diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index 2e5eac40..d2a09690 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -1,6 +1,10 @@ # Reformatting commits to be skipped when running 'git blame' # Use `git config --global blame.ignoreRevsFile .git-blame-ignore-revs` to use it # Add new reformatting commits at the top +99b6fc33b508c879f669172005b6c359d7d4f596 + +7485c7f2ce726f59f1ec66ddfe1d3f7d640201d8 + f9fc1a8e8b0b2dcbf5361f95ca778df63ac4e247 f17875f90e07688f683e5ea6e880c57ded640a81 diff --git a/.gitattributes b/.gitattributes index 9f7be242..82ff46c5 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2,7 +2,14 @@ *.mld linguist-documentation *.md linguist-documentation *.hints linguist-generated + french_law/js/french_law.js binary linguist-generated + french_law/ocaml/law_source/allocations_familiales.ml binary linguist-generated +french_law/ocaml/law_source/allocations_familiales_api_web.ml binary linguist-generated french_law/ocaml/law_source/unit_tests/tests_allocations_famiales.ml binary linguist-generated french_law/python/src/allocations_familiales.py binary linguist-generated + +french_law/ocaml/law_source/aides_logement.ml binary linguist-generated +french_law/ocaml/law_source/aides_logement_api_web.ml binary linguist-generated +french_law/python/src/aides_logement.py binary linguist-generated diff --git a/.github/workflows/run-builds.yml b/.github/workflows/run-builds.yml index 92c89c9f..8f37edf4 100644 --- a/.github/workflows/run-builds.yml +++ b/.github/workflows/run-builds.yml @@ -6,34 +6,6 @@ on: workflow_dispatch: jobs: - build-ubuntu: - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Set up OCaml - uses: avsm/setup-ocaml@v2 - with: - ocaml-compiler: 4.11.x - dune-cache: true - - - name: Install external dependencies - run: | - sudo apt-get update && sudo apt-get install python3-dev virtualenv \ - python3-setuptools python3-pip python3-pygments man2html rsync \ - colordiff npm nodejs libmpc-dev ninja-build pandoc - sudo python3 -m pip install --upgrade pip - sudo python3 -m pip install virtualenv - sudo make pygments - ./french_law/python/setup_env.sh - - name: Install OCaml dependencies - run: | - make dependencies-ocaml-with-z3 - - name: Make build - run: | - OCAMLRUNPARAM=b opam exec -- make build - build-nix-flake: runs-on: ubuntu-latest steps: diff --git a/.github/workflows/run-make-all.yml b/.github/workflows/run-make-all.yml index 559dd7e4..fce8ac0e 100644 --- a/.github/workflows/run-make-all.yml +++ b/.github/workflows/run-make-all.yml @@ -11,26 +11,38 @@ jobs: # The type of runner that the job will run on runs-on: self-hosted + env: + IMAGE_TAG: ${{ github.head_ref || github.ref_name }} + # Steps represent a sequence of tasks that will be executed as part of the job steps: - name: Checkout code uses: actions/checkout@v2 - - name: Re-initialize python dependencies + with: + fetch-depth: 0 + - name: Prepare container with all dependencies + run: git archive HEAD | docker build - --target dev-build-context + - name: Run builds, checks and tests + run: git archive HEAD | docker build - --force-rm -t catalalang/catala-build:${IMAGE_TAG} + - name: Cleanup Docker image + if: ${{ github.ref != 'refs/heads/master' }} + run: docker image rm catalalang/catala-build:${IMAGE_TAG} + - name: Build architecture-independent artifacts + if: ${{ github.ref == 'refs/heads/master' }} run: | - ./french_law/python/setup_env.sh - - name: Install dependencies - run: | - opam exec -- make dependencies pygments - - name: Check promoted files - run: | - opam exec -- make check-promoted > promotion.out 2>&1 || touch bad-promote - - name: Make all - run: | - OCAMLRUNPARAM=b opam exec -- make all - - name: Forward result from promotion check - run: | - if [ -e bad-promote ]; then - echo "[ERROR] Some promoted files were not up-to-date"; - cat promotion.out; - exit 1 - fi + RELEASE_TAG=$(git describe --tags) + mkdir -p artifacts + docker run --rm catalalang/catala-build:${IMAGE_TAG} sh -uexc ' + opam --cli=2.1 exec -- dune build --profile=release french_law compiler/catala.bc.js >&2 + mv _build/default/compiler/catala.bc.js catala_'"${RELEASE_TAG}"'_node.js >&2 + tar c -h catala_'"${RELEASE_TAG}"'_node.js french_law --exclude french_law/js/node_modules --exclude french_law/python/env --exclude '"'"'.*'"'"' + ' | tar vx -C artifacts + - name: Build static binaries + if: ${{ github.ref == 'refs/heads/master' }} + run: ./build_release.sh -C artifacts + - name: Publish artifacts + if: ${{ github.ref == 'refs/heads/master' }} + uses: actions/upload-artifact@v3 + with: + name: Catala artifacts + path: artifacts/* diff --git a/.gitignore b/.gitignore index c0695813..a049b6ca 100644 --- a/.gitignore +++ b/.gitignore @@ -10,5 +10,6 @@ legifrance_oauth* *.html .vscode/ .ninja_* +node_modules/ build.ninja diff --git a/.nix/catala.nix b/.nix/catala.nix index 42ca321d..deeaf985 100644 --- a/.nix/catala.nix +++ b/.nix/catala.nix @@ -1,29 +1,29 @@ { lib -, pkgs -, fetchFromGitHub -, buildDunePackage +, alcotest , ansiterminal -, sedlex -, menhir -, unionfind -, bindlib -, cmdliner_1_1_0 -, re -, zarith -, zarith_stubs_js -, ocamlgraph -, calendar -, visitors , benchmark +, bindlib +, buildDunePackage +, calendar +, cmdliner_1_1_0 +, cppo +, fetchFromGitHub , js_of_ocaml , js_of_ocaml-ppx -, camomile -, cppo -, ppx_deriving -, z3 -, alcotest -, ppx_yojson_conv +, menhir , menhirLib ? null #for nixos-unstable compatibility. +, ocamlgraph +, pkgs +, ppx_deriving +, ppx_yojson_conv +, re +, sedlex +, ubase +, unionfind +, visitors +, z3 +, zarith +, zarith_stubs_js }: buildDunePackage rec { @@ -37,34 +37,30 @@ buildDunePackage rec { useDune2 = true; propagatedBuildInputs = [ + alcotest ansiterminal - sedlex - menhir - menhirLib - cmdliner_1_1_0 - re - zarith - zarith_stubs_js - ocamlgraph - calendar - visitors benchmark + bindlib + calendar + camomile + cmdliner_1_1_0 + cppo js_of_ocaml js_of_ocaml-ppx - ppx_yojson_conv - camomile - cppo - z3 - - + menhir + menhirLib + ocamlgraph pkgs.z3 - ppx_deriving - - alcotest - + ppx_yojson_conv + re + sedlex + ubase unionfind - bindlib + visitors + z3 + zarith + zarith_stubs_js ] ++ (if isNull menhirLib then [ ] else [ menhirLib ]); doCheck = true; diff --git a/.ocamlformat b/.ocamlformat index e8450b9a..f538edb1 100644 --- a/.ocamlformat +++ b/.ocamlformat @@ -9,3 +9,5 @@ cases-exp-indent=2 indicate-multiline-delimiters=no parens-tuple=multi-line-only space-around-lists=false +break-infix-before-func +break-infix= fit-or-vertical diff --git a/Dockerfile b/Dockerfile index cf366bf6..acbf0658 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,54 @@ -FROM ocaml/opam:ubuntu-lts-ocaml-4.12 +# Stage 1: setup an opam switch with all dependencies installed +# (only depends on the opam files) +FROM ocamlpro/ocaml:4.14-2022-07-17 AS dev-build-context -RUN sudo apt-get update && sudo apt-get install -y \ - man2html \ - colordiff \ - latexmk \ - python3 \ - python3-pip \ - libgmp-dev \ - npm \ - nodejs +# pandoc is 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/testing/ -RUN sudo pip3 install virtualenv +RUN mkdir catala +WORKDIR catala + +# Get only the opam files at this stage to allow caching +ADD --chown=ocaml:ocaml *.opam ./ + +# trigger the selection of catala dev tools in opam +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 && \ + 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 && \ + opam clean +# Note: just one `opam switch create .` command should be enough once opam 2.1.3 is released (opam#5047 ; opam#5185) + + +# Stage 2: get the whole repo, run checks and builds +FROM dev-build-context + +# Get the full repo +ADD --chown=ocaml:ocaml . . + +# Prepare extra local dependencies +RUN opam exec -- make pygments dependencies-js +RUN opam exec -- ./french_law/python/setup_env.sh + +# OCaml backtraces may be useful on failure +ENV OCAMLRUNPARAM=b + +# Check promoted files (but delay failure) +RUN opam exec -- make check-promoted > promotion.out 2>&1 || touch bad-promote + +# Check the build +RUN opam exec -- make build + +# Check tests & all alt targets +RUN OCAMLRUNPARAM=b opam exec -- make all -B + +# Forward results of promotion check +RUN if [ -e bad-promote ]; then \ + echo "[ERROR] Some promoted files were not up-to-date"; \ + cat promotion.out; \ + exit 1; \ +fi diff --git a/INSTALL.md b/INSTALL.md index 662ce87a..c2914e33 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -11,11 +11,11 @@ Start by installing Docker: https://docs.docker.com/get-docker/ Then build the Docker image: - docker build . -t catala + docker build . --target dev-build-context -t catala -Finally, start a `bash` shell inside a new container created from the newly built image: +Finally, start a shell inside a new container created from the newly built image: - docker run -it -v $PWD:$PWD -w $PWD --name catala catala bash + docker run -it --name catala catala ### With nix @@ -41,18 +41,20 @@ OCaml's distribution and package manager. Follow the [instructions on the `opam` website](https://opam.ocaml.org/doc/Install.html). Next, you will need to use the correct version of OCaml. Catala has been tested -with OCaml compiler versions that are at least 4.12.0. To switch to OCaml 4.12.0., +with OCaml compiler versions that are at least 4.13.0. To switch to OCaml 4.13.0., just use: - opam switch 4.12.0 + opam switch 4.13.0 -If you get a `No switch 4.12.0 is currently installed` error message, follow -the hint and enter `opam switch create 4.12.0`. +If you get a `No switch 4.13.0 is currently installed` error message, follow +the hint and enter `opam switch create 4.13.0`. ## Dependencies -Next, install all the OCaml packages that Catala depend on, as well as some -git submodules, with +You can skip this step if you used the *Docker* option above, it is already taken +care of. + +Next, install all the packages that Catala depends on with make dependencies @@ -61,23 +63,13 @@ This should ensure everything is set up for developing on the Catala compiler! **Warning**: this command does not include the `z3` dependency required to enable the proof platform feature of Catala. If you wish to enable support for the proof platform and the `Proof` command of the Catala compiler, you should -instead execute `make dependencies-with-ocaml` prior to building the compiler. +instead execute `make dependencies-with-z3` prior to building the compiler. Other features of the Catala repository also require the following executables -to be present +to be present. On debian, arch or apline-based distributions, the above command +should already take care of them. - man2html virtualenv python3 pip rsync colordiff pygmentize nodejs npm - -please install them if they're not here, otherwise you will get some errors. -On a Debian distribution, this can be -done with - - sudo apt install python3-dev virtualenv python3-setuptools python3-pip python3-pygments man2html rsync colordiff npm nodejs libmpc-dev ninja-build - sudo python3 -m pip install --upgrade pip - -On ArchLinux : - - sudo pacman -S python-virtualenv man2html rsync colordiff nodejs npm + groff virtualenv python3 pip rsync colordiff pygmentize nodejs npm ## Build @@ -112,7 +104,7 @@ Catala website. ./generate_website_assets.sh /assets -You will need the `man2html` executable to generate the HTML versions of the man +You will need the `groff` executable to generate the HTML versions of the man pages, as well as the `rsync` executable to transfer files (preferred to `cp`) because it also works with a remote server. diff --git a/Makefile b/Makefile index c754010d..5d04b89a 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,8 @@ help : Makefile ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST)))) +export DUNE_PROFILE ?= release + # Export all variables to sub-make export @@ -10,28 +12,30 @@ export # Dependencies ########################################## -EXECUTABLES = man2html python3 colordiff node pygmentize node npm ninja pandoc +EXECUTABLES = groff python3 colordiff node pygmentize node npm ninja pandoc K := $(foreach exec,$(EXECUTABLES),\ $(if $(shell which $(exec)),some string,$(warning [WARNING] No "$(exec)" executable found. \ Please install this executable for everything to work smoothly))) +OPAM = opam --cli=2.1 + dependencies-ocaml: - opam install . ./doc/catala-dev-dependencies.opam --deps-only --with-doc --with-test --yes + $(OPAM) pin . --no-action + OPAMVAR_cataladevmode=1 $(OPAM) install . --with-doc --with-test --update-invariant --depext-only + OPAMVAR_cataladevmode=1 $(OPAM) install . --with-doc --with-test --update-invariant --deps-only dependencies-ocaml-with-z3: - opam install . ./doc/catala-dev-dependencies.opam z3 --deps-only --with-doc --with-test --yes + $(OPAM) pin . --no-action + OPAMVAR_cataladevmode=1 OPAMVAR_catalaz3mode=1 $(OPAM) install . --with-doc --with-test --update-invariant --depext-only + OPAMVAR_cataladevmode=1 OPAMVAR_catalaz3mode=1 $(OPAM) install . --with-doc --with-test --update-invariant --deps-only dependencies-js: $(MAKE) -C $(FRENCH_LAW_JS_LIB_DIR) dependencies -init-submodules: - git submodule update --init - - #> dependencies : Install the Catala OCaml, JS and Git dependencies -dependencies: dependencies-ocaml dependencies-js init-submodules +dependencies: dependencies-ocaml dependencies-js -dependencies-with-z3: dependencies-ocaml-with-z3 dependencies-js init-submodules +dependencies-with-z3: dependencies-ocaml-with-z3 dependencies-js ########################################## # Catala compiler rules @@ -42,16 +46,18 @@ BUILD_SYSTEM_DIR=build_system #> build_dev : Builds the Catala compiler, without formatting code build_dev: parser-messages - dune build $(COMPILER_DIR)/catala.exe $(BUILD_SYSTEM_DIR)/clerk.exe + dune build \ + $(COMPILER_DIR)/catala.exe \ + $(COMPILER_DIR)/plugins/ \ + $(BUILD_SYSTEM_DIR)/clerk.exe #> build : Builds the Catala compiler -build: parser-messages format - dune build $(COMPILER_DIR)/catala.exe $(BUILD_SYSTEM_DIR)/clerk.exe +build: parser-messages format build_dev #> js_build : Builds the Web-compatible JS versions of the Catala compiler js_build: - dune build $(COMPILER_DIR)/catala.bc.js --profile release - dune build $(COMPILER_DIR)/catala_web_interpreter.bc.js --profile release + dune build $(COMPILER_DIR)/catala.bc.js + dune build $(COMPILER_DIR)/catala_web_interpreter.bc.js #> doc : Generates the HTML OCaml documentation doc: @@ -61,8 +67,12 @@ doc: install: dune build @install -#> plugins : Builds the demonstration plugins -plugins: +#> runtimes : Builds the OCaml and js_of_ocaml runtimes +runtimes: + dune build runtimes/ + +#> plugins : Builds the compiler backend plugins +plugins: runtimes dune build compiler/plugins/ @echo "define CATALA_PLUGINS=_build/default/compiler/plugins to test the plugins" @@ -74,11 +84,11 @@ check-promoted: dune build @update-parser-messages @fmt compiler/surface/parser.messages: compiler/surface/tokens.mly compiler/surface/parser.mly - dune build @update-parser-messages --auto-promote || true + -dune build @update-parser-messages --auto-promote parser-messages: compiler/surface/parser.messages format: - dune build @fmt --auto-promote 2>/dev/null || true + -dune build @fmt --auto-promote 2>/dev/null ########################################## # Syntax highlighting rules @@ -188,32 +198,44 @@ literate_examples: literate_allocations_familiales literate_code_general_impots # OCaml #----------------------------------------- -FRENCH_LAW_OCAML_LIB_DIR=french_law/ocaml +FRENCH_LAW_OCAML_LIB_DIR = french_law/ocaml -$(FRENCH_LAW_OCAML_LIB_DIR)/law_source/allocations_familiales.ml: - CATALA_OPTS="$(CATALA_OPTS) -t" $(MAKE) -C $(ALLOCATIONS_FAMILIALES_DIR) allocations_familiales.ml - cp -f $(ALLOCATIONS_FAMILIALES_DIR)/allocations_familiales.ml $@ +FRENCH_LAW_LIBRARY_OCAML = \ + $(FRENCH_LAW_OCAML_LIB_DIR)/law_source/allocations_familiales_api_web.ml \ + $(FRENCH_LAW_OCAML_LIB_DIR)/law_source/unit_tests/tests_allocations_familiales.ml \ + $(FRENCH_LAW_OCAML_LIB_DIR)/law_source/aides_logement_api_web.ml -$(FRENCH_LAW_OCAML_LIB_DIR)/law_source/unit_tests/tests_allocations_familiales.ml: - CATALA_OPTS="$(CATALA_OPTS) -t" $(MAKE) -C $(ALLOCATIONS_FAMILIALES_DIR) tests/tests_allocations_familiales.ml - cp -f $(ALLOCATIONS_FAMILIALES_DIR)/tests/tests_allocations_familiales.ml $@ +$(addprefix _build/default/,$(FRENCH_LAW_LIBRARY_OCAML)) : + dune build $@ #> generate_french_law_library_ocaml : Generates the French law library OCaml sources from Catala -generate_french_law_library_ocaml:\ - $(FRENCH_LAW_OCAML_LIB_DIR)/law_source/allocations_familiales.ml \ - $(FRENCH_LAW_OCAML_LIB_DIR)/law_source/unit_tests/tests_allocations_familiales.ml - $(MAKE) format +generate_french_law_library_ocaml: + dune build $(FRENCH_LAW_LIBRARY_OCAML) #> build_french_law_library_ocaml : Builds the OCaml French law library -build_french_law_library_ocaml: generate_french_law_library_ocaml format +build_french_law_library_ocaml: dune build $(FRENCH_LAW_OCAML_LIB_DIR)/api.a -run_french_law_library_benchmark_ocaml: generate_french_law_library_ocaml +run_french_law_library_benchmark_ocaml: dune exec --profile release $(FRENCH_LAW_OCAML_LIB_DIR)/bench.exe -run_french_law_library_ocaml_tests: build_french_law_library_ocaml +run_french_law_library_ocaml_tests: dune exec $(FRENCH_LAW_OCAML_LIB_DIR)/law_source/unit_tests/run_tests.exe +#----------------------------------------- +# JSON schemas +#----------------------------------------- + +JSON_SCHEMAS = \ + $(AIDES_LOGEMENT_DIR)/aides_logement_schema.json \ + $(ALLOCATIONS_FAMILIALES_DIR)/allocations_familiales_schema.json + +#> generate_french_law_json_schemas : Generates the French law library JSON schemas +$(addprefix _build/default/,$(JSON_SCHEMAS)): + dune build $@ + +generate_french_law_json_schemas: + dune build $(JSON_SCHEMAS) #----------------------------------------- # JS @@ -225,10 +247,11 @@ run_french_law_library_benchmark_js: build_french_law_library_js $(MAKE) -C $(FRENCH_LAW_JS_LIB_DIR) bench #> build_french_law_library_js : Builds the JS version of the OCaml French law library -build_french_law_library_js: generate_french_law_library_ocaml format - dune build --profile release $(FRENCH_LAW_OCAML_LIB_DIR)/api_web.bc.js - cp -f $(ROOT_DIR)/_build/default/$(FRENCH_LAW_OCAML_LIB_DIR)/api_web.bc.js $(FRENCH_LAW_JS_LIB_DIR)/french_law.js +build_french_law_library_js: + dune build $(FRENCH_LAW_JS_LIB_DIR)/french_law.js +#> build_french_law_library_web_api : Builds the web API of the French law library +build_french_law_library_web_api: build_french_law_library_js generate_french_law_json_schemas #----------------------------------------- # Python @@ -236,23 +259,31 @@ build_french_law_library_js: generate_french_law_library_ocaml format FRENCH_LAW_PYTHON_LIB_DIR=french_law/python -$(FRENCH_LAW_PYTHON_LIB_DIR)/src/allocations_familiales.py: - CATALA_OPTS="$(CATALA_OPTS) -O -t" $(MAKE) -C $(ALLOCATIONS_FAMILIALES_DIR) allocations_familiales.py - cp -f $(ALLOCATIONS_FAMILIALES_DIR)/allocations_familiales.py $@ +FRENCH_LAW_LIBRARY_PYTHON = \ + $(FRENCH_LAW_PYTHON_LIB_DIR)/src/allocations_familiales.py \ + $(FRENCH_LAW_PYTHON_LIB_DIR)/src/aides_logement.py + +PY_VIRTUALENV = $(FRENCH_LAW_PYTHON_LIB_DIR)/env/bin/activate + +$(PY_VIRTUALENV): + @$(if $(wildcard $(PY_VIRTUALENV)),,$(error "Python virtualenv not initialised, you need to run $(FRENCH_LAW_PYTHON_LIB_DIR)/setup_env.sh")) + +$(FRENCH_LAW_LIBRARY_PYTHON): + dune build $@ #> generate_french_law_library_python : Generates the French law library Python sources from Catala -generate_french_law_library_python:\ - $(FRENCH_LAW_PYTHON_LIB_DIR)/src/allocations_familiales.py - . $(FRENCH_LAW_PYTHON_LIB_DIR)/env/bin/activate ;\ - $(MAKE) -C $(FRENCH_LAW_PYTHON_LIB_DIR) format +generate_french_law_library_python: + dune build $(FRENCH_LAW_LIBRARY_PYTHON) #> type_french_law_library_python : Types the French law library Python sources with mypy -type_french_law_library_python: generate_french_law_library_python - . $(FRENCH_LAW_PYTHON_LIB_DIR)/env/bin/activate ;\ +type_french_law_library_python: $(PY_VIRTUALENV) \ + generate_french_law_library_python + . $(PY_VIRTUALENV) ;\ $(MAKE) -C $(FRENCH_LAW_PYTHON_LIB_DIR) type -run_french_law_library_benchmark_python: type_french_law_library_python - . $(FRENCH_LAW_PYTHON_LIB_DIR)/env/bin/activate ;\ +run_french_law_library_benchmark_python: $(PY_VIRTUALENV) \ + type_french_law_library_python + . $(PY_VIRTUALENV) ;\ $(MAKE) -C $(FRENCH_LAW_PYTHON_LIB_DIR) bench ########################################## @@ -272,10 +303,10 @@ CLERK=$(CLERK_BIN) --exe $(CATALA_BIN) \ .FORCE: test_suite: .FORCE - $(CLERK) test tests + OCAMLRUNPARAM= $(CLERK) test tests test_examples: .FORCE - $(CLERK) test examples + OCAMLRUNPARAM= $(CLERK) test examples #> tests : Run interpreter tests tests: test_suite test_examples @@ -299,15 +330,14 @@ tests/%: .FORCE # Website assets ########################################## -grammar.html: $(COMPILER_DIR)/surface/parser.mly - obelisk html -o $@ $< +WEBSITE_ASSETS = grammar.html catala.html -catala.html: $(COMPILER_DIR)/utils/cli.ml - dune exec $(COMPILER_DIR)/catala.exe -- --help=groff | man2html | sed -e '1,8d' \ - | tac | sed "1,20d" | tac > $@ +$(addprefix _build/default/,$(WEBSITE_ASSETS)): + dune build $@ #> website-assets : Builds all the assets necessary for the Catala website -website-assets: doc js_build literate_examples grammar.html catala.html build_french_law_library_js +website-assets: js_build literate_examples build_french_law_library_web_api doc + dune build $(WEBSITE_ASSETS) ########################################## # Misceallenous @@ -315,20 +345,23 @@ website-assets: doc js_build literate_examples grammar.html catala.html build_fr #> all : Run all make commands all: \ - build js_build doc website-assets\ + build js_build doc \ tests \ + runtimes \ plugins \ generate_french_law_library_ocaml build_french_law_library_ocaml \ tests_ocaml bench_ocaml \ build_french_law_library_js \ bench_js \ - generate_french_law_library_python type_french_law_library_python\ - bench_python + generate_french_law_library_python type_french_law_library_python \ + bench_python \ + website-assets #> clean : Clean build artifacts clean: dune clean + rm -rf artifacts $(MAKE) -C $(ALLOCATIONS_FAMILIALES_DIR) clean $(MAKE) -C $(US_TAX_CODE_DIR) clean $(MAKE) -C $(TUTORIEL_FR_DIR) clean @@ -350,6 +383,12 @@ help_catala: ########################################## # Special targets ########################################## -.PHONY: inspect clean all literate_examples english allocations_familiales pygments \ - install build_dev build doc format dependencies dependencies-ocaml \ - catala.html help parser-messages plugins +.PHONY: inspect clean all literate_examples english allocations_familiales \ + pygments install build_dev build doc format dependencies \ + dependencies-ocaml catala.html help parser-messages plugins \ + generate_french_law_json_schemas generate_french_law_library_python \ + generate_french_law_library_ocaml \ + run_french_law_library_benchmark_python \ + run_french_law_library_benchmark_js run_french_law_library_ocaml_tests \ + build_french_law_library_js build_french_law_library_web_api \ + build_french_law_library_ocaml diff --git a/build_release.sh b/build_release.sh new file mode 100755 index 00000000..a4063fab --- /dev/null +++ b/build_release.sh @@ -0,0 +1,46 @@ +#! /usr/bin/env sh + +set -ue + +RELEASE_TAG=${RELEASE_TAG:-$(git describe --tags 2>/dev/null || echo dev)} + +BIN_TAG=${BIN_TAG:-$(uname -s)_$(uname -m)} + +CUSTOM_LINKING_CATALA_Z3="\ +(-cclib -static + -cclib -no-pie + -noautolink + -cclib -L/home/ocaml/.opam/z3/lib/stublibs + -cclib -lz3ml-static + -cclib -lz3 + -cclib -lstdc++ + -cclib -lthreadsnat + -cclib -lzarith + -cclib -lgmp + -cclib -lcamlstr + -cclib -lANSITerminal_stubs + -cclib -lunix)" + +CUSTOM_LINKING_CATALA_NOZ3="(-cclib -static -cclib -no-pie)" + +CUSTOM_LINKING_CLERK="(-cclib -static -cclib -no-pie)" + +git archive HEAD --prefix catala/ | \ +docker run --rm -i registry.gitlab.inria.fr/lgesbert/catala-ci-images:ocaml.4.14-z3static.4.10.1 \ + sh -uexc \ + '{ tar x && + cd catala && + echo "'"${CUSTOM_LINKING_CATALA_Z3}"'" >compiler/custom_linking.sexp && + echo "'"${CUSTOM_LINKING_CLERK}"'" >build_system/custom_linking.sexp && + opam --cli=2.1 install ./ninja_utils.opam ./clerk.opam ./catala.opam --destdir ../release.out/ && + mv ../release.out/bin/catala ../release.out/bin/catala-z3 && + opam --cli=2.1 remove z3 catala && + echo "'"${CUSTOM_LINKING_CATALA_NOZ3}"'" >compiler/custom_linking.sexp && + opam --cli=2.1 install ./catala.opam --destdir ../release.out/ && + rm -f ../release.out/bin/catala_web_interpreter && + for f in ../release.out/bin/*; do + strip ${f}; + mv ${f} ${f}_'"${RELEASE_TAG}"'_'"${BIN_TAG}"'; + done; + } >&2 && tar c -hC ../release.out/bin .' | +tar vx "$@" diff --git a/build_system/clerk_driver.ml b/build_system/clerk_driver.ml index 9311e9d9..cc33bc5b 100644 --- a/build_system/clerk_driver.ml +++ b/build_system/clerk_driver.ml @@ -24,7 +24,8 @@ module Nj = Ninja_utils let files_or_folders = Arg.( - non_empty & pos_right 0 file [] + non_empty + & pos_right 0 file [] & info [] ~docv:"FILE(S)" ~doc:"File(s) or folder(s) to process") let command = @@ -38,7 +39,8 @@ let debug = let reset_test_outputs = Arg.( - value & flag + value + & flag & info ["r"; "reset"] ~doc: "Used with the `test` command, resets the test output to whatever is \ @@ -88,8 +90,16 @@ let catala_opts = let clerk_t f = Term.( - const f $ files_or_folders $ command $ catalac $ catala_opts $ makeflags - $ debug $ scope $ reset_test_outputs $ ninja_output) + const f + $ files_or_folders + $ command + $ catalac + $ catala_opts + $ makeflags + $ debug + $ scope + $ reset_test_outputs + $ ninja_output) let version = "0.5.0" @@ -336,7 +346,8 @@ let collect_all_ninja_build let expected_output_file = expected_output.output_dir ^ Filename.basename expected_output.tested_filename - ^ "." ^ expected_output.id + ^ "." + ^ expected_output.id in let vars = [ @@ -392,7 +403,8 @@ let add_root_test_build (all_file_names : string list) (all_test_builds : string) : ninja = let file_names_str = - List.hd all_file_names ^ "" + List.hd all_file_names + ^ "" ^ List.fold_left (fun acc name -> acc ^ "; " ^ name) "" (List.tl all_file_names) @@ -440,9 +452,11 @@ let get_catala_files_in_folder (dir : string) : string list = false in if f_is_dir then - readdir_sort f |> Array.to_list + readdir_sort f + |> Array.to_list |> List.map (Filename.concat f) - |> List.append fs |> loop result + |> List.append fs + |> loop result else loop (f :: result) fs | [] -> result in @@ -647,7 +661,9 @@ let driver Nj.format fmt (add_root_test_build ninja ctx.all_file_names ctx.all_test_builds)); - let ninja_cmd = "ninja " ^ ninja_flags ^ " test -f " ^ ninja_output in + let ninja_cmd = + "ninja -f " ^ ninja_output ^ " " ^ ninja_flags ^ " test" + in Cli.debug_print "executing '%s'..." ninja_cmd; Sys.command ninja_cmd with Sys_error e -> diff --git a/build_system/dune b/build_system/dune index fafeb9ce..c1ffbcba 100644 --- a/build_system/dune +++ b/build_system/dune @@ -7,12 +7,29 @@ (library (name clerk_driver) (public_name clerk.driver) - (libraries catala.runtime catala.utils ninja_utils cmdliner re ANSITerminal) + (libraries + catala.runtime_ocaml + catala.utils + ninja_utils + cmdliner + re + ANSITerminal) (modules clerk_driver)) +(rule + (target custom_linking.sexp) + (mode fallback) + (action + (with-stdout-to + %{target} + (echo "()")))) + (executable (name clerk) (public_name clerk) + (flags + (:standard + (:include custom_linking.sexp))) (libraries clerk.driver) (modules clerk) (package clerk)) diff --git a/catala.opam b/catala.opam index b0b75678..619217aa 100644 --- a/catala.opam +++ b/catala.opam @@ -18,28 +18,34 @@ license: "Apache-2.0" homepage: "https://github.com/CatalaLang/catala" bug-reports: "https://github.com/CatalaLang/catala/issues" depends: [ - "dune" {>= "2.8"} - "ocaml" {>= "4.11.0"} "ANSITerminal" {>= "0.8.2"} - "sedlex" {>= "2.4"} - "menhir" {>= "20200211"} - "menhirLib" {>= "20200211"} - "unionFind" {>= "20200320"} + "benchmark" {>= "1.6"} "bindlib" {>= "5.0.1"} "cmdliner" {>= "1.1.0"} - "re" {>= "1.9.0"} - "zarith" {>= "1.12"} - "zarith_stubs_js" {>= "v0.14.1"} - "ocamlgraph" {>= "1.8.8"} - "visitors" {>= "20200210"} - "benchmark" {>= "1.6"} - "js_of_ocaml-ppx" {>= "3.8.0"} - "ppx_yojson_conv" {>= "0.14.0"} - "camomile" {>= "1.0.2"} "cppo" {>= "1"} "dates_calc" {>= "0.0.2"} + "dune" {>= "2.8"} + "js_of_ocaml-ppx" {>= "3.8.0"} + "menhir" {>= "20200211"} + "menhirLib" {>= "20200211"} + "ocaml" {>= "4.13.0"} + "ocamlfind" {!= "1.9.5"} + "ocamlgraph" {>= "1.8.8"} + "ppx_yojson_conv" {>= "0.14.0"} + "re" {>= "1.9.0"} + "sedlex" {>= "2.4"} + "ubase" {>= "0.05"} + "unionFind" {>= "20200320"} + "visitors" {>= "20200210"} + "zarith" {>= "1.12"} + "zarith_stubs_js" {>= "v0.14.1"} "alcotest" {with-test & >= "1.5.0"} "odoc" {with-doc} + "ocamlformat" {cataladevmode & = "0.21.0"} + "obelisk" {cataladevmode} + "conf-npm" {cataladevmode} + "conf-python-3-dev" {cataladevmode} + "z3" {catalaz3mode} ] depopts: ["z3"] conflicts: [ @@ -60,3 +66,11 @@ build: [ ] ] dev-repo: "git+https://github.com/CatalaLang/catala.git" +depexts: [ + ["groff" "colordiff" "latexmk" "python3-pip" "pandoc"] + {cataladevmode & os-family = "debian"} + ["groff" "colordiff" "texlive" "py3-pip" "py3-pygments"] + {cataladevmode & os-distribution = "alpine"} + ["groff" "colordiff" "latex-mk" "python-pygments" "pandoc"] + {cataladevmode & os-family = "arch"} +] diff --git a/clerk.opam b/clerk.opam index 0b3976b3..e5369c8e 100644 --- a/clerk.opam +++ b/clerk.opam @@ -35,4 +35,7 @@ build: [ ] ] dev-repo: "git+https://github.com/CatalaLang/catala.git" -depexts: ["ninja-build"] {os-family = "debian"} +depexts: [ + ["ninja-build"] {os-family = "debian"} + ["samurai"] {os-distribution = "alpine"} +] diff --git a/compiler/catala_web_interpreter.ml b/compiler/catala_web_interpreter.ml index 1e0f8e54..c4089647 100644 --- a/compiler/catala_web_interpreter.ml +++ b/compiler/catala_web_interpreter.ml @@ -13,7 +13,7 @@ let _ = (Contents (Js.to_string contents)) { Utils.Cli.debug = false; - unstyled = false; + color = Never; wrap_weaved_output = false; avoid_exceptions = false; backend = "Interpret"; diff --git a/compiler/dcalc/ast.ml b/compiler/dcalc/ast.ml index c50958a9..dd36e835 100644 --- a/compiler/dcalc/ast.ml +++ b/compiler/dcalc/ast.ml @@ -18,6 +18,7 @@ [@@@ocaml.warning "-7-34"] open Utils +module Runtime = Runtime_ocaml.Runtime module ScopeName : Uid.Id with type info = Uid.MarkedString.info = Uid.Make (Uid.MarkedString) () @@ -39,15 +40,15 @@ module EnumConstructor : Uid.Id with type info = Uid.MarkedString.info = module EnumMap : Map.S with type key = EnumName.t = Map.Make (EnumName) type typ_lit = TBool | TUnit | TInt | TRat | TMoney | TDate | TDuration -type struct_name = StructName.t -type enum_name = EnumName.t -type typ = +type marked_typ = typ Marked.pos + +and typ = | TLit of typ_lit - | TTuple of typ Pos.marked list * struct_name option - | TEnum of typ Pos.marked list * enum_name - | TArrow of typ Pos.marked * typ Pos.marked - | TArray of typ Pos.marked + | TTuple of marked_typ list * StructName.t option + | TEnum of marked_typ list * EnumName.t + | TArrow of marked_typ * marked_typ + | TArray of marked_typ | TAny type date = Runtime.date @@ -95,36 +96,104 @@ type unop = | Log of log_entry * Utils.Uid.MarkedString.info list | Length | IntToRat + | MoneyToRat + | RatToMoney | GetDay | GetMonth | GetYear + | FirstDayOfMonth + | LastDayOfMonth | RoundMoney | RoundDecimal type operator = Ternop of ternop | Binop of binop | Unop of unop -type expr = - | EVar of expr Bindlib.var Pos.marked - | ETuple of expr Pos.marked list * struct_name option +(** Some structures used for type inference *) +module Infer = struct + module Any = + Utils.Uid.Make + (struct + type info = unit + + let format_info fmt () = Format.fprintf fmt "any" + end) + () + + type unionfind_typ = typ Marked.pos UnionFind.elem + (** We do not reuse {!type: Dcalc.Ast.typ} because we have to include a new + [TAny] variant. Indeed, error terms can have any type and this has to be + captured by the type sytem. *) + + and typ = + | TLit of typ_lit + | TArrow of unionfind_typ * unionfind_typ + | TTuple of unionfind_typ list * StructName.t option + | TEnum of unionfind_typ list * EnumName.t + | TArray of unionfind_typ + | TAny of Any.t + + let rec typ_to_ast (ty : unionfind_typ) : marked_typ = + let ty, pos = UnionFind.get (UnionFind.find ty) in + match ty with + | TLit l -> TLit l, pos + | TTuple (ts, s) -> TTuple (List.map typ_to_ast ts, s), pos + | TEnum (ts, e) -> TEnum (List.map typ_to_ast ts, e), pos + | TArrow (t1, t2) -> TArrow (typ_to_ast t1, typ_to_ast t2), pos + | TAny _ -> TAny, pos + | TArray t1 -> TArray (typ_to_ast t1), pos + + let rec ast_to_typ (ty : marked_typ) : unionfind_typ = + let ty' = + match Marked.unmark ty with + | TLit l -> TLit l + | TArrow (t1, t2) -> TArrow (ast_to_typ t1, ast_to_typ t2) + | TTuple (ts, s) -> TTuple (List.map (fun t -> ast_to_typ t) ts, s) + | TEnum (ts, e) -> TEnum (List.map (fun t -> ast_to_typ t) ts, e) + | TArray t -> TArray (ast_to_typ t) + | TAny -> TAny (Any.fresh ()) + in + UnionFind.make (Marked.same_mark_as ty' ty) +end + +type untyped = { pos : Pos.t } [@@ocaml.unboxed] +type typed = { pos : Pos.t; ty : marked_typ } +type inferring = { pos : Pos.t; uf : Infer.unionfind_typ } + +(** The generic type of AST markings. Using a GADT allows functions to be + polymorphic in the marking, but still do transformations on types when + appropriate *) +type _ mark = + | Untyped : untyped -> untyped mark + | Typed : typed -> typed mark + | Inferring : inferring -> inferring mark + +type ('a, 'm) marked = ('a, 'm mark) Marked.t + +type 'm marked_expr = ('m expr, 'm) marked + +and 'm expr = + | EVar of 'm expr Bindlib.var + | ETuple of 'm marked_expr list * StructName.t option | ETupleAccess of - expr Pos.marked * int * struct_name option * typ Pos.marked list - | EInj of expr Pos.marked * int * enum_name * typ Pos.marked list - | EMatch of expr Pos.marked * expr Pos.marked list * enum_name - | EArray of expr Pos.marked list + 'm marked_expr * int * StructName.t option * typ Marked.pos list + | EInj of 'm marked_expr * int * EnumName.t * typ Marked.pos list + | EMatch of 'm marked_expr * 'm marked_expr list * EnumName.t + | EArray of 'm marked_expr list | ELit of lit | EAbs of - (expr, expr Pos.marked) Bindlib.mbinder Pos.marked * typ Pos.marked list - | EApp of expr Pos.marked * expr Pos.marked list - | EAssert of expr Pos.marked + (('m expr, 'm marked_expr) Bindlib.mbinder[@opaque]) * typ Marked.pos list + | EApp of 'm marked_expr * 'm marked_expr list + | EAssert of 'm marked_expr | EOp of operator - | EDefault of expr Pos.marked list * expr Pos.marked * expr Pos.marked - | EIfThenElse of expr Pos.marked * expr Pos.marked * expr Pos.marked - | ErrorOnEmpty of expr Pos.marked + | EDefault of 'm marked_expr list * 'm marked_expr * 'm marked_expr + | EIfThenElse of 'm marked_expr * 'm marked_expr * 'm marked_expr + | ErrorOnEmpty of 'm marked_expr -type struct_ctx = (StructFieldName.t * typ Pos.marked) list StructMap.t -type enum_ctx = (EnumConstructor.t * typ Pos.marked) list EnumMap.t +type typed_expr = typed marked_expr +type struct_ctx = (StructFieldName.t * typ Marked.pos) list StructMap.t +type enum_ctx = (EnumConstructor.t * typ Marked.pos) list EnumMap.t type decl_ctx = { ctx_enums : enum_ctx; ctx_structs : struct_ctx } -type binder = (expr, expr Pos.marked) Bindlib.binder +type 'm binder = ('m expr, 'm marked_expr) Bindlib.binder type scope_let_kind = | DestructuringInputStruct @@ -134,173 +203,158 @@ type scope_let_kind = | DestructuringSubScopeResults | Assertion -type 'expr scope_let = { +type ('expr, 'm) scope_let = { scope_let_kind : scope_let_kind; - scope_let_typ : typ Utils.Pos.marked; - scope_let_expr : 'expr Utils.Pos.marked; - scope_let_next : ('expr, 'expr scope_body_expr) Bindlib.binder; - scope_let_pos : Utils.Pos.t; + scope_let_typ : typ Marked.pos; + scope_let_expr : ('expr, 'm) marked; + scope_let_next : ('expr, ('expr, 'm) scope_body_expr) Bindlib.binder; + scope_let_pos : Pos.t; } -and 'expr scope_body_expr = - | Result of 'expr Utils.Pos.marked - | ScopeLet of 'expr scope_let +and ('expr, 'm) scope_body_expr = + | Result of ('expr, 'm) marked + | ScopeLet of ('expr, 'm) scope_let -type 'expr scope_body = { +type ('expr, 'm) scope_body = { scope_body_input_struct : StructName.t; scope_body_output_struct : StructName.t; - scope_body_expr : ('expr, 'expr scope_body_expr) Bindlib.binder; + scope_body_expr : ('expr, ('expr, 'm) scope_body_expr) Bindlib.binder; } -type 'expr scope_def = { +type ('expr, 'm) scope_def = { scope_name : ScopeName.t; - scope_body : 'expr scope_body; - scope_next : ('expr, 'expr scopes) Bindlib.binder; + scope_body : ('expr, 'm) scope_body; + scope_next : ('expr, ('expr, 'm) scopes) Bindlib.binder; } -and 'expr scopes = Nil | ScopeDef of 'expr scope_def +and ('expr, 'm) scopes = Nil | ScopeDef of ('expr, 'm) scope_def -type program = { decl_ctx : decl_ctx; scopes : expr scopes } +type ('expr, 'm) program_generic = { + decl_ctx : decl_ctx; + scopes : ('expr, 'm) scopes; +} -let evar (v : expr Bindlib.var) (pos : Pos.t) : expr Pos.marked Bindlib.box = - Bindlib.box_apply (fun v' -> v', pos) (Bindlib.box_var v) +type 'm program = ('m expr, 'm) program_generic -let etuple - (args : expr Pos.marked Bindlib.box list) - (s : StructName.t option) - (pos : Pos.t) : expr Pos.marked Bindlib.box = - Bindlib.box_apply (fun args -> ETuple (args, s), pos) (Bindlib.box_list args) +let no_mark (type m) : m mark -> m mark = function + | Untyped _ -> Untyped { pos = Pos.no_pos } + | Typed _ -> Typed { pos = Pos.no_pos; ty = Marked.mark Pos.no_pos TAny } + | Inferring _ -> + Inferring + { + pos = Pos.no_pos; + uf = UnionFind.make Infer.(TAny (Any.fresh ()), Pos.no_pos); + } -let etupleaccess - (e1 : expr Pos.marked Bindlib.box) - (i : int) - (s : StructName.t option) - (typs : typ Pos.marked list) - (pos : Pos.t) : expr Pos.marked Bindlib.box = - Bindlib.box_apply (fun e1 -> ETupleAccess (e1, i, s, typs), pos) e1 +let mark_pos (type m) (m : m mark) : Pos.t = + match m with + | Untyped { pos } | Typed { pos; _ } | Inferring { pos; _ } -> pos -let einj - (e1 : expr Pos.marked Bindlib.box) - (i : int) - (e_name : EnumName.t) - (typs : typ Pos.marked list) - (pos : Pos.t) : expr Pos.marked Bindlib.box = - Bindlib.box_apply (fun e1 -> EInj (e1, i, e_name, typs), pos) e1 +let pos (type m) (x : ('a, m) marked) : Pos.t = mark_pos (Marked.get_mark x) +let ty (_, m) : marked_typ = match m with Typed { ty; _ } -> ty -let ematch - (arg : expr Pos.marked Bindlib.box) - (arms : expr Pos.marked Bindlib.box list) - (e_name : EnumName.t) - (pos : Pos.t) : expr Pos.marked Bindlib.box = +let with_ty (type m) (ty : marked_typ) (x : ('a, m) marked) : ('a, typed) marked + = + Marked.mark + (match Marked.get_mark x with + | Untyped { pos } | Inferring { pos; _ } -> Typed { pos; ty } + | Typed m -> Typed { m with ty }) + (Marked.unmark x) + +let evar v mark = Bindlib.box_apply (Marked.mark mark) (Bindlib.box_var v) + +let etuple args s mark = + Bindlib.box_apply (fun args -> ETuple (args, s), mark) (Bindlib.box_list args) + +let etupleaccess e1 i s typs mark = + Bindlib.box_apply (fun e1 -> ETupleAccess (e1, i, s, typs), mark) e1 + +let einj e1 i e_name typs mark = + Bindlib.box_apply (fun e1 -> EInj (e1, i, e_name, typs), mark) e1 + +let ematch arg arms e_name mark = Bindlib.box_apply2 - (fun arg arms -> EMatch (arg, arms, e_name), pos) + (fun arg arms -> EMatch (arg, arms, e_name), mark) arg (Bindlib.box_list arms) -let earray (args : expr Pos.marked Bindlib.box list) (pos : Pos.t) : - expr Pos.marked Bindlib.box = - Bindlib.box_apply (fun args -> EArray args, pos) (Bindlib.box_list args) +let earray args mark = + Bindlib.box_apply (fun args -> EArray args, mark) (Bindlib.box_list args) -let elit (l : lit) (pos : Pos.t) : expr Pos.marked Bindlib.box = - Bindlib.box (ELit l, pos) +let elit l mark = Bindlib.box (ELit l, mark) -let eabs - (binder : (expr, expr Pos.marked) Bindlib.mbinder Bindlib.box) - (pos_binder : Pos.t) - (typs : typ Pos.marked list) - (pos : Pos.t) : expr Pos.marked Bindlib.box = - Bindlib.box_apply - (fun binder -> EAbs ((binder, pos_binder), typs), pos) - binder +let eabs binder typs mark = + Bindlib.box_apply (fun binder -> EAbs (binder, typs), mark) binder -let eapp - (e1 : expr Pos.marked Bindlib.box) - (args : expr Pos.marked Bindlib.box list) - (pos : Pos.t) : expr Pos.marked Bindlib.box = +let eapp e1 args mark = Bindlib.box_apply2 - (fun e1 args -> EApp (e1, args), pos) + (fun e1 args -> EApp (e1, args), mark) e1 (Bindlib.box_list args) -let eassert (e1 : expr Pos.marked Bindlib.box) (pos : Pos.t) : - expr Pos.marked Bindlib.box = - Bindlib.box_apply (fun e1 -> EAssert e1, pos) e1 +let eassert e1 mark = Bindlib.box_apply (fun e1 -> EAssert e1, mark) e1 +let eop op mark = Bindlib.box (EOp op, mark) -let eop (op : operator) (pos : Pos.t) : expr Pos.marked Bindlib.box = - Bindlib.box (EOp op, pos) - -let edefault - (excepts : expr Pos.marked Bindlib.box list) - (just : expr Pos.marked Bindlib.box) - (cons : expr Pos.marked Bindlib.box) - (pos : Pos.t) : expr Pos.marked Bindlib.box = +let edefault excepts just cons mark = Bindlib.box_apply3 - (fun excepts just cons -> EDefault (excepts, just, cons), pos) + (fun excepts just cons -> EDefault (excepts, just, cons), mark) (Bindlib.box_list excepts) just cons -let eifthenelse - (e1 : expr Pos.marked Bindlib.box) - (e2 : expr Pos.marked Bindlib.box) - (e3 : expr Pos.marked Bindlib.box) - (pos : Pos.t) : expr Pos.marked Bindlib.box = - Bindlib.box_apply3 (fun e1 e2 e3 -> EIfThenElse (e1, e2, e3), pos) e1 e2 e3 +let eifthenelse e1 e2 e3 mark = + Bindlib.box_apply3 (fun e1 e2 e3 -> EIfThenElse (e1, e2, e3), mark) e1 e2 e3 -let eerroronempty (e1 : expr Pos.marked Bindlib.box) (pos : Pos.t) : - expr Pos.marked Bindlib.box = - Bindlib.box_apply (fun e1 -> ErrorOnEmpty e1, pos) e1 +let eerroronempty e1 mark = + Bindlib.box_apply (fun e1 -> ErrorOnEmpty e1, mark) e1 -let map_expr - (ctx : 'a) - ~(f : 'a -> expr Pos.marked -> expr Pos.marked Bindlib.box) - (e : expr Pos.marked) : expr Pos.marked Bindlib.box = - match Pos.unmark e with - | EVar (v, _pos) -> evar v (Pos.get_position e) - | EApp (e1, args) -> - eapp (f ctx e1) (List.map (f ctx) args) (Pos.get_position e) - | EAbs ((binder, binder_pos), typs) -> - eabs - (Bindlib.box_mbinder (f ctx) binder) - binder_pos typs (Pos.get_position e) - | ETuple (args, s) -> etuple (List.map (f ctx) args) s (Pos.get_position e) +let translate_var v = Bindlib.copy_var v (fun x -> EVar x) (Bindlib.name_of v) + +let map_expr ctx ~f e = + let m = Marked.get_mark e in + match Marked.unmark e with + | EVar v -> evar (translate_var v) m + | EApp (e1, args) -> eapp (f ctx e1) (List.map (f ctx) args) m + | EAbs (binder, typs) -> + let vars, body = Bindlib.unmbind binder in + eabs (Bindlib.bind_mvar (Array.map translate_var vars) (f ctx body)) typs m + | ETuple (args, s) -> etuple (List.map (f ctx) args) s m | ETupleAccess (e1, n, s_name, typs) -> - etupleaccess ((f ctx) e1) n s_name typs (Pos.get_position e) - | EInj (e1, i, e_name, typs) -> - einj ((f ctx) e1) i e_name typs (Pos.get_position e) + etupleaccess ((f ctx) e1) n s_name typs m + | EInj (e1, i, e_name, typs) -> einj ((f ctx) e1) i e_name typs m | EMatch (arg, arms, e_name) -> - ematch ((f ctx) arg) (List.map (f ctx) arms) e_name (Pos.get_position e) - | EArray args -> earray (List.map (f ctx) args) (Pos.get_position e) - | ELit l -> elit l (Pos.get_position e) - | EAssert e1 -> eassert ((f ctx) e1) (Pos.get_position e) - | EOp op -> Bindlib.box (EOp op, Pos.get_position e) + ematch ((f ctx) arg) (List.map (f ctx) arms) e_name m + | EArray args -> earray (List.map (f ctx) args) m + | ELit l -> elit l m + | EAssert e1 -> eassert ((f ctx) e1) m + | EOp op -> Bindlib.box (EOp op, m) | EDefault (excepts, just, cons) -> - edefault - (List.map (f ctx) excepts) - ((f ctx) just) - ((f ctx) cons) - (Pos.get_position e) + edefault (List.map (f ctx) excepts) ((f ctx) just) ((f ctx) cons) m | EIfThenElse (e1, e2, e3) -> - eifthenelse ((f ctx) e1) ((f ctx) e2) ((f ctx) e3) (Pos.get_position e) - | ErrorOnEmpty e1 -> eerroronempty ((f ctx) e1) (Pos.get_position e) + eifthenelse ((f ctx) e1) ((f ctx) e2) ((f ctx) e3) m + | ErrorOnEmpty e1 -> eerroronempty ((f ctx) e1) m + +let rec map_expr_top_down ~f e = + map_expr () ~f:(fun () -> map_expr_top_down ~f) (f e) + +let map_expr_marks ~f e = + map_expr_top_down ~f:(fun e -> Marked.(mark (f (get_mark e)) (unmark e))) e + +let untype_expr e = map_expr_marks ~f:(fun m -> Untyped { pos = mark_pos m }) e + +type ('expr, 'm) box_expr_sig = + ('expr, 'm) marked -> ('expr, 'm) marked Bindlib.box (** See [Bindlib.box_term] documentation for why we are doing that. *) -let box_expr (e : expr Pos.marked) : expr Pos.marked Bindlib.box = +let box_expr : ('m expr, 'm) box_expr_sig = + fun e -> let rec id_t () e = map_expr () ~f:id_t e in id_t () e -type 'expr box_expr_sig = 'expr Pos.marked -> 'expr Pos.marked Bindlib.box - -let rec fold_left_scope_lets - ~(f : 'a -> 'expr scope_let -> 'expr Bindlib.var -> 'a) - ~(init : 'a) - (scope_body_expr : 'expr scope_body_expr) : 'a = +let rec fold_left_scope_lets ~f ~init scope_body_expr = match scope_body_expr with | Result _ -> init | ScopeLet scope_let -> let var, next = Bindlib.unbind scope_let.scope_let_next in fold_left_scope_lets ~f ~init:(f init scope_let var) next -let rec fold_right_scope_lets - ~(f : 'expr scope_let -> 'expr Bindlib.var -> 'a -> 'a) - ~(init : 'expr Pos.marked -> 'a) - (scope_body_expr : 'expr scope_body_expr) : 'a = +let rec fold_right_scope_lets ~f ~init scope_body_expr = match scope_body_expr with | Result result -> init result | ScopeLet scope_let -> @@ -308,39 +362,25 @@ let rec fold_right_scope_lets let next_result = fold_right_scope_lets ~f ~init next in f scope_let var next_result -let map_exprs_in_scope_lets - ~(f : 'expr Pos.marked -> 'expr Pos.marked Bindlib.box) - (scope_body_expr : 'expr scope_body_expr) : - 'expr scope_body_expr Bindlib.box = +let map_exprs_in_scope_lets ~f ~varf scope_body_expr = fold_right_scope_lets - ~f:(fun scope_let var_next (acc : 'expr scope_body_expr Bindlib.box) -> - let new_scope_let = - Bindlib.box_apply - (fun new_expr -> { scope_let with scope_let_expr = new_expr }) - (f scope_let.scope_let_expr) - in - let new_next = Bindlib.bind_var var_next acc in + ~f:(fun scope_let var_next acc -> Bindlib.box_apply2 - (fun new_next new_scope_let -> - ScopeLet { new_scope_let with scope_let_next = new_next }) - new_next new_scope_let) + (fun scope_let_next scope_let_expr -> + ScopeLet { scope_let with scope_let_next; scope_let_expr }) + (Bindlib.bind_var (varf var_next) acc) + (f scope_let.scope_let_expr)) ~init:(fun res -> Bindlib.box_apply (fun res -> Result res) (f res)) scope_body_expr -let rec fold_left_scope_defs - ~(f : 'a -> 'expr scope_def -> 'expr Bindlib.var -> 'a) - ~(init : 'a) - (scopes : 'expr scopes) : 'a = +let rec fold_left_scope_defs ~f ~init scopes = match scopes with | Nil -> init | ScopeDef scope_def -> let var, next = Bindlib.unbind scope_def.scope_next in fold_left_scope_defs ~f ~init:(f init scope_def var) next -let rec fold_right_scope_defs - ~(f : 'expr scope_def -> 'expr Bindlib.var -> 'a -> 'a) - ~(init : 'a) - (scopes : 'expr scopes) : 'a = +let rec fold_right_scope_defs ~f ~init scopes = match scopes with | Nil -> init | ScopeDef scope_def -> @@ -348,9 +388,7 @@ let rec fold_right_scope_defs let result_next = fold_right_scope_defs ~f ~init next in f scope_def var_next result_next -let map_scope_defs - ~(f : 'expr scope_def -> 'expr scope_def Bindlib.box) - (scopes : 'expr scopes) : 'expr scopes Bindlib.box = +let map_scope_defs ~f scopes = fold_right_scope_defs ~f:(fun scope_def var_next acc -> let new_scope_def = f scope_def in @@ -361,48 +399,62 @@ let map_scope_defs new_scope_def new_next) ~init:(Bindlib.box Nil) scopes -let map_exprs_in_scopes - ~(f : 'expr Pos.marked -> 'expr Pos.marked Bindlib.box) - (scopes : 'expr scopes) : 'expr scopes Bindlib.box = - map_scope_defs - ~f:(fun scope_def -> +let map_exprs_in_scopes ~f ~varf scopes = + fold_right_scope_defs + ~f:(fun scope_def var_next acc -> let scope_input_var, scope_lets = Bindlib.unbind scope_def.scope_body.scope_body_expr in - let new_scope_body_expr = map_exprs_in_scope_lets ~f scope_lets in + let new_scope_body_expr = map_exprs_in_scope_lets ~f ~varf scope_lets in let new_scope_body_expr = - Bindlib.bind_var scope_input_var new_scope_body_expr + Bindlib.bind_var (varf scope_input_var) new_scope_body_expr in - Bindlib.box_apply - (fun new_scope_body_expr -> - { - scope_def with - scope_body = - { - scope_def.scope_body with - scope_body_expr = new_scope_body_expr; - }; - }) - new_scope_body_expr) - scopes + let new_next = Bindlib.bind_var (varf var_next) acc in + Bindlib.box_apply2 + (fun scope_body_expr scope_next -> + ScopeDef + { + scope_def with + scope_body = { scope_def.scope_body with scope_body_expr }; + scope_next; + }) + new_scope_body_expr new_next) + ~init:(Bindlib.box Nil) scopes + +let untype_program prg = + { + prg with + scopes = + Bindlib.unbox + (map_exprs_in_scopes + ~f:(fun e -> untype_expr e) + ~varf:translate_var prg.scopes); + } + +type 'm var = 'm expr Bindlib.var +type 'm vars = 'm expr Bindlib.mvar + +let new_var s = Bindlib.new_var (fun x -> EVar x) s module Var = struct - type t = expr Bindlib.var + type t = V : 'a expr Bindlib.var -> t + (* We use this trivial GADT to make the 'm parameter disappear under an + existential. It's fine for a use as keys only. (bindlib defines [any_var] + similarly but it's not exported) todo: add [@@ocaml.unboxed] once it's + possible through abstract types *) - let make (s : string Pos.marked) : t = - Bindlib.new_var - (fun (x : expr Bindlib.var) : expr -> EVar (x, Pos.get_position s)) - (Pos.unmark s) - - let compare x y = Bindlib.compare_vars x y + let t v = V v + let get (V v) = Bindlib.copy_var v (fun x -> EVar x) (Bindlib.name_of v) + let compare (V x) (V y) = Bindlib.compare_vars x y + let eq (V x) (V y) = Bindlib.eq_vars x y end -module VarMap = Map.Make (Var) module VarSet = Set.Make (Var) +module VarMap = Map.Make (Var) -let rec free_vars_expr (e : expr Pos.marked) : VarSet.t = - match Pos.unmark e with - | EVar (v, _) -> VarSet.singleton v +let rec free_vars_expr (e : 'm marked_expr) : VarSet.t = + match Marked.unmark e with + | EVar v -> VarSet.singleton (Var.t v) | ETuple (es, _) | EArray es -> es |> List.map free_vars_expr |> List.fold_left VarSet.union VarSet.empty | ETupleAccess (e1, _, _, _) @@ -411,85 +463,162 @@ let rec free_vars_expr (e : expr Pos.marked) : VarSet.t = | EInj (e1, _, _, _) -> free_vars_expr e1 | EApp (e1, es) | EMatch (e1, es, _) -> - e1 :: es |> List.map free_vars_expr + e1 :: es + |> List.map free_vars_expr |> List.fold_left VarSet.union VarSet.empty | EDefault (es, ejust, econs) -> - ejust :: econs :: es |> List.map free_vars_expr + ejust :: econs :: es + |> List.map free_vars_expr |> List.fold_left VarSet.union VarSet.empty | EOp _ | ELit _ -> VarSet.empty | EIfThenElse (e1, e2, e3) -> - [e1; e2; e3] |> List.map free_vars_expr + [e1; e2; e3] + |> List.map free_vars_expr |> List.fold_left VarSet.union VarSet.empty - | EAbs ((binder, _), _) -> + | EAbs (binder, _) -> let vs, body = Bindlib.unmbind binder in - Array.fold_right VarSet.remove vs (free_vars_expr body) + Array.fold_right VarSet.remove (Array.map Var.t vs) (free_vars_expr body) -let rec free_vars_scope_body_expr (scope_lets : expr scope_body_expr) : VarSet.t - = +let rec free_vars_scope_body_expr (scope_lets : ('m expr, 'm) scope_body_expr) : + VarSet.t = match scope_lets with | Result e -> free_vars_expr e | ScopeLet { scope_let_expr = e; scope_let_next = next; _ } -> let v, body = Bindlib.unbind next in VarSet.union (free_vars_expr e) - (VarSet.remove v (free_vars_scope_body_expr body)) + (VarSet.remove (Var.t v) (free_vars_scope_body_expr body)) -let free_vars_scope_body (scope_body : expr scope_body) : VarSet.t = +let free_vars_scope_body (scope_body : ('m expr, 'm) scope_body) : VarSet.t = let { scope_body_expr = binder; _ } = scope_body in let v, body = Bindlib.unbind binder in - VarSet.remove v (free_vars_scope_body_expr body) + VarSet.remove (Var.t v) (free_vars_scope_body_expr body) -let rec free_vars_scopes (scopes : expr scopes) : VarSet.t = +let rec free_vars_scopes (scopes : ('m expr, 'm) scopes) : VarSet.t = match scopes with | Nil -> VarSet.empty | ScopeDef { scope_body = body; scope_next = next; _ } -> let v, next = Bindlib.unbind next in VarSet.union - (VarSet.remove v (free_vars_scopes next)) + (VarSet.remove (Var.t v) (free_vars_scopes next)) (free_vars_scope_body body) +(* type vars = expr Bindlib.mvar *) -type vars = expr Bindlib.mvar +let make_var ((x, mark) : ('m expr Bindlib.var, 'm) marked) : + 'm marked_expr Bindlib.box = + Bindlib.box_apply (fun x -> x, mark) (Bindlib.box_var x) -let make_var ((x, pos) : Var.t Pos.marked) : expr Pos.marked Bindlib.box = - Bindlib.box_apply (fun x -> x, pos) (Bindlib.box_var x) +type ('e, 'm) make_abs_sig = + 'e Bindlib.mvar -> + ('e, 'm) marked Bindlib.box -> + typ Marked.pos list -> + 'm mark -> + ('e, 'm) marked Bindlib.box -let make_abs - (xs : vars) - (e : expr Pos.marked Bindlib.box) - (pos_binder : Pos.t) - (taus : typ Pos.marked list) - (pos : Pos.t) : expr Pos.marked Bindlib.box = - Bindlib.box_apply - (fun b -> EAbs ((b, pos_binder), taus), pos) - (Bindlib.bind_mvar xs e) +let (make_abs : ('m expr, 'm) make_abs_sig) = + fun xs e taus mark -> + Bindlib.box_apply (fun b -> EAbs (b, taus), mark) (Bindlib.bind_mvar xs e) -let make_app - (e : expr Pos.marked Bindlib.box) - (u : expr Pos.marked Bindlib.box list) - (pos : Pos.t) : expr Pos.marked Bindlib.box = - Bindlib.box_apply2 (fun e u -> EApp (e, u), pos) e (Bindlib.box_list u) +let make_app : + 'm marked_expr Bindlib.box -> + 'm marked_expr Bindlib.box list -> + 'm mark -> + 'm marked_expr Bindlib.box = + fun e u mark -> + Bindlib.box_apply2 (fun e u -> EApp (e, u), mark) e (Bindlib.box_list u) -let make_let_in - (x : Var.t) - (tau : typ Pos.marked) - (e1 : expr Pos.marked Bindlib.box) - (e2 : expr Pos.marked Bindlib.box) - (pos : Pos.t) : expr Pos.marked Bindlib.box = - make_app (make_abs (Array.of_list [x]) e2 pos [tau] pos) [e1] pos +type ('expr, 'm) make_let_in_sig = + 'expr Bindlib.var -> + typ Marked.pos -> + ('expr, 'm) marked Bindlib.box -> + ('expr, 'm) marked Bindlib.box -> + Pos.t -> + ('expr, 'm) marked Bindlib.box -let empty_thunked_term : expr Pos.marked = - let silent = Var.make ("_", Pos.no_pos) in +let map_mark + (type m) + (pos_f : Pos.t -> Pos.t) + (ty_f : marked_typ -> marked_typ) + (m : m mark) : m mark = + match m with + | Untyped { pos } -> Untyped { pos = pos_f pos } + | Typed { pos; ty } -> Typed { pos = pos_f pos; ty = ty_f ty } + | Inferring { pos; uf } -> + Inferring + { pos = pos_f pos; uf = Infer.ast_to_typ (ty_f (Infer.typ_to_ast uf)) } + +let resolve_inferring { uf; pos } = { ty = Infer.typ_to_ast uf; pos } + +let map_mark2 + (type m) + (pos_f : Pos.t -> Pos.t -> Pos.t) + (ty_f : typed -> typed -> marked_typ) + (m1 : m mark) + (m2 : m mark) : m mark = + match m1, m2 with + | Untyped m1, Untyped m2 -> Untyped { pos = pos_f m1.pos m2.pos } + | Typed m1, Typed m2 -> Typed { pos = pos_f m1.pos m2.pos; ty = ty_f m1 m2 } + | Inferring m1, Inferring m2 -> + Inferring + { + pos = pos_f m1.pos m2.pos; + uf = + Infer.ast_to_typ (ty_f (resolve_inferring m1) (resolve_inferring m2)); + } + +let fold_marks + (type m) + (pos_f : Pos.t list -> Pos.t) + (ty_f : typed list -> marked_typ) + (ms : m mark list) : m mark = + match ms with + | [] -> invalid_arg "Dcalc.Ast.fold_mark" + | Untyped _ :: _ as ms -> + Untyped { pos = pos_f (List.map (function Untyped { pos } -> pos) ms) } + | Typed _ :: _ -> + Typed + { + pos = pos_f (List.map (function Typed { pos; _ } -> pos) ms); + ty = ty_f (List.map (function Typed m -> m) ms); + } + | Inferring _ :: _ -> + Inferring + { + pos = pos_f (List.map (function Inferring { pos; _ } -> pos) ms); + uf = + Infer.ast_to_typ + (ty_f (List.map (function Inferring m -> resolve_inferring m) ms)); + } + +let empty_thunked_term mark : 'm marked_expr = + let silent = new_var "_" in + let pos = mark_pos mark in Bindlib.unbox - (make_abs (Array.of_list [silent]) - (Bindlib.box (ELit LEmptyError, Pos.no_pos)) - Pos.no_pos - [TLit TUnit, Pos.no_pos] - Pos.no_pos) + (make_abs [| silent |] + (Bindlib.box (ELit LEmptyError, mark)) + [TLit TUnit, pos] + (map_mark + (fun pos -> pos) + (fun ty -> + Marked.mark pos (TArrow (Marked.mark pos (TLit TUnit), ty))) + mark)) -let is_value (e : expr Pos.marked) : bool = - match Pos.unmark e with ELit _ | EAbs _ | EOp _ -> true | _ -> false +let (make_let_in : ('m expr, 'm) make_let_in_sig) = + fun x tau e1 e2 pos -> + let m_e1 = Marked.get_mark (Bindlib.unbox e1) in + let m_e2 = Marked.get_mark (Bindlib.unbox e2) in + let m_abs = + map_mark2 + (fun _ _ -> pos) + (fun m1 m2 -> Marked.mark pos (TArrow (m1.ty, m2.ty))) + m_e1 m_e2 + in + make_app (make_abs [| x |] e2 [tau] m_abs) [e1] m_e2 -let rec equal_typs (ty1 : typ Pos.marked) (ty2 : typ Pos.marked) : bool = - match Pos.unmark ty1, Pos.unmark ty2 with +let is_value (e : 'e marked_expr) : bool = + match Marked.unmark e with ELit _ | EAbs _ | EOp _ -> true | _ -> false + +let rec equal_typs (ty1 : typ Marked.pos) (ty2 : typ Marked.pos) : bool = + match Marked.unmark ty1, Marked.unmark ty2 with | TLit l1, TLit l2 -> l1 = l2 | TTuple (tys1, n1), TTuple (tys2, n2) -> n1 = n2 && equal_typs_list tys1 tys2 | TEnum (tys1, n1), TEnum (tys2, n2) -> n1 = n2 && equal_typs_list tys1 tys2 @@ -498,7 +627,7 @@ let rec equal_typs (ty1 : typ Pos.marked) (ty2 : typ Pos.marked) : bool = | TAny, TAny -> true | _, _ -> false -and equal_typs_list (tys1 : typ Pos.marked list) (tys2 : typ Pos.marked list) : +and equal_typs_list (tys1 : typ Marked.pos list) (tys2 : typ Marked.pos list) : bool = List.length tys1 = List.length tys2 && (* OCaml && operator short-circuits when a clause is false, we can safely @@ -525,9 +654,9 @@ let equal_ops (op1 : operator) (op2 : operator) : bool = | Unop op1, Unop op2 -> equal_unops op1 op2 | _, _ -> false -let rec equal_exprs (e1 : expr Pos.marked) (e2 : expr Pos.marked) : bool = - match Pos.unmark e1, Pos.unmark e2 with - | EVar v1, EVar v2 -> Pos.unmark v1 = Pos.unmark v2 +let rec equal_exprs (e1 : 'm marked_expr) (e2 : 'm marked_expr) : bool = + match Marked.unmark e1, Marked.unmark e2 with + | EVar v1, EVar v2 -> Bindlib.eq_vars v1 v2 | ETuple (es1, n1), ETuple (es2, n2) -> n1 = n2 && equal_exprs_list es1 es2 | ETupleAccess (e1, id1, n1, tys1), ETupleAccess (e2, id2, n2, tys2) -> equal_exprs e1 e2 && id1 = id2 && n1 = n2 && equal_typs_list tys1 tys2 @@ -540,50 +669,32 @@ let rec equal_exprs (e1 : expr Pos.marked) (e2 : expr Pos.marked) : bool = | EAbs (b1, tys1), EAbs (b2, tys2) -> equal_typs_list tys1 tys2 && - let vars1, body1 = Bindlib.unmbind (Pos.unmark b1) in - let body2 = - Bindlib.msubst (Pos.unmark b2) - (Array.map (fun x -> EVar (x, Pos.no_pos)) vars1) - in + let vars1, body1 = Bindlib.unmbind b1 in + let body2 = Bindlib.msubst b2 (Array.map (fun x -> EVar x) vars1) in equal_exprs body1 body2 | EAssert e1, EAssert e2 -> equal_exprs e1 e2 | EOp op1, EOp op2 -> equal_ops op1 op2 | EDefault (exc1, def1, cons1), EDefault (exc2, def2, cons2) -> - equal_exprs def1 def2 && equal_exprs cons1 cons2 + equal_exprs def1 def2 + && equal_exprs cons1 cons2 && equal_exprs_list exc1 exc2 | EIfThenElse (if1, then1, else1), EIfThenElse (if2, then2, else2) -> equal_exprs if1 if2 && equal_exprs then1 then2 && equal_exprs else1 else2 | ErrorOnEmpty e1, ErrorOnEmpty e2 -> equal_exprs e1 e2 | _, _ -> false -and equal_exprs_list (es1 : expr Pos.marked list) (es2 : expr Pos.marked list) : +and equal_exprs_list (es1 : 'e marked_expr list) (es2 : 'm marked_expr list) : bool = List.length es1 = List.length es2 && (* OCaml && operator short-circuits when a clause is false, we can safely assume here that both lists have equal length *) List.for_all (fun (x, y) -> equal_exprs x y) (List.combine es1 es2) -type 'expr make_let_in_sig = - 'expr Bindlib.var -> - typ Pos.marked -> - 'expr Pos.marked Bindlib.box -> - 'expr Pos.marked Bindlib.box -> - Pos.t -> - 'expr Pos.marked Bindlib.box - -type 'expr make_abs_sig = - 'expr Bindlib.mvar -> - 'expr Pos.marked Bindlib.box -> - Pos.t -> - typ Pos.marked list -> - Pos.t -> - 'expr Pos.marked Bindlib.box - let rec unfold_scope_body_expr - ~(box_expr : 'expr box_expr_sig) - ~(make_let_in : 'expr make_let_in_sig) + ~(box_expr : ('expr, 'm) box_expr_sig) + ~(make_let_in : ('expr, 'm) make_let_in_sig) (ctx : decl_ctx) - (scope_let : 'expr scope_body_expr) : 'expr Pos.marked Bindlib.box = + (scope_let : ('expr, 'm) scope_body_expr) : ('expr, 'm) marked Bindlib.box = match scope_let with | Result e -> box_expr e | ScopeLet @@ -600,29 +711,29 @@ let rec unfold_scope_body_expr scope_let_pos let build_whole_scope_expr - ~(box_expr : 'expr box_expr_sig) - ~(make_abs : 'expr make_abs_sig) - ~(make_let_in : 'expr make_let_in_sig) + ~(box_expr : ('expr, 'm) box_expr_sig) + ~(make_abs : ('expr, 'm) make_abs_sig) + ~(make_let_in : ('expr, 'm) make_let_in_sig) (ctx : decl_ctx) - (body : 'expr scope_body) - (pos_scope : Pos.t) : 'expr Pos.marked Bindlib.box = + (body : ('expr, 'm) scope_body) + (mark_scope : 'm mark) : ('expr, 'm) marked Bindlib.box = let var, body_expr = Bindlib.unbind body.scope_body_expr in let body_expr = unfold_scope_body_expr ~box_expr ~make_let_in ctx body_expr in - make_abs (Array.of_list [var]) body_expr pos_scope + make_abs (Array.of_list [var]) body_expr [ ( TTuple ( List.map snd (StructMap.find body.scope_body_input_struct ctx.ctx_structs), Some body.scope_body_input_struct ), - pos_scope ); + mark_pos mark_scope ); ] - pos_scope + mark_scope let build_scope_typ_from_sig (ctx : decl_ctx) (scope_input_struct_name : StructName.t) (scope_return_struct_name : StructName.t) - (pos : Pos.t) : typ Pos.marked = + (pos : Pos.t) : typ Marked.pos = let scope_sig = StructMap.find scope_input_struct_name ctx.ctx_structs in let scope_return_typ = StructMap.find scope_return_struct_name ctx.ctx_structs @@ -639,22 +750,27 @@ type 'expr scope_name_or_var = | ScopeName of ScopeName.t | ScopeVar of 'expr Bindlib.var +let get_scope_body_mark scope_body = + match snd (Bindlib.unbind scope_body.scope_body_expr) with + | Result e | ScopeLet { scope_let_expr = e; _ } -> Marked.get_mark e + let rec unfold_scopes - ~(box_expr : 'expr box_expr_sig) - ~(make_abs : 'expr make_abs_sig) - ~(make_let_in : 'expr make_let_in_sig) + ~(box_expr : ('expr, 'm) box_expr_sig) + ~(make_abs : ('expr, 'm) make_abs_sig) + ~(make_let_in : ('expr, 'm) make_let_in_sig) (ctx : decl_ctx) - (s : 'expr scopes) - (main_scope : 'expr scope_name_or_var) : 'expr Pos.marked Bindlib.box = + (s : ('expr, 'm) scopes) + (mark : 'm mark) + (main_scope : 'expr scope_name_or_var) : ('expr, 'm) marked Bindlib.box = match s with | Nil -> ( match main_scope with - | ScopeVar v -> - Bindlib.box_apply (fun v -> v, Pos.no_pos) (Bindlib.box_var v) + | ScopeVar v -> Bindlib.box_apply (fun v -> v, mark) (Bindlib.box_var v) | ScopeName _ -> failwith "should not happen") | ScopeDef { scope_name; scope_body; scope_next } -> let scope_var, scope_next = Bindlib.unbind scope_next in - let scope_pos = Pos.get_position (ScopeName.get_info scope_name) in + let scope_pos = Marked.get_mark (ScopeName.get_info scope_name) in + let scope_body_mark = get_scope_body_mark scope_body in let main_scope = match main_scope with | ScopeVar v -> ScopeVar v @@ -666,16 +782,32 @@ let rec unfold_scopes (build_scope_typ_from_sig ctx scope_body.scope_body_input_struct scope_body.scope_body_output_struct scope_pos) (build_whole_scope_expr ~box_expr ~make_abs ~make_let_in ctx scope_body - scope_pos) - (unfold_scopes ~box_expr ~make_abs ~make_let_in ctx scope_next main_scope) + scope_body_mark) + (unfold_scopes ~box_expr ~make_abs ~make_let_in ctx scope_next mark + main_scope) scope_pos -let build_whole_program_expr (p : program) (main_scope : ScopeName.t) = +let rec find_scope name vars = function + | Nil -> raise Not_found + | ScopeDef { scope_name; scope_body; _ } when scope_name = name -> + List.rev vars, scope_body + | ScopeDef { scope_next; _ } -> + let var, next = Bindlib.unbind scope_next in + find_scope name (var :: vars) next + +let build_whole_program_expr + ~(box_expr : ('expr, 'm) box_expr_sig) + ~(make_abs : ('expr, 'm) make_abs_sig) + ~(make_let_in : ('expr, 'm) make_let_in_sig) + (p : ('expr, 'm) program_generic) + (main_scope : ScopeName.t) : ('expr, 'm) marked Bindlib.box = + let _, main_scope_body = find_scope main_scope [] p.scopes in unfold_scopes ~box_expr ~make_abs ~make_let_in p.decl_ctx p.scopes + (get_scope_body_mark main_scope_body) (ScopeName main_scope) -let rec expr_size (e : expr Pos.marked) : int = - match Pos.unmark e with +let rec expr_size (e : 'm marked_expr) : int = + match Marked.unmark e with | EVar _ | ELit _ | EOp _ -> 1 | ETuple (args, _) | EArray args -> List.fold_left (fun acc arg -> acc + expr_size arg) 1 args @@ -686,7 +818,7 @@ let rec expr_size (e : expr Pos.marked) : int = expr_size e1 + 1 | EMatch (arg, args, _) | EApp (arg, args) -> List.fold_left (fun acc arg -> acc + expr_size arg) (1 + expr_size arg) args - | EAbs ((binder, _), _) -> + | EAbs (binder, _) -> let _, body = Bindlib.unmbind binder in 1 + expr_size body | EIfThenElse (e1, e2, e3) -> 1 + expr_size e1 + expr_size e2 + expr_size e3 @@ -696,9 +828,9 @@ let rec expr_size (e : expr Pos.marked) : int = (1 + expr_size just + expr_size cons) exceptions -let remove_logging_calls (e : expr Pos.marked) : expr Pos.marked Bindlib.box = +let remove_logging_calls (e : 'm marked_expr) : 'm marked_expr Bindlib.box = let rec f () e = - match Pos.unmark e with + match Marked.unmark e with | EApp ((EOp (Unop (Log _)), _), [arg]) -> map_expr () ~f arg | _ -> map_expr () ~f e in diff --git a/compiler/dcalc/ast.mli b/compiler/dcalc/ast.mli index 6205bd80..1dbb2a6c 100644 --- a/compiler/dcalc/ast.mli +++ b/compiler/dcalc/ast.mli @@ -18,6 +18,7 @@ (** Abstract syntax tree of the default calculus intermediate representation *) open Utils +module Runtime = Runtime_ocaml.Runtime module ScopeName : Uid.Id with type info = Uid.MarkedString.info module StructName : Uid.Id with type info = Uid.MarkedString.info module StructFieldName : Uid.Id with type info = Uid.MarkedString.info @@ -32,12 +33,14 @@ module EnumMap : Map.S with type key = EnumName.t type typ_lit = TBool | TUnit | TInt | TRat | TMoney | TDate | TDuration -type typ = +type marked_typ = typ Marked.pos + +and typ = | TLit of typ_lit - | TTuple of typ Pos.marked list * StructName.t option - | TEnum of typ Pos.marked list * EnumName.t - | TArrow of typ Pos.marked * typ Pos.marked - | TArray of typ Pos.marked + | TTuple of marked_typ list * StructName.t option + | TEnum of marked_typ list * EnumName.t + | TArrow of marked_typ * marked_typ + | TArray of marked_typ | TAny type date = Runtime.date @@ -94,43 +97,85 @@ type unop = | Log of log_entry * Utils.Uid.MarkedString.info list | Length | IntToRat + | MoneyToRat + | RatToMoney | GetDay | GetMonth | GetYear + | FirstDayOfMonth + | LastDayOfMonth | RoundMoney | RoundDecimal type operator = Ternop of ternop | Binop of binop | Unop of unop +(** Contains some structures used for type inference *) +module Infer : sig + module Any : Utils.Uid.Id with type info = unit + + type unionfind_typ = typ Marked.pos UnionFind.elem + (** We do not reuse {!type: typ} because we have to include a new [TAny] + variant. Indeed, error terms can have any type and this has to be captured + by the type sytem. *) + + and typ = + | TLit of typ_lit + | TArrow of unionfind_typ * unionfind_typ + | TTuple of unionfind_typ list * StructName.t option + | TEnum of unionfind_typ list * EnumName.t + | TArray of unionfind_typ + | TAny of Any.t + + val typ_to_ast : unionfind_typ -> marked_typ + val ast_to_typ : marked_typ -> unionfind_typ +end + +type untyped = { pos : Pos.t } [@@unboxed] +type typed = { pos : Pos.t; ty : marked_typ } +type inferring = { pos : Pos.t; uf : Infer.unionfind_typ } + +(** The generic type of AST markings. Using a GADT allows functions to be + polymorphic in the marking, but still do transformations on types when + appropriate *) +type _ mark = + | Untyped : untyped -> untyped mark + | Typed : typed -> typed mark + | Inferring : inferring -> inferring mark + +type ('a, 'm) marked = ('a, 'm mark) Marked.t + +type 'm marked_expr = ('m expr, 'm) marked + (** The expressions use the {{:https://lepigre.fr/ocaml-bindlib/} Bindlib} library, based on higher-order abstract syntax*) -type expr = - | EVar of expr Bindlib.var Pos.marked - | ETuple of expr Pos.marked list * StructName.t option +and 'm expr = + | EVar of 'm expr Bindlib.var + | ETuple of 'm marked_expr list * StructName.t option (** The [MarkedString.info] is the former struct field name*) - | ETupleAccess of - expr Pos.marked * int * StructName.t option * typ Pos.marked list + | ETupleAccess of 'm marked_expr * int * StructName.t option * marked_typ list (** The [MarkedString.info] is the former struct field name *) - | EInj of expr Pos.marked * int * EnumName.t * typ Pos.marked list + | EInj of 'm marked_expr * int * EnumName.t * marked_typ list (** The [MarkedString.info] is the former enum case name *) - | EMatch of expr Pos.marked * expr Pos.marked list * EnumName.t + | EMatch of 'm marked_expr * 'm marked_expr list * EnumName.t (** The [MarkedString.info] is the former enum case name *) - | EArray of expr Pos.marked list + | EArray of 'm marked_expr list | ELit of lit | EAbs of - ((expr, expr Pos.marked) Bindlib.mbinder[@opaque]) Pos.marked - * typ Pos.marked list - | EApp of expr Pos.marked * expr Pos.marked list - | EAssert of expr Pos.marked + (('m expr, 'm marked_expr) Bindlib.mbinder[@opaque]) * marked_typ list + | EApp of 'm marked_expr * 'm marked_expr list + | EAssert of 'm marked_expr | EOp of operator - | EDefault of expr Pos.marked list * expr Pos.marked * expr Pos.marked - | EIfThenElse of expr Pos.marked * expr Pos.marked * expr Pos.marked - | ErrorOnEmpty of expr Pos.marked + | EDefault of 'm marked_expr list * 'm marked_expr * 'm marked_expr + | EIfThenElse of 'm marked_expr * 'm marked_expr * 'm marked_expr + | ErrorOnEmpty of 'm marked_expr -type struct_ctx = (StructFieldName.t * typ Pos.marked) list StructMap.t -type enum_ctx = (EnumConstructor.t * typ Pos.marked) list EnumMap.t +(** {3 Expression annotations ([Marked.t])} *) + +type typed_expr = typed marked_expr +type struct_ctx = (StructFieldName.t * marked_typ) list StructMap.t +type enum_ctx = (EnumConstructor.t * marked_typ) list EnumMap.t type decl_ctx = { ctx_enums : enum_ctx; ctx_structs : struct_ctx } -type binder = (expr, expr Pos.marked) Bindlib.binder +type 'm binder = ('m expr, 'm marked_expr) Bindlib.binder (** This kind annotation signals that the let-binding respects a structural invariant. These invariants concern the shape of the expression in the @@ -145,12 +190,12 @@ type scope_let_kind = | DestructuringSubScopeResults (** [let s.x = result.x ]**) | Assertion (** [let _ = assert e]*) -type 'expr scope_let = { +type ('expr, 'm) scope_let = { scope_let_kind : scope_let_kind; - scope_let_typ : typ Utils.Pos.marked; - scope_let_expr : 'expr Utils.Pos.marked; - scope_let_next : ('expr, 'expr scope_body_expr) Bindlib.binder; - scope_let_pos : Utils.Pos.t; + scope_let_typ : marked_typ; + scope_let_expr : ('expr, 'm) marked; + scope_let_next : ('expr, ('expr, 'm) scope_body_expr) Bindlib.binder; + scope_let_pos : Pos.t; } (** This type is parametrized by the expression type so it can be reused in later intermediate representations. *) @@ -158,110 +203,143 @@ type 'expr scope_let = { (** A scope let-binding has all the information necessary to make a proper let-binding expression, plus an annotation for the kind of the let-binding that comes from the compilation of a {!module: Scopelang.Ast} statement. *) -and 'expr scope_body_expr = - | Result of 'expr Utils.Pos.marked - | ScopeLet of 'expr scope_let +and ('expr, 'm) scope_body_expr = + | Result of ('expr, 'm) marked + | ScopeLet of ('expr, 'm) scope_let -type 'expr scope_body = { +type ('expr, 'm) scope_body = { scope_body_input_struct : StructName.t; scope_body_output_struct : StructName.t; - scope_body_expr : ('expr, 'expr scope_body_expr) Bindlib.binder; + scope_body_expr : ('expr, ('expr, 'm) scope_body_expr) Bindlib.binder; } (** Instead of being a single expression, we give a little more ad-hoc structure to the scope body by decomposing it in an ordered list of let-bindings, and a result expression that uses the let-binded variables. The first binder is the argument of type [scope_body_input_struct]. *) -type 'expr scope_def = { +type ('expr, 'm) scope_def = { scope_name : ScopeName.t; - scope_body : 'expr scope_body; - scope_next : ('expr, 'expr scopes) Bindlib.binder; + scope_body : ('expr, 'm) scope_body; + scope_next : ('expr, ('expr, 'm) scopes) Bindlib.binder; } (** Finally, we do the same transformation for the whole program for the kinded lets. This permit us to use bindlib variables for scopes names. *) -and 'a scopes = Nil | ScopeDef of 'a scope_def +and ('expr, 'm) scopes = Nil | ScopeDef of ('expr, 'm) scope_def -type program = { decl_ctx : decl_ctx; scopes : expr scopes } +type ('expr, 'm) program_generic = { + decl_ctx : decl_ctx; + scopes : ('expr, 'm) scopes; +} + +type 'm program = ('m expr, 'm) program_generic (** {1 Helpers} *) -(** {2 Boxed constructors}*) +(** {2 Manipulation of marks} *) -val evar : expr Bindlib.var -> Pos.t -> expr Pos.marked Bindlib.box +val no_mark : 'm mark -> 'm mark +val mark_pos : 'm mark -> Pos.t +val pos : ('a, 'm) marked -> Pos.t +val ty : ('a, typed) marked -> marked_typ +val with_ty : marked_typ -> ('a, 'm) marked -> ('a, typed) marked + +(** All the following functions will resolve the types if called on an + [Inferring] type *) + +val map_mark : + (Pos.t -> Pos.t) -> (marked_typ -> marked_typ) -> 'm mark -> 'm mark + +val map_mark2 : + (Pos.t -> Pos.t -> Pos.t) -> + (typed -> typed -> marked_typ) -> + 'm mark -> + 'm mark -> + 'm mark + +val fold_marks : + (Pos.t list -> Pos.t) -> (typed list -> marked_typ) -> 'm mark list -> 'm mark + +val get_scope_body_mark : ('expr, 'm) scope_body -> 'm mark +val untype_expr : 'm marked_expr -> untyped marked_expr Bindlib.box +val untype_program : 'm program -> untyped program + +(** {2 Boxed constructors} *) + +val evar : 'm expr Bindlib.var -> 'm mark -> 'm marked_expr Bindlib.box val etuple : - expr Pos.marked Bindlib.box list -> + 'm marked_expr Bindlib.box list -> StructName.t option -> - Pos.t -> - expr Pos.marked Bindlib.box + 'm mark -> + 'm marked_expr Bindlib.box val etupleaccess : - expr Pos.marked Bindlib.box -> + 'm marked_expr Bindlib.box -> int -> StructName.t option -> - typ Pos.marked list -> - Pos.t -> - expr Pos.marked Bindlib.box + marked_typ list -> + 'm mark -> + 'm marked_expr Bindlib.box val einj : - expr Pos.marked Bindlib.box -> + 'm marked_expr Bindlib.box -> int -> EnumName.t -> - typ Pos.marked list -> - Pos.t -> - expr Pos.marked Bindlib.box + marked_typ list -> + 'm mark -> + 'm marked_expr Bindlib.box val ematch : - expr Pos.marked Bindlib.box -> - expr Pos.marked Bindlib.box list -> + 'm marked_expr Bindlib.box -> + 'm marked_expr Bindlib.box list -> EnumName.t -> - Pos.t -> - expr Pos.marked Bindlib.box + 'm mark -> + 'm marked_expr Bindlib.box val earray : - expr Pos.marked Bindlib.box list -> Pos.t -> expr Pos.marked Bindlib.box + 'm marked_expr Bindlib.box list -> 'm mark -> 'm marked_expr Bindlib.box -val elit : lit -> Pos.t -> expr Pos.marked Bindlib.box +val elit : lit -> 'm mark -> 'm marked_expr Bindlib.box val eabs : - (expr, expr Pos.marked) Bindlib.mbinder Bindlib.box -> - Pos.t -> - typ Pos.marked list -> - Pos.t -> - expr Pos.marked Bindlib.box + ('m expr, 'm marked_expr) Bindlib.mbinder Bindlib.box -> + marked_typ list -> + 'm mark -> + 'm marked_expr Bindlib.box val eapp : - expr Pos.marked Bindlib.box -> - expr Pos.marked Bindlib.box list -> - Pos.t -> - expr Pos.marked Bindlib.box + 'm marked_expr Bindlib.box -> + 'm marked_expr Bindlib.box list -> + 'm mark -> + 'm marked_expr Bindlib.box val eassert : - expr Pos.marked Bindlib.box -> Pos.t -> expr Pos.marked Bindlib.box + 'm marked_expr Bindlib.box -> 'm mark -> 'm marked_expr Bindlib.box -val eop : operator -> Pos.t -> expr Pos.marked Bindlib.box +val eop : operator -> 'm mark -> 'm marked_expr Bindlib.box val edefault : - expr Pos.marked Bindlib.box list -> - expr Pos.marked Bindlib.box -> - expr Pos.marked Bindlib.box -> - Pos.t -> - expr Pos.marked Bindlib.box + 'm marked_expr Bindlib.box list -> + 'm marked_expr Bindlib.box -> + 'm marked_expr Bindlib.box -> + 'm mark -> + 'm marked_expr Bindlib.box val eifthenelse : - expr Pos.marked Bindlib.box -> - expr Pos.marked Bindlib.box -> - expr Pos.marked Bindlib.box -> - Pos.t -> - expr Pos.marked Bindlib.box + 'm marked_expr Bindlib.box -> + 'm marked_expr Bindlib.box -> + 'm marked_expr Bindlib.box -> + 'm mark -> + 'm marked_expr Bindlib.box val eerroronempty : - expr Pos.marked Bindlib.box -> Pos.t -> expr Pos.marked Bindlib.box + 'm marked_expr Bindlib.box -> 'm mark -> 'm marked_expr Bindlib.box -val box_expr : expr Pos.marked -> expr Pos.marked Bindlib.box +type ('expr, 'm) box_expr_sig = + ('expr, 'm) marked -> ('expr, 'm) marked Bindlib.box -type 'expr box_expr_sig = 'expr Pos.marked -> 'expr Pos.marked Bindlib.box +val box_expr : ('m expr, 'm) box_expr_sig (**{2 Program traversal}*) @@ -270,9 +348,9 @@ type 'expr box_expr_sig = 'expr Pos.marked -> 'expr Pos.marked Bindlib.box val map_expr : 'a -> - f:('a -> expr Pos.marked -> expr Pos.marked Bindlib.box) -> - expr Pos.marked -> - expr Pos.marked Bindlib.box + f:('a -> 'm1 marked_expr -> 'm2 marked_expr Bindlib.box) -> + ('m1 expr, 'm2 mark) Marked.t -> + 'm2 marked_expr Bindlib.box (** If you want to apply a map transform to an expression, you can save up writing a painful match over all the cases of the AST. For instance, if you want to remove all errors on empty, you can write @@ -280,7 +358,7 @@ val map_expr : {[ let remove_error_empty = let rec f () e = - match Pos.unmark e with + match Marked.unmark e with | ErrorOnEmpty e1 -> map_expr () f e1 | _ -> map_expr () f e in @@ -290,10 +368,21 @@ val map_expr : The first argument of map_expr is an optional context that you can carry around during your map traversal. *) +val map_expr_top_down : + f:('m1 marked_expr -> ('m1 expr, 'm2 mark) Marked.t) -> + 'm1 marked_expr -> + 'm2 marked_expr Bindlib.box +(** Recursively applies [f] to the nodes of the expression tree. The type + returned by [f] is hybrid since the mark at top-level has been rewritten, + but not yet the marks in the subtrees. *) + +val map_expr_marks : + f:('m1 mark -> 'm2 mark) -> 'm1 marked_expr -> 'm2 marked_expr Bindlib.box + val fold_left_scope_lets : - f:('a -> 'expr scope_let -> 'expr Bindlib.var -> 'a) -> + f:('a -> ('expr, 'm) scope_let -> 'expr Bindlib.var -> 'a) -> init:'a -> - 'expr scope_body_expr -> + ('expr, 'm) scope_body_expr -> 'a (** Usage: [fold_left_scope_lets ~f:(fun acc scope_let scope_let_var -> ...) ~init scope_lets], @@ -301,9 +390,9 @@ val fold_left_scope_lets : scope lets to be examined. *) val fold_right_scope_lets : - f:('expr scope_let -> 'expr Bindlib.var -> 'a -> 'a) -> - init:('expr Pos.marked -> 'a) -> - 'expr scope_body_expr -> + f:(('expr1, 'm1) scope_let -> 'expr1 Bindlib.var -> 'a -> 'a) -> + init:(('expr1, 'm1) marked -> 'a) -> + ('expr1, 'm1) scope_body_expr -> 'a (** Usage: [fold_right_scope_lets ~f:(fun scope_let scope_let_var acc -> ...) ~init scope_lets], @@ -311,14 +400,15 @@ val fold_right_scope_lets : scope lets to be examined (which are before in the program order). *) val map_exprs_in_scope_lets : - f:('expr Pos.marked -> 'expr Pos.marked Bindlib.box) -> - 'expr scope_body_expr -> - 'expr scope_body_expr Bindlib.box + f:(('expr1, 'm1) marked -> ('expr2, 'm2) marked Bindlib.box) -> + varf:('expr1 Bindlib.var -> 'expr2 Bindlib.var) -> + ('expr1, 'm1) scope_body_expr -> + ('expr2, 'm2) scope_body_expr Bindlib.box val fold_left_scope_defs : - f:('a -> 'expr scope_def -> 'expr Bindlib.var -> 'a) -> + f:('a -> ('expr1, 'm1) scope_def -> 'expr1 Bindlib.var -> 'a) -> init:'a -> - 'expr scopes -> + ('expr1, 'm1) scopes -> 'a (** Usage: [fold_left_scope_defs ~f:(fun acc scope_def scope_var -> ...) ~init scope_def], @@ -326,9 +416,9 @@ val fold_left_scope_defs : be examined. *) val fold_right_scope_defs : - f:('expr scope_def -> 'expr Bindlib.var -> 'a -> 'a) -> + f:(('expr1, 'm1) scope_def -> 'expr1 Bindlib.var -> 'a -> 'a) -> init:'a -> - 'expr scopes -> + ('expr1, 'm1) scopes -> 'a (** Usage: [fold_right_scope_defs ~f:(fun scope_def scope_var acc -> ...) ~init scope_def], @@ -336,96 +426,99 @@ val fold_right_scope_defs : be examined (which are before in the program order). *) val map_scope_defs : - f:('expr scope_def -> 'expr scope_def Bindlib.box) -> - 'expr scopes -> - 'expr scopes Bindlib.box + f:(('expr, 'm) scope_def -> ('expr, 'm) scope_def Bindlib.box) -> + ('expr, 'm) scopes -> + ('expr, 'm) scopes Bindlib.box val map_exprs_in_scopes : - f:('expr Pos.marked -> 'expr Pos.marked Bindlib.box) -> - 'expr scopes -> - 'expr scopes Bindlib.box + f:(('expr1, 'm1) marked -> ('expr2, 'm2) marked Bindlib.box) -> + varf:('expr1 Bindlib.var -> 'expr2 Bindlib.var) -> + ('expr1, 'm1) scopes -> + ('expr2, 'm2) scopes Bindlib.box (** This is the main map visitor for all the expressions inside all the scopes of the program. *) -(** {2 Variables}*) +(** {2 Variables} *) + +type 'm var = 'm expr Bindlib.var + +val new_var : string -> 'm var + +val translate_var : 'm1 var -> 'm2 var +(** used to convert between e.g. [untyped expr var] into a [typed expr var] *) module Var : sig - type t = expr Bindlib.var + type t + + val t : 'm expr Bindlib.var -> t + (** Hides the marking type parameter annotation behind an existential type so + that variables can be stored in non-polymorphic sets and maps *) + + val get : t -> 'm expr Bindlib.var + (** Be careful with this, it breaks the type abstraction by casting the + existential type annotation. See [!Bindlib.copy_var] for more detail. *) - val make : string Pos.marked -> t val compare : t -> t -> int + val eq : t -> t -> bool end module VarMap : Map.S with type key = Var.t module VarSet : Set.S with type elt = Var.t -val free_vars_expr : expr Pos.marked -> VarSet.t -val free_vars_scope_body_expr : expr scope_body_expr -> VarSet.t -val free_vars_scope_body : expr scope_body -> VarSet.t -val free_vars_scopes : expr scopes -> VarSet.t +val free_vars_expr : 'm marked_expr -> VarSet.t +val free_vars_scope_body_expr : ('m expr, 'm) scope_body_expr -> VarSet.t +val free_vars_scope_body : ('m expr, 'm) scope_body -> VarSet.t +val free_vars_scopes : ('m expr, 'm) scopes -> VarSet.t -type vars = expr Bindlib.mvar +(* type vars = expr Bindlib.mvar *) -(** {2 Boxed term constructors}*) +val make_var : ('m var, 'm) marked -> 'm marked_expr Bindlib.box -val make_var : Var.t Pos.marked -> expr Pos.marked Bindlib.box +(** {2 Boxed term constructors} *) -val make_abs : - vars -> - expr Pos.marked Bindlib.box -> - Pos.t -> - typ Pos.marked list -> - Pos.t -> - expr Pos.marked Bindlib.box +type ('e, 'm) make_abs_sig = + 'e Bindlib.mvar -> + ('e, 'm) marked Bindlib.box -> + marked_typ list -> + 'm mark -> + ('e, 'm) marked Bindlib.box + +val make_abs : ('m expr, 'm) make_abs_sig val make_app : - expr Pos.marked Bindlib.box -> - expr Pos.marked Bindlib.box list -> - Pos.t -> - expr Pos.marked Bindlib.box + 'm marked_expr Bindlib.box -> + 'm marked_expr Bindlib.box list -> + 'm mark -> + 'm marked_expr Bindlib.box -val make_let_in : - Var.t -> - typ Pos.marked -> - expr Pos.marked Bindlib.box -> - expr Pos.marked Bindlib.box -> +type ('expr, 'm) make_let_in_sig = + 'expr Bindlib.var -> + marked_typ -> + ('expr, 'm) marked Bindlib.box -> + ('expr, 'm) marked Bindlib.box -> Pos.t -> - expr Pos.marked Bindlib.box + ('expr, 'm) marked Bindlib.box + +val make_let_in : ('m expr, 'm) make_let_in_sig (**{2 Other}*) -val empty_thunked_term : expr Pos.marked -val is_value : expr Pos.marked -> bool +val empty_thunked_term : 'm mark -> 'm marked_expr +val is_value : 'm marked_expr -> bool -val equal_exprs : expr Pos.marked -> expr Pos.marked -> bool +val equal_exprs : 'm marked_expr -> 'm marked_expr -> bool (** Determines if two expressions are equal, omitting their position information *) (** {1 AST manipulation helpers}*) -type 'expr make_let_in_sig = - 'expr Bindlib.var -> - typ Pos.marked -> - 'expr Pos.marked Bindlib.box -> - 'expr Pos.marked Bindlib.box -> - Pos.t -> - 'expr Pos.marked Bindlib.box - -type 'expr make_abs_sig = - 'expr Bindlib.mvar -> - 'expr Pos.marked Bindlib.box -> - Pos.t -> - typ Pos.marked list -> - Pos.t -> - 'expr Pos.marked Bindlib.box - val build_whole_scope_expr : - box_expr:'expr box_expr_sig -> - make_abs:'expr make_abs_sig -> - make_let_in:'expr make_let_in_sig -> + box_expr:('expr, 'm) box_expr_sig -> + make_abs:('expr, 'm) make_abs_sig -> + make_let_in:('expr, 'm) make_let_in_sig -> decl_ctx -> - 'expr scope_body -> - Pos.t -> - 'expr Pos.marked Bindlib.box + ('expr, 'm) scope_body -> + 'm mark -> + ('expr, 'm) marked Bindlib.box (** Usage: [build_whole_scope_expr ctx body scope_position] where [scope_position] corresponds to the line of the scope declaration for instance. *) @@ -435,23 +528,34 @@ type 'expr scope_name_or_var = | ScopeVar of 'expr Bindlib.var val unfold_scopes : - box_expr:'expr box_expr_sig -> - make_abs:'expr make_abs_sig -> - make_let_in:'expr make_let_in_sig -> + box_expr:('expr, 'm) box_expr_sig -> + make_abs:('expr, 'm) make_abs_sig -> + make_let_in:('expr, 'm) make_let_in_sig -> decl_ctx -> - 'expr scopes -> + ('expr, 'm) scopes -> + 'm mark -> 'expr scope_name_or_var -> - 'expr Pos.marked Bindlib.box + ('expr, 'm) marked Bindlib.box val build_whole_program_expr : - program -> ScopeName.t -> expr Pos.marked Bindlib.box + box_expr:('expr, 'm) box_expr_sig -> + make_abs:('expr, 'm) make_abs_sig -> + make_let_in:('expr, 'm) make_let_in_sig -> + ('expr, 'm) program_generic -> + ScopeName.t -> + ('expr, 'm) marked Bindlib.box (** Usage: [build_whole_program_expr program main_scope] builds an expression corresponding to the main program and returning the main scope as a function. *) -val expr_size : expr Pos.marked -> int +val expr_size : 'm marked_expr -> int (** Used by the optimizer to know when to stop *) -val remove_logging_calls : expr Pos.marked -> expr Pos.marked Bindlib.box +val remove_logging_calls : 'm marked_expr -> 'm marked_expr Bindlib.box (** Removes all calls to [Log] unary operators in the AST, replacing them by their argument. *) + +val build_scope_typ_from_sig : + decl_ctx -> StructName.t -> StructName.t -> Pos.t -> typ Marked.pos +(** [build_scope_typ_from_sig ctx in_struct out_struct pos] builds the arrow + type for the specified scope *) diff --git a/compiler/dcalc/dune b/compiler/dcalc/dune index e450c570..03046b15 100644 --- a/compiler/dcalc/dune +++ b/compiler/dcalc/dune @@ -1,7 +1,7 @@ (library (name dcalc) (public_name catala.dcalc) - (libraries bindlib unionFind utils re camomile runtime) + (libraries bindlib unionFind utils re ubase catala.runtime_ocaml) (preprocess (pps visitors.ppx))) diff --git a/compiler/dcalc/interpreter.ml b/compiler/dcalc/interpreter.ml index a4bdfb99..1ba6a92e 100644 --- a/compiler/dcalc/interpreter.ml +++ b/compiler/dcalc/interpreter.ml @@ -18,11 +18,12 @@ open Utils module A = Ast +module Runtime = Runtime_ocaml.Runtime (** {1 Helpers} *) -let is_empty_error (e : A.expr Pos.marked) : bool = - match Pos.unmark e with ELit LEmptyError -> true | _ -> false +let is_empty_error (e : 'm A.marked_expr) : bool = + match Marked.unmark e with ELit LEmptyError -> true | _ -> false let log_indent = ref 0 @@ -30,390 +31,384 @@ let log_indent = ref 0 let rec evaluate_operator (ctx : Ast.decl_ctx) - (op : A.operator Pos.marked) - (args : A.expr Pos.marked list) : A.expr Pos.marked = + (op : A.operator) + (pos : Pos.t) + (args : 'm A.marked_expr list) : 'm A.expr = (* Try to apply [div] and if a [Division_by_zero] exceptions is catched, use [op] to raise multispanned errors. *) - let apply_div_or_raise_err (div : unit -> A.expr) (op : A.operator Pos.marked) - : A.expr = + let apply_div_or_raise_err (div : unit -> 'm A.expr) : 'm A.expr = try div () with Division_by_zero -> Errors.raise_multispanned_error [ - Some "The division operator:", Pos.get_position op; - Some "The null denominator:", Pos.get_position (List.nth args 1); + Some "The division operator:", pos; + Some "The null denominator:", Ast.pos (List.nth args 1); ] "division by zero at runtime" in - let get_binop_args_pos (args : (A.expr * Pos.t) list) : - (string option * Pos.t) list = - [ - None, Pos.get_position (List.nth args 0); - None, Pos.get_position (List.nth args 1); - ] + let get_binop_args_pos = function + | (arg0 :: arg1 :: _ : 'm A.marked_expr list) -> + [None, Ast.pos arg0; None, Ast.pos arg1] + | _ -> assert false in (* Try to apply [cmp] and if a [UncomparableDurations] exceptions is catched, use [args] to raise multispanned errors. *) let apply_cmp_or_raise_err - (cmp : unit -> A.expr) - (args : (A.expr * Pos.t) list) : A.expr = + (cmp : unit -> 'm A.expr) + (args : 'm A.marked_expr list) : 'm A.expr = try cmp () with Runtime.UncomparableDurations -> Errors.raise_multispanned_error (get_binop_args_pos args) "Cannot compare together durations that cannot be converted to a \ precise number of days" in - Pos.same_pos_as - (match Pos.unmark op, List.map Pos.unmark args with - | A.Ternop A.Fold, [_f; _init; EArray es] -> - Pos.unmark - (List.fold_left - (fun acc e' -> + match op, List.map Marked.unmark args with + | A.Ternop A.Fold, [_f; _init; EArray es] -> + Marked.unmark + (List.fold_left + (fun acc e' -> + evaluate_expr ctx + (Marked.same_mark_as (A.EApp (List.nth args 0, [acc; e'])) e')) + (List.nth args 1) es) + | A.Binop A.And, [ELit (LBool b1); ELit (LBool b2)] -> + A.ELit (LBool (b1 && b2)) + | A.Binop A.Or, [ELit (LBool b1); ELit (LBool b2)] -> + A.ELit (LBool (b1 || b2)) + | A.Binop A.Xor, [ELit (LBool b1); ELit (LBool b2)] -> + A.ELit (LBool (b1 <> b2)) + | A.Binop (A.Add KInt), [ELit (LInt i1); ELit (LInt i2)] -> + A.ELit (LInt Runtime.(i1 +! i2)) + | A.Binop (A.Sub KInt), [ELit (LInt i1); ELit (LInt i2)] -> + A.ELit (LInt Runtime.(i1 -! i2)) + | A.Binop (A.Mult KInt), [ELit (LInt i1); ELit (LInt i2)] -> + A.ELit (LInt Runtime.(i1 *! i2)) + | A.Binop (A.Div KInt), [ELit (LInt i1); ELit (LInt i2)] -> + apply_div_or_raise_err (fun _ -> A.ELit (LInt Runtime.(i1 /! i2))) + | A.Binop (A.Add KRat), [ELit (LRat i1); ELit (LRat i2)] -> + A.ELit (LRat Runtime.(i1 +& i2)) + | A.Binop (A.Sub KRat), [ELit (LRat i1); ELit (LRat i2)] -> + A.ELit (LRat Runtime.(i1 -& i2)) + | A.Binop (A.Mult KRat), [ELit (LRat i1); ELit (LRat i2)] -> + A.ELit (LRat Runtime.(i1 *& i2)) + | A.Binop (A.Div KRat), [ELit (LRat i1); ELit (LRat i2)] -> + apply_div_or_raise_err (fun _ -> A.ELit (LRat Runtime.(i1 /& i2))) + | A.Binop (A.Add KMoney), [ELit (LMoney m1); ELit (LMoney m2)] -> + A.ELit (LMoney Runtime.(m1 +$ m2)) + | A.Binop (A.Sub KMoney), [ELit (LMoney m1); ELit (LMoney m2)] -> + A.ELit (LMoney Runtime.(m1 -$ m2)) + | A.Binop (A.Mult KMoney), [ELit (LMoney m1); ELit (LRat m2)] -> + A.ELit (LMoney Runtime.(m1 *$ m2)) + | A.Binop (A.Div KMoney), [ELit (LMoney m1); ELit (LMoney m2)] -> + apply_div_or_raise_err (fun _ -> A.ELit (LRat Runtime.(m1 /$ m2))) + | A.Binop (A.Add KDuration), [ELit (LDuration d1); ELit (LDuration d2)] -> + A.ELit (LDuration Runtime.(d1 +^ d2)) + | A.Binop (A.Sub KDuration), [ELit (LDuration d1); ELit (LDuration d2)] -> + A.ELit (LDuration Runtime.(d1 -^ d2)) + | A.Binop (A.Sub KDate), [ELit (LDate d1); ELit (LDate d2)] -> + A.ELit (LDuration Runtime.(d1 -@ d2)) + | A.Binop (A.Add KDate), [ELit (LDate d1); ELit (LDuration d2)] -> + A.ELit (LDate Runtime.(d1 +@ d2)) + | A.Binop (A.Div KDuration), [ELit (LDuration d1); ELit (LDuration d2)] -> + apply_div_or_raise_err (fun _ -> + try A.ELit (LRat Runtime.(d1 /^ d2)) + with Runtime.IndivisableDurations -> + Errors.raise_multispanned_error (get_binop_args_pos args) + "Cannot divide durations that cannot be converted to a precise \ + number of days") + | A.Binop (A.Mult KDuration), [ELit (LDuration d1); ELit (LInt i1)] -> + A.ELit (LDuration Runtime.(d1 *^ i1)) + | A.Binop (A.Lt KInt), [ELit (LInt i1); ELit (LInt i2)] -> + A.ELit (LBool Runtime.(i1 + A.ELit (LBool Runtime.(i1 <=! i2)) + | A.Binop (A.Gt KInt), [ELit (LInt i1); ELit (LInt i2)] -> + A.ELit (LBool Runtime.(i1 >! i2)) + | A.Binop (A.Gte KInt), [ELit (LInt i1); ELit (LInt i2)] -> + A.ELit (LBool Runtime.(i1 >=! i2)) + | A.Binop (A.Lt KRat), [ELit (LRat i1); ELit (LRat i2)] -> + A.ELit (LBool Runtime.(i1 <& i2)) + | A.Binop (A.Lte KRat), [ELit (LRat i1); ELit (LRat i2)] -> + A.ELit (LBool Runtime.(i1 <=& i2)) + | A.Binop (A.Gt KRat), [ELit (LRat i1); ELit (LRat i2)] -> + A.ELit (LBool Runtime.(i1 >& i2)) + | A.Binop (A.Gte KRat), [ELit (LRat i1); ELit (LRat i2)] -> + A.ELit (LBool Runtime.(i1 >=& i2)) + | A.Binop (A.Lt KMoney), [ELit (LMoney m1); ELit (LMoney m2)] -> + A.ELit (LBool Runtime.(m1 <$ m2)) + | A.Binop (A.Lte KMoney), [ELit (LMoney m1); ELit (LMoney m2)] -> + A.ELit (LBool Runtime.(m1 <=$ m2)) + | A.Binop (A.Gt KMoney), [ELit (LMoney m1); ELit (LMoney m2)] -> + A.ELit (LBool Runtime.(m1 >$ m2)) + | A.Binop (A.Gte KMoney), [ELit (LMoney m1); ELit (LMoney m2)] -> + A.ELit (LBool Runtime.(m1 >=$ m2)) + | A.Binop (A.Lt KDuration), [ELit (LDuration d1); ELit (LDuration d2)] -> + apply_cmp_or_raise_err (fun _ -> A.ELit (LBool Runtime.(d1 <^ d2))) args + | A.Binop (A.Lte KDuration), [ELit (LDuration d1); ELit (LDuration d2)] -> + apply_cmp_or_raise_err (fun _ -> A.ELit (LBool Runtime.(d1 <=^ d2))) args + | A.Binop (A.Gt KDuration), [ELit (LDuration d1); ELit (LDuration d2)] -> + apply_cmp_or_raise_err (fun _ -> A.ELit (LBool Runtime.(d1 >^ d2))) args + | A.Binop (A.Gte KDuration), [ELit (LDuration d1); ELit (LDuration d2)] -> + apply_cmp_or_raise_err (fun _ -> A.ELit (LBool Runtime.(d1 >=^ d2))) args + | A.Binop (A.Lt KDate), [ELit (LDate d1); ELit (LDate d2)] -> + A.ELit (LBool Runtime.(d1 <@ d2)) + | A.Binop (A.Lte KDate), [ELit (LDate d1); ELit (LDate d2)] -> + A.ELit (LBool Runtime.(d1 <=@ d2)) + | A.Binop (A.Gt KDate), [ELit (LDate d1); ELit (LDate d2)] -> + A.ELit (LBool Runtime.(d1 >@ d2)) + | A.Binop (A.Gte KDate), [ELit (LDate d1); ELit (LDate d2)] -> + A.ELit (LBool Runtime.(d1 >=@ d2)) + | A.Binop A.Eq, [ELit LUnit; ELit LUnit] -> A.ELit (LBool true) + | A.Binop A.Eq, [ELit (LDuration d1); ELit (LDuration d2)] -> + A.ELit (LBool Runtime.(d1 =^ d2)) + | A.Binop A.Eq, [ELit (LDate d1); ELit (LDate d2)] -> + A.ELit (LBool Runtime.(d1 =@ d2)) + | A.Binop A.Eq, [ELit (LMoney m1); ELit (LMoney m2)] -> + A.ELit (LBool Runtime.(m1 =$ m2)) + | A.Binop A.Eq, [ELit (LRat i1); ELit (LRat i2)] -> + A.ELit (LBool Runtime.(i1 =& i2)) + | A.Binop A.Eq, [ELit (LInt i1); ELit (LInt i2)] -> + A.ELit (LBool Runtime.(i1 =! i2)) + | A.Binop A.Eq, [ELit (LBool b1); ELit (LBool b2)] -> A.ELit (LBool (b1 = b2)) + | A.Binop A.Eq, [EArray es1; EArray es2] -> + A.ELit + (LBool + (try + List.for_all2 + (fun e1 e2 -> + match evaluate_operator ctx op pos [e1; e2] with + | A.ELit (LBool b) -> b + | _ -> assert false + (* should not happen *)) + es1 es2 + with Invalid_argument _ -> false)) + | A.Binop A.Eq, [ETuple (es1, s1); ETuple (es2, s2)] -> + A.ELit + (LBool + (try + s1 = s2 + && List.for_all2 + (fun e1 e2 -> + match evaluate_operator ctx op pos [e1; e2] with + | A.ELit (LBool b) -> b + | _ -> assert false + (* should not happen *)) + es1 es2 + with Invalid_argument _ -> false)) + | A.Binop A.Eq, [EInj (e1, i1, en1, _ts1); EInj (e2, i2, en2, _ts2)] -> + A.ELit + (LBool + (try + en1 = en2 + && i1 = i2 + && + match evaluate_operator ctx op pos [e1; e2] with + | A.ELit (LBool b) -> b + | _ -> assert false + (* should not happen *) + with Invalid_argument _ -> false)) + | A.Binop A.Eq, [_; _] -> + A.ELit (LBool false) (* comparing anything else return false *) + | A.Binop A.Neq, [_; _] -> ( + match evaluate_operator ctx (A.Binop A.Eq) pos args with + | A.ELit (A.LBool b) -> A.ELit (A.LBool (not b)) + | _ -> assert false (*should not happen *)) + | A.Binop A.Concat, [A.EArray es1; A.EArray es2] -> A.EArray (es1 @ es2) + | A.Binop A.Map, [_; A.EArray es] -> + A.EArray + (List.map + (fun e' -> + evaluate_expr ctx + (Marked.same_mark_as (A.EApp (List.nth args 0, [e'])) e')) + es) + | A.Binop A.Filter, [_; A.EArray es] -> + A.EArray + (List.filter + (fun e' -> + match evaluate_expr ctx - (Pos.same_pos_as (A.EApp (List.nth args 0, [acc; e'])) e')) - (List.nth args 1) es) - | A.Binop A.And, [ELit (LBool b1); ELit (LBool b2)] -> - A.ELit (LBool (b1 && b2)) - | A.Binop A.Or, [ELit (LBool b1); ELit (LBool b2)] -> - A.ELit (LBool (b1 || b2)) - | A.Binop A.Xor, [ELit (LBool b1); ELit (LBool b2)] -> - A.ELit (LBool (b1 <> b2)) - | A.Binop (A.Add KInt), [ELit (LInt i1); ELit (LInt i2)] -> - A.ELit (LInt Runtime.(i1 +! i2)) - | A.Binop (A.Sub KInt), [ELit (LInt i1); ELit (LInt i2)] -> - A.ELit (LInt Runtime.(i1 -! i2)) - | A.Binop (A.Mult KInt), [ELit (LInt i1); ELit (LInt i2)] -> - A.ELit (LInt Runtime.(i1 *! i2)) - | A.Binop (A.Div KInt), [ELit (LInt i1); ELit (LInt i2)] -> - apply_div_or_raise_err (fun _ -> A.ELit (LInt Runtime.(i1 /! i2))) op - | A.Binop (A.Add KRat), [ELit (LRat i1); ELit (LRat i2)] -> - A.ELit (LRat Runtime.(i1 +& i2)) - | A.Binop (A.Sub KRat), [ELit (LRat i1); ELit (LRat i2)] -> - A.ELit (LRat Runtime.(i1 -& i2)) - | A.Binop (A.Mult KRat), [ELit (LRat i1); ELit (LRat i2)] -> - A.ELit (LRat Runtime.(i1 *& i2)) - | A.Binop (A.Div KRat), [ELit (LRat i1); ELit (LRat i2)] -> - apply_div_or_raise_err (fun _ -> A.ELit (LRat Runtime.(i1 /& i2))) op - | A.Binop (A.Add KMoney), [ELit (LMoney m1); ELit (LMoney m2)] -> - A.ELit (LMoney Runtime.(m1 +$ m2)) - | A.Binop (A.Sub KMoney), [ELit (LMoney m1); ELit (LMoney m2)] -> - A.ELit (LMoney Runtime.(m1 -$ m2)) - | A.Binop (A.Mult KMoney), [ELit (LMoney m1); ELit (LRat m2)] -> - A.ELit (LMoney Runtime.(m1 *$ m2)) - | A.Binop (A.Div KMoney), [ELit (LMoney m1); ELit (LMoney m2)] -> - apply_div_or_raise_err (fun _ -> A.ELit (LRat Runtime.(m1 /$ m2))) op - | A.Binop (A.Add KDuration), [ELit (LDuration d1); ELit (LDuration d2)] -> - A.ELit (LDuration Runtime.(d1 +^ d2)) - | A.Binop (A.Sub KDuration), [ELit (LDuration d1); ELit (LDuration d2)] -> - A.ELit (LDuration Runtime.(d1 -^ d2)) - | A.Binop (A.Sub KDate), [ELit (LDate d1); ELit (LDate d2)] -> - A.ELit (LDuration Runtime.(d1 -@ d2)) - | A.Binop (A.Add KDate), [ELit (LDate d1); ELit (LDuration d2)] -> - A.ELit (LDate Runtime.(d1 +@ d2)) - (* | A.Binop (A.Div KDuration), [ELit (LDuration d1); ELit (LDuration d2)] -> - * apply_div_or_raise_err - * (fun _ -> - * try A.ELit (LRat Runtime.(d1 /^ d2)) - * with Runtime.IndivisableDurations -> - * Errors.raise_multispanned_error (get_binop_args_pos args) - * "Cannot divide durations that cannot be converted to a precise \ - * number of days") - * op *) - | A.Binop (A.Mult KDuration), [ELit (LDuration d1); ELit (LInt i1)] -> - A.ELit (LDuration Runtime.(d1 *^ i1)) - | A.Binop (A.Lt KInt), [ELit (LInt i1); ELit (LInt i2)] -> - A.ELit (LBool Runtime.(i1 - A.ELit (LBool Runtime.(i1 <=! i2)) - | A.Binop (A.Gt KInt), [ELit (LInt i1); ELit (LInt i2)] -> - A.ELit (LBool Runtime.(i1 >! i2)) - | A.Binop (A.Gte KInt), [ELit (LInt i1); ELit (LInt i2)] -> - A.ELit (LBool Runtime.(i1 >=! i2)) - | A.Binop (A.Lt KRat), [ELit (LRat i1); ELit (LRat i2)] -> - A.ELit (LBool Runtime.(i1 <& i2)) - | A.Binop (A.Lte KRat), [ELit (LRat i1); ELit (LRat i2)] -> - A.ELit (LBool Runtime.(i1 <=& i2)) - | A.Binop (A.Gt KRat), [ELit (LRat i1); ELit (LRat i2)] -> - A.ELit (LBool Runtime.(i1 >& i2)) - | A.Binop (A.Gte KRat), [ELit (LRat i1); ELit (LRat i2)] -> - A.ELit (LBool Runtime.(i1 >=& i2)) - | A.Binop (A.Lt KMoney), [ELit (LMoney m1); ELit (LMoney m2)] -> - A.ELit (LBool Runtime.(m1 <$ m2)) - | A.Binop (A.Lte KMoney), [ELit (LMoney m1); ELit (LMoney m2)] -> - A.ELit (LBool Runtime.(m1 <=$ m2)) - | A.Binop (A.Gt KMoney), [ELit (LMoney m1); ELit (LMoney m2)] -> - A.ELit (LBool Runtime.(m1 >$ m2)) - | A.Binop (A.Gte KMoney), [ELit (LMoney m1); ELit (LMoney m2)] -> - A.ELit (LBool Runtime.(m1 >=$ m2)) - | A.Binop (A.Lt KDuration), [ELit (LDuration d1); ELit (LDuration d2)] -> - apply_cmp_or_raise_err (fun _ -> A.ELit (LBool Runtime.(d1 <^ d2))) args - | A.Binop (A.Lte KDuration), [ELit (LDuration d1); ELit (LDuration d2)] -> - apply_cmp_or_raise_err (fun _ -> A.ELit (LBool Runtime.(d1 <=^ d2))) args - | A.Binop (A.Gt KDuration), [ELit (LDuration d1); ELit (LDuration d2)] -> - apply_cmp_or_raise_err (fun _ -> A.ELit (LBool Runtime.(d1 >^ d2))) args - | A.Binop (A.Gte KDuration), [ELit (LDuration d1); ELit (LDuration d2)] -> - apply_cmp_or_raise_err (fun _ -> A.ELit (LBool Runtime.(d1 >=^ d2))) args - | A.Binop (A.Lt KDate), [ELit (LDate d1); ELit (LDate d2)] -> - A.ELit (LBool Runtime.(d1 <@ d2)) - | A.Binop (A.Lte KDate), [ELit (LDate d1); ELit (LDate d2)] -> - A.ELit (LBool Runtime.(d1 <=@ d2)) - | A.Binop (A.Gt KDate), [ELit (LDate d1); ELit (LDate d2)] -> - A.ELit (LBool Runtime.(d1 >@ d2)) - | A.Binop (A.Gte KDate), [ELit (LDate d1); ELit (LDate d2)] -> - A.ELit (LBool Runtime.(d1 >=@ d2)) - | A.Binop A.Eq, [ELit LUnit; ELit LUnit] -> A.ELit (LBool true) - | A.Binop A.Eq, [ELit (LDuration d1); ELit (LDuration d2)] -> - A.ELit (LBool Runtime.(d1 =^ d2)) - | A.Binop A.Eq, [ELit (LDate d1); ELit (LDate d2)] -> - A.ELit (LBool Runtime.(d1 =@ d2)) - | A.Binop A.Eq, [ELit (LMoney m1); ELit (LMoney m2)] -> - A.ELit (LBool Runtime.(m1 =$ m2)) - | A.Binop A.Eq, [ELit (LRat i1); ELit (LRat i2)] -> - A.ELit (LBool Runtime.(i1 =& i2)) - | A.Binop A.Eq, [ELit (LInt i1); ELit (LInt i2)] -> - A.ELit (LBool Runtime.(i1 =! i2)) - | A.Binop A.Eq, [ELit (LBool b1); ELit (LBool b2)] -> - A.ELit (LBool (b1 = b2)) - | A.Binop A.Eq, [EArray es1; EArray es2] -> - A.ELit - (LBool - (try - List.for_all2 - (fun e1 e2 -> - match Pos.unmark (evaluate_operator ctx op [e1; e2]) with - | A.ELit (LBool b) -> b - | _ -> assert false - (* should not happen *)) - es1 es2 - with Invalid_argument _ -> false)) - | A.Binop A.Eq, [ETuple (es1, s1); ETuple (es2, s2)] -> - A.ELit - (LBool - (try - s1 = s2 - && List.for_all2 - (fun e1 e2 -> - match Pos.unmark (evaluate_operator ctx op [e1; e2]) with - | A.ELit (LBool b) -> b - | _ -> assert false - (* should not happen *)) - es1 es2 - with Invalid_argument _ -> false)) - | A.Binop A.Eq, [EInj (e1, i1, en1, _ts1); EInj (e2, i2, en2, _ts2)] -> - A.ELit - (LBool - (try - en1 = en2 && i1 = i2 - && - match Pos.unmark (evaluate_operator ctx op [e1; e2]) with - | A.ELit (LBool b) -> b - | _ -> assert false - (* should not happen *) - with Invalid_argument _ -> false)) - | A.Binop A.Eq, [_; _] -> - A.ELit (LBool false) (* comparing anything else return false *) - | A.Binop A.Neq, [_; _] -> ( - match - Pos.unmark - (evaluate_operator ctx (Pos.same_pos_as (A.Binop A.Eq) op) args) - with - | A.ELit (A.LBool b) -> A.ELit (A.LBool (not b)) - | _ -> assert false (*should not happen *)) - | A.Binop A.Concat, [A.EArray es1; A.EArray es2] -> A.EArray (es1 @ es2) - | A.Binop A.Map, [_; A.EArray es] -> - A.EArray - (List.map - (fun e' -> - evaluate_expr ctx - (Pos.same_pos_as (A.EApp (List.nth args 0, [e'])) e')) - es) - | A.Binop A.Filter, [_; A.EArray es] -> - A.EArray - (List.filter - (fun e' -> - match - evaluate_expr ctx - (Pos.same_pos_as (A.EApp (List.nth args 0, [e'])) e') - with - | A.ELit (A.LBool b), _ -> b - | _ -> - Errors.raise_spanned_error - (Pos.get_position (List.nth args 0)) - "This predicate evaluated to something else than a boolean \ - (should not happen if the term was well-typed)") - es) - | A.Binop _, ([ELit LEmptyError; _] | [_; ELit LEmptyError]) -> - A.ELit LEmptyError - | A.Unop (A.Minus KInt), [ELit (LInt i)] -> - A.ELit (LInt Runtime.(integer_of_int 0 -! i)) - | A.Unop (A.Minus KRat), [ELit (LRat i)] -> - A.ELit (LRat Runtime.(decimal_of_string "0" -& i)) - | A.Unop (A.Minus KMoney), [ELit (LMoney i)] -> - A.ELit (LMoney Runtime.(money_of_units_int 0 -$ i)) - | A.Unop (A.Minus KDuration), [ELit (LDuration i)] -> - A.ELit (LDuration Runtime.(~-^i)) - | A.Unop A.Not, [ELit (LBool b)] -> A.ELit (LBool (not b)) - | A.Unop A.Length, [EArray es] -> - A.ELit (LInt (Runtime.integer_of_int (List.length es))) - | A.Unop A.GetDay, [ELit (LDate d)] -> - A.ELit (LInt Runtime.(day_of_month_of_date d)) - | A.Unop A.GetMonth, [ELit (LDate d)] -> - A.ELit (LInt Runtime.(month_number_of_date d)) - | A.Unop A.GetYear, [ELit (LDate d)] -> - A.ELit (LInt Runtime.(year_of_date d)) - | A.Unop A.IntToRat, [ELit (LInt i)] -> - A.ELit (LRat Runtime.(decimal_of_integer i)) - | A.Unop A.RoundMoney, [ELit (LMoney m)] -> - A.ELit (LMoney Runtime.(money_round m)) - | A.Unop A.RoundDecimal, [ELit (LRat m)] -> - A.ELit (LRat Runtime.(decimal_round m)) - | A.Unop (A.Log (entry, infos)), [e'] -> - if !Cli.trace_flag then ( - match entry with - | VarDef _ -> - (* TODO: this usage of Format is broken, Formatting requires that all - is formatted in one pass, without going through intermediate - "%s" *) - Cli.log_format "%*s%a %a: %s" (!log_indent * 2) "" - Print.format_log_entry entry Print.format_uid_list infos - (match e' with - (* | Ast.EAbs _ -> Cli.with_style [ ANSITerminal.green ] - "" *) - | _ -> - let expr_str = - Format.asprintf "%a" - (Print.format_expr ctx ~debug:false) - (e', Pos.no_pos) - in - let expr_str = - Re.Pcre.substitute ~rex:(Re.Pcre.regexp "\n\\s*") - ~subst:(fun _ -> " ") - expr_str - in - Cli.with_style [ANSITerminal.green] "%s" expr_str) - | PosRecordIfTrueBool -> ( - let pos = Pos.get_position op in - match pos <> Pos.no_pos, e' with - | true, ELit (LBool true) -> - Cli.log_format "%*s%a%s:\n%s" (!log_indent * 2) "" - Print.format_log_entry entry - (Cli.with_style [ANSITerminal.green] "Definition applied") - (Cli.add_prefix_to_each_line (Pos.retrieve_loc_text pos) (fun _ -> - Format.asprintf "%*s" (!log_indent * 2) "")) - | _ -> ()) - | BeginCall -> - Cli.log_format "%*s%a %a" (!log_indent * 2) "" Print.format_log_entry - entry Print.format_uid_list infos; - log_indent := !log_indent + 1 - | EndCall -> - log_indent := !log_indent - 1; - Cli.log_format "%*s%a %a" (!log_indent * 2) "" Print.format_log_entry - entry Print.format_uid_list infos) - else (); - e' - | A.Unop _, [ELit LEmptyError] -> A.ELit LEmptyError - | _ -> - Errors.raise_multispanned_error - ([Some "Operator:", Pos.get_position op] - @ List.mapi - (fun i arg -> - ( Some - (Format.asprintf "Argument n°%d, value %a" (i + 1) - (Print.format_expr ctx ~debug:true) - arg), - Pos.get_position arg )) - args) - "Operator applied to the wrong arguments\n\ - (should not happen if the term was well-typed)") - op + (Marked.same_mark_as (A.EApp (List.nth args 0, [e'])) e') + with + | A.ELit (A.LBool b), _ -> b + | _ -> + Errors.raise_spanned_error + (A.pos (List.nth args 0)) + "This predicate evaluated to something else than a boolean \ + (should not happen if the term was well-typed)") + es) + | A.Binop _, ([ELit LEmptyError; _] | [_; ELit LEmptyError]) -> + A.ELit LEmptyError + | A.Unop (A.Minus KInt), [ELit (LInt i)] -> + A.ELit (LInt Runtime.(integer_of_int 0 -! i)) + | A.Unop (A.Minus KRat), [ELit (LRat i)] -> + A.ELit (LRat Runtime.(decimal_of_string "0" -& i)) + | A.Unop (A.Minus KMoney), [ELit (LMoney i)] -> + A.ELit (LMoney Runtime.(money_of_units_int 0 -$ i)) + | A.Unop (A.Minus KDuration), [ELit (LDuration i)] -> + A.ELit (LDuration Runtime.(~-^i)) + | A.Unop A.Not, [ELit (LBool b)] -> A.ELit (LBool (not b)) + | A.Unop A.Length, [EArray es] -> + A.ELit (LInt (Runtime.integer_of_int (List.length es))) + | A.Unop A.GetDay, [ELit (LDate d)] -> + A.ELit (LInt Runtime.(day_of_month_of_date d)) + | A.Unop A.GetMonth, [ELit (LDate d)] -> + A.ELit (LInt Runtime.(month_number_of_date d)) + | A.Unop A.GetYear, [ELit (LDate d)] -> A.ELit (LInt Runtime.(year_of_date d)) + | A.Unop A.FirstDayOfMonth, [ELit (LDate d)] -> + A.ELit (LDate Runtime.(first_day_of_month d)) + | A.Unop A.LastDayOfMonth, [ELit (LDate d)] -> + A.ELit (LDate Runtime.(first_day_of_month d)) + | A.Unop A.IntToRat, [ELit (LInt i)] -> + A.ELit (LRat Runtime.(decimal_of_integer i)) + | A.Unop A.MoneyToRat, [ELit (LMoney i)] -> + A.ELit (LRat Runtime.(decimal_of_money i)) + | A.Unop A.RatToMoney, [ELit (LRat i)] -> + A.ELit (LMoney Runtime.(money_of_decimal i)) + | A.Unop A.RoundMoney, [ELit (LMoney m)] -> + A.ELit (LMoney Runtime.(money_round m)) + | A.Unop A.RoundDecimal, [ELit (LRat m)] -> + A.ELit (LRat Runtime.(decimal_round m)) + | A.Unop (A.Log (entry, infos)), [e'] -> + if !Cli.trace_flag then ( + match entry with + | VarDef _ -> + (* TODO: this usage of Format is broken, Formatting requires that all is + formatted in one pass, without going through intermediate "%s" *) + Cli.log_format "%*s%a %a: %s" (!log_indent * 2) "" + Print.format_log_entry entry Print.format_uid_list infos + (match e' with + (* | Ast.EAbs _ -> Cli.with_style [ ANSITerminal.green ] + "" *) + | _ -> + let expr_str = + Format.asprintf "%a" + (Print.format_expr ctx ~debug:false) + (List.hd args) + in + let expr_str = + Re.Pcre.substitute ~rex:(Re.Pcre.regexp "\n\\s*") + ~subst:(fun _ -> " ") + expr_str + in + Cli.with_style [ANSITerminal.green] "%s" expr_str) + | PosRecordIfTrueBool -> ( + match pos <> Pos.no_pos, e' with + | true, ELit (LBool true) -> + Cli.log_format "%*s%a%s:\n%s" (!log_indent * 2) "" + Print.format_log_entry entry + (Cli.with_style [ANSITerminal.green] "Definition applied") + (Cli.add_prefix_to_each_line (Pos.retrieve_loc_text pos) (fun _ -> + Format.asprintf "%*s" (!log_indent * 2) "")) + | _ -> ()) + | BeginCall -> + Cli.log_format "%*s%a %a" (!log_indent * 2) "" Print.format_log_entry + entry Print.format_uid_list infos; + log_indent := !log_indent + 1 + | EndCall -> + log_indent := !log_indent - 1; + Cli.log_format "%*s%a %a" (!log_indent * 2) "" Print.format_log_entry + entry Print.format_uid_list infos) + else (); + e' + | A.Unop _, [ELit LEmptyError] -> A.ELit LEmptyError + | _ -> + Errors.raise_multispanned_error + ([Some "Operator:", pos] + @ List.mapi + (fun i arg -> + ( Some + (Format.asprintf "Argument n°%d, value %a" (i + 1) + (Print.format_expr ctx ~debug:true) + arg), + A.pos arg )) + args) + "Operator applied to the wrong arguments\n\ + (should not happen if the term was well-typed)" +>>>>>>> master -and evaluate_expr (ctx : Ast.decl_ctx) (e : A.expr Pos.marked) : - A.expr Pos.marked = - match Pos.unmark e with +and evaluate_expr (ctx : Ast.decl_ctx) (e : 'm A.marked_expr) : 'm A.marked_expr + = + match Marked.unmark e with | EVar _ -> - Errors.raise_spanned_error (Pos.get_position e) + Errors.raise_spanned_error (A.pos e) "free variable found at evaluation (should not happen if term was \ well-typed" | EApp (e1, args) -> ( let e1 = evaluate_expr ctx e1 in let args = List.map (evaluate_expr ctx) args in - match Pos.unmark e1 with - | EAbs ((binder, _), _) -> + match Marked.unmark e1 with + | EAbs (binder, _) -> if Bindlib.mbinder_arity binder = List.length args then evaluate_expr ctx - (Bindlib.msubst binder (Array.of_list (List.map Pos.unmark args))) + (Bindlib.msubst binder (Array.of_list (List.map Marked.unmark args))) else - Errors.raise_spanned_error (Pos.get_position e) + Errors.raise_spanned_error (A.pos e) "wrong function call, expected %d arguments, got %d" (Bindlib.mbinder_arity binder) (List.length args) - | EOp op -> - Pos.same_pos_as - (Pos.unmark (evaluate_operator ctx (Pos.same_pos_as op e1) args)) - e - | ELit LEmptyError -> Pos.same_pos_as (A.ELit LEmptyError) e + | EOp op -> Marked.same_mark_as (evaluate_operator ctx op (A.pos e) args) e + | ELit LEmptyError -> Marked.same_mark_as (A.ELit LEmptyError) e | _ -> - Errors.raise_spanned_error (Pos.get_position e) + Errors.raise_spanned_error (A.pos e) "function has not been reduced to a lambda at evaluation (should not \ happen if the term was well-typed") | EAbs _ | ELit _ | EOp _ -> e (* these are values *) | ETuple (es, s) -> let new_es = List.map (evaluate_expr ctx) es in if List.exists is_empty_error new_es then - Pos.same_pos_as (A.ELit LEmptyError) e - else Pos.same_pos_as (A.ETuple (new_es, s)) e + Marked.same_mark_as (A.ELit LEmptyError) e + else Marked.same_mark_as (A.ETuple (new_es, s)) e | ETupleAccess (e1, n, s, _) -> ( let e1 = evaluate_expr ctx e1 in - match Pos.unmark e1 with + match Marked.unmark e1 with | ETuple (es, s') -> ( (match s, s' with | None, None -> () | Some s, Some s' when s = s' -> () | _ -> Errors.raise_multispanned_error - [None, Pos.get_position e; None, Pos.get_position e1] + [None, A.pos e; None, A.pos e1] "Error during tuple access: not the same structs (should not happen \ if the term was well-typed)"); match List.nth_opt es n with | Some e' -> e' | None -> - Errors.raise_spanned_error (Pos.get_position e1) + Errors.raise_spanned_error (A.pos e1) "The tuple has %d components but the %i-th element was requested \ (should not happen if the term was well-type)" (List.length es) n) - | ELit LEmptyError -> Pos.same_pos_as (A.ELit LEmptyError) e + | ELit LEmptyError -> Marked.same_mark_as (A.ELit LEmptyError) e | _ -> - Errors.raise_spanned_error (Pos.get_position e1) + Errors.raise_spanned_error (A.pos e1) "The expression %a should be a tuple with %d components but is not \ (should not happen if the term was well-typed)" (Print.format_expr ctx ~debug:true) e n) | EInj (e1, n, en, ts) -> let e1' = evaluate_expr ctx e1 in - if is_empty_error e1' then Pos.same_pos_as (A.ELit LEmptyError) e - else Pos.same_pos_as (A.EInj (e1', n, en, ts)) e + if is_empty_error e1' then Marked.same_mark_as (A.ELit LEmptyError) e + else Marked.same_mark_as (A.EInj (e1', n, en, ts)) e | EMatch (e1, es, e_name) -> ( let e1 = evaluate_expr ctx e1 in - match Pos.unmark e1 with + match Marked.unmark e1 with | A.EInj (e1, n, e_name', _) -> if e_name <> e_name' then Errors.raise_multispanned_error - [None, Pos.get_position e; None, Pos.get_position e1] + [None, A.pos e; None, A.pos e1] "Error during match: two different enums found (should not happend \ if the term was well-typed)"; let es_n = match List.nth_opt es n with | Some es_n -> es_n | None -> - Errors.raise_spanned_error (Pos.get_position e) + Errors.raise_spanned_error (A.pos e) "sum type index error (should not happend if the term was \ well-typed)" in - let new_e = Pos.same_pos_as (A.EApp (es_n, [e1])) e in + let new_e = Marked.same_mark_as (A.EApp (es_n, [e1])) e in evaluate_expr ctx new_e - | A.ELit A.LEmptyError -> Pos.same_pos_as (A.ELit A.LEmptyError) e + | A.ELit A.LEmptyError -> Marked.same_mark_as (A.ELit A.LEmptyError) e | _ -> - Errors.raise_spanned_error (Pos.get_position e1) + Errors.raise_spanned_error (A.pos e1) "Expected a term having a sum type as an argument to a match (should \ not happend if the term was well-typed") | EDefault (exceptions, just, cons) -> ( @@ -422,12 +417,12 @@ and evaluate_expr (ctx : Ast.decl_ctx) (e : A.expr Pos.marked) : match List.length exceptions - empty_count with | 0 -> ( let just = evaluate_expr ctx just in - match Pos.unmark just with - | ELit LEmptyError -> Pos.same_pos_as (A.ELit LEmptyError) e + match Marked.unmark just with + | ELit LEmptyError -> Marked.same_mark_as (A.ELit LEmptyError) e | ELit (LBool true) -> evaluate_expr ctx cons - | ELit (LBool false) -> Pos.same_pos_as (A.ELit LEmptyError) e + | ELit (LBool false) -> Marked.same_mark_as (A.ELit LEmptyError) e | _ -> - Errors.raise_spanned_error (Pos.get_position e) + Errors.raise_spanned_error (A.pos e) "Default justification has not been reduced to a boolean at \ evaluation (should not happen if the term was well-typed") | 1 -> List.find (fun sub -> not (is_empty_error sub)) exceptions @@ -435,80 +430,125 @@ and evaluate_expr (ctx : Ast.decl_ctx) (e : A.expr Pos.marked) : Errors.raise_multispanned_error (List.map (fun except -> - ( Some "This consequence has a valid justification:", - Pos.get_position except )) + Some "This consequence has a valid justification:", A.pos except) (List.filter (fun sub -> not (is_empty_error sub)) exceptions)) "There is a conflict between multiple valid consequences for assigning \ the same variable.") | EIfThenElse (cond, et, ef) -> ( - match Pos.unmark (evaluate_expr ctx cond) with + match Marked.unmark (evaluate_expr ctx cond) with | ELit (LBool true) -> evaluate_expr ctx et | ELit (LBool false) -> evaluate_expr ctx ef - | ELit LEmptyError -> Pos.same_pos_as (A.ELit LEmptyError) e + | ELit LEmptyError -> Marked.same_mark_as (A.ELit LEmptyError) e | _ -> - Errors.raise_spanned_error (Pos.get_position cond) + Errors.raise_spanned_error (A.pos cond) "Expected a boolean literal for the result of this condition (should \ not happen if the term was well-typed)") | EArray es -> let new_es = List.map (evaluate_expr ctx) es in if List.exists is_empty_error new_es then - Pos.same_pos_as (A.ELit LEmptyError) e - else Pos.same_pos_as (A.EArray new_es) e + Marked.same_mark_as (A.ELit LEmptyError) e + else Marked.same_mark_as (A.EArray new_es) e | ErrorOnEmpty e' -> let e' = evaluate_expr ctx e' in - if Pos.unmark e' = A.ELit LEmptyError then - Errors.raise_spanned_error (Pos.get_position e') + if Marked.unmark e' = A.ELit LEmptyError then + Errors.raise_spanned_error (A.pos e') "This variable evaluated to an empty term (no rule that defined it \ applied in this situation)" else e' | EAssert e' -> ( - match Pos.unmark (evaluate_expr ctx e') with - | ELit (LBool true) -> Pos.same_pos_as (Ast.ELit LUnit) e' + match Marked.unmark (evaluate_expr ctx e') with + | ELit (LBool true) -> Marked.same_mark_as (Ast.ELit LUnit) e' | ELit (LBool false) -> ( - match Pos.unmark e' with + match Marked.unmark e' with | Ast.ErrorOnEmpty ( EApp - ( (Ast.EOp (Binop op), pos_op), + ( (Ast.EOp (Binop op), _), [((ELit _, _) as e1); ((ELit _, _) as e2)] ), _ ) | EApp ( (Ast.EOp (Ast.Unop (Ast.Log _)), _), [ ( Ast.EApp - ( (Ast.EOp (Binop op), pos_op), + ( (Ast.EOp (Binop op), _), [((ELit _, _) as e1); ((ELit _, _) as e2)] ), _ ); ] ) | EApp - ( (Ast.EOp (Binop op), pos_op), - [((ELit _, _) as e1); ((ELit _, _) as e2)] ) -> - Errors.raise_spanned_error (Pos.get_position e') - "Assertion failed: %a %a %a" + ((Ast.EOp (Binop op), _), [((ELit _, _) as e1); ((ELit _, _) as e2)]) + -> + Errors.raise_spanned_error (A.pos e') "Assertion failed: %a %a %a" (Print.format_expr ctx ~debug:false) - e1 Print.format_binop (op, pos_op) + e1 Print.format_binop op (Print.format_expr ctx ~debug:false) e2 | _ -> Cli.debug_format "%a" (Print.format_expr ctx) e'; - Errors.raise_spanned_error (Pos.get_position e') "Assertion failed") - | ELit LEmptyError -> Pos.same_pos_as (A.ELit LEmptyError) e + Errors.raise_spanned_error (A.pos e') "Assertion failed") + | ELit LEmptyError -> Marked.same_mark_as (A.ELit LEmptyError) e | _ -> - Errors.raise_spanned_error (Pos.get_position e') + Errors.raise_spanned_error (A.pos e') "Expected a boolean literal for the result of this assertion (should \ not happen if the term was well-typed)") (** {1 API} *) -let interpret_program (ctx : Ast.decl_ctx) (e : Ast.expr Pos.marked) : - (Uid.MarkedString.info * Ast.expr Pos.marked) list = - match Pos.unmark (evaluate_expr ctx e) with - | Ast.EAbs (_, [(Ast.TTuple (taus, Some s_in), _)]) -> ( - let application_term = List.map (fun _ -> Ast.empty_thunked_term) taus in - let to_interpret = - ( Ast.EApp (e, [Ast.ETuple (application_term, Some s_in), Pos.no_pos]), - Pos.no_pos ) +let interpret_program : + 'm. + Ast.decl_ctx -> + 'm Ast.marked_expr -> + (Uid.MarkedString.info * 'm Ast.marked_expr) list = + fun (ctx : Ast.decl_ctx) (e : 'm Ast.marked_expr) : + (Uid.MarkedString.info * 'm Ast.marked_expr) list -> + match evaluate_expr ctx e with + | Ast.EAbs (_, [((Ast.TTuple (taus, Some s_in), _) as targs)]), mark_e -> + begin + (* At this point, the interpreter seeks to execute the scope but does not + have a way to retrieve input values from the command line. [taus] contain + the types of the scope arguments. For [context] arguments, we cann + provide an empty thunked term. But for [input] arguments of another type, + we cannot provide anything so we have to fail. *) + let application_term = + List.map + (fun ty -> + match Marked.unmark ty with + | A.TArrow ((A.TLit A.TUnit, _), ty_in) -> + Ast.empty_thunked_term + (A.map_mark (fun pos -> pos) (fun _ -> ty_in) mark_e) + | _ -> + Errors.raise_spanned_error (Marked.get_mark ty) + "This scope needs input arguments to be executed. But the Catala \ + built-in interpreter does not have a way to retrieve input \ + values from the command line, so it cannot execute this scope. \ + Please create another scope thatprovide the input arguments to \ + this one and execute it instead. ") + taus in - match Pos.unmark (evaluate_expr ctx to_interpret) with + let to_interpret = + ( Ast.EApp + ( e, + [ + ( Ast.ETuple (application_term, Some s_in), + let pos = + match application_term with + | a :: _ -> A.pos a + | [] -> Pos.no_pos + in + A.map_mark (fun _ -> pos) (fun _ -> targs) mark_e ); + ] ), + A.map_mark + (fun pos -> pos) + (fun ty -> + match application_term, ty with + | [], t_out -> t_out + | _ :: _, (A.TArrow (_, t_out), _) -> t_out + | _ :: _, (_, bad_pos) -> + Errors.raise_spanned_error bad_pos + "@[(bug) Result of interpretation doesn't have the \ + expected type:@ @[%a@]@]" + (Print.format_typ ctx) (fst @@ ty)) + mark_e ) + in + match Marked.unmark (evaluate_expr ctx to_interpret) with | Ast.ETuple (args, Some s_out) -> let s_out_fields = List.map @@ -517,10 +557,11 @@ let interpret_program (ctx : Ast.decl_ctx) (e : Ast.expr Pos.marked) : in List.map2 (fun arg var -> var, arg) args s_out_fields | _ -> - Errors.raise_spanned_error (Pos.get_position e) + Errors.raise_spanned_error (A.pos e) "The interpretation of a program should always yield a struct \ - corresponding to the scope variables") + corresponding to the scope variables" + end | _ -> - Errors.raise_spanned_error (Pos.get_position e) + Errors.raise_spanned_error (A.pos e) "The interpreter can only interpret terms starting with functions having \ thunked arguments" diff --git a/compiler/dcalc/interpreter.mli b/compiler/dcalc/interpreter.mli index 0e6a95a5..4190c2f1 100644 --- a/compiler/dcalc/interpreter.mli +++ b/compiler/dcalc/interpreter.mli @@ -18,13 +18,13 @@ open Utils -val evaluate_expr : Ast.decl_ctx -> Ast.expr Pos.marked -> Ast.expr Pos.marked +val evaluate_expr : Ast.decl_ctx -> 'm Ast.marked_expr -> 'm Ast.marked_expr (** Evaluates an expression according to the semantics of the default calculus. *) val interpret_program : Ast.decl_ctx -> - Ast.expr Pos.marked -> - (Uid.MarkedString.info * Ast.expr Pos.marked) list + 'm Ast.marked_expr -> + (Uid.MarkedString.info * 'm Ast.marked_expr) list (** Interprets a program. This function expects an expression typed as a function whose argument are all thunked. The function is executed by providing for each argument a thunked empty default. Returns a list of all diff --git a/compiler/dcalc/optimizations.ml b/compiler/dcalc/optimizations.ml index ea93cb36..34d4dc7c 100644 --- a/compiler/dcalc/optimizations.ml +++ b/compiler/dcalc/optimizations.ml @@ -18,15 +18,15 @@ open Utils open Ast type partial_evaluation_ctx = { - var_values : expr Pos.marked Ast.VarMap.t; + var_values : typed marked_expr Ast.VarMap.t; decl_ctx : decl_ctx; } -let rec partial_evaluation (ctx : partial_evaluation_ctx) (e : expr Pos.marked) - : expr Pos.marked Bindlib.box = - let pos = Pos.get_position e in +let rec partial_evaluation (ctx : partial_evaluation_ctx) (e : 'm marked_expr) : + 'm marked_expr Bindlib.box = + let pos = Marked.get_mark e in let rec_helper = partial_evaluation ctx in - match Pos.unmark e with + match Marked.unmark e with | EApp ( (( EOp (Unop Not), _ | EApp ((EOp (Unop (Log _)), _), [(EOp (Unop Not), _)]), _ ) as op), @@ -64,7 +64,7 @@ let rec partial_evaluation (ctx : partial_evaluation_ctx) (e : expr Pos.marked) ELit (LBool false), pos | _ -> EApp (op, [e1; e2]), pos)) (rec_helper e1) (rec_helper e2) - | EVar (x, _) -> Bindlib.box_apply (fun x -> x, pos) (Bindlib.box_var x) + | EVar x -> Bindlib.box_apply (fun x -> x, pos) (Bindlib.box_var x) | ETuple (args, s_name) -> Bindlib.box_apply (fun args -> ETuple (args, s_name), pos) @@ -93,18 +93,16 @@ let rec partial_evaluation (ctx : partial_evaluation_ctx) (e : expr Pos.marked) (fun args -> EArray args, pos) (List.map rec_helper args |> Bindlib.box_list) | ELit l -> Bindlib.box (ELit l, pos) - | EAbs ((binder, binder_pos), typs) -> + | EAbs (binder, typs) -> let vars, body = Bindlib.unmbind binder in let new_body = rec_helper body in let new_binder = Bindlib.bind_mvar vars new_body in - Bindlib.box_apply - (fun binder -> EAbs ((binder, binder_pos), typs), pos) - new_binder + Bindlib.box_apply (fun binder -> EAbs (binder, typs), pos) new_binder | EApp (f, args) -> Bindlib.box_apply2 (fun f args -> - match Pos.unmark f with - | EAbs ((binder, _pos_binder), _ts) -> + match Marked.unmark f with + | EAbs (binder, _ts) -> (* beta reduction *) Bindlib.msubst binder (List.map fst args |> Array.of_list) | _ -> EApp (f, args), pos) @@ -119,7 +117,7 @@ let rec partial_evaluation (ctx : partial_evaluation_ctx) (e : expr Pos.marked) match ( List.filter (fun except -> - match Pos.unmark except with + match Marked.unmark except with | ELit LEmptyError -> false | _ -> true) exceptions @@ -166,7 +164,7 @@ let rec partial_evaluation (ctx : partial_evaluation_ctx) (e : expr Pos.marked) | EIfThenElse (e1, e2, e3) -> Bindlib.box_apply3 (fun e1 e2 e3 -> - match Pos.unmark e1, Pos.unmark e2, Pos.unmark e3 with + match Marked.unmark e1, Marked.unmark e2, Marked.unmark e3 with | ELit (LBool true), _, _ | EApp ((EOp (Unop (Log _)), _), [(ELit (LBool true), _)]), _, _ -> e2 @@ -185,14 +183,14 @@ let rec partial_evaluation (ctx : partial_evaluation_ctx) (e : expr Pos.marked) | ErrorOnEmpty e1 -> Bindlib.box_apply (fun e1 -> ErrorOnEmpty e1, pos) (rec_helper e1) -let optimize_expr (decl_ctx : decl_ctx) (e : expr Pos.marked) = +let optimize_expr (decl_ctx : decl_ctx) (e : 'm marked_expr) = partial_evaluation { var_values = VarMap.empty; decl_ctx } e let rec scope_lets_map - (t : 'a -> expr Pos.marked -> expr Pos.marked Bindlib.box) + (t : 'a -> 'm marked_expr -> 'm marked_expr Bindlib.box) (ctx : 'a) - (scope_body_expr : expr scope_body_expr) : expr scope_body_expr Bindlib.box - = + (scope_body_expr : ('m expr, 'm) scope_body_expr) : + ('m expr, 'm) scope_body_expr Bindlib.box = match scope_body_expr with | Result e -> Bindlib.box_apply (fun e' -> Result e') (t ctx e) | ScopeLet scope_let -> @@ -211,9 +209,9 @@ let rec scope_lets_map new_scope_let_expr new_next let rec scopes_map - (t : 'a -> expr Pos.marked -> expr Pos.marked Bindlib.box) + (t : 'a -> 'm marked_expr -> 'm marked_expr Bindlib.box) (ctx : 'a) - (scopes : expr scopes) : expr scopes Bindlib.box = + (scopes : ('m expr, 'm) scopes) : ('m expr, 'm) scopes Bindlib.box = match scopes with | Nil -> Bindlib.box Nil | ScopeDef scope_def -> @@ -242,15 +240,16 @@ let rec scopes_map new_scope_body_expr new_scope_next let program_map - (t : 'a -> expr Pos.marked -> expr Pos.marked Bindlib.box) + (t : 'a -> 'm marked_expr -> 'm marked_expr Bindlib.box) (ctx : 'a) - (p : program) : program Bindlib.box = + (p : 'm program) : 'm program Bindlib.box = Bindlib.box_apply (fun new_scopes -> { p with scopes = new_scopes }) (scopes_map t ctx p.scopes) -let optimize_program (p : program) : program = +let optimize_program (p : 'm program) : untyped program = Bindlib.unbox (program_map partial_evaluation { var_values = VarMap.empty; decl_ctx = p.decl_ctx } p) + |> untype_program diff --git a/compiler/dcalc/optimizations.mli b/compiler/dcalc/optimizations.mli index f29db96b..53c7a600 100644 --- a/compiler/dcalc/optimizations.mli +++ b/compiler/dcalc/optimizations.mli @@ -17,8 +17,7 @@ (** Optimization passes for default calculus programs and expressions *) -open Utils open Ast -val optimize_expr : decl_ctx -> expr Pos.marked -> expr Pos.marked Bindlib.box -val optimize_program : program -> program +val optimize_expr : decl_ctx -> 'm marked_expr -> 'm marked_expr Bindlib.box +val optimize_program : 'm program -> untyped program diff --git a/compiler/dcalc/print.ml b/compiler/dcalc/print.ml index b1162f33..ac94560d 100644 --- a/compiler/dcalc/print.ml +++ b/compiler/dcalc/print.ml @@ -16,21 +16,10 @@ open Utils open Ast +open String_common -let typ_needs_parens (e : typ Pos.marked) : bool = - match Pos.unmark e with TArrow _ | TArray _ -> true | _ -> false - -let is_uppercase (x : CamomileLibraryDefault.Camomile.UChar.t) : bool = - try - match CamomileLibraryDefault.Camomile.UCharInfo.general_category x with - | `Ll -> false - | `Lu -> true - | _ -> false - with _ -> true - -let begins_with_uppercase (s : string) : bool = - let first_letter = CamomileLibraryDefault.Camomile.UTF8.get s 0 in - is_uppercase first_letter +let typ_needs_parens (e : typ) : bool = + match e with TArrow _ | TArray _ -> true | _ -> false let format_uid_list (fmt : Format.formatter) @@ -41,7 +30,7 @@ let format_uid_list (fun fmt info -> Format.fprintf fmt "%a" (Utils.Cli.format_with_style - (if begins_with_uppercase (Pos.unmark info) then + (if begins_with_uppercase (Marked.unmark info) then [ANSITerminal.red] else [])) (Format.asprintf "%a" Utils.Uid.MarkedString.format_info info))) @@ -79,23 +68,21 @@ let format_enum_constructor (fmt : Format.formatter) (c : EnumConstructor.t) : (Utils.Cli.format_with_style [ANSITerminal.magenta]) (Format.asprintf "%a" EnumConstructor.format_t c) -let rec format_typ - (ctx : Ast.decl_ctx) - (fmt : Format.formatter) - (typ : typ Pos.marked) : unit = +let rec format_typ (ctx : Ast.decl_ctx) (fmt : Format.formatter) (typ : typ) : + unit = let format_typ = format_typ ctx in - let format_typ_with_parens (fmt : Format.formatter) (t : typ Pos.marked) = + let format_typ_with_parens (fmt : Format.formatter) (t : typ) = if typ_needs_parens t then Format.fprintf fmt "(%a)" format_typ t else Format.fprintf fmt "%a" format_typ t in - match Pos.unmark typ with + match typ with | TLit l -> Format.fprintf fmt "%a" format_tlit l | TTuple (ts, None) -> Format.fprintf fmt "@[(%a)@]" (Format.pp_print_list ~pp_sep:(fun fmt () -> Format.fprintf fmt "@ %a@ " format_operator "*") (fun fmt t -> Format.fprintf fmt "%a" format_typ t)) - ts + (List.map Marked.unmark ts) | TTuple (_args, Some s) -> Format.fprintf fmt "@[%a%a%a%a@]" Ast.StructName.format_t s format_punctuation "{" @@ -106,7 +93,9 @@ let rec format_typ Format.fprintf fmt "%a%a%a%a@ %a" format_punctuation "\"" StructFieldName.format_t field format_punctuation "\"" format_punctuation ":" format_typ typ)) - (StructMap.find s ctx.ctx_structs) + (List.map + (fun (c, t) -> c, Marked.unmark t) + (StructMap.find s ctx.ctx_structs)) format_punctuation "}" | TEnum (_, e) -> Format.fprintf fmt "@[%a%a%a%a@]" Ast.EnumName.format_t e @@ -117,19 +106,21 @@ let rec format_typ (fun fmt (case, typ) -> Format.fprintf fmt "%a%a@ %a" format_enum_constructor case format_punctuation ":" format_typ typ)) - (EnumMap.find e ctx.ctx_enums) + (List.map + (fun (c, t) -> c, Marked.unmark t) + (EnumMap.find e ctx.ctx_enums)) format_punctuation "]" | TArrow (t1, t2) -> - Format.fprintf fmt "@[%a %a@ %a@]" format_typ_with_parens t1 - format_operator "→" format_typ t2 + Format.fprintf fmt "@[%a %a@ %a@]" format_typ_with_parens + (Marked.unmark t1) format_operator "→" format_typ (Marked.unmark t2) | TArray t1 -> Format.fprintf fmt "@[%a@ %a@]" format_base_type "array" format_typ - t1 + (Marked.unmark t1) | TAny -> format_base_type fmt "any" (* (EmileRolley) NOTE: seems to be factorizable with Lcalc.Print.format_lit. *) -let format_lit (fmt : Format.formatter) (l : lit Pos.marked) : unit = - match Pos.unmark l with +let format_lit (fmt : Format.formatter) (l : lit) : unit = + match l with | LBool b -> format_lit_style fmt (string_of_bool b) | LInt i -> format_lit_style fmt (Runtime.integer_to_string i) | LEmptyError -> format_lit_style fmt "∅ " @@ -158,9 +149,9 @@ let format_op_kind (fmt : Format.formatter) (k : op_kind) = | KDate -> "@" | KDuration -> "^") -let format_binop (fmt : Format.formatter) (op : binop Pos.marked) : unit = +let format_binop (fmt : Format.formatter) (op : binop) : unit = format_operator fmt - (match Pos.unmark op with + (match op with | Add k -> Format.asprintf "+%a" format_op_kind k | Sub k -> Format.asprintf "-%a" format_op_kind k | Mult k -> Format.asprintf "*%a" format_op_kind k @@ -178,8 +169,8 @@ let format_binop (fmt : Format.formatter) (op : binop Pos.marked) : unit = | Map -> "map" | Filter -> "filter") -let format_ternop (fmt : Format.formatter) (op : ternop Pos.marked) : unit = - match Pos.unmark op with Fold -> format_keyword fmt "fold" +let format_ternop (fmt : Format.formatter) (op : ternop) : unit = + match op with Fold -> format_keyword fmt "fold" let format_log_entry (fmt : Format.formatter) (entry : log_entry) : unit = Format.fprintf fmt "@<2>%s" @@ -189,9 +180,9 @@ let format_log_entry (fmt : Format.formatter) (entry : log_entry) : unit = | EndCall -> Utils.Cli.with_style [ANSITerminal.yellow] "← " | PosRecordIfTrueBool -> Utils.Cli.with_style [ANSITerminal.green] "☛ ") -let format_unop (fmt : Format.formatter) (op : unop Pos.marked) : unit = +let format_unop (fmt : Format.formatter) (op : unop) : unit = Format.fprintf fmt "%s" - (match Pos.unmark op with + (match op with | Minus _ -> "-" | Not -> "~" | Log (entry, infos) -> @@ -202,32 +193,36 @@ let format_unop (fmt : Format.formatter) (op : unop Pos.marked) : unit = infos | Length -> "length" | IntToRat -> "int_to_rat" + | MoneyToRat -> "money_to_rat" + | RatToMoney -> "rat_to_money" | GetDay -> "get_day" | GetMonth -> "get_month" | GetYear -> "get_year" + | FirstDayOfMonth -> "first_day_of_month" + | LastDayOfMonth -> "last_day_of_month" | RoundMoney -> "round_money" | RoundDecimal -> "round_decimal") -let needs_parens (e : expr Pos.marked) : bool = - match Pos.unmark e with EAbs _ | ETuple (_, Some _) -> true | _ -> false +let needs_parens (e : 'm marked_expr) : bool = + match Marked.unmark e with EAbs _ | ETuple (_, Some _) -> true | _ -> false -let format_var (fmt : Format.formatter) (v : Var.t) : unit = +let format_var (fmt : Format.formatter) (v : 'm Ast.var) : unit = Format.fprintf fmt "%s_%d" (Bindlib.name_of v) (Bindlib.uid_of v) let rec format_expr ?(debug : bool = false) (ctx : Ast.decl_ctx) (fmt : Format.formatter) - (e : expr Pos.marked) : unit = + (e : 'm marked_expr) : unit = let format_expr = format_expr ~debug ctx in - let format_with_parens (fmt : Format.formatter) (e : expr Pos.marked) = + let format_with_parens (fmt : Format.formatter) (e : 'm marked_expr) = if needs_parens e then Format.fprintf fmt "%a%a%a" format_punctuation "(" format_expr e format_punctuation ")" else Format.fprintf fmt "%a" format_expr e in - match Pos.unmark e with - | EVar v -> Format.fprintf fmt "%a" format_var (Pos.unmark v) + match Marked.unmark e with + | EVar v -> Format.fprintf fmt "%a" format_var v | ETuple (es, None) -> Format.fprintf fmt "@[%a%a%a@]" format_punctuation "(" (Format.pp_print_list @@ -274,10 +269,12 @@ let rec format_expr Format.fprintf fmt "@[%a %a%a@ %a@]" format_punctuation "|" format_enum_constructor c format_punctuation ":" format_expr e)) (List.combine es (List.map fst (Ast.EnumMap.find e_name ctx.ctx_enums))) - | ELit l -> format_lit fmt (Pos.same_pos_as l e) - | EApp ((EAbs ((binder, _), taus), _), args) -> + | ELit l -> format_lit fmt l + | EApp ((EAbs (binder, taus), _), args) -> let xs, body = Bindlib.unmbind binder in - let xs_tau = List.map2 (fun x tau -> x, tau) (Array.to_list xs) taus in + let xs_tau = + List.map2 (fun x tau -> x, Marked.unmark tau) (Array.to_list xs) taus + in let xs_tau_arg = List.map2 (fun (x, tau) arg -> x, tau, arg) xs_tau args in Format.fprintf fmt "%a%a" (Format.pp_print_list @@ -288,9 +285,11 @@ let rec format_expr (format_typ ctx) tau format_punctuation "=" format_expr arg format_keyword "in")) xs_tau_arg format_expr body - | EAbs ((binder, _), taus) -> + | EAbs (binder, taus) -> let xs, body = Bindlib.unmbind binder in - let xs_tau = List.map2 (fun x tau -> x, tau) (Array.to_list xs) taus in + let xs_tau = + List.map2 (fun x tau -> x, Marked.unmark tau) (Array.to_list xs) taus + in Format.fprintf fmt "@[%a @[%a@] %a@ %a@]" format_punctuation "λ" (Format.pp_print_list @@ -300,16 +299,16 @@ let rec format_expr format_punctuation ":" (format_typ ctx) tau format_punctuation ")")) xs_tau format_punctuation "→" format_expr body | EApp ((EOp (Binop ((Ast.Map | Ast.Filter) as op)), _), [arg1; arg2]) -> - Format.fprintf fmt "@[%a@ %a@ %a@]" format_binop (op, Pos.no_pos) + Format.fprintf fmt "@[%a@ %a@ %a@]" format_binop op format_with_parens arg1 format_with_parens arg2 | EApp ((EOp (Binop op), _), [arg1; arg2]) -> Format.fprintf fmt "@[%a@ %a@ %a@]" format_with_parens arg1 - format_binop (op, Pos.no_pos) format_with_parens arg2 + format_binop op format_with_parens arg2 | EApp ((EOp (Unop (Log _)), _), [arg1]) when not debug -> format_expr fmt arg1 | EApp ((EOp (Unop op), _), [arg1]) -> - Format.fprintf fmt "@[%a@ %a@]" format_unop (op, Pos.no_pos) - format_with_parens arg1 + Format.fprintf fmt "@[%a@ %a@]" format_unop op format_with_parens + arg1 | EApp (f, args) -> Format.fprintf fmt "@[%a@ %a@]" format_expr f (Format.pp_print_list @@ -320,9 +319,9 @@ let rec format_expr Format.fprintf fmt "@[%a@ %a@ %a@ %a@ %a@ %a@]" format_keyword "if" format_expr e1 format_keyword "then" format_expr e2 format_keyword "else" format_expr e3 - | EOp (Ternop op) -> Format.fprintf fmt "%a" format_ternop (op, Pos.no_pos) - | EOp (Binop op) -> Format.fprintf fmt "%a" format_binop (op, Pos.no_pos) - | EOp (Unop op) -> Format.fprintf fmt "%a" format_unop (op, Pos.no_pos) + | EOp (Ternop op) -> Format.fprintf fmt "%a" format_ternop op + | EOp (Binop op) -> Format.fprintf fmt "%a" format_binop op + | EOp (Unop op) -> Format.fprintf fmt "%a" format_unop op | EDefault (exceptions, just, cons) -> if List.length exceptions = 0 then Format.fprintf fmt "@[%a%a@ %a@ %a%a@]" format_punctuation "⟨" @@ -348,10 +347,13 @@ let format_scope ?(debug : bool = false) (ctx : decl_ctx) (fmt : Format.formatter) - ((n, s) : Ast.ScopeName.t * Ast.expr scope_body) = + ((n, s) : Ast.ScopeName.t * ('m Ast.expr, 'm) scope_body) = Format.fprintf fmt "@[%a %a =@ %a@]" format_keyword "let" Ast.ScopeName.format_t n (format_expr ctx ~debug) (Bindlib.unbox (Ast.build_whole_scope_expr ~make_abs:Ast.make_abs ~make_let_in:Ast.make_let_in ~box_expr:Ast.box_expr ctx s - (Pos.get_position (Ast.ScopeName.get_info n)))) + (Ast.map_mark + (fun _ -> Marked.get_mark (Ast.ScopeName.get_info n)) + (fun ty -> ty) + (Ast.get_scope_body_mark s)))) diff --git a/compiler/dcalc/print.mli b/compiler/dcalc/print.mli index f02b3c76..8a3ae7a0 100644 --- a/compiler/dcalc/print.mli +++ b/compiler/dcalc/print.mli @@ -18,11 +18,6 @@ open Utils -(** {1 Helpers} *) - -val is_uppercase : CamomileLibraryDefault.Camomile.UChar.t -> bool -val begins_with_uppercase : string -> bool - (** {1 Common syntax highlighting helpers}*) val format_base_type : Format.formatter -> string -> unit @@ -36,25 +31,25 @@ val format_lit_style : Format.formatter -> string -> unit val format_uid_list : Format.formatter -> Uid.MarkedString.info list -> unit val format_enum_constructor : Format.formatter -> Ast.EnumConstructor.t -> unit val format_tlit : Format.formatter -> Ast.typ_lit -> unit -val format_typ : Ast.decl_ctx -> Format.formatter -> Ast.typ Pos.marked -> unit -val format_lit : Format.formatter -> Ast.lit Pos.marked -> unit +val format_typ : Ast.decl_ctx -> Format.formatter -> Ast.typ -> unit +val format_lit : Format.formatter -> Ast.lit -> unit val format_op_kind : Format.formatter -> Ast.op_kind -> unit -val format_binop : Format.formatter -> Ast.binop Pos.marked -> unit -val format_ternop : Format.formatter -> Ast.ternop Pos.marked -> unit +val format_binop : Format.formatter -> Ast.binop -> unit +val format_ternop : Format.formatter -> Ast.ternop -> unit val format_log_entry : Format.formatter -> Ast.log_entry -> unit -val format_unop : Format.formatter -> Ast.unop Pos.marked -> unit -val format_var : Format.formatter -> Ast.Var.t -> unit +val format_unop : Format.formatter -> Ast.unop -> unit +val format_var : Format.formatter -> 'm Ast.var -> unit val format_expr : ?debug:bool (** [true] for debug printing *) -> Ast.decl_ctx -> Format.formatter -> - Ast.expr Pos.marked -> + 'm Ast.marked_expr -> unit val format_scope : ?debug:bool (** [true] for debug printing *) -> Ast.decl_ctx -> Format.formatter -> - Ast.ScopeName.t * Ast.expr Ast.scope_body -> + Ast.ScopeName.t * ('m Ast.expr, 'm) Ast.scope_body -> unit diff --git a/compiler/dcalc/typing.ml b/compiler/dcalc/typing.ml index 9d419df6..0dc5f724 100644 --- a/compiler/dcalc/typing.ml +++ b/compiler/dcalc/typing.ml @@ -19,46 +19,27 @@ open Utils module A = Ast +open A.Infer (** {1 Types and unification} *) -module Any = - Utils.Uid.Make - (struct - type info = unit - - let format_info fmt () = Format.fprintf fmt "any" - end) - () - -(** We do not reuse {!type: Dcalc.Ast.typ} because we have to include a new - [TAny] variant. Indeed, error terms can have any type and this has to be - captured by the type sytem. *) -type typ = - | TLit of A.typ_lit - | TArrow of typ Pos.marked UnionFind.elem * typ Pos.marked UnionFind.elem - | TTuple of typ Pos.marked UnionFind.elem list * Ast.StructName.t option - | TEnum of typ Pos.marked UnionFind.elem list * Ast.EnumName.t - | TArray of typ Pos.marked UnionFind.elem - | TAny of Any.t - -let typ_needs_parens (t : typ Pos.marked UnionFind.elem) : bool = +let typ_needs_parens (t : typ Marked.pos UnionFind.elem) : bool = let t = UnionFind.get (UnionFind.find t) in - match Pos.unmark t with TArrow _ | TArray _ -> true | _ -> false + match Marked.unmark t with TArrow _ | TArray _ -> true | _ -> false let rec format_typ (ctx : Ast.decl_ctx) (fmt : Format.formatter) - (typ : typ Pos.marked UnionFind.elem) : unit = + (typ : typ Marked.pos UnionFind.elem) : unit = let format_typ = format_typ ctx in let format_typ_with_parens (fmt : Format.formatter) - (t : typ Pos.marked UnionFind.elem) = + (t : typ Marked.pos UnionFind.elem) = if typ_needs_parens t then Format.fprintf fmt "(%a)" format_typ t else Format.fprintf fmt "%a" format_typ t in let typ = UnionFind.get (UnionFind.find typ) in - match Pos.unmark typ with + match Marked.unmark typ with | TLit l -> Format.fprintf fmt "%a" Print.format_tlit l | TTuple (ts, None) -> Format.fprintf fmt "@[(%a)]" @@ -74,77 +55,99 @@ let rec format_typ | TArray t1 -> Format.fprintf fmt "@[%a@ array@]" format_typ t1 | TAny d -> Format.fprintf fmt "any[%d]" (Any.hash d) +exception + Type_error of + A.untyped A.marked_expr + * typ Marked.pos UnionFind.elem + * typ Marked.pos UnionFind.elem + (** Raises an error if unification cannot be performed *) let rec unify (ctx : Ast.decl_ctx) - (t1 : typ Pos.marked UnionFind.elem) - (t2 : typ Pos.marked UnionFind.elem) : unit = + (e : 'm A.marked_expr) (* used for error context *) + (t1 : typ Marked.pos UnionFind.elem) + (t2 : typ Marked.pos UnionFind.elem) : unit = let unify = unify ctx in - (* Cli.debug_print (Format.asprintf "Unifying %a and %a" (format_typ ctx) t1 - (format_typ ctx) t2); *) + (* Cli.debug_format "Unifying %a and %a" (format_typ ctx) t1 (format_typ ctx) + t2; *) let t1_repr = UnionFind.get (UnionFind.find t1) in let t2_repr = UnionFind.get (UnionFind.find t2) in - let raise_type_error (t1_pos : Pos.t) (t2_pos : Pos.t) : 'a = - (* TODO: if we get weird error messages, then it means that we should use - the persistent version of the union-find data structure. *) - let t1_s = - Cli.with_style [ANSITerminal.yellow] "%s" - (Re.Pcre.substitute ~rex:(Re.Pcre.regexp "\n\\s*") - ~subst:(fun _ -> " ") - (Format.asprintf "%a" (format_typ ctx) t1)) - in - let t2_s = - Cli.with_style [ANSITerminal.yellow] "%s" - (Re.Pcre.substitute ~rex:(Re.Pcre.regexp "\n\\s*") - ~subst:(fun _ -> " ") - (Format.asprintf "%a" (format_typ ctx) t2)) - in - Errors.raise_multispanned_error - [ - Some (Format.asprintf "Type %s coming from expression:" t1_s), t1_pos; - Some (Format.asprintf "Type %s coming from expression:" t2_s), t2_pos; - ] - "Error during typechecking, incompatible types:\n%a %s\n%a %s" - (Cli.format_with_style [ANSITerminal.blue; ANSITerminal.Bold]) - "-->" t1_s - (Cli.format_with_style [ANSITerminal.blue; ANSITerminal.Bold]) - "-->" t2_s + let raise_type_error () = + raise (Type_error (Bindlib.unbox (A.untype_expr e), t1, t2)) in let repr = - match t1_repr, t2_repr with - | (TLit tl1, _), (TLit tl2, _) when tl1 = tl2 -> None - | (TArrow (t11, t12), _), (TArrow (t21, t22), _) -> - unify t11 t21; - unify t12 t22; + match Marked.unmark t1_repr, Marked.unmark t2_repr with + | TLit tl1, TLit tl2 when tl1 = tl2 -> None + | TArrow (t11, t12), TArrow (t21, t22) -> + unify e t11 t21; + unify e t12 t22; None - | (TTuple (ts1, s1), t1_pos), (TTuple (ts2, s2), t2_pos) -> + | TTuple (ts1, s1), TTuple (ts2, s2) -> if s1 = s2 && List.length ts1 = List.length ts2 then begin - List.iter2 unify ts1 ts2; + List.iter2 (unify e) ts1 ts2; None end - else raise_type_error t1_pos t2_pos - | (TEnum (ts1, e1), t1_pos), (TEnum (ts2, e2), t2_pos) -> + else raise_type_error () + | TEnum (ts1, e1), TEnum (ts2, e2) -> if e1 = e2 && List.length ts1 = List.length ts2 then begin - List.iter2 unify ts1 ts2; + List.iter2 (unify e) ts1 ts2; None end - else raise_type_error t1_pos t2_pos - | (TArray t1', _), (TArray t2', _) -> - unify t1' t2'; + else raise_type_error () + | TArray t1', TArray t2' -> + unify e t1' t2'; None - | (TAny _, _), (TAny _, _) -> None - | (TAny _, _), t_repr | t_repr, (TAny _, _) -> Some t_repr - | (_, t1_pos), (_, t2_pos) -> raise_type_error t1_pos t2_pos + | TAny _, TAny _ -> None + | TAny _, _ -> Some t2_repr + | _, TAny _ -> Some t1_repr + | _ -> raise_type_error () in let t_union = UnionFind.union t1 t2 in match repr with None -> () | Some t_repr -> UnionFind.set t_union t_repr +let handle_type_error ctx e t1 t2 = + (* TODO: if we get weird error messages, then it means that we should use the + persistent version of the union-find data structure. *) + let t1_repr = UnionFind.get (UnionFind.find t1) in + let t2_repr = UnionFind.get (UnionFind.find t2) in + let t1_pos = Marked.get_mark t1_repr in + let t2_pos = Marked.get_mark t2_repr in + let unformat_typ typ = + let buf = Buffer.create 59 in + let ppf = Format.formatter_of_buffer buf in + (* set infinite width to disable line cuts *) + Format.pp_set_margin ppf max_int; + format_typ ctx ppf typ; + Format.pp_print_flush ppf (); + Buffer.contents buf + in + let t1_s fmt () = + Cli.format_with_style [ANSITerminal.yellow] fmt (unformat_typ t1) + in + let t2_s fmt () = + Cli.format_with_style [ANSITerminal.yellow] fmt (unformat_typ t2) + in + Errors.raise_multispanned_error + [ + ( Some + (Format.asprintf + "Error coming from typechecking the following expression:"), + A.pos e ); + Some (Format.asprintf "Type %a coming from expression:" t1_s ()), t1_pos; + Some (Format.asprintf "Type %a coming from expression:" t2_s ()), t2_pos; + ] + "Error during typechecking, incompatible types:\n%a %a\n%a %a" + (Cli.format_with_style [ANSITerminal.blue; ANSITerminal.Bold]) + "-->" t1_s () + (Cli.format_with_style [ANSITerminal.blue; ANSITerminal.Bold]) + "-->" t2_s () + (** Operators have a single type, instead of being polymorphic with constraints. This allows us to have a simpler type system, while we argue the syntactic burden of operator annotations helps the programmer visualize the type flow in the code. *) -let op_type (op : A.operator Pos.marked) : typ Pos.marked UnionFind.elem = - let pos = Pos.get_position op in +let op_type (op : A.operator Marked.pos) : typ Marked.pos UnionFind.elem = + let pos = Marked.get_mark op in let bt = UnionFind.make (TLit TBool, pos) in let it = UnionFind.make (TLit TInt, pos) in let rt = UnionFind.make (TLit TRat, pos) in @@ -156,7 +159,7 @@ let op_type (op : A.operator Pos.marked) : typ Pos.marked UnionFind.elem = let any2 = UnionFind.make (TAny (Any.fresh ()), pos) in let array_any2 = UnionFind.make (TArray any2, pos) in let arr x y = UnionFind.make (TArrow (x, y), pos) in - match Pos.unmark op with + match Marked.unmark op with | A.Ternop A.Fold -> arr (arr any2 (arr any any2)) (arr any2 (arr array_any any2)) | A.Binop (A.And | A.Or | A.Xor) -> arr bt (arr bt bt) @@ -198,381 +201,507 @@ let op_type (op : A.operator Pos.marked) : typ Pos.marked UnionFind.elem = | A.Unop A.GetDay -> arr dat it | A.Unop A.GetMonth -> arr dat it | A.Unop A.GetYear -> arr dat it + | A.Unop A.FirstDayOfMonth -> arr dat dat + | A.Unop A.LastDayOfMonth -> arr dat dat | A.Unop A.RoundMoney -> arr mt mt | A.Unop A.RoundDecimal -> arr rt rt | A.Unop A.IntToRat -> arr it rt + | A.Unop A.MoneyToRat -> arr mt rt + | A.Unop A.RatToMoney -> arr rt mt | Binop (Mult KDate) | Binop (Div KDate) | Unop (Minus KDate) -> Errors.raise_spanned_error pos "This operator is not available!" -let rec ast_to_typ (ty : A.typ) : typ = - match ty with - | A.TLit l -> TLit l - | A.TArrow (t1, t2) -> - TArrow - ( UnionFind.make (Pos.map_under_mark ast_to_typ t1), - UnionFind.make (Pos.map_under_mark ast_to_typ t2) ) - | A.TTuple (ts, s) -> - TTuple - ( List.map (fun t -> UnionFind.make (Pos.map_under_mark ast_to_typ t)) ts, - s ) - | A.TEnum (ts, e) -> - TEnum - ( List.map (fun t -> UnionFind.make (Pos.map_under_mark ast_to_typ t)) ts, - e ) - | A.TArray t -> TArray (UnionFind.make (Pos.map_under_mark ast_to_typ t)) - | A.TAny -> TAny (Any.fresh ()) - -let rec typ_to_ast (ty : typ Pos.marked UnionFind.elem) : A.typ Pos.marked = - Pos.map_under_mark - (fun ty -> - match ty with - | TLit l -> A.TLit l - | TTuple (ts, s) -> A.TTuple (List.map typ_to_ast ts, s) - | TEnum (ts, e) -> A.TEnum (List.map typ_to_ast ts, e) - | TArrow (t1, t2) -> A.TArrow (typ_to_ast t1, typ_to_ast t2) - | TAny _ -> A.TAny - | TArray t1 -> A.TArray (typ_to_ast t1)) - (UnionFind.get (UnionFind.find ty)) - (** {1 Double-directed typing} *) -type env = typ Pos.marked UnionFind.elem A.VarMap.t +type env = typ Marked.pos UnionFind.elem A.VarMap.t + +let translate_var v = Bindlib.copy_var v (fun x -> A.EVar x) (Bindlib.name_of v) +let add_pos e ty = Marked.mark (A.pos e) ty +let ty (_, A.Inferring { A.uf; _ }) = uf +let ( let+ ) x f = Bindlib.box_apply f x +let ( and+ ) x1 x2 = Bindlib.box_pair x1 x2 + +(* Maps a boxing function on a list, returning a boxed list *) +let bmap (f : 'a -> 'b Bindlib.box) (es : 'a list) : 'b list Bindlib.box = + List.fold_right + (fun e acc -> + let+ e' = f e and+ acc in + e' :: acc) + es (Bindlib.box []) + +(* Likewise, but with a function of two arguments on two lists of identical + lengths *) +let bmap2 (f : 'a -> 'b -> 'c Bindlib.box) (es : 'a list) (xs : 'b list) : + 'c list Bindlib.box = + List.fold_right2 + (fun e x acc -> + let+ e' = f e x and+ acc in + e' :: acc) + es xs (Bindlib.box []) + +let box_ty e = Bindlib.unbox (Bindlib.box_apply ty e) (** Infers the most permissive type from an expression *) let rec typecheck_expr_bottom_up (ctx : Ast.decl_ctx) (env : env) - (e : A.expr Pos.marked) : typ Pos.marked UnionFind.elem = - (* Cli.debug_print (Format.asprintf "Looking for type of %a" - (Print.format_expr ctx) e); *) - try - let out = - match Pos.unmark e with - | EVar v -> ( - match A.VarMap.find_opt (Pos.unmark v) env with - | Some t -> t - | None -> - Errors.raise_spanned_error (Pos.get_position e) - "Variable not found in the current context") - | ELit (LBool _) -> UnionFind.make (Pos.same_pos_as (TLit TBool) e) - | ELit (LInt _) -> UnionFind.make (Pos.same_pos_as (TLit TInt) e) - | ELit (LRat _) -> UnionFind.make (Pos.same_pos_as (TLit TRat) e) - | ELit (LMoney _) -> UnionFind.make (Pos.same_pos_as (TLit TMoney) e) - | ELit (LDate _) -> UnionFind.make (Pos.same_pos_as (TLit TDate) e) - | ELit (LDuration _) -> - UnionFind.make (Pos.same_pos_as (TLit TDuration) e) - | ELit LUnit -> UnionFind.make (Pos.same_pos_as (TLit TUnit) e) - | ELit LEmptyError -> - UnionFind.make (Pos.same_pos_as (TAny (Any.fresh ())) e) - | ETuple (es, s) -> - let ts = List.map (typecheck_expr_bottom_up ctx env) es in - UnionFind.make (Pos.same_pos_as (TTuple (ts, s)) e) - | ETupleAccess (e1, n, s, typs) -> ( - let typs = - List.map - (fun typ -> UnionFind.make (Pos.map_under_mark ast_to_typ typ)) - typs - in - typecheck_expr_top_down ctx env e1 - (UnionFind.make (TTuple (typs, s), Pos.get_position e)); - match List.nth_opt typs n with - | Some t' -> t' - | None -> - Errors.raise_spanned_error (Pos.get_position e1) - "Expression should have a tuple type with at least %d elements but \ - only has %d" - n (List.length typs)) - | EInj (e1, n, e_name, ts) -> - let ts = - List.map - (fun t -> UnionFind.make (Pos.map_under_mark ast_to_typ t)) - ts - in - let ts_n = - match List.nth_opt ts n with - | Some ts_n -> ts_n - | None -> - Errors.raise_spanned_error (Pos.get_position e) - "Expression should have a sum type with at least %d cases but \ - only has %d" - n (List.length ts) - in - typecheck_expr_top_down ctx env e1 ts_n; - UnionFind.make (Pos.same_pos_as (TEnum (ts, e_name)) e) - | EMatch (e1, es, e_name) -> - let enum_cases = - List.map - (fun e' -> - UnionFind.make (Pos.same_pos_as (TAny (Any.fresh ())) e')) - es - in - let t_e1 = - UnionFind.make (Pos.same_pos_as (TEnum (enum_cases, e_name)) e1) - in - typecheck_expr_top_down ctx env e1 t_e1; - let t_ret = UnionFind.make (Pos.same_pos_as (TAny (Any.fresh ())) e) in - List.iteri - (fun i es' -> - let enum_t = List.nth enum_cases i in - let t_es' = - UnionFind.make (Pos.same_pos_as (TArrow (enum_t, t_ret)) es') - in - typecheck_expr_top_down ctx env es' t_es') - es; - t_ret - | EAbs ((binder, pos_binder), taus) -> - let xs, body = Bindlib.unmbind binder in - if Array.length xs = List.length taus then - let xstaus = - List.map2 - (fun x tau -> - ( x, - UnionFind.make - (ast_to_typ (Pos.unmark tau), Pos.get_position tau) )) - (Array.to_list xs) taus - in - let env = - List.fold_left - (fun env (x, tau) -> A.VarMap.add x tau env) - env xstaus - in - List.fold_right - (fun (_, t_arg) (acc : typ Pos.marked UnionFind.elem) -> - UnionFind.make (TArrow (t_arg, acc), pos_binder)) - xstaus - (typecheck_expr_bottom_up ctx env body) - else - Errors.raise_spanned_error pos_binder - "function has %d variables but was supplied %d types" - (Array.length xs) (List.length taus) - | EApp (e1, args) -> - let t_args = List.map (typecheck_expr_bottom_up ctx env) args in - let t_ret = UnionFind.make (Pos.same_pos_as (TAny (Any.fresh ())) e) in - let t_app = - List.fold_right - (fun t_arg acc -> - UnionFind.make (Pos.same_pos_as (TArrow (t_arg, acc)) e)) - t_args t_ret - in - typecheck_expr_top_down ctx env e1 t_app; - t_ret - | EOp op -> op_type (Pos.same_pos_as op e) - | EDefault (excepts, just, cons) -> - typecheck_expr_top_down ctx env just - (UnionFind.make (Pos.same_pos_as (TLit TBool) just)); - let tcons = typecheck_expr_bottom_up ctx env cons in - List.iter - (fun except -> typecheck_expr_top_down ctx env except tcons) - excepts; - tcons - | EIfThenElse (cond, et, ef) -> - typecheck_expr_top_down ctx env cond - (UnionFind.make (Pos.same_pos_as (TLit TBool) cond)); - let tt = typecheck_expr_bottom_up ctx env et in - typecheck_expr_top_down ctx env ef tt; - tt - | EAssert e' -> - typecheck_expr_top_down ctx env e' - (UnionFind.make (Pos.same_pos_as (TLit TBool) e')); - UnionFind.make (Pos.same_pos_as (TLit TUnit) e') - | ErrorOnEmpty e' -> typecheck_expr_bottom_up ctx env e' - | EArray es -> - let cell_type = - UnionFind.make (Pos.same_pos_as (TAny (Any.fresh ())) e) - in - List.iter - (fun e' -> - let t_e' = typecheck_expr_bottom_up ctx env e' in - unify ctx cell_type t_e') - es; - UnionFind.make (Pos.same_pos_as (TArray cell_type) e) + (e : 'm A.marked_expr) : A.inferring A.marked_expr Bindlib.box = + (* Cli.debug_format "Looking for type of %a" (Print.format_expr ~debug:true + ctx) e; *) + let pos_e = A.pos e in + let mark (e : A.inferring A.expr) uf = + Marked.mark (A.Inferring { A.uf; pos = pos_e }) e + in + let unionfind_make ?(pos = e) t = UnionFind.make (add_pos pos t) in + let mark_with_uf e1 ?pos ty = mark e1 (unionfind_make ?pos ty) in + match Marked.unmark e with + | A.EVar v -> begin + match A.VarMap.find_opt (A.Var.t v) env with + | Some t -> + let+ v' = Bindlib.box_var (translate_var v) in + mark v' t + | None -> + Errors.raise_spanned_error (A.pos e) + "Variable %s not found in the current context." (Bindlib.name_of v) + end + | A.ELit (LBool _) as e1 -> Bindlib.box @@ mark_with_uf e1 (TLit TBool) + | A.ELit (LInt _) as e1 -> Bindlib.box @@ mark_with_uf e1 (TLit TInt) + | A.ELit (LRat _) as e1 -> Bindlib.box @@ mark_with_uf e1 (TLit TRat) + | A.ELit (LMoney _) as e1 -> Bindlib.box @@ mark_with_uf e1 (TLit TMoney) + | A.ELit (LDate _) as e1 -> Bindlib.box @@ mark_with_uf e1 (TLit TDate) + | A.ELit (LDuration _) as e1 -> + Bindlib.box @@ mark_with_uf e1 (TLit TDuration) + | A.ELit LUnit as e1 -> Bindlib.box @@ mark_with_uf e1 (TLit TUnit) + | A.ELit LEmptyError as e1 -> + Bindlib.box @@ mark_with_uf e1 (TAny (Any.fresh ())) + | A.ETuple (es, s) -> + let+ es = bmap (typecheck_expr_bottom_up ctx env) es in + mark_with_uf (ETuple (es, s)) (TTuple (List.map ty es, s)) + | A.ETupleAccess (e1, n, s, typs) -> begin + let utyps = List.map ast_to_typ typs in + let+ e1 = + typecheck_expr_top_down ctx env (unionfind_make (TTuple (utyps, s))) e1 in - (* Cli.debug_print (Format.asprintf "Found type of %a: %a" - (Print.format_expr ctx) e (format_typ ctx) out); *) - out - with Errors.StructuredError (msg, err_pos) when List.length err_pos = 2 -> - raise - (Errors.StructuredError - ( msg, - ( Some "Error coming from typechecking the following expression:", - Pos.get_position e ) - :: err_pos )) + match List.nth_opt utyps n with + | Some t' -> mark (ETupleAccess (e1, n, s, typs)) t' + | None -> + Errors.raise_spanned_error (A.pos e1) + "Expression should have a tuple type with at least %d elements but \ + only has %d" + n (List.length typs) + end + | A.EInj (e1, n, e_name, ts) -> + let ts' = List.map ast_to_typ ts in + let ts_n = + match List.nth_opt ts' n with + | Some ts_n -> ts_n + | None -> + Errors.raise_spanned_error (A.pos e) + "Expression should have a sum type with at least %d cases but only \ + has %d" + n (List.length ts') + in + let+ e1' = typecheck_expr_top_down ctx env ts_n e1 in + mark_with_uf (A.EInj (e1', n, e_name, ts)) (TEnum (ts', e_name)) + | A.EMatch (e1, es, e_name) -> + let enum_cases = + List.map (fun e' -> unionfind_make ~pos:e' (TAny (Any.fresh ()))) es + in + let t_e1 = UnionFind.make (add_pos e1 (TEnum (enum_cases, e_name))) in + let t_ret = unionfind_make ~pos:e (TAny (Any.fresh ())) in + let+ e1' = typecheck_expr_top_down ctx env t_e1 e1 + and+ es' = + bmap2 + (fun es' enum_t -> + typecheck_expr_top_down ctx env + (unionfind_make ~pos:es' (TArrow (enum_t, t_ret))) + es') + es enum_cases + in + mark (EMatch (e1', es', e_name)) t_ret + | A.EAbs (binder, taus) -> + if Bindlib.mbinder_arity binder <> List.length taus then + Errors.raise_spanned_error (A.pos e) + "function has %d variables but was supplied %d types" + (Bindlib.mbinder_arity binder) + (List.length taus) + else + let xs, body = Bindlib.unmbind binder in + let xs' = Array.map translate_var xs in + let xstaus = List.mapi (fun i tau -> xs'.(i), ast_to_typ tau) taus in + let env = + List.fold_left + (fun env (x, tau) -> A.VarMap.add (A.Var.t x) tau env) + env xstaus + in + let body' = typecheck_expr_bottom_up ctx env body in + let t_func = + List.fold_right + (fun (_, t_arg) acc -> unionfind_make (TArrow (t_arg, acc))) + xstaus (box_ty body') + in + let+ binder' = Bindlib.bind_mvar xs' body' in + mark (EAbs (binder', taus)) t_func + | A.EApp (e1, args) -> + let args' = bmap (typecheck_expr_bottom_up ctx env) args in + let t_ret = unionfind_make (TAny (Any.fresh ())) in + let t_func = + List.fold_right + (fun ty_arg acc -> unionfind_make (TArrow (ty_arg, acc))) + (Bindlib.unbox (Bindlib.box_apply (List.map ty) args')) + t_ret + in + let+ e1' = typecheck_expr_bottom_up ctx env e1 and+ args' in + unify ctx e (ty e1') t_func; + mark (EApp (e1', args')) t_ret + | A.EOp op as e1 -> Bindlib.box @@ mark e1 (op_type (Marked.mark pos_e op)) + | A.EDefault (excepts, just, cons) -> + let just' = + typecheck_expr_top_down ctx env + (unionfind_make ~pos:just (TLit TBool)) + just + in + let cons' = typecheck_expr_bottom_up ctx env cons in + let tau = box_ty cons' in + let+ just' + and+ cons' + and+ excepts' = + bmap (fun except -> typecheck_expr_top_down ctx env tau except) excepts + in + mark (A.EDefault (excepts', just', cons')) tau + | A.EIfThenElse (cond, et, ef) -> + let cond' = + typecheck_expr_top_down ctx env + (unionfind_make ~pos:cond (TLit TBool)) + cond + in + let et' = typecheck_expr_bottom_up ctx env et in + let tau = box_ty et' in + let+ cond' and+ et' and+ ef' = typecheck_expr_top_down ctx env tau ef in + mark (A.EIfThenElse (cond', et', ef')) tau + | A.EAssert e1 -> + let+ e1' = + typecheck_expr_top_down ctx env (unionfind_make ~pos:e1 (TLit TBool)) e1 + in + mark_with_uf (A.EAssert e1') ~pos:e1 (TLit TUnit) + | A.ErrorOnEmpty e1 -> + let+ e1' = typecheck_expr_bottom_up ctx env e1 in + mark (A.ErrorOnEmpty e1') (ty e1') + | A.EArray es -> + let cell_type = unionfind_make (TAny (Any.fresh ())) in + let+ es' = + bmap + (fun e1 -> + let e1' = typecheck_expr_bottom_up ctx env e1 in + unify ctx e1 cell_type (box_ty e1'); + e1') + es + in + mark_with_uf (A.EArray es') (TArray cell_type) (** Checks whether the expression can be typed with the provided type *) and typecheck_expr_top_down (ctx : Ast.decl_ctx) (env : env) - (e : A.expr Pos.marked) - (tau : typ Pos.marked UnionFind.elem) : unit = - (* Cli.debug_print (Format.asprintf "Typechecking %a : %a" (Print.format_expr - ctx) e (format_typ ctx) tau); *) - try - match Pos.unmark e with - | EVar v -> ( - match A.VarMap.find_opt (Pos.unmark v) env with - | Some tau' -> ignore (unify ctx tau tau') + (tau : typ Marked.pos UnionFind.elem) + (e : 'm A.marked_expr) : A.inferring A.marked_expr Bindlib.box = + (* Cli.debug_format "Propagating type %a for expr %a" (format_typ ctx) tau + (Print.format_expr ctx) e; *) + let pos_e = A.pos e in + let mark e = Marked.mark (A.Inferring { uf = tau; pos = pos_e }) e in + let unify_and_mark (e : A.inferring A.expr) tau' = + let e = Marked.mark (A.Inferring { uf = tau'; pos = pos_e }) e in + unify ctx (Bindlib.unbox (A.untype_expr e)) tau tau'; + e + in + let unionfind_make ?(pos = e) t = UnionFind.make (add_pos pos t) in + match Marked.unmark e with + | A.EVar v -> begin + match A.VarMap.find_opt (A.Var.t v) env with + | Some tau' -> + let+ v' = Bindlib.box_var (translate_var v) in + unify_and_mark v' tau' + | None -> + Errors.raise_spanned_error (A.pos e) + "Variable %s not found in the current context" (Bindlib.name_of v) + end + | A.ELit (LBool _) as e1 -> + Bindlib.box @@ unify_and_mark e1 (unionfind_make (TLit TBool)) + | A.ELit (LInt _) as e1 -> + Bindlib.box @@ unify_and_mark e1 (unionfind_make (TLit TInt)) + | A.ELit (LRat _) as e1 -> + Bindlib.box @@ unify_and_mark e1 (unionfind_make (TLit TRat)) + | A.ELit (LMoney _) as e1 -> + Bindlib.box @@ unify_and_mark e1 (unionfind_make (TLit TMoney)) + | A.ELit (LDate _) as e1 -> + Bindlib.box @@ unify_and_mark e1 (unionfind_make (TLit TDate)) + | A.ELit (LDuration _) as e1 -> + Bindlib.box @@ unify_and_mark e1 (unionfind_make (TLit TDuration)) + | A.ELit LUnit as e1 -> + Bindlib.box @@ unify_and_mark e1 (unionfind_make (TLit TUnit)) + | A.ELit LEmptyError as e1 -> + Bindlib.box @@ unify_and_mark e1 (unionfind_make (TAny (Any.fresh ()))) + | A.ETuple (es, s) -> + let+ es' = bmap (typecheck_expr_bottom_up ctx env) es in + unify_and_mark + (A.ETuple (es', s)) + (unionfind_make (TTuple (List.map ty es', s))) + | A.ETupleAccess (e1, n, s, typs) -> begin + let typs' = List.map ast_to_typ typs in + let+ e1' = + typecheck_expr_top_down ctx env (unionfind_make (TTuple (typs', s))) e1 + in + match List.nth_opt typs' n with + | Some t1n -> unify_and_mark (A.ETupleAccess (e1', n, s, typs)) t1n + | None -> + Errors.raise_spanned_error (Ast.pos e1) + "Expression should have a tuple type with at least %d elements but \ + only has %d" + n (List.length typs) + end + | A.EInj (e1, n, e_name, ts) -> + let ts' = List.map ast_to_typ ts in + let ts_n = + match List.nth_opt ts' n with + | Some ts_n -> ts_n | None -> - Errors.raise_spanned_error (Pos.get_position e) - "Variable not found in the current context") - | ELit (LBool _) -> - unify ctx tau (UnionFind.make (Pos.same_pos_as (TLit TBool) e)) - | ELit (LInt _) -> - unify ctx tau (UnionFind.make (Pos.same_pos_as (TLit TInt) e)) - | ELit (LRat _) -> - unify ctx tau (UnionFind.make (Pos.same_pos_as (TLit TRat) e)) - | ELit (LMoney _) -> - unify ctx tau (UnionFind.make (Pos.same_pos_as (TLit TMoney) e)) - | ELit (LDate _) -> - unify ctx tau (UnionFind.make (Pos.same_pos_as (TLit TDate) e)) - | ELit (LDuration _) -> - unify ctx tau (UnionFind.make (Pos.same_pos_as (TLit TDuration) e)) - | ELit LUnit -> - unify ctx tau (UnionFind.make (Pos.same_pos_as (TLit TUnit) e)) - | ELit LEmptyError -> - unify ctx tau (UnionFind.make (Pos.same_pos_as (TAny (Any.fresh ())) e)) - | ETuple (es, s) -> - let t_es = - UnionFind.make - (Pos.same_pos_as - (TTuple (List.map (typecheck_expr_bottom_up ctx env) es, s)) - e) - in - unify ctx tau t_es - | ETupleAccess (e1, n, s, typs) -> ( - let typs = - List.map - (fun typ -> UnionFind.make (Pos.map_under_mark ast_to_typ typ)) - typs - in - typecheck_expr_top_down ctx env e1 - (UnionFind.make (TTuple (typs, s), Pos.get_position e)); - match List.nth_opt typs n with - | Some t1n -> unify ctx t1n tau - | None -> - Errors.raise_spanned_error (Pos.get_position e1) - "Expression should have a tuple type with at least %d elements but \ - only has %d" - n (List.length typs)) - | EInj (e1, n, e_name, ts) -> - let ts = - List.map (fun t -> UnionFind.make (Pos.map_under_mark ast_to_typ t)) ts - in - let ts_n = - match List.nth_opt ts n with - | Some ts_n -> ts_n - | None -> - Errors.raise_spanned_error (Pos.get_position e) - "Expression should have a sum type with at least %d cases but only \ - has %d" - n (List.length ts) - in - typecheck_expr_top_down ctx env e1 ts_n; - unify ctx (UnionFind.make (Pos.same_pos_as (TEnum (ts, e_name)) e)) tau - | EMatch (e1, es, e_name) -> - let enum_cases = - List.map - (fun e' -> UnionFind.make (Pos.same_pos_as (TAny (Any.fresh ())) e')) - es - in - let t_e1 = - UnionFind.make (Pos.same_pos_as (TEnum (enum_cases, e_name)) e1) - in - typecheck_expr_top_down ctx env e1 t_e1; - let t_ret = UnionFind.make (Pos.same_pos_as (TAny (Any.fresh ())) e) in - List.iteri - (fun i es' -> - let enum_t = List.nth enum_cases i in - let t_es' = - UnionFind.make (Pos.same_pos_as (TArrow (enum_t, t_ret)) es') - in - typecheck_expr_top_down ctx env es' t_es') - es; - unify ctx tau t_ret - | EAbs ((binder, pos_binder), t_args) -> + Errors.raise_spanned_error (A.pos e) + "Expression should have a sum type with at least %d cases but only \ + has %d" + n (List.length ts) + in + let+ e1' = typecheck_expr_top_down ctx env ts_n e1 in + unify_and_mark + (A.EInj (e1', n, e_name, ts)) + (unionfind_make (TEnum (ts', e_name))) + | A.EMatch (e1, es, e_name) -> + let enum_cases = + List.map (fun e' -> unionfind_make ~pos:e' (TAny (Any.fresh ()))) es + in + let e1' = + typecheck_expr_top_down ctx env + (unionfind_make ~pos:e1 (TEnum (enum_cases, e_name))) + e1 + in + let t_ret = unionfind_make ~pos:e (TAny (Any.fresh ())) in + let+ e1' + and+ es' = + bmap2 + (fun es' enum_t -> + typecheck_expr_top_down ctx env + (unionfind_make ~pos:es' (TArrow (enum_t, t_ret))) + es') + es enum_cases + in + unify_and_mark (EMatch (e1', es', e_name)) t_ret + | A.EAbs (binder, t_args) -> + if Bindlib.mbinder_arity binder <> List.length t_args then + Errors.raise_spanned_error (A.pos e) + "function has %d variables but was supplied %d types" + (Bindlib.mbinder_arity binder) + (List.length t_args) + else let xs, body = Bindlib.unmbind binder in - if Array.length xs = List.length t_args then - let xstaus = - List.map2 - (fun x t_arg -> - x, UnionFind.make (Pos.map_under_mark ast_to_typ t_arg)) - (Array.to_list xs) t_args - in - let env = - List.fold_left - (fun env (x, t_arg) -> A.VarMap.add x t_arg env) - env xstaus - in - let t_out = typecheck_expr_bottom_up ctx env body in - let t_func = - List.fold_right - (fun (_, t_arg) acc -> - UnionFind.make (Pos.same_pos_as (TArrow (t_arg, acc)) e)) - xstaus t_out - in - unify ctx t_func tau - else - Errors.raise_spanned_error pos_binder - "function has %d variables but was supplied %d types" - (Array.length xs) (List.length t_args) - | EApp (e1, args) -> - let t_args = List.map (typecheck_expr_bottom_up ctx env) args in - let te1 = typecheck_expr_bottom_up ctx env e1 in + let xs' = Array.map translate_var xs in + let xstaus = + List.map2 (fun x t_arg -> x, ast_to_typ t_arg) (Array.to_list xs) t_args + in + let env = + List.fold_left + (fun env (x, t_arg) -> A.VarMap.add (A.Var.t x) t_arg env) + env xstaus + in + let body' = typecheck_expr_bottom_up ctx env body in let t_func = List.fold_right - (fun t_arg acc -> - UnionFind.make (Pos.same_pos_as (TArrow (t_arg, acc)) e)) - t_args tau + (fun (_, t_arg) acc -> unionfind_make (TArrow (t_arg, acc))) + xstaus (box_ty body') in - unify ctx te1 t_func - | EOp op -> - let op_typ = op_type (Pos.same_pos_as op e) in - unify ctx op_typ tau - | EDefault (excepts, just, cons) -> - typecheck_expr_top_down ctx env just - (UnionFind.make (Pos.same_pos_as (TLit TBool) just)); - typecheck_expr_top_down ctx env cons tau; - List.iter - (fun except -> typecheck_expr_top_down ctx env except tau) - excepts - | EIfThenElse (cond, et, ef) -> - typecheck_expr_top_down ctx env cond - (UnionFind.make (Pos.same_pos_as (TLit TBool) cond)); - typecheck_expr_top_down ctx env et tau; - typecheck_expr_top_down ctx env ef tau - | EAssert e' -> - typecheck_expr_top_down ctx env e' - (UnionFind.make (Pos.same_pos_as (TLit TBool) e')); - unify ctx tau (UnionFind.make (Pos.same_pos_as (TLit TUnit) e')) - | ErrorOnEmpty e' -> typecheck_expr_top_down ctx env e' tau - | EArray es -> - let cell_type = - UnionFind.make (Pos.same_pos_as (TAny (Any.fresh ())) e) - in - List.iter - (fun e' -> - let t_e' = typecheck_expr_bottom_up ctx env e' in - unify ctx cell_type t_e') - es; - unify ctx tau (UnionFind.make (Pos.same_pos_as (TArray cell_type) e)) - with Errors.StructuredError (msg, err_pos) when List.length err_pos = 2 -> - raise - (Errors.StructuredError - ( msg, - ( Some "Error coming from typechecking the following expression:", - Pos.get_position e ) - :: err_pos )) + let+ binder' = Bindlib.bind_mvar xs' body' in + unify_and_mark (EAbs (binder', t_args)) t_func + | A.EApp (e1, args) -> + let+ args' = bmap (typecheck_expr_bottom_up ctx env) args + and+ e1' = typecheck_expr_bottom_up ctx env e1 in + let t_func = + List.fold_right + (fun arg acc -> unionfind_make (TArrow (ty arg, acc))) + args' tau + in + unify ctx e (ty e1') t_func; + unify_and_mark (EApp (e1', args')) tau + | A.EOp op as e1 -> + let op_typ = op_type (add_pos e op) in + Bindlib.box (unify_and_mark e1 op_typ) + | A.EDefault (excepts, just, cons) -> + let+ just' = + typecheck_expr_top_down ctx env + (unionfind_make ~pos:just (TLit TBool)) + just + and+ cons' = typecheck_expr_top_down ctx env tau cons + and+ excepts' = bmap (typecheck_expr_top_down ctx env tau) excepts in + mark (A.EDefault (excepts', just', cons')) + | A.EIfThenElse (cond, et, ef) -> + let+ cond' = + typecheck_expr_top_down ctx env + (unionfind_make ~pos:cond (TLit TBool)) + cond + and+ et' = typecheck_expr_top_down ctx env tau et + and+ ef' = typecheck_expr_top_down ctx env tau ef in + mark (A.EIfThenElse (cond', et', ef')) + | A.EAssert e1 -> + let+ e1' = + typecheck_expr_top_down ctx env (unionfind_make ~pos:e1 (TLit TBool)) e1 + in + unify_and_mark (EAssert e1') (unionfind_make ~pos:e1 (TLit TUnit)) + | A.ErrorOnEmpty e1 -> + let+ e1' = typecheck_expr_top_down ctx env tau e1 in + mark (A.ErrorOnEmpty e1') + | A.EArray es -> + let cell_type = unionfind_make (TAny (Any.fresh ())) in + let+ es' = + bmap + (fun e1 -> + let e1' = typecheck_expr_bottom_up ctx env e1 in + unify ctx e cell_type (box_ty e1'); + e1') + es + in + unify_and_mark (A.EArray es') (unionfind_make (TArray cell_type)) + +let wrap ctx f e = + try f e + with Type_error (e, ty1, ty2) -> ( + let bt = Printexc.get_raw_backtrace () in + try handle_type_error ctx e ty1 ty2 + with e -> Printexc.raise_with_backtrace e bt) (** {1 API} *) +let get_ty_mark (A.Inferring { uf; pos }) = + A.Typed { ty = A.Infer.typ_to_ast uf; pos } + (* Infer the type of an expression *) -let infer_type (ctx : Ast.decl_ctx) (e : A.expr Pos.marked) : A.typ Pos.marked = - let ty = typecheck_expr_bottom_up ctx A.VarMap.empty e in - typ_to_ast ty +let infer_types (ctx : Ast.decl_ctx) (e : 'm A.marked_expr) : + Ast.typed Ast.marked_expr Bindlib.box = + A.map_expr_marks ~f:get_ty_mark + @@ Bindlib.unbox + @@ wrap ctx (typecheck_expr_bottom_up ctx A.VarMap.empty) e + +let infer_type (type m) ctx (e : m A.marked_expr) = + match Marked.get_mark e with + | A.Typed { ty; _ } -> ty + | A.Inferring { uf; _ } -> typ_to_ast uf + | A.Untyped _ -> A.ty (Bindlib.unbox (infer_types ctx e)) (** Typechecks an expression given an expected type *) let check_type (ctx : Ast.decl_ctx) - (e : A.expr Pos.marked) - (tau : A.typ Pos.marked) = - typecheck_expr_top_down ctx A.VarMap.empty e - (UnionFind.make (Pos.map_under_mark ast_to_typ tau)) + (e : 'm A.marked_expr) + (tau : A.typ Marked.pos) = + (* todo: consider using the already inferred type if ['m] = [typed] *) + ignore + @@ wrap ctx (typecheck_expr_top_down ctx A.VarMap.empty (ast_to_typ tau)) e + +let infer_types_program prg = + let ctx = prg.A.decl_ctx in + let rec process_scopes env = function + | A.Nil -> Bindlib.box A.Nil + | A.ScopeDef + { + scope_next; + scope_name; + scope_body = + { + scope_body_input_struct = s_in; + scope_body_output_struct = s_out; + scope_body_expr = body; + }; + } -> + let scope_pos = Marked.get_mark (A.ScopeName.get_info scope_name) in + let struct_ty struct_name = + let struc = A.StructMap.find struct_name ctx.A.ctx_structs in + ast_to_typ + (Marked.mark scope_pos + (A.TTuple (List.map snd struc, Some struct_name))) + in + let ty_in = struct_ty s_in in + let ty_out = struct_ty s_out in + let ty_scope = + UnionFind.make (Marked.mark scope_pos (TArrow (ty_in, ty_out))) + in + let rec process_scope_body_expr env = function + | A.Result e -> + let e' = typecheck_expr_bottom_up ctx env e in + Bindlib.box_apply + (fun e -> + unify ctx e (ty e) ty_out; + A.Result e) + e' + | A.ScopeLet + { + scope_let_kind; + scope_let_typ; + scope_let_expr = e; + scope_let_next; + scope_let_pos; + } -> + let ty_e = ast_to_typ scope_let_typ in + let e = typecheck_expr_bottom_up ctx env e in + let var, next = Bindlib.unbind scope_let_next in + let env = A.VarMap.add (A.Var.t var) ty_e env in + let next = process_scope_body_expr env next in + let scope_let_next = Bindlib.bind_var (translate_var var) next in + Bindlib.box_apply2 + (fun scope_let_expr scope_let_next -> + unify ctx scope_let_expr (ty scope_let_expr) ty_e; + A.ScopeLet + { + scope_let_kind; + scope_let_typ; + scope_let_expr; + scope_let_next; + scope_let_pos; + }) + e scope_let_next + in + let scope_body_expr = + let var, e = Bindlib.unbind body in + let env = A.VarMap.add (A.Var.t var) ty_in env in + let e' = process_scope_body_expr env e in + let e' = + Bindlib.box_apply + (fun e -> + Bindlib.unbox + @@ A.map_exprs_in_scope_lets ~varf:translate_var + ~f: + (A.map_expr_top_down ~f:(fun e -> + Marked.(mark (get_ty_mark (get_mark e)) (unmark e)))) + e) + e' + in + Bindlib.bind_var (translate_var var) e' + in + let scope_next = + let scope_var, next = Bindlib.unbind scope_next in + let env = A.VarMap.add (A.Var.t scope_var) ty_scope env in + let next' = process_scopes env next in + Bindlib.bind_var (translate_var scope_var) next' + in + Bindlib.box_apply2 + (fun scope_body_expr scope_next -> + A.ScopeDef + { + scope_next; + scope_name; + scope_body = + { + scope_body_input_struct = s_in; + scope_body_output_struct = s_out; + scope_body_expr; + }; + }) + scope_body_expr scope_next + in + let scopes = wrap ctx (process_scopes A.VarMap.empty) prg.scopes in + Bindlib.box_apply (fun scopes -> { A.decl_ctx = ctx; scopes }) scopes + |> Bindlib.unbox diff --git a/compiler/dcalc/typing.mli b/compiler/dcalc/typing.mli index a95bf4bc..5c66ca4f 100644 --- a/compiler/dcalc/typing.mli +++ b/compiler/dcalc/typing.mli @@ -17,8 +17,18 @@ (** Typing for the default calculus. Because of the error terms, we perform type inference using the classical W algorithm with union-find unification. *) -val infer_type : - Ast.decl_ctx -> Ast.expr Utils.Pos.marked -> Ast.typ Utils.Pos.marked +val infer_types : + Ast.decl_ctx -> + Ast.untyped Ast.marked_expr -> + Ast.typed Ast.marked_expr Bindlib.box +(** Infers types everywhere on the given expression, and adds (or replaces) type + annotations on each node *) + +val infer_type : Ast.decl_ctx -> 'm Ast.marked_expr -> Ast.typ Utils.Marked.pos +(** Gets the outer type of the given expression, using either the existing + annotations or inference *) val check_type : - Ast.decl_ctx -> Ast.expr Utils.Pos.marked -> Ast.typ Utils.Pos.marked -> unit + Ast.decl_ctx -> 'm Ast.marked_expr -> Ast.typ Utils.Marked.pos -> unit + +val infer_types_program : Ast.untyped Ast.program -> Ast.typed Ast.program diff --git a/compiler/desugared/ast.ml b/compiler/desugared/ast.ml index 35aa454d..a65c0828 100644 --- a/compiler/desugared/ast.ml +++ b/compiler/desugared/ast.ml @@ -69,10 +69,10 @@ module ScopeDef = struct let get_position x = match x with - | Var (x, None) -> Pos.get_position (ScopeVar.get_info x) - | Var (_, Some sx) -> Pos.get_position (StateName.get_info sx) + | Var (x, None) -> Marked.get_mark (ScopeVar.get_info x) + | Var (_, Some sx) -> Marked.get_mark (StateName.get_info sx) | SubScopeVar (x, _) -> - Pos.get_position (Scopelang.Ast.SubScopeName.get_info x) + Marked.get_mark (Scopelang.Ast.SubScopeName.get_info x) let format_t fmt x = match x with @@ -97,22 +97,22 @@ module ScopeDefSet : Set.S with type elt = ScopeDef.t = Set.Make (ScopeDef) (** {1 AST} *) type location = - | ScopeVar of ScopeVar.t Pos.marked * StateName.t option + | ScopeVar of ScopeVar.t Marked.pos * StateName.t option | SubScopeVar of Scopelang.Ast.ScopeName.t - * Scopelang.Ast.SubScopeName.t Pos.marked - * ScopeVar.t Pos.marked + * Scopelang.Ast.SubScopeName.t Marked.pos + * ScopeVar.t Marked.pos -module LocationSet : Set.S with type elt = location Pos.marked = +module LocationSet : Set.S with type elt = location Marked.pos = Set.Make (struct - type t = location Pos.marked + type t = location Marked.pos let compare x y = - match Pos.unmark x, Pos.unmark y with + match Marked.unmark x, Marked.unmark y with | ScopeVar (vx, None), ScopeVar (vy, None) | ScopeVar (vx, Some _), ScopeVar (vy, None) | ScopeVar (vx, None), ScopeVar (vy, Some _) -> - ScopeVar.compare (Pos.unmark vx) (Pos.unmark vy) + ScopeVar.compare (Marked.unmark vx) (Marked.unmark vy) | ScopeVar ((x, _), Some sx), ScopeVar ((y, _), Some sy) -> let cmp = ScopeVar.compare x y in if cmp = 0 then StateName.compare sx sy else cmp @@ -124,36 +124,32 @@ Set.Make (struct | SubScopeVar _, ScopeVar _ -> 1 end) +type marked_expr = expr Marked.pos (** The expressions use the {{:https://lepigre.fr/ocaml-bindlib/} Bindlib} library, based on higher-order abstract syntax*) -type expr = + +and expr = | ELocation of location - | EVar of expr Bindlib.var Pos.marked + | EVar of expr Bindlib.var | EStruct of - Scopelang.Ast.StructName.t - * expr Pos.marked Scopelang.Ast.StructFieldMap.t + Scopelang.Ast.StructName.t * marked_expr Scopelang.Ast.StructFieldMap.t | EStructAccess of - expr Pos.marked - * Scopelang.Ast.StructFieldName.t - * Scopelang.Ast.StructName.t + marked_expr * Scopelang.Ast.StructFieldName.t * Scopelang.Ast.StructName.t | EEnumInj of - expr Pos.marked - * Scopelang.Ast.EnumConstructor.t - * Scopelang.Ast.EnumName.t + marked_expr * Scopelang.Ast.EnumConstructor.t * Scopelang.Ast.EnumName.t | EMatch of - expr Pos.marked + marked_expr * Scopelang.Ast.EnumName.t - * expr Pos.marked Scopelang.Ast.EnumConstructorMap.t + * marked_expr Scopelang.Ast.EnumConstructorMap.t | ELit of Dcalc.Ast.lit | EAbs of - (expr, expr Pos.marked) Bindlib.mbinder Pos.marked - * Scopelang.Ast.typ Pos.marked list - | EApp of expr Pos.marked * expr Pos.marked list + (expr, marked_expr) Bindlib.mbinder * Scopelang.Ast.typ Marked.pos list + | EApp of marked_expr * marked_expr list | EOp of Dcalc.Ast.operator - | EDefault of expr Pos.marked list * expr Pos.marked * expr Pos.marked - | EIfThenElse of expr Pos.marked * expr Pos.marked * expr Pos.marked - | EArray of expr Pos.marked list - | ErrorOnEmpty of expr Pos.marked + | EDefault of marked_expr list * marked_expr * marked_expr + | EIfThenElse of marked_expr * marked_expr * marked_expr + | EArray of marked_expr list + | ErrorOnEmpty of marked_expr module Expr = struct type t = expr @@ -172,13 +168,12 @@ module Expr = struct in match e1, e2 with | ELocation _, ELocation _ -> 0 - | EVar (v1, _), EVar (v2, _) -> Bindlib.compare_vars v1 v2 + | EVar v1, EVar v2 -> Bindlib.compare_vars v1 v2 | EStruct (name1, field_map1), EStruct (name2, field_map2) -> ( match Scopelang.Ast.StructName.compare name1 name2 with | 0 -> - Scopelang.Ast.StructFieldMap.compare - (Pos.compare_marked compare) - field_map1 field_map2 + Scopelang.Ast.StructFieldMap.compare (Marked.compare compare) field_map1 + field_map2 | n -> n) | ( EStructAccess ((e1, _), field_name1, struct_name1), EStructAccess ((e2, _), field_name2, struct_name2) ) -> ( @@ -200,15 +195,14 @@ module Expr = struct | 0 -> ( match Scopelang.Ast.EnumName.compare name1 name2 with | 0 -> - Scopelang.Ast.EnumConstructorMap.compare - (Pos.compare_marked compare) + Scopelang.Ast.EnumConstructorMap.compare (Marked.compare compare) emap1 emap2 | n -> n) | n -> n) | ELit l1, ELit l2 -> Stdlib.compare l1 l2 - | EAbs ((binder1, _), typs1), EAbs ((binder2, _), typs2) -> ( + | EAbs (binder1, typs1), EAbs (binder2, typs2) -> ( match - list_compare (Pos.compare_marked Scopelang.Ast.Typ.compare) typs1 typs2 + list_compare (Marked.compare Scopelang.Ast.Typ.compare) typs1 typs2 with | 0 -> let _, (e1, _), (e2, _) = Bindlib.unmbind2 binder1 binder2 in @@ -224,7 +218,7 @@ module Expr = struct match compare just1 just2 with | 0 -> ( match compare cons1 cons2 with - | 0 -> list_compare (Pos.compare_marked compare) exs1 exs2 + | 0 -> list_compare (Marked.compare compare) exs1 exs2 | n -> n) | n -> n) | ( EIfThenElse ((i1, _), (t1, _), (e1, _)), @@ -268,22 +262,28 @@ module ExprMap = Map.Make (Expr) module Var = struct type t = expr Bindlib.var - let make (s : string Pos.marked) : t = - Bindlib.new_var - (fun (x : expr Bindlib.var) : expr -> EVar (x, Pos.get_position s)) - (Pos.unmark s) + let make (s : string) : t = + Bindlib.new_var (fun (x : expr Bindlib.var) : expr -> EVar x) s let compare x y = Bindlib.compare_vars x y end type vars = expr Bindlib.mvar +type exception_situation = + | BaseCase + | ExceptionToLabel of LabelName.t Marked.pos + | ExceptionToRule of RuleName.t Marked.pos + +type label_situation = ExplicitlyLabeled of LabelName.t Marked.pos | Unlabeled + type rule = { rule_id : RuleName.t; - rule_just : expr Pos.marked Bindlib.box; - rule_cons : expr Pos.marked Bindlib.box; - rule_parameter : (Var.t * Scopelang.Ast.typ Pos.marked) option; - rule_exception_to_rules : RuleSet.t Pos.marked; + rule_just : expr Marked.pos Bindlib.box; + rule_cons : expr Marked.pos Bindlib.box; + rule_parameter : (Var.t * Scopelang.Ast.typ Marked.pos) option; + rule_exception : exception_situation; + rule_label : label_situation; } module Rule = struct @@ -323,46 +323,47 @@ end let empty_rule (pos : Pos.t) - (have_parameter : Scopelang.Ast.typ Pos.marked option) : rule = + (have_parameter : Scopelang.Ast.typ Marked.pos option) : rule = { rule_just = Bindlib.box (ELit (Dcalc.Ast.LBool false), pos); rule_cons = Bindlib.box (ELit Dcalc.Ast.LEmptyError, pos); rule_parameter = (match have_parameter with - | Some typ -> Some (Var.make ("dummy", pos), typ) + | Some typ -> Some (Var.make "dummy", typ) | None -> None); - rule_exception_to_rules = RuleSet.empty, pos; + rule_exception = BaseCase; rule_id = RuleName.fresh ("empty", pos); + rule_label = Unlabeled; } let always_false_rule (pos : Pos.t) - (have_parameter : Scopelang.Ast.typ Pos.marked option) : rule = + (have_parameter : Scopelang.Ast.typ Marked.pos option) : rule = { rule_just = Bindlib.box (ELit (Dcalc.Ast.LBool true), pos); rule_cons = Bindlib.box (ELit (Dcalc.Ast.LBool false), pos); rule_parameter = (match have_parameter with - | Some typ -> Some (Var.make ("dummy", pos), typ) + | Some typ -> Some (Var.make "dummy", typ) | None -> None); - rule_exception_to_rules = RuleSet.empty, pos; + rule_exception = BaseCase; rule_id = RuleName.fresh ("always_false", pos); + rule_label = Unlabeled; } -type assertion = expr Pos.marked Bindlib.box +type assertion = expr Marked.pos Bindlib.box type variation_typ = Increasing | Decreasing type reference_typ = Decree | Law type meta_assertion = - | FixedBy of reference_typ Pos.marked - | VariesWith of unit * variation_typ Pos.marked option + | FixedBy of reference_typ Marked.pos + | VariesWith of unit * variation_typ Marked.pos option type scope_def = { scope_def_rules : rule RuleMap.t; - scope_def_typ : Scopelang.Ast.typ Pos.marked; + scope_def_typ : Scopelang.Ast.typ Marked.pos; scope_def_is_condition : bool; scope_def_io : Scopelang.Ast.io; - scope_def_label_groups : RuleSet.t LabelMap.t; } type var_or_states = WholeVar | States of StateName.t list @@ -382,11 +383,11 @@ type program = { program_structs : Scopelang.Ast.struct_ctx; } -let rec locations_used (e : expr Pos.marked) : LocationSet.t = - match Pos.unmark e with - | ELocation l -> LocationSet.singleton (l, Pos.get_position e) +let rec locations_used (e : expr Marked.pos) : LocationSet.t = + match Marked.unmark e with + | ELocation l -> LocationSet.singleton (l, Marked.get_mark e) | EVar _ | ELit _ | EOp _ -> LocationSet.empty - | EAbs ((binder, _), _) -> + | EAbs (binder, _) -> let _, body = Bindlib.unmbind binder in locations_used body | EStruct (_, es) -> @@ -424,9 +425,9 @@ let free_variables (def : rule RuleMap.t) : Pos.t ScopeDefMap.t = (fun (loc, loc_pos) acc -> ScopeDefMap.add (match loc with - | ScopeVar (v, st) -> ScopeDef.Var (Pos.unmark v, st) + | ScopeVar (v, st) -> ScopeDef.Var (Marked.unmark v, st) | SubScopeVar (_, sub_index, sub_var) -> - ScopeDef.SubScopeVar (Pos.unmark sub_index, Pos.unmark sub_var)) + ScopeDef.SubScopeVar (Marked.unmark sub_index, Marked.unmark sub_var)) loc_pos acc) locs acc in @@ -440,36 +441,30 @@ let free_variables (def : rule RuleMap.t) : Pos.t ScopeDefMap.t = add_locs acc locs) def ScopeDefMap.empty -let make_var ((x, pos) : Var.t Pos.marked) : expr Pos.marked Bindlib.box = +let make_var ((x, pos) : Var.t Marked.pos) : expr Marked.pos Bindlib.box = Bindlib.box_apply (fun v -> v, pos) (Bindlib.box_var x) let make_abs (xs : vars) - (e : expr Pos.marked Bindlib.box) - (pos_binder : Pos.t) - (taus : Scopelang.Ast.typ Pos.marked list) - (pos : Pos.t) : expr Pos.marked Bindlib.box = - Bindlib.box_apply - (fun b -> EAbs ((b, pos_binder), taus), pos) - (Bindlib.bind_mvar xs e) + (e : expr Marked.pos Bindlib.box) + (taus : Scopelang.Ast.typ Marked.pos list) + (pos : Pos.t) : expr Marked.pos Bindlib.box = + Bindlib.box_apply (fun b -> EAbs (b, taus), pos) (Bindlib.bind_mvar xs e) let make_app - (e : expr Pos.marked Bindlib.box) - (u : expr Pos.marked Bindlib.box list) - (pos : Pos.t) : expr Pos.marked Bindlib.box = + (e : expr Marked.pos Bindlib.box) + (u : expr Marked.pos Bindlib.box list) + (pos : Pos.t) : expr Marked.pos Bindlib.box = Bindlib.box_apply2 (fun e u -> EApp (e, u), pos) e (Bindlib.box_list u) let make_let_in (x : Var.t) - (tau : Scopelang.Ast.typ Pos.marked) - (e1 : expr Pos.marked Bindlib.box) - (e2 : expr Pos.marked Bindlib.box) : expr Pos.marked Bindlib.box = + (tau : Scopelang.Ast.typ Marked.pos) + (e1 : expr Marked.pos Bindlib.box) + (e2 : expr Marked.pos Bindlib.box) : expr Marked.pos Bindlib.box = Bindlib.box_apply2 - (fun e u -> EApp (e, u), Pos.get_position (Bindlib.unbox e2)) - (make_abs (Array.of_list [x]) e2 - (Pos.get_position (Bindlib.unbox e2)) - [tau] - (Pos.get_position (Bindlib.unbox e2))) + (fun e u -> EApp (e, u), Marked.get_mark (Bindlib.unbox e2)) + (make_abs (Array.of_list [x]) e2 [tau] (Marked.get_mark (Bindlib.unbox e2))) (Bindlib.box_list [e1]) module VarMap = Map.Make (Var) diff --git a/compiler/desugared/ast.mli b/compiler/desugared/ast.mli index f5f1503e..80702135 100644 --- a/compiler/desugared/ast.mli +++ b/compiler/desugared/ast.mli @@ -52,44 +52,40 @@ module ScopeDefSet : Set.S with type elt = ScopeDef.t (**{2 Expressions}*) type location = - | ScopeVar of ScopeVar.t Pos.marked * StateName.t option + | ScopeVar of ScopeVar.t Marked.pos * StateName.t option | SubScopeVar of Scopelang.Ast.ScopeName.t - * Scopelang.Ast.SubScopeName.t Pos.marked - * ScopeVar.t Pos.marked + * Scopelang.Ast.SubScopeName.t Marked.pos + * ScopeVar.t Marked.pos -module LocationSet : Set.S with type elt = location Pos.marked +module LocationSet : Set.S with type elt = location Marked.pos +type marked_expr = expr Marked.pos (** The expressions use the {{:https://lepigre.fr/ocaml-bindlib/} Bindlib} library, based on higher-order abstract syntax*) -type expr = + +and expr = | ELocation of location - | EVar of expr Bindlib.var Pos.marked + | EVar of expr Bindlib.var | EStruct of - Scopelang.Ast.StructName.t - * expr Pos.marked Scopelang.Ast.StructFieldMap.t + Scopelang.Ast.StructName.t * marked_expr Scopelang.Ast.StructFieldMap.t | EStructAccess of - expr Pos.marked - * Scopelang.Ast.StructFieldName.t - * Scopelang.Ast.StructName.t + marked_expr * Scopelang.Ast.StructFieldName.t * Scopelang.Ast.StructName.t | EEnumInj of - expr Pos.marked - * Scopelang.Ast.EnumConstructor.t - * Scopelang.Ast.EnumName.t + marked_expr * Scopelang.Ast.EnumConstructor.t * Scopelang.Ast.EnumName.t | EMatch of - expr Pos.marked + marked_expr * Scopelang.Ast.EnumName.t - * expr Pos.marked Scopelang.Ast.EnumConstructorMap.t + * marked_expr Scopelang.Ast.EnumConstructorMap.t | ELit of Dcalc.Ast.lit | EAbs of - (expr, expr Pos.marked) Bindlib.mbinder Pos.marked - * Scopelang.Ast.typ Pos.marked list - | EApp of expr Pos.marked * expr Pos.marked list + (expr, marked_expr) Bindlib.mbinder * Scopelang.Ast.typ Marked.pos list + | EApp of marked_expr * marked_expr list | EOp of Dcalc.Ast.operator - | EDefault of expr Pos.marked list * expr Pos.marked * expr Pos.marked - | EIfThenElse of expr Pos.marked * expr Pos.marked * expr Pos.marked - | EArray of expr Pos.marked list - | ErrorOnEmpty of expr Pos.marked + | EDefault of marked_expr list * marked_expr * marked_expr + | EIfThenElse of marked_expr * marked_expr * marked_expr + | EArray of marked_expr list + | ErrorOnEmpty of marked_expr module ExprMap : Map.S with type key = expr @@ -98,7 +94,7 @@ module ExprMap : Map.S with type key = expr module Var : sig type t = expr Bindlib.var - val make : string Pos.marked -> t + val make : string -> t val compare : t -> t -> int end @@ -106,58 +102,64 @@ module VarMap : Map.S with type key = Var.t type vars = expr Bindlib.mvar -val make_var : Var.t Pos.marked -> expr Pos.marked Bindlib.box +val make_var : Var.t Marked.pos -> expr Marked.pos Bindlib.box val make_abs : vars -> - expr Pos.marked Bindlib.box -> + expr Marked.pos Bindlib.box -> + Scopelang.Ast.typ Marked.pos list -> Pos.t -> - Scopelang.Ast.typ Pos.marked list -> - Pos.t -> - expr Pos.marked Bindlib.box + expr Marked.pos Bindlib.box val make_app : - expr Pos.marked Bindlib.box -> - expr Pos.marked Bindlib.box list -> + expr Marked.pos Bindlib.box -> + expr Marked.pos Bindlib.box list -> Pos.t -> - expr Pos.marked Bindlib.box + expr Marked.pos Bindlib.box val make_let_in : Var.t -> - Scopelang.Ast.typ Pos.marked -> - expr Pos.marked Bindlib.box -> - expr Pos.marked Bindlib.box -> - expr Pos.marked Bindlib.box + Scopelang.Ast.typ Marked.pos -> + expr Marked.pos Bindlib.box -> + expr Marked.pos Bindlib.box -> + expr Marked.pos Bindlib.box (** {2 Rules and scopes}*) +type exception_situation = + | BaseCase + | ExceptionToLabel of LabelName.t Marked.pos + | ExceptionToRule of RuleName.t Marked.pos + +type label_situation = ExplicitlyLabeled of LabelName.t Marked.pos | Unlabeled + type rule = { rule_id : RuleName.t; - rule_just : expr Pos.marked Bindlib.box; - rule_cons : expr Pos.marked Bindlib.box; - rule_parameter : (Var.t * Scopelang.Ast.typ Pos.marked) option; - rule_exception_to_rules : RuleSet.t Pos.marked; + rule_just : expr Marked.pos Bindlib.box; + rule_cons : expr Marked.pos Bindlib.box; + rule_parameter : (Var.t * Scopelang.Ast.typ Marked.pos) option; + rule_exception : exception_situation; + rule_label : label_situation; } module Rule : Set.OrderedType with type t = rule -val empty_rule : Pos.t -> Scopelang.Ast.typ Pos.marked option -> rule -val always_false_rule : Pos.t -> Scopelang.Ast.typ Pos.marked option -> rule +val empty_rule : Pos.t -> Scopelang.Ast.typ Marked.pos option -> rule +val always_false_rule : Pos.t -> Scopelang.Ast.typ Marked.pos option -> rule -type assertion = expr Pos.marked Bindlib.box +type assertion = expr Marked.pos Bindlib.box type variation_typ = Increasing | Decreasing type reference_typ = Decree | Law type meta_assertion = - | FixedBy of reference_typ Pos.marked - | VariesWith of unit * variation_typ Pos.marked option + | FixedBy of reference_typ Marked.pos + | VariesWith of unit * variation_typ Marked.pos option type scope_def = { scope_def_rules : rule RuleMap.t; - scope_def_typ : Scopelang.Ast.typ Pos.marked; + scope_def_typ : Scopelang.Ast.typ Marked.pos; scope_def_is_condition : bool; scope_def_io : Scopelang.Ast.io; - scope_def_label_groups : RuleSet.t LabelMap.t; } type var_or_states = WholeVar | States of StateName.t list @@ -179,5 +181,5 @@ type program = { (** {1 Helpers} *) -val locations_used : expr Pos.marked -> LocationSet.t +val locations_used : expr Marked.pos -> LocationSet.t val free_variables : rule RuleMap.t -> Pos.t ScopeDefMap.t diff --git a/compiler/desugared/dependency.ml b/compiler/desugared/dependency.ml index 1dd2d4c4..9aad2351 100644 --- a/compiler/desugared/dependency.ml +++ b/compiler/desugared/dependency.ml @@ -129,10 +129,11 @@ let check_for_cycle (scope : Ast.scope) (g : ScopeDependencies.t) : unit = in [ ( Some ("Cycle variable " ^ var_str ^ ", declared:"), - Pos.get_position var_info ); + Marked.get_mark var_info ); ( Some ("Used here in the definition of another cycle variable " - ^ succ_str ^ ":"), + ^ succ_str + ^ ":"), edge_pos ); ]) scc) @@ -240,8 +241,17 @@ module ExceptionVertex = struct let equal x y = compare x y = 0 end +module EdgeExceptions = struct + type t = Pos.t list + + let compare = compare + let default = [Pos.no_pos] +end + module ExceptionsDependencies = - Graph.Persistent.Digraph.ConcreteBidirectionalLabeled (ExceptionVertex) (Edge) + Graph.Persistent.Digraph.ConcreteBidirectionalLabeled + (ExceptionVertex) + (EdgeExceptions) (** Module of the graph, provided by OCamlGraph. [x -> y] if [y] is an exception to [x] *) @@ -250,95 +260,190 @@ module ExceptionsSCC = Graph.Components.Make (ExceptionsDependencies) (** {2 Graph computations} *) +type exception_edge = { + label_from : Ast.LabelName.t; + label_to : Ast.LabelName.t; + edge_positions : Pos.t list; +} + let build_exceptions_graph (def : Ast.rule Ast.RuleMap.t) (def_info : Ast.ScopeDef.t) : ExceptionsDependencies.t = - (* first we collect all the rule sets referred by exceptions *) - let all_rule_sets_pointed_to_by_exceptions : Ast.RuleSet.t list = + (* First we partition the definitions into groups bearing the same label. To + handle the rules that were not labeled by the user, we create implicit + labels. *) + + (* All the rules of the form [definition x ...] are base case with no explicit + label, so they should share this implicit label. *) + let base_case_implicit_label = + Ast.LabelName.fresh ("base_case", Pos.no_pos) + in + (* When declaring [exception definition x ...], it means there is a unique + rule [R] to which this can be an exception to. So we give a unique label to + all the rules that are implicitly exceptions to rule [R]. *) + let exception_to_rule_implicit_labels : Ast.LabelName.t Ast.RuleMap.t = Ast.RuleMap.fold - (fun _rule_name rule acc -> - if Ast.RuleSet.is_empty (Pos.unmark rule.Ast.rule_exception_to_rules) - then acc - else Pos.unmark rule.Ast.rule_exception_to_rules :: acc) + (fun _ rule_from exception_to_rule_implicit_labels -> + match rule_from.Ast.rule_exception with + | Ast.ExceptionToRule (rule_to, _) -> ( + match + Ast.RuleMap.find_opt rule_to exception_to_rule_implicit_labels + with + | Some _ -> + (* we already created the label *) exception_to_rule_implicit_labels + | None -> + Ast.RuleMap.add rule_to + (Ast.LabelName.fresh + ( "exception_to_" + ^ Marked.unmark (Ast.RuleName.get_info rule_to), + Pos.no_pos )) + exception_to_rule_implicit_labels) + | _ -> exception_to_rule_implicit_labels) + def Ast.RuleMap.empty + in + (* When declaring [exception foo_l definition x ...], the rule is exception to + all the rules sharing label [foo_l]. So we give a unique label to all the + rules that are implicitly exceptions to rule [foo_l]. *) + let exception_to_label_implicit_labels : Ast.LabelName.t Ast.LabelMap.t = + Ast.RuleMap.fold + (fun _ rule_from + (exception_to_label_implicit_labels : Ast.LabelName.t Ast.LabelMap.t) -> + match rule_from.Ast.rule_exception with + | Ast.ExceptionToLabel (label_to, _) -> ( + match + Ast.LabelMap.find_opt label_to exception_to_label_implicit_labels + with + | Some _ -> + (* we already created the label *) + exception_to_label_implicit_labels + | None -> + Ast.LabelMap.add label_to + (Ast.LabelName.fresh + ( "exception_to_" + ^ Marked.unmark (Ast.LabelName.get_info label_to), + Pos.no_pos )) + exception_to_label_implicit_labels) + | _ -> exception_to_label_implicit_labels) + def Ast.LabelMap.empty + in + + (* Now we have all the labels necessary to partition our rules into sets, each + one corresponding to a label relating to the structure of the exception + DAG. *) + let label_to_rule_sets = + Ast.RuleMap.fold + (fun rule_name rule rule_sets -> + let label_of_rule = + match rule.Ast.rule_label with + | Ast.ExplicitlyLabeled (l, _) -> l + | Ast.Unlabeled -> ( + match rule.Ast.rule_exception with + | BaseCase -> base_case_implicit_label + | ExceptionToRule (r, _) -> + Ast.RuleMap.find r exception_to_rule_implicit_labels + | ExceptionToLabel (l', _) -> + Ast.LabelMap.find l' exception_to_label_implicit_labels) + in + Ast.LabelMap.update label_of_rule + (fun rule_set -> + match rule_set with + | None -> Some (Ast.RuleSet.singleton rule_name) + | Some rule_set -> Some (Ast.RuleSet.add rule_name rule_set)) + rule_sets) + def Ast.LabelMap.empty + in + let find_label_of_rule (r : Ast.RuleName.t) : Ast.LabelName.t = + fst + (Ast.LabelMap.choose + (Ast.LabelMap.filter + (fun _ rule_set -> Ast.RuleSet.mem r rule_set) + label_to_rule_sets)) + in + (* Next, we collect the exception edges between those groups of rules referred + by their labels. This is also at this step that we check consistency of the + edges as they are declared at each rule but should be the same for all the + rules of the same group. *) + let exception_edges : exception_edge list = + Ast.RuleMap.fold + (fun rule_name rule exception_edges -> + let label_from = find_label_of_rule rule_name in + let label_to_and_pos = + match rule.Ast.rule_exception with + | Ast.BaseCase -> None + | Ast.ExceptionToRule (r', pos) -> Some (find_label_of_rule r', pos) + | Ast.ExceptionToLabel (l', pos) -> Some (l', pos) + in + match label_to_and_pos with + | None -> exception_edges + | Some (label_to, edge_pos) -> ( + let other_edges_originating_from_same_label = + List.filter + (fun edge -> Ast.LabelName.compare edge.label_from label_from = 0) + exception_edges + in + (* We check the consistency*) + if Ast.LabelName.compare label_from label_to = 0 then + Errors.raise_spanned_error edge_pos + "Cannot define rule as an exception to itself"; + List.iter + (fun edge -> + if Ast.LabelName.compare edge.label_to label_to <> 0 then + Errors.raise_multispanned_error + (( Some + "This declaration contradicts another exception \ + declarations:", + edge_pos ) + :: List.map + (fun pos -> + Some "Here is another exception declaration:", pos) + edge.edge_positions) + "The declaration of exceptions are inconsistent for variable \ + %a." + Ast.ScopeDef.format_t def_info) + other_edges_originating_from_same_label; + (* Now we add the edge to the list*) + let existing_edge = + List.find_opt + (fun edge -> + Ast.LabelName.compare edge.label_from label_from = 0 + && Ast.LabelName.compare edge.label_to label_to = 0) + exception_edges + in + match existing_edge with + | None -> + { label_from; label_to; edge_positions = [edge_pos] } + :: exception_edges + | Some existing_edge -> + { + label_from; + label_to; + edge_positions = edge_pos :: existing_edge.edge_positions; + } + :: List.filter (fun edge -> edge <> existing_edge) exception_edges)) def [] in - (* we make sure these sets are either disjoint or equal ; should be a - syntactic invariant since you currently can't assign two labels to a single - rule but an extra check is valuable since this is a required invariant for - the graph to be sound *) - List.iter - (fun rule_set1 -> - List.iter - (fun rule_set2 -> - if Ast.RuleSet.equal rule_set1 rule_set2 then () - else if Ast.RuleSet.disjoint rule_set1 rule_set2 then () - else - let spans = - List.of_seq - (Seq.map - (fun rule -> - ( Some "Rule or definition from the first group:", - Pos.get_position (Ast.RuleName.get_info rule) )) - (Ast.RuleSet.to_seq rule_set1)) - @ List.of_seq - (Seq.map - (fun rule -> - ( Some "Rule or definition from the second group:", - Pos.get_position (Ast.RuleName.get_info rule) )) - (Ast.RuleSet.to_seq rule_set2)) - in - Errors.raise_multispanned_error spans - "Definitions or rules grouped by different labels overlap, \ - whereas these groups shoule be disjoint") - all_rule_sets_pointed_to_by_exceptions) - all_rule_sets_pointed_to_by_exceptions; - (* Then we add the exception graph vertices by taking all those sets of rules - pointed to by exceptions, and adding the remaining rules not pointed as - separate singleton set vertices *) + (* We've got the vertices and the edges, let's build the graph! *) let g = - List.fold_left - (fun g rule_set -> ExceptionsDependencies.add_vertex g rule_set) - ExceptionsDependencies.empty all_rule_sets_pointed_to_by_exceptions - in - let g = - Ast.RuleMap.fold - (fun (rule_name : Ast.RuleName.t) _ g -> - if - List.exists - (fun rule_set_pointed_to_by_exceptions -> - Ast.RuleSet.mem rule_name rule_set_pointed_to_by_exceptions) - all_rule_sets_pointed_to_by_exceptions - then g - else - ExceptionsDependencies.add_vertex g (Ast.RuleSet.singleton rule_name)) - def g + Ast.LabelMap.fold + (fun _label rule_set g -> ExceptionsDependencies.add_vertex g rule_set) + label_to_rule_sets ExceptionsDependencies.empty in (* then we add the edges *) let g = - Ast.RuleMap.fold - (fun rule_name rule g -> - (* Right now, exceptions can only consist of one rule, we may want to - relax that constraint later in the development of Catala. *) - let exception_to_ruleset, pos = rule.Ast.rule_exception_to_rules in - if Ast.RuleSet.is_empty exception_to_ruleset then g - (* we don't add an edge*) - else if ExceptionsDependencies.mem_vertex g exception_to_ruleset then - if exception_to_ruleset = Ast.RuleSet.singleton rule_name then - Errors.raise_spanned_error pos - "Cannot define rule as an exception to itself" - else - let edge = - ExceptionsDependencies.E.create - (Ast.RuleSet.singleton rule_name) - pos exception_to_ruleset - in - ExceptionsDependencies.add_edge_e g edge - else - Errors.raise_spanned_error pos - "This rule has been declared as an exception to an incorrect \ - label: this label is not attached to a definition of \"%a\"" - Ast.ScopeDef.format_t def_info) - def g + List.fold_left + (fun g edge -> + let rule_group_from = + Ast.LabelMap.find edge.label_from label_to_rule_sets + in + let rule_group_to = + Ast.LabelMap.find edge.label_to label_to_rule_sets + in + let edge = + ExceptionsDependencies.E.create rule_group_from edge.edge_positions + rule_group_to + in + ExceptionsDependencies.add_edge_e g edge) + g exception_edges in g @@ -364,13 +469,16 @@ let check_for_exception_cycle (g : ExceptionsDependencies.t) : unit = in [ ( Some - ("Cyclic exception for definition of variable \"" ^ var_str - ^ "\", declared here:"), - Pos.get_position var_info ); + ("Cyclic exception for definition of variable \"" + ^ var_str + ^ "\", declared here:"), + Marked.get_mark var_info ); ( Some ("Used here in the definition of another cyclic exception \ - for defining \"" ^ var_str ^ "\":"), - edge_pos ); + for defining \"" + ^ var_str + ^ "\":"), + List.hd edge_pos ); ]) scc) in diff --git a/compiler/desugared/dependency.mli b/compiler/desugared/dependency.mli index e0aea4bd..2ea2f513 100644 --- a/compiler/desugared/dependency.mli +++ b/compiler/desugared/dependency.mli @@ -68,8 +68,10 @@ val build_scope_dependencies : Ast.scope -> ScopeDependencies.t (** {1 Exceptions dependency graph} *) +module EdgeExceptions : Graph.Sig.ORDERED_TYPE_DFT with type t = Pos.t list + module ExceptionsDependencies : - Graph.Sig.P with type V.t = Ast.RuleSet.t and type E.label = Edge.t + Graph.Sig.P with type V.t = Ast.RuleSet.t and type E.label = EdgeExceptions.t val build_exceptions_graph : Ast.rule Ast.RuleMap.t -> Ast.ScopeDef.t -> ExceptionsDependencies.t diff --git a/compiler/desugared/desugared_to_scope.ml b/compiler/desugared/desugared_to_scope.ml index e0741a27..cfeefa41 100644 --- a/compiler/desugared/desugared_to_scope.ml +++ b/compiler/desugared/desugared_to_scope.ml @@ -30,84 +30,83 @@ type ctx = { } let tag_with_log_entry - (e : Scopelang.Ast.expr Pos.marked) + (e : Scopelang.Ast.expr Marked.pos) (l : Dcalc.Ast.log_entry) (markings : Utils.Uid.MarkedString.info list) : - Scopelang.Ast.expr Pos.marked = + Scopelang.Ast.expr Marked.pos = ( Scopelang.Ast.EApp ( ( Scopelang.Ast.EOp (Dcalc.Ast.Unop (Dcalc.Ast.Log (l, markings))), - Pos.get_position e ), + Marked.get_mark e ), [e] ), - Pos.get_position e ) + Marked.get_mark e ) -let rec translate_expr (ctx : ctx) (e : Ast.expr Pos.marked) : - Scopelang.Ast.expr Pos.marked Bindlib.box = - match Pos.unmark e with +let rec translate_expr (ctx : ctx) (e : Ast.expr Marked.pos) : + Scopelang.Ast.expr Marked.pos Bindlib.box = + let m = Marked.get_mark e in + match Marked.unmark e with | Ast.ELocation (SubScopeVar (s_name, ss_name, s_var)) -> (* When referring to a subscope variable in an expression, we are referring to the output, hence we take the last state. *) let new_s_var = - match Ast.ScopeVarMap.find (Pos.unmark s_var) ctx.scope_var_mapping with - | WholeVar new_s_var -> Pos.same_pos_as new_s_var s_var - | States states -> Pos.same_pos_as (snd (List.hd (List.rev states))) s_var + match + Ast.ScopeVarMap.find (Marked.unmark s_var) ctx.scope_var_mapping + with + | WholeVar new_s_var -> Marked.same_mark_as new_s_var s_var + | States states -> + Marked.same_mark_as (snd (List.hd (List.rev states))) s_var in Bindlib.box - ( Scopelang.Ast.ELocation (SubScopeVar (s_name, ss_name, new_s_var)), - Pos.get_position e ) + (Scopelang.Ast.ELocation (SubScopeVar (s_name, ss_name, new_s_var)), m) | Ast.ELocation (ScopeVar (s_var, None)) -> Bindlib.box ( Scopelang.Ast.ELocation (ScopeVar (match - Ast.ScopeVarMap.find (Pos.unmark s_var) ctx.scope_var_mapping + Ast.ScopeVarMap.find (Marked.unmark s_var) ctx.scope_var_mapping with - | WholeVar new_s_var -> Pos.same_pos_as new_s_var s_var + | WholeVar new_s_var -> Marked.same_mark_as new_s_var s_var | States _ -> failwith "should not happen")), - Pos.get_position e ) + m ) | Ast.ELocation (ScopeVar (s_var, Some state)) -> Bindlib.box ( Scopelang.Ast.ELocation (ScopeVar (match - Ast.ScopeVarMap.find (Pos.unmark s_var) ctx.scope_var_mapping + Ast.ScopeVarMap.find (Marked.unmark s_var) ctx.scope_var_mapping with | WholeVar _ -> failwith "should not happen" - | States states -> Pos.same_pos_as (List.assoc state states) s_var)), - Pos.get_position e ) + | States states -> + Marked.same_mark_as (List.assoc state states) s_var)), + m ) | Ast.EVar v -> Bindlib.box_apply - (fun v -> Pos.same_pos_as v e) - (Bindlib.box_var (Ast.VarMap.find (Pos.unmark v) ctx.var_mapping)) + (fun v -> Marked.same_mark_as v e) + (Bindlib.box_var (Ast.VarMap.find v ctx.var_mapping)) | EStruct (s_name, fields) -> Bindlib.box_apply - (fun new_fields -> - Scopelang.Ast.EStruct (s_name, new_fields), Pos.get_position e) + (fun new_fields -> Scopelang.Ast.EStruct (s_name, new_fields), m) (Scopelang.Ast.StructFieldMapLift.lift_box (Scopelang.Ast.StructFieldMap.map (translate_expr ctx) fields)) | EStructAccess (e1, s_name, f_name) -> Bindlib.box_apply - (fun new_e1 -> - Scopelang.Ast.EStructAccess (new_e1, s_name, f_name), Pos.get_position e) + (fun new_e1 -> Scopelang.Ast.EStructAccess (new_e1, s_name, f_name), m) (translate_expr ctx e1) | EEnumInj (e1, cons, e_name) -> Bindlib.box_apply - (fun new_e1 -> - Scopelang.Ast.EEnumInj (new_e1, cons, e_name), Pos.get_position e) + (fun new_e1 -> Scopelang.Ast.EEnumInj (new_e1, cons, e_name), m) (translate_expr ctx e1) | EMatch (e1, e_name, arms) -> Bindlib.box_apply2 (fun new_e1 new_arms -> - Scopelang.Ast.EMatch (new_e1, e_name, new_arms), Pos.get_position e) + Scopelang.Ast.EMatch (new_e1, e_name, new_arms), m) (translate_expr ctx e1) (Scopelang.Ast.EnumConstructorMapLift.lift_box (Scopelang.Ast.EnumConstructorMap.map (translate_expr ctx) arms)) - | ELit l -> Bindlib.box (Scopelang.Ast.ELit l, Pos.get_position e) - | EAbs ((binder, binder_pos), typs) -> + | ELit l -> Bindlib.box (Scopelang.Ast.ELit l, m) + | EAbs (binder, typs) -> let vars, body = Bindlib.unmbind binder in let new_vars = - Array.map - (fun var -> Scopelang.Ast.Var.make (Bindlib.name_of var, binder_pos)) - vars + Array.map (fun var -> Scopelang.Ast.Var.make (Bindlib.name_of var)) vars in let ctx = List.fold_left2 @@ -116,35 +115,32 @@ let rec translate_expr (ctx : ctx) (e : Ast.expr Pos.marked) : ctx (Array.to_list vars) (Array.to_list new_vars) in Bindlib.box_apply - (fun new_binder -> - Scopelang.Ast.EAbs ((new_binder, binder_pos), typs), Pos.get_position e) + (fun new_binder -> Scopelang.Ast.EAbs (new_binder, typs), m) (Bindlib.bind_mvar new_vars (translate_expr ctx body)) | EApp (e1, args) -> Bindlib.box_apply2 - (fun new_e1 new_args -> - Scopelang.Ast.EApp (new_e1, new_args), Pos.get_position e) + (fun new_e1 new_args -> Scopelang.Ast.EApp (new_e1, new_args), m) (translate_expr ctx e1) (Bindlib.box_list (List.map (translate_expr ctx) args)) - | EOp op -> Bindlib.box (Scopelang.Ast.EOp op, Pos.get_position e) + | EOp op -> Bindlib.box (Scopelang.Ast.EOp op, m) | EDefault (excepts, just, cons) -> Bindlib.box_apply3 (fun new_excepts new_just new_cons -> - Scopelang.Ast.make_default ~pos:(Pos.get_position e) new_excepts - new_just new_cons) + Scopelang.Ast.make_default ~pos:m new_excepts new_just new_cons) (Bindlib.box_list (List.map (translate_expr ctx) excepts)) (translate_expr ctx just) (translate_expr ctx cons) | EIfThenElse (e1, e2, e3) -> Bindlib.box_apply3 (fun new_e1 new_e2 new_e3 -> - Scopelang.Ast.EIfThenElse (new_e1, new_e2, new_e3), Pos.get_position e) + Scopelang.Ast.EIfThenElse (new_e1, new_e2, new_e3), m) (translate_expr ctx e1) (translate_expr ctx e2) (translate_expr ctx e3) | EArray args -> Bindlib.box_apply - (fun new_args -> Scopelang.Ast.EArray new_args, Pos.get_position e) + (fun new_args -> Scopelang.Ast.EArray new_args, m) (Bindlib.box_list (List.map (translate_expr ctx) args)) | ErrorOnEmpty e1 -> Bindlib.box_apply - (fun new_e1 -> Scopelang.Ast.ErrorOnEmpty new_e1, Pos.get_position e) + (fun new_e1 -> Scopelang.Ast.ErrorOnEmpty new_e1, m) (translate_expr ctx e1) (** {1 Rule tree construction} *) @@ -155,8 +151,8 @@ type rule_tree = | Leaf of Ast.rule list (** Rules defining a base case piecewise. List is non-empty. *) | Node of rule_tree list * Ast.rule list - (** A list of exceptions to a non-empty list of rules defining a base case - piecewise. *) + (** [Node (exceptions, base_case)] is a list of exceptions to a non-empty + list of rules defining a base case piecewise. *) (** Transforms a flat list of rules into a tree, taking into account the priorities declared between rules *) @@ -197,7 +193,7 @@ let rec rule_tree_to_expr (ctx : ctx) (def_pos : Pos.t) (is_func : Ast.Var.t option) - (tree : rule_tree) : Scopelang.Ast.expr Pos.marked Bindlib.box = + (tree : rule_tree) : Scopelang.Ast.expr Marked.pos Bindlib.box = let exceptions, base_rules = match tree with Leaf r -> [], r | Node (exceptions, r) -> exceptions, r in @@ -205,8 +201,8 @@ let rec rule_tree_to_expr whole rule tree into a function, we need to perform some alpha-renaming of all the expressions *) let substitute_parameter - (e : Ast.expr Pos.marked Bindlib.box) - (rule : Ast.rule) : Ast.expr Pos.marked Bindlib.box = + (e : Ast.expr Marked.pos Bindlib.box) + (rule : Ast.rule) : Ast.expr Marked.pos Bindlib.box = match is_func, rule.Ast.rule_parameter with | Some new_param, Some (old_param, _) -> let binder = Bindlib.bind_var old_param e in @@ -225,7 +221,7 @@ let rec rule_tree_to_expr match Ast.VarMap.find_opt new_param ctx.var_mapping with | None -> let new_param_scope = - Scopelang.Ast.Var.make (Bindlib.name_of new_param, def_pos) + Scopelang.Ast.Var.make (Bindlib.name_of new_param) in { ctx with @@ -248,8 +244,8 @@ let rec rule_tree_to_expr (fun rule -> substitute_parameter rule.Ast.rule_cons rule) base_rules in - let translate_and_unbox_list (list : Ast.expr Pos.marked Bindlib.box list) : - Scopelang.Ast.expr Pos.marked Bindlib.box list = + let translate_and_unbox_list (list : Ast.expr Marked.pos Bindlib.box list) : + Scopelang.Ast.expr Marked.pos Bindlib.box list = List.map (fun e -> (* There are two levels of boxing here, the outermost is introduced by @@ -303,7 +299,7 @@ let rec rule_tree_to_expr in Scopelang.Ast.make_abs (Array.of_list [Ast.VarMap.find new_param ctx.var_mapping]) - default def_pos [typ] def_pos + default [typ] def_pos else default | _ -> (* should not happen *) assert false @@ -315,13 +311,15 @@ let translate_def (ctx : ctx) (def_info : Ast.ScopeDef.t) (def : Ast.rule Ast.RuleMap.t) - (typ : Scopelang.Ast.typ Pos.marked) + (typ : Scopelang.Ast.typ Marked.pos) (io : Scopelang.Ast.io) ~(is_cond : bool) - ~(is_subscope_var : bool) : Scopelang.Ast.expr Pos.marked = + ~(is_subscope_var : bool) : Scopelang.Ast.expr Marked.pos = (* Here, we have to transform this list of rules into a default tree. *) let is_def_func = - match Pos.unmark typ with Scopelang.Ast.TArrow (_, _) -> true | _ -> false + match Marked.unmark typ with + | Scopelang.Ast.TArrow (_, _) -> true + | _ -> false in let is_rule_func _ (r : Ast.rule) : bool = Option.is_some r.Ast.rule_parameter @@ -330,12 +328,12 @@ let translate_def let all_rules_not_func = Ast.RuleMap.for_all (fun n r -> not (is_rule_func n r)) def in - let is_def_func_param_typ : Scopelang.Ast.typ Pos.marked option = + let is_def_func_param_typ : Scopelang.Ast.typ Marked.pos option = if is_def_func && all_rules_func then - match Pos.unmark typ with + match Marked.unmark typ with | Scopelang.Ast.TArrow (t_param, _) -> Some t_param | _ -> - Errors.raise_spanned_error (Pos.get_position typ) + Errors.raise_spanned_error (Marked.get_mark typ) "The definitions of %a are function but its type, %a, is not a \ function type" Ast.ScopeDef.format_t def_info Scopelang.Print.format_typ typ @@ -345,12 +343,12 @@ let translate_def List.map (fun (_, r) -> ( Some "This definition is a function:", - Pos.get_position (Bindlib.unbox r.Ast.rule_cons) )) + Marked.get_mark (Bindlib.unbox r.Ast.rule_cons) )) (Ast.RuleMap.bindings (Ast.RuleMap.filter is_rule_func def)) @ List.map (fun (_, r) -> ( Some "This definition is not a function:", - Pos.get_position (Bindlib.unbox r.Ast.rule_cons) )) + Marked.get_mark (Bindlib.unbox r.Ast.rule_cons) )) (Ast.RuleMap.bindings (Ast.RuleMap.filter (fun n r -> not (is_rule_func n r)) def)) in @@ -360,8 +358,12 @@ let translate_def in let top_list = def_map_to_tree def_info def in let top_value = - (if is_cond then Ast.always_false_rule else Ast.empty_rule) - (Pos.get_position typ) is_def_func_param_typ + if is_cond then + Some + (Ast.always_false_rule + (Ast.ScopeDef.get_position def_info) + is_def_func_param_typ) + else None in if Ast.RuleMap.cardinal def = 0 @@ -386,27 +388,37 @@ let translate_def && not (is_cond && - match Pos.unmark io.Scopelang.Ast.io_input with + match Marked.unmark io.Scopelang.Ast.io_input with | OnlyInput -> true | _ -> false) (* However, this special case suffers from an exception: when a condition is defined as an OnlyInput to a subscope, since the [false] default value will not be provided by the calee scope, it has to be placed in the caller. *) - then ELit LEmptyError, Pos.no_pos + then ELit LEmptyError, Ast.ScopeDef.get_position def_info else Bindlib.unbox (rule_tree_to_expr ~toplevel:true ctx (Ast.ScopeDef.get_position def_info) - (Option.map - (fun _ -> - Ast.Var.make ("param", Ast.ScopeDef.get_position def_info)) - is_def_func_param_typ) - (match top_list with - | [] -> - (* In this case, there are no rules to define the expression *) + (Option.map (fun _ -> Ast.Var.make "param") is_def_func_param_typ) + (match top_list, top_value with + | [], None -> + (* In this case, there are no rules to define the expression and no + default value so we put an empty rule. *) + Leaf [Ast.empty_rule (Marked.get_mark typ) is_def_func_param_typ] + | [], Some top_value -> + (* In this case, there are no rules to define the expression but a + default value so we put it. *) Leaf [top_value] - | _ -> Node (top_list, [top_value]))) + | _, Some top_value -> + (* When there are rules + a default value, we put the rules as + exceptions to the default value *) + Node (top_list, [top_value]) + | [top_tree], None -> top_tree + | _, None -> + Node + ( top_list, + [Ast.empty_rule (Marked.get_mark typ) is_def_func_param_typ] ))) (** Translates a scope *) let translate_scope (ctx : ctx) (scope : Ast.scope) : Scopelang.Ast.scope_decl = @@ -429,17 +441,17 @@ let translate_scope (ctx : ctx) (scope : Ast.scope) : Scopelang.Ast.scope_decl = let var_def = scope_def.scope_def_rules in let var_typ = scope_def.scope_def_typ in let is_cond = scope_def.scope_def_is_condition in - match Pos.unmark scope_def.Ast.scope_def_io.io_input with + match Marked.unmark scope_def.Ast.scope_def_io.io_input with | OnlyInput when not (Ast.RuleMap.is_empty var_def) -> (* If the variable is tagged as input, then it shall not be redefined. *) Errors.raise_multispanned_error (( Some "Incriminated variable:", - Pos.get_position (Ast.ScopeVar.get_info var) ) + Marked.get_mark (Ast.ScopeVar.get_info var) ) :: List.map (fun (rule, _) -> ( Some "Incriminated variable definition:", - Pos.get_position (Ast.RuleName.get_info rule) )) + Marked.get_mark (Ast.RuleName.get_info rule) )) (Ast.RuleMap.bindings var_def)) "It is impossible to give a definition to a scope variable \ tagged as input." @@ -465,9 +477,9 @@ let translate_scope (ctx : ctx) (scope : Ast.scope) : Scopelang.Ast.scope_decl = Scopelang.Ast.Definition ( ( Scopelang.Ast.ScopeVar ( scope_var, - Pos.get_position + Marked.get_mark (Scopelang.Ast.ScopeVar.get_info scope_var) ), - Pos.get_position + Marked.get_mark (Scopelang.Ast.ScopeVar.get_info scope_var) ), var_typ, scope_def.Ast.scope_def_io, @@ -491,7 +503,7 @@ let translate_scope (ctx : ctx) (scope : Ast.scope) : Scopelang.Ast.scope_decl = and are not visible in the input of the subscope *) && not ((match - Pos.unmark scope_def.Ast.scope_def_io.io_input + Marked.unmark scope_def.Ast.scope_def_io.io_input with | Scopelang.Ast.NoInput -> true | _ -> false) @@ -511,20 +523,21 @@ let translate_scope (ctx : ctx) (scope : Ast.scope) : Scopelang.Ast.scope_decl = subscope. But we have to check that this redefinition is allowed with respect to the io parameters of that subscope variable. *) - (match Pos.unmark scope_def.Ast.scope_def_io.io_input with + (match + Marked.unmark scope_def.Ast.scope_def_io.io_input + with | Scopelang.Ast.NoInput -> Errors.raise_multispanned_error (( Some "Incriminated subscope:", Ast.ScopeDef.get_position def_key ) :: ( Some "Incriminated variable:", - Pos.get_position + Marked.get_mark (Ast.ScopeVar.get_info sub_scope_var) ) :: List.map (fun (rule, _) -> ( Some "Incriminated subscope variable definition:", - Pos.get_position (Ast.RuleName.get_info rule) - )) + Marked.get_mark (Ast.RuleName.get_info rule) )) (Ast.RuleMap.bindings def)) "It is impossible to give a definition to a subscope \ variable not tagged as input or context." @@ -536,7 +549,7 @@ let translate_scope (ctx : ctx) (scope : Ast.scope) : Scopelang.Ast.scope_decl = ( Some "Incriminated subscope:", Ast.ScopeDef.get_position def_key ); ( Some "Incriminated variable:", - Pos.get_position + Marked.get_mark (Ast.ScopeVar.get_info sub_scope_var) ); ] "This subscope variable is a mandatory input but no \ @@ -554,7 +567,7 @@ let translate_scope (ctx : ctx) (scope : Ast.scope) : Scopelang.Ast.scope_decl = scope.scope_sub_scopes in let var_pos = - Pos.get_position (Ast.ScopeVar.get_info sub_scope_var) + Marked.get_mark (Ast.ScopeVar.get_info sub_scope_var) in Scopelang.Ast.Definition ( ( Scopelang.Ast.SubScopeVar @@ -673,8 +686,10 @@ let translate_program (pgrm : Ast.program) : Scopelang.Ast.program = (let state_name, state_pos = Ast.StateName.get_info state in - ( Pos.unmark (Ast.ScopeVar.get_info scope_var) - ^ "_" ^ state_name, + ( Marked.unmark + (Ast.ScopeVar.get_info scope_var) + ^ "_" + ^ state_name, state_pos )) )) states)) ctx.scope_var_mapping; diff --git a/compiler/driver.ml b/compiler/driver.ml index d1226db5..bf4c1e10 100644 --- a/compiler/driver.ml +++ b/compiler/driver.ml @@ -81,20 +81,12 @@ let driver source_file (options : Cli.options) : int = Surface.Parser_driver.parse_top_level_file source_file language in let prgm = Surface.Fill_positions.fill_pos_with_legislative_info prgm in - let get_output ?ext () = - match options.output_file, ext with - | Some "-", _ | None, None -> None, fun f -> f stdout - | Some f, _ -> Some f, File.with_out_channel f - | None, Some ext -> - let src = - match source_file with FileName f -> f | Contents _ -> "a" - in - let f = Filename.remove_extension src ^ ext in - Some f, File.with_out_channel f + let get_output ?ext = + File.get_out_channel ~source_file ~output_file:options.output_file ?ext in - let get_output_format ?ext () = - let f, with_ = get_output ?ext () in - f, fun f -> with_ (fun oc -> File.with_formatter_of_out_channel oc f) + let get_output_format ?ext = + File.get_formatter_of_out_channel ~source_file + ~output_file:options.output_file ?ext in (match backend with | `Makefile -> @@ -109,7 +101,8 @@ let driver source_file (options : Cli.options) : int = let output_file, with_output = get_output ~ext:".d" () in Cli.debug_print "Writing list of dependencies to %s..." (Option.value ~default:"stdout" output_file); - with_output @@ fun oc -> + with_output + @@ fun oc -> Printf.fprintf oc "%s:\\\n%s\n%s:" (String.concat "\\\n" (Option.value ~default:"stdout" output_file @@ -173,7 +166,8 @@ let driver source_file (options : Cli.options) : int = match backend with | `Scopelang -> let _output_file, with_output = get_output_format () in - with_output @@ fun fmt -> + with_output + @@ fun fmt -> if Option.is_some options.ex_scope then Format.fprintf fmt "%a\n" (Scopelang.Print.format_scope ~debug:options.debug) @@ -196,13 +190,11 @@ let driver source_file (options : Cli.options) : int = end else prgm in - let prgrm_dcalc_expr = - Bindlib.unbox (Dcalc.Ast.build_whole_program_expr prgm scope_uid) - in match backend with | `Dcalc -> let _output_file, with_output = get_output_format () in - with_output @@ fun fmt -> + with_output + @@ fun fmt -> if Option.is_some options.ex_scope then Format.fprintf fmt "%a\n" (Dcalc.Print.format_scope ~debug:options.debug prgm.decl_ctx) @@ -218,13 +210,19 @@ let driver source_file (options : Cli.options) : int = else acc) prgm.scopes) ) else + let prgrm_dcalc_expr = + Bindlib.unbox + (Dcalc.Ast.build_whole_program_expr ~box_expr:Dcalc.Ast.box_expr + ~make_abs:Dcalc.Ast.make_abs + ~make_let_in:Dcalc.Ast.make_let_in prgm scope_uid) + in Format.fprintf fmt "%a\n" (Dcalc.Print.format_expr prgm.decl_ctx) prgrm_dcalc_expr | ( `Interpret | `Typecheck | `OCaml | `Python | `Scalc | `Lcalc | `Proof | `Plugin _ ) as backend -> ( Cli.debug_print "Typechecking..."; - let _typ = Dcalc.Typing.infer_type prgm.decl_ctx prgrm_dcalc_expr in + let prgm = Dcalc.Typing.infer_types_program prgm in (* Cli.debug_print (Format.asprintf "Typechecking results :@\n%a" (Dcalc.Print.format_typ prgm.decl_ctx) typ); *) match backend with @@ -242,6 +240,12 @@ let driver source_file (options : Cli.options) : int = Verification.Solver.solve_vc prgm.decl_ctx vcs | `Interpret -> Cli.debug_print "Starting interpretation..."; + let prgrm_dcalc_expr = + Bindlib.unbox + (Dcalc.Ast.build_whole_program_expr ~box_expr:Dcalc.Ast.box_expr + ~make_abs:Dcalc.Ast.make_abs + ~make_let_in:Dcalc.Ast.make_let_in prgm scope_uid) + in let results = Dcalc.Interpreter.interpret_program prgm.decl_ctx prgrm_dcalc_expr in @@ -281,7 +285,7 @@ let driver source_file (options : Cli.options) : int = Cli.debug_print "Optimizing lambda calculus..."; Lcalc.Optimizations.optimize_program prgm end - else prgm + else Lcalc.Ast.untype_program prgm in let prgm = if options.closure_conversion then ( @@ -294,7 +298,8 @@ let driver source_file (options : Cli.options) : int = match backend with | `Lcalc -> let _output_file, with_output = get_output_format () in - with_output @@ fun fmt -> + with_output + @@ fun fmt -> if Option.is_some options.ex_scope then Format.fprintf fmt "%a\n" (Lcalc.Print.format_scope ~debug:options.debug prgm.decl_ctx) @@ -310,39 +315,42 @@ let driver source_file (options : Cli.options) : int = else acc) prgm.scopes) ) else - ignore - (Dcalc.Ast.fold_left_scope_defs ~init:0 - ~f:(fun i scope_def _ -> - Format.fprintf fmt "%s%a" - (if i = 0 then "" else "\n") - (Lcalc.Print.format_scope prgm.decl_ctx) - (scope_uid, scope_def.scope_body); - i + 1) - prgm.scopes) + let prgrm_lcalc_expr = + Bindlib.unbox + (Dcalc.Ast.build_whole_program_expr + ~box_expr:Lcalc.Ast.box_expr ~make_abs:Lcalc.Ast.make_abs + ~make_let_in:Lcalc.Ast.make_let_in prgm scope_uid) + in + Format.fprintf fmt "%a\n" + (Lcalc.Print.format_expr prgm.decl_ctx) + prgrm_lcalc_expr | (`OCaml | `Python | `Scalc | `Plugin _) as backend -> ( match backend with | `OCaml -> let output_file, with_output = get_output_format ~ext:".ml" () in - with_output @@ fun fmt -> + with_output + @@ fun fmt -> Cli.debug_print "Compiling program into OCaml..."; Cli.debug_print "Writing to %s..." (Option.value ~default:"stdout" output_file); Lcalc.To_ocaml.format_program fmt prgm type_ordering | `Plugin (Plugin.Lcalc p) -> - let output_file, _ = get_output ~ext:p.Plugin.extension () in + let output_file, _ = + get_output_format ~ext:p.Plugin.extension () + in Cli.debug_print "Compiling program through backend \"%s\"..." p.Plugin.name; - Cli.debug_print "Writing to %s..." - (Option.value ~default:"stdout" output_file); - p.Plugin.apply output_file prgm type_ordering + p.Plugin.apply ~source_file ~output_file ~scope:options.ex_scope + prgm type_ordering | (`Python | `Scalc | `Plugin (Plugin.Scalc _)) as backend -> ( let prgm = Scalc.Compile_from_lambda.translate_program prgm in match backend with | `Scalc -> let _output_file, with_output = get_output_format () in - with_output @@ fun fmt -> + with_output + @@ fun fmt -> if Option.is_some options.ex_scope then Format.fprintf fmt "%a\n" (Scalc.Print.format_scope ~debug:options.debug @@ -365,7 +373,8 @@ let driver source_file (options : Cli.options) : int = Cli.debug_print "Compiling program into Python..."; Cli.debug_print "Writing to %s..." (Option.value ~default:"stdout" output_file); - with_output @@ fun fmt -> + with_output + @@ fun fmt -> Scalc.To_python.format_program fmt prgm type_ordering | `Plugin (Plugin.Lcalc _) -> assert false | `Plugin (Plugin.Scalc p) -> @@ -374,14 +383,19 @@ let driver source_file (options : Cli.options) : int = p.Plugin.name; Cli.debug_print "Writing to %s..." (Option.value ~default:"stdout" output_file); - p.Plugin.apply output_file prgm type_ordering))))))); + p.Plugin.apply ~source_file ~output_file + ~scope:options.ex_scope prgm type_ordering))))))); 0 with | Errors.StructuredError (msg, pos) -> + let bt = Printexc.get_raw_backtrace () in Cli.error_print "%s" (Errors.print_structured_error msg pos); + if Printexc.backtrace_status () then Printexc.print_raw_backtrace stderr bt; -1 | Sys_error msg -> + let bt = Printexc.get_raw_backtrace () in Cli.error_print "System error: %s" msg; + if Printexc.backtrace_status () then Printexc.print_raw_backtrace stderr bt; -1 let main () = diff --git a/compiler/dune b/compiler/dune index cf6ee220..3fdc3105 100644 --- a/compiler/dune +++ b/compiler/dune @@ -10,18 +10,10 @@ dcalc lcalc scalc - runtime + catala.runtime_ocaml verification) (modules plugin driver)) -(library - (name runtime) - (public_name catala.runtime) - (preprocess - (pps ppx_yojson_conv)) - (libraries dates_calc zarith zarith_stubs_js) - (modules runtime)) - (executable (name catala_web_interpreter) (modes byte js) @@ -30,11 +22,26 @@ (modules catala_web_interpreter) (preprocess (pps js_of_ocaml-ppx)) - (libraries catala.driver js_of_ocaml)) + (libraries + catala.driver + js_of_ocaml + catala.runtime_ocaml + catala.runtime_jsoo)) + +(rule + (target custom_linking.sexp) + (mode fallback) + (action + (with-stdout-to + %{target} + (echo "()")))) (executable (name catala) (modes native js) + (flags + (:standard + (:include custom_linking.sexp))) (package catala) (modules catala) (public_name catala) diff --git a/compiler/index.mld b/compiler/index.mld index 8c62462b..c84b5a89 100644 --- a/compiler/index.mld +++ b/compiler/index.mld @@ -106,9 +106,9 @@ Two more modules contain additional features for the compiler: {li {{: utils.html} Compiler utilities}} } -The Catala runtime documentation is available here: +The Catala runtimes documentation is available here: -{!modules: Runtime} +{!modules: Runtime_ocaml.Runtime Runtime_jsoo.Runtime} Last, it is possible to customize the backend to the compiler using a plugin mechanism. The API is defined inside the following module: diff --git a/compiler/lcalc/ast.ml b/compiler/lcalc/ast.ml index 56d5a5e1..7c642462 100644 --- a/compiler/lcalc/ast.ml +++ b/compiler/lcalc/ast.ml @@ -15,6 +15,7 @@ the License. *) open Utils +module Runtime = Runtime_ocaml.Runtime module D = Dcalc.Ast type lit = @@ -27,197 +28,181 @@ type lit = | LDuration of Runtime.duration type except = ConflictError | EmptyError | NoValueProvided | Crash +type 'm mark = 'm D.mark -type expr = - | EVar of expr Bindlib.var Pos.marked - | ETuple of expr Pos.marked list * D.StructName.t option +type 'm marked_expr = ('m expr, 'm) D.marked + +and 'm expr = + | EVar of 'm expr Bindlib.var + | ETuple of 'm marked_expr list * D.StructName.t option (** The [MarkedString.info] is the former struct field name*) | ETupleAccess of - expr Pos.marked * int * D.StructName.t option * D.typ Pos.marked list + 'm marked_expr * int * D.StructName.t option * D.typ Marked.pos list (** The [MarkedString.info] is the former struct field name *) - | EInj of expr Pos.marked * int * D.EnumName.t * D.typ Pos.marked list + | EInj of 'm marked_expr * int * D.EnumName.t * D.typ Marked.pos list (** The [MarkedString.info] is the former enum case name *) - | EMatch of expr Pos.marked * expr Pos.marked list * D.EnumName.t + | EMatch of 'm marked_expr * 'm marked_expr list * D.EnumName.t (** The [MarkedString.info] is the former enum case name *) - | EArray of expr Pos.marked list + | EArray of 'm marked_expr list | ELit of lit - | EAbs of - (expr, expr Pos.marked) Bindlib.mbinder Pos.marked * D.typ Pos.marked list - | EApp of expr Pos.marked * expr Pos.marked list - | EAssert of expr Pos.marked + | EAbs of ('m expr, 'm marked_expr) Bindlib.mbinder * D.typ Marked.pos list + | EApp of 'm marked_expr * 'm marked_expr list + | EAssert of 'm marked_expr | EOp of D.operator - | EIfThenElse of expr Pos.marked * expr Pos.marked * expr Pos.marked + | EIfThenElse of 'm marked_expr * 'm marked_expr * 'm marked_expr | ERaise of except - | ECatch of expr Pos.marked * except * expr Pos.marked + | ECatch of 'm marked_expr * except * 'm marked_expr -type program = { decl_ctx : Dcalc.Ast.decl_ctx; scopes : expr Dcalc.Ast.scopes } +type 'm program = ('m expr, 'm) Dcalc.Ast.program_generic -let evar (v : expr Bindlib.var) (pos : Pos.t) : expr Pos.marked Bindlib.box = - Bindlib.box_apply (fun v' -> v', pos) (Bindlib.box_var v) +(* *) -let etuple - (args : expr Pos.marked Bindlib.box list) - (s : Dcalc.Ast.StructName.t option) - (pos : Pos.t) : expr Pos.marked Bindlib.box = - Bindlib.box_apply (fun args -> ETuple (args, s), pos) (Bindlib.box_list args) +let evar v mark = Bindlib.box_apply (Marked.mark mark) (Bindlib.box_var v) -let etupleaccess - (e1 : expr Pos.marked Bindlib.box) - (i : int) - (s : Dcalc.Ast.StructName.t option) - (typs : Dcalc.Ast.typ Pos.marked list) - (pos : Pos.t) : expr Pos.marked Bindlib.box = - Bindlib.box_apply (fun e1 -> ETupleAccess (e1, i, s, typs), pos) e1 +let etuple args s mark = + Bindlib.box_apply (fun args -> ETuple (args, s), mark) (Bindlib.box_list args) -let einj - (e1 : expr Pos.marked Bindlib.box) - (i : int) - (e_name : Dcalc.Ast.EnumName.t) - (typs : Dcalc.Ast.typ Pos.marked list) - (pos : Pos.t) : expr Pos.marked Bindlib.box = - Bindlib.box_apply (fun e1 -> EInj (e1, i, e_name, typs), pos) e1 +let etupleaccess e1 i s typs mark = + Bindlib.box_apply (fun e1 -> ETupleAccess (e1, i, s, typs), mark) e1 -let ematch - (arg : expr Pos.marked Bindlib.box) - (arms : expr Pos.marked Bindlib.box list) - (e_name : Dcalc.Ast.EnumName.t) - (pos : Pos.t) : expr Pos.marked Bindlib.box = +let einj e1 i e_name typs mark = + Bindlib.box_apply (fun e1 -> EInj (e1, i, e_name, typs), mark) e1 + +let ematch arg arms e_name mark = Bindlib.box_apply2 - (fun arg arms -> EMatch (arg, arms, e_name), pos) + (fun arg arms -> EMatch (arg, arms, e_name), mark) arg (Bindlib.box_list arms) -let earray (args : expr Pos.marked Bindlib.box list) (pos : Pos.t) : - expr Pos.marked Bindlib.box = - Bindlib.box_apply (fun args -> EArray args, pos) (Bindlib.box_list args) +let earray args mark = + Bindlib.box_apply (fun args -> EArray args, mark) (Bindlib.box_list args) -let elit (l : lit) (pos : Pos.t) : expr Pos.marked Bindlib.box = - Bindlib.box (ELit l, pos) +let elit l mark = Bindlib.box (ELit l, mark) -let eabs - (binder : (expr, expr Pos.marked) Bindlib.mbinder Bindlib.box) - (pos_binder : Pos.t) - (typs : Dcalc.Ast.typ Pos.marked list) - (pos : Pos.t) : expr Pos.marked Bindlib.box = - Bindlib.box_apply - (fun binder -> EAbs ((binder, pos_binder), typs), pos) - binder +let eabs binder typs mark = + Bindlib.box_apply (fun binder -> EAbs (binder, typs), mark) binder -let eapp - (e1 : expr Pos.marked Bindlib.box) - (args : expr Pos.marked Bindlib.box list) - (pos : Pos.t) : expr Pos.marked Bindlib.box = +let eapp e1 args mark = Bindlib.box_apply2 - (fun e1 args -> EApp (e1, args), pos) + (fun e1 args -> EApp (e1, args), mark) e1 (Bindlib.box_list args) -let eassert (e1 : expr Pos.marked Bindlib.box) (pos : Pos.t) : - expr Pos.marked Bindlib.box = - Bindlib.box_apply (fun e1 -> EAssert e1, pos) e1 +let eassert e1 mark = Bindlib.box_apply (fun e1 -> EAssert e1, mark) e1 +let eop op mark = Bindlib.box (EOp op, mark) -let eop (op : Dcalc.Ast.operator) (pos : Pos.t) : expr Pos.marked Bindlib.box = - Bindlib.box (EOp op, pos) - -let eraise (e1 : except) (pos : Pos.t) : expr Pos.marked Bindlib.box = - Bindlib.box (ERaise e1, pos) - -let ecatch - (e1 : expr Pos.marked Bindlib.box) - (exn : except) - (e2 : expr Pos.marked Bindlib.box) - (pos : Pos.t) : expr Pos.marked Bindlib.box = - Bindlib.box_apply2 (fun e1 e2 -> ECatch (e1, exn, e2), pos) e1 e2 - -let eifthenelse - (e1 : expr Pos.marked Bindlib.box) - (e2 : expr Pos.marked Bindlib.box) - (e3 : expr Pos.marked Bindlib.box) - (pos : Pos.t) : expr Pos.marked Bindlib.box = +let eifthenelse e1 e2 e3 pos = Bindlib.box_apply3 (fun e1 e2 e3 -> EIfThenElse (e1, e2, e3), pos) e1 e2 e3 +type 'm var = 'm expr Bindlib.var +type 'm vars = 'm expr Bindlib.mvar + +let new_var s = Bindlib.new_var (fun x -> EVar x) s + module Var = struct - type t = expr Bindlib.var + type t = V : 'a var -> t + (* See Dcalc.Ast.var *) - let make (s : string Pos.marked) : t = - Bindlib.new_var - (fun (x : expr Bindlib.var) : expr -> EVar (x, Pos.get_position s)) - (Pos.unmark s) - - let compare x y = Bindlib.compare_vars x y + let t v = V v + let get (V v) = Bindlib.copy_var v (fun x -> EVar x) (Bindlib.name_of v) + let compare (V x) (V y) = Bindlib.compare_vars x y end -module VarMap = Map.Make (Var) module VarSet = Set.Make (Var) +module VarMap = Map.Make (Var) -type vars = expr Bindlib.mvar +(* *) -let map_expr - (ctx : 'a) - ~(f : 'a -> expr Pos.marked -> expr Pos.marked Bindlib.box) - (e : expr Pos.marked) : expr Pos.marked Bindlib.box = - match Pos.unmark e with - | EVar (v, _pos) -> evar v (Pos.get_position e) +let eraise e1 pos = Bindlib.box (ERaise e1, pos) + +let ecatch e1 exn e2 pos = + Bindlib.box_apply2 (fun e1 e2 -> ECatch (e1, exn, e2), pos) e1 e2 + +let translate_var v = Bindlib.copy_var v (fun x -> EVar x) (Bindlib.name_of v) + +let map_expr ctx ~f e = + let m = Marked.get_mark e in + match Marked.unmark e with + | EVar v -> evar (translate_var v) (Marked.get_mark e) | EApp (e1, args) -> - eapp (f ctx e1) (List.map (f ctx) args) (Pos.get_position e) - | EAbs ((binder, binder_pos), typs) -> - eabs - (Bindlib.box_mbinder (f ctx) binder) - binder_pos typs (Pos.get_position e) - | ETuple (args, s) -> etuple (List.map (f ctx) args) s (Pos.get_position e) + eapp (f ctx e1) (List.map (f ctx) args) (Marked.get_mark e) + | EAbs (binder, typs) -> + let vars, body = Bindlib.unmbind binder in + eabs (Bindlib.bind_mvar (Array.map translate_var vars) (f ctx body)) typs m + | ETuple (args, s) -> etuple (List.map (f ctx) args) s (Marked.get_mark e) | ETupleAccess (e1, n, s_name, typs) -> - etupleaccess ((f ctx) e1) n s_name typs (Pos.get_position e) + etupleaccess ((f ctx) e1) n s_name typs (Marked.get_mark e) | EInj (e1, i, e_name, typs) -> - einj ((f ctx) e1) i e_name typs (Pos.get_position e) + einj ((f ctx) e1) i e_name typs (Marked.get_mark e) | EMatch (arg, arms, e_name) -> - ematch ((f ctx) arg) (List.map (f ctx) arms) e_name (Pos.get_position e) - | EArray args -> earray (List.map (f ctx) args) (Pos.get_position e) - | ELit l -> elit l (Pos.get_position e) - | EAssert e1 -> eassert ((f ctx) e1) (Pos.get_position e) - | EOp op -> Bindlib.box (EOp op, Pos.get_position e) - | ERaise exn -> eraise exn (Pos.get_position e) + ematch ((f ctx) arg) (List.map (f ctx) arms) e_name (Marked.get_mark e) + | EArray args -> earray (List.map (f ctx) args) (Marked.get_mark e) + | ELit l -> elit l (Marked.get_mark e) + | EAssert e1 -> eassert ((f ctx) e1) (Marked.get_mark e) + | EOp op -> Bindlib.box (EOp op, Marked.get_mark e) + | ERaise exn -> eraise exn (Marked.get_mark e) | EIfThenElse (e1, e2, e3) -> - eifthenelse ((f ctx) e1) ((f ctx) e2) ((f ctx) e3) (Pos.get_position e) - | ECatch (e1, exn, e2) -> - ecatch (f ctx e1) exn (f ctx e2) (Pos.get_position e) + eifthenelse ((f ctx) e1) ((f ctx) e2) ((f ctx) e3) (Marked.get_mark e) + | ECatch (e1, exn, e2) -> ecatch (f ctx e1) exn (f ctx e2) (Marked.get_mark e) + +let rec map_expr_top_down ~f e = + map_expr () ~f:(fun () -> map_expr_top_down ~f) (f e) + +let map_expr_marks ~f e = + map_expr_top_down ~f:(fun e -> Marked.(mark (f (get_mark e)) (unmark e))) e + +let untype_expr e = + map_expr_marks ~f:(fun m -> Untyped { pos = D.mark_pos m }) e + +let untype_program prg = + { + prg with + D.scopes = + Bindlib.unbox + (D.map_exprs_in_scopes + ~f:(fun e -> untype_expr e) + ~varf:translate_var prg.D.scopes); + } (** See [Bindlib.box_term] documentation for why we are doing that. *) -let box_expr (e : expr Pos.marked) : expr Pos.marked Bindlib.box = +let box_expr (e : 'm marked_expr) : 'm marked_expr Bindlib.box = let rec id_t () e = map_expr () ~f:id_t e in id_t () e -let make_var ((x, pos) : Var.t Pos.marked) : expr Pos.marked Bindlib.box = - Bindlib.box_apply (fun x -> x, pos) (Bindlib.box_var x) +let make_var (x, mark) = + Bindlib.box_apply (fun x -> x, mark) (Bindlib.box_var x) -let make_abs - (xs : vars) - (e : expr Pos.marked Bindlib.box) - (pos_binder : Pos.t) - (taus : D.typ Pos.marked list) - (pos : Pos.t) : expr Pos.marked Bindlib.box = - Bindlib.box_apply - (fun b -> EAbs ((b, pos_binder), taus), pos) - (Bindlib.bind_mvar xs e) +let make_abs xs e taus mark = + Bindlib.box_apply (fun b -> EAbs (b, taus), mark) (Bindlib.bind_mvar xs e) -let make_app - (e : expr Pos.marked Bindlib.box) - (u : expr Pos.marked Bindlib.box list) - (pos : Pos.t) : expr Pos.marked Bindlib.box = - Bindlib.box_apply2 (fun e u -> EApp (e, u), pos) e (Bindlib.box_list u) +let make_app e u mark = + Bindlib.box_apply2 (fun e u -> EApp (e, u), mark) e (Bindlib.box_list u) -let make_let_in - (x : Var.t) - (tau : D.typ Pos.marked) - (e1 : expr Pos.marked Bindlib.box) - (e2 : expr Pos.marked Bindlib.box) - (pos : Pos.t) : expr Pos.marked Bindlib.box = - make_app (make_abs (Array.of_list [x]) e2 pos [tau] pos) [e1] pos +let make_let_in x tau e1 e2 pos = + let m_e1 = Marked.get_mark (Bindlib.unbox e1) in + let m_e2 = Marked.get_mark (Bindlib.unbox e2) in + let m_abs = + D.map_mark2 + (fun _ _ -> pos) + (fun m1 m2 -> TArrow (m1.ty, m2.ty), m1.pos) + m_e1 m_e2 + in + make_app (make_abs [| x |] e2 [tau] m_abs) [e1] m_e2 -let make_multiple_let_in - (xs : Var.t array) - (taus : D.typ Pos.marked list) - (e1 : expr Pos.marked Bindlib.box list) - (e2 : expr Pos.marked Bindlib.box) - (pos : Pos.t) : expr Pos.marked Bindlib.box = - make_app (make_abs xs e2 pos taus pos) e1 pos +let make_multiple_let_in xs taus e1s e2 pos = + (* let m_e1s = List.map (fun e -> Marked.get_mark (Bindlib.unbox e)) e1s in *) + let m_e1s = + D.fold_marks List.hd + (fun tys -> + D.TTuple (List.map (fun t -> t.D.ty) tys, None), (List.hd tys).D.pos) + (List.map (fun e -> Marked.get_mark (Bindlib.unbox e)) e1s) + in + let m_e2 = Marked.get_mark (Bindlib.unbox e2) in + let m_abs = + D.map_mark2 + (fun _ _ -> pos) + (fun m1 m2 -> Marked.mark pos (D.TArrow (m1.ty, m2.ty))) + m_e1s m_e2 + in + make_app (make_abs xs e2 taus m_abs) e1s m_e2 let ( let+ ) x f = Bindlib.box_apply f x let ( and+ ) x y = Bindlib.box_pair x y @@ -229,57 +214,53 @@ let none_constr : D.EnumConstructor.t = let some_constr : D.EnumConstructor.t = D.EnumConstructor.fresh ("ESome", Pos.no_pos) -let option_enum_config : (D.EnumConstructor.t * D.typ Pos.marked) list = +let option_enum_config : (D.EnumConstructor.t * D.typ Marked.pos) list = [none_constr, (D.TLit D.TUnit, Pos.no_pos); some_constr, (D.TAny, Pos.no_pos)] -let make_none (pos : Pos.t) : expr Pos.marked Bindlib.box = - let mark : 'a -> 'a Pos.marked = Pos.mark pos in - Bindlib.box @@ mark - @@ EInj - (mark @@ ELit LUnit, 0, option_enum, [D.TLit D.TUnit, pos; D.TAny, pos]) +(* FIXME: proper typing in all the constructors below *) -let make_some (e : expr Pos.marked Bindlib.box) : expr Pos.marked Bindlib.box = - let pos = Pos.get_position @@ Bindlib.unbox e in - let mark : 'a -> 'a Pos.marked = Pos.mark pos in - begin[@ocamlformat "disable"] - let+ e = e in - mark @@ EInj (e, 1, option_enum, [ (D.TLit D.TUnit, pos); (D.TAny, pos) ]) - end +let make_none m = + let mark = Marked.mark m in + let tunit = D.TLit D.TUnit, D.mark_pos m in + Bindlib.box + @@ mark + @@ EInj + ( Marked.mark + (D.map_mark (fun pos -> pos) (fun _ -> tunit) m) + (ELit LUnit), + 0, + option_enum, + [D.TLit D.TUnit, Pos.no_pos; D.TAny, Pos.no_pos] ) + +let make_some e = + let m = Marked.get_mark @@ Bindlib.unbox e in + let mark = Marked.mark m in + let+ e in + mark + @@ EInj + (e, 1, option_enum, [D.TLit D.TUnit, D.mark_pos m; D.TAny, D.mark_pos m]) (** [make_matchopt_with_abs_arms arg e_none e_some] build an expression [match arg with |None -> e_none | Some -> e_some] and requires e_some and e_none to be in the form [EAbs ...].*) -let make_matchopt_with_abs_arms - (arg : expr Pos.marked Bindlib.box) - (e_none : expr Pos.marked Bindlib.box) - (e_some : expr Pos.marked Bindlib.box) : expr Pos.marked Bindlib.box = - let pos = Pos.get_position @@ Bindlib.unbox arg in - let mark : 'a -> 'a Pos.marked = Pos.mark pos in - begin[@ocamlformat "disable"] - let+ arg = arg - and+ e_none = e_none - and+ e_some = e_some in - mark @@ EMatch (arg, [ e_none; e_some ], option_enum) - end +let make_matchopt_with_abs_arms arg e_none e_some = + let m = Marked.get_mark @@ Bindlib.unbox arg in + let mark = Marked.mark m in + let+ arg and+ e_none and+ e_some in + mark @@ EMatch (arg, [e_none; e_some], option_enum) (** [make_matchopt pos v tau arg e_none e_some] builds an expression [match arg with | None () -> e_none | Some v -> e_some]. It binds v to e_some, permitting it to be used inside the expression. There is no requirements on the form of both e_some and e_none. *) -let make_matchopt - (pos : Pos.t) - (v : Var.t) - (tau : D.typ Pos.marked) - (arg : expr Pos.marked Bindlib.box) - (e_none : expr Pos.marked Bindlib.box) - (e_some : expr Pos.marked Bindlib.box) : expr Pos.marked Bindlib.box = - let x = Var.make ("_", pos) in +let make_matchopt m v tau arg e_none e_some = + let x = new_var "_" in make_matchopt_with_abs_arms arg - (make_abs (Array.of_list [x]) e_none pos [D.TLit D.TUnit, pos] pos) - (make_abs (Array.of_list [v]) e_some pos [tau] pos) + (make_abs (Array.of_list [x]) e_none [D.TLit D.TUnit, D.mark_pos m] m) + (make_abs (Array.of_list [v]) e_some [tau] m) -let handle_default = Var.make ("handle_default", Pos.no_pos) -let handle_default_opt = Var.make ("handle_default_opt", Pos.no_pos) +let handle_default = Var.t (new_var "handle_default") +let handle_default_opt = Var.t (new_var "handle_default_opt") -type binder = (expr, expr Pos.marked) Bindlib.binder +type 'm binder = ('m expr, 'm marked_expr) Bindlib.binder diff --git a/compiler/lcalc/ast.mli b/compiler/lcalc/ast.mli index 02cfb845..d3442db8 100644 --- a/compiler/lcalc/ast.mli +++ b/compiler/lcalc/ast.mli @@ -15,6 +15,7 @@ the License. *) open Utils +module Runtime = Runtime_ocaml.Runtime (** Abstract syntax tree for the lambda calculus *) @@ -33,190 +34,217 @@ type lit = | LDuration of Runtime.duration type except = ConflictError | EmptyError | NoValueProvided | Crash +type 'm mark = 'm Dcalc.Ast.mark -type expr = - | EVar of expr Bindlib.var Pos.marked - | ETuple of expr Pos.marked list * Dcalc.Ast.StructName.t option +type 'm marked_expr = ('m expr, 'm) Dcalc.Ast.marked + +and 'm expr = + | EVar of 'm expr Bindlib.var + | ETuple of 'm marked_expr list * Dcalc.Ast.StructName.t option (** The [MarkedString.info] is the former struct field name*) | ETupleAccess of - expr Pos.marked + 'm marked_expr * int * Dcalc.Ast.StructName.t option - * Dcalc.Ast.typ Pos.marked list + * Dcalc.Ast.typ Marked.pos list (** The [MarkedString.info] is the former struct field name *) | EInj of - expr Pos.marked + 'm marked_expr * int * Dcalc.Ast.EnumName.t - * Dcalc.Ast.typ Pos.marked list + * Dcalc.Ast.typ Marked.pos list (** The [MarkedString.info] is the former enum case name *) - | EMatch of expr Pos.marked * expr Pos.marked list * Dcalc.Ast.EnumName.t + | EMatch of 'm marked_expr * 'm marked_expr list * Dcalc.Ast.EnumName.t (** The [MarkedString.info] is the former enum case name *) - | EArray of expr Pos.marked list + | EArray of 'm marked_expr list | ELit of lit | EAbs of - (expr, expr Pos.marked) Bindlib.mbinder Pos.marked - * Dcalc.Ast.typ Pos.marked list - | EApp of expr Pos.marked * expr Pos.marked list - | EAssert of expr Pos.marked + ('m expr, 'm marked_expr) Bindlib.mbinder * Dcalc.Ast.typ Marked.pos list + | EApp of 'm marked_expr * 'm marked_expr list + | EAssert of 'm marked_expr | EOp of Dcalc.Ast.operator - | EIfThenElse of expr Pos.marked * expr Pos.marked * expr Pos.marked + | EIfThenElse of 'm marked_expr * 'm marked_expr * 'm marked_expr | ERaise of except - | ECatch of expr Pos.marked * except * expr Pos.marked + | ECatch of 'm marked_expr * except * 'm marked_expr -type program = { decl_ctx : Dcalc.Ast.decl_ctx; scopes : expr Dcalc.Ast.scopes } +type 'm program = ('m expr, 'm) Dcalc.Ast.program_generic (** {1 Variable helpers} *) -module Var : sig - type t = expr Bindlib.var +type 'm var = 'm expr Bindlib.var +type 'm vars = 'm expr Bindlib.mvar - val make : string Pos.marked -> t +module Var : sig + type t + + val t : 'm expr Bindlib.var -> t + val get : t -> 'm expr Bindlib.var val compare : t -> t -> int end module VarMap : Map.S with type key = Var.t module VarSet : Set.S with type elt = Var.t -type vars = expr Bindlib.mvar -type binder = (expr, expr Pos.marked) Bindlib.binder +val new_var : string -> 'm var -(** {1 Boxed constructors}*) +type 'm binder = ('m expr, 'm marked_expr) Bindlib.binder -val evar : expr Bindlib.var -> Pos.t -> expr Pos.marked Bindlib.box +(** {2 Program traversal} *) + +val map_expr : + 'a -> + f:('a -> 'm1 marked_expr -> 'm2 marked_expr Bindlib.box) -> + ('m1 expr, 'm2 mark) Marked.t -> + 'm2 marked_expr Bindlib.box +(** See [Dcalc.Ast.map_expr] *) + +val map_expr_top_down : + f:('m1 marked_expr -> ('m1 expr, 'm2 mark) Marked.t) -> + 'm1 marked_expr -> + 'm2 marked_expr Bindlib.box +(** See [Dcalc.Ast.map_expr_top_down] *) + +val map_expr_marks : + f:('m1 mark -> 'm2 mark) -> 'm1 marked_expr -> 'm2 marked_expr Bindlib.box +(** See [Dcalc.Ast.map_expr_marks] *) + +val untype_expr : 'm marked_expr -> Dcalc.Ast.untyped marked_expr Bindlib.box +val untype_program : 'm program -> Dcalc.Ast.untyped program + +(** {1 Boxed constructors} *) + +val evar : 'm expr Bindlib.var -> 'm mark -> 'm marked_expr Bindlib.box val etuple : - expr Pos.marked Bindlib.box list -> + 'm marked_expr Bindlib.box list -> Dcalc.Ast.StructName.t option -> - Pos.t -> - expr Pos.marked Bindlib.box + 'm mark -> + 'm marked_expr Bindlib.box val etupleaccess : - expr Pos.marked Bindlib.box -> + 'm marked_expr Bindlib.box -> int -> Dcalc.Ast.StructName.t option -> - Dcalc.Ast.typ Pos.marked list -> - Pos.t -> - expr Pos.marked Bindlib.box + Dcalc.Ast.typ Marked.pos list -> + 'm mark -> + 'm marked_expr Bindlib.box val einj : - expr Pos.marked Bindlib.box -> + 'm marked_expr Bindlib.box -> int -> Dcalc.Ast.EnumName.t -> - Dcalc.Ast.typ Pos.marked list -> - Pos.t -> - expr Pos.marked Bindlib.box + Dcalc.Ast.typ Marked.pos list -> + 'm mark -> + 'm marked_expr Bindlib.box val ematch : - expr Pos.marked Bindlib.box -> - expr Pos.marked Bindlib.box list -> + 'm marked_expr Bindlib.box -> + 'm marked_expr Bindlib.box list -> Dcalc.Ast.EnumName.t -> - Pos.t -> - expr Pos.marked Bindlib.box + 'm mark -> + 'm marked_expr Bindlib.box val earray : - expr Pos.marked Bindlib.box list -> Pos.t -> expr Pos.marked Bindlib.box + 'm marked_expr Bindlib.box list -> 'm mark -> 'm marked_expr Bindlib.box -val elit : lit -> Pos.t -> expr Pos.marked Bindlib.box +val elit : lit -> 'm mark -> 'm marked_expr Bindlib.box val eabs : - (expr, expr Pos.marked) Bindlib.mbinder Bindlib.box -> - Pos.t -> - Dcalc.Ast.typ Pos.marked list -> - Pos.t -> - expr Pos.marked Bindlib.box + ('m expr, 'm marked_expr) Bindlib.mbinder Bindlib.box -> + Dcalc.Ast.typ Marked.pos list -> + 'm mark -> + 'm marked_expr Bindlib.box val eapp : - expr Pos.marked Bindlib.box -> - expr Pos.marked Bindlib.box list -> - Pos.t -> - expr Pos.marked Bindlib.box + 'm marked_expr Bindlib.box -> + 'm marked_expr Bindlib.box list -> + 'm mark -> + 'm marked_expr Bindlib.box val eassert : - expr Pos.marked Bindlib.box -> Pos.t -> expr Pos.marked Bindlib.box + 'm marked_expr Bindlib.box -> 'm mark -> 'm marked_expr Bindlib.box -val eop : Dcalc.Ast.operator -> Pos.t -> expr Pos.marked Bindlib.box +val eop : Dcalc.Ast.operator -> 'm mark -> 'm marked_expr Bindlib.box val eifthenelse : - expr Pos.marked Bindlib.box -> - expr Pos.marked Bindlib.box -> - expr Pos.marked Bindlib.box -> - Pos.t -> - expr Pos.marked Bindlib.box + 'm marked_expr Bindlib.box -> + 'm marked_expr Bindlib.box -> + 'm marked_expr Bindlib.box -> + 'm mark -> + 'm marked_expr Bindlib.box val ecatch : - expr Pos.marked Bindlib.box -> + 'm marked_expr Bindlib.box -> except -> - expr Pos.marked Bindlib.box -> - Pos.t -> - expr Pos.marked Bindlib.box + 'm marked_expr Bindlib.box -> + 'm mark -> + 'm marked_expr Bindlib.box -val eraise : except -> Pos.t -> expr Pos.marked Bindlib.box +val eraise : except -> 'm mark -> 'm marked_expr Bindlib.box (** {1 Language terms construction}*) -val make_var : Var.t Pos.marked -> expr Pos.marked Bindlib.box +val make_var : ('m var, 'm) Dcalc.Ast.marked -> 'm marked_expr Bindlib.box val make_abs : - vars -> - expr Pos.marked Bindlib.box -> - Pos.t -> - Dcalc.Ast.typ Pos.marked list -> - Pos.t -> - expr Pos.marked Bindlib.box + 'm vars -> + 'm marked_expr Bindlib.box -> + Dcalc.Ast.typ Marked.pos list -> + 'm mark -> + 'm marked_expr Bindlib.box val make_app : - expr Pos.marked Bindlib.box -> - expr Pos.marked Bindlib.box list -> - Pos.t -> - expr Pos.marked Bindlib.box + 'm marked_expr Bindlib.box -> + 'm marked_expr Bindlib.box list -> + 'm mark -> + 'm marked_expr Bindlib.box val make_let_in : - Var.t -> - Dcalc.Ast.typ Pos.marked -> - expr Pos.marked Bindlib.box -> - expr Pos.marked Bindlib.box -> + 'm var -> + Dcalc.Ast.typ Marked.pos -> + 'm marked_expr Bindlib.box -> + 'm marked_expr Bindlib.box -> Pos.t -> - expr Pos.marked Bindlib.box + 'm marked_expr Bindlib.box val make_multiple_let_in : - Var.t array -> - Dcalc.Ast.typ Pos.marked list -> - expr Pos.marked Bindlib.box list -> - expr Pos.marked Bindlib.box -> + 'm vars -> + Dcalc.Ast.typ Marked.pos list -> + 'm marked_expr Bindlib.box list -> + 'm marked_expr Bindlib.box -> Pos.t -> - expr Pos.marked Bindlib.box + 'm marked_expr Bindlib.box val option_enum : Dcalc.Ast.EnumName.t val none_constr : Dcalc.Ast.EnumConstructor.t val some_constr : Dcalc.Ast.EnumConstructor.t val option_enum_config : - (Dcalc.Ast.EnumConstructor.t * Dcalc.Ast.typ Pos.marked) list + (Dcalc.Ast.EnumConstructor.t * Dcalc.Ast.typ Marked.pos) list -val make_none : Pos.t -> expr Pos.marked Bindlib.box -val make_some : expr Pos.marked Bindlib.box -> expr Pos.marked Bindlib.box +val make_none : 'm mark -> 'm marked_expr Bindlib.box +val make_some : 'm marked_expr Bindlib.box -> 'm marked_expr Bindlib.box val make_matchopt_with_abs_arms : - expr Pos.marked Bindlib.box -> - expr Pos.marked Bindlib.box -> - expr Pos.marked Bindlib.box -> - expr Pos.marked Bindlib.box + 'm marked_expr Bindlib.box -> + 'm marked_expr Bindlib.box -> + 'm marked_expr Bindlib.box -> + 'm marked_expr Bindlib.box val make_matchopt : - Pos.t -> - Var.t -> - Dcalc.Ast.typ Pos.marked -> - expr Pos.marked Bindlib.box -> - expr Pos.marked Bindlib.box -> - expr Pos.marked Bindlib.box -> - expr Pos.marked Bindlib.box + 'm mark -> + 'm var -> + Dcalc.Ast.typ Marked.pos -> + 'm marked_expr Bindlib.box -> + 'm marked_expr Bindlib.box -> + 'm marked_expr Bindlib.box -> + 'm marked_expr Bindlib.box (** [e' = make_matchopt'' pos v e e_none e_some] Builds the term corresponding to [match e with | None -> fun () -> e_none |Some -> fun v -> e_some]. *) -val box_expr : expr Pos.marked -> expr Pos.marked Bindlib.box +val box_expr : 'm marked_expr -> 'm marked_expr Bindlib.box -(** {1 Special symbols}*) +(** {1 Special symbols} *) val handle_default : Var.t val handle_default_opt : Var.t diff --git a/compiler/lcalc/backends.ml b/compiler/lcalc/backends.ml deleted file mode 100644 index cfb51330..00000000 --- a/compiler/lcalc/backends.ml +++ /dev/null @@ -1,81 +0,0 @@ -(* This file is part of the Catala compiler, a specification language for tax - and social benefits computation rules. Copyright (C) 2021 Inria, contributor: - Denis Merigoux - - Licensed under the Apache License, Version 2.0 (the "License"); you may not - use this file except in compliance with the License. You may obtain a copy of - the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - License for the specific language governing permissions and limitations under - the License. *) - -let to_ascii (s : string) : string = - let out = ref "" in - CamomileLibraryDefault.Camomile.UTF8.iter - (fun c -> - let code = CamomileLibraryDefault.Camomile.UChar.uint_code c in - out := - !out - ^ - match code with - | 0xc7 -> "C" - | 0xe7 -> "c" - | c when c >= 0xc0 && c <= 0xc6 -> "A" - | c when c >= 0xe0 && c <= 0xe6 -> "a" - | c when c >= 0xc8 && c <= 0xcb -> "E" - | c when c >= 0xe8 && c <= 0xeb -> "e" - | c when c >= 0xcc && c <= 0xcf -> "I" - | c when c >= 0xec && c <= 0xef -> "i" - | c when c >= 0xd2 && c <= 0xd6 -> "O" - | c when c >= 0xf2 && c <= 0xf6 -> "o" - | c when c >= 0xd9 && c <= 0xdc -> "U" - | c when c >= 0xf9 && c <= 0xfc -> "u" - | _ -> - if code > 128 then "_" - else String.make 1 (CamomileLibraryDefault.Camomile.UChar.char_of c)) - s; - !out - -let to_lowercase (s : string) : string = - let is_first = ref true in - let out = ref "" in - CamomileLibraryDefault.Camomile.UTF8.iter - (fun c -> - let is_uppercase = Dcalc.Print.is_uppercase c in - out := - !out - ^ (if is_uppercase && not !is_first then "_" else "") - ^ String.lowercase_ascii - (String.make 1 (CamomileLibraryDefault.Camomile.UChar.char_of c)); - is_first := false) - s; - !out - -let to_uppercase (s : string) : string = - let last_was_underscore = ref false in - let is_first = ref true in - let out = ref "" in - CamomileLibraryDefault.Camomile.UTF8.iter - (fun c -> - let is_underscore = - c = CamomileLibraryDefault.Camomile.UChar.of_char '_' - in - let c_string = - String.make 1 (CamomileLibraryDefault.Camomile.UChar.char_of c) - in - out := - !out - ^ - if is_underscore then "" - else if !last_was_underscore || !is_first then - String.uppercase_ascii c_string - else c_string; - last_was_underscore := is_underscore; - is_first := false) - s; - !out diff --git a/compiler/lcalc/closure_conversion.ml b/compiler/lcalc/closure_conversion.ml index 39d29673..f5294085 100644 --- a/compiler/lcalc/closure_conversion.ml +++ b/compiler/lcalc/closure_conversion.ml @@ -21,275 +21,283 @@ module D = Dcalc.Ast (** TODO: This version is not yet debugged and ought to be specialized when Lcalc has more structure. *) -type closure = { name : Var.t; expr : expr Pos.marked Bindlib.box } type ctx = { name_context : string; globally_bound_vars : VarSet.t } (** Returns the expression with closed closures and the set of free variables inside this new expression. Implementation guided by http://gallium.inria.fr/~fpottier/mpri/cours04.pdf#page=9. *) -let rec closure_conversion_expr (ctx : ctx) (e : expr Pos.marked) : - expr Pos.marked Bindlib.box * VarSet.t = - match Pos.unmark e with - | EVar v -> - ( Bindlib.box_apply - (fun new_v -> new_v, Pos.get_position v) - (Bindlib.box_var (Pos.unmark v)), - VarSet.diff (VarSet.singleton (Pos.unmark v)) ctx.globally_bound_vars ) - | ETuple (args, s) -> - let new_args, free_vars = - List.fold_left - (fun (new_args, free_vars) arg -> - let new_arg, new_free_vars = closure_conversion_expr ctx arg in - new_arg :: new_args, VarSet.union new_free_vars free_vars) - ([], VarSet.empty) args - in - ( Bindlib.box_apply - (fun new_args -> ETuple (List.rev new_args, s), Pos.get_position e) - (Bindlib.box_list new_args), - free_vars ) - | ETupleAccess (e1, n, s, typs) -> - let new_e1, free_vars = closure_conversion_expr ctx e1 in - ( Bindlib.box_apply - (fun new_e1 -> ETupleAccess (new_e1, n, s, typs), Pos.get_position e) - new_e1, - free_vars ) - | EInj (e1, n, e_name, typs) -> - let new_e1, free_vars = closure_conversion_expr ctx e1 in - ( Bindlib.box_apply - (fun new_e1 -> EInj (new_e1, n, e_name, typs), Pos.get_position e) - new_e1, - free_vars ) - | EMatch (e1, arms, e_name) -> - let new_e1, free_vars = closure_conversion_expr ctx e1 in - (* We do not close the clotures inside the arms of the match expression, - since they get a special treatment at compilation to Scalc. *) - let new_arms, free_vars = - List.fold_right - (fun arm (new_arms, free_vars) -> - match Pos.unmark arm with - | EAbs ((binder, binder_pos), typs) -> - let vars, body = Bindlib.unmbind binder in - let new_body, new_free_vars = closure_conversion_expr ctx body in - let new_binder = Bindlib.bind_mvar vars new_body in - ( Bindlib.box_apply - (fun new_binder -> - EAbs ((new_binder, binder_pos), typs), Pos.get_position arm) - new_binder - :: new_arms, - VarSet.union free_vars new_free_vars ) - | _ -> failwith "should not happen") - arms ([], free_vars) - in - ( Bindlib.box_apply2 - (fun new_e1 new_arms -> - EMatch (new_e1, new_arms, e_name), Pos.get_position e) - new_e1 - (Bindlib.box_list new_arms), - free_vars ) - | EArray args -> - let new_args, free_vars = - List.fold_right - (fun arg (new_args, free_vars) -> - let new_arg, new_free_vars = closure_conversion_expr ctx arg in - new_arg :: new_args, VarSet.union free_vars new_free_vars) - args ([], VarSet.empty) - in - ( Bindlib.box_apply - (fun new_args -> EArray new_args, Pos.get_position e) - (Bindlib.box_list new_args), - free_vars ) - | ELit l -> Bindlib.box (ELit l, Pos.get_position e), VarSet.empty - | EApp ((EAbs ((binder, binder_pos), typs_abs), e1_pos), args) -> - (* let-binding, we should not close these *) - let vars, body = Bindlib.unmbind binder in - let new_body, free_vars = closure_conversion_expr ctx body in - let new_binder = Bindlib.bind_mvar vars new_body in - let new_args, free_vars = - List.fold_right - (fun arg (new_args, free_vars) -> - let new_arg, new_free_vars = closure_conversion_expr ctx arg in - new_arg :: new_args, VarSet.union free_vars new_free_vars) - args ([], free_vars) - in - ( Bindlib.box_apply2 - (fun new_binder new_args -> - ( EApp ((EAbs ((new_binder, binder_pos), typs_abs), e1_pos), new_args), - Pos.get_position e )) - new_binder - (Bindlib.box_list new_args), - free_vars ) - | EAbs ((binder, binder_pos), typs) -> - (* λ x.t *) - (* Converting the closure. *) - let vars, body = Bindlib.unmbind binder in - (* t *) - let new_body, body_vars = closure_conversion_expr ctx body in - (* [[t]] *) - let extra_vars = - VarSet.diff body_vars (VarSet.of_list (Array.to_list vars)) - in - let extra_vars_list = VarSet.elements extra_vars in - (* x1, ..., xn *) - let code_var = Var.make (ctx.name_context, binder_pos) in - (* code *) - let inner_c_var = Var.make ("env", binder_pos) in - let new_closure_body = - make_multiple_let_in - (Array.of_list extra_vars_list) - (List.init (List.length extra_vars_list) (fun _ -> - Dcalc.Ast.TAny, binder_pos)) - (List.mapi - (fun i _ -> - Bindlib.box_apply - (fun inner_c_var -> - ( ETupleAccess - ( (inner_c_var, binder_pos), - i + 1, - None, - List.init - (List.length extra_vars_list + 1) - (fun _ -> Dcalc.Ast.TAny, binder_pos) ), - binder_pos )) - (Bindlib.box_var inner_c_var)) - extra_vars_list) - new_body binder_pos - in - let new_closure = - make_abs - (Array.concat [Array.make 1 inner_c_var; vars]) - new_closure_body binder_pos - ((Dcalc.Ast.TAny, binder_pos) :: typs) - (Pos.get_position e) - in - ( make_let_in code_var - (Dcalc.Ast.TAny, Pos.get_position e) - new_closure - (Bindlib.box_apply2 - (fun code_var extra_vars -> - ( ETuple - ( (code_var, binder_pos) - :: List.map - (fun extra_var -> extra_var, binder_pos) - extra_vars, - None ), - Pos.get_position e )) - (Bindlib.box_var code_var) - (Bindlib.box_list - (List.map - (fun extra_var -> Bindlib.box_var extra_var) - extra_vars_list))) - (Pos.get_position e), - extra_vars ) - | EApp ((EOp op, pos_op), args) -> - (* This corresponds to an operator call, which we don't want to transform*) - let new_args, free_vars = - List.fold_right - (fun arg (new_args, free_vars) -> - let new_arg, new_free_vars = closure_conversion_expr ctx arg in - new_arg :: new_args, VarSet.union free_vars new_free_vars) - args ([], VarSet.empty) - in - ( Bindlib.box_apply - (fun new_e2 -> EApp ((EOp op, pos_op), new_e2), Pos.get_position e) - (Bindlib.box_list new_args), - free_vars ) - | EApp ((EVar (v, _), v_pos), args) when VarSet.mem v ctx.globally_bound_vars - -> - (* This corresponds to a scope call, which we don't want to transform*) - let new_args, free_vars = - List.fold_right - (fun arg (new_args, free_vars) -> - let new_arg, new_free_vars = closure_conversion_expr ctx arg in - new_arg :: new_args, VarSet.union free_vars new_free_vars) - args ([], VarSet.empty) - in - ( Bindlib.box_apply2 - (fun new_v new_e2 -> EApp ((new_v, v_pos), new_e2), Pos.get_position e) - (Bindlib.box_var v) - (Bindlib.box_list new_args), - free_vars ) - | EApp (e1, args) -> - let new_e1, free_vars = closure_conversion_expr ctx e1 in - let env_var = Var.make ("env", Pos.get_position e1) in - let code_var = Var.make ("code", Pos.get_position e1) in - let new_args, free_vars = - List.fold_right - (fun arg (new_args, free_vars) -> - let new_arg, new_free_vars = closure_conversion_expr ctx arg in - new_arg :: new_args, VarSet.union free_vars new_free_vars) - args ([], free_vars) - in - let call_expr = - make_let_in code_var - (Dcalc.Ast.TAny, Pos.get_position e) - (Bindlib.box_apply - (fun env_var -> - ( ETupleAccess - ((env_var, Pos.get_position e1), 0, None, [ (*TODO: fill?*) ]), - Pos.get_position e )) - (Bindlib.box_var env_var)) - (Bindlib.box_apply3 - (fun code_var env_var new_args -> - ( EApp - ( (code_var, Pos.get_position e1), - (env_var, Pos.get_position e1) :: new_args ), - Pos.get_position e )) - (Bindlib.box_var code_var) (Bindlib.box_var env_var) - (Bindlib.box_list new_args)) - (Pos.get_position e) - in - ( make_let_in env_var - (Dcalc.Ast.TAny, Pos.get_position e) - new_e1 call_expr (Pos.get_position e), - free_vars ) - | EAssert e1 -> - let new_e1, free_vars = closure_conversion_expr ctx e1 in - ( Bindlib.box_apply (fun new_e1 -> EAssert new_e1, Pos.get_position e) new_e1, - free_vars ) - | EOp op -> Bindlib.box (EOp op, Pos.get_position e), VarSet.empty - | EIfThenElse (e1, e2, e3) -> - let new_e1, free_vars1 = closure_conversion_expr ctx e1 in - let new_e2, free_vars2 = closure_conversion_expr ctx e2 in - let new_e3, free_vars3 = closure_conversion_expr ctx e3 in - ( Bindlib.box_apply3 - (fun new_e1 new_e2 new_e3 -> - EIfThenElse (new_e1, new_e2, new_e3), Pos.get_position e) - new_e1 new_e2 new_e3, - VarSet.union (VarSet.union free_vars1 free_vars2) free_vars3 ) - | ERaise except -> - Bindlib.box (ERaise except, Pos.get_position e), VarSet.empty - | ECatch (e1, except, e2) -> - let new_e1, free_vars1 = closure_conversion_expr ctx e1 in - let new_e2, free_vars2 = closure_conversion_expr ctx e2 in - ( Bindlib.box_apply2 - (fun new_e1 new_e2 -> - ECatch (new_e1, except, new_e2), Pos.get_position e) - new_e1 new_e2, - VarSet.union free_vars1 free_vars2 ) +let closure_conversion_expr (type m) (ctx : ctx) (e : m marked_expr) : + m marked_expr Bindlib.box = + let module MVarSet = Set.Make (struct + type t = m var -let closure_conversion (p : program) : program Bindlib.box = + let compare = Bindlib.compare_vars + end) in + let rec aux e = + match Marked.unmark e with + | EVar v -> + ( Bindlib.box_apply + (fun new_v -> new_v, Marked.get_mark e) + (Bindlib.box_var v), + if VarSet.mem (Var.t v) ctx.globally_bound_vars then MVarSet.empty + else MVarSet.singleton v ) + | ETuple (args, s) -> + let new_args, free_vars = + List.fold_left + (fun (new_args, free_vars) arg -> + let new_arg, new_free_vars = aux arg in + new_arg :: new_args, MVarSet.union new_free_vars free_vars) + ([], MVarSet.empty) args + in + ( Bindlib.box_apply + (fun new_args -> ETuple (List.rev new_args, s), Marked.get_mark e) + (Bindlib.box_list new_args), + free_vars ) + | ETupleAccess (e1, n, s, typs) -> + let new_e1, free_vars = aux e1 in + ( Bindlib.box_apply + (fun new_e1 -> ETupleAccess (new_e1, n, s, typs), Marked.get_mark e) + new_e1, + free_vars ) + | EInj (e1, n, e_name, typs) -> + let new_e1, free_vars = aux e1 in + ( Bindlib.box_apply + (fun new_e1 -> EInj (new_e1, n, e_name, typs), Marked.get_mark e) + new_e1, + free_vars ) + | EMatch (e1, arms, e_name) -> + let new_e1, free_vars = aux e1 in + (* We do not close the clotures inside the arms of the match expression, + since they get a special treatment at compilation to Scalc. *) + let new_arms, free_vars = + List.fold_right + (fun arm (new_arms, free_vars) -> + match Marked.unmark arm with + | EAbs (binder, typs) -> + let vars, body = Bindlib.unmbind binder in + let new_body, new_free_vars = aux body in + let new_binder = Bindlib.bind_mvar vars new_body in + ( Bindlib.box_apply + (fun new_binder -> + EAbs (new_binder, typs), Marked.get_mark arm) + new_binder + :: new_arms, + MVarSet.union free_vars new_free_vars ) + | _ -> failwith "should not happen") + arms ([], free_vars) + in + ( Bindlib.box_apply2 + (fun new_e1 new_arms -> + EMatch (new_e1, new_arms, e_name), Marked.get_mark e) + new_e1 + (Bindlib.box_list new_arms), + free_vars ) + | EArray args -> + let new_args, free_vars = + List.fold_right + (fun arg (new_args, free_vars) -> + let new_arg, new_free_vars = aux arg in + new_arg :: new_args, MVarSet.union free_vars new_free_vars) + args ([], MVarSet.empty) + in + ( Bindlib.box_apply + (fun new_args -> EArray new_args, Marked.get_mark e) + (Bindlib.box_list new_args), + free_vars ) + | ELit l -> Bindlib.box (ELit l, Marked.get_mark e), MVarSet.empty + | EApp ((EAbs (binder, typs_abs), e1_pos), args) -> + (* let-binding, we should not close these *) + let vars, body = Bindlib.unmbind binder in + let new_body, free_vars = aux body in + let new_binder = Bindlib.bind_mvar vars new_body in + let new_args, free_vars = + List.fold_right + (fun arg (new_args, free_vars) -> + let new_arg, new_free_vars = aux arg in + new_arg :: new_args, MVarSet.union free_vars new_free_vars) + args ([], free_vars) + in + ( Bindlib.box_apply2 + (fun new_binder new_args -> + ( EApp ((EAbs (new_binder, typs_abs), e1_pos), new_args), + Marked.get_mark e )) + new_binder + (Bindlib.box_list new_args), + free_vars ) + | EAbs (binder, typs) -> + (* λ x.t *) + let binder_mark = Marked.get_mark e in + let binder_pos = D.mark_pos binder_mark in + (* Converting the closure. *) + let vars, body = Bindlib.unmbind binder in + (* t *) + let new_body, body_vars = aux body in + (* [[t]] *) + let extra_vars = + MVarSet.diff body_vars (MVarSet.of_list (Array.to_list vars)) + in + let extra_vars_list = MVarSet.elements extra_vars in + (* x1, ..., xn *) + let code_var = new_var ctx.name_context in + (* code *) + let inner_c_var = new_var "env" in + let any_ty = Dcalc.Ast.TAny, binder_pos in + let new_closure_body = + make_multiple_let_in + (Array.of_list extra_vars_list) + (List.map (fun _ -> any_ty) extra_vars_list) + (List.mapi + (fun i _ -> + Bindlib.box_apply + (fun inner_c_var -> + ( ETupleAccess + ( (inner_c_var, binder_mark), + i + 1, + None, + List.map (fun _ -> any_ty) extra_vars_list ), + binder_mark )) + (Bindlib.box_var inner_c_var)) + extra_vars_list) + new_body (D.mark_pos binder_mark) + in + let new_closure = + make_abs + (Array.concat [Array.make 1 inner_c_var; vars]) + new_closure_body + ((Dcalc.Ast.TAny, binder_pos) :: typs) + (Marked.get_mark e) + in + ( make_let_in code_var + (Dcalc.Ast.TAny, D.pos e) + new_closure + (Bindlib.box_apply2 + (fun code_var extra_vars -> + ( ETuple + ( (code_var, binder_mark) + :: List.map + (fun extra_var -> extra_var, binder_mark) + extra_vars, + None ), + Marked.get_mark e )) + (Bindlib.box_var code_var) + (Bindlib.box_list + (List.map + (fun extra_var -> Bindlib.box_var extra_var) + extra_vars_list))) + (D.pos e), + extra_vars ) + | EApp ((EOp op, pos_op), args) -> + (* This corresponds to an operator call, which we don't want to + transform*) + let new_args, free_vars = + List.fold_right + (fun arg (new_args, free_vars) -> + let new_arg, new_free_vars = aux arg in + new_arg :: new_args, MVarSet.union free_vars new_free_vars) + args ([], MVarSet.empty) + in + ( Bindlib.box_apply + (fun new_e2 -> EApp ((EOp op, pos_op), new_e2), Marked.get_mark e) + (Bindlib.box_list new_args), + free_vars ) + | EApp ((EVar v, v_pos), args) + when VarSet.mem (Var.t v) ctx.globally_bound_vars -> + (* This corresponds to a scope call, which we don't want to transform*) + let new_args, free_vars = + List.fold_right + (fun arg (new_args, free_vars) -> + let new_arg, new_free_vars = aux arg in + new_arg :: new_args, MVarSet.union free_vars new_free_vars) + args ([], MVarSet.empty) + in + ( Bindlib.box_apply2 + (fun new_v new_e2 -> EApp ((new_v, v_pos), new_e2), Marked.get_mark e) + (Bindlib.box_var v) + (Bindlib.box_list new_args), + free_vars ) + | EApp (e1, args) -> + let new_e1, free_vars = aux e1 in + let env_var = new_var "env" in + let code_var = new_var "code" in + let new_args, free_vars = + List.fold_right + (fun arg (new_args, free_vars) -> + let new_arg, new_free_vars = aux arg in + new_arg :: new_args, MVarSet.union free_vars new_free_vars) + args ([], free_vars) + in + let call_expr = + make_let_in code_var + (Dcalc.Ast.TAny, D.pos e) + (Bindlib.box_apply + (fun env_var -> + ( ETupleAccess + ((env_var, Marked.get_mark e1), 0, None, [ (*TODO: fill?*) ]), + Marked.get_mark e )) + (Bindlib.box_var env_var)) + (Bindlib.box_apply3 + (fun code_var env_var new_args -> + ( EApp + ( (code_var, Marked.get_mark e1), + (env_var, Marked.get_mark e1) :: new_args ), + Marked.get_mark e )) + (Bindlib.box_var code_var) (Bindlib.box_var env_var) + (Bindlib.box_list new_args)) + (D.pos e) + in + ( make_let_in env_var (Dcalc.Ast.TAny, D.pos e) new_e1 call_expr (D.pos e), + free_vars ) + | EAssert e1 -> + let new_e1, free_vars = aux e1 in + ( Bindlib.box_apply + (fun new_e1 -> EAssert new_e1, Marked.get_mark e) + new_e1, + free_vars ) + | EOp op -> Bindlib.box (EOp op, Marked.get_mark e), MVarSet.empty + | EIfThenElse (e1, e2, e3) -> + let new_e1, free_vars1 = aux e1 in + let new_e2, free_vars2 = aux e2 in + let new_e3, free_vars3 = aux e3 in + ( Bindlib.box_apply3 + (fun new_e1 new_e2 new_e3 -> + EIfThenElse (new_e1, new_e2, new_e3), Marked.get_mark e) + new_e1 new_e2 new_e3, + MVarSet.union (MVarSet.union free_vars1 free_vars2) free_vars3 ) + | ERaise except -> + Bindlib.box (ERaise except, Marked.get_mark e), MVarSet.empty + | ECatch (e1, except, e2) -> + let new_e1, free_vars1 = aux e1 in + let new_e2, free_vars2 = aux e2 in + ( Bindlib.box_apply2 + (fun new_e1 new_e2 -> + ECatch (new_e1, except, new_e2), Marked.get_mark e) + new_e1 new_e2, + MVarSet.union free_vars1 free_vars2 ) + in + let e', _vars = aux e in + e' + +let closure_conversion (p : 'm program) : 'm program Bindlib.box = let new_scopes, _ = D.fold_left_scope_defs - ~f: - (fun ((acc_new_scopes, global_vars) : - (expr D.scopes Bindlib.box -> expr D.scopes Bindlib.box) - * VarSet.t) (scope : expr D.scope_def) (scope_var : Var.t) -> + ~f:(fun (acc_new_scopes, global_vars) scope scope_var -> (* [acc_new_scopes] represents what has been translated in the past, it needs a continuation to attach the rest of the translated scopes. *) let scope_input_var, scope_body_expr = Bindlib.unbind scope.scope_body.scope_body_expr in - let global_vars = VarSet.add scope_var global_vars in + let global_vars = VarSet.add (Var.t scope_var) global_vars in let ctx = { name_context = - Pos.unmark (Dcalc.Ast.ScopeName.get_info scope.scope_name); + Marked.unmark (Dcalc.Ast.ScopeName.get_info scope.scope_name); globally_bound_vars = global_vars; } in let new_scope_lets = D.map_exprs_in_scope_lets - ~f:(fun e -> fst (closure_conversion_expr ctx e)) + ~f:(closure_conversion_expr ctx) + ~varf:(fun v -> v) scope_body_expr in let new_scope_body_expr = diff --git a/compiler/lcalc/backends.mli b/compiler/lcalc/closure_conversion.mli similarity index 61% rename from compiler/lcalc/backends.mli rename to compiler/lcalc/closure_conversion.mli index 2b5d3589..1cc68459 100644 --- a/compiler/lcalc/backends.mli +++ b/compiler/lcalc/closure_conversion.mli @@ -1,5 +1,5 @@ (* This file is part of the Catala compiler, a specification language for tax - and social benefits computation rules. Copyright (C) 2021 Inria, contributor: + and social benefits computation rules. Copyright (C) 2022 Inria, contributor: Denis Merigoux Licensed under the Apache License, Version 2.0 (the "License"); you may not @@ -14,14 +14,6 @@ License for the specific language governing permissions and limitations under the License. *) -(** Helper functions common to all Catala compiler backends *) - -val to_ascii : string -> string -(** Removes all non-ASCII diacritics from a string by converting them to their - base letter in the Latin alphabet *) - -val to_lowercase : string -> string -(** Converts CamlCase into snake_case *) - -val to_uppercase : string -> string -(** Convertes snake_case into CamlCase *) +val closure_conversion : 'm Ast.program -> 'm Ast.program Bindlib.box +(** Warning/todo: no effort was yet made to ensure correct propagation of type + annotations in the typed case *) diff --git a/compiler/lcalc/compile_with_exceptions.ml b/compiler/lcalc/compile_with_exceptions.ml index f0af48a4..9f28c026 100644 --- a/compiler/lcalc/compile_with_exceptions.ml +++ b/compiler/lcalc/compile_with_exceptions.ml @@ -18,11 +18,11 @@ open Utils module D = Dcalc.Ast module A = Ast -type ctx = A.Var.t D.VarMap.t +type 'm ctx = 'm A.var D.VarMap.t (** This environment contains a mapping between the variables in Dcalc and their correspondance in Lcalc. *) -let translate_lit (l : D.lit) : A.expr = +let translate_lit (l : D.lit) : 'm A.expr = match l with | D.LBool l -> A.ELit (A.LBool l) | D.LInt i -> A.ELit (A.LInt i) @@ -33,105 +33,104 @@ let translate_lit (l : D.lit) : A.expr = | D.LDuration d -> A.ELit (A.LDuration d) | D.LEmptyError -> A.ERaise A.EmptyError -let thunk_expr (e : A.expr Pos.marked Bindlib.box) (pos : Pos.t) : - A.expr Pos.marked Bindlib.box = - let dummy_var = A.Var.make ("_", pos) in - A.make_abs [| dummy_var |] e pos [D.TAny, pos] pos +let thunk_expr (e : 'm A.marked_expr Bindlib.box) (mark : 'm A.mark) : + 'm A.marked_expr Bindlib.box = + let dummy_var = A.new_var "_" in + A.make_abs [| dummy_var |] e [D.TAny, D.mark_pos mark] mark let rec translate_default - (ctx : ctx) - (exceptions : D.expr Pos.marked list) - (just : D.expr Pos.marked) - (cons : D.expr Pos.marked) - (pos_default : Pos.t) : A.expr Pos.marked Bindlib.box = + (ctx : 'm ctx) + (exceptions : 'm D.marked_expr list) + (just : 'm D.marked_expr) + (cons : 'm D.marked_expr) + (mark_default : 'm D.mark) : 'm A.marked_expr Bindlib.box = let exceptions = List.map - (fun except -> thunk_expr (translate_expr ctx except) pos_default) + (fun except -> thunk_expr (translate_expr ctx except) mark_default) exceptions in let exceptions = A.make_app - (A.make_var (A.handle_default, pos_default)) + (A.make_var (A.Var.get A.handle_default, mark_default)) [ - A.earray exceptions pos_default; - thunk_expr (translate_expr ctx just) pos_default; - thunk_expr (translate_expr ctx cons) pos_default; + A.earray exceptions mark_default; + thunk_expr (translate_expr ctx just) mark_default; + thunk_expr (translate_expr ctx cons) mark_default; ] - pos_default + mark_default in exceptions -and translate_expr (ctx : ctx) (e : D.expr Pos.marked) : - A.expr Pos.marked Bindlib.box = - match Pos.unmark e with - | D.EVar v -> A.make_var (D.VarMap.find (Pos.unmark v) ctx, Pos.get_position e) +and translate_expr (ctx : 'm ctx) (e : 'm D.marked_expr) : + 'm A.marked_expr Bindlib.box = + match Marked.unmark e with + | D.EVar v -> A.make_var (D.VarMap.find (D.Var.t v) ctx, Marked.get_mark e) | D.ETuple (args, s) -> - A.etuple (List.map (translate_expr ctx) args) s (Pos.get_position e) + A.etuple (List.map (translate_expr ctx) args) s (Marked.get_mark e) | D.ETupleAccess (e1, i, s, ts) -> - A.etupleaccess (translate_expr ctx e1) i s ts (Pos.get_position e) + A.etupleaccess (translate_expr ctx e1) i s ts (Marked.get_mark e) | D.EInj (e1, i, en, ts) -> - A.einj (translate_expr ctx e1) i en ts (Pos.get_position e) + A.einj (translate_expr ctx e1) i en ts (Marked.get_mark e) | D.EMatch (e1, cases, en) -> A.ematch (translate_expr ctx e1) (List.map (translate_expr ctx) cases) - en (Pos.get_position e) + en (Marked.get_mark e) | D.EArray es -> - A.earray (List.map (translate_expr ctx) es) (Pos.get_position e) - | D.ELit l -> Bindlib.box (Pos.same_pos_as (translate_lit l) e) - | D.EOp op -> A.eop op (Pos.get_position e) + A.earray (List.map (translate_expr ctx) es) (Marked.get_mark e) + | D.ELit l -> Bindlib.box (Marked.same_mark_as (translate_lit l) e) + | D.EOp op -> A.eop op (Marked.get_mark e) | D.EIfThenElse (e1, e2, e3) -> A.eifthenelse (translate_expr ctx e1) (translate_expr ctx e2) - (translate_expr ctx e3) (Pos.get_position e) - | D.EAssert e1 -> A.eassert (translate_expr ctx e1) (Pos.get_position e) + (translate_expr ctx e3) (Marked.get_mark e) + | D.EAssert e1 -> A.eassert (translate_expr ctx e1) (Marked.get_mark e) | D.ErrorOnEmpty arg -> A.ecatch (translate_expr ctx arg) A.EmptyError - (Bindlib.box (Pos.same_pos_as (A.ERaise A.NoValueProvided) e)) - (Pos.get_position e) + (Bindlib.box (Marked.same_mark_as (A.ERaise A.NoValueProvided) e)) + (Marked.get_mark e) | D.EApp (e1, args) -> A.eapp (translate_expr ctx e1) (List.map (translate_expr ctx) args) - (Pos.get_position e) - | D.EAbs ((binder, pos_binder), ts) -> + (Marked.get_mark e) + | D.EAbs (binder, ts) -> let vars, body = Bindlib.unmbind binder in let ctx, lc_vars = Array.fold_right (fun var (ctx, lc_vars) -> - let lc_var = A.Var.make (Bindlib.name_of var, pos_binder) in - D.VarMap.add var lc_var ctx, lc_var :: lc_vars) + let lc_var = A.new_var (Bindlib.name_of var) in + D.VarMap.add (D.Var.t var) lc_var ctx, lc_var :: lc_vars) vars (ctx, []) in let lc_vars = Array.of_list lc_vars in let new_body = translate_expr ctx body in let new_binder = Bindlib.bind_mvar lc_vars new_body in Bindlib.box_apply - (fun new_binder -> - Pos.same_pos_as (A.EAbs ((new_binder, pos_binder), ts)) e) + (fun new_binder -> Marked.same_mark_as (A.EAbs (new_binder, ts)) e) new_binder | D.EDefault ([exn], just, cons) when !Cli.optimize_flag -> A.ecatch (translate_expr ctx exn) A.EmptyError (A.eifthenelse (translate_expr ctx just) (translate_expr ctx cons) - (Bindlib.box (Pos.same_pos_as (A.ERaise A.EmptyError) e)) - (Pos.get_position e)) - (Pos.get_position e) + (Bindlib.box (Marked.same_mark_as (A.ERaise A.EmptyError) e)) + (Marked.get_mark e)) + (Marked.get_mark e) | D.EDefault (exceptions, just, cons) -> - translate_default ctx exceptions just cons (Pos.get_position e) + translate_default ctx exceptions just cons (Marked.get_mark e) let rec translate_scope_lets (decl_ctx : D.decl_ctx) - (ctx : A.Var.t D.VarMap.t) - (scope_lets : D.expr D.scope_body_expr) : - A.expr D.scope_body_expr Bindlib.box = + (ctx : 'm ctx) + (scope_lets : ('m D.expr, 'm) D.scope_body_expr) : + ('m A.expr, 'm) D.scope_body_expr Bindlib.box = match scope_lets with | Result e -> Bindlib.box_apply (fun e -> D.Result e) (translate_expr ctx e) | ScopeLet scope_let -> let old_scope_let_var, scope_let_next = Bindlib.unbind scope_let.scope_let_next in - let new_scope_let_var = - A.Var.make (Bindlib.name_of old_scope_let_var, scope_let.scope_let_pos) - in + let new_scope_let_var = A.new_var (Bindlib.name_of old_scope_let_var) in let new_scope_let_expr = translate_expr ctx scope_let.scope_let_expr in - let new_ctx = D.VarMap.add old_scope_let_var new_scope_let_var ctx in + let new_ctx = + D.VarMap.add (D.Var.t old_scope_let_var) new_scope_let_var ctx + in let new_scope_next = translate_scope_lets decl_ctx new_ctx scope_let_next in let new_scope_next = Bindlib.bind_var new_scope_let_var new_scope_next in Bindlib.box_apply2 @@ -148,31 +147,29 @@ let rec translate_scope_lets let rec translate_scopes (decl_ctx : D.decl_ctx) - (ctx : A.Var.t D.VarMap.t) - (scopes : D.expr D.scopes) : A.expr D.scopes Bindlib.box = + (ctx : 'm ctx) + (scopes : ('m D.expr, 'm) D.scopes) : ('m A.expr, 'm) D.scopes Bindlib.box = match scopes with | Nil -> Bindlib.box D.Nil | ScopeDef scope_def -> let old_scope_var, scope_next = Bindlib.unbind scope_def.scope_next in let new_scope_var = - A.Var.make (D.ScopeName.get_info scope_def.scope_name) + A.new_var (Marked.unmark (D.ScopeName.get_info scope_def.scope_name)) in let old_scope_input_var, scope_body_expr = Bindlib.unbind scope_def.scope_body.scope_body_expr in - let new_scope_input_var = - A.Var.make - ( Bindlib.name_of old_scope_input_var, - Pos.get_position (D.ScopeName.get_info scope_def.scope_name) ) + let new_scope_input_var = A.new_var (Bindlib.name_of old_scope_input_var) in + let new_ctx = + D.VarMap.add (D.Var.t old_scope_input_var) new_scope_input_var ctx in - let new_ctx = D.VarMap.add old_scope_input_var new_scope_input_var ctx in let new_scope_body_expr = translate_scope_lets decl_ctx new_ctx scope_body_expr in let new_scope_body_expr = Bindlib.bind_var new_scope_input_var new_scope_body_expr in - let new_scope : A.expr D.scope_body Bindlib.box = + let new_scope : ('m A.expr, 'm) D.scope_body Bindlib.box = Bindlib.box_apply (fun new_scope_body_expr -> { @@ -184,7 +181,7 @@ let rec translate_scopes }) new_scope_body_expr in - let new_ctx = D.VarMap.add old_scope_var new_scope_var new_ctx in + let new_ctx = D.VarMap.add (D.Var.t old_scope_var) new_scope_var new_ctx in let scope_next = Bindlib.bind_var new_scope_var (translate_scopes decl_ctx new_ctx scope_next) @@ -199,7 +196,7 @@ let rec translate_scopes }) new_scope scope_next -let translate_program (prgm : D.program) : A.program = +let translate_program (prgm : 'm D.program) : 'm A.program = { scopes = Bindlib.unbox (translate_scopes prgm.decl_ctx D.VarMap.empty prgm.scopes); diff --git a/compiler/lcalc/compile_with_exceptions.mli b/compiler/lcalc/compile_with_exceptions.mli index a6795a04..da0f4d78 100644 --- a/compiler/lcalc/compile_with_exceptions.mli +++ b/compiler/lcalc/compile_with_exceptions.mli @@ -15,6 +15,6 @@ the License. *) (** Translation from the default calculus to the lambda calculus. This - translation uses exceptions handle empty default terms. *) + translation uses exceptions to handle empty default terms. *) -val translate_program : Dcalc.Ast.program -> Ast.program +val translate_program : 'm Dcalc.Ast.program -> 'm Ast.program diff --git a/compiler/lcalc/compile_without_exceptions.ml b/compiler/lcalc/compile_without_exceptions.ml index 9bca337b..77914d9c 100644 --- a/compiler/lcalc/compile_without_exceptions.ml +++ b/compiler/lcalc/compile_without_exceptions.ml @@ -40,12 +40,12 @@ module A = Ast hoisted and later handled by the [translate_expr] function. Every other cases is found in the translate_and_hoist function. *) -type hoists = D.expr Pos.marked A.VarMap.t +type 'm hoists = 'm D.marked_expr A.VarMap.t (** Hoists definition. It represent bindings between [A.Var.t] and [D.expr]. *) -type info = { - expr : A.expr Pos.marked Bindlib.box; - var : A.expr Bindlib.var; +type 'm info = { + expr : 'm A.marked_expr Bindlib.box; + var : 'm A.expr Bindlib.var; is_pure : bool; } (** Information about each encontered Dcalc variable is stored inside a context @@ -54,19 +54,20 @@ type info = { indicating whenever the variable can be an EmptyError and hence should be matched (false) or if it never can be EmptyError (true). *) -let pp_info (fmt : Format.formatter) (info : info) = +let pp_info (fmt : Format.formatter) (info : 'm info) = Format.fprintf fmt "{var: %a; is_pure: %b}" Print.format_var info.var info.is_pure -type ctx = { +type 'm ctx = { decl_ctx : D.decl_ctx; - vars : info D.VarMap.t; + vars : 'm info D.VarMap.t; (** information context about variables in the current scope *) } -let _pp_ctx (fmt : Format.formatter) (ctx : ctx) = - let pp_binding (fmt : Format.formatter) ((v, info) : D.Var.t * info) = - Format.fprintf fmt "%a: %a" Dcalc.Print.format_var v pp_info info +let _pp_ctx (fmt : Format.formatter) (ctx : 'm ctx) = + let pp_binding (fmt : Format.formatter) ((v, info) : D.Var.t * 'm info) = + Format.fprintf fmt "%a: %a" Dcalc.Print.format_var (D.Var.get v) pp_info + info in let pp_bindings = @@ -79,10 +80,10 @@ let _pp_ctx (fmt : Format.formatter) (ctx : ctx) = (** [find ~info n ctx] is a warpper to ocaml's Map.find that handle errors in a slightly better way. *) -let find ?(info : string = "none") (n : D.Var.t) (ctx : ctx) : info = +let find ?(info : string = "none") (n : 'm D.var) (ctx : 'm ctx) : 'm info = (* let _ = Format.asprintf "Searching for variable %a inside context %a" Dcalc.Print.format_var n pp_ctx ctx |> Cli.debug_print in *) - try D.VarMap.find n ctx.vars + try D.VarMap.find (D.Var.t n) ctx.vars with Not_found -> Errors.raise_spanned_error Pos.no_pos "Internal Error: Variable %a was not found in the current environment. \ @@ -93,16 +94,17 @@ let find ?(info : string = "none") (n : D.Var.t) (ctx : ctx) : info = var, creating a unique corresponding variable in Lcalc, with the corresponding expression, and the boolean is_pure. It is usefull for debuging purposes as it printing each of the Dcalc/Lcalc variable pairs. *) -let add_var (pos : Pos.t) (var : D.Var.t) (is_pure : bool) (ctx : ctx) : ctx = - let new_var = A.Var.make (Bindlib.name_of var, pos) in - let expr = A.make_var (new_var, pos) in +let add_var (mark : 'm D.mark) (var : 'm D.var) (is_pure : bool) (ctx : 'm ctx) + : 'm ctx = + let new_var = A.new_var (Bindlib.name_of var) in + let expr = A.make_var (new_var, mark) in (* Cli.debug_print @@ Format.asprintf "D.%a |-> A.%a" Dcalc.Print.format_var var Print.format_var new_var; *) { ctx with vars = - D.VarMap.update var + D.VarMap.update (D.Var.t var) (fun _ -> Some { expr; var = new_var; is_pure }) ctx.vars; } @@ -112,10 +114,11 @@ let add_var (pos : Pos.t) (var : D.Var.t) (is_pure : bool) (ctx : ctx) : ctx = Since positions where there is thunked expressions is exactly where we will put option expressions. Hence, the transformation simply reduce [unit -> 'a] into ['a option] recursivly. There is no polymorphism inside catala. *) -let rec translate_typ (tau : D.typ Pos.marked) : D.typ Pos.marked = - (Fun.flip Pos.same_pos_as) tau +let rec translate_typ (tau : D.typ Marked.pos) : D.typ Marked.pos = + (Fun.flip Marked.same_mark_as) + tau begin - match Pos.unmark tau with + match Marked.unmark tau with | D.TLit l -> D.TLit l | D.TTuple (ts, s) -> D.TTuple (List.map translate_typ ts, s) | D.TEnum (ts, en) -> D.TEnum (List.map translate_typ ts, en) @@ -160,10 +163,10 @@ let disjoint_union_maps (pos : Pos.t) (cs : 'a A.VarMap.t list) : 'a A.VarMap.t the equivalence between the execution of e and the execution of e' are equivalent in an environement where each variable v, where (v, e_v) is in hoists, has the non-empty value in e_v. *) -let rec translate_and_hoist (ctx : ctx) (e : D.expr Pos.marked) : - A.expr Pos.marked Bindlib.box * hoists = - let pos = Pos.get_position e in - match Pos.unmark e with +let rec translate_and_hoist (ctx : 'm ctx) (e : 'm D.marked_expr) : + 'm A.marked_expr Bindlib.box * 'm hoists = + let pos = Marked.get_mark e in + match Marked.unmark e with (* empty-producing/using terms. We hoist those. (D.EVar in some cases, EApp(D.EVar _, [ELit LUnit]), EDefault _, ELit LEmptyDefault) I'm unsure about assert. *) @@ -172,49 +175,47 @@ let rec translate_and_hoist (ctx : ctx) (e : D.expr Pos.marked) : current context) is thunked, hence matched in the next case. This assumption can change in the future, and this case is here for this reason. *) - let v, pos_v = v in if not (find ~info:"search for a variable" v ctx).is_pure then - let v' = A.Var.make (Bindlib.name_of v, pos_v) in + let v' = A.new_var (Bindlib.name_of v) in (* Cli.debug_print @@ Format.asprintf "Found an unpure variable %a, created a variable %a to replace it" Dcalc.Print.format_var v Print.format_var v'; *) - A.make_var (v', pos), A.VarMap.singleton v' e + A.make_var (v', pos), A.VarMap.singleton (A.Var.t v') e else (find ~info:"should never happend" v ctx).expr, A.VarMap.empty - | D.EApp ((D.EVar (v, pos_v), p), [(D.ELit D.LUnit, _)]) -> + | D.EApp ((D.EVar v, p), [(D.ELit D.LUnit, _)]) -> if not (find ~info:"search for a variable" v ctx).is_pure then - let v' = A.Var.make (Bindlib.name_of v, pos_v) in + let v' = A.new_var (Bindlib.name_of v) in (* Cli.debug_print @@ Format.asprintf "Found an unpure variable %a, created a variable %a to replace it" Dcalc.Print.format_var v Print.format_var v'; *) - A.make_var (v', pos), A.VarMap.singleton v' (D.EVar (v, pos_v), p) + A.make_var (v', pos), A.VarMap.singleton (A.Var.t v') (D.EVar v, p) else - Errors.raise_spanned_error pos + Errors.raise_spanned_error (D.pos e) "Internal error: an pure variable was found in an unpure environment." | D.EDefault (_exceptions, _just, _cons) -> - let v' = A.Var.make ("default_term", pos) in - A.make_var (v', pos), A.VarMap.singleton v' e + let v' = A.new_var "default_term" in + A.make_var (v', pos), A.VarMap.singleton (A.Var.t v') e | D.ELit D.LEmptyError -> - let v' = A.Var.make ("empty_litteral", pos) in - A.make_var (v', pos), A.VarMap.singleton v' e + let v' = A.new_var "empty_litteral" in + A.make_var (v', pos), A.VarMap.singleton (A.Var.t v') e (* This one is a very special case. It transform an unpure expression environement to a pure expression. *) | ErrorOnEmpty arg -> (* [ match arg with | None -> raise NoValueProvided | Some v -> {{ v }} ] *) - let silent_var = A.Var.make ("_", pos) in - let x = A.Var.make ("non_empty_argument", pos) in + let silent_var = A.new_var "_" in + let x = A.new_var "non_empty_argument" in let arg' = translate_expr ctx arg in ( A.make_matchopt_with_abs_arms arg' (A.make_abs [| silent_var |] (Bindlib.box (A.ERaise A.NoValueProvided, pos)) - pos - [D.TAny, pos] + [D.TAny, D.pos e] pos) - (A.make_abs [| x |] (A.make_var (x, pos)) pos [D.TAny, pos] pos), + (A.make_abs [| x |] (A.make_var (x, pos)) [D.TAny, D.pos e] pos), A.VarMap.empty ) (* pure terms *) - | D.ELit l -> A.elit (translate_lit l pos) pos, A.VarMap.empty + | D.ELit l -> A.elit (translate_lit l (D.pos e)) pos, A.VarMap.empty | D.EIfThenElse (e1, e2, e3) -> let e1', h1 = translate_and_hoist ctx e1 in let e2', h2 = translate_and_hoist ctx e2 in @@ -224,13 +225,13 @@ let rec translate_and_hoist (ctx : ctx) (e : D.expr Pos.marked) : (*(* equivalent code : *) let e' = let+ e1' = e1' and+ e2' = e2' and+ e3' = e3' in (A.EIfThenElse (e1', e2', e3'), pos) in *) - e', disjoint_union_maps pos [h1; h2; h3] + e', disjoint_union_maps (D.pos e) [h1; h2; h3] | D.EAssert e1 -> (* same behavior as in the ICFP paper: if e1 is empty, then no error is raised. *) let e1', h1 = translate_and_hoist ctx e1 in A.eassert e1' pos, h1 - | D.EAbs ((binder, pos_binder), ts) -> + | D.EAbs (binder, ts) -> let vars, body = Bindlib.unmbind binder in let ctx, lc_vars = ArrayLabels.fold_right vars ~init:(ctx, []) ~f:(fun var (ctx, lc_vars) -> @@ -252,8 +253,7 @@ let rec translate_and_hoist (ctx : ctx) (e : D.expr Pos.marked) : let new_binder = Bindlib.bind_mvar lc_vars new_body in ( Bindlib.box_apply - (fun new_binder -> - A.EAbs ((new_binder, pos_binder), List.map translate_typ ts), pos) + (fun new_binder -> A.EAbs (new_binder, List.map translate_typ ts), pos) new_binder, hoists ) | EApp (e1, args) -> @@ -262,7 +262,7 @@ let rec translate_and_hoist (ctx : ctx) (e : D.expr Pos.marked) : args |> List.map (translate_and_hoist ctx) |> List.split in - let hoists = disjoint_union_maps pos (h1 :: h_args) in + let hoists = disjoint_union_maps (D.pos e) (h1 :: h_args) in let e' = A.eapp e1' args' pos in e', hoists | ETuple (args, s) -> @@ -270,7 +270,7 @@ let rec translate_and_hoist (ctx : ctx) (e : D.expr Pos.marked) : args |> List.map (translate_and_hoist ctx) |> List.split in - let hoists = disjoint_union_maps pos h_args in + let hoists = disjoint_union_maps (D.pos e) h_args in A.etuple args' s pos, hoists | ETupleAccess (e1, i, s, ts) -> let e1', hoists = translate_and_hoist ctx e1 in @@ -286,75 +286,72 @@ let rec translate_and_hoist (ctx : ctx) (e : D.expr Pos.marked) : cases |> List.map (translate_and_hoist ctx) |> List.split in - let hoists = disjoint_union_maps pos (h1 :: h_cases) in + let hoists = disjoint_union_maps (D.pos e) (h1 :: h_cases) in let e' = A.ematch e1' cases' en pos in e', hoists | EArray es -> let es', hoists = es |> List.map (translate_and_hoist ctx) |> List.split in - A.earray es' pos, disjoint_union_maps pos hoists + A.earray es' pos, disjoint_union_maps (D.pos e) hoists | EOp op -> Bindlib.box (A.EOp op, pos), A.VarMap.empty -and translate_expr ?(append_esome = true) (ctx : ctx) (e : D.expr Pos.marked) : - A.expr Pos.marked Bindlib.box = +and translate_expr ?(append_esome = true) (ctx : 'm ctx) (e : 'm D.marked_expr) + : 'm A.marked_expr Bindlib.box = let e', hoists = translate_and_hoist ctx e in let hoists = A.VarMap.bindings hoists in - let _pos = Pos.get_position e in + let _pos = Marked.get_mark e in (* build the hoists *) (* Cli.debug_print @@ Format.asprintf "hoist for the expression: [%a]" (Format.pp_print_list Print.format_var) (List.map fst hoists); *) ListLabels.fold_left hoists ~init:(if append_esome then A.make_some e' else e') - ~f:(fun acc (v, (hoist, pos_hoist)) -> + ~f:(fun acc (v, (hoist, mark_hoist)) -> (* Cli.debug_print @@ Format.asprintf "hoist using A.%a" Print.format_var v; *) - let c' : A.expr Pos.marked Bindlib.box = + let c' : 'm A.marked_expr Bindlib.box = match hoist with (* Here we have to handle only the cases appearing in hoists, as defined the [translate_and_hoist] function. *) - | D.EVar v -> - (find ~info:"should never happend" (Pos.unmark v) ctx).expr + | D.EVar v -> (find ~info:"should never happend" v ctx).expr | D.EDefault (excep, just, cons) -> let excep' = List.map (translate_expr ctx) excep in let just' = translate_expr ctx just in let cons' = translate_expr ctx cons in (* calls handle_option. *) A.make_app - (A.make_var (A.handle_default_opt, pos_hoist)) + (A.make_var (A.Var.get A.handle_default_opt, mark_hoist)) [ Bindlib.box_apply - (fun excep' -> A.EArray excep', pos_hoist) + (fun excep' -> A.EArray excep', mark_hoist) (Bindlib.box_list excep'); just'; cons'; ] - pos_hoist - | D.ELit D.LEmptyError -> A.make_none pos_hoist + mark_hoist + | D.ELit D.LEmptyError -> A.make_none mark_hoist | D.EAssert arg -> let arg' = translate_expr ctx arg in (* [ match arg with | None -> raise NoValueProvided | Some v -> assert {{ v }} ] *) - let silent_var = A.Var.make ("_", pos_hoist) in - let x = A.Var.make ("assertion_argument", pos_hoist) in + let silent_var = A.new_var "_" in + let x = A.new_var "assertion_argument" in A.make_matchopt_with_abs_arms arg' (A.make_abs [| silent_var |] - (Bindlib.box (A.ERaise A.NoValueProvided, pos_hoist)) - pos_hoist - [D.TAny, pos_hoist] - pos_hoist) + (Bindlib.box (A.ERaise A.NoValueProvided, mark_hoist)) + [D.TAny, D.mark_pos mark_hoist] + mark_hoist) (A.make_abs [| x |] (Bindlib.box_apply - (fun arg -> A.EAssert arg, pos_hoist) - (A.make_var (x, pos_hoist))) - pos_hoist - [D.TAny, pos_hoist] - pos_hoist) + (fun arg -> A.EAssert arg, mark_hoist) + (A.make_var (x, mark_hoist))) + [D.TAny, D.mark_pos mark_hoist] + mark_hoist) | _ -> - Errors.raise_spanned_error pos_hoist + Errors.raise_spanned_error (D.mark_pos mark_hoist) "Internal Error: An term was found in a position where it should \ not be" in @@ -363,11 +360,14 @@ and translate_expr ?(append_esome = true) (ctx : ctx) (e : D.expr Pos.marked) : ] *) (* Cli.debug_print @@ Format.asprintf "build matchopt using %a" Print.format_var v; *) - A.make_matchopt pos_hoist v (D.TAny, pos_hoist) c' (A.make_none pos_hoist) - acc) + A.make_matchopt mark_hoist (A.Var.get v) + (D.TAny, D.mark_pos mark_hoist) + c' (A.make_none mark_hoist) acc) -let rec translate_scope_let (ctx : ctx) (lets : D.expr D.scope_body_expr) : - A.expr D.scope_body_expr Bindlib.box = +let rec translate_scope_let + (ctx : 'm ctx) + (lets : ('m D.expr, 'm) D.scope_body_expr) : + ('m A.expr, 'm) D.scope_body_expr Bindlib.box = match lets with | Result e -> Bindlib.box_apply @@ -377,7 +377,7 @@ let rec translate_scope_let (ctx : ctx) (lets : D.expr D.scope_body_expr) : { scope_let_kind = SubScopeVarDefinition; scope_let_typ = typ; - scope_let_expr = D.EAbs ((binder, _), _), _; + scope_let_expr = D.EAbs (binder, _), emark; scope_let_next = next; scope_let_pos = pos; } -> @@ -389,7 +389,8 @@ let rec translate_scope_let (ctx : ctx) (lets : D.expr D.scope_body_expr) : let var, next = Bindlib.unbind next in (* Cli.debug_print @@ Format.asprintf "unbinding %a" Dcalc.Print.format_var var; *) - let ctx' = add_var pos var var_is_pure ctx in + let vmark = D.map_mark (fun _ -> pos) (fun _ -> typ) emark in + let ctx' = add_var vmark var var_is_pure ctx in let new_var = (find ~info:"variable that was just created" var ctx').var in let new_next = translate_scope_let ctx' next in Bindlib.box_apply2 @@ -408,7 +409,7 @@ let rec translate_scope_let (ctx : ctx) (lets : D.expr D.scope_body_expr) : { scope_let_kind = SubScopeVarDefinition; scope_let_typ = typ; - scope_let_expr = (D.ErrorOnEmpty _, _) as expr; + scope_let_expr = (D.ErrorOnEmpty _, emark) as expr; scope_let_next = next; scope_let_pos = pos; } -> @@ -417,7 +418,8 @@ let rec translate_scope_let (ctx : ctx) (lets : D.expr D.scope_body_expr) : let var, next = Bindlib.unbind next in (* Cli.debug_print @@ Format.asprintf "unbinding %a" Dcalc.Print.format_var var; *) - let ctx' = add_var pos var var_is_pure ctx in + let vmark = D.map_mark (fun _ -> pos) (fun _ -> typ) emark in + let ctx' = add_var vmark var var_is_pure ctx in let new_var = (find ~info:"variable that was just created" var ctx').var in Bindlib.box_apply2 (fun new_expr new_next -> @@ -459,7 +461,7 @@ let rec translate_scope_let (ctx : ctx) (lets : D.expr D.scope_body_expr) : can do so by looking at the typ of the destructuring: if it's thunked, then the variable is context. If it's not thunked, it's a regular input. *) - match Pos.unmark typ with + match Marked.unmark typ with | D.TArrow ((D.TLit D.TUnit, _), _) -> false | _ -> true) | ScopeVarDefinition | SubScopeVarDefinition | CallingSubScope @@ -469,7 +471,10 @@ let rec translate_scope_let (ctx : ctx) (lets : D.expr D.scope_body_expr) : let var, next = Bindlib.unbind next in (* Cli.debug_print @@ Format.asprintf "unbinding %a" Dcalc.Print.format_var var; *) - let ctx' = add_var pos var var_is_pure ctx in + let vmark = + D.map_mark (fun _ -> pos) (fun _ -> typ) (Marked.get_mark expr) + in + let ctx' = add_var vmark var var_is_pure ctx in let new_var = (find ~info:"variable that was just created" var ctx').var in Bindlib.box_apply2 (fun new_expr new_next -> @@ -486,8 +491,9 @@ let rec translate_scope_let (ctx : ctx) (lets : D.expr D.scope_body_expr) : let translate_scope_body (scope_pos : Pos.t) - (ctx : ctx) - (body : D.expr D.scope_body) : A.expr D.scope_body Bindlib.box = + (ctx : 'm ctx) + (body : ('m D.expr, 'm) D.scope_body) : + ('m A.expr, 'm) D.scope_body Bindlib.box = match body with | { scope_body_expr = result; @@ -495,7 +501,14 @@ let translate_scope_body scope_body_output_struct = output_struct; } -> let v, lets = Bindlib.unbind result in - let ctx' = add_var scope_pos v true ctx in + let vmark = + let m = + match lets with + | Result e | ScopeLet { scope_let_expr = e; _ } -> Marked.get_mark e + in + D.map_mark (fun _ -> scope_pos) (fun ty -> ty) m + in + let ctx' = add_var vmark v true ctx in let v' = (find ~info:"variable that was just created" v ctx').var in Bindlib.box_apply (fun new_expr -> @@ -506,18 +519,23 @@ let translate_scope_body }) (Bindlib.bind_var v' (translate_scope_let ctx' lets)) -let rec translate_scopes (ctx : ctx) (scopes : D.expr D.scopes) : - A.expr D.scopes Bindlib.box = +let rec translate_scopes (ctx : 'm ctx) (scopes : ('m D.expr, 'm) D.scopes) : + ('m A.expr, 'm) D.scopes Bindlib.box = match scopes with | Nil -> Bindlib.box D.Nil | ScopeDef { scope_name; scope_body; scope_next } -> let scope_var, next = Bindlib.unbind scope_next in - let new_ctx = add_var Pos.no_pos scope_var true ctx in + let vmark = + match Bindlib.unbind scope_body.scope_body_expr with + | _, (Result e | ScopeLet { scope_let_expr = e; _ }) -> Marked.get_mark e + in + + let new_ctx = add_var vmark scope_var true ctx in let new_scope_name = (find ~info:"variable that was just created" scope_var new_ctx).var in - let scope_pos = Pos.get_position (D.ScopeName.get_info scope_name) in + let scope_pos = Marked.get_mark (D.ScopeName.get_info scope_name) in let new_body = translate_scope_body scope_pos ctx scope_body in let tail = translate_scopes new_ctx next in @@ -528,7 +546,7 @@ let rec translate_scopes (ctx : ctx) (scopes : D.expr D.scopes) : new_body (Bindlib.bind_var new_scope_name tail) -let translate_program (prgm : D.program) : A.program = +let translate_program (prgm : 'm D.program) : 'm A.program = let inputs_structs = D.fold_left_scope_defs prgm.scopes ~init:[] ~f:(fun acc scope_def _ -> scope_def.D.scope_body.scope_body_input_struct :: acc) diff --git a/compiler/lcalc/compile_without_exceptions.mli b/compiler/lcalc/compile_without_exceptions.mli index 752924fc..6bb2b18d 100644 --- a/compiler/lcalc/compile_without_exceptions.mli +++ b/compiler/lcalc/compile_without_exceptions.mli @@ -19,4 +19,4 @@ transformation is one piece to permit to compile toward legacy languages that does not contains exceptions. *) -val translate_program : Dcalc.Ast.program -> Ast.program +val translate_program : 'm Dcalc.Ast.program -> 'm Ast.program diff --git a/compiler/lcalc/dune b/compiler/lcalc/dune index 7fa1bcb3..66ff93d3 100644 --- a/compiler/lcalc/dune +++ b/compiler/lcalc/dune @@ -1,7 +1,7 @@ (library (name lcalc) (public_name catala.lcalc) - (libraries bindlib dcalc scopelang runtime) + (libraries bindlib ubase dcalc scopelang catala.runtime_ocaml) (preprocess (pps visitors.ppx))) diff --git a/compiler/lcalc/optimizations.ml b/compiler/lcalc/optimizations.ml index 3c319848..c31f3c5e 100644 --- a/compiler/lcalc/optimizations.ml +++ b/compiler/lcalc/optimizations.ml @@ -15,19 +15,20 @@ the License. *) open Utils open Ast +module D = Dcalc.Ast let ( let+ ) x f = Bindlib.box_apply f x let ( and+ ) x y = Bindlib.box_pair x y let visitor_map - (t : 'a -> expr Pos.marked -> expr Pos.marked Bindlib.box) + (t : 'a -> 'm marked_expr -> 'm marked_expr Bindlib.box) (ctx : 'a) - (e : expr Pos.marked) : expr Pos.marked Bindlib.box = + (e : 'm marked_expr) : 'm marked_expr Bindlib.box = (* calls [t ctx] on every direct childs of [e], then rebuild an abstract syntax tree modified. Used in other transformations. *) - let default_mark e' = Pos.same_pos_as e' e in - match Pos.unmark e with - | EVar (v, _pos) -> + let default_mark e' = Marked.same_mark_as e' e in + match Marked.unmark e with + | EVar v -> let+ v = Bindlib.box_var v in default_mark @@ v | ETuple (args, n) -> @@ -46,11 +47,11 @@ let visitor_map | EArray args -> let+ args = args |> List.map (t ctx) |> Bindlib.box_list in default_mark @@ EArray args - | EAbs ((binder, pos_binder), ts) -> + | EAbs (binder, ts) -> let vars, body = Bindlib.unmbind binder in let body = t ctx body in let+ binder = Bindlib.bind_mvar vars body in - default_mark @@ EAbs ((binder, pos_binder), ts) + default_mark @@ EAbs (binder, ts) | EApp (e1, args) -> let+ e1 = t ctx e1 and+ args = args |> List.map (t ctx) |> Bindlib.box_list in @@ -66,10 +67,9 @@ let visitor_map default_mark @@ ECatch (e1, exn, e2) | ERaise _ | ELit _ | EOp _ -> Bindlib.box e -let rec iota_expr (_ : unit) (e : expr Pos.marked) : expr Pos.marked Bindlib.box - = - let default_mark e' = Pos.mark (Pos.get_position e) e' in - match Pos.unmark e with +let rec iota_expr (_ : unit) (e : 'm marked_expr) : 'm marked_expr Bindlib.box = + let default_mark e' = Marked.mark (Marked.get_mark e) e' in + match Marked.unmark e with | EMatch ((EInj (e1, i, n', _ts), _), cases, n) when Dcalc.Ast.EnumName.compare n n' = 0 -> let+ e1 = visitor_map iota_expr () e1 @@ -86,42 +86,45 @@ let rec iota_expr (_ : unit) (e : expr Pos.marked) : expr Pos.marked Bindlib.box visitor_map iota_expr () e' | _ -> visitor_map iota_expr () e -let rec beta_expr (_ : unit) (e : expr Pos.marked) : expr Pos.marked Bindlib.box - = - let default_mark e' = Pos.same_pos_as e' e in - match Pos.unmark e with +let rec beta_expr (_ : unit) (e : 'm marked_expr) : 'm marked_expr Bindlib.box = + let default_mark e' = Marked.same_mark_as e' e in + match Marked.unmark e with | EApp (e1, args) -> ( let+ e1 = beta_expr () e1 and+ args = List.map (beta_expr ()) args |> Bindlib.box_list in - match Pos.unmark e1 with - | EAbs ((binder, _pos_binder), _ts) -> + match Marked.unmark e1 with + | EAbs (binder, _ts) -> let (_ : (_, _) Bindlib.mbinder) = binder in Bindlib.msubst binder (List.map fst args |> Array.of_list) | _ -> default_mark @@ EApp (e1, args)) | _ -> visitor_map beta_expr () e -let iota_optimizations (p : program) : program = - let new_scopes = Dcalc.Ast.map_exprs_in_scopes ~f:(iota_expr ()) p.scopes in - { p with scopes = Bindlib.unbox new_scopes } +let iota_optimizations (p : 'm program) : 'm program = + let new_scopes = + Dcalc.Ast.map_exprs_in_scopes ~f:(iota_expr ()) ~varf:(fun v -> v) p.scopes + in + { p with D.scopes = Bindlib.unbox new_scopes } (* TODO: beta optimizations apply inlining of the program. We left the inclusion of beta-optimization as future work since its produce code that is harder to read, and can produce exponential blowup of the size of the generated program. *) -let _beta_optimizations (p : program) : program = - let new_scopes = Dcalc.Ast.map_exprs_in_scopes ~f:(beta_expr ()) p.scopes in +let _beta_optimizations (p : 'm program) : 'm program = + let new_scopes = + Dcalc.Ast.map_exprs_in_scopes ~f:(beta_expr ()) ~varf:(fun v -> v) p.scopes + in { p with scopes = Bindlib.unbox new_scopes } -let rec peephole_expr (_ : unit) (e : expr Pos.marked) : - expr Pos.marked Bindlib.box = - let default_mark e' = Pos.mark (Pos.get_position e) e' in +let rec peephole_expr (_ : unit) (e : 'm marked_expr) : + 'm marked_expr Bindlib.box = + let default_mark e' = Marked.mark (Marked.get_mark e) e' in - match Pos.unmark e with + match Marked.unmark e with | EIfThenElse (e1, e2, e3) -> ( let+ e1 = peephole_expr () e1 and+ e2 = peephole_expr () e2 and+ e3 = peephole_expr () e3 in - match Pos.unmark e1 with + match Marked.unmark e1 with | ELit (LBool true) | EApp ((EOp (Unop (Log _)), _), [(ELit (LBool true), _)]) -> e2 @@ -131,7 +134,7 @@ let rec peephole_expr (_ : unit) (e : expr Pos.marked) : | _ -> default_mark @@ EIfThenElse (e1, e2, e3)) | ECatch (e1, except, e2) -> ( let+ e1 = peephole_expr () e1 and+ e2 = peephole_expr () e2 in - match Pos.unmark e1, Pos.unmark e2 with + match Marked.unmark e1, Marked.unmark e2 with | ERaise except', ERaise except'' when except' = except && except = except'' -> default_mark @@ ERaise except @@ -140,11 +143,13 @@ let rec peephole_expr (_ : unit) (e : expr Pos.marked) : | _ -> default_mark @@ ECatch (e1, except, e2)) | _ -> visitor_map peephole_expr () e -let peephole_optimizations (p : program) : program = +let peephole_optimizations (p : 'm program) : 'm program = let new_scopes = - Dcalc.Ast.map_exprs_in_scopes ~f:(peephole_expr ()) p.scopes + Dcalc.Ast.map_exprs_in_scopes ~f:(peephole_expr ()) + ~varf:(fun v -> v) + p.scopes in { p with scopes = Bindlib.unbox new_scopes } -let optimize_program (p : program) : program = - p |> iota_optimizations |> peephole_optimizations +let optimize_program (p : 'm program) : Dcalc.Ast.untyped program = + p |> iota_optimizations |> peephole_optimizations |> untype_program diff --git a/compiler/lcalc/optimizations.mli b/compiler/lcalc/optimizations.mli index 4e7ab958..da3af2c5 100644 --- a/compiler/lcalc/optimizations.mli +++ b/compiler/lcalc/optimizations.mli @@ -16,4 +16,6 @@ open Ast -val optimize_program : program -> program +val optimize_program : 'm program -> Dcalc.Ast.untyped program +(** Warning/todo: no effort was yet made to ensure correct propagation of type + annotations in the typed case *) diff --git a/compiler/lcalc/print.ml b/compiler/lcalc/print.ml index a0f4e820..661ceec7 100644 --- a/compiler/lcalc/print.ml +++ b/compiler/lcalc/print.ml @@ -17,22 +17,10 @@ open Utils open Ast -let is_uppercase (x : CamomileLibraryDefault.Camomile.UChar.t) : bool = - try - match CamomileLibraryDefault.Camomile.UCharInfo.general_category x with - | `Ll -> false - | `Lu -> true - | _ -> false - with _ -> true - -let begins_with_uppercase (s : string) : bool = - let first_letter = CamomileLibraryDefault.Camomile.UTF8.get s 0 in - is_uppercase first_letter - (** {b Note:} (EmileRolley) seems to be factorizable with Dcalc.Print.format_lit. *) -let format_lit (fmt : Format.formatter) (l : lit Pos.marked) : unit = - match Pos.unmark l with +let format_lit (fmt : Format.formatter) (l : lit Marked.pos) : unit = + match Marked.unmark l with | LBool b -> Dcalc.Print.format_lit_style fmt (string_of_bool b) | LInt i -> Dcalc.Print.format_lit_style fmt (Runtime.integer_to_string i) | LUnit -> Dcalc.Print.format_lit_style fmt "()" @@ -68,26 +56,26 @@ let format_keyword (fmt : Format.formatter) (s : string) : unit = let format_punctuation (fmt : Format.formatter) (s : string) : unit = Format.fprintf fmt "%a" (Utils.Cli.format_with_style [ANSITerminal.cyan]) s -let needs_parens (e : expr Pos.marked) : bool = - match Pos.unmark e with EAbs _ | ETuple (_, Some _) -> true | _ -> false +let needs_parens (e : 'm marked_expr) : bool = + match Marked.unmark e with EAbs _ | ETuple (_, Some _) -> true | _ -> false -let format_var (fmt : Format.formatter) (v : Var.t) : unit = +let format_var (fmt : Format.formatter) (v : 'm Ast.var) : unit = Format.fprintf fmt "%s_%d" (Bindlib.name_of v) (Bindlib.uid_of v) let rec format_expr ?(debug : bool = false) (ctx : Dcalc.Ast.decl_ctx) (fmt : Format.formatter) - (e : expr Pos.marked) : unit = + (e : 'm marked_expr) : unit = let format_expr = format_expr ctx ~debug in - let format_with_parens (fmt : Format.formatter) (e : expr Pos.marked) = + let format_with_parens (fmt : Format.formatter) (e : 'm marked_expr) = if needs_parens e then Format.fprintf fmt "%a%a%a" format_punctuation "(" format_expr e format_punctuation ")" else Format.fprintf fmt "%a" format_expr e in - match Pos.unmark e with - | EVar v -> Format.fprintf fmt "%a" format_var (Pos.unmark v) + match Marked.unmark e with + | EVar v -> Format.fprintf fmt "%a" format_var v | ETuple (es, None) -> Format.fprintf fmt "@[%a%a%a@]" format_punctuation "(" (Format.pp_print_list @@ -136,23 +124,23 @@ let rec format_expr format_expr e)) (List.combine es (List.map fst (Dcalc.Ast.EnumMap.find e_name ctx.ctx_enums))) - | ELit l -> Format.fprintf fmt "%a" format_lit (Pos.same_pos_as l e) - | EApp ((EAbs ((binder, _), taus), _), args) -> + | ELit l -> + Format.fprintf fmt "%a" format_lit (Marked.mark (Dcalc.Ast.pos e) l) + | EApp ((EAbs (binder, taus), _), args) -> let xs, body = Bindlib.unmbind binder in - let xs_tau = List.map2 (fun x tau -> x, tau) (Array.to_list xs) taus in - let xs_tau_arg = List.map2 (fun (x, tau) arg -> x, tau, arg) xs_tau args in Format.fprintf fmt "%a%a" (Format.pp_print_list ~pp_sep:(fun fmt () -> Format.fprintf fmt "") - (fun fmt (x, tau, arg) -> + (fun fmt ((x, tau), arg) -> Format.fprintf fmt "@[%a@ %a@ %a@ %a@ %a@ %a@ %a@]@\n" format_keyword "let" format_var x format_punctuation ":" (Dcalc.Print.format_typ ctx) - tau format_punctuation "=" format_expr arg format_keyword "in")) - xs_tau_arg format_expr body - | EAbs ((binder, _), taus) -> + (Marked.unmark tau) format_punctuation "=" format_expr arg + format_keyword "in")) + (List.combine (List.combine (Array.to_list xs) taus) args) + format_expr body + | EAbs (binder, taus) -> let xs, body = Bindlib.unmbind binder in - let xs_tau = List.map2 (fun x tau -> x, tau) (Array.to_list xs) taus in Format.fprintf fmt "@[%a %a %a@ %a@]" format_punctuation "λ" (Format.pp_print_list ~pp_sep:(fun fmt () -> Format.fprintf fmt "@ ") @@ -160,21 +148,22 @@ let rec format_expr Format.fprintf fmt "%a%a%a %a%a" format_punctuation "(" format_var x format_punctuation ":" (Dcalc.Print.format_typ ctx) - tau format_punctuation ")")) - xs_tau format_punctuation "→" format_expr body + (Marked.unmark tau) format_punctuation ")")) + (List.combine (Array.to_list xs) taus) + format_punctuation "→" format_expr body | EApp ((EOp (Binop ((Dcalc.Ast.Map | Dcalc.Ast.Filter) as op)), _), [arg1; arg2]) -> - Format.fprintf fmt "@[%a@ %a@ %a@]" Dcalc.Print.format_binop - (op, Pos.no_pos) format_with_parens arg1 format_with_parens arg2 + Format.fprintf fmt "@[%a@ %a@ %a@]" Dcalc.Print.format_binop op + format_with_parens arg1 format_with_parens arg2 | EApp ((EOp (Binop op), _), [arg1; arg2]) -> Format.fprintf fmt "@[%a@ %a@ %a@]" format_with_parens arg1 - Dcalc.Print.format_binop (op, Pos.no_pos) format_with_parens arg2 + Dcalc.Print.format_binop op format_with_parens arg2 | EApp ((EOp (Unop (Log _)), _), [arg1]) when not debug -> Format.fprintf fmt "%a" format_with_parens arg1 | EApp ((EOp (Unop op), _), [arg1]) -> - Format.fprintf fmt "@[%a@ %a@]" Dcalc.Print.format_unop - (op, Pos.no_pos) format_with_parens arg1 + Format.fprintf fmt "@[%a@ %a@]" Dcalc.Print.format_unop op + format_with_parens arg1 | EApp (f, args) -> Format.fprintf fmt "@[%a@ %a@]" format_expr f (Format.pp_print_list @@ -185,12 +174,9 @@ let rec format_expr Format.fprintf fmt "@[%a@ %a@ %a@ %a@ %a@ %a@]" format_keyword "if" format_expr e1 format_keyword "then" format_expr e2 format_keyword "else" format_expr e3 - | EOp (Ternop op) -> - Format.fprintf fmt "%a" Dcalc.Print.format_ternop (op, Pos.no_pos) - | EOp (Binop op) -> - Format.fprintf fmt "%a" Dcalc.Print.format_binop (op, Pos.no_pos) - | EOp (Unop op) -> - Format.fprintf fmt "%a" Dcalc.Print.format_unop (op, Pos.no_pos) + | EOp (Ternop op) -> Format.fprintf fmt "%a" Dcalc.Print.format_ternop op + | EOp (Binop op) -> Format.fprintf fmt "%a" Dcalc.Print.format_binop op + | EOp (Unop op) -> Format.fprintf fmt "%a" Dcalc.Print.format_unop op | ECatch (e1, exn, e2) -> Format.fprintf fmt "@[%a@ %a@ %a@ %a ->@ %a@]" format_keyword "try" format_with_parens e1 format_keyword "with" format_exception exn @@ -202,14 +188,13 @@ let rec format_expr Format.fprintf fmt "@[%a@ %a%a%a@]" format_keyword "assert" format_punctuation "(" format_expr e' format_punctuation ")" -let format_scope - ?(debug : bool = false) - (ctx : Dcalc.Ast.decl_ctx) - (fmt : Format.formatter) - ((n, s) : Dcalc.Ast.ScopeName.t * Ast.expr Dcalc.Ast.scope_body) : unit = +let format_scope ?(debug = false) ctx fmt (n, s) = Format.fprintf fmt "@[%a %a =@ %a@]" format_keyword "let" Dcalc.Ast.ScopeName.format_t n (format_expr ctx ~debug) (Bindlib.unbox (Dcalc.Ast.build_whole_scope_expr ~make_abs:Ast.make_abs ~make_let_in:Ast.make_let_in ~box_expr:Ast.box_expr ctx s - (Pos.get_position (Dcalc.Ast.ScopeName.get_info n)))) + (Dcalc.Ast.map_mark + (fun _ -> Marked.get_mark (Dcalc.Ast.ScopeName.get_info n)) + (fun ty -> ty) + (Dcalc.Ast.get_scope_body_mark s)))) diff --git a/compiler/lcalc/print.mli b/compiler/lcalc/print.mli index 7bab87f6..938aa3d5 100644 --- a/compiler/lcalc/print.mli +++ b/compiler/lcalc/print.mli @@ -16,27 +16,22 @@ open Utils -(** {1 Helpers} *) - -val is_uppercase : CamomileLibraryDefault.Camomile.UChar.t -> bool -val begins_with_uppercase : string -> bool - (** {1 Formatters} *) -val format_lit : Format.formatter -> Ast.lit Pos.marked -> unit -val format_var : Format.formatter -> Ast.Var.t -> unit +val format_lit : Format.formatter -> Ast.lit Marked.pos -> unit +val format_var : Format.formatter -> 'm Ast.var -> unit val format_exception : Format.formatter -> Ast.except -> unit val format_expr : ?debug:bool -> Dcalc.Ast.decl_ctx -> Format.formatter -> - Ast.expr Pos.marked -> + 'm Ast.marked_expr -> unit val format_scope : ?debug:bool -> Dcalc.Ast.decl_ctx -> Format.formatter -> - Dcalc.Ast.ScopeName.t * Ast.expr Dcalc.Ast.scope_body -> + Dcalc.Ast.ScopeName.t * ('m Ast.expr, 'm) Dcalc.Ast.scope_body -> unit diff --git a/compiler/lcalc/to_ocaml.ml b/compiler/lcalc/to_ocaml.ml index c37f9671..7bd63bf5 100644 --- a/compiler/lcalc/to_ocaml.ml +++ b/compiler/lcalc/to_ocaml.ml @@ -16,11 +16,11 @@ open Utils open Ast -open Backends +open String_common module D = Dcalc.Ast let find_struct (s : D.StructName.t) (ctx : D.decl_ctx) : - (D.StructFieldName.t * D.typ Pos.marked) list = + (D.StructFieldName.t * D.typ Marked.pos) list = try D.StructMap.find s ctx.D.ctx_structs with Not_found -> let s_name, pos = D.StructName.get_info s in @@ -29,7 +29,7 @@ let find_struct (s : D.StructName.t) (ctx : D.decl_ctx) : s_name let find_enum (en : D.EnumName.t) (ctx : D.decl_ctx) : - (D.EnumConstructor.t * D.typ Pos.marked) list = + (D.EnumConstructor.t * D.typ Marked.pos) list = try D.EnumMap.find en ctx.D.ctx_enums with Not_found -> let en_name, pos = D.EnumName.get_info en in @@ -37,27 +37,26 @@ let find_enum (en : D.EnumName.t) (ctx : D.decl_ctx) : "Internal Error: Enumeration %s was not found in the current environment." en_name -let format_lit (fmt : Format.formatter) (l : lit Pos.marked) : unit = - match Pos.unmark l with - | LBool b -> - Dcalc.Print.format_lit fmt (Pos.same_pos_as (Dcalc.Ast.LBool b) l) +let format_lit (fmt : Format.formatter) (l : lit Marked.pos) : unit = + match Marked.unmark l with + | LBool b -> Dcalc.Print.format_lit fmt (Dcalc.Ast.LBool b) | LInt i -> Format.fprintf fmt "integer_of_string@ \"%s\"" (Runtime.integer_to_string i) - | LUnit -> Dcalc.Print.format_lit fmt (Pos.same_pos_as Dcalc.Ast.LUnit l) + | LUnit -> Dcalc.Print.format_lit fmt Dcalc.Ast.LUnit | LRat i -> Format.fprintf fmt "decimal_of_string \"%a\"" Dcalc.Print.format_lit - (Pos.same_pos_as (Dcalc.Ast.LRat i) l) + (Dcalc.Ast.LRat i) | LMoney e -> Format.fprintf fmt "money_of_cents_string@ \"%s\"" (Runtime.integer_to_string (Runtime.money_to_cents e)) | LDate d -> - Format.fprintf fmt "date_of_numbers %d %d %d" + Format.fprintf fmt "date_of_numbers (%d) (%d) (%d)" (Runtime.integer_to_int (Runtime.year_of_date d)) (Runtime.integer_to_int (Runtime.month_number_of_date d)) (Runtime.integer_to_int (Runtime.day_of_month_of_date d)) | LDuration d -> let years, months, days = Runtime.duration_to_years_months_days d in - Format.fprintf fmt "duration_of_numbers %d %d %d" years months days + Format.fprintf fmt "duration_of_numbers (%d) (%d) (%d)" years months days let format_op_kind (fmt : Format.formatter) (k : Dcalc.Ast.op_kind) = Format.fprintf fmt "%s" @@ -68,9 +67,9 @@ let format_op_kind (fmt : Format.formatter) (k : Dcalc.Ast.op_kind) = | KDate -> "@" | KDuration -> "^") -let format_binop (fmt : Format.formatter) (op : Dcalc.Ast.binop Pos.marked) : +let format_binop (fmt : Format.formatter) (op : Dcalc.Ast.binop Marked.pos) : unit = - match Pos.unmark op with + match Marked.unmark op with | Add k -> Format.fprintf fmt "+%a" format_op_kind k | Sub k -> Format.fprintf fmt "-%a" format_op_kind k | Mult k -> Format.fprintf fmt "*%a" format_op_kind k @@ -87,9 +86,9 @@ let format_binop (fmt : Format.formatter) (op : Dcalc.Ast.binop Pos.marked) : | Map -> Format.fprintf fmt "Array.map" | Filter -> Format.fprintf fmt "array_filter" -let format_ternop (fmt : Format.formatter) (op : Dcalc.Ast.ternop Pos.marked) : +let format_ternop (fmt : Format.formatter) (op : Dcalc.Ast.ternop Marked.pos) : unit = - match Pos.unmark op with Fold -> Format.fprintf fmt "Array.fold_left" + match Marked.unmark op with Fold -> Format.fprintf fmt "Array.fold_left" let format_uid_list (fmt : Format.formatter) (uids : Uid.MarkedString.info list) : unit = @@ -101,74 +100,80 @@ let format_uid_list (fmt : Format.formatter) (uids : Uid.MarkedString.info list) uids let format_string_list (fmt : Format.formatter) (uids : string list) : unit = + let sanitize_quotes = Re.compile (Re.char '"') in Format.fprintf fmt "@[[%a]@]" (Format.pp_print_list ~pp_sep:(fun fmt () -> Format.fprintf fmt ";@ ") - (fun fmt info -> Format.fprintf fmt "\"%s\"" info)) + (fun fmt info -> + Format.fprintf fmt "\"%s\"" + (Re.replace sanitize_quotes ~f:(fun _ -> "\\\"") info))) uids -let format_unop (fmt : Format.formatter) (op : Dcalc.Ast.unop Pos.marked) : unit +let format_unop (fmt : Format.formatter) (op : Dcalc.Ast.unop Marked.pos) : unit = - match Pos.unmark op with + match Marked.unmark op with | Minus k -> Format.fprintf fmt "~-%a" format_op_kind k | Not -> Format.fprintf fmt "%s" "not" | Log (_entry, _infos) -> - Errors.raise_spanned_error (Pos.get_position op) + Errors.raise_spanned_error (Marked.get_mark op) "Internal error: a log operator has not been caught by the expression \ match" | Length -> Format.fprintf fmt "%s" "array_length" | IntToRat -> Format.fprintf fmt "%s" "decimal_of_integer" + | MoneyToRat -> Format.fprintf fmt "%s" "decimal_of_money" + | RatToMoney -> Format.fprintf fmt "%s" "money_of_decimal" | GetDay -> Format.fprintf fmt "%s" "day_of_month_of_date" | GetMonth -> Format.fprintf fmt "%s" "month_number_of_date" | GetYear -> Format.fprintf fmt "%s" "year_of_date" + | FirstDayOfMonth -> Format.fprintf fmt "%s" "first_day_of_month" + | LastDayOfMonth -> Format.fprintf fmt "%s" "last_day_of_month" | RoundMoney -> Format.fprintf fmt "%s" "money_round" | RoundDecimal -> Format.fprintf fmt "%s" "decimal_round" let avoid_keywords (s : string) : string = - if - match s with - (* list taken from - http://caml.inria.fr/pub/docs/manual-ocaml/lex.html#sss:keywords *) - | "and" | "as" | "assert" | "asr" | "begin" | "class" | "constraint" | "do" - | "done" | "downto" | "else" | "end" | "exception" | "external" | "false" - | "for" | "fun" | "function" | "functor" | "if" | "in" | "include" - | "inherit" | "initializer" | "land" | "lazy" | "let" | "lor" | "lsl" - | "lsr" | "lxor" | "match" | "method" | "mod" | "module" | "mutable" | "new" - | "nonrec" | "object" | "of" | "open" | "or" | "private" | "rec" | "sig" - | "struct" | "then" | "to" | "true" | "try" | "type" | "val" | "virtual" - | "when" | "while" | "with" -> - true - | _ -> false - then s ^ "_" - else s + match s with + (* list taken from + http://caml.inria.fr/pub/docs/manual-ocaml/lex.html#sss:keywords *) + | "and" | "as" | "assert" | "asr" | "begin" | "class" | "constraint" | "do" + | "done" | "downto" | "else" | "end" | "exception" | "external" | "false" + | "for" | "fun" | "function" | "functor" | "if" | "in" | "include" | "inherit" + | "initializer" | "land" | "lazy" | "let" | "lor" | "lsl" | "lsr" | "lxor" + | "match" | "method" | "mod" | "module" | "mutable" | "new" | "nonrec" + | "object" | "of" | "open" | "or" | "private" | "rec" | "sig" | "struct" + | "then" | "to" | "true" | "try" | "type" | "val" | "virtual" | "when" + | "while" | "with" -> + s ^ "_user" + | _ -> s let format_struct_name (fmt : Format.formatter) (v : Dcalc.Ast.StructName.t) : - unit = -Format.asprintf "%a" Dcalc.Ast.StructName.format_t v -|> to_ascii -|> to_lowercase -|> avoid_keywords -|> Format.fprintf fmt "%s" -[@@ocamlformat "disable"] - -let format_to_struct_type (fmt : Format.formatter) (v : Dcalc.Ast.StructName.t) : unit = Format.asprintf "%a" Dcalc.Ast.StructName.format_t v |> to_ascii - |> to_lowercase + |> to_snake_case + |> avoid_keywords + |> Format.fprintf fmt "%s" + +let format_to_module_name + (fmt : Format.formatter) + (name : [< `Ename of D.EnumName.t | `Sname of D.StructName.t ]) = + (match name with + | `Ename v -> Format.asprintf "%a" D.EnumName.format_t v + | `Sname v -> Format.asprintf "%a" D.StructName.format_t v) + |> to_ascii + |> to_snake_case |> avoid_keywords |> String.split_on_char '_' |> List.map String.capitalize_ascii |> String.concat "" |> Format.fprintf fmt "%s" - [@@ocamlformat "disable"] let format_struct_field_name (fmt : Format.formatter) ((sname_opt, v) : Dcalc.Ast.StructName.t option * Dcalc.Ast.StructFieldName.t) : unit = (match sname_opt with - | Some sname -> Format.fprintf fmt "%a.%s" format_to_struct_type sname + | Some sname -> + Format.fprintf fmt "%a.%s" format_to_module_name (`Sname sname) | None -> Format.fprintf fmt "%s") (avoid_keywords (to_ascii (Format.asprintf "%a" Dcalc.Ast.StructFieldName.format_t v))) @@ -177,7 +182,7 @@ let format_enum_name (fmt : Format.formatter) (v : Dcalc.Ast.EnumName.t) : unit = Format.fprintf fmt "%s" (avoid_keywords - (to_lowercase + (to_snake_case (to_ascii (Format.asprintf "%a" Dcalc.Ast.EnumName.format_t v)))) let format_enum_cons_name @@ -187,9 +192,9 @@ let format_enum_cons_name (avoid_keywords (to_ascii (Format.asprintf "%a" Dcalc.Ast.EnumConstructor.format_t v))) -let rec typ_embedding_name (fmt : Format.formatter) (ty : D.typ Pos.marked) : +let rec typ_embedding_name (fmt : Format.formatter) (ty : D.typ Marked.pos) : unit = - match Pos.unmark ty with + match Marked.unmark ty with | D.TLit D.TUnit -> Format.fprintf fmt "embed_unit" | D.TLit D.TBool -> Format.fprintf fmt "embed_bool" | D.TLit D.TInt -> Format.fprintf fmt "embed_integer" @@ -203,19 +208,18 @@ let rec typ_embedding_name (fmt : Format.formatter) (ty : D.typ Pos.marked) : | D.TArray ty -> Format.fprintf fmt "embed_array (%a)" typ_embedding_name ty | _ -> Format.fprintf fmt "unembeddable" -let typ_needs_parens (e : Dcalc.Ast.typ Pos.marked) : bool = - match Pos.unmark e with TArrow _ | TArray _ -> true | _ -> false +let typ_needs_parens (e : Dcalc.Ast.typ Marked.pos) : bool = + match Marked.unmark e with TArrow _ | TArray _ -> true | _ -> false -let rec format_typ (fmt : Format.formatter) (typ : Dcalc.Ast.typ Pos.marked) : +let rec format_typ (fmt : Format.formatter) (typ : Dcalc.Ast.typ Marked.pos) : unit = - let format_typ = format_typ in let format_typ_with_parens (fmt : Format.formatter) - (t : Dcalc.Ast.typ Pos.marked) = + (t : Dcalc.Ast.typ Marked.pos) = if typ_needs_parens t then Format.fprintf fmt "(%a)" format_typ t else Format.fprintf fmt "%a" format_typ t in - match Pos.unmark typ with + match Marked.unmark typ with | TLit l -> Format.fprintf fmt "%a" Dcalc.Print.format_tlit l | TTuple (ts, None) -> Format.fprintf fmt "@[(%a)@]" @@ -223,23 +227,24 @@ let rec format_typ (fmt : Format.formatter) (typ : Dcalc.Ast.typ Pos.marked) : ~pp_sep:(fun fmt () -> Format.fprintf fmt "@ *@ ") format_typ_with_parens) ts - | TTuple (_, Some s) -> Format.fprintf fmt "%a.t" format_to_struct_type s + | TTuple (_, Some s) -> + Format.fprintf fmt "%a.t" format_to_module_name (`Sname s) | TEnum ([t], e) when D.EnumName.compare e Ast.option_enum = 0 -> Format.fprintf fmt "@[(%a)@] %a" format_typ_with_parens t format_enum_name e | TEnum (_, e) when D.EnumName.compare e Ast.option_enum = 0 -> - Errors.raise_spanned_error (Pos.get_position typ) + Errors.raise_spanned_error (Marked.get_mark typ) "Internal Error: found an typing parameter for an eoption type of the \ - wrong lenght." - | TEnum (_ts, e) -> Format.fprintf fmt "%a" format_enum_name e + wrong length." + | TEnum (_ts, e) -> Format.fprintf fmt "%a.t" format_to_module_name (`Ename e) | TArrow (t1, t2) -> Format.fprintf fmt "@[%a ->@ %a@]" format_typ_with_parens t1 format_typ_with_parens t2 | TArray t1 -> Format.fprintf fmt "@[%a@ array@]" format_typ_with_parens t1 | TAny -> Format.fprintf fmt "_" -let format_var (fmt : Format.formatter) (v : Var.t) : unit = - let lowercase_name = to_lowercase (to_ascii (Bindlib.name_of v)) in +let format_var (fmt : Format.formatter) (v : 'm var) : unit = + let lowercase_name = to_snake_case (to_ascii (Bindlib.name_of v)) in let lowercase_name = Re.Pcre.substitute ~rex:(Re.Pcre.regexp "\\.") ~subst:(fun _ -> "_dot_") @@ -248,26 +253,35 @@ let format_var (fmt : Format.formatter) (v : Var.t) : unit = let lowercase_name = avoid_keywords (to_ascii lowercase_name) in if List.mem lowercase_name ["handle_default"; "handle_default_opt"] - || Dcalc.Print.begins_with_uppercase (Bindlib.name_of v) + || begins_with_uppercase (Bindlib.name_of v) then Format.fprintf fmt "%s" lowercase_name else if lowercase_name = "_" then Format.fprintf fmt "%s" lowercase_name - else Format.fprintf fmt "%s_" lowercase_name + else ( + Cli.debug_print "lowercase_name: %s " lowercase_name; + Format.fprintf fmt "%s_" lowercase_name) -let needs_parens (e : expr Pos.marked) : bool = - match Pos.unmark e with +let needs_parens (e : 'm marked_expr) : bool = + match Marked.unmark e with | EApp ((EAbs (_, _), _), _) | ELit (LBool _ | LUnit) | EVar _ | ETuple _ | EOp _ -> false | _ -> true -let format_exception (fmt : Format.formatter) (exc : except Pos.marked) : unit = - match Pos.unmark exc with - | ConflictError -> Format.fprintf fmt "ConflictError" +let format_exception (fmt : Format.formatter) (exc : except Marked.pos) : unit = + match Marked.unmark exc with + | ConflictError -> + let pos = Marked.get_mark exc in + Format.fprintf fmt + "(ConflictError@ @[{filename = \"%s\";@ start_line=%d;@ \ + start_column=%d;@ end_line=%d; end_column=%d;@ law_headings=%a}@])" + (Pos.get_file pos) (Pos.get_start_line pos) (Pos.get_start_column pos) + (Pos.get_end_line pos) (Pos.get_end_column pos) format_string_list + (Pos.get_law_info pos) | EmptyError -> Format.fprintf fmt "EmptyError" | Crash -> Format.fprintf fmt "Crash" | NoValueProvided -> - let pos = Pos.get_position exc in + let pos = Marked.get_mark exc in Format.fprintf fmt "(NoValueProvided@ @[{filename = \"%s\";@ start_line=%d;@ \ start_column=%d;@ end_line=%d; end_column=%d;@ law_headings=%a}@])" @@ -278,14 +292,14 @@ let format_exception (fmt : Format.formatter) (exc : except Pos.marked) : unit = let rec format_expr (ctx : Dcalc.Ast.decl_ctx) (fmt : Format.formatter) - (e : expr Pos.marked) : unit = + (e : 'm marked_expr) : unit = let format_expr = format_expr ctx in - let format_with_parens (fmt : Format.formatter) (e : expr Pos.marked) = + let format_with_parens (fmt : Format.formatter) (e : 'm marked_expr) = if needs_parens e then Format.fprintf fmt "(%a)" format_expr e else Format.fprintf fmt "%a" format_expr e in - match Pos.unmark e with - | EVar v -> Format.fprintf fmt "%a" format_var (Pos.unmark v) + match Marked.unmark e with + | EVar v -> Format.fprintf fmt "%a" format_var v | ETuple (es, None) -> Format.fprintf fmt "@[(%a)@]" (Format.pp_print_list @@ -321,20 +335,23 @@ let rec format_expr Format.fprintf fmt "%a.%a" format_with_parens e1 format_struct_field_name (Some s, fst (List.nth (find_struct s ctx) n))) | EInj (e, n, en, _ts) -> - Format.fprintf fmt "@[%a@ %a@]" format_enum_cons_name + Format.fprintf fmt "@[%a.%a@ %a@]" format_to_module_name (`Ename en) + format_enum_cons_name (fst (List.nth (find_enum en ctx) n)) format_with_parens e | EMatch (e, es, e_name) -> - Format.fprintf fmt "@[match@ %a@]@ with@\n%a" format_with_parens e + Format.fprintf fmt "@[@[match@ %a@]@ with@\n| %a@]" + format_with_parens e (Format.pp_print_list - ~pp_sep:(fun fmt () -> Format.fprintf fmt "@\n| ") + ~pp_sep:(fun fmt () -> Format.fprintf fmt "@ | ") (fun fmt (e, c) -> - Format.fprintf fmt "%a %a" format_enum_cons_name c + Format.fprintf fmt "@[%a.%a %a@]" format_to_module_name + (`Ename e_name) format_enum_cons_name c (fun fmt e -> - match Pos.unmark e with - | EAbs ((binder, _), _) -> + match Marked.unmark e with + | EAbs (binder, _) -> let xs, body = Bindlib.unmbind binder in - Format.fprintf fmt "%a ->@[@ %a@]" + Format.fprintf fmt "%a ->@ %a" (Format.pp_print_list ~pp_sep:(fun fmt () -> Format.fprintf fmt "@,") (fun fmt x -> Format.fprintf fmt "%a" format_var x)) @@ -343,8 +360,8 @@ let rec format_expr (* should not happen *)) e)) (List.combine es (List.map fst (find_enum e_name ctx))) - | ELit l -> Format.fprintf fmt "%a" format_lit (Pos.same_pos_as l e) - | EApp ((EAbs ((binder, _), taus), _), args) -> + | ELit l -> Format.fprintf fmt "%a" format_lit (Marked.mark (D.pos e) l) + | EApp ((EAbs (binder, taus), _), args) -> let xs, body = Bindlib.unmbind binder in let xs_tau = List.map2 (fun x tau -> x, tau) (Array.to_list xs) taus in let xs_tau_arg = List.map2 (fun (x, tau) arg -> x, tau, arg) xs_tau args in @@ -355,7 +372,7 @@ let rec format_expr Format.fprintf fmt "@[let@ %a@ :@ %a@ =@ %a@]@ in@\n" format_var x format_typ tau format_with_parens arg)) xs_tau_arg format_with_parens body - | EAbs ((binder, _), taus) -> + | EAbs (binder, taus) -> let xs, body = Bindlib.unmbind binder in let xs_tau = List.map2 (fun x tau -> x, tau) (Array.to_list xs) taus in Format.fprintf fmt "@[fun@ %a ->@ %a@]" @@ -380,8 +397,9 @@ let rec format_expr 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 - | EApp ((EOp (Unop (D.Log (D.PosRecordIfTrueBool, _))), pos), [arg1]) + | EApp ((EOp (Unop (D.Log (D.PosRecordIfTrueBool, _))), m), [arg1]) when !Cli.trace_flag -> + let pos = D.mark_pos m in Format.fprintf fmt "(log_decision_taken@ @[{filename = \"%s\";@ start_line=%d;@ \ start_column=%d;@ end_line=%d; end_column=%d;@ law_headings=%a}@]@ %a)" @@ -397,6 +415,24 @@ let rec format_expr | EApp ((EOp (Unop op), _), [arg1]) -> Format.fprintf fmt "@[%a@ %a@]" format_unop (op, Pos.no_pos) format_with_parens arg1 + | EApp ((EVar x, pos), args) + when Ast.Var.compare (Ast.Var.t x) Ast.handle_default = 0 + || Ast.Var.compare (Ast.Var.t x) Ast.handle_default_opt = 0 -> + Format.fprintf fmt + "@[%a@ @[{filename = \"%s\";@ start_line=%d;@ \ + start_column=%d;@ end_line=%d; end_column=%d;@ law_headings=%a}@]@ %a@]" + format_var x + (Pos.get_file (D.mark_pos pos)) + (Pos.get_start_line (D.mark_pos pos)) + (Pos.get_start_column (D.mark_pos pos)) + (Pos.get_end_line (D.mark_pos pos)) + (Pos.get_end_column (D.mark_pos pos)) + format_string_list + (Pos.get_law_info (D.mark_pos pos)) + (Format.pp_print_list + ~pp_sep:(fun fmt () -> Format.fprintf fmt "@ ") + format_with_parens) + args | EApp (f, args) -> Format.fprintf fmt "@[%a@ %a@]" format_with_parens f (Format.pp_print_list @@ -412,29 +448,38 @@ let rec format_expr | EOp (Unop op) -> Format.fprintf fmt "%a" format_unop (op, Pos.no_pos) | EAssert e' -> Format.fprintf fmt - "@[if @ %a@ then@ ()@ else@ raise AssertionFailed@]" + "@[if@ %a@ then@ ()@ else@ raise (AssertionFailed @[{filename = \"%s\";@ start_line=%d;@ start_column=%d;@ end_line=%d; \ + end_column=%d;@ law_headings=%a}@])@]" format_with_parens e' - | ERaise exc -> - Format.fprintf fmt "raise@ %a" format_exception (exc, Pos.get_position e) + (Pos.get_file (D.pos e')) + (Pos.get_start_line (D.pos e')) + (Pos.get_start_column (D.pos e')) + (Pos.get_end_line (D.pos e')) + (Pos.get_end_column (D.pos e')) + format_string_list + (Pos.get_law_info (D.pos e')) + | ERaise exc -> Format.fprintf fmt "raise@ %a" format_exception (exc, D.pos e) | ECatch (e1, exc, e2) -> - Format.fprintf fmt "@[try@ %a@ with@ %a@ ->@ %a@]" format_with_parens - e1 format_exception - (exc, Pos.get_position e) + Format.fprintf fmt + "@,@[@[try@ %a@]@ with@]@ @[%a@ ->@ %a@]" + format_with_parens e1 format_exception + (exc, D.pos e) format_with_parens e2 let format_struct_embedding (fmt : Format.formatter) ((struct_name, struct_fields) : - D.StructName.t * (D.StructFieldName.t * D.typ Pos.marked) list) = + D.StructName.t * (D.StructFieldName.t * D.typ Marked.pos) list) = if List.length struct_fields = 0 then Format.fprintf fmt "let embed_%a (_: %a.t) : runtime_value = Unit@\n@\n" - format_struct_name struct_name format_to_struct_type struct_name + format_struct_name struct_name format_to_module_name (`Sname struct_name) else Format.fprintf fmt "@[let embed_%a (x: %a.t) : runtime_value =@ Struct([\"%a\"],@ \ @[[%a]@])@]@\n\ @\n" - format_struct_name struct_name format_to_struct_type struct_name + format_struct_name struct_name format_to_module_name (`Sname struct_name) D.StructName.format_t struct_name (Format.pp_print_list ~pp_sep:(fun fmt () -> Format.fprintf fmt ";@\n") @@ -448,17 +493,17 @@ let format_struct_embedding let format_enum_embedding (fmt : Format.formatter) ((enum_name, enum_cases) : - D.EnumName.t * (D.EnumConstructor.t * D.typ Pos.marked) list) = + D.EnumName.t * (D.EnumConstructor.t * D.typ Marked.pos) list) = if List.length enum_cases = 0 then - Format.fprintf fmt "let embed_%a (_: %a) : runtime_value = Unit@\n@\n" - format_enum_name enum_name format_enum_name enum_name + Format.fprintf fmt "let embed_%a (_: %a.t) : runtime_value = Unit@\n@\n" + format_to_module_name (`Ename enum_name) format_enum_name enum_name else Format.fprintf fmt - "@[let embed_%a (x: %a) : runtime_value =@ Enum([\"%a\"],@ @[match x with@ %a@])@]@\n\ + "@[@[let embed_%a@ @[(x:@ %a.t)@]@ : runtime_value \ + =@]@ Enum([\"%a\"],@ @[match x with@ %a@])@]@\n\ @\n" - format_enum_name enum_name format_enum_name enum_name D.EnumName.format_t - enum_name + format_enum_name enum_name format_to_module_name (`Ename enum_name) + D.EnumName.format_t enum_name (Format.pp_print_list ~pp_sep:(fun fmt () -> Format.fprintf fmt "@\n") (fun _fmt (enum_cons, enum_cons_type) -> @@ -474,37 +519,33 @@ let format_ctx let format_struct_decl fmt (struct_name, struct_fields) = if List.length struct_fields = 0 then Format.fprintf fmt - "module %a = struct@\n@[@ type t = unit\nend@] @\n" - format_to_struct_type struct_name + "@[module %a = struct@\n@[type t = unit@]@]@\nend@\n" + format_to_module_name (`Sname struct_name) else Format.fprintf fmt - "module %a = struct@\n\ - @[@ type t = {@\n\ - @[ %a@]@\n\ - }\n\ - end@]@\n" - format_to_struct_type struct_name + "@[@[module %a = struct@ @[type t = {@,\ + %a@;\ + <0-2>}@]@]@ end@]@\n" + format_to_module_name (`Sname struct_name) (Format.pp_print_list - ~pp_sep:(fun fmt () -> Format.fprintf fmt "@\n") + ~pp_sep:(fun fmt () -> Format.fprintf fmt ";@ ") (fun _fmt (struct_field, struct_field_type) -> - Format.fprintf fmt "%a:@ %a;" format_struct_field_name + Format.fprintf fmt "@[%a:@ %a@]" format_struct_field_name (None, struct_field) format_typ struct_field_type)) struct_fields; if !Cli.trace_flag then format_struct_embedding fmt (struct_name, struct_fields) in let format_enum_decl fmt (enum_name, enum_cons) = - if List.length enum_cons = 0 then - Format.fprintf fmt "type %a = unit@\n@\n" format_enum_name enum_name - else - Format.fprintf fmt "type %a =@\n@[ %a@]@\n@\n" format_enum_name - enum_name - (Format.pp_print_list - ~pp_sep:(fun fmt () -> Format.fprintf fmt "@\n") - (fun _fmt (enum_cons, enum_cons_type) -> - Format.fprintf fmt "| %a@ of@ %a" format_enum_cons_name enum_cons - format_typ enum_cons_type)) - enum_cons; + Format.fprintf fmt + "module %a = struct@\n@[@ type t =@\n@[ %a@]@\nend@]@\n" + format_to_module_name (`Ename enum_name) + (Format.pp_print_list + ~pp_sep:(fun fmt () -> Format.fprintf fmt "@\n") + (fun _fmt (enum_cons, enum_cons_type) -> + Format.fprintf fmt "@[| %a@ of@ %a@]" format_enum_cons_name + enum_cons format_typ enum_cons_type)) + enum_cons; if !Cli.trace_flag then format_enum_embedding fmt (enum_name, enum_cons) in let is_in_type_ordering s = @@ -535,7 +576,7 @@ let format_ctx let rec format_scope_body_expr (ctx : Dcalc.Ast.decl_ctx) (fmt : Format.formatter) - (scope_lets : Ast.expr Dcalc.Ast.scope_body_expr) : unit = + (scope_lets : ('m Ast.expr, 'm) Dcalc.Ast.scope_body_expr) : unit = match scope_lets with | Dcalc.Ast.Result e -> format_expr ctx fmt e | Dcalc.Ast.ScopeLet scope_let -> @@ -551,7 +592,7 @@ let rec format_scope_body_expr let rec format_scopes (ctx : Dcalc.Ast.decl_ctx) (fmt : Format.formatter) - (scopes : Ast.expr Dcalc.Ast.scopes) : unit = + (scopes : ('m Ast.expr, 'm) Dcalc.Ast.scopes) : unit = match scopes with | Dcalc.Ast.Nil -> () | Dcalc.Ast.ScopeDef scope_def -> @@ -560,23 +601,27 @@ let rec format_scopes in let scope_var, scope_next = Bindlib.unbind scope_def.scope_next in Format.fprintf fmt "@\n@\n@[let %a (%a: %a.t) : %a.t =@\n%a@]%a" - format_var scope_var format_var scope_input_var format_to_struct_type - scope_def.scope_body.scope_body_input_struct format_to_struct_type - scope_def.scope_body.scope_body_output_struct + format_var scope_var format_var scope_input_var format_to_module_name + (`Sname scope_def.scope_body.scope_body_input_struct) + format_to_module_name + (`Sname scope_def.scope_body.scope_body_output_struct) (format_scope_body_expr ctx) scope_body_expr (format_scopes ctx) scope_next let format_program (fmt : Format.formatter) - (p : Ast.program) + (p : 'm Ast.program) (type_ordering : Scopelang.Dependency.TVertex.t list) : unit = - Cli.style_flag := false; - Format.fprintf fmt - "(** This file has been generated by the Catala compiler, do not edit! *)@\n\ - @\n\ - open Runtime@\n\ - @\n\ - [@@@@@@ocaml.warning \"-4-26-27-32-41-42\"]@\n\ - @\n\ - %a%a@?" - (format_ctx type_ordering) p.decl_ctx (format_scopes p.decl_ctx) p.scopes + Cli.call_unstyled (fun _ -> + Format.fprintf fmt + "(** This file has been generated by the Catala compiler, do not edit! \ + *)@\n\ + @\n\ + open Runtime_ocaml.Runtime@\n\ + @\n\ + [@@@@@@ocaml.warning \"-4-26-27-32-41-42\"]@\n\ + @\n\ + %a%a@\n\ + @?" + (format_ctx type_ordering) p.decl_ctx (format_scopes p.decl_ctx) + p.scopes) diff --git a/compiler/lcalc/to_ocaml.mli b/compiler/lcalc/to_ocaml.mli index f9e22f03..f64ca373 100644 --- a/compiler/lcalc/to_ocaml.mli +++ b/compiler/lcalc/to_ocaml.mli @@ -14,8 +14,49 @@ License for the specific language governing permissions and limitations under the License. *) +open Utils +open Ast + (** Formats a lambda calculus program into a valid OCaml program *) +val avoid_keywords : string -> string + +val find_struct : + Dcalc.Ast.StructName.t -> + Dcalc.Ast.decl_ctx -> + (Dcalc.Ast.StructFieldName.t * Dcalc.Ast.typ Marked.pos) list + +val find_enum : + Dcalc.Ast.EnumName.t -> + Dcalc.Ast.decl_ctx -> + (Dcalc.Ast.EnumConstructor.t * Dcalc.Ast.typ Marked.pos) list + +val typ_needs_parens : Dcalc.Ast.typ Marked.pos -> bool +val needs_parens : 'm marked_expr -> bool +val format_enum_name : Format.formatter -> Dcalc.Ast.EnumName.t -> unit + +val format_enum_cons_name : + Format.formatter -> Dcalc.Ast.EnumConstructor.t -> unit + +val format_struct_name : Format.formatter -> Dcalc.Ast.StructName.t -> unit + +val format_struct_field_name : + Format.formatter -> + Dcalc.Ast.StructName.t option * Dcalc.Ast.StructFieldName.t -> + unit + +val format_to_module_name : + Format.formatter -> + [< `Ename of Dcalc.Ast.EnumName.t | `Sname of Dcalc.Ast.StructName.t ] -> + unit + +val format_lit : Format.formatter -> lit Marked.pos -> unit +val format_uid_list : Format.formatter -> Uid.MarkedString.info list -> unit +val format_var : Format.formatter -> 'm var -> unit + val format_program : - Format.formatter -> Ast.program -> Scopelang.Dependency.TVertex.t list -> unit + Format.formatter -> + 'm Ast.program -> + Scopelang.Dependency.TVertex.t list -> + unit (** Usage [format_program fmt p type_dependencies_ordering] *) diff --git a/compiler/literate/dune b/compiler/literate/dune index 7a7de45b..70ed9a39 100644 --- a/compiler/literate/dune +++ b/compiler/literate/dune @@ -1,7 +1,7 @@ (library (name literate) (public_name catala.literate) - (libraries re utils surface)) + (libraries re utils surface ubase)) (documentation (package catala) diff --git a/compiler/literate/html.ml b/compiler/literate/html.ml index 30f2372e..2e87baa5 100644 --- a/compiler/literate/html.ml +++ b/compiler/literate/html.ml @@ -114,14 +114,14 @@ let wrap_html (** Performs syntax highlighting on a piece of code by using Pygments and the special Catala lexer. *) -let pygmentize_code (c : string Pos.marked) (language : C.backend_lang) : string +let pygmentize_code (c : string Marked.pos) (language : C.backend_lang) : string = C.debug_print "Pygmenting the code chunk %s" - (Pos.to_string (Pos.get_position c)); + (Pos.to_string (Marked.get_mark c)); let temp_file_in = Filename.temp_file "catala_html_pygments" "in" in let temp_file_out = Filename.temp_file "catala_html_pygments" "out" in let oc = open_out temp_file_in in - Printf.fprintf oc "%s" (Pos.unmark c); + Printf.fprintf oc "%s" (Marked.unmark c); close_out oc; let pygments = "pygmentize" in let pygments_lexer = get_language_extension language in @@ -133,9 +133,9 @@ let pygmentize_code (c : string Pos.marked) (language : C.backend_lang) : string "html"; "-O"; "style=colorful,anchorlinenos=True,lineanchors=\"" - ^ Pos.get_file (Pos.get_position c) + ^ String_common.to_ascii (Pos.get_file (Marked.get_mark c)) ^ "\",linenos=table,linenostart=" - ^ string_of_int (Pos.get_start_line (Pos.get_position c) - 1); + ^ string_of_int (Pos.get_start_line (Marked.get_mark c) - 1); "-o"; temp_file_out; temp_file_in; @@ -158,9 +158,15 @@ let pygmentize_code (c : string Pos.marked) (language : C.backend_lang) : string (** {1 Weaving} *) +let sanitize_html_href str = + str + |> String_common.to_ascii + |> R.substitute ~rex:(R.regexp "[' '°]") ~subst:(function _ -> "%20") + let rec law_structure_to_html (language : C.backend_lang) (print_only_law : bool) + (parents_headings : string list) (fmt : Format.formatter) (i : A.law_structure) : unit = match i with @@ -171,30 +177,83 @@ let rec law_structure_to_html Format.fprintf fmt "
\n
%s
\n%s\n
" (if metadata then " code-metadata" else "") - (Pos.get_file (Pos.get_position c)) + (Pos.get_file (Marked.get_mark c)) (pygmentize_code - (Pos.same_pos_as ("```catala\n" ^ Pos.unmark c ^ "```") c) + (Marked.same_mark_as ("```catala\n" ^ Marked.unmark c ^ "```") c) language) | A.CodeBlock _ -> () | A.LawHeading (heading, children) -> let h_number = heading.law_heading_precedence + 1 in - Format.fprintf fmt "%s\n" - h_number + let is_a_section_to_collapse = + (* Only 2 depth sections are collasped in a
tag. Indeed, this + allow to significantly reduce rendering time (~= 100x for the + [aides_logement] example in the catala-website), while remaining + practicable. *) + h_number = 2 + in + let h_name = Marked.unmark heading.law_heading_name in + let complete_headings = parents_headings @ [h_name] in + let id = complete_headings |> String.concat "-" |> sanitize_html_href in + let fmt_details_open fmt () = + if is_a_section_to_collapse then + Format.fprintf fmt "
%s" h_name + in + let fmt_details_close fmt () = + if is_a_section_to_collapse then Format.fprintf fmt "
" + in + Format.fprintf fmt + "%s%s@\n\ + %a\n\ + %a\n\ + %a" + h_number id id h_name (match heading.law_heading_id, language with | Some id, Fr -> let ltime = Unix.localtime (Unix.time ()) in - P.sprintf "https://legifrance.gouv.fr/codes/id/%s/%d-%02d-%02d" id + P.sprintf + "Voir le texte sur Légifrance.gouv.fr" + id (1900 + ltime.Unix.tm_year) (ltime.Unix.tm_mon + 1) ltime.Unix.tm_mday - | _ -> "#") - (pre_html (Pos.unmark heading.law_heading_name)) - h_number; - Format.pp_print_list - ~pp_sep:(fun fmt () -> Format.fprintf fmt "\n") - (law_structure_to_html language print_only_law) - fmt children + | _ -> "") + h_number fmt_details_open () + (Format.pp_print_list + ~pp_sep:(fun fmt () -> Format.fprintf fmt "\n") + (law_structure_to_html language print_only_law complete_headings)) + children fmt_details_close () | A.LawInclude _ -> () +let rec fmt_toc + (parents_headings : string list) + fmt + (items : A.law_structure list) = + Format.fprintf fmt "@[
    @\n%a@\n@]
" + (List.length parents_headings) + (Format.pp_print_list + ~pp_sep:(fun fmt () -> Format.fprintf fmt "@\n") + (fun fmt item -> + match item with + | A.LawHeading (heading, childs) -> + let h_name = Marked.unmark heading.law_heading_name in + let complete_headings = parents_headings @ [h_name] in + let id = + complete_headings |> String.concat "-" |> sanitize_html_href + in + Format.fprintf fmt + "@[
  • @\n\ + @[
    @\n\ + %s@\n\ + %a@\n\ + @]
    @\n\ + @]
  • " + id h_name + (fmt_toc complete_headings) + childs + | _ -> ())) + (items |> List.filter (function A.LawHeading (_, _) -> true | _ -> false)) + (** {1 API} *) let ast_to_html @@ -202,7 +261,23 @@ let ast_to_html ~(print_only_law : bool) (fmt : Format.formatter) (program : A.program) : unit = - Format.pp_print_list - ~pp_sep:(fun fmt () -> Format.fprintf fmt "\n\n") - (law_structure_to_html language print_only_law) - fmt program.program_items + let toc = + match language with + | C.Fr -> "Sommaire" + | C.En -> "Table of contents" + | C.Pl -> "Spis treści." + in + + Format.fprintf fmt + "@[
    @\n\ + %s@\n\ + %a@\n\ + @]
    \n\ + %a@\n" + toc (fmt_toc []) program.program_items + (Format.pp_print_list + ~pp_sep:(fun fmt () -> Format.fprintf fmt "\n\n") + (fun fmt -> + Format.fprintf fmt "%a" + (law_structure_to_html language print_only_law []))) + program.program_items diff --git a/compiler/literate/latex.ml b/compiler/literate/latex.ml index 58819029..d5f18435 100644 --- a/compiler/literate/latex.ml +++ b/compiler/literate/latex.ml @@ -182,9 +182,10 @@ let check_exceeding_lines (start_line : int) (filename : string) (content : string) = - content |> String.split_on_char '\n' + content + |> String.split_on_char '\n' |> List.iteri (fun i s -> - if CamomileLibrary.UTF8.length s > max_len then ( + if String.length s > max_len then ( Cli.warning_print "The line %s in %s is exceeding %s characters:" (Cli.with_style ANSITerminal.[Bold; yellow] @@ -216,7 +217,7 @@ let rec law_structure_to_latex | 6 -> "subsubsubsubsubsubsection" | 7 -> "paragraph" | _ -> "subparagraph") - (pre_latexify (Pos.unmark heading.law_heading_name)); + (pre_latexify (Marked.unmark heading.law_heading_name)); Format.pp_print_list ~pp_sep:(fun fmt () -> Format.fprintf fmt "\n\n") (law_structure_to_latex language print_only_law) @@ -241,10 +242,10 @@ let rec law_structure_to_latex ```catala\n\ %s```\n\ \\end{minted}" - (pre_latexify (Filename.basename (Pos.get_file (Pos.get_position c)))) - (Pos.get_start_line (Pos.get_position c) - 1) + (pre_latexify (Filename.basename (Pos.get_file (Marked.get_mark c)))) + (Pos.get_start_line (Marked.get_mark c) - 1) (get_language_extension language) - (Pos.unmark c) + (Marked.unmark c) | A.CodeBlock (_, c, true) when not print_only_law -> let metadata_title = match language with @@ -252,9 +253,9 @@ let rec law_structure_to_latex | En -> "Metadata" | Pl -> "Metadane" in - let start_line = Pos.get_start_line (Pos.get_position c) - 1 in - let filename = Filename.basename (Pos.get_file (Pos.get_position c)) in - let block_content = Pos.unmark c in + let start_line = Pos.get_start_line (Marked.get_mark c) - 1 in + let filename = Filename.basename (Pos.get_file (Marked.get_mark c)) in + let block_content = Marked.unmark c in check_exceeding_lines start_line filename block_content; Format.fprintf fmt "\\begin{tcolorbox}[colframe=OliveGreen, breakable, \ diff --git a/compiler/literate/literate_common.ml b/compiler/literate/literate_common.ml index 7f5f02f2..83cdf383 100644 --- a/compiler/literate/literate_common.ml +++ b/compiler/literate/literate_common.ml @@ -78,7 +78,8 @@ let run_pandoc (s : string) (backend : [ `Html | `Latex ]) : string = let pandoc_args = [| "-f"; - "markdown+multiline_tables"; + "markdown+multiline_tables+tex_math_dollars"; + "--mathjax"; "-t"; (match backend with `Html -> "html" | `Latex -> "latex"); "-o"; diff --git a/compiler/plugin.ml b/compiler/plugin.ml index 482f6936..9dfaf6f5 100644 --- a/compiler/plugin.ml +++ b/compiler/plugin.ml @@ -14,13 +14,23 @@ License for the specific language governing permissions and limitations under the License. *) +type 'ast plugin_apply_fun_typ = + source_file:Utils.Pos.input_file -> + output_file:string option -> + scope:string option -> + 'ast -> + Scopelang.Dependency.TVertex.t list -> + unit + type 'ast gen = { name : string; extension : string; - apply : string option -> 'ast -> Scopelang.Dependency.TVertex.t list -> unit; + apply : 'ast plugin_apply_fun_typ; } -type t = Lcalc of Lcalc.Ast.program gen | Scalc of Scalc.Ast.program gen +type t = + | Lcalc of Dcalc.Ast.untyped Lcalc.Ast.program gen + | Scalc of Scalc.Ast.program gen let name = function Lcalc { name; _ } | Scalc { name; _ } -> name let backend_plugins : (string, t) Hashtbl.t = Hashtbl.create 17 diff --git a/compiler/plugin.mli b/compiler/plugin.mli index 59ec7bed..0eb30c17 100644 --- a/compiler/plugin.mli +++ b/compiler/plugin.mli @@ -16,13 +16,23 @@ (** {2 catala-facing API} *) +type 'ast plugin_apply_fun_typ = + source_file:Utils.Pos.input_file -> + output_file:string option -> + scope:string option -> + 'ast -> + Scopelang.Dependency.TVertex.t list -> + unit + type 'ast gen = { name : string; extension : string; - apply : string option -> 'ast -> Scopelang.Dependency.TVertex.t list -> unit; + apply : 'ast plugin_apply_fun_typ; } -type t = Lcalc of Lcalc.Ast.program gen | Scalc of Scalc.Ast.program gen +type t = + | Lcalc of Dcalc.Ast.untyped Lcalc.Ast.program gen + | Scalc of Scalc.Ast.program gen val find : string -> t (** Find a registered plugin *) @@ -39,19 +49,13 @@ module PluginAPI : sig val register_lcalc : name:string -> extension:string -> - (string option -> - Lcalc.Ast.program -> - Scopelang.Dependency.TVertex.t list -> - unit) -> + Dcalc.Ast.untyped Lcalc.Ast.program plugin_apply_fun_typ -> unit val register_scalc : name:string -> extension:string -> - (string option -> - Scalc.Ast.program -> - Scopelang.Dependency.TVertex.t list -> - unit) -> + Scalc.Ast.program plugin_apply_fun_typ -> unit end diff --git a/compiler/plugins/api_web.ml b/compiler/plugins/api_web.ml new file mode 100644 index 00000000..ee9c784e --- /dev/null +++ b/compiler/plugins/api_web.ml @@ -0,0 +1,473 @@ +(* This file is part of the Catala compiler, a specification language for tax + and social benefits computation rules. Copyright (C) 2020 Inria, + contributors: Emile Rolley , Louis Gesbert + . + + Licensed under the Apache License, Version 2.0 (the "License"); you may not + use this file except in compliance with the License. You may obtain a copy of + the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + License for the specific language governing permissions and limitations under + the License. *) + +(** Catala plugin for generating web APIs. It generates OCaml code before the + the associated [js_of_ocaml] wrapper. *) + +open Utils +open String_common +open Lcalc +open Lcalc.Ast +open Lcalc.To_ocaml +module D = Dcalc.Ast + +let name = "api_web" +let extension = ".ml" + +(** Contains all format functions used to generating the [js_of_ocaml] wrapper + of the corresponding Catala program. *) +module To_jsoo = struct + let to_camel_case (s : string) : string = + String.split_on_char '_' s + |> (function + | hd :: tl -> hd :: List.map String.capitalize_ascii tl | l -> l) + |> String.concat "" + + let format_struct_field_name_camel_case + (fmt : Format.formatter) + (v : Dcalc.Ast.StructFieldName.t) : unit = + let s = + Format.asprintf "%a" Dcalc.Ast.StructFieldName.format_t v + |> to_ascii + |> to_snake_case + |> avoid_keywords + |> to_camel_case + in + Format.fprintf fmt "%s" s + + let format_tlit (fmt : Format.formatter) (l : Dcalc.Ast.typ_lit) : unit = + Dcalc.Print.format_base_type fmt + (match l with + | TUnit -> "unit" + | TInt -> "int" + | TRat | TMoney -> "Js.number Js.t" + | TDuration -> "Runtime_jsoo.Runtime.duration Js.t" + | TBool -> "bool Js.t" + | TDate -> "Js.js_string Js.t") + + let rec format_typ (fmt : Format.formatter) (typ : Dcalc.Ast.typ Marked.pos) : + unit = + let format_typ_with_parens + (fmt : Format.formatter) + (t : Dcalc.Ast.typ Marked.pos) = + if typ_needs_parens t then Format.fprintf fmt "(%a)" format_typ t + else Format.fprintf fmt "%a" format_typ t + in + match Marked.unmark typ with + | TLit l -> Format.fprintf fmt "%a" format_tlit l + | TTuple (_, Some s) -> Format.fprintf fmt "%a Js.t" format_struct_name s + | TTuple (_, None) -> + (* Tuples are encoded as an javascript polymorphic array. *) + Format.fprintf fmt "Js.Unsafe.any_js_array Js.t " + | TEnum ([t], e) when D.EnumName.compare e option_enum = 0 -> + Format.fprintf fmt "@[(%a)@] %a" format_typ_with_parens t + format_enum_name e + | TEnum (_, e) when D.EnumName.compare e option_enum = 0 -> + Errors.raise_spanned_error (Marked.get_mark typ) + "Internal Error: found an typing parameter for an eoption type of the \ + wrong length." + | TEnum (_, e) -> Format.fprintf fmt "%a Js.t" format_enum_name e + | TArray t1 -> + Format.fprintf fmt "@[%a@ Js.js_array Js.t@]" format_typ_with_parens t1 + | TAny -> Format.fprintf fmt "Js.Unsafe.any Js.t" + | TArrow (t1, t2) -> + Format.fprintf fmt "(@[%a, @ %a@]) Js.meth_callback" + format_typ_with_parens t1 format_typ_with_parens t2 + + let rec format_typ_to_jsoo fmt typ = + match Marked.unmark typ with + | Dcalc.Ast.TLit TBool -> Format.fprintf fmt "Js.bool" + | Dcalc.Ast.TLit TInt -> Format.fprintf fmt "integer_to_int" + | Dcalc.Ast.TLit TRat -> + Format.fprintf fmt "Js.number_of_float %@%@ decimal_to_float" + | Dcalc.Ast.TLit TMoney -> + Format.fprintf fmt "Js.number_of_float %@%@ money_to_float" + | Dcalc.Ast.TLit TDuration -> Format.fprintf fmt "duration_to_jsoo" + | Dcalc.Ast.TLit TDate -> Format.fprintf fmt "date_to_jsoo" + | Dcalc.Ast.TEnum (_, ename) -> + Format.fprintf fmt "%a_to_jsoo" format_enum_name ename + | Dcalc.Ast.TTuple (_, Some sname) -> + Format.fprintf fmt "%a_to_jsoo" format_struct_name sname + | Dcalc.Ast.TArray t -> + Format.fprintf fmt "Js.array %@%@ Array.map (fun x -> %a x)" + format_typ_to_jsoo t + | Dcalc.Ast.TAny | Dcalc.Ast.TTuple (_, None) -> + Format.fprintf fmt "Js.Unsafe.inject" + | _ -> Format.fprintf fmt "" + + let rec format_typ_of_jsoo fmt typ = + match Marked.unmark typ with + | Dcalc.Ast.TLit TBool -> Format.fprintf fmt "Js.to_bool" + | Dcalc.Ast.TLit TInt -> Format.fprintf fmt "integer_of_int" + | Dcalc.Ast.TLit TRat -> + Format.fprintf fmt "decimal_of_float %@%@ Js.float_of_number" + | Dcalc.Ast.TLit TMoney -> + Format.fprintf fmt + "money_of_decimal %@%@ decimal_of_float %@%@ Js.float_of_number" + | Dcalc.Ast.TLit TDuration -> Format.fprintf fmt "duration_of_jsoo" + | Dcalc.Ast.TLit TDate -> Format.fprintf fmt "date_of_jsoo" + | Dcalc.Ast.TEnum (_, ename) -> + Format.fprintf fmt "%a_of_jsoo" format_enum_name ename + | Dcalc.Ast.TTuple (_, Some sname) -> + Format.fprintf fmt "%a_of_jsoo" format_struct_name sname + | Dcalc.Ast.TArray t -> + Format.fprintf fmt "Array.map (fun x -> %a x) %@%@ Js.to_array" + format_typ_of_jsoo t + | _ -> Format.fprintf fmt "" + + let format_var_camel_case (fmt : Format.formatter) (v : 'm var) : unit = + let lowercase_name = + Bindlib.name_of v + |> to_ascii + |> to_snake_case + |> Re.Pcre.substitute ~rex:(Re.Pcre.regexp "\\.") ~subst:(fun _ -> + "_dot_") + |> to_ascii + |> avoid_keywords + |> to_camel_case + in + if + List.mem lowercase_name ["handle_default"; "handle_default_opt"] + || begins_with_uppercase (Bindlib.name_of v) + then Format.fprintf fmt "%s" lowercase_name + else if lowercase_name = "_" then Format.fprintf fmt "%s" lowercase_name + else Format.fprintf fmt "%s_" lowercase_name + + let format_ctx + (type_ordering : Scopelang.Dependency.TVertex.t list) + (fmt : Format.formatter) + (ctx : D.decl_ctx) : unit = + let format_prop_or_meth fmt (struct_field_type : D.typ Marked.pos) = + match Marked.unmark struct_field_type with + | Dcalc.Ast.TArrow _ -> Format.fprintf fmt "Js.meth" + | _ -> Format.fprintf fmt "Js.readonly_prop" + in + let format_struct_decl fmt (struct_name, struct_fields) = + let fmt_struct_name fmt _ = format_struct_name fmt struct_name in + let fmt_module_struct_name fmt _ = + To_ocaml.format_to_module_name fmt (`Sname struct_name) + in + let fmt_to_jsoo fmt _ = + Format.fprintf fmt "%a" + (Format.pp_print_list + ~pp_sep:(fun fmt () -> Format.fprintf fmt "@\n") + (fun fmt (struct_field, struct_field_type) -> + match Marked.unmark struct_field_type with + | Dcalc.Ast.TArrow (t1, t2) -> + Format.fprintf fmt + "@[method %a =@ Js.wrap_meth_callback@ @[(@,\ + fun input ->@ %a (%a.%a (%a input)))@]@]" + format_struct_field_name_camel_case struct_field + format_typ_to_jsoo t2 fmt_struct_name () + format_struct_field_name (None, struct_field) + format_typ_of_jsoo t1 + | _ -> + Format.fprintf fmt "@[val %a =@ %a %a.%a@]" + format_struct_field_name_camel_case struct_field + format_typ_to_jsoo struct_field_type fmt_struct_name () + format_struct_field_name (None, struct_field))) + struct_fields + in + let fmt_of_jsoo fmt _ = + Format.fprintf fmt "%a" + (Format.pp_print_list + ~pp_sep:(fun fmt () -> Format.fprintf fmt ";@\n") + (fun fmt (struct_field, struct_field_type) -> + match Marked.unmark struct_field_type with + | Dcalc.Ast.TArrow _ -> + Format.fprintf fmt + "%a = failwith \"The function '%a' translation isn't yet \ + supported...\"" + format_struct_field_name (None, struct_field) + format_struct_field_name (None, struct_field) + | _ -> + Format.fprintf fmt + "@[%a =@ @[%a@ @[%a@,##.%a@]@]@]" + format_struct_field_name (None, struct_field) + format_typ_of_jsoo struct_field_type fmt_struct_name () + format_struct_field_name_camel_case struct_field)) + struct_fields + in + let fmt_conv_funs fmt _ = + Format.fprintf fmt + "@[let %a_to_jsoo@ (%a@ : %a.t)@ : %a Js.t =@ @[object%%js@\n\ + %a@\n\ + @]@]end@\n\ + @[let %a_of_jsoo@ @[(%a@ : %a Js.t)@] :@ %a.t =@ \ + @[{@,\ + %a@]@\n\ + }@]" + fmt_struct_name () fmt_struct_name () fmt_module_struct_name () + fmt_struct_name () fmt_to_jsoo () fmt_struct_name () fmt_struct_name + () fmt_struct_name () fmt_module_struct_name () fmt_of_jsoo () + in + + if List.length struct_fields = 0 then + Format.fprintf fmt + "class type %a =@ object end@\n\ + let %a_to_jsoo (_ : %a.t) : %a Js.t = object%%js end@\n\ + let %a_of_jsoo (_ : %a Js.t) : %a.t = ()" fmt_struct_name () + fmt_struct_name () fmt_module_struct_name () fmt_struct_name () + fmt_struct_name () fmt_struct_name () fmt_module_struct_name () + else + Format.fprintf fmt + "@[class type %a =@ @[object@ %a@]@,end@\n%a@]@\n" + fmt_struct_name () + (Format.pp_print_list + ~pp_sep:(fun fmt () -> Format.fprintf fmt "@\n") + (fun fmt (struct_field, struct_field_type) -> + Format.fprintf fmt "@[method %a:@ %a %a@]" + format_struct_field_name_camel_case struct_field format_typ + struct_field_type format_prop_or_meth struct_field_type)) + struct_fields fmt_conv_funs () + in + let format_enum_decl + fmt + (enum_name, (enum_cons : (D.EnumConstructor.t * D.typ Marked.pos) list)) + = + let fmt_enum_name fmt _ = format_enum_name fmt enum_name in + let fmt_module_enum_name fmt _ = + To_ocaml.format_to_module_name fmt (`Ename enum_name) + in + let fmt_to_jsoo fmt _ = + Format.fprintf fmt "%a" + (Format.pp_print_list + ~pp_sep:(fun fmt () -> Format.fprintf fmt "@\n") + (fun fmt (cname, typ) -> + match Marked.unmark typ with + | Dcalc.Ast.TTuple (_, None) -> + Cli.error_print + "Tuples aren't supported yet in the conversion to JS" + | _ -> + Format.fprintf fmt + "@[@[| %a arg -> object%%js@\n\ + val kind = Js.string \"%a\"@\n\ + val payload = Js.Unsafe.coerce (Js.Unsafe.inject (%a \ + arg))@]@\n\ + end@]" + format_enum_cons_name cname format_enum_cons_name cname + format_typ_to_jsoo typ)) + enum_cons + in + let fmt_of_jsoo fmt _ = + Format.fprintf fmt + "@[match@ %a##.kind@ |> Js.to_string@ with@]@\n\ + @[%a@\n\ + @[| cons ->@ @[failwith@ @[(Printf.sprintf@ \ + \"Unexpected '%%s' kind for the enumeration '%a.t'\"@ cons)@]@]@]@]" + fmt_enum_name () + (Format.pp_print_list + ~pp_sep:(fun fmt () -> Format.fprintf fmt "@\n") + (fun fmt (cname, typ) -> + match Marked.unmark typ with + | Dcalc.Ast.TTuple (_, None) -> + Cli.error_print + "Tuples aren't yet supported in the conversion to JS..." + | Dcalc.Ast.TLit TUnit -> + Format.fprintf fmt "@[| \"%a\" ->@ %a.%a ()@]" + format_enum_cons_name cname fmt_module_enum_name () + format_enum_cons_name cname + | _ -> + Format.fprintf fmt + "| \"%a\" ->@\n%a.%a (%a (Js.Unsafe.coerce %a##.payload))" + format_enum_cons_name cname fmt_module_enum_name () + format_enum_cons_name cname format_typ_of_jsoo typ + fmt_enum_name ())) + enum_cons fmt_module_enum_name () + in + + let fmt_conv_funs fmt _ = + Format.fprintf fmt + "@[let %a_to_jsoo@ : %a.t -> %a Js.t@ = function@\n\ + %a@]@\n\ + @\n\ + @[let %a_of_jsoo@ @[(%a@ : %a Js.t)@]@ : %a.t =@ %a@]@\n" + fmt_enum_name () fmt_module_enum_name () fmt_enum_name () fmt_to_jsoo + () fmt_enum_name () fmt_enum_name () fmt_enum_name () + fmt_module_enum_name () fmt_of_jsoo () + in + Format.fprintf fmt + "@[class type %a =@ @[object@ @[method kind :@ \ + Js.js_string Js.t Js.readonly_prop@\n\ + @[(** Expects one of:@\n\ + %a *)@]@]@\n\ + @\n\ + @[method payload :@ Js.Unsafe.any Js.t Js.readonly_prop@]@]@\n\ + end@]@\n\ + @\n\ + %a@\n" + format_enum_name enum_name + (Format.pp_print_list + ~pp_sep:(fun fmt () -> Format.fprintf fmt "@\n") + (fun fmt (enum_cons, _) -> + Format.fprintf fmt "- \"%a\"" format_enum_cons_name enum_cons)) + enum_cons fmt_conv_funs () + in + let is_in_type_ordering s = + List.exists + (fun struct_or_enum -> + match struct_or_enum with + | Scopelang.Dependency.TVertex.Enum _ -> false + | Scopelang.Dependency.TVertex.Struct s' -> s = s') + type_ordering + in + let scope_structs = + List.map + (fun (s, _) -> Scopelang.Dependency.TVertex.Struct s) + (Dcalc.Ast.StructMap.bindings + (Dcalc.Ast.StructMap.filter + (fun s _ -> not (is_in_type_ordering s)) + ctx.ctx_structs)) + in + List.iter + (fun struct_or_enum -> + match struct_or_enum with + | Scopelang.Dependency.TVertex.Struct s -> + Format.fprintf fmt "%a@\n" format_struct_decl (s, find_struct s ctx) + | Scopelang.Dependency.TVertex.Enum e -> + Format.fprintf fmt "%a@\n" format_enum_decl (e, find_enum e ctx)) + (type_ordering @ scope_structs) + + let fmt_input_struct_name fmt (scope_def : ('a expr, 'm) D.scope_def) = + format_struct_name fmt scope_def.scope_body.scope_body_input_struct + + let fmt_output_struct_name fmt (scope_def : ('a expr, 'm) D.scope_def) = + format_struct_name fmt scope_def.scope_body.scope_body_output_struct + + let rec format_scopes_to_fun + (ctx : Dcalc.Ast.decl_ctx) + (fmt : Format.formatter) + (scopes : ('expr, 'm) Dcalc.Ast.scopes) = + match scopes with + | Dcalc.Ast.Nil -> () + | Dcalc.Ast.ScopeDef scope_def -> + let scope_var, scope_next = Bindlib.unbind scope_def.scope_next in + let fmt_fun_call fmt _ = + Format.fprintf fmt "@[%a@ |> %a_of_jsoo@ |> %a@ |> %a_to_jsoo@]" + fmt_input_struct_name scope_def fmt_input_struct_name scope_def + format_var scope_var fmt_output_struct_name scope_def + in + Format.fprintf fmt + "@\n@\n@[let %a@ (%a : %a Js.t)@ : %a Js.t =@\n%a@]@\n%a" + format_var scope_var fmt_input_struct_name scope_def + fmt_input_struct_name scope_def fmt_output_struct_name scope_def + fmt_fun_call () (format_scopes_to_fun ctx) scope_next + + let rec format_scopes_to_callbacks + (ctx : Dcalc.Ast.decl_ctx) + (fmt : Format.formatter) + (scopes : ('expr, 'm) Dcalc.Ast.scopes) : unit = + match scopes with + | Dcalc.Ast.Nil -> () + | Dcalc.Ast.ScopeDef scope_def -> + let scope_var, scope_next = Bindlib.unbind scope_def.scope_next in + let fmt_meth_name fmt _ = + Format.fprintf fmt "method %a : (%a Js.t -> %a Js.t) Js.callback" + format_var_camel_case scope_var fmt_input_struct_name scope_def + fmt_output_struct_name scope_def + in + Format.fprintf fmt "@,@[%a =@ Js.wrap_callback@ %a@]@,%a" + fmt_meth_name () format_var scope_var + (format_scopes_to_callbacks ctx) + scope_next + + let format_program + (fmt : Format.formatter) + (module_name : string option) + (prgm : 'm Lcalc.Ast.program) + (type_ordering : Scopelang.Dependency.TVertex.t list) = + let fmt_lib_name fmt _ = + Format.fprintf fmt "%sLib" + (Option.fold ~none:"" + ~some:(fun name -> + List.nth (String.split_on_char ' ' name) 1 + |> String.split_on_char '_' + |> List.map String.capitalize_ascii + |> String.concat "") + module_name) + in + + Cli.call_unstyled (fun _ -> + Format.fprintf fmt + "(** This file has been generated by the Catala compiler, do not \ + edit! *)@\n\ + @\n\ + open Runtime_ocaml.Runtime@\n\ + open Runtime_jsoo.Runtime@\n\ + open Js_of_ocaml@\n\ + %s@\n\ + @\n\ + [@@@@@@ocaml.warning \"-4-26-27-32-41-42\"]@\n\ + @\n\ + (* Generated API *)@\n\ + @\n\ + %a@\n\ + %a@\n\ + @\n\ + @[let _ =@ @[ Js.export \"%a\"@\n\ + @[(object%%js@ %a@]@\n\ + end)@]@]@?" + (Option.fold ~none:"" ~some:(fun name -> name) module_name) + (format_ctx type_ordering) prgm.decl_ctx + (format_scopes_to_fun prgm.decl_ctx) + prgm.scopes fmt_lib_name () + (format_scopes_to_callbacks prgm.decl_ctx) + prgm.scopes) +end + +let apply + ~(source_file : Pos.input_file) + ~(output_file : string option) + ~scope + (prgm : 'm Lcalc.Ast.program) + (type_ordering : Scopelang.Dependency.TVertex.t list) = + ignore scope; + File.with_formatter_of_opt_file output_file (fun fmt -> + Cli.trace_flag := true; + Cli.debug_print "Writing OCaml code to %s..." + (Option.value ~default:"stdout" output_file); + To_ocaml.format_program fmt prgm type_ordering); + + let output_file, filename_without_ext = + match output_file with + | Some "-" -> output_file, output_file + | Some f -> + output_file, Some (Filename.basename f |> Filename.remove_extension) + | None -> Some "-", None + in + let jsoo_output_file, with_formatter = + File.get_formatter_of_out_channel ~source_file + ~output_file: + (Option.map + (fun name -> + if "-" = name then "-" + else Filename.remove_extension name ^ "_api_web.ml") + output_file) + ~ext:"_api_web.ml" () + in + let module_name = + Option.map + (fun name -> Printf.sprintf "open %s" (String.capitalize_ascii name)) + filename_without_ext + in + with_formatter (fun fmt -> + Cli.debug_print "Writing JSOO API code to %s..." + (Option.value ~default:"stdout" jsoo_output_file); + To_jsoo.format_program fmt module_name prgm type_ordering) + +let () = Driver.Plugin.register_lcalc ~name ~extension apply diff --git a/compiler/plugins/dune b/compiler/plugins/dune index 6934138d..1b67068e 100644 --- a/compiler/plugins/dune +++ b/compiler/plugins/dune @@ -5,10 +5,16 @@ (libraries catala.driver)) (executable - (name jsoo) + (name api_web) (modes plugin) - (modules jsoo) - (libraries catala.driver catala.runtime)) + (modules api_web) + (libraries catala.driver)) + +(executable + (name json_schema) + (modes plugin) + (modules json_schema) + (libraries catala.driver)) (documentation (package catala) diff --git a/compiler/plugins/json_schema.ml b/compiler/plugins/json_schema.ml new file mode 100644 index 00000000..63624cac --- /dev/null +++ b/compiler/plugins/json_schema.ml @@ -0,0 +1,244 @@ +(* This file is part of the Catala compiler, a specification language for tax + and social benefits computation rules. Copyright (C) 2020 Inria, + contributors: Emile Rolley . + + Licensed under the Apache License, Version 2.0 (the "License"); you may not + use this file except in compliance with the License. You may obtain a copy of + the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + License for the specific language governing permissions and limitations under + the License. *) + +(** Catala plugin for generating {{:https://json-schema.org} JSON schemas} used + to build forms for the Catala website. *) + +let name = "json_schema" +let extension = "_schema.json" + +open Utils +open String_common +open Lcalc.Ast +open Lcalc.To_ocaml +module D = Dcalc.Ast + +(** Contains all format functions used to format a Lcalc Catala program + representation to a JSON schema describing the corresponding web form. *) +module To_json = struct + let to_camel_case (s : string) : string = + String.split_on_char '_' s + |> (function + | hd :: tl -> hd :: List.map String.capitalize_ascii tl | l -> l) + |> String.concat "" + + let format_struct_field_name_camel_case + (fmt : Format.formatter) + (v : Dcalc.Ast.StructFieldName.t) : unit = + let s = + Format.asprintf "%a" Dcalc.Ast.StructFieldName.format_t v + |> to_ascii + |> to_snake_case + |> avoid_keywords + |> to_camel_case + in + Format.fprintf fmt "%s" s + + let rec find_scope_def (target_name : string) : + ('m expr, 'm) D.scopes -> ('m expr, 'm) D.scope_def option = function + | D.Nil -> None + | D.ScopeDef scope_def -> + let name = + Format.asprintf "%a" D.ScopeName.format_t scope_def.scope_name + in + if name = target_name then Some scope_def + else + let _, next_scope = Bindlib.unbind scope_def.scope_next in + find_scope_def target_name next_scope + + let fmt_tlit fmt (tlit : D.typ_lit) = + match tlit with + | TUnit -> Format.fprintf fmt "\"type\": \"null\",@\n\"default\": null" + | TInt | TRat -> Format.fprintf fmt "\"type\": \"number\",@\n\"default\": 0" + | TMoney -> + Format.fprintf fmt + "\"type\": \"number\",@\n\"minimum\": 0,@\n\"default\": 0" + | TBool -> Format.fprintf fmt "\"type\": \"boolean\",@\n\"default\": false" + | TDate -> Format.fprintf fmt "\"type\": \"string\",@\n\"format\": \"date\"" + | TDuration -> failwith "TODO: tlit duration" + + let rec fmt_type fmt (typ : D.marked_typ) = + match Marked.unmark typ with + | D.TLit tlit -> fmt_tlit fmt tlit + | D.TTuple (_, Some sname) -> + Format.fprintf fmt "\"$ref\": \"#/definitions/%a\"" format_struct_name + sname + | D.TEnum (_, ename) -> + Format.fprintf fmt "\"$ref\": \"#/definitions/%a\"" format_enum_name ename + | D.TArray t -> + Format.fprintf fmt + "\"type\": \"array\",@\n\ + \"default\": [],@\n\ + @[\"items\": {@\n\ + %a@]@\n\ + }" + fmt_type t + | _ -> () + + let fmt_struct_properties + (ctx : D.decl_ctx) + (fmt : Format.formatter) + (sname : D.StructName.t) = + Format.fprintf fmt "%a" + (Format.pp_print_list + ~pp_sep:(fun fmt () -> Format.fprintf fmt ",@\n") + (fun fmt (field_name, field_type) -> + Format.fprintf fmt "@[\"%a\": {@\n%a@]@\n}" + format_struct_field_name_camel_case field_name fmt_type field_type)) + (find_struct sname ctx) + + let fmt_definitions + (ctx : D.decl_ctx) + (fmt : Format.formatter) + (scope_def : ('m expr, 'm) D.scope_def) = + let get_name t = + match Marked.unmark t with + | D.TTuple (_, Some sname) -> + Format.asprintf "%a" format_struct_name sname + | D.TEnum (_, ename) -> Format.asprintf "%a" format_enum_name ename + | _ -> failwith "unreachable: only structs and enums are collected." + in + let rec collect_required_type_defs_from_scope_input + (input_struct : D.StructName.t) : D.marked_typ list = + let rec collect (acc : D.marked_typ list) (t : D.marked_typ) : + D.marked_typ list = + match Marked.unmark t with + | D.TTuple (_, Some s) -> + (* Scope's input is a struct. *) + (t :: acc) @ collect_required_type_defs_from_scope_input s + | D.TEnum (ts, _) -> List.fold_left collect (t :: acc) ts + | D.TArray t -> collect acc t + | _ -> acc + in + find_struct input_struct ctx + |> List.fold_left (fun acc (_, field_typ) -> collect acc field_typ) [] + |> List.sort_uniq (fun t t' -> String.compare (get_name t) (get_name t')) + in + let fmt_enum_properties fmt ename = + let enum_def = find_enum ename ctx in + Format.fprintf fmt + "@[\"kind\": {@\n\ + \"type\": \"string\",@\n\ + @[\"anyOf\": [@\n\ + %a@]@\n\ + ]@]@\n\ + }@\n\ + },@\n\ + @[\"allOf\": [@\n\ + %a@]@\n\ + ]@]@\n\ + }" + (Format.pp_print_list + ~pp_sep:(fun fmt () -> Format.fprintf fmt ",@\n") + (fun fmt (enum_cons, _) -> + Format.fprintf fmt + "@[{@\n\"type\": \"string\",@\n\"enum\": [\"%a\"]@]@\n}" + format_enum_cons_name enum_cons)) + enum_def + (Format.pp_print_list + ~pp_sep:(fun fmt () -> Format.fprintf fmt ",@\n") + (fun fmt (enum_cons, payload_type) -> + Format.fprintf fmt + "@[{@\n\ + @[\"if\": {@\n\ + @[\"properties\": {@\n\ + @[\"kind\": {@\n\ + \"const\": \"%a\"@]@\n\ + }@]@\n\ + }@]@\n\ + },@\n\ + @[\"then\": {@\n\ + @[\"properties\": {@\n\ + @[\"payload\": {@\n\ + %a@]@\n\ + }@]@\n\ + }@]@\n\ + }@]@\n\ + }" + format_enum_cons_name enum_cons fmt_type payload_type)) + enum_def + in + + Format.fprintf fmt "@\n%a" + (Format.pp_print_list + ~pp_sep:(fun fmt () -> Format.fprintf fmt ",@\n") + (fun fmt typ -> + match Marked.unmark typ with + | D.TTuple (_, Some sname) -> + Format.fprintf fmt + "@[\"%a\": {@\n\ + \"type\": \"object\",@\n\ + @[\"properties\": {@\n\ + %a@]@\n\ + }@]@\n\ + }" + format_struct_name sname + (fmt_struct_properties ctx) + sname + | D.TEnum (_, ename) -> + Format.fprintf fmt + "@[\"%a\": {@\n\ + \"type\": \"object\",@\n\ + @[\"properties\": {@\n\ + %a@]@]@\n" + format_enum_name ename fmt_enum_properties ename + | _ -> ())) + (collect_required_type_defs_from_scope_input + scope_def.scope_body.scope_body_input_struct) + + let format_program + (fmt : Format.formatter) + (scope : string) + (prgm : 'm Lcalc.Ast.program) = + match find_scope_def scope prgm.scopes with + | None -> Cli.error_print "Internal error: scope '%s' not found." scope + | Some scope_def -> + Cli.call_unstyled (fun _ -> + Format.fprintf fmt + "{@[@\n\ + \"type\": \"object\",@\n\ + \"@[definitions\": {%a@]@\n\ + },@\n\ + \"@[properties\": {@\n\ + %a@]@\n\ + }@]@\n\ + }" + (fmt_definitions prgm.decl_ctx) + scope_def + (fmt_struct_properties prgm.decl_ctx) + scope_def.scope_body.scope_body_input_struct) +end + +let apply + ~(source_file : Pos.input_file) + ~(output_file : string option) + ~(scope : string option) + (prgm : 'm Lcalc.Ast.program) + (type_ordering : Scopelang.Dependency.TVertex.t list) = + ignore source_file; + ignore type_ordering; + match scope with + | Some s -> + File.with_formatter_of_opt_file output_file (fun fmt -> + Cli.debug_print + "Writing JSON schema corresponding to the scope '%s' to the file \ + %s..." + s + (Option.value ~default:"stdout" output_file); + To_json.format_program fmt s prgm) + | None -> Cli.error_print "A scope must be specified for the plugin: %s" name + +let () = Driver.Plugin.register_lcalc ~name ~extension apply diff --git a/compiler/plugins/jsoo.ml b/compiler/plugins/jsoo.ml deleted file mode 100644 index ef4aea12..00000000 --- a/compiler/plugins/jsoo.ml +++ /dev/null @@ -1,78 +0,0 @@ -(* This file is part of the Catala compiler, a specification language for tax - and social benefits computation rules. Copyright (C) 2020 Inria, contributor: - Louis Gesbert . - - Licensed under the Apache License, Version 2.0 (the "License"); you may not - use this file except in compliance with the License. You may obtain a copy of - the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - License for the specific language governing permissions and limitations under - the License. *) - -(** This file demonstrates the use of backend plugins for Catala. It's a simple - wrapper on top of the OCaml backend that calls js_of_ocaml on the generated - code. Not for production use. *) - -let name = "jsoo" -let extension = ".js" - -let finalise e f = - let bt = Printexc.get_raw_backtrace () in - f (); - Printexc.raise_with_backtrace e bt - -let finally f k = - match k () with - | r -> - f (); - r - | exception e -> finalise e f - -let with_open_out file f = - let oc = open_out file in - finally (fun () -> close_out oc) (fun () -> f oc) - -let with_temp_file pfx sfx f = - let tmp = Filename.temp_file pfx sfx in - match f tmp with - | r -> - Sys.remove tmp; - r - | exception e -> - let bt = Printexc.get_raw_backtrace () in - Sys.remove tmp; - Printexc.raise_with_backtrace e bt - -let apply output_file prgm type_ordering = - with_temp_file "catala_jsoo_" ".ml" @@ fun ml_file -> - Utils.File.with_formatter_of_opt_file output_file @@ fun fmt -> - Lcalc.To_ocaml.format_program fmt prgm type_ordering; - with_temp_file "catala_jsoo_" ".byte" @@ fun bytecode_file -> - if - Sys.command - (Printf.sprintf - "ocamlfind ocamlc -package catala.runtime -linkpkg %S -o %S" ml_file - bytecode_file) - <> 0 - then failwith "ocaml err"; - Utils.Cli.debug_print "OCaml compil ok"; - let out_arg = - match output_file with Some f -> Printf.sprintf "%S" f | None -> "-" - in - if - Sys.command - (Printf.sprintf - "js_of_ocaml +zarith_stubs_js/biginteger.js \ - +zarith_stubs_js/runtime.js %S -o %s" - bytecode_file out_arg) - <> 0 - then failwith "jsoo err"; - Utils.Cli.debug_print "Jsoo compil ok, output in %s" - (Option.value ~default:"stdout" output_file) - -let () = Driver.Plugin.register_lcalc ~name ~extension apply diff --git a/compiler/plugins/plugins.mld b/compiler/plugins/plugins.mld index b94817c7..f9cb1f2d 100644 --- a/compiler/plugins/plugins.mld +++ b/compiler/plugins/plugins.mld @@ -41,11 +41,25 @@ This trivial example registers a plugin that uses the [scalc] format as input. It simply calls the code of the built-in Python backend, and should be no different to using the normal Catala Python output mode. -{2 jsoo example} +{2 [js_of_ocaml] wrapper generator example} -This slightly more involved plugin reads the [lcalc] format, applies the code of -the [OCaml] backend normally, but then calls the [ocamlc] and [js_of_ocaml] -compiler successively on the output in order to give a Javascript output. +This plugin generates a [js_of_ocaml] wrapper from the [lcalc] representation +of a Catala program. -Note that this output remains a library, it won't provide user-facing features, -and no efforts are made to make it callable from normal JavaScript code. +It start by generating the OCaml module before generating the [_api_web.ml] +one, which contains all the class types and conversion functions between the +OCaml types and their corresponding JS objects. At the end the module exposes +all methods in a JS lib [Lib]. + +See +{{:https://github.com/CatalaLang/catala/tree/master/french_law/ocaml/law_source} +law_source} for examples of generated code. + +{2 JSON schema generator example} + +This plugin generates a {{:https://json-schema.org} JSON schema} corresponding +to a scope of a Catala program. + +See +{{:https://github.com/CatalaLang/catala/tree/master/french_law/json_schemas} +json_schemas} for examples of generated schemas. diff --git a/compiler/plugins/python.ml b/compiler/plugins/python.ml index 9cb7ed06..3f9a8300 100644 --- a/compiler/plugins/python.ml +++ b/compiler/plugins/python.ml @@ -23,8 +23,10 @@ let name = "python-plugin" let extension = ".py" -let apply output_file prgm type_ordering = - Utils.File.with_formatter_of_opt_file output_file @@ fun fmt -> - Scalc.To_python.format_program fmt prgm type_ordering +let apply ~source_file ~output_file ~scope prgm type_ordering = + ignore source_file; + ignore scope; + Utils.File.with_formatter_of_opt_file output_file + @@ fun fmt -> Scalc.To_python.format_program fmt prgm type_ordering let () = Driver.Plugin.register_scalc ~name ~extension apply diff --git a/compiler/scalc/ast.ml b/compiler/scalc/ast.ml index da3ddb4e..e4f36a34 100644 --- a/compiler/scalc/ast.ml +++ b/compiler/scalc/ast.ml @@ -20,26 +20,30 @@ module L = Lcalc.Ast module TopLevelName = Uid.Make (Uid.MarkedString) () module LocalName = Uid.Make (Uid.MarkedString) () +let dead_value = LocalName.fresh ("dead_value", Pos.no_pos) +let handle_default = TopLevelName.fresh ("handle_default", Pos.no_pos) +let handle_default_opt = TopLevelName.fresh ("handle_default_opt", Pos.no_pos) + type expr = | EVar of LocalName.t | EFunc of TopLevelName.t - | EStruct of expr Pos.marked list * D.StructName.t - | EStructFieldAccess of expr Pos.marked * D.StructFieldName.t * D.StructName.t - | EInj of expr Pos.marked * D.EnumConstructor.t * D.EnumName.t - | EArray of expr Pos.marked list + | EStruct of expr Marked.pos list * D.StructName.t + | EStructFieldAccess of expr Marked.pos * D.StructFieldName.t * D.StructName.t + | EInj of expr Marked.pos * D.EnumConstructor.t * D.EnumName.t + | EArray of expr Marked.pos list | ELit of L.lit - | EApp of expr Pos.marked * expr Pos.marked list + | EApp of expr Marked.pos * expr Marked.pos list | EOp of Dcalc.Ast.operator type stmt = - | SInnerFuncDef of LocalName.t Pos.marked * func - | SLocalDecl of LocalName.t Pos.marked * D.typ Pos.marked - | SLocalDef of LocalName.t Pos.marked * expr Pos.marked + | SInnerFuncDef of LocalName.t Marked.pos * func + | SLocalDecl of LocalName.t Marked.pos * D.typ Marked.pos + | SLocalDef of LocalName.t Marked.pos * expr Marked.pos | STryExcept of block * L.except * block | SRaise of L.except - | SIfThenElse of expr Pos.marked * block * block + | SIfThenElse of expr Marked.pos * block * block | SSwitch of - expr Pos.marked + expr Marked.pos * D.EnumName.t * (block (* Statements corresponding to arm closure body*) * (* Variable instantiated with enum payload *) LocalName.t) @@ -47,10 +51,10 @@ type stmt = | SReturn of expr | SAssert of expr -and block = stmt Pos.marked list +and block = stmt Marked.pos list and func = { - func_params : (LocalName.t Pos.marked * D.typ Pos.marked) list; + func_params : (LocalName.t Marked.pos * D.typ Marked.pos) list; func_body : block; } diff --git a/compiler/scalc/compile_from_lambda.ml b/compiler/scalc/compile_from_lambda.ml index 293f6812..7d540109 100644 --- a/compiler/scalc/compile_from_lambda.ml +++ b/compiler/scalc/compile_from_lambda.ml @@ -29,15 +29,15 @@ type ctxt = { (* Expressions can spill out side effect, hence this function also returns a list of statements to be prepended before the expression is evaluated *) -let rec translate_expr (ctxt : ctxt) (expr : L.expr Pos.marked) : - A.block * A.expr Pos.marked = - match Pos.unmark expr with +let rec translate_expr (ctxt : ctxt) (expr : 'm L.marked_expr) : + A.block * A.expr Marked.pos = + match Marked.unmark expr with | L.EVar v -> let local_var = - try A.EVar (L.VarMap.find (Pos.unmark v) ctxt.var_dict) - with Not_found -> A.EFunc (L.VarMap.find (Pos.unmark v) ctxt.func_dict) + try A.EVar (L.VarMap.find (L.Var.t v) ctxt.var_dict) + with Not_found -> A.EFunc (L.VarMap.find (L.Var.t v) ctxt.func_dict) in - [], (local_var, Pos.get_position v) + [], (local_var, D.pos expr) | L.ETuple (args, Some s_name) -> let args_stmts, new_args = List.fold_left @@ -48,7 +48,7 @@ let rec translate_expr (ctxt : ctxt) (expr : L.expr Pos.marked) : in let new_args = List.rev new_args in let args_stmts = List.rev args_stmts in - args_stmts, (A.EStruct (new_args, s_name), Pos.get_position expr) + args_stmts, (A.EStruct (new_args, s_name), D.pos expr) | L.ETuple (_, None) -> failwith "Non-struct tuples cannot be compiled to scalc" | L.ETupleAccess (e1, num_field, Some s_name, _) -> @@ -57,9 +57,7 @@ let rec translate_expr (ctxt : ctxt) (expr : L.expr Pos.marked) : fst (List.nth (D.StructMap.find s_name ctxt.decl_ctx.ctx_structs) num_field) in - ( e1_stmts, - (A.EStructFieldAccess (new_e1, field_name, s_name), Pos.get_position expr) - ) + e1_stmts, (A.EStructFieldAccess (new_e1, field_name, s_name), D.pos expr) | L.ETupleAccess (_, _, None, _) -> failwith "Non-struct tuples cannot be compiled to scalc" | L.EInj (e1, num_cons, e_name, _) -> @@ -67,7 +65,7 @@ let rec translate_expr (ctxt : ctxt) (expr : L.expr Pos.marked) : let cons_name = fst (List.nth (D.EnumMap.find e_name ctxt.decl_ctx.ctx_enums) num_cons) in - e1_stmts, (A.EInj (new_e1, cons_name, e_name), Pos.get_position expr) + e1_stmts, (A.EInj (new_e1, cons_name, e_name), D.pos expr) | L.EApp (f, args) -> let f_stmts, new_f = translate_expr ctxt f in let args_stmts, new_args = @@ -78,7 +76,7 @@ let rec translate_expr (ctxt : ctxt) (expr : L.expr Pos.marked) : ([], []) args in let new_args = List.rev new_args in - f_stmts @ args_stmts, (A.EApp (new_f, new_args), Pos.get_position expr) + f_stmts @ args_stmts, (A.EApp (new_f, new_args), D.pos expr) | L.EArray args -> let args_stmts, new_args = List.fold_left @@ -88,9 +86,9 @@ let rec translate_expr (ctxt : ctxt) (expr : L.expr Pos.marked) : ([], []) args in let new_args = List.rev new_args in - args_stmts, (A.EArray new_args, Pos.get_position expr) - | L.EOp op -> [], (A.EOp op, Pos.get_position expr) - | L.ELit l -> [], (A.ELit l, Pos.get_position expr) + args_stmts, (A.EArray new_args, D.pos expr) + | L.EOp op -> [], (A.EOp op, D.pos expr) + | L.ELit l -> [], (A.ELit l, D.pos expr) | _ -> let tmp_var = A.LocalName.fresh @@ -100,34 +98,33 @@ let rec translate_expr (ctxt : ctxt) (expr : L.expr Pos.marked) : (match ctxt.inside_definition_of with | None -> ctxt.context_name | Some v -> - let v = Pos.unmark (A.LocalName.get_info v) in + let v = Marked.unmark (A.LocalName.get_info v) in let tmp_rex = Re.Pcre.regexp "^temp_" in if Re.Pcre.pmatch ~rex:tmp_rex v then v else "temp_" ^ v), - Pos.get_position expr ) + D.pos expr ) in let ctxt = { ctxt with inside_definition_of = Some tmp_var; - context_name = Pos.unmark (A.LocalName.get_info tmp_var); + context_name = Marked.unmark (A.LocalName.get_info tmp_var); } in let tmp_stmts = translate_statements ctxt expr in - ( ( A.SLocalDecl - ((tmp_var, Pos.get_position expr), (D.TAny, Pos.get_position expr)), - Pos.get_position expr ) + ( (A.SLocalDecl ((tmp_var, D.pos expr), (D.TAny, D.pos expr)), D.pos expr) :: tmp_stmts, - (A.EVar tmp_var, Pos.get_position expr) ) + (A.EVar tmp_var, D.pos expr) ) -and translate_statements (ctxt : ctxt) (block_expr : L.expr Pos.marked) : - A.block = - match Pos.unmark block_expr with +and translate_statements (ctxt : ctxt) (block_expr : 'm L.marked_expr) : A.block + = + match Marked.unmark block_expr with | L.EAssert e -> (* Assertions are always encapsulated in a unit-typed let binding *) let e_stmts, new_e = translate_expr ctxt e in - e_stmts @ [A.SAssert (Pos.unmark new_e), Pos.get_position block_expr] - | L.EApp ((L.EAbs ((binder, binder_pos), taus), eabs_pos), args) -> + e_stmts @ [A.SAssert (Marked.unmark new_e), D.pos block_expr] + | L.EApp ((L.EAbs (binder, taus), binder_mark), args) -> (* This defines multiple local variables at the time *) + let binder_pos = D.mark_pos binder_mark in let vars, body = Bindlib.unmbind binder in let vars_tau = List.map2 (fun x tau -> x, tau) (Array.to_list vars) taus in let ctxt = @@ -136,7 +133,7 @@ and translate_statements (ctxt : ctxt) (block_expr : L.expr Pos.marked) : var_dict = List.fold_left (fun var_dict (x, _) -> - L.VarMap.add x + L.VarMap.add (L.Var.t x) (A.LocalName.fresh (Bindlib.name_of x, binder_pos)) var_dict) ctxt.var_dict vars_tau; @@ -145,14 +142,15 @@ and translate_statements (ctxt : ctxt) (block_expr : L.expr Pos.marked) : let local_decls = List.map (fun (x, tau) -> - ( A.SLocalDecl ((L.VarMap.find x ctxt.var_dict, binder_pos), tau), - eabs_pos )) + ( A.SLocalDecl + ((L.VarMap.find (L.Var.t x) ctxt.var_dict, binder_pos), tau), + binder_pos )) vars_tau in let vars_args = List.map2 (fun (x, tau) arg -> - (L.VarMap.find x ctxt.var_dict, binder_pos), tau, arg) + (L.VarMap.find (L.Var.t x) ctxt.var_dict, binder_pos), tau, arg) vars_tau args in let def_blocks = @@ -161,8 +159,9 @@ and translate_statements (ctxt : ctxt) (block_expr : L.expr Pos.marked) : let ctxt = { ctxt with - inside_definition_of = Some (Pos.unmark x); - context_name = Pos.unmark (A.LocalName.get_info (Pos.unmark x)); + inside_definition_of = Some (Marked.unmark x); + context_name = + Marked.unmark (A.LocalName.get_info (Marked.unmark x)); } in let arg_stmts, new_arg = translate_expr ctxt arg in @@ -171,13 +170,13 @@ and translate_statements (ctxt : ctxt) (block_expr : L.expr Pos.marked) : in let rest_of_block = translate_statements ctxt body in local_decls @ List.flatten def_blocks @ rest_of_block - | L.EAbs ((binder, binder_pos), taus) -> + | L.EAbs (binder, taus) -> let vars, body = Bindlib.unmbind binder in + let binder_pos = D.pos block_expr in let vars_tau = List.map2 (fun x tau -> x, tau) (Array.to_list vars) taus in let closure_name = match ctxt.inside_definition_of with - | None -> - A.LocalName.fresh (ctxt.context_name, Pos.get_position block_expr) + | None -> A.LocalName.fresh (ctxt.context_name, D.pos block_expr) | Some x -> x in let ctxt = @@ -186,7 +185,7 @@ and translate_statements (ctxt : ctxt) (block_expr : L.expr Pos.marked) : var_dict = List.fold_left (fun var_dict (x, _) -> - L.VarMap.add x + L.VarMap.add (L.Var.t x) (A.LocalName.fresh (Bindlib.name_of x, binder_pos)) var_dict) ctxt.var_dict vars_tau; @@ -201,7 +200,7 @@ and translate_statements (ctxt : ctxt) (block_expr : L.expr Pos.marked) : func_params = List.map (fun (var, tau) -> - (L.VarMap.find var ctxt.var_dict, binder_pos), tau) + (L.VarMap.find (L.Var.t var) ctxt.var_dict, binder_pos), tau) vars_tau; func_body = new_body; } ), @@ -212,16 +211,19 @@ and translate_statements (ctxt : ctxt) (block_expr : L.expr Pos.marked) : let new_args = List.fold_left (fun new_args arg -> - match Pos.unmark arg with - | L.EAbs ((binder, pos_binder), _) -> + match Marked.unmark arg with + | L.EAbs (binder, _) -> let vars, body = Bindlib.unmbind binder in assert (Array.length vars = 1); let var = vars.(0) in let scalc_var = - A.LocalName.fresh (Bindlib.name_of var, pos_binder) + A.LocalName.fresh (Bindlib.name_of var, D.pos arg) in let ctxt = - { ctxt with var_dict = L.VarMap.add var scalc_var ctxt.var_dict } + { + ctxt with + var_dict = L.VarMap.add (L.Var.t var) scalc_var ctxt.var_dict; + } in let new_arg = translate_statements ctxt body in (new_arg, scalc_var) :: new_args @@ -230,19 +232,28 @@ and translate_statements (ctxt : ctxt) (block_expr : L.expr Pos.marked) : [] args in let new_args = List.rev new_args in - e1_stmts - @ [A.SSwitch (new_e1, e_name, new_args), Pos.get_position block_expr] + e1_stmts @ [A.SSwitch (new_e1, e_name, new_args), D.pos block_expr] | L.EIfThenElse (cond, e_true, e_false) -> let cond_stmts, s_cond = translate_expr ctxt cond in let s_e_true = translate_statements ctxt e_true in let s_e_false = translate_statements ctxt e_false in - cond_stmts - @ [A.SIfThenElse (s_cond, s_e_true, s_e_false), Pos.get_position block_expr] + cond_stmts @ [A.SIfThenElse (s_cond, s_e_true, s_e_false), D.pos block_expr] | L.ECatch (e_try, except, e_catch) -> let s_e_try = translate_statements ctxt e_try in let s_e_catch = translate_statements ctxt e_catch in - [A.STryExcept (s_e_try, except, s_e_catch), Pos.get_position block_expr] - | L.ERaise except -> [A.SRaise except, Pos.get_position block_expr] + [A.STryExcept (s_e_try, except, s_e_catch), D.pos block_expr] + | L.ERaise except -> + (* Before raising the exception, we still give a dummy definition to the + current variable so that tools like mypy don't complain. *) + (match ctxt.inside_definition_of with + | None -> [] + | Some x -> + [ + ( A.SLocalDef + ((x, D.pos block_expr), (Ast.EVar Ast.dead_value, D.pos block_expr)), + D.pos block_expr ); + ]) + @ [A.SRaise except, D.pos block_expr] | _ -> ( let e_stmts, new_e = translate_expr ctxt block_expr in e_stmts @@ -256,9 +267,9 @@ and translate_statements (ctxt : ctxt) (block_expr : L.expr Pos.marked) : | _ -> [ ( (match ctxt.inside_definition_of with - | None -> A.SReturn (Pos.unmark new_e) - | Some x -> A.SLocalDef (Pos.same_pos_as x new_e, new_e)), - Pos.get_position block_expr ); + | None -> A.SReturn (Marked.unmark new_e) + | Some x -> A.SLocalDef (Marked.same_mark_as x new_e, new_e)), + D.pos block_expr ); ]) let rec translate_scope_body_expr @@ -266,7 +277,7 @@ let rec translate_scope_body_expr (decl_ctx : D.decl_ctx) (var_dict : A.LocalName.t L.VarMap.t) (func_dict : A.TopLevelName.t L.VarMap.t) - (scope_expr : L.expr D.scope_body_expr) : A.block = + (scope_expr : ('m L.expr, 'm) D.scope_body_expr) : A.block = match scope_expr with | Result e -> let block, new_e = @@ -276,17 +287,17 @@ let rec translate_scope_body_expr func_dict; var_dict; inside_definition_of = None; - context_name = Pos.unmark (D.ScopeName.get_info scope_name); + context_name = Marked.unmark (D.ScopeName.get_info scope_name); } e in - block @ [A.SReturn (Pos.unmark new_e), Pos.get_position new_e] + block @ [A.SReturn (Marked.unmark new_e), Marked.get_mark new_e] | ScopeLet scope_let -> let let_var, scope_let_next = Bindlib.unbind scope_let.scope_let_next in let let_var_id = A.LocalName.fresh (Bindlib.name_of let_var, scope_let.scope_let_pos) in - let new_var_dict = L.VarMap.add let_var let_var_id var_dict in + let new_var_dict = L.VarMap.add (L.Var.t let_var) let_var_id var_dict in (match scope_let.scope_let_kind with | D.Assertion -> translate_statements @@ -295,7 +306,7 @@ let rec translate_scope_body_expr func_dict; var_dict; inside_definition_of = Some let_var_id; - context_name = Pos.unmark (D.ScopeName.get_info scope_name); + context_name = Marked.unmark (D.ScopeName.get_info scope_name); } scope_let.scope_let_expr | _ -> @@ -306,7 +317,7 @@ let rec translate_scope_body_expr func_dict; var_dict; inside_definition_of = Some let_var_id; - context_name = Pos.unmark (D.ScopeName.get_info scope_name); + context_name = Marked.unmark (D.ScopeName.get_info scope_name); } scope_let.scope_let_expr in @@ -321,9 +332,9 @@ let rec translate_scope_body_expr @ translate_scope_body_expr scope_name decl_ctx new_var_dict func_dict scope_let_next -let translate_program (p : L.program) : A.program = +let translate_program (p : 'm L.program) : A.program = { - decl_ctx = p.L.decl_ctx; + decl_ctx = p.D.decl_ctx; scopes = (let _, new_scopes = D.fold_left_scope_defs @@ -332,13 +343,13 @@ let translate_program (p : L.program) : A.program = Bindlib.unbind scope_def.scope_body.scope_body_expr in let input_pos = - Pos.get_position (D.ScopeName.get_info scope_def.scope_name) + Marked.get_mark (D.ScopeName.get_info scope_def.scope_name) in let scope_input_var_id = A.LocalName.fresh (Bindlib.name_of scope_input_var, input_pos) in let var_dict = - L.VarMap.singleton scope_input_var scope_input_var_id + L.VarMap.singleton (L.Var.t scope_input_var) scope_input_var_id in let new_scope_body = translate_scope_body_expr scope_def.D.scope_name p.decl_ctx @@ -347,7 +358,9 @@ let translate_program (p : L.program) : A.program = let func_id = A.TopLevelName.fresh (Bindlib.name_of scope_var, Pos.no_pos) in - let func_dict = L.VarMap.add scope_var func_id func_dict in + let func_dict = + L.VarMap.add (L.Var.t scope_var) func_id func_dict + in ( func_dict, { Ast.scope_body_name = scope_def.D.scope_name; @@ -362,7 +375,7 @@ let translate_program (p : L.program) : A.program = (D.StructMap.find scope_def.D.scope_body .D.scope_body_input_struct - p.L.decl_ctx.ctx_structs), + p.D.decl_ctx.ctx_structs), Some scope_def.D.scope_body .D.scope_body_input_struct ), @@ -374,13 +387,10 @@ let translate_program (p : L.program) : A.program = :: new_scopes )) ~init: ( (if !Cli.avoid_exceptions_flag then - L.VarMap.singleton L.handle_default_opt - (A.TopLevelName.fresh ("handle_default_opt", Pos.no_pos)) - else - L.VarMap.singleton L.handle_default - (A.TopLevelName.fresh ("handle_default", Pos.no_pos))), + L.VarMap.singleton L.handle_default_opt A.handle_default_opt + else L.VarMap.singleton L.handle_default A.handle_default), [] ) - p.L.scopes + p.D.scopes in List.rev new_scopes); } diff --git a/compiler/scalc/dune b/compiler/scalc/dune index 75f842e1..2f0a9449 100644 --- a/compiler/scalc/dune +++ b/compiler/scalc/dune @@ -1,7 +1,7 @@ (library (name scalc) (public_name catala.scalc) - (libraries bindlib lcalc runtime)) + (libraries bindlib lcalc catala.runtime_ocaml)) (documentation (package catala) diff --git a/compiler/scalc/print.ml b/compiler/scalc/print.ml index 5010615d..44ff6487 100644 --- a/compiler/scalc/print.ml +++ b/compiler/scalc/print.ml @@ -17,7 +17,7 @@ open Utils open Ast -let needs_parens (_e : expr Pos.marked) : bool = false +let needs_parens (_e : expr Marked.pos) : bool = false let format_local_name (fmt : Format.formatter) (v : LocalName.t) : unit = Format.fprintf fmt "%a_%s" LocalName.format_t v @@ -27,15 +27,15 @@ let rec format_expr (decl_ctx : Dcalc.Ast.decl_ctx) ?(debug : bool = false) (fmt : Format.formatter) - (e : expr Pos.marked) : unit = + (e : expr Marked.pos) : unit = let format_expr = format_expr decl_ctx ~debug in - let format_with_parens (fmt : Format.formatter) (e : expr Pos.marked) = + let format_with_parens (fmt : Format.formatter) (e : expr Marked.pos) = if needs_parens e then Format.fprintf fmt "%a%a%a" Dcalc.Print.format_punctuation "(" format_expr e Dcalc.Print.format_punctuation ")" else Format.fprintf fmt "%a" format_expr e in - match Pos.unmark e with + match Marked.unmark e with | EVar v -> Format.fprintf fmt "%a" format_local_name v | EFunc v -> Format.fprintf fmt "%a" TopLevelName.format_t v | EStruct (es, s) -> @@ -75,62 +75,59 @@ let rec format_expr (Dcalc.Ast.EnumMap.find enum decl_ctx.ctx_enums))) format_expr e | ELit l -> - Format.fprintf fmt "%a" Lcalc.Print.format_lit (Pos.same_pos_as l e) + Format.fprintf fmt "%a" Lcalc.Print.format_lit (Marked.same_mark_as l e) | EApp ((EOp (Binop ((Dcalc.Ast.Map | Dcalc.Ast.Filter) as op)), _), [arg1; arg2]) -> - Format.fprintf fmt "@[%a@ %a@ %a@]" Dcalc.Print.format_binop - (op, Pos.no_pos) format_with_parens arg1 format_with_parens arg2 + Format.fprintf fmt "@[%a@ %a@ %a@]" Dcalc.Print.format_binop op + format_with_parens arg1 format_with_parens arg2 | EApp ((EOp (Binop op), _), [arg1; arg2]) -> Format.fprintf fmt "@[%a@ %a@ %a@]" format_with_parens arg1 - Dcalc.Print.format_binop (op, Pos.no_pos) format_with_parens arg2 + Dcalc.Print.format_binop op format_with_parens arg2 | EApp ((EOp (Unop (Log _)), _), [arg1]) when not debug -> Format.fprintf fmt "%a" format_with_parens arg1 | EApp ((EOp (Unop op), _), [arg1]) -> - Format.fprintf fmt "@[%a@ %a@]" Dcalc.Print.format_unop - (op, Pos.no_pos) format_with_parens arg1 + Format.fprintf fmt "@[%a@ %a@]" Dcalc.Print.format_unop op + format_with_parens arg1 | EApp (f, args) -> Format.fprintf fmt "@[%a@ %a@]" format_expr f (Format.pp_print_list ~pp_sep:(fun fmt () -> Format.fprintf fmt "@ ") format_with_parens) args - | EOp (Ternop op) -> - Format.fprintf fmt "%a" Dcalc.Print.format_ternop (op, Pos.no_pos) - | EOp (Binop op) -> - Format.fprintf fmt "%a" Dcalc.Print.format_binop (op, Pos.no_pos) - | EOp (Unop op) -> - Format.fprintf fmt "%a" Dcalc.Print.format_unop (op, Pos.no_pos) + | EOp (Ternop op) -> Format.fprintf fmt "%a" Dcalc.Print.format_ternop op + | EOp (Binop op) -> Format.fprintf fmt "%a" Dcalc.Print.format_binop op + | EOp (Unop op) -> Format.fprintf fmt "%a" Dcalc.Print.format_unop op let rec format_statement (decl_ctx : Dcalc.Ast.decl_ctx) ?(debug : bool = false) (fmt : Format.formatter) - (stmt : stmt Pos.marked) : unit = + (stmt : stmt Marked.pos) : unit = if debug then () else (); - match Pos.unmark stmt with + match Marked.unmark stmt with | SInnerFuncDef (name, func) -> Format.fprintf fmt "@[%a@ %a@ %a@ %a@]@\n@[ %a@]" - Dcalc.Print.format_keyword "let" LocalName.format_t (Pos.unmark name) + Dcalc.Print.format_keyword "let" LocalName.format_t (Marked.unmark name) (Format.pp_print_list ~pp_sep:(fun fmt () -> Format.fprintf fmt "@ ") (fun fmt ((name, _), typ) -> Format.fprintf fmt "%a%a %a@ %a%a" Dcalc.Print.format_punctuation "(" LocalName.format_t name Dcalc.Print.format_punctuation ":" (Dcalc.Print.format_typ decl_ctx) - typ Dcalc.Print.format_punctuation ")")) + (Marked.unmark typ) Dcalc.Print.format_punctuation ")")) func.func_params Dcalc.Print.format_punctuation "=" (format_block decl_ctx ~debug) func.func_body | SLocalDecl (name, typ) -> Format.fprintf fmt "@[%a %a %a@ %a@]" Dcalc.Print.format_keyword - "decl" LocalName.format_t (Pos.unmark name) Dcalc.Print.format_punctuation - ":" + "decl" LocalName.format_t (Marked.unmark name) + Dcalc.Print.format_punctuation ":" (Dcalc.Print.format_typ decl_ctx) - typ + (Marked.unmark typ) | SLocalDef (name, expr) -> Format.fprintf fmt "@[%a %a@ %a@]" LocalName.format_t - (Pos.unmark name) Dcalc.Print.format_punctuation "=" + (Marked.unmark name) Dcalc.Print.format_punctuation "=" (format_expr decl_ctx ~debug) expr | STryExcept (b_try, except, b_with) -> @@ -157,11 +154,11 @@ let rec format_statement | SReturn ret -> Format.fprintf fmt "@[%a %a@]" Dcalc.Print.format_keyword "return" (format_expr decl_ctx ~debug) - (ret, Pos.get_position stmt) + (ret, Marked.get_mark stmt) | SAssert expr -> Format.fprintf fmt "@[%a %a@]" Dcalc.Print.format_keyword "assert" (format_expr decl_ctx ~debug) - (expr, Pos.get_position stmt) + (expr, Marked.get_mark stmt) | SSwitch (e_switch, enum, arms) -> Format.fprintf fmt "@[%a @[%a@]%a@]%a" Dcalc.Print.format_keyword "switch" @@ -204,7 +201,7 @@ let format_scope Format.fprintf fmt "%a%a %a@ %a%a" Dcalc.Print.format_punctuation "(" LocalName.format_t name Dcalc.Print.format_punctuation ":" (Dcalc.Print.format_typ decl_ctx) - typ Dcalc.Print.format_punctuation ")")) + (Marked.unmark typ) Dcalc.Print.format_punctuation ")")) body.scope_body_func.func_params Dcalc.Print.format_punctuation "=" (format_block decl_ctx ~debug) body.scope_body_func.func_body diff --git a/compiler/scalc/to_python.ml b/compiler/scalc/to_python.ml index 5adad7a3..38ae02f3 100644 --- a/compiler/scalc/to_python.ml +++ b/compiler/scalc/to_python.ml @@ -17,12 +17,13 @@ open Utils open Ast -open Lcalc.Backends +open String_common +module Runtime = Runtime_ocaml.Runtime module D = Dcalc.Ast module L = Lcalc.Ast -let format_lit (fmt : Format.formatter) (l : L.lit Pos.marked) : unit = - match Pos.unmark l with +let format_lit (fmt : Format.formatter) (l : L.lit Marked.pos) : unit = + match Marked.unmark l with | LBool true -> Format.fprintf fmt "True" | LBool false -> Format.fprintf fmt "False" | LInt i -> @@ -30,7 +31,7 @@ let format_lit (fmt : Format.formatter) (l : L.lit Pos.marked) : unit = | LUnit -> Format.fprintf fmt "Unit()" | LRat i -> Format.fprintf fmt "decimal_of_string(\"%a\")" Dcalc.Print.format_lit - (Pos.same_pos_as (Dcalc.Ast.LRat i) l) + (Dcalc.Ast.LRat i) | LMoney e -> Format.fprintf fmt "money_of_cents_string(\"%s\")" (Runtime.integer_to_string (Runtime.money_to_cents e)) @@ -51,9 +52,9 @@ let format_log_entry (fmt : Format.formatter) (entry : Dcalc.Ast.log_entry) : | EndCall -> Format.fprintf fmt "%s" "← " | PosRecordIfTrueBool -> Format.fprintf fmt "☛ " -let format_binop (fmt : Format.formatter) (op : Dcalc.Ast.binop Pos.marked) : +let format_binop (fmt : Format.formatter) (op : Dcalc.Ast.binop Marked.pos) : unit = - match Pos.unmark op with + match Marked.unmark op with | Add _ | Concat -> Format.fprintf fmt "+" | Sub _ -> Format.fprintf fmt "-" | Mult _ -> Format.fprintf fmt "*" @@ -70,9 +71,9 @@ let format_binop (fmt : Format.formatter) (op : Dcalc.Ast.binop Pos.marked) : | Map -> Format.fprintf fmt "list_map" | Filter -> Format.fprintf fmt "list_filter" -let format_ternop (fmt : Format.formatter) (op : Dcalc.Ast.ternop Pos.marked) : +let format_ternop (fmt : Format.formatter) (op : Dcalc.Ast.ternop Marked.pos) : unit = - match Pos.unmark op with Fold -> Format.fprintf fmt "list_fold_left" + match Marked.unmark op with Fold -> Format.fprintf fmt "list_fold_left" let format_uid_list (fmt : Format.formatter) (uids : Uid.MarkedString.info list) : unit = @@ -84,23 +85,30 @@ let format_uid_list (fmt : Format.formatter) (uids : Uid.MarkedString.info list) uids let format_string_list (fmt : Format.formatter) (uids : string list) : unit = + let sanitize_quotes = Re.compile (Re.char '"') in Format.fprintf fmt "[%a]" (Format.pp_print_list ~pp_sep:(fun fmt () -> Format.fprintf fmt ",@ ") - (fun fmt info -> Format.fprintf fmt "\"%s\"" info)) + (fun fmt info -> + Format.fprintf fmt "\"%s\"" + (Re.replace sanitize_quotes ~f:(fun _ -> "\\\"") info))) uids -let format_unop (fmt : Format.formatter) (op : Dcalc.Ast.unop Pos.marked) : unit +let format_unop (fmt : Format.formatter) (op : Dcalc.Ast.unop Marked.pos) : unit = - match Pos.unmark op with + match Marked.unmark op with | Minus _ -> Format.fprintf fmt "-" | Not -> Format.fprintf fmt "not" | Log (entry, infos) -> assert false (* should not happen *) | Length -> Format.fprintf fmt "%s" "list_length" | IntToRat -> Format.fprintf fmt "%s" "decimal_of_integer" + | MoneyToRat -> Format.fprintf fmt "%s" "decimal_of_money" + | RatToMoney -> Format.fprintf fmt "%s" "money_of_decimal" | GetDay -> Format.fprintf fmt "%s" "day_of_month_of_date" | GetMonth -> Format.fprintf fmt "%s" "month_number_of_date" | GetYear -> Format.fprintf fmt "%s" "year_of_date" + | FirstDayOfMonth -> Format.fprintf fmt "%s" "first_day_of_month" + | LastDayOfMonth -> Format.fprintf fmt "%s" "last_day_of_month" | RoundMoney -> Format.fprintf fmt "%s" "money_round" | RoundDecimal -> Format.fprintf fmt "%s" "decimal_round" @@ -123,7 +131,7 @@ let format_struct_name (fmt : Format.formatter) (v : Dcalc.Ast.StructName.t) : unit = Format.fprintf fmt "%s" (avoid_keywords - (to_uppercase + (to_camel_case (to_ascii (Format.asprintf "%a" Dcalc.Ast.StructName.format_t v)))) let format_struct_field_name @@ -137,7 +145,7 @@ let format_enum_name (fmt : Format.formatter) (v : Dcalc.Ast.EnumName.t) : unit = Format.fprintf fmt "%s" (avoid_keywords - (to_uppercase + (to_camel_case (to_ascii (Format.asprintf "%a" Dcalc.Ast.EnumName.format_t v)))) let format_enum_cons_name @@ -147,19 +155,19 @@ let format_enum_cons_name (avoid_keywords (to_ascii (Format.asprintf "%a" Dcalc.Ast.EnumConstructor.format_t v))) -let typ_needs_parens (e : Dcalc.Ast.typ Pos.marked) : bool = - match Pos.unmark e with TArrow _ | TArray _ -> true | _ -> false +let typ_needs_parens (e : Dcalc.Ast.typ Marked.pos) : bool = + match Marked.unmark e with TArrow _ | TArray _ -> true | _ -> false -let rec format_typ (fmt : Format.formatter) (typ : Dcalc.Ast.typ Pos.marked) : +let rec format_typ (fmt : Format.formatter) (typ : Dcalc.Ast.typ Marked.pos) : unit = let format_typ = format_typ in let format_typ_with_parens (fmt : Format.formatter) - (t : Dcalc.Ast.typ Pos.marked) = + (t : Dcalc.Ast.typ Marked.pos) = if typ_needs_parens t then Format.fprintf fmt "(%a)" format_typ t else Format.fprintf fmt "%a" format_typ t in - match Pos.unmark typ with + match Marked.unmark typ with | TLit TUnit -> Format.fprintf fmt "Unit" | TLit TMoney -> Format.fprintf fmt "Money" | TLit TInt -> Format.fprintf fmt "Integer" @@ -185,14 +193,13 @@ let rec format_typ (fmt : Format.formatter) (typ : Dcalc.Ast.typ Pos.marked) : | TAny -> Format.fprintf fmt "Any" let format_name_cleaned (fmt : Format.formatter) (s : string) : unit = - let lowercase_name = to_lowercase (to_ascii s) in - let lowercase_name = - Re.Pcre.substitute ~rex:(Re.Pcre.regexp "\\.") - ~subst:(fun _ -> "_dot_") - lowercase_name - in - let lowercase_name = avoid_keywords (to_ascii lowercase_name) in - Format.fprintf fmt "%s" lowercase_name + s + |> to_ascii + |> to_snake_case + |> Re.Pcre.substitute ~rex:(Re.Pcre.regexp "\\.") ~subst:(fun _ -> "_dot_") + |> to_ascii + |> avoid_keywords + |> Format.fprintf fmt "%s" module StringMap = Map.Make (String) module IntMap = Map.Make (Int) @@ -205,7 +212,7 @@ module IntMap = Map.Make (Int) let string_counter_map : int IntMap.t StringMap.t ref = ref StringMap.empty let format_var (fmt : Format.formatter) (v : LocalName.t) : unit = - let v_str = Pos.unmark (LocalName.get_info v) in + let v_str = Marked.unmark (LocalName.get_info v) in let hash = LocalName.hash v in let local_id = match StringMap.find_opt v_str !string_counter_map with @@ -236,22 +243,29 @@ let format_var (fmt : Format.formatter) (v : LocalName.t) : unit = else Format.fprintf fmt "%a_%d" format_name_cleaned v_str local_id let format_toplevel_name (fmt : Format.formatter) (v : TopLevelName.t) : unit = - let v_str = Pos.unmark (TopLevelName.get_info v) in + let v_str = Marked.unmark (TopLevelName.get_info v) in format_name_cleaned fmt v_str -let needs_parens (e : expr Pos.marked) : bool = - match Pos.unmark e with +let needs_parens (e : expr Marked.pos) : bool = + match Marked.unmark e with | ELit (LBool _ | LUnit) | EVar _ | EOp _ -> false | _ -> true -let format_exception (fmt : Format.formatter) (exc : L.except Pos.marked) : unit +let format_exception (fmt : Format.formatter) (exc : L.except Marked.pos) : unit = - match Pos.unmark exc with - | ConflictError -> Format.fprintf fmt "ConflictError" + let pos = Marked.get_mark exc in + match Marked.unmark exc with + | ConflictError -> + Format.fprintf fmt + "ConflictError(@[SourcePosition(@[filename=\"%s\",@ \ + start_line=%d,@ start_column=%d,@ end_line=%d,@ end_column=%d,@ \ + law_headings=%a)@])@]" + (Pos.get_file pos) (Pos.get_start_line pos) (Pos.get_start_column pos) + (Pos.get_end_line pos) (Pos.get_end_column pos) format_string_list + (Pos.get_law_info pos) | EmptyError -> Format.fprintf fmt "EmptyError" | Crash -> Format.fprintf fmt "Crash" | NoValueProvided -> - let pos = Pos.get_position exc in Format.fprintf fmt "NoValueProvided(@[SourcePosition(@[filename=\"%s\",@ \ start_line=%d,@ start_column=%d,@ end_line=%d,@ end_column=%d,@ \ @@ -263,8 +277,8 @@ let format_exception (fmt : Format.formatter) (exc : L.except Pos.marked) : unit let rec format_expression (ctx : Dcalc.Ast.decl_ctx) (fmt : Format.formatter) - (e : expr Pos.marked) : unit = - match Pos.unmark e with + (e : expr Marked.pos) : unit = + match Marked.unmark e with | EVar v -> format_var fmt v | EFunc f -> format_toplevel_name fmt f | EStruct (es, s) -> @@ -299,7 +313,7 @@ let rec format_expression ~pp_sep:(fun fmt () -> Format.fprintf fmt ",@ ") (fun fmt e -> Format.fprintf fmt "%a" (format_expression ctx) e)) es - | ELit l -> Format.fprintf fmt "%a" format_lit (Pos.same_pos_as l e) + | ELit l -> Format.fprintf fmt "%a" format_lit (Marked.same_mark_as l e) | EApp ((EOp (Binop ((Dcalc.Ast.Map | Dcalc.Ast.Filter) as op)), _), [arg1; arg2]) -> @@ -336,6 +350,19 @@ let rec format_expression | EApp ((EOp (Unop op), _), [arg1]) -> Format.fprintf fmt "%a(%a)" format_unop (op, Pos.no_pos) (format_expression ctx) arg1 + | EApp ((EFunc x, pos), args) + when Ast.TopLevelName.compare x Ast.handle_default = 0 + || Ast.TopLevelName.compare x Ast.handle_default_opt = 0 -> + Format.fprintf fmt + "%a(@[SourcePosition(filename=\"%s\",@ start_line=%d,@ \ + start_column=%d,@ end_line=%d, end_column=%d,@ law_headings=%a), %a)@]" + format_toplevel_name x (Pos.get_file pos) (Pos.get_start_line pos) + (Pos.get_start_column pos) (Pos.get_end_line pos) (Pos.get_end_column pos) + format_string_list (Pos.get_law_info pos) + (Format.pp_print_list + ~pp_sep:(fun fmt () -> Format.fprintf fmt ",@ ") + (format_expression ctx)) + args | EApp (f, args) -> Format.fprintf fmt "%a(@[%a)@]" (format_expression ctx) f (Format.pp_print_list @@ -349,20 +376,21 @@ let rec format_expression let rec format_statement (ctx : Dcalc.Ast.decl_ctx) (fmt : Format.formatter) - (s : stmt Pos.marked) : unit = - match Pos.unmark s with + (s : stmt Marked.pos) : unit = + match Marked.unmark s with | SInnerFuncDef (name, { func_params; func_body }) -> Format.fprintf fmt "@[def %a(%a):@\n%a@]" format_var - (Pos.unmark name) + (Marked.unmark name) (Format.pp_print_list ~pp_sep:(fun fmt () -> Format.fprintf fmt ", ") (fun fmt (var, typ) -> - Format.fprintf fmt "%a:%a" format_var (Pos.unmark var) format_typ typ)) + Format.fprintf fmt "%a:%a" format_var (Marked.unmark var) format_typ + typ)) func_params (format_block ctx) func_body | SLocalDecl _ -> assert false (* We don't need to declare variables in Python *) | SLocalDef (v, e) -> - Format.fprintf fmt "@[%a = %a@]" format_var (Pos.unmark v) + Format.fprintf fmt "@[%a = %a@]" format_var (Marked.unmark v) (format_expression ctx) e | STryExcept (try_b, except, catch_b) -> Format.fprintf fmt "@[try:@\n%a@]@\n@[except %a:@\n%a@]" @@ -370,7 +398,7 @@ let rec format_statement (format_block ctx) catch_b | SRaise except -> Format.fprintf fmt "@[raise %a@]" format_exception - (except, Pos.get_position s) + (except, Marked.get_mark s) | SIfThenElse (cond, b1, b2) -> Format.fprintf fmt "@[if %a:@\n%a@]@\n@[else:@\n%a@]" (format_expression ctx) cond (format_block ctx) b1 (format_block ctx) b2 @@ -408,10 +436,19 @@ let rec format_statement cases | SReturn e1 -> Format.fprintf fmt "@[return %a@]" (format_expression ctx) - (e1, Pos.get_position s) + (e1, Marked.get_mark s) | SAssert e1 -> - Format.fprintf fmt "@[assert %a@]" (format_expression ctx) - (e1, Pos.get_position s) + let pos = Marked.get_mark s in + Format.fprintf fmt + "@[if not (%a):@\n\ + raise AssertionFailure(@[SourcePosition(@[filename=\"%s\",@ start_line=%d,@ start_column=%d,@ end_line=%d,@ \ + end_column=%d,@ law_headings=@[%a@])@])@]@]" + (format_expression ctx) + (e1, Marked.get_mark s) + (Pos.get_file pos) (Pos.get_start_line pos) (Pos.get_start_column pos) + (Pos.get_end_line pos) (Pos.get_end_column pos) format_string_list + (Pos.get_law_info pos) and format_block (ctx : Dcalc.Ast.decl_ctx) (fmt : Format.formatter) (b : block) : unit = @@ -419,7 +456,7 @@ and format_block (ctx : Dcalc.Ast.decl_ctx) (fmt : Format.formatter) (b : block) ~pp_sep:(fun fmt () -> Format.fprintf fmt "@\n") (format_statement ctx) fmt (List.filter - (fun s -> match Pos.unmark s with SLocalDecl _ -> false | _ -> true) + (fun s -> match Marked.unmark s with SLocalDecl _ -> false | _ -> true) b) let format_ctx @@ -429,20 +466,20 @@ let format_ctx let format_struct_decl fmt (struct_name, struct_fields) = Format.fprintf fmt "class %a:@\n\ - \tdef __init__(self, %a) -> None:@\n\ + \ def __init__(self, %a) -> None:@\n\ %a@\n\ @\n\ - \tdef __eq__(self, other: object) -> bool:@\n\ - \t\tif isinstance(other, %a):@\n\ - \t\t\treturn @[(%a)@]@\n\ - \t\telse:@\n\ - \t\t\treturn False@\n\ + \ def __eq__(self, other: object) -> bool:@\n\ + \ if isinstance(other, %a):@\n\ + \ return @[(%a)@]@\n\ + \ else:@\n\ + \ return False@\n\ @\n\ - \tdef __ne__(self, other: object) -> bool:@\n\ - \t\treturn not (self == other)@\n\ + \ def __ne__(self, other: object) -> bool:@\n\ + \ return not (self == other)@\n\ @\n\ - \tdef __str__(self) -> str:@\n\ - \t\t@[return \"%a(%a)\".format(%a)@]" format_struct_name + \ def __str__(self) -> str:@\n\ + \ @[return \"%a(%a)\".format(%a)@]" format_struct_name struct_name (Format.pp_print_list ~pp_sep:(fun fmt () -> Format.fprintf fmt ", ") @@ -451,12 +488,12 @@ let format_ctx format_typ struct_field_type)) struct_fields (if List.length struct_fields = 0 then fun fmt _ -> - Format.fprintf fmt "\t\tpass" + Format.fprintf fmt " pass" else Format.pp_print_list ~pp_sep:(fun fmt () -> Format.fprintf fmt "@\n") (fun _fmt (struct_field, _) -> - Format.fprintf fmt "\t\tself.%a = %a" format_struct_field_name + Format.fprintf fmt " self.%a = %a" format_struct_field_name struct_field format_struct_field_name struct_field)) struct_fields format_struct_name struct_name (if List.length struct_fields > 0 then @@ -486,23 +523,24 @@ let format_ctx %a@]@\n\ @\n\ class %a:@\n\ - \tdef __init__(self, code: %a_Code, value: Any) -> None:@\n\ - \t\tself.code = code@\n\ - \t\tself.value = value@\n\ + \ def __init__(self, code: %a_Code, value: Any) -> None:@\n\ + \ self.code = code@\n\ + \ self.value = value@\n\ @\n\ @\n\ - \tdef __eq__(self, other: object) -> bool:@\n\ - \t\tif isinstance(other, %a):@\n\ - \t\t\treturn self.code == other.code and self.value == other.value@\n\ - \t\telse:@\n\ - \t\t\treturn False@\n\ + \ def __eq__(self, other: object) -> bool:@\n\ + \ if isinstance(other, %a):@\n\ + \ return self.code == other.code and self.value == \ + other.value@\n\ + \ else:@\n\ + \ return False@\n\ @\n\ @\n\ - \tdef __ne__(self, other: object) -> bool:@\n\ - \t\treturn not (self == other)@\n\ + \ def __ne__(self, other: object) -> bool:@\n\ + \ return not (self == other)@\n\ @\n\ - \tdef __str__(self) -> str:@\n\ - \t\t@[return \"{}({})\".format(self.code, self.value)@]" + \ def __str__(self) -> str:@\n\ + \ @[return \"{}({})\".format(self.code, self.value)@]" format_enum_name enum_name (Format.pp_print_list ~pp_sep:(fun fmt () -> Format.fprintf fmt "@\n") @@ -547,28 +585,28 @@ let format_program (* We disable the style flag in order to enjoy formatting from the pretty-printers of Dcalc and Lcalc but without the color terminal markers. *) - Cli.style_flag := false; - Format.fprintf fmt - "# This file has been generated by the Catala compiler, do not edit!\n\ - @\n\ - from catala.runtime import *@\n\ - from typing import Any, List, Callable, Tuple\n\ - from enum import Enum\n\ - @\n\ - %a@\n\ - @\n\ - %a@?" - (format_ctx type_ordering) p.decl_ctx - (Format.pp_print_list - ~pp_sep:(fun fmt () -> Format.fprintf fmt "@\n@\n") - (fun fmt body -> - let { Ast.func_params; Ast.func_body } = body.scope_body_func in - Format.fprintf fmt "@[def %a(%a):@\n%a@]" format_toplevel_name - body.scope_body_var - (Format.pp_print_list - ~pp_sep:(fun fmt () -> Format.fprintf fmt ", ") - (fun fmt (var, typ) -> - Format.fprintf fmt "%a:%a" format_var (Pos.unmark var) - format_typ typ)) - func_params (format_block p.decl_ctx) func_body)) - p.scopes + Cli.call_unstyled (fun _ -> + Format.fprintf fmt + "# This file has been generated by the Catala compiler, do not edit!\n\ + @\n\ + from catala.runtime import *@\n\ + from typing import Any, List, Callable, Tuple\n\ + from enum import Enum\n\ + @\n\ + %a@\n\ + @\n\ + %a@?" + (format_ctx type_ordering) p.decl_ctx + (Format.pp_print_list + ~pp_sep:(fun fmt () -> Format.fprintf fmt "@\n@\n") + (fun fmt body -> + let { Ast.func_params; Ast.func_body } = body.scope_body_func in + Format.fprintf fmt "@[def %a(%a):@\n%a@]" + format_toplevel_name body.scope_body_var + (Format.pp_print_list + ~pp_sep:(fun fmt () -> Format.fprintf fmt ", ") + (fun fmt (var, typ) -> + Format.fprintf fmt "%a:%a" format_var (Marked.unmark var) + format_typ typ)) + func_params (format_block p.decl_ctx) func_body)) + p.scopes) diff --git a/compiler/scopelang/ast.ml b/compiler/scopelang/ast.ml index 81ed51db..c3b663bf 100644 --- a/compiler/scopelang/ast.ml +++ b/compiler/scopelang/ast.ml @@ -51,16 +51,16 @@ module EnumConstructorMap : Map.S with type key = EnumConstructor.t = module EnumConstructorMapLift = Bindlib.Lift (EnumConstructorMap) type location = - | ScopeVar of ScopeVar.t Pos.marked + | ScopeVar of ScopeVar.t Marked.pos | SubScopeVar of - ScopeName.t * SubScopeName.t Pos.marked * ScopeVar.t Pos.marked + ScopeName.t * SubScopeName.t Marked.pos * ScopeVar.t Marked.pos -module LocationSet : Set.S with type elt = location Pos.marked = +module LocationSet : Set.S with type elt = location Marked.pos = Set.Make (struct - type t = location Pos.marked + type t = location Marked.pos let compare x y = - match Pos.unmark x, Pos.unmark y with + match Marked.unmark x, Marked.unmark y with | ScopeVar (vx, _), ScopeVar (vy, _) -> ScopeVar.compare vx vy | ( SubScopeVar (_, (xsubindex, _), (xsubvar, _)), SubScopeVar (_, (ysubindex, _), (ysubvar, _)) ) -> @@ -74,7 +74,7 @@ type typ = | TLit of Dcalc.Ast.typ_lit | TStruct of StructName.t | TEnum of EnumName.t - | TArrow of typ Pos.marked * typ Pos.marked + | TArrow of typ Marked.pos * typ Marked.pos | TArray of typ | TAny @@ -102,23 +102,23 @@ module Typ = struct | _, TArray _ -> 1 end -type expr = +type marked_expr = expr Marked.pos + +and expr = | ELocation of location - | EVar of expr Bindlib.var Pos.marked - | EStruct of StructName.t * expr Pos.marked StructFieldMap.t - | EStructAccess of expr Pos.marked * StructFieldName.t * StructName.t - | EEnumInj of expr Pos.marked * EnumConstructor.t * EnumName.t - | EMatch of - expr Pos.marked * EnumName.t * expr Pos.marked EnumConstructorMap.t + | EVar of expr Bindlib.var + | EStruct of StructName.t * marked_expr StructFieldMap.t + | EStructAccess of marked_expr * StructFieldName.t * StructName.t + | EEnumInj of marked_expr * EnumConstructor.t * EnumName.t + | EMatch of marked_expr * EnumName.t * marked_expr EnumConstructorMap.t | ELit of Dcalc.Ast.lit - | EAbs of - (expr, expr Pos.marked) Bindlib.mbinder Pos.marked * typ Pos.marked list - | EApp of expr Pos.marked * expr Pos.marked list + | EAbs of (expr, marked_expr) Bindlib.mbinder * typ Marked.pos list + | EApp of marked_expr * marked_expr list | EOp of Dcalc.Ast.operator - | EDefault of expr Pos.marked list * expr Pos.marked * expr Pos.marked - | EIfThenElse of expr Pos.marked * expr Pos.marked * expr Pos.marked - | EArray of expr Pos.marked list - | ErrorOnEmpty of expr Pos.marked + | EDefault of marked_expr list * marked_expr * marked_expr + | EIfThenElse of marked_expr * marked_expr * marked_expr + | EArray of marked_expr list + | ErrorOnEmpty of marked_expr module Expr = struct type t = expr @@ -136,13 +136,11 @@ module Expr = struct in match e1, e2 with | ELocation _, ELocation _ -> 0 - | EVar (v1, _), EVar (v2, _) -> Bindlib.compare_vars v1 v2 + | EVar v1, EVar v2 -> Bindlib.compare_vars v1 v2 | EStruct (name1, field_map1), EStruct (name2, field_map2) -> ( match StructName.compare name1 name2 with | 0 -> - StructFieldMap.compare - (Pos.compare_marked compare) - field_map1 field_map2 + StructFieldMap.compare (Marked.compare compare) field_map1 field_map2 | n -> n) | ( EStructAccess ((e1, _), field_name1, struct_name1), EStructAccess ((e2, _), field_name2, struct_name2) ) -> ( @@ -163,13 +161,12 @@ module Expr = struct match compare e1 e2 with | 0 -> ( match EnumName.compare name1 name2 with - | 0 -> - EnumConstructorMap.compare (Pos.compare_marked compare) emap1 emap2 + | 0 -> EnumConstructorMap.compare (Marked.compare compare) emap1 emap2 | n -> n) | n -> n) | ELit l1, ELit l2 -> Stdlib.compare l1 l2 - | EAbs ((binder1, _), typs1), EAbs ((binder2, _), typs2) -> ( - match list_compare (Pos.compare_marked Typ.compare) typs1 typs2 with + | EAbs (binder1, typs1), EAbs (binder2, typs2) -> ( + match list_compare (Marked.compare Typ.compare) typs1 typs2 with | 0 -> let _, (e1, _), (e2, _) = Bindlib.unmbind2 binder1 binder2 in compare e1 e2 @@ -184,7 +181,7 @@ module Expr = struct match compare just1 just2 with | 0 -> ( match compare cons1 cons2 with - | 0 -> list_compare (Pos.compare_marked compare) exs1 exs2 + | 0 -> list_compare (Marked.compare compare) exs1 exs2 | n -> n) | n -> n) | ( EIfThenElse ((i1, _), (t1, _), (e1, _)), @@ -225,11 +222,11 @@ end module ExprMap = Map.Make (Expr) -let rec locations_used (e : expr Pos.marked) : LocationSet.t = - match Pos.unmark e with - | ELocation l -> LocationSet.singleton (l, Pos.get_position e) +let rec locations_used (e : expr Marked.pos) : LocationSet.t = + match Marked.unmark e with + | ELocation l -> LocationSet.singleton (l, Marked.get_mark e) | EVar _ | ELit _ | EOp _ -> LocationSet.empty - | EAbs ((binder, _), _) -> + | EAbs (binder, _) -> let _, body = Bindlib.unmbind binder in locations_used body | EStruct (_, es) -> @@ -261,21 +258,21 @@ let rec locations_used (e : expr Pos.marked) : LocationSet.t = | ErrorOnEmpty e' -> locations_used e' type io_input = NoInput | OnlyInput | Reentrant -type io = { io_output : bool Pos.marked; io_input : io_input Pos.marked } +type io = { io_output : bool Marked.pos; io_input : io_input Marked.pos } type rule = - | Definition of location Pos.marked * typ Pos.marked * io * expr Pos.marked - | Assertion of expr Pos.marked + | Definition of location Marked.pos * typ Marked.pos * io * expr Marked.pos + | Assertion of expr Marked.pos | Call of ScopeName.t * SubScopeName.t type scope_decl = { scope_decl_name : ScopeName.t; - scope_sig : (typ Pos.marked * io) ScopeVarMap.t; + scope_sig : (typ Marked.pos * io) ScopeVarMap.t; scope_decl_rules : rule list; } -type struct_ctx = (StructFieldName.t * typ Pos.marked) list StructMap.t -type enum_ctx = (EnumConstructor.t * typ Pos.marked) list EnumMap.t +type struct_ctx = (StructFieldName.t * typ Marked.pos) list StructMap.t +type enum_ctx = (EnumConstructor.t * typ Marked.pos) list EnumMap.t type program = { program_scopes : scope_decl ScopeMap.t; @@ -286,46 +283,38 @@ type program = { module Var = struct type t = expr Bindlib.var - let make (s : string Pos.marked) : t = - Bindlib.new_var - (fun (x : expr Bindlib.var) : expr -> EVar (x, Pos.get_position s)) - (Pos.unmark s) + let make (s : string) : t = + Bindlib.new_var (fun (x : expr Bindlib.var) : expr -> EVar x) s let compare x y = Bindlib.compare_vars x y end type vars = expr Bindlib.mvar -let make_var ((x, pos) : Var.t Pos.marked) : expr Pos.marked Bindlib.box = +let make_var ((x, pos) : Var.t Marked.pos) : expr Marked.pos Bindlib.box = Bindlib.box_apply (fun v -> v, pos) (Bindlib.box_var x) let make_abs (xs : vars) - (e : expr Pos.marked Bindlib.box) - (pos_binder : Pos.t) - (taus : typ Pos.marked list) - (pos : Pos.t) : expr Pos.marked Bindlib.box = - Bindlib.box_apply - (fun b -> EAbs ((b, pos_binder), taus), pos) - (Bindlib.bind_mvar xs e) + (e : expr Marked.pos Bindlib.box) + (taus : typ Marked.pos list) + (pos : Pos.t) : expr Marked.pos Bindlib.box = + Bindlib.box_apply (fun b -> EAbs (b, taus), pos) (Bindlib.bind_mvar xs e) let make_app - (e : expr Pos.marked Bindlib.box) - (u : expr Pos.marked Bindlib.box list) - (pos : Pos.t) : expr Pos.marked Bindlib.box = + (e : expr Marked.pos Bindlib.box) + (u : expr Marked.pos Bindlib.box list) + (pos : Pos.t) : expr Marked.pos Bindlib.box = Bindlib.box_apply2 (fun e u -> EApp (e, u), pos) e (Bindlib.box_list u) let make_let_in (x : Var.t) - (tau : typ Pos.marked) - (e1 : expr Pos.marked Bindlib.box) - (e2 : expr Pos.marked Bindlib.box) : expr Pos.marked Bindlib.box = + (tau : typ Marked.pos) + (e1 : expr Marked.pos Bindlib.box) + (e2 : expr Marked.pos Bindlib.box) : expr Marked.pos Bindlib.box = Bindlib.box_apply2 - (fun e u -> EApp (e, u), Pos.get_position (Bindlib.unbox e2)) - (make_abs (Array.of_list [x]) e2 - (Pos.get_position (Bindlib.unbox e2)) - [tau] - (Pos.get_position (Bindlib.unbox e2))) + (fun e u -> EApp (e, u), Marked.get_mark (Bindlib.unbox e2)) + (make_abs (Array.of_list [x]) e2 [tau] (Marked.get_mark (Bindlib.unbox e2))) (Bindlib.box_list [e1]) let make_default ?(pos = Pos.no_pos) exceptions just cons = @@ -344,7 +333,7 @@ let make_default ?(pos = Pos.no_pos) exceptions just cons = EDefault (exceptions, just, cons), pos | [except], Some false, _ -> except | exceptions, _, cons -> - let pos = if pos <> Pos.no_pos then pos else Pos.get_position just in + let pos = if pos <> Pos.no_pos then pos else Marked.get_mark just in EDefault (exceptions, just, cons), pos module VarMap = Map.Make (Var) diff --git a/compiler/scopelang/ast.mli b/compiler/scopelang/ast.mli index f00ad425..764aef36 100644 --- a/compiler/scopelang/ast.mli +++ b/compiler/scopelang/ast.mli @@ -50,11 +50,11 @@ module EnumConstructorMapLift : sig end type location = - | ScopeVar of ScopeVar.t Pos.marked + | ScopeVar of ScopeVar.t Marked.pos | SubScopeVar of - ScopeName.t * SubScopeName.t Pos.marked * ScopeVar.t Pos.marked + ScopeName.t * SubScopeName.t Marked.pos * ScopeVar.t Marked.pos -module LocationSet : Set.S with type elt = location Pos.marked +module LocationSet : Set.S with type elt = location Marked.pos (** {1 Abstract syntax tree} *) @@ -62,36 +62,36 @@ type typ = | TLit of Dcalc.Ast.typ_lit | TStruct of StructName.t | TEnum of EnumName.t - | TArrow of typ Pos.marked * typ Pos.marked + | TArrow of typ Marked.pos * typ Marked.pos | TArray of typ | TAny module Typ : Set.OrderedType with type t = typ +type marked_expr = expr Marked.pos (** The expressions use the {{:https://lepigre.fr/ocaml-bindlib/} Bindlib} library, based on higher-order abstract syntax*) -type expr = + +and expr = | ELocation of location - | EVar of expr Bindlib.var Pos.marked - | EStruct of StructName.t * expr Pos.marked StructFieldMap.t - | EStructAccess of expr Pos.marked * StructFieldName.t * StructName.t - | EEnumInj of expr Pos.marked * EnumConstructor.t * EnumName.t - | EMatch of - expr Pos.marked * EnumName.t * expr Pos.marked EnumConstructorMap.t + | EVar of expr Bindlib.var + | EStruct of StructName.t * marked_expr StructFieldMap.t + | EStructAccess of marked_expr * StructFieldName.t * StructName.t + | EEnumInj of marked_expr * EnumConstructor.t * EnumName.t + | EMatch of marked_expr * EnumName.t * marked_expr EnumConstructorMap.t | ELit of Dcalc.Ast.lit - | EAbs of - (expr, expr Pos.marked) Bindlib.mbinder Pos.marked * typ Pos.marked list - | EApp of expr Pos.marked * expr Pos.marked list + | EAbs of (expr, marked_expr) Bindlib.mbinder * typ Marked.pos list + | EApp of marked_expr * marked_expr list | EOp of Dcalc.Ast.operator - | EDefault of expr Pos.marked list * expr Pos.marked * expr Pos.marked - | EIfThenElse of expr Pos.marked * expr Pos.marked * expr Pos.marked - | EArray of expr Pos.marked list - | ErrorOnEmpty of expr Pos.marked + | EDefault of marked_expr list * marked_expr * marked_expr + | EIfThenElse of marked_expr * marked_expr * marked_expr + | EArray of marked_expr list + | ErrorOnEmpty of marked_expr module Expr : Set.OrderedType with type t = expr module ExprMap : Map.S with type key = expr -val locations_used : expr Pos.marked -> LocationSet.t +val locations_used : expr Marked.pos -> LocationSet.t (** This type characterizes the three levels of visibility for a given scope variable with regards to the scope's input and possible redefinitions inside @@ -108,25 +108,25 @@ type io_input = caller as they appear in the input. *) type io = { - io_output : bool Pos.marked; + io_output : bool Marked.pos; (** [true] is present in the output of the scope. *) - io_input : io_input Pos.marked; + io_input : io_input Marked.pos; } (** Characterization of the input/output status of a scope variable. *) type rule = - | Definition of location Pos.marked * typ Pos.marked * io * expr Pos.marked - | Assertion of expr Pos.marked + | Definition of location Marked.pos * typ Marked.pos * io * expr Marked.pos + | Assertion of expr Marked.pos | Call of ScopeName.t * SubScopeName.t type scope_decl = { scope_decl_name : ScopeName.t; - scope_sig : (typ Pos.marked * io) ScopeVarMap.t; + scope_sig : (typ Marked.pos * io) ScopeVarMap.t; scope_decl_rules : rule list; } -type struct_ctx = (StructFieldName.t * typ Pos.marked) list StructMap.t -type enum_ctx = (EnumConstructor.t * typ Pos.marked) list EnumMap.t +type struct_ctx = (StructFieldName.t * typ Marked.pos) list StructMap.t +type enum_ctx = (EnumConstructor.t * typ Marked.pos) list EnumMap.t type program = { program_scopes : scope_decl ScopeMap.t; @@ -139,7 +139,7 @@ type program = { module Var : sig type t = expr Bindlib.var - val make : string Pos.marked -> t + val make : string -> t val compare : t -> t -> int end @@ -147,35 +147,34 @@ module VarMap : Map.S with type key = Var.t type vars = expr Bindlib.mvar -val make_var : Var.t Pos.marked -> expr Pos.marked Bindlib.box +val make_var : Var.t Marked.pos -> expr Marked.pos Bindlib.box val make_abs : vars -> - expr Pos.marked Bindlib.box -> + expr Marked.pos Bindlib.box -> + typ Marked.pos list -> Pos.t -> - typ Pos.marked list -> - Pos.t -> - expr Pos.marked Bindlib.box + expr Marked.pos Bindlib.box val make_app : - expr Pos.marked Bindlib.box -> - expr Pos.marked Bindlib.box list -> + expr Marked.pos Bindlib.box -> + expr Marked.pos Bindlib.box list -> Pos.t -> - expr Pos.marked Bindlib.box + expr Marked.pos Bindlib.box val make_let_in : Var.t -> - typ Pos.marked -> - expr Pos.marked Bindlib.box -> - expr Pos.marked Bindlib.box -> - expr Pos.marked Bindlib.box + typ Marked.pos -> + expr Marked.pos Bindlib.box -> + expr Marked.pos Bindlib.box -> + expr Marked.pos Bindlib.box val make_default : ?pos:Pos.t -> - expr Pos.marked list -> - expr Pos.marked -> - expr Pos.marked -> - expr Pos.marked + expr Marked.pos list -> + expr Marked.pos -> + expr Marked.pos -> + expr Marked.pos (** [make_default ?pos exceptions just cons] builds a term semantically equivalent to [] (the [EDefault] constructor) while avoiding redundant nested constructions. The position is extracted diff --git a/compiler/scopelang/dependency.ml b/compiler/scopelang/dependency.ml index 99b6d0ac..05248304 100644 --- a/compiler/scopelang/dependency.ml +++ b/compiler/scopelang/dependency.ml @@ -61,14 +61,14 @@ let build_program_dep_graph (prgm : Ast.program) : SDependencies.t = | Ast.Call (subscope, subindex) -> if subscope = scope_name then Errors.raise_spanned_error - (Pos.get_position + (Marked.get_mark (Ast.ScopeName.get_info scope.Ast.scope_decl_name)) "The scope %a is calling into itself as a subscope, which is \ forbidden since Catala does not provide recursion" Ast.ScopeName.format_t scope.Ast.scope_decl_name else Ast.ScopeMap.add subscope - (Pos.get_position (Ast.SubScopeName.get_info subindex)) + (Marked.get_mark (Ast.SubScopeName.get_info subindex)) acc) Ast.ScopeMap.empty scope.Ast.scope_decl_rules in @@ -100,10 +100,11 @@ let check_for_cycle_in_scope (g : SDependencies.t) : unit = let succ_str = Format.asprintf "%a" Ast.ScopeName.format_t succ in [ ( Some ("Cycle variable " ^ var_str ^ ", declared:"), - Pos.get_position var_info ); + Marked.get_mark var_info ); ( Some ("Used here in the definition of another cycle variable " - ^ succ_str ^ ":"), + ^ succ_str + ^ ":"), edge_pos ); ]) scc) @@ -165,8 +166,8 @@ module TTopologicalTraversal = Graph.Topological.Make (TDependencies) module TSCC = Graph.Components.Make (TDependencies) (** Tarjan's stongly connected components algorithm, provided by OCamlGraph *) -let rec get_structs_or_enums_in_type (t : Ast.typ Pos.marked) : TVertexSet.t = - match Pos.unmark t with +let rec get_structs_or_enums_in_type (t : Ast.typ Marked.pos) : TVertexSet.t = + match Marked.unmark t with | Ast.TStruct s -> TVertexSet.singleton (TVertex.Struct s) | Ast.TEnum e -> TVertexSet.singleton (TVertex.Enum e) | Ast.TArrow (t1, t2) -> @@ -174,7 +175,7 @@ let rec get_structs_or_enums_in_type (t : Ast.typ Pos.marked) : TVertexSet.t = (get_structs_or_enums_in_type t1) (get_structs_or_enums_in_type t2) | Ast.TLit _ | Ast.TAny -> TVertexSet.empty - | Ast.TArray t1 -> get_structs_or_enums_in_type (Pos.same_pos_as t1 t) + | Ast.TArray t1 -> get_structs_or_enums_in_type (Marked.same_mark_as t1 t) let build_type_graph (structs : Ast.struct_ctx) (enums : Ast.enum_ctx) : TDependencies.t = @@ -190,13 +191,13 @@ let build_type_graph (structs : Ast.struct_ctx) (enums : Ast.enum_ctx) : TVertexSet.fold (fun used g -> if TVertex.equal used def then - Errors.raise_spanned_error (Pos.get_position typ) + Errors.raise_spanned_error (Marked.get_mark typ) "The type %a is defined using itself, which is forbidden \ since Catala does not provide recursive types" TVertex.format_t used else let edge = - TDependencies.E.create used (Pos.get_position typ) def + TDependencies.E.create used (Marked.get_mark typ) def in TDependencies.add_edge_e g edge) used g) @@ -214,13 +215,13 @@ let build_type_graph (structs : Ast.struct_ctx) (enums : Ast.enum_ctx) : TVertexSet.fold (fun used g -> if TVertex.equal used def then - Errors.raise_spanned_error (Pos.get_position typ) + Errors.raise_spanned_error (Marked.get_mark typ) "The type %a is defined using itself, which is forbidden \ since Catala does not provide recursive types" TVertex.format_t used else let edge = - TDependencies.E.create used (Pos.get_position typ) def + TDependencies.E.create used (Marked.get_mark typ) def in TDependencies.add_edge_e g edge) used g) @@ -251,10 +252,11 @@ let check_type_cycles (structs : Ast.struct_ctx) (enums : Ast.enum_ctx) : let succ_str = Format.asprintf "%a" TVertex.format_t succ in [ ( Some ("Cycle type " ^ var_str ^ ", declared:"), - Pos.get_position var_info ); + Marked.get_mark var_info ); ( Some ("Used here in the definition of another cycle type " - ^ succ_str ^ ":"), + ^ succ_str + ^ ":"), edge_pos ); ]) scc) diff --git a/compiler/scopelang/dependency.mli b/compiler/scopelang/dependency.mli index 0775dca1..01c147c7 100644 --- a/compiler/scopelang/dependency.mli +++ b/compiler/scopelang/dependency.mli @@ -48,6 +48,6 @@ module TVertexSet : Set.S with type elt = TVertex.t module TDependencies : Graph.Sig.P with type V.t = TVertex.t and type E.label = Pos.t -val get_structs_or_enums_in_type : Ast.typ Pos.marked -> TVertexSet.t +val get_structs_or_enums_in_type : Ast.typ Marked.pos -> TVertexSet.t val build_type_graph : Ast.struct_ctx -> Ast.enum_ctx -> TDependencies.t val check_type_cycles : Ast.struct_ctx -> Ast.enum_ctx -> TVertex.t list diff --git a/compiler/scopelang/print.ml b/compiler/scopelang/print.ml index ede11881..68fbb815 100644 --- a/compiler/scopelang/print.ml +++ b/compiler/scopelang/print.ml @@ -17,30 +17,30 @@ open Utils open Ast -let needs_parens (e : expr Pos.marked) : bool = - match Pos.unmark e with EAbs _ -> true | _ -> false +let needs_parens (e : expr Marked.pos) : bool = + match Marked.unmark e with EAbs _ -> true | _ -> false let format_var (fmt : Format.formatter) (v : Var.t) : unit = Format.fprintf fmt "%s_%d" (Bindlib.name_of v) (Bindlib.uid_of v) let format_location (fmt : Format.formatter) (l : location) : unit = match l with - | ScopeVar v -> Format.fprintf fmt "%a" ScopeVar.format_t (Pos.unmark v) + | ScopeVar v -> Format.fprintf fmt "%a" ScopeVar.format_t (Marked.unmark v) | SubScopeVar (_, subindex, subvar) -> - Format.fprintf fmt "%a.%a" SubScopeName.format_t (Pos.unmark subindex) - ScopeVar.format_t (Pos.unmark subvar) + Format.fprintf fmt "%a.%a" SubScopeName.format_t (Marked.unmark subindex) + ScopeVar.format_t (Marked.unmark subvar) -let typ_needs_parens (e : typ Pos.marked) : bool = - match Pos.unmark e with TArrow _ -> true | _ -> false +let typ_needs_parens (e : typ Marked.pos) : bool = + match Marked.unmark e with TArrow _ -> true | _ -> false -let rec format_typ (fmt : Format.formatter) (typ : typ Pos.marked) : unit = - let format_typ_with_parens (fmt : Format.formatter) (t : typ Pos.marked) = +let rec format_typ (fmt : Format.formatter) (typ : typ Marked.pos) : unit = + let format_typ_with_parens (fmt : Format.formatter) (t : typ Marked.pos) = if typ_needs_parens t then Format.fprintf fmt "%a%a%a" Dcalc.Print.format_punctuation "(" format_typ t Dcalc.Print.format_punctuation ")" else Format.fprintf fmt "%a" format_typ t in - match Pos.unmark typ with + match Marked.unmark typ with | TLit l -> Dcalc.Print.format_tlit fmt l | TStruct s -> Format.fprintf fmt "%a" Ast.StructName.format_t s | TEnum e -> Format.fprintf fmt "%a" Ast.EnumName.format_t e @@ -48,24 +48,24 @@ let rec format_typ (fmt : Format.formatter) (typ : typ Pos.marked) : unit = Format.fprintf fmt "@[%a %a@ %a@]" format_typ_with_parens t1 Dcalc.Print.format_operator "→" format_typ t2 | TArray t1 -> - Format.fprintf fmt "@[%a@ %a@]" format_typ (Pos.same_pos_as t1 typ) + Format.fprintf fmt "@[%a@ %a@]" format_typ + (Marked.same_mark_as t1 typ) Dcalc.Print.format_base_type "array" | TAny -> Format.fprintf fmt "any" let rec format_expr ?(debug : bool = false) (fmt : Format.formatter) - (e : expr Pos.marked) : unit = + (e : expr Marked.pos) : unit = let format_expr = format_expr ~debug in - let format_with_parens (fmt : Format.formatter) (e : expr Pos.marked) = + let format_with_parens (fmt : Format.formatter) (e : expr Marked.pos) = if needs_parens e then Format.fprintf fmt "(%a)" format_expr e else Format.fprintf fmt "%a" format_expr e in - match Pos.unmark e with + match Marked.unmark e with | ELocation l -> Format.fprintf fmt "%a" format_location l - | EVar v -> Format.fprintf fmt "%a" format_var (Pos.unmark v) - | ELit l -> - Format.fprintf fmt "%a" Dcalc.Print.format_lit (Pos.same_pos_as l e) + | EVar v -> Format.fprintf fmt "%a" format_var v + | ELit l -> Format.fprintf fmt "%a" Dcalc.Print.format_lit l | EStruct (name, fields) -> Format.fprintf fmt " @[%a@ %a@ %a@ %a@]" Ast.StructName.format_t name Dcalc.Print.format_punctuation "{" @@ -97,7 +97,7 @@ let rec format_expr Dcalc.Print.format_enum_constructor cons_name Dcalc.Print.format_punctuation "→" format_expr case_expr)) (Ast.EnumConstructorMap.bindings cases) - | EApp ((EAbs ((binder, _), taus), _), args) -> + | EApp ((EAbs (binder, taus), _), args) -> let xs, body = Bindlib.unmbind binder in let xs_tau = List.map2 (fun x tau -> x, tau) (Array.to_list xs) taus in let xs_tau_arg = List.map2 (fun (x, tau) arg -> x, tau, arg) xs_tau args in @@ -111,7 +111,7 @@ let rec format_expr Dcalc.Print.format_punctuation "=" format_expr arg Dcalc.Print.format_keyword "in")) xs_tau_arg format_expr body - | EAbs ((binder, _), taus) -> + | EAbs (binder, taus) -> let xs, body = Bindlib.unmbind binder in let xs_tau = List.map2 (fun x tau -> x, tau) (Array.to_list xs) taus in Format.fprintf fmt "@[%a@ %a@ %a@ %a@]" @@ -125,11 +125,11 @@ let rec format_expr xs_tau Dcalc.Print.format_punctuation "→" format_expr body | EApp ((EOp (Binop op), _), [arg1; arg2]) -> Format.fprintf fmt "@[%a@ %a@ %a@]" format_with_parens arg1 - Dcalc.Print.format_binop (op, Pos.no_pos) format_with_parens arg2 + Dcalc.Print.format_binop op format_with_parens arg2 | EApp ((EOp (Unop (Log _)), _), [arg1]) when not debug -> format_expr fmt arg1 | EApp ((EOp (Unop op), _), [arg1]) -> - Format.fprintf fmt "@[%a@ %a@]" Dcalc.Print.format_unop (op, Pos.no_pos) + Format.fprintf fmt "@[%a@ %a@]" Dcalc.Print.format_unop op format_with_parens arg1 | EApp (f, args) -> Format.fprintf fmt "@[%a@ %a@]" format_expr f @@ -141,12 +141,9 @@ let rec format_expr Format.fprintf fmt "@[%a@ %a@ %a@ %a@ %a@ %a@]" Dcalc.Print.format_keyword "if" format_expr e1 Dcalc.Print.format_keyword "then" format_expr e2 Dcalc.Print.format_keyword "else" format_expr e3 - | EOp (Ternop op) -> - Format.fprintf fmt "%a" Dcalc.Print.format_ternop (op, Pos.no_pos) - | EOp (Binop op) -> - Format.fprintf fmt "%a" Dcalc.Print.format_binop (op, Pos.no_pos) - | EOp (Unop op) -> - Format.fprintf fmt "%a" Dcalc.Print.format_unop (op, Pos.no_pos) + | EOp (Ternop op) -> Format.fprintf fmt "%a" Dcalc.Print.format_ternop op + | EOp (Binop op) -> Format.fprintf fmt "%a" Dcalc.Print.format_binop op + | EOp (Unop op) -> Format.fprintf fmt "%a" Dcalc.Print.format_unop op | EDefault (excepts, just, cons) -> if List.length excepts = 0 then Format.fprintf fmt "@[%a%a %a@ %a%a@]" Dcalc.Print.format_punctuation "⟨" @@ -172,7 +169,7 @@ let rec format_expr let format_struct (fmt : Format.formatter) - ((name, fields) : StructName.t * (StructFieldName.t * typ Pos.marked) list) + ((name, fields) : StructName.t * (StructFieldName.t * typ Marked.pos) list) : unit = Format.fprintf fmt "%a %a %a %a@\n@[ %a@]@\n%a" Dcalc.Print.format_keyword "type" StructName.format_t name @@ -186,7 +183,7 @@ let format_struct let format_enum (fmt : Format.formatter) - ((name, cases) : EnumName.t * (EnumConstructor.t * typ Pos.marked) list) : + ((name, cases) : EnumName.t * (EnumConstructor.t * typ Marked.pos) list) : unit = Format.fprintf fmt "%a %a %a @\n@[ %a@]" Dcalc.Print.format_keyword "type" EnumName.format_t name Dcalc.Print.format_punctuation "=" @@ -212,11 +209,11 @@ let format_scope "(" ScopeVar.format_t scope_var Dcalc.Print.format_punctuation ":" format_typ typ Dcalc.Print.format_punctuation "|" Dcalc.Print.format_keyword - (match Pos.unmark vis.io_input with + (match Marked.unmark vis.io_input with | NoInput -> "internal" | OnlyInput -> "input" | Reentrant -> "context") - (if Pos.unmark vis.io_output then fun fmt () -> + (if Marked.unmark vis.io_output then fun fmt () -> Format.fprintf fmt "%a@,%a" Dcalc.Print.format_punctuation "|" Dcalc.Print.format_keyword "output" else fun fmt () -> Format.fprintf fmt "@<0>") @@ -230,16 +227,16 @@ let format_scope match rule with | Definition (loc, typ, _, e) -> Format.fprintf fmt "@[%a %a %a %a %a@ %a@]" - Dcalc.Print.format_keyword "let" format_location (Pos.unmark loc) - Dcalc.Print.format_punctuation ":" format_typ typ - Dcalc.Print.format_punctuation "=" + Dcalc.Print.format_keyword "let" format_location + (Marked.unmark loc) Dcalc.Print.format_punctuation ":" format_typ + typ Dcalc.Print.format_punctuation "=" (fun fmt e -> - match Pos.unmark loc with + match Marked.unmark loc with | SubScopeVar _ -> format_expr fmt e | ScopeVar v -> ( match - Pos.unmark - (snd (ScopeVarMap.find (Pos.unmark v) decl.scope_sig)) + Marked.unmark + (snd (ScopeVarMap.find (Marked.unmark v) decl.scope_sig)) .io_input with | Reentrant -> diff --git a/compiler/scopelang/print.mli b/compiler/scopelang/print.mli index bbcb1a32..ca6b8945 100644 --- a/compiler/scopelang/print.mli +++ b/compiler/scopelang/print.mli @@ -18,12 +18,12 @@ open Utils val format_var : Format.formatter -> Ast.Var.t -> unit val format_location : Format.formatter -> Ast.location -> unit -val format_typ : Format.formatter -> Ast.typ Pos.marked -> unit +val format_typ : Format.formatter -> Ast.typ Marked.pos -> unit val format_expr : ?debug:bool (** [true] for debug printing *) -> Format.formatter -> - Ast.expr Pos.marked -> + Ast.expr Marked.pos -> unit val format_scope : diff --git a/compiler/scopelang/scope_to_dcalc.ml b/compiler/scopelang/scope_to_dcalc.ml index 1221ceb7..764fdf81 100644 --- a/compiler/scopelang/scope_to_dcalc.ml +++ b/compiler/scopelang/scope_to_dcalc.ml @@ -24,8 +24,9 @@ type scope_var_ctx = { type scope_sig_ctx = { scope_sig_local_vars : scope_var_ctx list; (** List of scope variables *) - scope_sig_scope_var : Dcalc.Ast.Var.t; (** Var representing the scope *) - scope_sig_input_var : Dcalc.Ast.Var.t; + scope_sig_scope_var : Dcalc.Ast.untyped Dcalc.Ast.var; + (** Var representing the scope *) + scope_sig_input_var : Dcalc.Ast.untyped Dcalc.Ast.var; (** Var representing the scope input inside the scope func *) scope_sig_input_struct : Ast.StructName.t; (** Scope input *) scope_sig_output_struct : Ast.StructName.t; (** Scope output *) @@ -38,11 +39,12 @@ type ctx = { enums : Ast.enum_ctx; scope_name : Ast.ScopeName.t; scopes_parameters : scope_sigs_ctx; - scope_vars : (Dcalc.Ast.Var.t * Dcalc.Ast.typ * Ast.io) Ast.ScopeVarMap.t; + scope_vars : + (Dcalc.Ast.untyped Dcalc.Ast.var * Dcalc.Ast.typ * Ast.io) Ast.ScopeVarMap.t; subscope_vars : - (Dcalc.Ast.Var.t * Dcalc.Ast.typ * Ast.io) Ast.ScopeVarMap.t + (Dcalc.Ast.untyped Dcalc.Ast.var * Dcalc.Ast.typ * Ast.io) Ast.ScopeVarMap.t Ast.SubScopeMap.t; - local_vars : Dcalc.Ast.Var.t Ast.VarMap.t; + local_vars : Dcalc.Ast.untyped Dcalc.Ast.var Ast.VarMap.t; } let empty_ctx @@ -60,10 +62,10 @@ let empty_ctx local_vars = Ast.VarMap.empty; } -let rec translate_typ (ctx : ctx) (t : Ast.typ Pos.marked) : - Dcalc.Ast.typ Pos.marked = - Pos.same_pos_as - (match Pos.unmark t with +let rec translate_typ (ctx : ctx) (t : Ast.typ Marked.pos) : + Dcalc.Ast.typ Marked.pos = + Marked.same_mark_as + (match Marked.unmark t with | Ast.TLit l -> Dcalc.Ast.TLit l | Ast.TArrow (t1, t2) -> Dcalc.Ast.TArrow (translate_typ ctx t1, translate_typ ctx t2) @@ -76,43 +78,50 @@ let rec translate_typ (ctx : ctx) (t : Ast.typ Pos.marked) : Dcalc.Ast.TEnum (List.map (fun (_, t) -> translate_typ ctx t) e_cases, e_uid) | Ast.TArray t1 -> - Dcalc.Ast.TArray (translate_typ ctx (Pos.same_pos_as t1 t)) + Dcalc.Ast.TArray (translate_typ ctx (Marked.same_mark_as t1 t)) | Ast.TAny -> Dcalc.Ast.TAny) t +let pos_mark (pos : Pos.t) : Dcalc.Ast.untyped Dcalc.Ast.mark = + Dcalc.Ast.Untyped { pos } + +let pos_mark_as e = pos_mark (Marked.get_mark e) + let merge_defaults - (caller : Dcalc.Ast.expr Pos.marked Bindlib.box) - (callee : Dcalc.Ast.expr Pos.marked Bindlib.box) : - Dcalc.Ast.expr Pos.marked Bindlib.box = + (caller : Dcalc.Ast.untyped Dcalc.Ast.marked_expr Bindlib.box) + (callee : Dcalc.Ast.untyped Dcalc.Ast.marked_expr Bindlib.box) : + Dcalc.Ast.untyped Dcalc.Ast.marked_expr Bindlib.box = let caller = + let m = Marked.get_mark (Bindlib.unbox caller) in Dcalc.Ast.make_app caller - [Bindlib.box (Dcalc.Ast.ELit Dcalc.Ast.LUnit, Pos.no_pos)] - Pos.no_pos + [Bindlib.box (Dcalc.Ast.ELit Dcalc.Ast.LUnit, m)] + m in let body = Bindlib.box_apply2 (fun caller callee -> + let m = Marked.get_mark callee in ( Dcalc.Ast.EDefault - ( [caller], - (Dcalc.Ast.ELit (Dcalc.Ast.LBool true), Pos.no_pos), - callee ), - Pos.no_pos )) + ([caller], (Dcalc.Ast.ELit (Dcalc.Ast.LBool true), m), callee), + m )) caller callee in body let tag_with_log_entry - (e : Dcalc.Ast.expr Pos.marked Bindlib.box) + (e : Dcalc.Ast.untyped Dcalc.Ast.marked_expr Bindlib.box) (l : Dcalc.Ast.log_entry) (markings : Utils.Uid.MarkedString.info list) : - Dcalc.Ast.expr Pos.marked Bindlib.box = + Dcalc.Ast.untyped Dcalc.Ast.marked_expr Bindlib.box = Bindlib.box_apply (fun e -> - ( Dcalc.Ast.EApp - ( ( Dcalc.Ast.EOp (Dcalc.Ast.Unop (Dcalc.Ast.Log (l, markings))), - Pos.get_position e ), - [e] ), - Pos.get_position e )) + Marked.same_mark_as + (Dcalc.Ast.EApp + ( Marked.same_mark_as + (Dcalc.Ast.EOp (Dcalc.Ast.Unop (Dcalc.Ast.Log (l, markings)))) + e, + [e] )) + e) e (* In a list of exceptions, it is normally an error if more than a single one @@ -122,8 +131,8 @@ let tag_with_log_entry NOTE: the choice of the exception that will be triggered and show in the trace is arbitrary (but deterministic). *) -let collapse_similar_outcomes (excepts : Ast.expr Pos.marked list) : - Ast.expr Pos.marked list = +let collapse_similar_outcomes (excepts : Ast.expr Marked.pos list) : + Ast.expr Marked.pos list = let cons_map = List.fold_left (fun map -> function @@ -154,241 +163,236 @@ let collapse_similar_outcomes (excepts : Ast.expr Pos.marked list) : in excepts -let rec translate_expr (ctx : ctx) (e : Ast.expr Pos.marked) : - Dcalc.Ast.expr Pos.marked Bindlib.box = - Bindlib.box_apply - (fun (x : Dcalc.Ast.expr) -> Pos.same_pos_as x e) - (match Pos.unmark e with - | EVar v -> Bindlib.box_var (Ast.VarMap.find (Pos.unmark v) ctx.local_vars) - | ELit l -> Bindlib.box (Dcalc.Ast.ELit l) - | EStruct (struct_name, e_fields) -> - let struct_sig = Ast.StructMap.find struct_name ctx.structs in - let d_fields, remaining_e_fields = - List.fold_right - (fun (field_name, _) (d_fields, e_fields) -> - let field_e = Ast.StructFieldMap.find field_name e_fields in - let field_d = translate_expr ctx field_e in - field_d :: d_fields, Ast.StructFieldMap.remove field_name e_fields) - struct_sig ([], e_fields) - in - if Ast.StructFieldMap.cardinal remaining_e_fields > 0 then - Errors.raise_spanned_error (Pos.get_position e) - "The fields \"%a\" do not belong to the structure %a" - Ast.StructName.format_t struct_name - (Format.pp_print_list - ~pp_sep:(fun fmt () -> Format.fprintf fmt ", ") - (fun fmt (field_name, _) -> - Format.fprintf fmt "%a" Ast.StructFieldName.format_t field_name)) - (Ast.StructFieldMap.bindings remaining_e_fields) - else - Bindlib.box_apply - (fun d_fields -> Dcalc.Ast.ETuple (d_fields, Some struct_name)) - (Bindlib.box_list d_fields) - | EStructAccess (e1, field_name, struct_name) -> - let struct_sig = Ast.StructMap.find struct_name ctx.structs in - let _, field_index = - try - List.assoc field_name - (List.mapi (fun i (x, y) -> x, (y, i)) struct_sig) - with Not_found -> - Errors.raise_spanned_error (Pos.get_position e) - "The field \"%a\" does not belong to the structure %a" - Ast.StructFieldName.format_t field_name Ast.StructName.format_t - struct_name - in - let e1 = translate_expr ctx e1 in +let rec translate_expr (ctx : ctx) (e : Ast.expr Marked.pos) : + Dcalc.Ast.untyped Dcalc.Ast.marked_expr Bindlib.box = + Bindlib.box_apply (fun (x : Dcalc.Ast.untyped Dcalc.Ast.expr) -> + Marked.mark (pos_mark_as e) x) + @@ + match Marked.unmark e with + | EVar v -> Bindlib.box_var (Ast.VarMap.find v ctx.local_vars) + | ELit l -> Bindlib.box (Dcalc.Ast.ELit l) + | EStruct (struct_name, e_fields) -> + let struct_sig = Ast.StructMap.find struct_name ctx.structs in + let d_fields, remaining_e_fields = + List.fold_right + (fun (field_name, _) (d_fields, e_fields) -> + let field_e = Ast.StructFieldMap.find field_name e_fields in + let field_d = translate_expr ctx field_e in + field_d :: d_fields, Ast.StructFieldMap.remove field_name e_fields) + struct_sig ([], e_fields) + in + if Ast.StructFieldMap.cardinal remaining_e_fields > 0 then + Errors.raise_spanned_error (Marked.get_mark e) + "The fields \"%a\" do not belong to the structure %a" + Ast.StructName.format_t struct_name + (Format.pp_print_list + ~pp_sep:(fun fmt () -> Format.fprintf fmt ", ") + (fun fmt (field_name, _) -> + Format.fprintf fmt "%a" Ast.StructFieldName.format_t field_name)) + (Ast.StructFieldMap.bindings remaining_e_fields) + else Bindlib.box_apply - (fun e1 -> - Dcalc.Ast.ETupleAccess - ( e1, - field_index, - Some struct_name, - List.map (fun (_, t) -> translate_typ ctx t) struct_sig )) - e1 - | EEnumInj (e1, constructor, enum_name) -> - let enum_sig = Ast.EnumMap.find enum_name ctx.enums in - let _, constructor_index = - try - List.assoc constructor - (List.mapi (fun i (x, y) -> x, (y, i)) enum_sig) - with Not_found -> - Errors.raise_spanned_error (Pos.get_position e) - "The constructor \"%a\" does not belong to the enum %a" - Ast.EnumConstructor.format_t constructor Ast.EnumName.format_t - enum_name - in + (fun d_fields -> Dcalc.Ast.ETuple (d_fields, Some struct_name)) + (Bindlib.box_list d_fields) + | EStructAccess (e1, field_name, struct_name) -> + let struct_sig = Ast.StructMap.find struct_name ctx.structs in + let _, field_index = + try + List.assoc field_name (List.mapi (fun i (x, y) -> x, (y, i)) struct_sig) + with Not_found -> + Errors.raise_spanned_error (Marked.get_mark e) + "The field \"%a\" does not belong to the structure %a" + Ast.StructFieldName.format_t field_name Ast.StructName.format_t + struct_name + in + let e1 = translate_expr ctx e1 in + Bindlib.box_apply + (fun e1 -> + Dcalc.Ast.ETupleAccess + ( e1, + field_index, + Some struct_name, + List.map (fun (_, t) -> translate_typ ctx t) struct_sig )) + e1 + | EEnumInj (e1, constructor, enum_name) -> + let enum_sig = Ast.EnumMap.find enum_name ctx.enums in + let _, constructor_index = + try + List.assoc constructor (List.mapi (fun i (x, y) -> x, (y, i)) enum_sig) + with Not_found -> + Errors.raise_spanned_error (Marked.get_mark e) + "The constructor \"%a\" does not belong to the enum %a" + Ast.EnumConstructor.format_t constructor Ast.EnumName.format_t + enum_name + in + let e1 = translate_expr ctx e1 in + Bindlib.box_apply + (fun e1 -> + Dcalc.Ast.EInj + ( e1, + constructor_index, + enum_name, + List.map (fun (_, t) -> translate_typ ctx t) enum_sig )) + e1 + | EMatch (e1, enum_name, cases) -> + let enum_sig = Ast.EnumMap.find enum_name ctx.enums in + let d_cases, remaining_e_cases = + List.fold_right + (fun (constructor, _) (d_cases, e_cases) -> + let case_e = + try Ast.EnumConstructorMap.find constructor e_cases + with Not_found -> + Errors.raise_spanned_error (Marked.get_mark e) + "The constructor %a of enum %a is missing from this pattern \ + matching" + Ast.EnumConstructor.format_t constructor Ast.EnumName.format_t + enum_name + in + let case_d = translate_expr ctx case_e in + case_d :: d_cases, Ast.EnumConstructorMap.remove constructor e_cases) + enum_sig ([], cases) + in + if Ast.EnumConstructorMap.cardinal remaining_e_cases > 0 then + Errors.raise_spanned_error (Marked.get_mark e) + "Patter matching is incomplete for enum %a: missing cases %a" + Ast.EnumName.format_t enum_name + (Format.pp_print_list + ~pp_sep:(fun fmt () -> Format.fprintf fmt ", ") + (fun fmt (case_name, _) -> + Format.fprintf fmt "%a" Ast.EnumConstructor.format_t case_name)) + (Ast.EnumConstructorMap.bindings remaining_e_cases) + else let e1 = translate_expr ctx e1 in - Bindlib.box_apply - (fun e1 -> - Dcalc.Ast.EInj - ( e1, - constructor_index, - enum_name, - List.map (fun (_, t) -> translate_typ ctx t) enum_sig )) - e1 - | EMatch (e1, enum_name, cases) -> - let enum_sig = Ast.EnumMap.find enum_name ctx.enums in - let d_cases, remaining_e_cases = - List.fold_right - (fun (constructor, _) (d_cases, e_cases) -> - let case_e = - try Ast.EnumConstructorMap.find constructor e_cases - with Not_found -> - Errors.raise_spanned_error (Pos.get_position e) - "The constructor %a of enum %a is missing from this pattern \ - matching" - Ast.EnumConstructor.format_t constructor Ast.EnumName.format_t - enum_name - in - let case_d = translate_expr ctx case_e in - case_d :: d_cases, Ast.EnumConstructorMap.remove constructor e_cases) - enum_sig ([], cases) - in - if Ast.EnumConstructorMap.cardinal remaining_e_cases > 0 then - Errors.raise_spanned_error (Pos.get_position e) - "Patter matching is incomplete for enum %a: missing cases %a" - Ast.EnumName.format_t enum_name - (Format.pp_print_list - ~pp_sep:(fun fmt () -> Format.fprintf fmt ", ") - (fun fmt (case_name, _) -> - Format.fprintf fmt "%a" Ast.EnumConstructor.format_t case_name)) - (Ast.EnumConstructorMap.bindings remaining_e_cases) - else - let e1 = translate_expr ctx e1 in - Bindlib.box_apply2 - (fun d_fields e1 -> Dcalc.Ast.EMatch (e1, d_fields, enum_name)) - (Bindlib.box_list d_cases) e1 - | EApp (e1, args) -> - (* We insert various log calls to record arguments and outputs of - user-defined functions belonging to scopes *) - let e1_func = translate_expr ctx e1 in - let markings l = - match l with - | Ast.ScopeVar (v, _) -> - [Ast.ScopeName.get_info ctx.scope_name; Ast.ScopeVar.get_info v] - | Ast.SubScopeVar (s, _, (v, _)) -> - [Ast.ScopeName.get_info s; Ast.ScopeVar.get_info v] - in - let e1_func = - match Pos.unmark e1 with - | ELocation l -> - tag_with_log_entry e1_func Dcalc.Ast.BeginCall (markings l) - | _ -> e1_func - in - let new_args = List.map (translate_expr ctx) args in - let input_typ, output_typ = - (* NOTE: this is a temporary solution, it works because it's assume that - all function calls are from scope variable. However, this will change - -- for more information see - https://github.com/CatalaLang/catala/pull/280#discussion_r898851693. *) - let retrieve_in_and_out_typ_or_any var vars = - let _, typ, _ = Ast.ScopeVarMap.find (Pos.unmark var) vars in - match typ with - | Dcalc.Ast.TArrow (marked_input_typ, marked_output_typ) -> - Pos.unmark marked_input_typ, Pos.unmark marked_output_typ - | _ -> Dcalc.Ast.TAny, Dcalc.Ast.TAny - in - match Pos.unmark e1 with - | ELocation (ScopeVar var) -> - retrieve_in_and_out_typ_or_any var ctx.scope_vars - | ELocation (SubScopeVar (_, sname, var)) -> - ctx.subscope_vars - |> Ast.SubScopeMap.find (Pos.unmark sname) - |> retrieve_in_and_out_typ_or_any var + Bindlib.box_apply2 + (fun d_fields e1 -> Dcalc.Ast.EMatch (e1, d_fields, enum_name)) + (Bindlib.box_list d_cases) e1 + | EApp (e1, args) -> + (* We insert various log calls to record arguments and outputs of + user-defined functions belonging to scopes *) + let e1_func = translate_expr ctx e1 in + let markings l = + match l with + | Ast.ScopeVar (v, _) -> + [Ast.ScopeName.get_info ctx.scope_name; Ast.ScopeVar.get_info v] + | Ast.SubScopeVar (s, _, (v, _)) -> + [Ast.ScopeName.get_info s; Ast.ScopeVar.get_info v] + in + let e1_func = + match Marked.unmark e1 with + | ELocation l -> + tag_with_log_entry e1_func Dcalc.Ast.BeginCall (markings l) + | _ -> e1_func + in + let new_args = List.map (translate_expr ctx) args in + let input_typ, output_typ = + (* NOTE: this is a temporary solution, it works because it's assume that + all function calls are from scope variable. However, this will change + -- for more information see + https://github.com/CatalaLang/catala/pull/280#discussion_r898851693. *) + let retrieve_in_and_out_typ_or_any var vars = + let _, typ, _ = Ast.ScopeVarMap.find (Marked.unmark var) vars in + match typ with + | Dcalc.Ast.TArrow (marked_input_typ, marked_output_typ) -> + Marked.unmark marked_input_typ, Marked.unmark marked_output_typ | _ -> Dcalc.Ast.TAny, Dcalc.Ast.TAny in - let new_args = - match Pos.unmark e1, new_args with - | ELocation l, [new_arg] -> - [ - tag_with_log_entry new_arg (Dcalc.Ast.VarDef input_typ) - (markings l @ [Pos.same_pos_as "input" e]); - ] - | _ -> new_args + match Marked.unmark e1 with + | ELocation (ScopeVar var) -> + retrieve_in_and_out_typ_or_any var ctx.scope_vars + | ELocation (SubScopeVar (_, sname, var)) -> + ctx.subscope_vars + |> Ast.SubScopeMap.find (Marked.unmark sname) + |> retrieve_in_and_out_typ_or_any var + | _ -> Dcalc.Ast.TAny, Dcalc.Ast.TAny + in + let new_args = + match Marked.unmark e1, new_args with + | ELocation l, [new_arg] -> + [ + tag_with_log_entry new_arg (Dcalc.Ast.VarDef input_typ) + (markings l @ [Marked.same_mark_as "input" e]); + ] + | _ -> new_args + in + let new_e = + Bindlib.box_apply2 + (fun e' u -> Dcalc.Ast.EApp (e', u), pos_mark_as e) + e1_func + (Bindlib.box_list new_args) + in + let new_e = + match Marked.unmark e1 with + | ELocation l -> + tag_with_log_entry + (tag_with_log_entry new_e (Dcalc.Ast.VarDef output_typ) + (markings l @ [Marked.same_mark_as "output" e])) + Dcalc.Ast.EndCall (markings l) + | _ -> new_e + in + Bindlib.box_apply Marked.unmark new_e + | EAbs (binder, typ) -> + let xs, body = Bindlib.unmbind binder in + let new_xs = + Array.map (fun x -> Dcalc.Ast.new_var (Bindlib.name_of x)) xs + in + let both_xs = Array.map2 (fun x new_x -> x, new_x) xs new_xs in + let body = + translate_expr + { + ctx with + local_vars = + Array.fold_left + (fun local_vars (x, new_x) -> Ast.VarMap.add x new_x local_vars) + ctx.local_vars both_xs; + } + body + in + let binder = Bindlib.bind_mvar new_xs body in + Bindlib.box_apply + (fun b -> Dcalc.Ast.EAbs (b, List.map (translate_typ ctx) typ)) + binder + | EDefault (excepts, just, cons) -> + let excepts = collapse_similar_outcomes excepts in + Bindlib.box_apply3 + (fun e j c -> Dcalc.Ast.EDefault (e, j, c)) + (Bindlib.box_list (List.map (translate_expr ctx) excepts)) + (translate_expr ctx just) (translate_expr ctx cons) + | ELocation (ScopeVar a) -> + let v, _, _ = Ast.ScopeVarMap.find (Marked.unmark a) ctx.scope_vars in + Bindlib.box_var v + | ELocation (SubScopeVar (_, s, a)) -> ( + try + let v, _, _ = + Ast.ScopeVarMap.find (Marked.unmark a) + (Ast.SubScopeMap.find (Marked.unmark s) ctx.subscope_vars) in - let new_e = - Bindlib.box_apply2 - (fun e' u -> Dcalc.Ast.EApp (e', u), Pos.get_position e) - e1_func - (Bindlib.box_list new_args) - in - let new_e = - match Pos.unmark e1 with - | ELocation l -> - tag_with_log_entry - (tag_with_log_entry new_e (Dcalc.Ast.VarDef output_typ) - (markings l @ [Pos.same_pos_as "output" e])) - Dcalc.Ast.EndCall (markings l) - | _ -> new_e - in - Bindlib.box_apply Pos.unmark new_e - | EAbs ((binder, pos_binder), typ) -> - let xs, body = Bindlib.unmbind binder in - let new_xs = - Array.map - (fun x -> Dcalc.Ast.Var.make (Bindlib.name_of x, Pos.no_pos)) - xs - in - let both_xs = Array.map2 (fun x new_x -> x, new_x) xs new_xs in - let body = - translate_expr - { - ctx with - local_vars = - Array.fold_left - (fun local_vars (x, new_x) -> Ast.VarMap.add x new_x local_vars) - ctx.local_vars both_xs; - } - body - in - let binder = Bindlib.bind_mvar new_xs body in - Bindlib.box_apply - (fun b -> - Dcalc.Ast.EAbs ((b, pos_binder), List.map (translate_typ ctx) typ)) - binder - | EDefault (excepts, just, cons) -> - let excepts = collapse_similar_outcomes excepts in - Bindlib.box_apply3 - (fun e j c -> Dcalc.Ast.EDefault (e, j, c)) - (Bindlib.box_list (List.map (translate_expr ctx) excepts)) - (translate_expr ctx just) (translate_expr ctx cons) - | ELocation (ScopeVar a) -> - let v, _, _ = Ast.ScopeVarMap.find (Pos.unmark a) ctx.scope_vars in Bindlib.box_var v - | ELocation (SubScopeVar (_, s, a)) -> ( - try - let v, _, _ = - Ast.ScopeVarMap.find (Pos.unmark a) - (Ast.SubScopeMap.find (Pos.unmark s) ctx.subscope_vars) - in - Bindlib.box_var v - with Not_found -> - Errors.raise_multispanned_error - [ - Some "Incriminated variable usage:", Pos.get_position e; - ( Some "Incriminated subscope variable declaration:", - Pos.get_position (Ast.ScopeVar.get_info (Pos.unmark a)) ); - ( Some "Incriminated subscope declaration:", - Pos.get_position (Ast.SubScopeName.get_info (Pos.unmark s)) ); - ] - "The variable %a.%a cannot be used here, as it is not part subscope \ - %a's results. Maybe you forgot to qualify it as an output?" - Ast.SubScopeName.format_t (Pos.unmark s) Ast.ScopeVar.format_t - (Pos.unmark a) Ast.SubScopeName.format_t (Pos.unmark s)) - | EIfThenElse (cond, et, ef) -> - Bindlib.box_apply3 - (fun c t f -> Dcalc.Ast.EIfThenElse (c, t, f)) - (translate_expr ctx cond) (translate_expr ctx et) - (translate_expr ctx ef) - | EOp op -> Bindlib.box (Dcalc.Ast.EOp op) - | ErrorOnEmpty e' -> - Bindlib.box_apply - (fun e' -> Dcalc.Ast.ErrorOnEmpty e') - (translate_expr ctx e') - | EArray es -> - Bindlib.box_apply - (fun es -> Dcalc.Ast.EArray es) - (Bindlib.box_list (List.map (translate_expr ctx) es))) + with Not_found -> + Errors.raise_multispanned_error + [ + Some "Incriminated variable usage:", Marked.get_mark e; + ( Some "Incriminated subscope variable declaration:", + Marked.get_mark (Ast.ScopeVar.get_info (Marked.unmark a)) ); + ( Some "Incriminated subscope declaration:", + Marked.get_mark (Ast.SubScopeName.get_info (Marked.unmark s)) ); + ] + "The variable %a.%a cannot be used here, as it is not part subscope \ + %a's results. Maybe you forgot to qualify it as an output?" + Ast.SubScopeName.format_t (Marked.unmark s) Ast.ScopeVar.format_t + (Marked.unmark a) Ast.SubScopeName.format_t (Marked.unmark s)) + | EIfThenElse (cond, et, ef) -> + Bindlib.box_apply3 + (fun c t f -> Dcalc.Ast.EIfThenElse (c, t, f)) + (translate_expr ctx cond) (translate_expr ctx et) (translate_expr ctx ef) + | EOp op -> Bindlib.box (Dcalc.Ast.EOp op) + | ErrorOnEmpty e' -> + Bindlib.box_apply + (fun e' -> Dcalc.Ast.ErrorOnEmpty e') + (translate_expr ctx e') + | EArray es -> + Bindlib.box_apply + (fun es -> Dcalc.Ast.EArray es) + (Bindlib.box_list (List.map (translate_expr ctx) es)) (** The result of a rule translation is a list of assignment, with variables and expressions. We also return the new translation context available after the @@ -399,21 +403,27 @@ let translate_rule (ctx : ctx) (rule : Ast.rule) ((sigma_name, pos_sigma) : Utils.Uid.MarkedString.info) : - (Dcalc.Ast.expr Dcalc.Ast.scope_body_expr Bindlib.box -> - Dcalc.Ast.expr Dcalc.Ast.scope_body_expr Bindlib.box) + (( Dcalc.Ast.untyped Dcalc.Ast.expr, + Dcalc.Ast.untyped ) + Dcalc.Ast.scope_body_expr + Bindlib.box -> + ( Dcalc.Ast.untyped Dcalc.Ast.expr, + Dcalc.Ast.untyped ) + Dcalc.Ast.scope_body_expr + Bindlib.box) * ctx = match rule with | Definition ((ScopeVar a, var_def_pos), tau, a_io, e) -> - let a_name = Ast.ScopeVar.get_info (Pos.unmark a) in - let a_var = Dcalc.Ast.Var.make a_name in + let a_name = Ast.ScopeVar.get_info (Marked.unmark a) in + let a_var = Dcalc.Ast.new_var (Marked.unmark a_name) in let tau = translate_typ ctx tau in let new_e = translate_expr ctx e in - let a_expr = Dcalc.Ast.make_var (a_var, var_def_pos) in + let a_expr = Dcalc.Ast.make_var (a_var, pos_mark var_def_pos) in let merged_expr = Bindlib.box_apply (fun merged_expr -> - Dcalc.Ast.ErrorOnEmpty merged_expr, Pos.get_position a_name) - (match Pos.unmark a_io.io_input with + Dcalc.Ast.ErrorOnEmpty merged_expr, pos_mark_as a_name) + (match Marked.unmark a_io.io_input with | OnlyInput -> failwith "should not happen" (* scopelang should not contain any definitions of input only @@ -423,7 +433,7 @@ let translate_rule in let merged_expr = tag_with_log_entry merged_expr - (Dcalc.Ast.VarDef (Pos.unmark tau)) + (Dcalc.Ast.VarDef (Marked.unmark tau)) [sigma_name, pos_sigma; a_name] in ( (fun next -> @@ -435,15 +445,15 @@ let translate_rule Dcalc.Ast.scope_let_typ = tau; Dcalc.Ast.scope_let_expr = merged_expr; Dcalc.Ast.scope_let_kind = Dcalc.Ast.ScopeVarDefinition; - Dcalc.Ast.scope_let_pos = Pos.get_position a; + Dcalc.Ast.scope_let_pos = Marked.get_mark a; }) (Bindlib.bind_var a_var next) merged_expr), { ctx with scope_vars = - Ast.ScopeVarMap.add (Pos.unmark a) - (a_var, Pos.unmark tau, a_io) + Ast.ScopeVarMap.add (Marked.unmark a) + (a_var, Marked.unmark tau, a_io) ctx.scope_vars; } ) | Definition @@ -452,32 +462,34 @@ let translate_rule a_io, e ) -> let a_name = - Pos.map_under_mark + Marked.map_under_mark (fun str -> - str ^ "." ^ Pos.unmark (Ast.ScopeVar.get_info (Pos.unmark subs_var))) - (Ast.SubScopeName.get_info (Pos.unmark subs_index)) + str + ^ "." + ^ Marked.unmark (Ast.ScopeVar.get_info (Marked.unmark subs_var))) + (Ast.SubScopeName.get_info (Marked.unmark subs_index)) in - let a_var = Dcalc.Ast.Var.make a_name in + let a_var = Dcalc.Ast.new_var (Marked.unmark a_name) in let tau = translate_typ ctx tau in let new_e = tag_with_log_entry (translate_expr ctx e) - (Dcalc.Ast.VarDef (Pos.unmark tau)) + (Dcalc.Ast.VarDef (Marked.unmark tau)) [sigma_name, pos_sigma; a_name] in - let silent_var = Dcalc.Ast.Var.make ("_", Pos.no_pos) in + let silent_var = Dcalc.Ast.new_var "_" in let thunked_or_nonempty_new_e = - match Pos.unmark a_io.io_input with + match Marked.unmark a_io.io_input with | NoInput -> failwith "should not happen" | OnlyInput -> Bindlib.box_apply - (fun new_e -> Dcalc.Ast.ErrorOnEmpty new_e, Pos.get_position subs_var) + (fun new_e -> Dcalc.Ast.ErrorOnEmpty new_e, pos_mark_as subs_var) new_e | Reentrant -> Dcalc.Ast.make_abs (Array.of_list [silent_var]) - new_e var_def_pos + new_e [Dcalc.Ast.TLit TUnit, var_def_pos] - var_def_pos + (pos_mark var_def_pos) in ( (fun next -> Bindlib.box_apply2 @@ -485,9 +497,9 @@ let translate_rule Dcalc.Ast.ScopeLet { Dcalc.Ast.scope_let_next = next; - Dcalc.Ast.scope_let_pos = Pos.get_position a_name; + Dcalc.Ast.scope_let_pos = Marked.get_mark a_name; Dcalc.Ast.scope_let_typ = - (match Pos.unmark a_io.io_input with + (match Marked.unmark a_io.io_input with | NoInput -> failwith "should not happen" | OnlyInput -> tau | Reentrant -> @@ -501,18 +513,18 @@ let translate_rule { ctx with subscope_vars = - Ast.SubScopeMap.update (Pos.unmark subs_index) + Ast.SubScopeMap.update (Marked.unmark subs_index) (fun map -> match map with | Some map -> Some - (Ast.ScopeVarMap.add (Pos.unmark subs_var) - (a_var, Pos.unmark tau, a_io) + (Ast.ScopeVarMap.add (Marked.unmark subs_var) + (a_var, Marked.unmark tau, a_io) map) | None -> Some - (Ast.ScopeVarMap.singleton (Pos.unmark subs_var) - (a_var, Pos.unmark tau, a_io))) + (Ast.ScopeVarMap.singleton (Marked.unmark subs_var) + (a_var, Marked.unmark tau, a_io))) ctx.subscope_vars; } ) | Call (subname, subindex) -> @@ -521,14 +533,14 @@ let translate_rule let all_subscope_input_vars = List.filter (fun var_ctx -> - match Pos.unmark var_ctx.scope_var_io.Ast.io_input with + match Marked.unmark var_ctx.scope_var_io.Ast.io_input with | NoInput -> false | _ -> true) all_subscope_vars in let all_subscope_output_vars = List.filter - (fun var_ctx -> Pos.unmark var_ctx.scope_var_io.Ast.io_output) + (fun var_ctx -> Marked.unmark var_ctx.scope_var_io.Ast.io_output) all_subscope_vars in let scope_dcalc_var = subscope_sig.scope_sig_scope_var in @@ -541,39 +553,39 @@ let translate_rule let subscope_var_not_yet_defined subvar = not (Ast.ScopeVarMap.mem subvar subscope_vars_defined) in - let pos_call = Pos.get_position (Ast.SubScopeName.get_info subindex) in + let pos_call = Marked.get_mark (Ast.SubScopeName.get_info subindex) in let subscope_args = List.map (fun (subvar : scope_var_ctx) -> if subscope_var_not_yet_defined subvar.scope_var_name then - (* This is a redundant check. Normally, all subscope varaibles + (* This is a redundant check. Normally, all subscope variables should have been defined (even an empty definition, if they're not defined by any rule in the source code) by the translation from desugared to the scope language. *) - Bindlib.box Dcalc.Ast.empty_thunked_term + Bindlib.box + (Dcalc.Ast.empty_thunked_term (Untyped { pos = pos_call })) else let a_var, _, _ = Ast.ScopeVarMap.find subvar.scope_var_name subscope_vars_defined in - Dcalc.Ast.make_var (a_var, pos_call)) + Dcalc.Ast.make_var (a_var, pos_mark pos_call)) all_subscope_input_vars in let subscope_struct_arg = Bindlib.box_apply (fun subscope_args -> ( Dcalc.Ast.ETuple (subscope_args, Some called_scope_input_struct), - pos_call )) + pos_mark pos_call )) (Bindlib.box_list subscope_args) in let all_subscope_output_vars_dcalc = List.map (fun (subvar : scope_var_ctx) -> let sub_dcalc_var = - Dcalc.Ast.Var.make - (Pos.map_under_mark - (fun s -> - Pos.unmark (Ast.SubScopeName.get_info subindex) ^ "." ^ s) - (Ast.ScopeVar.get_info subvar.scope_var_name)) + Dcalc.Ast.new_var + (Marked.unmark (Ast.SubScopeName.get_info subindex) + ^ "." + ^ Marked.unmark (Ast.ScopeVar.get_info subvar.scope_var_name)) in subvar, sub_dcalc_var) all_subscope_output_vars @@ -581,8 +593,7 @@ let translate_rule let subscope_func = tag_with_log_entry (Dcalc.Ast.make_var - ( scope_dcalc_var, - Pos.get_position (Ast.SubScopeName.get_info subindex) )) + (scope_dcalc_var, pos_mark_as (Ast.SubScopeName.get_info subindex))) Dcalc.Ast.BeginCall [ sigma_name, pos_sigma; @@ -593,7 +604,7 @@ let translate_rule let call_expr = tag_with_log_entry (Bindlib.box_apply2 - (fun e u -> Dcalc.Ast.EApp (e, [u]), Pos.no_pos) + (fun e u -> Dcalc.Ast.EApp (e, [u]), pos_mark Pos.no_pos) subscope_func subscope_struct_arg) Dcalc.Ast.EndCall [ @@ -602,7 +613,7 @@ let translate_rule Ast.ScopeName.get_info subname; ] in - let result_tuple_var = Dcalc.Ast.Var.make ("result", pos_sigma) in + let result_tuple_var = Dcalc.Ast.new_var "result" in let result_tuple_typ = ( Dcalc.Ast.TTuple ( List.map @@ -611,8 +622,7 @@ let translate_rule Some called_scope_return_struct ), pos_sigma ) in - let call_scope_let - (next : Dcalc.Ast.expr Dcalc.Ast.scope_body_expr Bindlib.box) = + let call_scope_let next = Bindlib.box_apply2 (fun next call_expr -> Dcalc.Ast.ScopeLet @@ -626,8 +636,7 @@ let translate_rule (Bindlib.bind_var result_tuple_var next) call_expr in - let result_bindings_lets - (next : Dcalc.Ast.expr Dcalc.Ast.scope_body_expr Bindlib.box) = + let result_bindings_lets next = List.fold_right (fun (var_ctx, v) (next, i) -> ( Bindlib.box_apply2 @@ -648,10 +657,10 @@ let translate_rule (fun (var_ctx, _) -> var_ctx.scope_var_typ, pos_sigma) all_subscope_output_vars_dcalc ), - pos_sigma ); + pos_mark pos_sigma ); }) (Bindlib.bind_var v next) - (Dcalc.Ast.make_var (result_tuple_var, pos_sigma)), + (Dcalc.Ast.make_var (result_tuple_var, pos_mark pos_sigma)), i - 1 )) all_subscope_output_vars_dcalc (next, List.length all_subscope_output_vars_dcalc - 1) @@ -677,19 +686,19 @@ let translate_rule Dcalc.Ast.ScopeLet { Dcalc.Ast.scope_let_next = next; - Dcalc.Ast.scope_let_pos = Pos.get_position e; + Dcalc.Ast.scope_let_pos = Marked.get_mark e; Dcalc.Ast.scope_let_typ = - Dcalc.Ast.TLit TUnit, Pos.get_position e; + Dcalc.Ast.TLit TUnit, Marked.get_mark e; Dcalc.Ast.scope_let_expr = (* To ensure that we throw an error if the value is not defined, we add an check "ErrorOnEmpty" here. *) - Pos.same_pos_as + Marked.same_mark_as (Dcalc.Ast.EAssert - (Dcalc.Ast.ErrorOnEmpty new_e, Pos.get_position e)) + (Dcalc.Ast.ErrorOnEmpty new_e, pos_mark_as e)) new_e; Dcalc.Ast.scope_let_kind = Dcalc.Ast.Assertion; }) - (Bindlib.bind_var (Dcalc.Ast.Var.make ("_", Pos.get_position e)) next) + (Bindlib.bind_var (Dcalc.Ast.new_var "_") next) new_e), ctx ) @@ -698,7 +707,11 @@ let translate_rules (rules : Ast.rule list) ((sigma_name, pos_sigma) : Utils.Uid.MarkedString.info) (sigma_return_struct_name : Ast.StructName.t) : - Dcalc.Ast.expr Dcalc.Ast.scope_body_expr Bindlib.box * ctx = + ( Dcalc.Ast.untyped Dcalc.Ast.expr, + Dcalc.Ast.untyped ) + Dcalc.Ast.scope_body_expr + Bindlib.box + * ctx = let scope_lets, new_ctx = List.fold_left (fun (scope_lets, ctx) rule -> @@ -712,17 +725,18 @@ let translate_rules let scope_variables = Ast.ScopeVarMap.bindings new_ctx.scope_vars in let scope_output_variables = List.filter - (fun (_, (_, _, io)) -> Pos.unmark io.Ast.io_output) + (fun (_, (_, _, io)) -> Marked.unmark io.Ast.io_output) scope_variables in let return_exp = Bindlib.box_apply (fun args -> - Dcalc.Ast.ETuple (args, Some sigma_return_struct_name), pos_sigma) + ( Dcalc.Ast.ETuple (args, Some sigma_return_struct_name), + pos_mark pos_sigma )) (Bindlib.box_list (List.map (fun (_, (dcalc_var, _, _)) -> - Dcalc.Ast.make_var (dcalc_var, pos_sigma)) + Dcalc.Ast.make_var (dcalc_var, pos_mark pos_sigma)) scope_output_variables)) in ( scope_lets @@ -737,7 +751,9 @@ let translate_scope_decl (sctx : scope_sigs_ctx) (scope_name : Ast.ScopeName.t) (sigma : Ast.scope_decl) : - Dcalc.Ast.expr Dcalc.Ast.scope_body Bindlib.box * Dcalc.Ast.struct_ctx = + (Dcalc.Ast.untyped Dcalc.Ast.expr, Dcalc.Ast.untyped) Dcalc.Ast.scope_body + Bindlib.box + * Dcalc.Ast.struct_ctx = let sigma_info = Ast.ScopeName.get_info sigma.scope_decl_name in let scope_sig = Ast.ScopeMap.find sigma.scope_decl_name sctx in let scope_variables = scope_sig.scope_sig_local_vars in @@ -746,10 +762,12 @@ let translate_scope_decl scope variables *) List.fold_left (fun ctx scope_var -> - match Pos.unmark scope_var.scope_var_io.io_input with + match Marked.unmark scope_var.scope_var_io.io_input with | OnlyInput -> let scope_var_name = Ast.ScopeVar.get_info scope_var.scope_var_name in - let scope_var_dcalc = Dcalc.Ast.Var.make scope_var_name in + let scope_var_dcalc = + Dcalc.Ast.new_var (Marked.unmark scope_var_name) + in { ctx with scope_vars = @@ -766,7 +784,7 @@ let translate_scope_decl let scope_input_var = scope_sig.scope_sig_input_var in let scope_input_struct_name = scope_sig.scope_sig_input_struct in let scope_return_struct_name = scope_sig.scope_sig_output_struct in - let pos_sigma = Pos.get_position sigma_info in + let pos_sigma = Marked.get_mark sigma_info in let rules_with_return_expr, ctx = translate_rules ctx sigma.scope_decl_rules sigma_info scope_return_struct_name @@ -784,18 +802,18 @@ let translate_scope_decl let scope_input_variables = List.filter (fun (var_ctx, _) -> - match Pos.unmark var_ctx.scope_var_io.io_input with + match Marked.unmark var_ctx.scope_var_io.io_input with | NoInput -> false | _ -> true) scope_variables in let scope_output_variables = List.filter - (fun (var_ctx, _) -> Pos.unmark var_ctx.scope_var_io.io_output) + (fun (var_ctx, _) -> Marked.unmark var_ctx.scope_var_io.io_output) scope_variables in let input_var_typ (var_ctx : scope_var_ctx) = - match Pos.unmark var_ctx.scope_var_io.io_input with + match Marked.unmark var_ctx.scope_var_io.io_input with | OnlyInput -> var_ctx.scope_var_typ, pos_sigma | Reentrant -> ( Dcalc.Ast.TArrow @@ -803,8 +821,7 @@ let translate_scope_decl pos_sigma ) | NoInput -> failwith "should not happen" in - let input_destructurings - (next : Dcalc.Ast.expr Dcalc.Ast.scope_body_expr Bindlib.box) = + let input_destructurings next = fst (List.fold_right (fun (var_ctx, v) (next, i) -> @@ -825,10 +842,10 @@ let translate_scope_decl List.map (fun (var_ctx, _) -> input_var_typ var_ctx) scope_input_variables ), - pos_sigma ); + pos_mark pos_sigma ); }) (Bindlib.bind_var v next) - (Dcalc.Ast.make_var (scope_input_var, pos_sigma)), + (Dcalc.Ast.make_var (scope_input_var, pos_mark pos_sigma)), i - 1 )) scope_input_variables (next, List.length scope_input_variables - 1)) @@ -868,7 +885,7 @@ let translate_scope_decl new_struct_ctx ) let translate_program (prgm : Ast.program) : - Dcalc.Ast.program * Dependency.TVertex.t list = + Dcalc.Ast.untyped Dcalc.Ast.program * Dependency.TVertex.t list = let scope_dependencies = Dependency.build_program_dep_graph prgm in Dependency.check_for_cycle_in_scope scope_dependencies; let types_ordering = @@ -899,23 +916,22 @@ let translate_program (prgm : Ast.program) : Ast.ScopeMap.mapi (fun scope_name scope -> let scope_dvar = - Dcalc.Ast.Var.make (Ast.ScopeName.get_info scope.Ast.scope_decl_name) + Dcalc.Ast.new_var + (Marked.unmark (Ast.ScopeName.get_info scope.Ast.scope_decl_name)) in let scope_return_struct_name = Ast.StructName.fresh - (Pos.map_under_mark + (Marked.map_under_mark (fun s -> s ^ "_out") (Ast.ScopeName.get_info scope_name)) in let scope_input_var = - Dcalc.Ast.Var.make - (Pos.map_under_mark - (fun s -> s ^ "_in") - (Ast.ScopeName.get_info scope_name)) + Dcalc.Ast.new_var + (Marked.unmark (Ast.ScopeName.get_info scope_name) ^ "_in") in let scope_input_struct_name = Ast.StructName.fresh - (Pos.map_under_mark + (Marked.map_under_mark (fun s -> s ^ "_in") (Ast.ScopeName.get_info scope_name)) in @@ -928,7 +944,7 @@ let translate_program (prgm : Ast.program) : in { scope_var_name = scope_var; - scope_var_typ = Pos.unmark tau; + scope_var_typ = Marked.unmark tau; scope_var_io = vis; }) (Ast.ScopeVarMap.bindings scope.scope_sig); @@ -941,7 +957,10 @@ let translate_program (prgm : Ast.program) : in (* the resulting expression is the list of definitions of all the scopes, ending with the top-level scope. *) - let (scopes, decl_ctx) : Dcalc.Ast.expr Dcalc.Ast.scopes Bindlib.box * _ = + let (scopes, decl_ctx) + : (Dcalc.Ast.untyped Dcalc.Ast.expr, Dcalc.Ast.untyped) Dcalc.Ast.scopes + Bindlib.box + * _ = List.fold_right (fun scope_name (scopes, decl_ctx) -> let scope = Ast.ScopeMap.find scope_name prgm.program_scopes in diff --git a/compiler/scopelang/scope_to_dcalc.mli b/compiler/scopelang/scope_to_dcalc.mli index b61e8d09..38f6228a 100644 --- a/compiler/scopelang/scope_to_dcalc.mli +++ b/compiler/scopelang/scope_to_dcalc.mli @@ -17,7 +17,7 @@ (** Scope language to default calculus translator *) val translate_program : - Ast.program -> Dcalc.Ast.program * Dependency.TVertex.t list + Ast.program -> Dcalc.Ast.untyped Dcalc.Ast.program * Dependency.TVertex.t list (** Usage [translate_program p] returns a tuple [(new_program, types_list)] where [new_program] is the map of translated scopes. Finally, [types_list] is a list of all types (structs and enums) used in the program, correctly diff --git a/compiler/surface/ast.ml b/compiler/surface/ast.ml index 26afa54d..f8b881a3 100644 --- a/compiler/surface/ast.ml +++ b/compiler/surface/ast.ml @@ -42,18 +42,18 @@ type ident = (string[@opaque]) visitors { variety = "iter"; name = "ident_iter"; nude = true }] (** Idents are snake_case *) -type qident = ident Pos.marked list +type qident = ident Marked.pos list [@@deriving visitors { variety = "map"; - ancestors = ["Pos.marked_map"; "ident_map"]; + ancestors = ["Marked.pos_map"; "ident_map"]; name = "qident_map"; }, visitors { variety = "iter"; - ancestors = ["Pos.marked_iter"; "ident_iter"]; + ancestors = ["Marked.pos_iter"; "ident_iter"]; name = "qident_iter"; }] @@ -82,18 +82,18 @@ type primitive_typ = type base_typ_data = | Primitive of primitive_typ - | Collection of base_typ_data Pos.marked + | Collection of base_typ_data Marked.pos [@@deriving visitors { variety = "map"; - ancestors = ["Pos.marked_map"; "primitive_typ_map"]; + ancestors = ["Marked.pos_map"; "primitive_typ_map"]; name = "base_typ_data_map"; }, visitors { variety = "iter"; - ancestors = ["Pos.marked_iter"; "primitive_typ_iter"]; + ancestors = ["Marked.pos_iter"; "primitive_typ_iter"]; name = "base_typ_data_iter"; }] @@ -115,8 +115,8 @@ type base_typ = Condition | Data of base_typ_data }] type func_typ = { - arg_typ : base_typ Pos.marked; - return_typ : base_typ Pos.marked; + arg_typ : base_typ Marked.pos; + return_typ : base_typ Marked.pos; } [@@deriving visitors @@ -152,8 +152,8 @@ type typ = Base of base_typ | Func of func_typ }] type struct_decl_field = { - struct_decl_field_name : ident Pos.marked; - struct_decl_field_typ : typ Pos.marked; + struct_decl_field_name : ident Marked.pos; + struct_decl_field_typ : typ Marked.pos; } [@@deriving visitors @@ -170,8 +170,8 @@ type struct_decl_field = { }] type struct_decl = { - struct_decl_name : constructor Pos.marked; - struct_decl_fields : struct_decl_field Pos.marked list; + struct_decl_name : constructor Marked.pos; + struct_decl_fields : struct_decl_field Marked.pos list; } [@@deriving visitors @@ -188,8 +188,8 @@ type struct_decl = { }] type enum_decl_case = { - enum_decl_case_name : constructor Pos.marked; - enum_decl_case_typ : typ Pos.marked option; + enum_decl_case_name : constructor Marked.pos; + enum_decl_case_typ : typ Marked.pos option; } [@@deriving visitors @@ -208,8 +208,8 @@ type enum_decl_case = { }] type enum_decl = { - enum_decl_name : constructor Pos.marked; - enum_decl_cases : enum_decl_case Pos.marked list; + enum_decl_name : constructor Marked.pos; + enum_decl_cases : enum_decl_case Marked.pos list; } [@@deriving visitors @@ -228,19 +228,19 @@ type enum_decl = { }] type match_case_pattern = - (constructor Pos.marked option * constructor Pos.marked) list - * ident Pos.marked option + (constructor Marked.pos option * constructor Marked.pos) list + * ident Marked.pos option [@@deriving visitors { variety = "map"; - ancestors = ["ident_map"; "constructor_map"; "Pos.marked_map"]; + ancestors = ["ident_map"; "constructor_map"; "Marked.pos_map"]; name = "match_case_pattern_map"; }, visitors { variety = "iter"; - ancestors = ["ident_iter"; "constructor_iter"; "Pos.marked_iter"]; + ancestors = ["ident_iter"; "constructor_iter"; "Marked.pos_iter"]; name = "match_case_pattern_iter"; }] @@ -300,9 +300,13 @@ type unop = Not | Minus of op_kind type builtin_expression = | Cardinal | IntToDec + | MoneyToDec + | DecToMoney | GetDay | GetMonth | GetYear + | LastDayOfMonth + | FirstDayOfMonth | RoundMoney | RoundDecimal [@@deriving @@ -310,21 +314,21 @@ type builtin_expression = visitors { variety = "iter"; name = "builtin_expression_iter"; nude = true }] type literal_date = { - literal_date_day : (int[@opaque]) Pos.marked; - literal_date_month : (int[@opaque]) Pos.marked; - literal_date_year : (int[@opaque]) Pos.marked; + literal_date_day : (int[@opaque]); + literal_date_month : (int[@opaque]); + literal_date_year : (int[@opaque]); } [@@deriving visitors { variety = "map"; - ancestors = ["Pos.marked_map"]; + ancestors = ["Marked.pos_map"]; name = "literal_date_map"; }, visitors { variety = "iter"; - ancestors = ["Pos.marked_iter"]; + ancestors = ["Marked.pos_iter"]; name = "literal_date_iter"; }] @@ -349,7 +353,7 @@ type money_amount = { visitors { variety = "iter"; name = "money_amount_iter"; nude = true }] type literal = - | LNumber of literal_number Pos.marked * literal_unit Pos.marked option + | LNumber of literal_number Marked.pos * literal_unit Marked.pos option | LBool of bool | LMoneyAmount of money_amount | LDate of literal_date @@ -382,8 +386,8 @@ type literal = type aggregate_func = | AggregateSum of primitive_typ | AggregateCount - | AggregateExtremum of bool * primitive_typ * expression Pos.marked - | AggregateArgExtremum of bool * primitive_typ * expression Pos.marked + | AggregateExtremum of bool * primitive_typ * expression Marked.pos + | AggregateArgExtremum of bool * primitive_typ * expression Marked.pos and collection_op = | Exists @@ -393,42 +397,42 @@ and collection_op = | Filter and explicit_match_case = { - match_case_pattern : match_case_pattern Pos.marked; - match_case_expr : expression Pos.marked; + match_case_pattern : match_case_pattern Marked.pos; + match_case_expr : expression Marked.pos; } and match_case = - | WildCard of expression Pos.marked + | WildCard of expression Marked.pos | MatchCase of explicit_match_case -and match_cases = match_case Pos.marked list +and match_cases = match_case Marked.pos list and expression = - | MatchWith of expression Pos.marked * match_cases Pos.marked + | MatchWith of expression Marked.pos * match_cases Marked.pos | IfThenElse of - expression Pos.marked * expression Pos.marked * expression Pos.marked - | Binop of binop Pos.marked * expression Pos.marked * expression Pos.marked - | Unop of unop Pos.marked * expression Pos.marked + expression Marked.pos * expression Marked.pos * expression Marked.pos + | Binop of binop Marked.pos * expression Marked.pos * expression Marked.pos + | Unop of unop Marked.pos * expression Marked.pos | CollectionOp of - collection_op Pos.marked - * ident Pos.marked - * expression Pos.marked - * expression Pos.marked - | MemCollection of expression Pos.marked * expression Pos.marked - | TestMatchCase of expression Pos.marked * match_case_pattern Pos.marked - | FunCall of expression Pos.marked * expression Pos.marked + collection_op Marked.pos + * ident Marked.pos + * expression Marked.pos + * expression Marked.pos + | MemCollection of expression Marked.pos * expression Marked.pos + | TestMatchCase of expression Marked.pos * match_case_pattern Marked.pos + | FunCall of expression Marked.pos * expression Marked.pos | Builtin of builtin_expression | Literal of literal | EnumInject of - constructor Pos.marked option - * constructor Pos.marked - * expression Pos.marked option + constructor Marked.pos option + * constructor Marked.pos + * expression Marked.pos option | StructLit of - constructor Pos.marked * (ident Pos.marked * expression Pos.marked) list - | ArrayLit of expression Pos.marked list + constructor Marked.pos * (ident Marked.pos * expression Marked.pos) list + | ArrayLit of expression Marked.pos list | Ident of ident | Dotted of - expression Pos.marked * constructor Pos.marked option * ident Pos.marked + expression Marked.pos * constructor Marked.pos option * ident Marked.pos (** Dotted is for both struct field projection and sub-scope variables *) [@@deriving visitors @@ -463,30 +467,30 @@ and expression = type exception_to = | NotAnException | UnlabeledException - | ExceptionToLabel of ident Pos.marked + | ExceptionToLabel of ident Marked.pos [@@deriving visitors { variety = "map"; - ancestors = ["ident_map"; "Pos.marked_map"]; + ancestors = ["ident_map"; "Marked.pos_map"]; name = "exception_to_map"; }, visitors { variety = "iter"; - ancestors = ["ident_iter"; "Pos.marked_iter"]; + ancestors = ["ident_iter"; "Marked.pos_iter"]; name = "exception_to_iter"; }] type rule = { - rule_label : ident Pos.marked option; + rule_label : ident Marked.pos option; rule_exception_to : exception_to; - rule_parameter : ident Pos.marked option; - rule_condition : expression Pos.marked option; - rule_name : qident Pos.marked; + rule_parameter : ident Marked.pos option; + rule_condition : expression Marked.pos option; + rule_name : qident Marked.pos; rule_id : Desugared.Ast.RuleName.t; [@opaque] - rule_consequence : (bool[@opaque]) Pos.marked; - rule_state : ident Pos.marked option; + rule_consequence : (bool[@opaque]) Marked.pos; + rule_state : ident Marked.pos option; } [@@deriving visitors @@ -503,14 +507,14 @@ type rule = { }] type definition = { - definition_label : ident Pos.marked option; + definition_label : ident Marked.pos option; definition_exception_to : exception_to; - definition_name : qident Pos.marked; - definition_parameter : ident Pos.marked option; - definition_condition : expression Pos.marked option; + definition_name : qident Marked.pos; + definition_parameter : ident Marked.pos option; + definition_condition : expression Marked.pos option; definition_id : Desugared.Ast.RuleName.t; [@opaque] - definition_expr : expression Pos.marked; - definition_state : ident Pos.marked option; + definition_expr : expression Marked.pos; + definition_state : ident Marked.pos option; } [@@deriving visitors @@ -532,11 +536,11 @@ type variation_typ = Increasing | Decreasing visitors { variety = "iter"; name = "variation_typ_iter" }] type meta_assertion = - | FixedBy of qident Pos.marked * ident Pos.marked + | FixedBy of qident Marked.pos * ident Marked.pos | VariesWith of - qident Pos.marked - * expression Pos.marked - * variation_typ Pos.marked option + qident Marked.pos + * expression Marked.pos + * variation_typ Marked.pos option [@@deriving visitors { @@ -552,8 +556,8 @@ type meta_assertion = }] type assertion = { - assertion_condition : expression Pos.marked option; - assertion_content : expression Pos.marked; + assertion_condition : expression Marked.pos option; + assertion_content : expression Marked.pos; } [@@deriving visitors @@ -592,9 +596,9 @@ type scope_use_item = }] type scope_use = { - scope_use_condition : expression Pos.marked option; - scope_use_name : constructor Pos.marked; - scope_use_items : scope_use_item Pos.marked list; + scope_use_condition : expression Marked.pos option; + scope_use_name : constructor Marked.pos; + scope_use_items : scope_use_item Marked.pos list; } [@@deriving visitors @@ -616,26 +620,26 @@ type io_input = Input | Context | Internal visitors { variety = "iter"; name = "io_input_iter" }] type scope_decl_context_io = { - scope_decl_context_io_input : io_input Pos.marked; - scope_decl_context_io_output : bool Pos.marked; + scope_decl_context_io_input : io_input Marked.pos; + scope_decl_context_io_output : bool Marked.pos; } [@@deriving visitors { variety = "map"; - ancestors = ["io_input_map"; "Pos.marked_map"]; + ancestors = ["io_input_map"; "Marked.pos_map"]; name = "scope_decl_context_io_map"; }, visitors { variety = "iter"; - ancestors = ["io_input_iter"; "Pos.marked_iter"]; + ancestors = ["io_input_iter"; "Marked.pos_iter"]; name = "scope_decl_context_io_iter"; }] type scope_decl_context_scope = { - scope_decl_context_scope_name : ident Pos.marked; - scope_decl_context_scope_sub_scope : constructor Pos.marked; + scope_decl_context_scope_name : ident Marked.pos; + scope_decl_context_scope_sub_scope : constructor Marked.pos; scope_decl_context_scope_attribute : scope_decl_context_io; } [@@deriving @@ -647,7 +651,7 @@ type scope_decl_context_scope = { "ident_map"; "constructor_map"; "scope_decl_context_io_map"; - "Pos.marked_map"; + "Marked.pos_map"; ]; name = "scope_decl_context_scope_map"; }, @@ -659,16 +663,16 @@ type scope_decl_context_scope = { "ident_iter"; "constructor_iter"; "scope_decl_context_io_iter"; - "Pos.marked_iter"; + "Marked.pos_iter"; ]; name = "scope_decl_context_scope_iter"; }] type scope_decl_context_data = { - scope_decl_context_item_name : ident Pos.marked; - scope_decl_context_item_typ : typ Pos.marked; + scope_decl_context_item_name : ident Marked.pos; + scope_decl_context_item_typ : typ Marked.pos; scope_decl_context_item_attribute : scope_decl_context_io; - scope_decl_context_item_states : ident Pos.marked list; + scope_decl_context_item_states : ident Marked.pos list; } [@@deriving visitors @@ -704,8 +708,8 @@ type scope_decl_context_item = }] type scope_decl = { - scope_decl_name : constructor Pos.marked; - scope_decl_context : scope_decl_context_item Pos.marked list; + scope_decl_name : constructor Marked.pos; + scope_decl_context : scope_decl_context_item Marked.pos list; } [@@deriving visitors @@ -747,7 +751,7 @@ type code_item = name = "code_item_iter"; }] -type code_block = code_item Pos.marked list +type code_block = code_item Marked.pos list [@@deriving visitors { variety = "map"; ancestors = ["code_item_map"]; name = "code_block_map" }, @@ -758,23 +762,23 @@ type code_block = code_item Pos.marked list name = "code_block_iter"; }] -type source_repr = (string[@opaque]) Pos.marked +type source_repr = (string[@opaque]) Marked.pos [@@deriving visitors { variety = "map"; - ancestors = ["Pos.marked_map"]; + ancestors = ["Marked.pos_map"]; name = "source_repr_map"; }, visitors { variety = "iter"; - ancestors = ["Pos.marked_iter"]; + ancestors = ["Marked.pos_iter"]; name = "source_repr_iter"; }] type law_heading = { - law_heading_name : (string[@opaque]) Pos.marked; + law_heading_name : (string[@opaque]) Marked.pos; law_heading_id : (string[@opaque]) option; law_heading_expiration_date : (string[@opaque]) option; law_heading_precedence : (int[@opaque]); @@ -783,31 +787,31 @@ type law_heading = { visitors { variety = "map"; - ancestors = ["Pos.marked_map"]; + ancestors = ["Marked.pos_map"]; name = "law_heading_map"; }, visitors { variety = "iter"; - ancestors = ["Pos.marked_iter"]; + ancestors = ["Marked.pos_iter"]; name = "law_heading_iter"; }] type law_include = - | PdfFile of (string[@opaque]) Pos.marked * (int[@opaque]) option - | CatalaFile of (string[@opaque]) Pos.marked - | LegislativeText of (string[@opaque]) Pos.marked + | PdfFile of (string[@opaque]) Marked.pos * (int[@opaque]) option + | CatalaFile of (string[@opaque]) Marked.pos + | LegislativeText of (string[@opaque]) Marked.pos [@@deriving visitors { variety = "map"; - ancestors = ["Pos.marked_map"]; + ancestors = ["Marked.pos_map"]; name = "law_include_map"; }, visitors { variety = "iter"; - ancestors = ["Pos.marked_iter"]; + ancestors = ["Marked.pos_iter"]; name = "law_include_iter"; }] @@ -862,7 +866,9 @@ type source_file = law_structure list (** Translates a {!type: rule} into the corresponding {!type: definition} *) let rule_to_def (rule : rule) : definition = - let consequence_expr = Literal (LBool (Pos.unmark rule.rule_consequence)) in + let consequence_expr = + Literal (LBool (Marked.unmark rule.rule_consequence)) + in { definition_label = rule.rule_label; definition_exception_to = rule.rule_exception_to; @@ -870,6 +876,6 @@ let rule_to_def (rule : rule) : definition = definition_parameter = rule.rule_parameter; definition_condition = rule.rule_condition; definition_id = rule.rule_id; - definition_expr = consequence_expr, Pos.get_position rule.rule_consequence; + definition_expr = consequence_expr, Marked.get_mark rule.rule_consequence; definition_state = rule.rule_state; } diff --git a/compiler/surface/desugaring.ml b/compiler/surface/desugaring.ml index f6f2d519..a371a51e 100644 --- a/compiler/surface/desugaring.ml +++ b/compiler/surface/desugaring.ml @@ -16,6 +16,8 @@ the License. *) open Utils +module Runtime = Runtime_ocaml.Runtime + (** Translation from {!module: Surface.Ast} to {!module: Desugaring.Ast}. - Removes syntactic sugars @@ -62,7 +64,7 @@ module LiftEnumConstructorMap = Bindlib.Lift (Scopelang.Ast.EnumConstructorMap) let disambiguate_constructor (ctxt : Name_resolution.context) - (constructor : (string Pos.marked option * string Pos.marked) list) + (constructor : (string Marked.pos option * string Marked.pos) list) (pos : Pos.t) : Scopelang.Ast.EnumName.t * Scopelang.Ast.EnumConstructor.t = let enum, constructor = match constructor with @@ -73,11 +75,12 @@ let disambiguate_constructor in let possible_c_uids = try - Desugared.Ast.IdentMap.find (Pos.unmark constructor) + Desugared.Ast.IdentMap.find + (Marked.unmark constructor) ctxt.constructor_idmap with Not_found -> Errors.raise_spanned_error - (Pos.get_position constructor) + (Marked.get_mark constructor) "The name of this constructor has not been defined before, maybe it is \ a typo?" in @@ -85,7 +88,7 @@ let disambiguate_constructor | None -> if Scopelang.Ast.EnumMap.cardinal possible_c_uids > 1 then Errors.raise_spanned_error - (Pos.get_position constructor) + (Marked.get_mark constructor) "This constructor name is ambiguous, it can belong to %a. Disambiguate \ it by prefixing it with the enum name." (Format.pp_print_list @@ -98,17 +101,18 @@ let disambiguate_constructor try (* The path is fully qualified *) let e_uid = - Desugared.Ast.IdentMap.find (Pos.unmark enum) ctxt.enum_idmap + Desugared.Ast.IdentMap.find (Marked.unmark enum) ctxt.enum_idmap in try let c_uid = Scopelang.Ast.EnumMap.find e_uid possible_c_uids in e_uid, c_uid with Not_found -> Errors.raise_spanned_error pos "Enum %s does not contain case %s" - (Pos.unmark enum) (Pos.unmark constructor) + (Marked.unmark enum) + (Marked.unmark constructor) with Not_found -> - Errors.raise_spanned_error (Pos.get_position enum) - "Enum %s has not been defined before" (Pos.unmark enum)) + Errors.raise_spanned_error (Marked.get_mark enum) + "Enum %s has not been defined before" (Marked.unmark enum)) (** Usage: [translate_expr scope ctxt expr] @@ -116,10 +120,10 @@ let disambiguate_constructor disambiguate the scope and subscopes variables than occur in the expresion *) let rec translate_expr (scope : Scopelang.Ast.ScopeName.t) - (inside_definition_of : Desugared.Ast.ScopeDef.t Pos.marked option) + (inside_definition_of : Desugared.Ast.ScopeDef.t Marked.pos option) (ctxt : Name_resolution.context) - ((expr, pos) : Ast.expression Pos.marked) : - Desugared.Ast.expr Pos.marked Bindlib.box = + ((expr, pos) : Ast.expression Marked.pos) : + Desugared.Ast.expr Marked.pos Bindlib.box = let scope_ctxt = Scopelang.Ast.ScopeMap.find scope ctxt.scopes in let rec_helper = translate_expr scope inside_definition_of ctxt in match expr with @@ -137,18 +141,18 @@ let rec translate_expr Scopelang.Ast.EnumConstructorMap.mapi (fun c_uid' tau -> if Scopelang.Ast.EnumConstructor.compare c_uid c_uid' <> 0 then - let nop_var = Desugared.Ast.Var.make ("_", pos) in + let nop_var = Desugared.Ast.Var.make "_" in Bindlib.unbox (Desugared.Ast.make_abs [| nop_var |] (Bindlib.box (Desugared.Ast.ELit (Dcalc.Ast.LBool false), pos)) - pos [tau] pos) + [tau] pos) else let ctxt, binding_var = - Name_resolution.add_def_local_var ctxt binding + Name_resolution.add_def_local_var ctxt (Marked.unmark binding) in let e2 = translate_expr scope inside_definition_of ctxt e2 in Bindlib.unbox - (Desugared.Ast.make_abs [| binding_var |] e2 pos [tau] pos)) + (Desugared.Ast.make_abs [| binding_var |] e2 [tau] pos)) (Scopelang.Ast.EnumMap.find enum_uid ctxt.enums) in Bindlib.box_apply @@ -161,8 +165,9 @@ let rec translate_expr (rec_helper e_if) (rec_helper e_then) (rec_helper e_else) | Binop (op, e1, e2) -> let op_term = - Pos.same_pos_as - (Desugared.Ast.EOp (Dcalc.Ast.Binop (translate_binop (Pos.unmark op)))) + Marked.same_mark_as + (Desugared.Ast.EOp + (Dcalc.Ast.Binop (translate_binop (Marked.unmark op)))) op in Bindlib.box_apply2 @@ -170,8 +175,8 @@ let rec translate_expr (rec_helper e1) (rec_helper e2) | Unop (op, e) -> let op_term = - Pos.same_pos_as - (Desugared.Ast.EOp (Dcalc.Ast.Unop (translate_unop (Pos.unmark op)))) + Marked.same_mark_as + (Desugared.Ast.EOp (Dcalc.Ast.Unop (translate_unop (Marked.unmark op)))) op in Bindlib.box_apply @@ -218,21 +223,17 @@ let rec translate_expr Errors.raise_spanned_error pos "Impossible to specify decimal amounts of days, months or years" | LDate date -> - if Pos.unmark date.literal_date_month > 12 then - Errors.raise_spanned_error - (Pos.get_position date.literal_date_month) + if date.literal_date_month > 12 then + Errors.raise_spanned_error pos "There is an error in this date: the month number is bigger than 12"; - if Pos.unmark date.literal_date_day > 31 then - Errors.raise_spanned_error - (Pos.get_position date.literal_date_day) + if date.literal_date_day > 31 then + Errors.raise_spanned_error pos "There is an error in this date: the day number is bigger than 31"; Desugared.Ast.ELit (Dcalc.Ast.LDate (try - Runtime.date_of_numbers - (Pos.unmark date.literal_date_year) - (Pos.unmark date.literal_date_month) - (Pos.unmark date.literal_date_day) + Runtime.date_of_numbers date.literal_date_year + date.literal_date_month date.literal_date_day with Runtime.ImpossibleDate -> Errors.raise_spanned_error pos "There is an error in this date, it does not correspond to a \ @@ -300,11 +301,11 @@ let rec translate_expr Desugared.Ast.make_var (uid, pos) (* the whole box thing is to accomodate for this case *)) | Dotted (e, c, x) -> ( - match Pos.unmark e with + match Marked.unmark e with | Ident y when Name_resolution.is_subscope_uid scope ctxt y -> (* In this case, y.x is a subscope variable *) let subscope_uid : Scopelang.Ast.SubScopeName.t = - Name_resolution.get_subscope_uid scope ctxt (Pos.same_pos_as y e) + Name_resolution.get_subscope_uid scope ctxt (Marked.same_mark_as y e) in let subscope_real_uid : Scopelang.Ast.ScopeName.t = Scopelang.Ast.SubScopeMap.find subscope_uid scope_ctxt.sub_scopes @@ -321,16 +322,16 @@ let rec translate_expr (* In this case e.x is the struct field x access of expression e *) let e = translate_expr scope inside_definition_of ctxt e in let x_possible_structs = - try Desugared.Ast.IdentMap.find (Pos.unmark x) ctxt.field_idmap + try Desugared.Ast.IdentMap.find (Marked.unmark x) ctxt.field_idmap with Not_found -> - Errors.raise_spanned_error (Pos.get_position x) + Errors.raise_spanned_error (Marked.get_mark x) "Unknown subscope or struct field name" in match c with | None -> (* No constructor name was specified *) if Scopelang.Ast.StructMap.cardinal x_possible_structs > 1 then - Errors.raise_spanned_error (Pos.get_position x) + Errors.raise_spanned_error (Marked.get_mark x) "This struct field name is ambiguous, it can belong to %a. \ Disambiguate it by prefixing it with the struct name." (Format.pp_print_list @@ -349,7 +350,7 @@ let rec translate_expr | Some c_name -> ( try let c_uid = - Desugared.Ast.IdentMap.find (Pos.unmark c_name) ctxt.struct_idmap + Desugared.Ast.IdentMap.find (Marked.unmark c_name) ctxt.struct_idmap in try let f_uid = Scopelang.Ast.StructMap.find c_uid x_possible_structs in @@ -358,19 +359,19 @@ let rec translate_expr e with Not_found -> Errors.raise_spanned_error pos "Struct %s does not contain field %s" - (Pos.unmark c_name) (Pos.unmark x) + (Marked.unmark c_name) (Marked.unmark x) with Not_found -> - Errors.raise_spanned_error (Pos.get_position c_name) - "Struct %s has not been defined before" (Pos.unmark c_name)))) + Errors.raise_spanned_error (Marked.get_mark c_name) + "Struct %s has not been defined before" (Marked.unmark c_name)))) | FunCall (f, arg) -> Bindlib.box_apply2 (fun f arg -> Desugared.Ast.EApp (f, [arg]), pos) (rec_helper f) (rec_helper arg) | StructLit (s_name, fields) -> let s_uid = - try Desugared.Ast.IdentMap.find (Pos.unmark s_name) ctxt.struct_idmap + try Desugared.Ast.IdentMap.find (Marked.unmark s_name) ctxt.struct_idmap with Not_found -> - Errors.raise_spanned_error (Pos.get_position s_name) + Errors.raise_spanned_error (Marked.get_mark s_name) "This identifier should refer to a struct name" in @@ -380,20 +381,20 @@ let rec translate_expr let f_uid = try Scopelang.Ast.StructMap.find s_uid - (Desugared.Ast.IdentMap.find (Pos.unmark f_name) + (Desugared.Ast.IdentMap.find (Marked.unmark f_name) ctxt.field_idmap) with Not_found -> - Errors.raise_spanned_error (Pos.get_position f_name) + Errors.raise_spanned_error (Marked.get_mark f_name) "This identifier should refer to a field of struct %s" - (Pos.unmark s_name) + (Marked.unmark s_name) in (match Scopelang.Ast.StructFieldMap.find_opt f_uid s_fields with | None -> () | Some e_field -> Errors.raise_multispanned_error [ - None, Pos.get_position f_e; - None, Pos.get_position (Bindlib.unbox e_field); + None, Marked.get_mark f_e; + None, Marked.get_mark (Bindlib.unbox e_field); ] "The field %a has been defined twice:" Scopelang.Ast.StructFieldName.format_t f_uid); @@ -417,11 +418,12 @@ let rec translate_expr | EnumInject (enum, constructor, payload) -> ( let possible_c_uids = try - Desugared.Ast.IdentMap.find (Pos.unmark constructor) + Desugared.Ast.IdentMap.find + (Marked.unmark constructor) ctxt.constructor_idmap with Not_found -> Errors.raise_spanned_error - (Pos.get_position constructor) + (Marked.get_mark constructor) "The name of this constructor has not been defined before, maybe it \ is a typo?" in @@ -433,7 +435,7 @@ let rec translate_expr Scopelang.Ast.EnumMap.cardinal possible_c_uids > 1 then Errors.raise_spanned_error - (Pos.get_position constructor) + (Marked.get_mark constructor) "This constructor name is ambiguous, it can belong to %a. \ Desambiguate it by prefixing it with the enum name." (Format.pp_print_list @@ -453,7 +455,7 @@ let rec translate_expr | Some e' -> e' | None -> ( Desugared.Ast.ELit Dcalc.Ast.LUnit, - Pos.get_position constructor )), + Marked.get_mark constructor )), c_uid, e_uid ), pos )) @@ -462,7 +464,7 @@ let rec translate_expr try (* The path has been fully qualified *) let e_uid = - Desugared.Ast.IdentMap.find (Pos.unmark enum) ctxt.enum_idmap + Desugared.Ast.IdentMap.find (Marked.unmark enum) ctxt.enum_idmap in try let c_uid = Scopelang.Ast.EnumMap.find e_uid possible_c_uids in @@ -476,17 +478,18 @@ let rec translate_expr | Some e' -> e' | None -> ( Desugared.Ast.ELit Dcalc.Ast.LUnit, - Pos.get_position constructor )), + Marked.get_mark constructor )), c_uid, e_uid ), pos )) (Bindlib.box_opt payload) with Not_found -> Errors.raise_spanned_error pos "Enum %s does not contain case %s" - (Pos.unmark enum) (Pos.unmark constructor) + (Marked.unmark enum) + (Marked.unmark constructor) with Not_found -> - Errors.raise_spanned_error (Pos.get_position enum) - "Enum %s has not been defined before" (Pos.unmark enum))) + Errors.raise_spanned_error (Marked.get_mark enum) + "Enum %s has not been defined before" (Marked.unmark enum))) | MatchWith (e1, (cases, _cases_pos)) -> let e1 = translate_expr scope inside_definition_of ctxt e1 in let cases_d, e_uid = @@ -498,20 +501,20 @@ let rec translate_expr e1 (LiftEnumConstructorMap.lift_box cases_d) | TestMatchCase (e1, pattern) -> - (match snd (Pos.unmark pattern) with + (match snd (Marked.unmark pattern) with | None -> () | Some binding -> - Errors.format_spanned_warning (Pos.get_position binding) + Errors.format_spanned_warning (Marked.get_mark binding) "This binding will be ignored (remove it to suppress warning)"); let enum_uid, c_uid = disambiguate_constructor ctxt - (fst (Pos.unmark pattern)) - (Pos.get_position pattern) + (fst (Marked.unmark pattern)) + (Marked.get_mark pattern) in let cases = Scopelang.Ast.EnumConstructorMap.mapi (fun c_uid' tau -> - let nop_var = Desugared.Ast.Var.make ("_", pos) in + let nop_var = Desugared.Ast.Var.make "_" in Bindlib.unbox (Desugared.Ast.make_abs [| nop_var |] (Bindlib.box @@ -519,7 +522,7 @@ let rec translate_expr (Dcalc.Ast.LBool (Scopelang.Ast.EnumConstructor.compare c_uid c_uid' = 0)), pos )) - pos [tau] pos)) + [tau] pos)) (Scopelang.Ast.EnumMap.find enum_uid ctxt.enums) in Bindlib.box_apply @@ -535,11 +538,12 @@ let rec translate_expr collection, predicate ) -> let collection = rec_helper collection in - let ctxt, param = Name_resolution.add_def_local_var ctxt param' in + let ctxt, param = + Name_resolution.add_def_local_var ctxt (Marked.unmark param') + in let f_pred = Desugared.Ast.make_abs [| param |] (translate_expr scope inside_definition_of ctxt predicate) - pos [Scopelang.Ast.TAny, pos] pos in @@ -563,7 +567,9 @@ let rec translate_expr predicate ) -> let init = rec_helper init in let collection = rec_helper collection in - let ctxt, param = Name_resolution.add_def_local_var ctxt param' in + let ctxt, param = + Name_resolution.add_def_local_var ctxt (Marked.unmark param') + in let op_kind = match pred_typ with | Ast.Integer -> Dcalc.Ast.KInt @@ -583,25 +589,19 @@ let rec translate_expr let f_pred = Desugared.Ast.make_abs [| param |] (translate_expr scope inside_definition_of ctxt predicate) - pos [Scopelang.Ast.TAny, pos] pos in - let f_pred_var = - Desugared.Ast.Var.make ("predicate", Pos.get_position predicate) - in + let f_pred_var = Desugared.Ast.Var.make "predicate" in let f_pred_var_e = - Desugared.Ast.make_var (f_pred_var, Pos.get_position predicate) + Desugared.Ast.make_var (f_pred_var, Marked.get_mark predicate) in - let acc_var = Desugared.Ast.Var.make ("acc", pos) in + let acc_var = Desugared.Ast.Var.make "acc" in let acc_var_e = Desugared.Ast.make_var (acc_var, pos) in - let item_var = - Desugared.Ast.Var.make - ("item", Pos.get_position (Bindlib.unbox collection)) - in + let item_var = Desugared.Ast.Var.make "item" in let item_var_e = Desugared.Ast.make_var - (item_var, Pos.get_position (Bindlib.unbox collection)) + (item_var, Marked.get_mark (Bindlib.unbox collection)) in let fold_body = Bindlib.box_apply3 @@ -620,7 +620,7 @@ let rec translate_expr acc_var_e item_var_e f_pred_var_e in let fold_f = - Desugared.Ast.make_abs [| acc_var; item_var |] fold_body pos + Desugared.Ast.make_abs [| acc_var; item_var |] fold_body [Scopelang.Ast.TAny, pos; Scopelang.Ast.TAny, pos] pos in @@ -635,37 +635,39 @@ let rec translate_expr in Desugared.Ast.make_let_in f_pred_var (Scopelang.Ast.TAny, pos) f_pred fold | CollectionOp (op', param', collection, predicate) -> - let ctxt, param = Name_resolution.add_def_local_var ctxt param' in + let ctxt, param = + Name_resolution.add_def_local_var ctxt (Marked.unmark param') + in let collection = rec_helper collection in let init = - match Pos.unmark op' with + match Marked.unmark op' with | Ast.Map | Ast.Filter | Ast.Aggregate (Ast.AggregateArgExtremum _) -> assert false (* should not happen *) | Ast.Exists -> Bindlib.box - (Desugared.Ast.ELit (Dcalc.Ast.LBool false), Pos.get_position op') + (Desugared.Ast.ELit (Dcalc.Ast.LBool false), Marked.get_mark op') | Ast.Forall -> Bindlib.box - (Desugared.Ast.ELit (Dcalc.Ast.LBool true), Pos.get_position op') + (Desugared.Ast.ELit (Dcalc.Ast.LBool true), Marked.get_mark op') | Ast.Aggregate (Ast.AggregateSum Ast.Integer) -> Bindlib.box ( Desugared.Ast.ELit (Dcalc.Ast.LInt (Runtime.integer_of_int 0)), - Pos.get_position op' ) + Marked.get_mark op' ) | Ast.Aggregate (Ast.AggregateSum Ast.Decimal) -> Bindlib.box ( Desugared.Ast.ELit (Dcalc.Ast.LRat (Runtime.decimal_of_string "0")), - Pos.get_position op' ) + Marked.get_mark op' ) | Ast.Aggregate (Ast.AggregateSum Ast.Money) -> Bindlib.box ( Desugared.Ast.ELit (Dcalc.Ast.LMoney (Runtime.money_of_cents_integer (Runtime.integer_of_int 0))), - Pos.get_position op' ) + Marked.get_mark op' ) | Ast.Aggregate (Ast.AggregateSum Ast.Duration) -> Bindlib.box ( Desugared.Ast.ELit (Dcalc.Ast.LDuration (Runtime.duration_of_numbers 0 0 0)), - Pos.get_position op' ) + Marked.get_mark op' ) | Ast.Aggregate (Ast.AggregateSum t) -> Errors.raise_spanned_error pos "It is impossible to sum two values of type %a together" @@ -674,16 +676,16 @@ let rec translate_expr | Ast.Aggregate Ast.AggregateCount -> Bindlib.box ( Desugared.Ast.ELit (Dcalc.Ast.LInt (Runtime.integer_of_int 0)), - Pos.get_position op' ) + Marked.get_mark op' ) in - let acc_var = Desugared.Ast.Var.make ("acc", Pos.get_position param') in - let acc = Desugared.Ast.make_var (acc_var, Pos.get_position param') in + let acc_var = Desugared.Ast.Var.make "acc" in + let acc = Desugared.Ast.make_var (acc_var, Marked.get_mark param') in let f_body = let make_body (op : Dcalc.Ast.binop) = Bindlib.box_apply2 (fun predicate acc -> ( Desugared.Ast.EApp - ( (Desugared.Ast.EOp (Dcalc.Ast.Binop op), Pos.get_position op'), + ( (Desugared.Ast.EOp (Dcalc.Ast.Binop op), Marked.get_mark op'), [acc; predicate] ), pos )) (translate_expr scope inside_definition_of ctxt predicate) @@ -691,9 +693,9 @@ let rec translate_expr in let make_extr_body (cmp_op : Dcalc.Ast.binop) - (t : Scopelang.Ast.typ Pos.marked) = - let tmp_var = Desugared.Ast.Var.make ("tmp", Pos.get_position param') in - let tmp = Desugared.Ast.make_var (tmp_var, Pos.get_position param') in + (t : Scopelang.Ast.typ Marked.pos) = + let tmp_var = Desugared.Ast.Var.make "tmp" in + let tmp = Desugared.Ast.make_var (tmp_var, Marked.get_mark param') in Desugared.Ast.make_let_in tmp_var t (translate_expr scope inside_definition_of ctxt predicate) (Bindlib.box_apply2 @@ -701,7 +703,7 @@ let rec translate_expr ( Desugared.Ast.EIfThenElse ( ( Desugared.Ast.EApp ( ( Desugared.Ast.EOp (Dcalc.Ast.Binop cmp_op), - Pos.get_position op' ), + Marked.get_mark op' ), [acc; tmp] ), pos ), acc, @@ -709,7 +711,7 @@ let rec translate_expr pos )) acc tmp) in - match Pos.unmark op' with + match Marked.unmark op' with | Ast.Map | Ast.Filter | Ast.Aggregate (Ast.AggregateArgExtremum _) -> assert false (* should not happen *) | Ast.Exists -> make_body Dcalc.Ast.Or @@ -751,12 +753,12 @@ let rec translate_expr ( Desugared.Ast.EApp ( ( Desugared.Ast.EOp (Dcalc.Ast.Binop (Dcalc.Ast.Add Dcalc.Ast.KInt)), - Pos.get_position op' ), + Marked.get_mark op' ), [ acc; ( Desugared.Ast.ELit (Dcalc.Ast.LInt (Runtime.integer_of_int 1)), - Pos.get_position predicate ); + Marked.get_mark predicate ); ] ), pos ), acc ), @@ -769,9 +771,9 @@ let rec translate_expr Bindlib.box_apply (fun binder -> ( Desugared.Ast.EAbs - ( (binder, pos), + ( binder, [ - Scopelang.Ast.TLit t, Pos.get_position op'; + Scopelang.Ast.TLit t, Marked.get_mark op'; Scopelang.Ast.TAny, pos (* we put any here because the type of the elements of the arrays is not always the type of the accumulator; for @@ -780,7 +782,7 @@ let rec translate_expr pos )) (Bindlib.bind_mvar [| acc_var; param |] f_body) in - match Pos.unmark op' with + match Marked.unmark op' with | Ast.Map | Ast.Filter | Ast.Aggregate (Ast.AggregateArgExtremum _) -> assert false (* should not happen *) | Ast.Exists -> make_f Dcalc.Ast.TBool @@ -810,11 +812,11 @@ let rec translate_expr pos )) f collection init | MemCollection (member, collection) -> - let param_var = Desugared.Ast.Var.make ("collection_member", pos) in + let param_var = Desugared.Ast.Var.make "collection_member" in let param = Desugared.Ast.make_var (param_var, pos) in let collection = rec_helper collection in let init = Bindlib.box (Desugared.Ast.ELit (Dcalc.Ast.LBool false), pos) in - let acc_var = Desugared.Ast.Var.make ("acc", pos) in + let acc_var = Desugared.Ast.Var.make "acc" in let acc = Desugared.Ast.make_var (acc_var, pos) in let f_body = Bindlib.box_apply3 @@ -836,7 +838,7 @@ let rec translate_expr Bindlib.box_apply (fun binder -> ( Desugared.Ast.EAbs - ( (binder, pos), + ( binder, [ Scopelang.Ast.TLit Dcalc.Ast.TBool, pos; Scopelang.Ast.TAny, pos; @@ -853,6 +855,10 @@ let rec translate_expr f collection init | Builtin IntToDec -> Bindlib.box (Desugared.Ast.EOp (Dcalc.Ast.Unop Dcalc.Ast.IntToRat), pos) + | Builtin MoneyToDec -> + Bindlib.box (Desugared.Ast.EOp (Dcalc.Ast.Unop Dcalc.Ast.MoneyToRat), pos) + | Builtin DecToMoney -> + Bindlib.box (Desugared.Ast.EOp (Dcalc.Ast.Unop Dcalc.Ast.RatToMoney), pos) | Builtin Cardinal -> Bindlib.box (Desugared.Ast.EOp (Dcalc.Ast.Unop Dcalc.Ast.Length), pos) | Builtin GetDay -> @@ -861,6 +867,12 @@ let rec translate_expr Bindlib.box (Desugared.Ast.EOp (Dcalc.Ast.Unop Dcalc.Ast.GetMonth), pos) | Builtin GetYear -> Bindlib.box (Desugared.Ast.EOp (Dcalc.Ast.Unop Dcalc.Ast.GetYear), pos) + | Builtin FirstDayOfMonth -> + Bindlib.box + (Desugared.Ast.EOp (Dcalc.Ast.Unop Dcalc.Ast.FirstDayOfMonth), pos) + | Builtin LastDayOfMonth -> + Bindlib.box + (Desugared.Ast.EOp (Dcalc.Ast.Unop Dcalc.Ast.LastDayOfMonth), pos) | Builtin RoundMoney -> Bindlib.box (Desugared.Ast.EOp (Dcalc.Ast.Unop Dcalc.Ast.RoundMoney), pos) | Builtin RoundDecimal -> @@ -868,31 +880,30 @@ let rec translate_expr and disambiguate_match_and_build_expression (scope : Scopelang.Ast.ScopeName.t) - (inside_definition_of : Desugared.Ast.ScopeDef.t Pos.marked option) + (inside_definition_of : Desugared.Ast.ScopeDef.t Marked.pos option) (ctxt : Name_resolution.context) - (cases : Ast.match_case Pos.marked list) : - Desugared.Ast.expr Pos.marked Bindlib.box Scopelang.Ast.EnumConstructorMap.t + (cases : Ast.match_case Marked.pos list) : + Desugared.Ast.expr Marked.pos Bindlib.box Scopelang.Ast.EnumConstructorMap.t * Scopelang.Ast.EnumName.t = let create_var = function - | None -> ctxt, (Desugared.Ast.Var.make ("_", Pos.no_pos), Pos.no_pos) + | None -> ctxt, Desugared.Ast.Var.make "_" | Some param -> let ctxt, param_var = Name_resolution.add_def_local_var ctxt param in - ctxt, (param_var, Pos.get_position param) + ctxt, param_var in let bind_case_body (c_uid : Dcalc.Ast.EnumConstructor.t) (e_uid : Dcalc.Ast.EnumName.t) (ctxt : Name_resolution.context) - (param_pos : Pos.t) (case_body : ('a * Pos.t) Bindlib.box) (e_binder : (Desugared.Ast.expr, Desugared.Ast.expr * Pos.t) Bindlib.mbinder Bindlib.box) : 'c Bindlib.box = Bindlib.box_apply2 (fun e_binder case_body -> - Pos.same_pos_as + Marked.same_mark_as (Desugared.Ast.EAbs - ( (e_binder, param_pos), + ( e_binder, [ Scopelang.Ast.EnumConstructorMap.find c_uid (Scopelang.Ast.EnumMap.find e_uid ctxt.Name_resolution.enums); @@ -903,10 +914,10 @@ and disambiguate_match_and_build_expression let bind_match_cases (cases_d, e_uid, curr_index) (case, case_pos) = match case with | Ast.MatchCase case -> - let constructor, binding = Pos.unmark case.Ast.match_case_pattern in + let constructor, binding = Marked.unmark case.Ast.match_case_pattern in let e_uid', c_uid = disambiguate_constructor ctxt constructor - (Pos.get_position case.Ast.match_case_pattern) + (Marked.get_mark case.Ast.match_case_pattern) in let e_uid = match e_uid with @@ -915,7 +926,7 @@ and disambiguate_match_and_build_expression if e_uid = e_uid' then e_uid else Errors.raise_spanned_error - (Pos.get_position case.Ast.match_case_pattern) + (Marked.get_mark case.Ast.match_case_pattern) "This case matches a constructor of enumeration %a but previous \ case were matching constructors of enumeration %a" Scopelang.Ast.EnumName.format_t e_uid @@ -926,19 +937,17 @@ and disambiguate_match_and_build_expression | Some e_case -> Errors.raise_multispanned_error [ - None, Pos.get_position case.match_case_expr; - None, Pos.get_position (Bindlib.unbox e_case); + None, Marked.get_mark case.match_case_expr; + None, Marked.get_mark (Bindlib.unbox e_case); ] "The constructor %a has been matched twice:" Scopelang.Ast.EnumConstructor.format_t c_uid); - let ctxt, (param_var, param_pos) = create_var binding in + let ctxt, param_var = create_var (Option.map Marked.unmark binding) in let case_body = translate_expr scope inside_definition_of ctxt case.Ast.match_case_expr in let e_binder = Bindlib.bind_mvar (Array.of_list [param_var]) case_body in - let case_expr = - bind_case_body c_uid e_uid ctxt param_pos case_body e_binder - in + let case_expr = bind_case_body c_uid e_uid ctxt case_body e_binder in ( Scopelang.Ast.EnumConstructorMap.add c_uid case_expr cases_d, Some e_uid, curr_index + 1 ) @@ -949,7 +958,7 @@ and disambiguate_match_and_build_expression [ Some "Not ending wildcard:", case_pos; ( Some "Next reachable case:", - curr_index + 1 |> List.nth cases |> Pos.get_position ); + curr_index + 1 |> List.nth cases |> Marked.get_mark ); ] "Wildcard must be the last match case" in @@ -988,7 +997,7 @@ and disambiguate_match_and_build_expression ... | CaseN -> wildcard_payload *) (* Creates the wildcard payload *) - let ctxt, (payload_var, var_pos) = create_var None in + let ctxt, payload_var = create_var None in let case_body = translate_expr scope inside_definition_of ctxt match_case_expr in @@ -1000,7 +1009,7 @@ and disambiguate_match_and_build_expression Scopelang.Ast.EnumConstructorMap.fold (fun c_uid _ (cases_d, e_uid_opt, curr_index) -> let case_expr = - bind_case_body c_uid e_uid ctxt var_pos case_body e_binder + bind_case_body c_uid e_uid ctxt case_body e_binder in ( Scopelang.Ast.EnumConstructorMap.add c_uid case_expr cases_d, e_uid_opt, @@ -1022,21 +1031,23 @@ and disambiguate_match_and_build_expression this precondition has to be appended to the justifications of each definition in the subscope use. This is what this function does. *) let merge_conditions - (precond : Desugared.Ast.expr Pos.marked Bindlib.box option) - (cond : Desugared.Ast.expr Pos.marked Bindlib.box option) - (default_pos : Pos.t) : Desugared.Ast.expr Pos.marked Bindlib.box = + (precond : Desugared.Ast.expr Marked.pos Bindlib.box option) + (cond : Desugared.Ast.expr Marked.pos Bindlib.box option) + (default_pos : Pos.t) : Desugared.Ast.expr Marked.pos Bindlib.box = match precond, cond with | Some precond, Some cond -> let op_term = ( Desugared.Ast.EOp (Dcalc.Ast.Binop Dcalc.Ast.And), - Pos.get_position (Bindlib.unbox cond) ) + Marked.get_mark (Bindlib.unbox cond) ) in Bindlib.box_apply2 (fun precond cond -> - Desugared.Ast.EApp (op_term, [precond; cond]), Pos.get_position cond) + Desugared.Ast.EApp (op_term, [precond; cond]), Marked.get_mark cond) precond cond | Some precond, None -> - Bindlib.box_apply (fun precond -> Pos.unmark precond, default_pos) precond + Bindlib.box_apply + (fun precond -> Marked.unmark precond, default_pos) + precond | None, Some cond -> cond | None, None -> Bindlib.box (Desugared.Ast.ELit (Dcalc.Ast.LBool true), default_pos) @@ -1046,47 +1057,49 @@ let merge_conditions let process_default (ctxt : Name_resolution.context) (scope : Scopelang.Ast.ScopeName.t) - (def_key : Desugared.Ast.ScopeDef.t Pos.marked) + (def_key : Desugared.Ast.ScopeDef.t Marked.pos) (rule_id : Desugared.Ast.RuleName.t) - (param_uid : Desugared.Ast.Var.t Pos.marked option) - (precond : Desugared.Ast.expr Pos.marked Bindlib.box option) - (exception_to_rules : Desugared.Ast.RuleSet.t Pos.marked) - (just : Ast.expression Pos.marked option) - (cons : Ast.expression Pos.marked) : Desugared.Ast.rule = + (param_uid : Desugared.Ast.Var.t Marked.pos option) + (precond : Desugared.Ast.expr Marked.pos Bindlib.box option) + (exception_situation : Desugared.Ast.exception_situation) + (label_situation : Desugared.Ast.label_situation) + (just : Ast.expression Marked.pos option) + (cons : Ast.expression Marked.pos) : Desugared.Ast.rule = let just = match just with | Some just -> Some (translate_expr scope (Some def_key) ctxt just) | None -> None in - let just = merge_conditions precond just (Pos.get_position def_key) in + let just = merge_conditions precond just (Marked.get_mark def_key) in let cons = translate_expr scope (Some def_key) ctxt cons in { rule_just = just; rule_cons = cons; rule_parameter = (let def_key_typ = - Name_resolution.get_def_typ ctxt (Pos.unmark def_key) + Name_resolution.get_def_typ ctxt (Marked.unmark def_key) in - match Pos.unmark def_key_typ, param_uid with + match Marked.unmark def_key_typ, param_uid with | Scopelang.Ast.TArrow (t_in, _), Some param_uid -> - Some (Pos.unmark param_uid, t_in) + Some (Marked.unmark param_uid, t_in) | Scopelang.Ast.TArrow _, None -> Errors.raise_spanned_error - (Pos.get_position (Bindlib.unbox cons)) + (Marked.get_mark (Bindlib.unbox cons)) "This definition has a function type but the parameter is missing" | _, Some _ -> Errors.raise_spanned_error - (Pos.get_position (Bindlib.unbox cons)) + (Marked.get_mark (Bindlib.unbox cons)) "This definition has a parameter but its type is not a function" | _ -> None); - rule_exception_to_rules = exception_to_rules; + rule_exception = exception_situation; rule_id; + rule_label = label_situation; } (** Wrapper around {!val: process_default} that performs some name disambiguation *) let process_def - (precond : Desugared.Ast.expr Pos.marked Bindlib.box option) + (precond : Desugared.Ast.expr Marked.pos Bindlib.box option) (scope_uid : Scopelang.Ast.ScopeName.t) (ctxt : Name_resolution.context) (prgm : Desugared.Ast.program) @@ -1097,9 +1110,9 @@ let process_def let scope_ctxt = Scopelang.Ast.ScopeMap.find scope_uid ctxt.scopes in let def_key = Name_resolution.get_def_key - (Pos.unmark def.definition_name) + (Marked.unmark def.definition_name) def.definition_state scope_uid ctxt - (Pos.get_position def.definition_expr) + (Marked.get_mark def.definition_expr) in let scope_def_ctxt = Desugared.Ast.ScopeDefMap.find def_key scope_ctxt.scope_defs_contexts @@ -1109,36 +1122,45 @@ let process_def match def.definition_parameter with | None -> None, ctxt | Some param -> - let ctxt, param_var = Name_resolution.add_def_local_var ctxt param in - Some (Pos.same_pos_as param_var param), ctxt + let ctxt, param_var = + Name_resolution.add_def_local_var ctxt (Marked.unmark param) + in + Some (Marked.same_mark_as param_var param), ctxt in let scope_updated = let scope_def = Desugared.Ast.ScopeDefMap.find def_key scope.scope_defs in let rule_name = def.definition_id in - let parent_rules = + let label_situation = + match def.definition_label with + | Some (label_str, label_pos) -> + Desugared.Ast.ExplicitlyLabeled + ( Desugared.Ast.IdentMap.find label_str scope_def_ctxt.label_idmap, + label_pos ) + | None -> Desugared.Ast.Unlabeled + in + let exception_situation = match def.Ast.definition_exception_to with - | NotAnException -> - Desugared.Ast.RuleSet.empty, Pos.get_position def.Ast.definition_name + | NotAnException -> Desugared.Ast.BaseCase | UnlabeledException -> ( match scope_def_ctxt.default_exception_rulename with - (* This should have been caught previously by - check_unlabeled_exception *) | None | Some (Name_resolution.Ambiguous _) -> + (* This should have been caught previously by + check_unlabeled_exception *) assert false (* should not happen *) | Some (Name_resolution.Unique (name, pos)) -> - Desugared.Ast.RuleSet.singleton name, pos) - | ExceptionToLabel label -> ( + Desugared.Ast.ExceptionToRule (name, pos)) + | ExceptionToLabel label_str -> ( try let label_id = - Desugared.Ast.IdentMap.find (Pos.unmark label) + Desugared.Ast.IdentMap.find (Marked.unmark label_str) scope_def_ctxt.label_idmap in - ( Desugared.Ast.LabelMap.find label_id scope_def.scope_def_label_groups, - Pos.get_position def.Ast.definition_name ) + Desugared.Ast.ExceptionToLabel (label_id, Marked.get_mark label_str) with Not_found -> - Errors.raise_spanned_error (Pos.get_position label) + Errors.raise_spanned_error + (Marked.get_mark label_str) "Unknown label for the scope variable %a: \"%s\"" - Desugared.Ast.ScopeDef.format_t def_key (Pos.unmark label)) + Desugared.Ast.ScopeDef.format_t def_key (Marked.unmark label_str)) in let scope_def = { @@ -1146,9 +1168,9 @@ let process_def scope_def_rules = Desugared.Ast.RuleMap.add rule_name (process_default new_ctxt scope_uid - (def_key, Pos.get_position def.definition_name) - rule_name param_uid precond parent_rules def.definition_condition - def.definition_expr) + (def_key, Marked.get_mark def.definition_name) + rule_name param_uid precond exception_situation label_situation + def.definition_condition def.definition_expr) scope_def.scope_def_rules; } in @@ -1166,7 +1188,7 @@ let process_def (** Translates a {!type: Surface.Ast.rule} from the surface language *) let process_rule - (precond : Desugared.Ast.expr Pos.marked Bindlib.box option) + (precond : Desugared.Ast.expr Marked.pos Bindlib.box option) (scope : Scopelang.Ast.ScopeName.t) (ctxt : Name_resolution.context) (prgm : Desugared.Ast.program) @@ -1176,7 +1198,7 @@ let process_rule (** Translates assertions *) let process_assert - (precond : Desugared.Ast.expr Pos.marked Bindlib.box option) + (precond : Desugared.Ast.expr Marked.pos Bindlib.box option) (scope_uid : Scopelang.Ast.ScopeName.t) (ctxt : Name_resolution.context) (prgm : Desugared.Ast.program) @@ -1192,8 +1214,8 @@ let process_assert ( Ast.IfThenElse ( cond, ass.Ast.assertion_content, - Pos.same_pos_as (Ast.Literal (Ast.LBool true)) cond ), - Pos.get_position cond )) + Marked.same_mark_as (Ast.Literal (Ast.LBool true)) cond ), + Marked.get_mark cond )) in let ass = match precond with @@ -1203,9 +1225,9 @@ let process_assert ( Desugared.Ast.EIfThenElse ( precond, ass, - Pos.same_pos_as (Desugared.Ast.ELit (Dcalc.Ast.LBool true)) + Marked.same_mark_as (Desugared.Ast.ELit (Dcalc.Ast.LBool true)) precond ), - Pos.get_position precond )) + Marked.get_mark precond )) precond ass | None -> ass in @@ -1220,13 +1242,13 @@ let process_assert (** Translates a surface definition, rule or assertion *) let process_scope_use_item - (precond : Ast.expression Pos.marked option) + (precond : Ast.expression Marked.pos option) (scope : Scopelang.Ast.ScopeName.t) (ctxt : Name_resolution.context) (prgm : Desugared.Ast.program) - (item : Ast.scope_use_item Pos.marked) : Desugared.Ast.program = + (item : Ast.scope_use_item Marked.pos) : Desugared.Ast.program = let precond = Option.map (translate_expr scope None ctxt) precond in - match Pos.unmark item with + match Marked.unmark item with | Ast.Rule rule -> process_rule precond scope ctxt prgm rule | Ast.Definition def -> process_def precond scope ctxt prgm def | Ast.Assertion ass -> process_assert precond scope ctxt prgm ass @@ -1239,23 +1261,23 @@ let process_scope_use_item let check_unlabeled_exception (scope : Scopelang.Ast.ScopeName.t) (ctxt : Name_resolution.context) - (item : Ast.scope_use_item Pos.marked) : unit = + (item : Ast.scope_use_item Marked.pos) : unit = let scope_ctxt = Scopelang.Ast.ScopeMap.find scope ctxt.scopes in - match Pos.unmark item with + match Marked.unmark item with | Ast.Rule _ | Ast.Definition _ -> ( let def_key, exception_to = - match Pos.unmark item with + match Marked.unmark item with | Ast.Rule rule -> ( Name_resolution.get_def_key - (Pos.unmark rule.rule_name) + (Marked.unmark rule.rule_name) rule.rule_state scope ctxt - (Pos.get_position rule.rule_name), + (Marked.get_mark rule.rule_name), rule.rule_exception_to ) | Ast.Definition def -> ( Name_resolution.get_def_key - (Pos.unmark def.definition_name) + (Marked.unmark def.definition_name) def.definition_state scope ctxt - (Pos.get_position def.definition_name), + (Marked.get_mark def.definition_name), def.definition_exception_to ) | _ -> assert false (* should not happen *) @@ -1270,11 +1292,11 @@ let check_unlabeled_exception | Ast.UnlabeledException -> ( match scope_def_ctxt.default_exception_rulename with | None -> - Errors.raise_spanned_error (Pos.get_position item) + Errors.raise_spanned_error (Marked.get_mark item) "This exception does not have a corresponding definition" | Some (Ambiguous pos) -> Errors.raise_multispanned_error - ([Some "Ambiguous exception", Pos.get_position item] + ([Some "Ambiguous exception", Marked.get_mark item] @ List.map (fun p -> Some "Candidate definition", p) pos) "This exception can refer to several definitions. Try using labels \ to disambiguate" @@ -1305,7 +1327,7 @@ let attribute_to_io (attr : Ast.scope_decl_context_io) : Scopelang.Ast.io = { Scopelang.Ast.io_output = attr.scope_decl_context_io_output; Scopelang.Ast.io_input = - Pos.map_under_mark + Marked.map_under_mark (fun io -> match io with | Ast.Input -> Scopelang.Ast.OnlyInput @@ -1363,8 +1385,6 @@ let desugar_program (ctxt : Name_resolution.context) (prgm : Ast.program) : Desugared.Ast.scope_def_rules = Desugared.Ast.RuleMap.empty; Desugared.Ast.scope_def_typ = v_sig.var_sig_typ; - Desugared.Ast.scope_def_label_groups = - Name_resolution.label_groups ctxt s_uid def_key; Desugared.Ast.scope_def_is_condition = v_sig.var_sig_is_condition; Desugared.Ast.scope_def_io = @@ -1384,9 +1404,6 @@ let desugar_program (ctxt : Name_resolution.context) (prgm : Ast.program) : Desugared.Ast.RuleMap.empty; Desugared.Ast.scope_def_typ = v_sig.var_sig_typ; - Desugared.Ast.scope_def_label_groups = - Name_resolution.label_groups ctxt s_uid - def_key; Desugared.Ast.scope_def_is_condition = v_sig.var_sig_is_condition; Desugared.Ast.scope_def_io = @@ -1403,7 +1420,7 @@ let desugar_program (ctxt : Name_resolution.context) (prgm : Ast.program) : if i = 0 then original_io.io_input else ( Scopelang.Ast.NoInput, - Pos.get_position + Marked.get_mark (Desugared.Ast.StateName .get_info state) ) in @@ -1412,7 +1429,7 @@ let desugar_program (ctxt : Name_resolution.context) (prgm : Ast.program) : original_io.io_output else ( false, - Pos.get_position + Marked.get_mark (Desugared.Ast.StateName .get_info state) ) in @@ -1442,9 +1459,6 @@ let desugar_program (ctxt : Name_resolution.context) (prgm : Ast.program) : Desugared.Ast.scope_def_rules = Desugared.Ast.RuleMap.empty; Desugared.Ast.scope_def_typ = v_sig.var_sig_typ; - Desugared.Ast.scope_def_label_groups = - Name_resolution.label_groups ctxt subscope_uid - def_key; Desugared.Ast.scope_def_is_condition = v_sig.var_sig_is_condition; Desugared.Ast.scope_def_io = @@ -1475,7 +1489,7 @@ let desugar_program (ctxt : Name_resolution.context) (prgm : Ast.program) : | CodeBlock (block, _, _) -> List.fold_left (fun prgm item -> - match Pos.unmark item with + match Marked.unmark item with | Ast.ScopeUse use -> process_scope_use ctxt prgm use | _ -> prgm) prgm block diff --git a/compiler/surface/dune b/compiler/surface/dune index 9c5d3a5d..2184fb8a 100644 --- a/compiler/surface/dune +++ b/compiler/surface/dune @@ -10,7 +10,7 @@ scopelang zarith zarith_stubs_js - calendar) + dates_calc) (preprocess (pps sedlex.ppx visitors.ppx))) @@ -38,6 +38,11 @@ (merge_into parser) (flags --external-tokens Tokens --table --explain)) +(rule + (target grammar.html) + (action + (run obelisk html -o %{target} %{dep:parser.mly}))) + (documentation (package catala) (mld_files surface)) diff --git a/compiler/surface/fill_positions.ml b/compiler/surface/fill_positions.ml index f22e7273..f8d3db55 100644 --- a/compiler/surface/fill_positions.ml +++ b/compiler/surface/fill_positions.ml @@ -21,14 +21,14 @@ let fill_pos_with_legislative_info (p : Ast.program) : Ast.program = object inherit [_] Ast.program_map as super - method! visit_marked f env x = - f env (Pos.unmark x), Pos.overwrite_law_info (Pos.get_position x) env + method! visit_pos f env x = + f env (Marked.unmark x), Pos.overwrite_law_info (Marked.get_mark x) env method! visit_LawHeading (env : string list) (heading : Ast.law_heading) (children : Ast.law_structure list) = - let env = Pos.unmark heading.law_heading_name :: env in + let env = Marked.unmark heading.law_heading_name :: env in Ast.LawHeading ( super#visit_law_heading env heading, List.map (fun child -> super#visit_law_structure env child) children diff --git a/compiler/surface/lexer.cppo.ml b/compiler/surface/lexer.cppo.ml index e9ff72a0..66febe7f 100644 --- a/compiler/surface/lexer.cppo.ml +++ b/compiler/surface/lexer.cppo.ml @@ -59,6 +59,9 @@ module R = Re.Pcre #ifndef MR_COLLECTION #define MR_COLLECTION MS_COLLECTION #endif +#ifndef MR_CONTAINS + #define MR_CONTAINS MS_CONTAINS +#endif #ifndef MR_ENUM #define MR_ENUM MS_ENUM #endif @@ -221,6 +224,12 @@ module R = Re.Pcre #ifndef MR_IntToDec #define MR_IntToDec MS_IntToDec #endif +#ifndef MR_MoneyToDec + #define MR_MoneyToDec MS_MoneyToDec +#endif +#ifndef MR_DecToMoney + #define MR_DecToMoney MS_DecToMoney +#endif #ifndef MR_RoundMoney #define MR_RoundMoney MS_RoundMoney #endif @@ -236,6 +245,12 @@ module R = Re.Pcre #ifndef MR_GetYear #define MR_GetYear MS_GetYear #endif +#ifndef MR_FirstDayOfMonth + #define MR_FirstDayOfMonth MS_FirstDayOfMonth +#endif +#ifndef MR_LastDayOfMonth + #define MR_LastDayOfMonth MS_LastDayOfMonth +#endif #ifndef MR_INPUT #define MR_INPUT MS_INPUT #endif @@ -258,6 +273,7 @@ let token_list : (string * token) list = (MS_INCREASING, INCREASING); (MS_OF, OF); (MS_COLLECTION, COLLECTION); + (MS_CONTAINS, CONTAINS); (MS_ENUM, ENUM); (MS_INTEGER, INTEGER); (MS_MONEY, MONEY); @@ -322,9 +338,13 @@ let lex_builtin (s : string) : Ast.builtin_expression option = let lexbuf = Utf8.from_string s in match%sedlex lexbuf with | MR_IntToDec, eof -> Some IntToDec + | MR_DecToMoney, eof -> Some DecToMoney + | MR_MoneyToDec, eof -> Some MoneyToDec | MR_GetDay, eof -> Some GetDay | MR_GetMonth, eof -> Some GetMonth | MR_GetYear, eof -> Some GetYear + | MR_FirstDayOfMonth -> Some FirstDayOfMonth + | MR_LastDayOfMonth -> Some LastDayOfMonth | MR_RoundMoney, eof -> Some RoundMoney | MR_RoundDecimal, eof -> Some RoundDecimal | _ -> None @@ -394,6 +414,9 @@ let rec lex_code (lexbuf : lexbuf) : token = | MR_COLLECTION -> L.update_acc lexbuf; COLLECTION + | MR_CONTAINS -> + L.update_acc lexbuf; + CONTAINS | MR_ENUM -> L.update_acc lexbuf; ENUM @@ -572,10 +595,26 @@ let rec lex_code (lexbuf : lexbuf) : token = Buffer.add_string cents (String.make (2 - Buffer.length cents) '0'); L.update_acc lexbuf; MONEY_AMOUNT (Buffer.contents units, Buffer.contents cents) - | Plus digit, MC_DECIMAL_SEPARATOR, Star digit -> + | Rep (digit, 4), '-', Rep (digit, 2), '-', Rep (digit, 2) -> let rex = Re.(compile @@ whole_string @@ seq [ - group (rep1 digit); + group (repn digit 4 None); + char '-'; + group (repn digit 2 None); + char '-'; + group (repn digit 2 None); + ]) + in + let date_parts = R.get_substring (R.exec ~rex (Utf8.lexeme lexbuf)) in + DATE_LITERAL ( + int_of_string (date_parts 1), + int_of_string (date_parts 2), + int_of_string (date_parts 3) + ) + | Opt '-', Plus digit, MC_DECIMAL_SEPARATOR, Star digit -> + let rex = + Re.(compile @@ whole_string @@ seq [ + group (seq [opt (char '-') ; rep1 digit]); char MC_DECIMAL_SEPARATOR; group (rep digit) ]) in @@ -750,7 +789,7 @@ let rec lex_code (lexbuf : lexbuf) : token = (* Name of variable *) L.update_acc lexbuf; IDENT (Utf8.lexeme lexbuf) - | Plus digit -> + | Opt '-', Plus digit -> (* Integer literal*) L.update_acc lexbuf; INT_LITERAL (Utf8.lexeme lexbuf) diff --git a/compiler/surface/lexer_en.cppo.ml b/compiler/surface/lexer_en.cppo.ml index 6f896899..4cdd157d 100644 --- a/compiler/surface/lexer_en.cppo.ml +++ b/compiler/surface/lexer_en.cppo.ml @@ -29,6 +29,7 @@ #define MS_INCREASING "increasing" #define MS_OF "of" #define MS_COLLECTION "collection" +#define MS_CONTAINS "contains" #define MS_ENUM "enumeration" #define MS_INTEGER "integer" #define MS_MONEY "money" @@ -102,9 +103,13 @@ #define MS_RoundMoney "round_money" #define MS_RoundDecimal "round_decimal" #define MS_IntToDec "integer_to_decimal" +#define MS_MoneyToDec "money_to_decimal" +#define MS_DecToMoney "decimal_to_money" #define MS_GetDay "get_day" #define MS_GetMonth "get_month" #define MS_GetYear "get_year" +#define MS_FirstDayOfMonth "first_day_of_month" +#define MS_LastDayOfMonth "last_day_of_month" (* Directives *) diff --git a/compiler/surface/lexer_fr.cppo.ml b/compiler/surface/lexer_fr.cppo.ml index 95055145..7608a285 100644 --- a/compiler/surface/lexer_fr.cppo.ml +++ b/compiler/surface/lexer_fr.cppo.ml @@ -37,6 +37,7 @@ #define MS_INCREASING "croissant" #define MS_OF "de" #define MS_COLLECTION "collection" +#define MS_CONTAINS "contient" #define MS_ENUM "énumération" #define MR_ENUM 0xE9, "num", 0xE9, "ration" #define MS_INTEGER "entier" @@ -125,12 +126,18 @@ #define MR_RoundDecimal "arrondi_d", 0xE9, "cimal" #define MS_IntToDec "entier_vers_décimal" #define MR_IntToDec "entier_vers_d", 0xE9, "cimal" +#define MS_MoneyToDec "argent_vers_décimal" +#define MR_MoneyToDec "argent_vers_d", 0xE9, "cimal" +#define MS_DecToMoney "décimal_vers_argent" +#define MR_DecToMoney "d", 0xE9, "cimal_vers_argent" #define MS_GetDay "accès_jour" #define MR_GetDay "acc", 0xE8, "s_jour" #define MS_GetMonth "accès_mois" #define MR_GetMonth "acc", 0xE8, "s_mois" #define MS_GetYear "accès_année" #define MR_GetYear "acc", 0xE8, "s_ann", 0xE9, "e" +#define MS_FirstDayOfMonth "premier_jour_du_mois" +#define MS_LastDayOfMonth "dernier_jour_du_mois" (* Directives *) diff --git a/compiler/surface/lexer_pl.cppo.ml b/compiler/surface/lexer_pl.cppo.ml index 2df3a927..fb38dbb7 100644 --- a/compiler/surface/lexer_pl.cppo.ml +++ b/compiler/surface/lexer_pl.cppo.ml @@ -29,6 +29,7 @@ #define MS_INCREASING "rosnacy" #define MS_OF "z" #define MS_COLLECTION "kolekcja" +#define MS_CONTAINS "zawiera" #define MS_ENUM "enumeracja" #define MS_INTEGER "calkowita" #define MS_MONEY "pieniądze" @@ -113,12 +114,20 @@ #define MR_RoundMoney "zaokr",0x0105,"glony_pieni", 0x0105, "dze" #define MS_IntToDec "calkowita_wers_dziesiętny" #define MR_IntToDec "calkowita_wers_dziesi", 0x0119, "tny" +#define MS_MoneyToDec "pieniądze_wers_dziesiętny" +#define MR_MoneyToDec "pieni", 0x0105, "dze_wers_dziesi", 0x0119, "tny" +#define MS_DecToMoney "dziesiętny_wers_pieniądze" +#define MR_DecToMoney "dziesi", 0x0119, "tny_wers_pieni", 0x0105, "dze" #define MS_GetDay "dostęp_dzień" #define MR_GetDay "dost", 0x0119, "p_dzie", 0x144 #define MS_GetMonth "dostęp_miesiąc" #define MR_GetMonth "dost", 0x0119, "p_miesi", 0x0105, "c" #define MS_GetYear "dostęp_rok" #define MR_GetYear "dost", 0x0119, "p_rok" +#define MS_FirstDayOfMonth "pierwszy_dzień_miesiąca" +#define MR_FirstDayOfMonth "pierwszy_dzie", 0x144, "_miesi", 0x0105, "ca" +#define MS_LastDayOfMonth "ostatni_dzień_miesiąca" +#define MR_LastDayOfMonth "ostatni_dzie", 0x144, "_miesi", 0x0105, "ca" (* Directives *) diff --git a/compiler/surface/name_resolution.ml b/compiler/surface/name_resolution.ml index 6dbed35b..579fc97a 100644 --- a/compiler/surface/name_resolution.ml +++ b/compiler/surface/name_resolution.ml @@ -27,12 +27,11 @@ type typ = Scopelang.Ast.typ type unique_rulename = | Ambiguous of Pos.t list - | Unique of Desugared.Ast.RuleName.t Pos.marked + | Unique of Desugared.Ast.RuleName.t Marked.pos type scope_def_context = { default_exception_rulename : unique_rulename option; label_idmap : Desugared.Ast.LabelName.t Desugared.Ast.IdentMap.t; - label_groups : Desugared.Ast.RuleSet.t Desugared.Ast.LabelMap.t; } type scope_context = { @@ -47,14 +46,14 @@ type scope_context = { } (** Inside a scope, we distinguish between the variables and the subscopes. *) -type struct_context = typ Pos.marked Scopelang.Ast.StructFieldMap.t +type struct_context = typ Marked.pos Scopelang.Ast.StructFieldMap.t (** Types of the fields of a struct *) -type enum_context = typ Pos.marked Scopelang.Ast.EnumConstructorMap.t +type enum_context = typ Marked.pos Scopelang.Ast.EnumConstructorMap.t (** Types of the payloads of the cases of an enum *) type var_sig = { - var_sig_typ : typ Pos.marked; + var_sig_typ : typ Marked.pos; var_sig_is_condition : bool; var_sig_io : Ast.scope_decl_context_io; var_sig_states_idmap : Desugared.Ast.StateName.t Desugared.Ast.IdentMap.t; @@ -101,15 +100,15 @@ let raise_unsupported_feature (msg : string) (pos : Pos.t) = (** Function to call whenever an identifier used somewhere has not been declared in the program previously *) -let raise_unknown_identifier (msg : string) (ident : ident Pos.marked) = - Errors.raise_spanned_error (Pos.get_position ident) +let raise_unknown_identifier (msg : string) (ident : ident Marked.pos) = + Errors.raise_spanned_error (Marked.get_mark ident) "\"%s\": unknown identifier %s" - (Utils.Cli.with_style [ANSITerminal.yellow] "%s" (Pos.unmark ident)) + (Utils.Cli.with_style [ANSITerminal.yellow] "%s" (Marked.unmark ident)) msg (** Gets the type associated to an uid *) let get_var_typ (ctxt : context) (uid : Desugared.Ast.ScopeVar.t) : - typ Pos.marked = + typ Marked.pos = (Desugared.Ast.ScopeVarMap.find uid ctxt.var_typs).var_sig_typ let is_var_cond (ctxt : context) (uid : Desugared.Ast.ScopeVar.t) : bool = @@ -123,7 +122,7 @@ let get_var_io (ctxt : context) (uid : Desugared.Ast.ScopeVar.t) : let get_var_uid (scope_uid : Scopelang.Ast.ScopeName.t) (ctxt : context) - ((x, pos) : ident Pos.marked) : Desugared.Ast.ScopeVar.t = + ((x, pos) : ident Marked.pos) : Desugared.Ast.ScopeVar.t = let scope = Scopelang.Ast.ScopeMap.find scope_uid ctxt.scopes in match Desugared.Ast.IdentMap.find_opt x scope.var_idmap with | None -> @@ -137,7 +136,7 @@ let get_var_uid let get_subscope_uid (scope_uid : Scopelang.Ast.ScopeName.t) (ctxt : context) - ((y, pos) : ident Pos.marked) : Scopelang.Ast.SubScopeName.t = + ((y, pos) : ident Marked.pos) : Scopelang.Ast.SubScopeName.t = let scope = Scopelang.Ast.ScopeMap.find scope_uid ctxt.scopes in match Desugared.Ast.IdentMap.find_opt y scope.sub_scopes_idmap with | None -> raise_unknown_identifier "for a subscope of this scope" (y, pos) @@ -164,7 +163,7 @@ let belongs_to (** Retrieves the type of a scope definition from the context *) let get_def_typ (ctxt : context) (def : Desugared.Ast.ScopeDef.t) : - typ Pos.marked = + typ Marked.pos = match def with | Desugared.Ast.ScopeDef.SubScopeVar (_, x) (* we don't need to look at the subscope prefix because [x] is already the uid @@ -180,17 +179,6 @@ let is_def_cond (ctxt : context) (def : Desugared.Ast.ScopeDef.t) : bool = | Desugared.Ast.ScopeDef.Var (x, _) -> is_var_cond ctxt x -let label_groups - (ctxt : context) - (s_uid : Scopelang.Ast.ScopeName.t) - (def : Desugared.Ast.ScopeDef.t) : - Desugared.Ast.RuleSet.t Desugared.Ast.LabelMap.t = - try - (Desugared.Ast.ScopeDefMap.find def - (Scopelang.Ast.ScopeMap.find s_uid ctxt.scopes).scope_defs_contexts) - .label_groups - with Not_found -> Desugared.Ast.LabelMap.empty - (** {1 Declarations pass} *) (** Process a subscope declaration *) @@ -208,7 +196,7 @@ let process_subscope_decl Errors.raise_multispanned_error [ ( Some "first use", - Pos.get_position (Scopelang.Ast.SubScopeName.get_info use) ); + Marked.get_mark (Scopelang.Ast.SubScopeName.get_info use) ); Some "second use", s_pos; ] "Subscope name \"%a\" already used" @@ -237,7 +225,7 @@ let process_subscope_decl scopes = Scopelang.Ast.ScopeMap.add scope scope_ctxt ctxt.scopes; } -let is_type_cond ((typ, _) : Ast.typ Pos.marked) = +let is_type_cond ((typ, _) : Ast.typ Marked.pos) = match typ with | Ast.Base Ast.Condition | Ast.Func { arg_typ = _; return_typ = Ast.Condition, _ } -> @@ -247,13 +235,14 @@ let is_type_cond ((typ, _) : Ast.typ Pos.marked) = (** Process a basic type (all types except function types) *) let rec process_base_typ (ctxt : context) - ((typ, typ_pos) : Ast.base_typ Pos.marked) : Scopelang.Ast.typ Pos.marked = + ((typ, typ_pos) : Ast.base_typ Marked.pos) : Scopelang.Ast.typ Marked.pos = match typ with | Ast.Condition -> Scopelang.Ast.TLit TBool, typ_pos | Ast.Data (Ast.Collection t) -> ( Scopelang.Ast.TArray - (Pos.unmark - (process_base_typ ctxt (Ast.Data (Pos.unmark t), Pos.get_position t))), + (Marked.unmark + (process_base_typ ctxt + (Ast.Data (Marked.unmark t), Marked.get_mark t))), typ_pos ) | Ast.Data (Ast.Primitive prim) -> ( match prim with @@ -277,8 +266,8 @@ let rec process_base_typ ident))) (** Process a type (function or not) *) -let process_type (ctxt : context) ((typ, typ_pos) : Ast.typ Pos.marked) : - Scopelang.Ast.typ Pos.marked = +let process_type (ctxt : context) ((typ, typ_pos) : Ast.typ Marked.pos) : + Scopelang.Ast.typ Marked.pos = match typ with | Ast.Base base_typ -> process_base_typ ctxt (base_typ, typ_pos) | Ast.Func { arg_typ; return_typ } -> @@ -300,7 +289,7 @@ let process_data_decl | Some use -> Errors.raise_multispanned_error [ - Some "First use:", Pos.get_position (Desugared.Ast.ScopeVar.get_info use); + Some "First use:", Marked.get_mark (Desugared.Ast.ScopeVar.get_info use); Some "Second use:", pos; ] "Variable name \"%a\" already used" @@ -318,7 +307,7 @@ let process_data_decl List.fold_right (fun state_id (states_idmap, states_list) -> let state_uid = Desugared.Ast.StateName.fresh state_id in - ( Desugared.Ast.IdentMap.add (Pos.unmark state_id) state_uid + ( Desugared.Ast.IdentMap.add (Marked.unmark state_id) state_uid states_idmap, state_uid :: states_list )) decl.scope_decl_context_item_states @@ -349,15 +338,14 @@ let process_item_decl | Ast.ContextScope sub_decl -> process_subscope_decl scope ctxt sub_decl (** Adds a binding to the context *) -let add_def_local_var (ctxt : context) (name : ident Pos.marked) : +let add_def_local_var (ctxt : context) (name : ident) : context * Desugared.Ast.Var.t = let local_var_uid = Desugared.Ast.Var.make name in let ctxt = { ctxt with local_var_idmap = - Desugared.Ast.IdentMap.add (Pos.unmark name) local_var_uid - ctxt.local_var_idmap; + Desugared.Ast.IdentMap.add name local_var_uid ctxt.local_var_idmap; } in ctxt, local_var_uid @@ -367,7 +355,7 @@ let process_scope_decl (ctxt : context) (decl : Ast.scope_decl) : context = let name, _ = decl.scope_decl_name in let scope_uid = Desugared.Ast.IdentMap.find name ctxt.scope_idmap in List.fold_left - (fun ctxt item -> process_item_decl scope_uid ctxt (Pos.unmark item)) + (fun ctxt item -> process_item_decl scope_uid ctxt (Marked.unmark item)) ctxt decl.scope_decl_context (** Process a struct declaration *) @@ -377,10 +365,10 @@ let process_struct_decl (ctxt : context) (sdecl : Ast.struct_decl) : context = in if List.length sdecl.struct_decl_fields = 0 then Errors.raise_spanned_error - (Pos.get_position sdecl.struct_decl_name) + (Marked.get_mark sdecl.struct_decl_name) "The struct %s does not have any fields; give it some for Catala to be \ able to accept it." - (Pos.unmark sdecl.struct_decl_name); + (Marked.unmark sdecl.struct_decl_name); List.fold_left (fun ctxt (fdecl, _) -> let f_uid = @@ -391,7 +379,7 @@ let process_struct_decl (ctxt : context) (sdecl : Ast.struct_decl) : context = ctxt with field_idmap = Desugared.Ast.IdentMap.update - (Pos.unmark fdecl.Ast.struct_decl_field_name) + (Marked.unmark fdecl.Ast.struct_decl_field_name) (fun uids -> match uids with | None -> Some (Scopelang.Ast.StructMap.singleton s_uid f_uid) @@ -426,10 +414,10 @@ let process_enum_decl (ctxt : context) (edecl : Ast.enum_decl) : context = in if List.length edecl.enum_decl_cases = 0 then Errors.raise_spanned_error - (Pos.get_position edecl.enum_decl_name) + (Marked.get_mark edecl.enum_decl_name) "The enum %s does not have any cases; give it some for Catala to be able \ to accept it." - (Pos.unmark edecl.enum_decl_name); + (Marked.unmark edecl.enum_decl_name); List.fold_left (fun ctxt (cdecl, cdecl_pos) -> let c_uid = @@ -440,7 +428,7 @@ let process_enum_decl (ctxt : context) (edecl : Ast.enum_decl) : context = ctxt with constructor_idmap = Desugared.Ast.IdentMap.update - (Pos.unmark cdecl.Ast.enum_decl_case_name) + (Marked.unmark cdecl.Ast.enum_decl_case_name) (fun uids -> match uids with | None -> Some (Scopelang.Ast.EnumMap.singleton e_uid c_uid) @@ -468,19 +456,19 @@ let process_enum_decl (ctxt : context) (edecl : Ast.enum_decl) : context = ctxt edecl.enum_decl_cases (** Process the names of all declaration items *) -let process_name_item (ctxt : context) (item : Ast.code_item Pos.marked) : +let process_name_item (ctxt : context) (item : Ast.code_item Marked.pos) : context = let raise_already_defined_error (use : Uid.MarkedString.info) name pos msg = Errors.raise_multispanned_error [ - Some "First definition:", Pos.get_position use; + Some "First definition:", Marked.get_mark use; Some "Second definition:", pos; ] "%s name \"%a\" already defined" msg (Utils.Cli.format_with_style [ANSITerminal.yellow]) name in - match Pos.unmark item with + match Marked.unmark item with | ScopeDecl decl -> ( let name, pos = decl.scope_decl_name in (* Checks if the name is already used *) @@ -517,7 +505,7 @@ let process_name_item (ctxt : context) (item : Ast.code_item Pos.marked) : ctxt with struct_idmap = Desugared.Ast.IdentMap.add - (Pos.unmark sdecl.struct_decl_name) + (Marked.unmark sdecl.struct_decl_name) s_uid ctxt.struct_idmap; }) | EnumDecl edecl -> ( @@ -534,15 +522,15 @@ let process_name_item (ctxt : context) (item : Ast.code_item Pos.marked) : ctxt with enum_idmap = Desugared.Ast.IdentMap.add - (Pos.unmark edecl.enum_decl_name) + (Marked.unmark edecl.enum_decl_name) e_uid ctxt.enum_idmap; }) | ScopeUse _ -> ctxt (** Process a code item that is a declaration *) -let process_decl_item (ctxt : context) (item : Ast.code_item Pos.marked) : +let process_decl_item (ctxt : context) (item : Ast.code_item Marked.pos) : context = - match Pos.unmark item with + match Marked.unmark item with | ScopeDecl decl -> process_scope_decl ctxt decl | StructDecl sdecl -> process_struct_decl ctxt sdecl | EnumDecl edecl -> process_enum_decl ctxt edecl @@ -552,14 +540,14 @@ let process_decl_item (ctxt : context) (item : Ast.code_item Pos.marked) : let process_code_block (ctxt : context) (block : Ast.code_block) - (process_item : context -> Ast.code_item Pos.marked -> context) : context = + (process_item : context -> Ast.code_item Marked.pos -> context) : context = List.fold_left (fun ctxt decl -> process_item ctxt decl) ctxt block (** Process a law structure, only considering the code blocks *) let rec process_law_structure (ctxt : context) (s : Ast.law_structure) - (process_item : context -> Ast.code_item Pos.marked -> context) : context = + (process_item : context -> Ast.code_item Marked.pos -> context) : context = match s with | Ast.LawHeading (_, children) -> List.fold_left @@ -572,7 +560,7 @@ let rec process_law_structure let get_def_key (name : Ast.qident) - (state : Ast.ident Pos.marked option) + (state : Ast.ident Marked.pos option) (scope_uid : Scopelang.Ast.ScopeName.t) (ctxt : context) (default_pos : Pos.t) : Desugared.Ast.ScopeDef.t = @@ -587,14 +575,14 @@ let get_def_key | Some state -> ( try Some - (Desugared.Ast.IdentMap.find (Pos.unmark state) + (Desugared.Ast.IdentMap.find (Marked.unmark state) var_sig.var_sig_states_idmap) with Not_found -> Errors.raise_multispanned_error [ - None, Pos.get_position state; + None, Marked.get_mark state; ( Some "Variable declaration:", - Pos.get_position (Desugared.Ast.ScopeVar.get_info x_uid) ); + Marked.get_mark (Desugared.Ast.ScopeVar.get_info x_uid) ); ] "This identifier is not a state declared for variable %a." Desugared.Ast.ScopeVar.format_t x_uid) @@ -603,9 +591,9 @@ let get_def_key then Errors.raise_multispanned_error [ - None, Pos.get_position x; + None, Marked.get_mark x; ( Some "Variable declaration:", - Pos.get_position (Desugared.Ast.ScopeVar.get_info x_uid) ); + Marked.get_mark (Desugared.Ast.ScopeVar.get_info x_uid) ); ] "This definition does not indicate which state has to be \ considered for variable %a." @@ -638,9 +626,9 @@ let process_definition (fun (s_ctxt : scope_context option) -> let def_key = get_def_key - (Pos.unmark d.definition_name) + (Marked.unmark d.definition_name) d.definition_state s_name ctxt - (Pos.get_position d.definition_expr) + (Marked.get_mark d.definition_expr) in match s_ctxt with | None -> assert false (* should not happen *) @@ -659,7 +647,6 @@ let process_definition definition for this definition key *) default_exception_rulename = None; label_idmap = Desugared.Ast.IdentMap.empty; - label_groups = Desugared.Ast.LabelMap.empty; } ~some:(fun x -> x) def_key_ctx @@ -671,7 +658,7 @@ let process_definition | None -> def_key_ctx | Some label -> let new_label_idmap = - Desugared.Ast.IdentMap.update (Pos.unmark label) + Desugared.Ast.IdentMap.update (Marked.unmark label) (fun existing_label -> match existing_label with | Some existing_label -> Some existing_label @@ -679,27 +666,7 @@ let process_definition Some (Desugared.Ast.LabelName.fresh label)) def_key_ctx.label_idmap in - let label_id = - Desugared.Ast.IdentMap.find (Pos.unmark label) - new_label_idmap - in - { - def_key_ctx with - label_idmap = new_label_idmap; - label_groups = - Desugared.Ast.LabelMap.update label_id - (fun group -> - match group with - | None -> - Some - (Desugared.Ast.RuleSet.singleton - d.definition_id) - | Some existing_group -> - Some - (Desugared.Ast.RuleSet.add d.definition_id - existing_group)) - def_key_ctx.label_groups; - } + { def_key_ctx with label_idmap = new_label_idmap } in (* And second, we update the map of default rulenames for unlabeled exceptions *) @@ -720,7 +687,7 @@ let process_definition default_exception_rulename = Some (Ambiguous - ([Pos.get_position d.definition_name] + ([Marked.get_mark d.definition_name] @ match old with | Ambiguous old -> old @@ -737,7 +704,7 @@ let process_definition default_exception_rulename = Some (Ambiguous - [Pos.get_position d.definition_name]); + [Marked.get_mark d.definition_name]); } (* This is a possible default definition for this key. We create and store a fresh rulename *) @@ -748,7 +715,7 @@ let process_definition Some (Unique ( d.definition_id, - Pos.get_position d.definition_name )); + Marked.get_mark d.definition_name )); })) in Some def_key_ctx) @@ -760,8 +727,8 @@ let process_definition let process_scope_use_item (s_name : Scopelang.Ast.ScopeName.t) (ctxt : context) - (sitem : Ast.scope_use_item Pos.marked) : context = - match Pos.unmark sitem with + (sitem : Ast.scope_use_item Marked.pos) : context = + match Marked.unmark sitem with | Rule r -> process_definition ctxt s_name (Ast.rule_to_def r) | Definition d -> process_definition ctxt s_name d | _ -> ctxt @@ -770,20 +737,20 @@ let process_scope_use (ctxt : context) (suse : Ast.scope_use) : context = let s_name = try Desugared.Ast.IdentMap.find - (Pos.unmark suse.Ast.scope_use_name) + (Marked.unmark suse.Ast.scope_use_name) ctxt.scope_idmap with Not_found -> Errors.raise_spanned_error - (Pos.get_position suse.Ast.scope_use_name) + (Marked.get_mark suse.Ast.scope_use_name) "\"%a\": this scope has not been declared anywhere, is it a typo?" (Utils.Cli.format_with_style [ANSITerminal.yellow]) - (Pos.unmark suse.Ast.scope_use_name) + (Marked.unmark suse.Ast.scope_use_name) in List.fold_left (process_scope_use_item s_name) ctxt suse.Ast.scope_use_items -let process_use_item (ctxt : context) (item : Ast.code_item Pos.marked) : +let process_use_item (ctxt : context) (item : Ast.code_item Marked.pos) : context = - match Pos.unmark item with + match Marked.unmark item with | ScopeDecl _ | StructDecl _ | EnumDecl _ -> ctxt | ScopeUse suse -> process_scope_use ctxt suse diff --git a/compiler/surface/name_resolution.mli b/compiler/surface/name_resolution.mli index 4dd8d9a5..21520a35 100644 --- a/compiler/surface/name_resolution.mli +++ b/compiler/surface/name_resolution.mli @@ -27,12 +27,11 @@ type typ = Scopelang.Ast.typ type unique_rulename = | Ambiguous of Pos.t list - | Unique of Desugared.Ast.RuleName.t Pos.marked + | Unique of Desugared.Ast.RuleName.t Marked.pos type scope_def_context = { default_exception_rulename : unique_rulename option; label_idmap : Desugared.Ast.LabelName.t Desugared.Ast.IdentMap.t; - label_groups : Desugared.Ast.RuleSet.t Desugared.Ast.LabelMap.t; } type scope_context = { @@ -47,14 +46,14 @@ type scope_context = { } (** Inside a scope, we distinguish between the variables and the subscopes. *) -type struct_context = typ Pos.marked Scopelang.Ast.StructFieldMap.t +type struct_context = typ Marked.pos Scopelang.Ast.StructFieldMap.t (** Types of the fields of a struct *) -type enum_context = typ Pos.marked Scopelang.Ast.EnumConstructorMap.t +type enum_context = typ Marked.pos Scopelang.Ast.EnumConstructorMap.t (** Types of the payloads of the cases of an enum *) type var_sig = { - var_sig_typ : typ Pos.marked; + var_sig_typ : typ Marked.pos; var_sig_is_condition : bool; var_sig_io : Ast.scope_decl_context_io; var_sig_states_idmap : Desugared.Ast.StateName.t Desugared.Ast.IdentMap.t; @@ -98,11 +97,11 @@ val raise_unsupported_feature : string -> Pos.t -> 'a (** Temporary function raising an error message saying that a feature is not supported yet *) -val raise_unknown_identifier : string -> ident Pos.marked -> 'a +val raise_unknown_identifier : string -> ident Marked.pos -> 'a (** Function to call whenever an identifier used somewhere has not been declared in the program previously *) -val get_var_typ : context -> Desugared.Ast.ScopeVar.t -> typ Pos.marked +val get_var_typ : context -> Desugared.Ast.ScopeVar.t -> typ Marked.pos (** Gets the type associated to an uid *) val is_var_cond : context -> Desugared.Ast.ScopeVar.t -> bool @@ -113,14 +112,14 @@ val get_var_io : val get_var_uid : Scopelang.Ast.ScopeName.t -> context -> - ident Pos.marked -> + ident Marked.pos -> Desugared.Ast.ScopeVar.t (** Get the variable uid inside the scope given in argument *) val get_subscope_uid : Scopelang.Ast.ScopeName.t -> context -> - ident Pos.marked -> + ident Marked.pos -> Scopelang.Ast.SubScopeName.t (** Get the subscope uid inside the scope given in argument *) @@ -132,26 +131,18 @@ val belongs_to : context -> Desugared.Ast.ScopeVar.t -> Scopelang.Ast.ScopeName.t -> bool (** Checks if the var_uid belongs to the scope scope_uid *) -val get_def_typ : context -> Desugared.Ast.ScopeDef.t -> typ Pos.marked +val get_def_typ : context -> Desugared.Ast.ScopeDef.t -> typ Marked.pos (** Retrieves the type of a scope definition from the context *) val is_def_cond : context -> Desugared.Ast.ScopeDef.t -> bool +val is_type_cond : Ast.typ Marked.pos -> bool -val label_groups : - context -> - Scopelang.Ast.ScopeName.t -> - Desugared.Ast.ScopeDef.t -> - Desugared.Ast.RuleSet.t Desugared.Ast.LabelMap.t - -val is_type_cond : Ast.typ Pos.marked -> bool - -val add_def_local_var : - context -> ident Pos.marked -> context * Desugared.Ast.Var.t +val add_def_local_var : context -> ident -> context * Desugared.Ast.Var.t (** Adds a binding to the context *) val get_def_key : Ast.qident -> - Ast.ident Pos.marked option -> + Ast.ident Marked.pos option -> Scopelang.Ast.ScopeName.t -> context -> Pos.t -> diff --git a/compiler/surface/parser.messages b/compiler/surface/parser.messages index 6454f92e..9584cc22 100644 --- a/compiler/surface/parser.messages +++ b/compiler/surface/parser.messages @@ -1,6 +1,6 @@ source_file: BEGIN_CODE DECLARATION ENUM CONSTRUCTOR COLON ALT CONSTRUCTOR CONTENT TEXT YEAR ## -## Ends in an error in state: 358. +## Ends in an error in state: 353. ## ## list(enum_decl_line) -> enum_decl_line . list(enum_decl_line) [ SCOPE END_CODE DECLARATION ] ## @@ -12,7 +12,7 @@ expected another enum case, or a new declaration or scope use source_file: BEGIN_CODE DECLARATION ENUM CONSTRUCTOR COLON ALT CONSTRUCTOR CONTENT YEAR ## -## Ends in an error in state: 353. +## Ends in an error in state: 348. ## ## enum_decl_line_payload -> CONTENT . typ [ SCOPE END_CODE DECLARATION ALT ] ## @@ -24,7 +24,7 @@ expected a content type source_file: BEGIN_CODE DECLARATION ENUM CONSTRUCTOR COLON ALT CONSTRUCTOR YEAR ## -## Ends in an error in state: 352. +## Ends in an error in state: 347. ## ## enum_decl_line -> ALT constructor . option(enum_decl_line_payload) [ SCOPE END_CODE DECLARATION ALT ] ## @@ -36,7 +36,7 @@ expected a payload for your enum case, or another case or declaration source_file: BEGIN_CODE DECLARATION ENUM CONSTRUCTOR COLON ALT YEAR ## -## Ends in an error in state: 351. +## Ends in an error in state: 346. ## ## enum_decl_line -> ALT . constructor option(enum_decl_line_payload) [ SCOPE END_CODE DECLARATION ALT ] ## @@ -48,7 +48,7 @@ expected the name of an enum case source_file: BEGIN_CODE DECLARATION ENUM CONSTRUCTOR COLON YEAR ## -## Ends in an error in state: 350. +## Ends in an error in state: 345. ## ## code_item -> DECLARATION ENUM constructor COLON . list(enum_decl_line) [ SCOPE END_CODE DECLARATION ] ## @@ -60,7 +60,7 @@ expected an enum case source_file: BEGIN_CODE DECLARATION ENUM CONSTRUCTOR YEAR ## -## Ends in an error in state: 349. +## Ends in an error in state: 344. ## ## code_item -> DECLARATION ENUM constructor . COLON list(enum_decl_line) [ SCOPE END_CODE DECLARATION ] ## @@ -72,7 +72,7 @@ expected a colon source_file: BEGIN_CODE DECLARATION ENUM YEAR ## -## Ends in an error in state: 348. +## Ends in an error in state: 343. ## ## code_item -> DECLARATION ENUM . constructor COLON list(enum_decl_line) [ SCOPE END_CODE DECLARATION ] ## @@ -91,7 +91,7 @@ expected the name of your enum source_file: BEGIN_CODE DECLARATION SCOPE CONSTRUCTOR COLON YEAR ## -## Ends in an error in state: 323. +## Ends in an error in state: 318. ## ## code_item -> DECLARATION SCOPE constructor COLON . nonempty_list(scope_decl_item) [ SCOPE END_CODE DECLARATION ] ## @@ -103,7 +103,7 @@ expected a context item introduced by "context" source_file: BEGIN_CODE DECLARATION SCOPE CONSTRUCTOR YEAR ## -## Ends in an error in state: 322. +## Ends in an error in state: 317. ## ## code_item -> DECLARATION SCOPE constructor . COLON nonempty_list(scope_decl_item) [ SCOPE END_CODE DECLARATION ] ## @@ -115,7 +115,7 @@ expected a colon followed by the list of context items of this scope source_file: BEGIN_CODE DECLARATION SCOPE YEAR ## -## Ends in an error in state: 321. +## Ends in an error in state: 316. ## ## code_item -> DECLARATION SCOPE . constructor COLON nonempty_list(scope_decl_item) [ SCOPE END_CODE DECLARATION ] ## @@ -127,7 +127,7 @@ expected the name of the scope you are declaring source_file: BEGIN_CODE DECLARATION STRUCT CONSTRUCTOR COLON CONDITION IDENT DEPENDS COLLECTION YEAR ## -## Ends in an error in state: 308. +## Ends in an error in state: 303. ## ## typ -> collection_marked . typ [ STATE SCOPE OUTPUT INTERNAL INPUT IDENT END_CODE DEPENDS DECLARATION DATA CONTEXT CONDITION ALT ] ## @@ -139,7 +139,7 @@ expected a new struct data, or another declaration or scope use source_file: BEGIN_CODE DECLARATION STRUCT CONSTRUCTOR COLON CONDITION IDENT DEPENDS TEXT YEAR ## -## Ends in an error in state: 316. +## Ends in an error in state: 311. ## ## list(struct_scope) -> struct_scope . list(struct_scope) [ SCOPE END_CODE DECLARATION ] ## @@ -151,7 +151,7 @@ expected a new struct data, or another declaration or scope use source_file: BEGIN_CODE DECLARATION STRUCT CONSTRUCTOR COLON CONDITION IDENT DEPENDS YEAR ## -## Ends in an error in state: 312. +## Ends in an error in state: 307. ## ## struct_scope_func -> DEPENDS . typ [ STATE SCOPE OUTPUT INTERNAL INPUT IDENT END_CODE DECLARATION DATA CONTEXT CONDITION ] ## @@ -163,7 +163,7 @@ expected the type of the parameter of this struct data function source_file: BEGIN_CODE DECLARATION STRUCT CONSTRUCTOR COLON CONDITION IDENT YEAR ## -## Ends in an error in state: 311. +## Ends in an error in state: 306. ## ## struct_scope -> struct_scope_base . option(struct_scope_func) [ SCOPE END_CODE DECLARATION DATA CONDITION ] ## @@ -175,7 +175,7 @@ expected a new struct data, or another declaration or scope use source_file: BEGIN_CODE DECLARATION STRUCT CONSTRUCTOR COLON CONDITION YEAR ## -## Ends in an error in state: 318. +## Ends in an error in state: 313. ## ## struct_scope_base -> condition_pos . ident [ SCOPE END_CODE DEPENDS DECLARATION DATA CONDITION ] ## @@ -187,7 +187,7 @@ expected the name of this struct condition source_file: BEGIN_CODE DECLARATION STRUCT CONSTRUCTOR COLON DATA IDENT CONTENT YEAR ## -## Ends in an error in state: 304. +## Ends in an error in state: 299. ## ## struct_scope_base -> DATA ident CONTENT . typ [ SCOPE END_CODE DEPENDS DECLARATION DATA CONDITION ] ## @@ -199,7 +199,7 @@ expected the type of this struct data source_file: BEGIN_CODE DECLARATION STRUCT CONSTRUCTOR COLON DATA IDENT YEAR ## -## Ends in an error in state: 303. +## Ends in an error in state: 298. ## ## struct_scope_base -> DATA ident . CONTENT typ [ SCOPE END_CODE DEPENDS DECLARATION DATA CONDITION ] ## @@ -211,7 +211,7 @@ expected the type of this struct data, introduced by the content keyword source_file: BEGIN_CODE DECLARATION STRUCT CONSTRUCTOR COLON DATA YEAR ## -## Ends in an error in state: 302. +## Ends in an error in state: 297. ## ## struct_scope_base -> DATA . ident CONTENT typ [ SCOPE END_CODE DEPENDS DECLARATION DATA CONDITION ] ## @@ -223,7 +223,7 @@ expected the name of this struct data source_file: BEGIN_CODE DECLARATION STRUCT CONSTRUCTOR COLON YEAR ## -## Ends in an error in state: 301. +## Ends in an error in state: 296. ## ## code_item -> DECLARATION STRUCT constructor COLON . list(struct_scope) [ SCOPE END_CODE DECLARATION ] ## @@ -235,7 +235,7 @@ expected struct data or condition source_file: BEGIN_CODE DECLARATION STRUCT CONSTRUCTOR YEAR ## -## Ends in an error in state: 300. +## Ends in an error in state: 295. ## ## code_item -> DECLARATION STRUCT constructor . COLON list(struct_scope) [ SCOPE END_CODE DECLARATION ] ## @@ -247,7 +247,7 @@ expected a colon source_file: BEGIN_CODE DECLARATION STRUCT YEAR ## -## Ends in an error in state: 299. +## Ends in an error in state: 294. ## ## code_item -> DECLARATION STRUCT . constructor COLON list(struct_scope) [ SCOPE END_CODE DECLARATION ] ## @@ -259,7 +259,7 @@ expected the struct name source_file: BEGIN_CODE DECLARATION YEAR ## -## Ends in an error in state: 298. +## Ends in an error in state: 293. ## ## code_item -> DECLARATION . STRUCT constructor COLON list(struct_scope) [ SCOPE END_CODE DECLARATION ] ## code_item -> DECLARATION . SCOPE constructor COLON nonempty_list(scope_decl_item) [ SCOPE END_CODE DECLARATION ] @@ -273,7 +273,7 @@ expected the kind of the declaration (struct, scope or enum) source_file: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION CARDINAL THEN ## -## Ends in an error in state: 263. +## Ends in an error in state: 258. ## ## nonempty_list(scope_item) -> scope_item . [ SCOPE END_CODE DECLARATION ] ## nonempty_list(scope_item) -> scope_item . nonempty_list(scope_item) [ SCOPE END_CODE DECLARATION ] @@ -285,26 +285,26 @@ source_file: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION CARDINAL THEN ## This implies that, although the LR(1) items shown above provide an ## accurate view of the past (what has been recognized so far), they ## may provide an INCOMPLETE view of the future (what was expected next). -## In state 86, spurious reduction of production primitive_expression -> CARDINAL -## In state 90, spurious reduction of production base_expression -> primitive_expression -## In state 116, spurious reduction of production unop_expression -> base_expression -## In state 87, spurious reduction of production mult_expression -> unop_expression -## In state 164, spurious reduction of production sum_expression -> mult_expression -## In state 117, spurious reduction of production compare_expression -> sum_expression -## In state 175, spurious reduction of production logical_atom -> compare_expression -## In state 170, spurious reduction of production logical_or_expression -> logical_atom -## In state 166, spurious reduction of production logical_expression -> logical_or_expression -## In state 200, spurious reduction of production expression -> logical_expression -## In state 257, spurious reduction of production assertion_base -> expression -## In state 258, spurious reduction of production assertion -> option(condition_consequence) assertion_base -## In state 262, spurious reduction of production scope_item -> ASSERTION assertion +## In state 81, spurious reduction of production primitive_expression -> CARDINAL +## In state 85, spurious reduction of production base_expression -> primitive_expression +## In state 111, spurious reduction of production unop_expression -> base_expression +## In state 82, spurious reduction of production mult_expression -> unop_expression +## In state 159, spurious reduction of production sum_expression -> mult_expression +## In state 112, spurious reduction of production compare_expression -> sum_expression +## In state 170, spurious reduction of production logical_atom -> compare_expression +## In state 165, spurious reduction of production logical_or_expression -> logical_atom +## In state 161, spurious reduction of production logical_expression -> logical_or_expression +## In state 195, spurious reduction of production expression -> logical_expression +## In state 252, spurious reduction of production assertion_base -> expression +## In state 253, spurious reduction of production assertion -> option(condition_consequence) assertion_base +## In state 257, spurious reduction of production scope_item -> ASSERTION assertion ## expected a new scope use item source_file: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION FIXED IDENT BY YEAR ## -## Ends in an error in state: 254. +## Ends in an error in state: 249. ## ## assertion -> FIXED qident BY . ident [ SCOPE RULE LABEL EXCEPTION END_CODE DEFINITION DECLARATION ASSERTION ] ## @@ -316,7 +316,7 @@ expected the legislative text by which the value of the variable is fixed source_file: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION FIXED IDENT WITH_V ## -## Ends in an error in state: 253. +## Ends in an error in state: 248. ## ## assertion -> FIXED qident . BY ident [ SCOPE RULE LABEL EXCEPTION END_CODE DEFINITION DECLARATION ASSERTION ] ## @@ -327,15 +327,15 @@ source_file: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION FIXED IDENT WITH_V ## This implies that, although the LR(1) items shown above provide an ## accurate view of the past (what has been recognized so far), they ## may provide an INCOMPLETE view of the future (what was expected next). -## In state 247, spurious reduction of production separated_nonempty_list(DOT,ident) -> ident -## In state 239, spurious reduction of production qident -> separated_nonempty_list(DOT,ident) +## In state 242, spurious reduction of production separated_nonempty_list(DOT,ident) -> ident +## In state 234, spurious reduction of production qident -> separated_nonempty_list(DOT,ident) ## expected the legislative text by which the value of the variable is fixed source_file: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION FIXED YEAR ## -## Ends in an error in state: 252. +## Ends in an error in state: 247. ## ## assertion -> FIXED . qident BY ident [ SCOPE RULE LABEL EXCEPTION END_CODE DEFINITION DECLARATION ASSERTION ] ## @@ -348,7 +348,7 @@ expected the name of the variable that should be fixed source_file: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION UNDER_CONDITION TRUE THEN ## -## Ends in an error in state: 260. +## Ends in an error in state: 255. ## ## condition_consequence -> condition . CONSEQUENCE [ VERTICAL TRUE SUM STATE NOT MONEY_AMOUNT MINUSMONEY MINUSDURATION MINUSDEC MINUS MINIMUM MAXIMUM MATCH MAP LSQUARE LPAREN INT_LITERAL IF IDENT FOR FILTER FILLED FALSE EXISTS DEFINED_AS DECIMAL_LITERAL CONTENT CONSTRUCTOR CARDINAL ] ## @@ -359,24 +359,24 @@ source_file: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION UNDER_CONDITION TRUE T ## This implies that, although the LR(1) items shown above provide an ## accurate view of the past (what has been recognized so far), they ## may provide an INCOMPLETE view of the future (what was expected next). -## In state 51, spurious reduction of production primitive_expression -> small_expression -## In state 90, spurious reduction of production base_expression -> primitive_expression -## In state 116, spurious reduction of production unop_expression -> base_expression -## In state 87, spurious reduction of production mult_expression -> unop_expression -## In state 164, spurious reduction of production sum_expression -> mult_expression -## In state 117, spurious reduction of production compare_expression -> sum_expression -## In state 175, spurious reduction of production logical_atom -> compare_expression -## In state 170, spurious reduction of production logical_or_expression -> logical_atom -## In state 166, spurious reduction of production logical_expression -> logical_or_expression -## In state 200, spurious reduction of production expression -> logical_expression -## In state 251, spurious reduction of production condition -> UNDER_CONDITION expression +## In state 46, spurious reduction of production primitive_expression -> small_expression +## In state 85, spurious reduction of production base_expression -> primitive_expression +## In state 111, spurious reduction of production unop_expression -> base_expression +## In state 82, spurious reduction of production mult_expression -> unop_expression +## In state 159, spurious reduction of production sum_expression -> mult_expression +## In state 112, spurious reduction of production compare_expression -> sum_expression +## In state 170, spurious reduction of production logical_atom -> compare_expression +## In state 165, spurious reduction of production logical_or_expression -> logical_atom +## In state 161, spurious reduction of production logical_expression -> logical_or_expression +## In state 195, spurious reduction of production expression -> logical_expression +## In state 246, spurious reduction of production condition -> UNDER_CONDITION expression ## expected a consequence for this definition under condition source_file: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION UNDER_CONDITION YEAR ## -## Ends in an error in state: 250. +## Ends in an error in state: 245. ## ## condition -> UNDER_CONDITION . expression [ CONSEQUENCE ] ## @@ -388,7 +388,7 @@ expected an expression for this condition source_file: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION VARIES IDENT UNDER_CONDITION ## -## Ends in an error in state: 240. +## Ends in an error in state: 235. ## ## assertion -> VARIES qident . WITH_V base_expression option(variation_type) [ SCOPE RULE LABEL EXCEPTION END_CODE DEFINITION DECLARATION ASSERTION ] ## @@ -399,15 +399,15 @@ source_file: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION VARIES IDENT UNDER_CON ## This implies that, although the LR(1) items shown above provide an ## accurate view of the past (what has been recognized so far), they ## may provide an INCOMPLETE view of the future (what was expected next). -## In state 247, spurious reduction of production separated_nonempty_list(DOT,ident) -> ident -## In state 239, spurious reduction of production qident -> separated_nonempty_list(DOT,ident) +## In state 242, spurious reduction of production separated_nonempty_list(DOT,ident) -> ident +## In state 234, spurious reduction of production qident -> separated_nonempty_list(DOT,ident) ## expected an indication about what this variable varies with source_file: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION VARIES IDENT WITH_V TRUE XOR ## -## Ends in an error in state: 242. +## Ends in an error in state: 237. ## ## assertion -> VARIES qident WITH_V base_expression . option(variation_type) [ SCOPE RULE LABEL EXCEPTION END_CODE DEFINITION DECLARATION ASSERTION ] ## @@ -418,15 +418,15 @@ source_file: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION VARIES IDENT WITH_V TR ## This implies that, although the LR(1) items shown above provide an ## accurate view of the past (what has been recognized so far), they ## may provide an INCOMPLETE view of the future (what was expected next). -## In state 51, spurious reduction of production primitive_expression -> small_expression -## In state 90, spurious reduction of production base_expression -> primitive_expression +## In state 46, spurious reduction of production primitive_expression -> small_expression +## In state 85, spurious reduction of production base_expression -> primitive_expression ## expected an indication about the variation sense of the variable, or a new scope item source_file: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION VARIES IDENT WITH_V YEAR ## -## Ends in an error in state: 241. +## Ends in an error in state: 236. ## ## assertion -> VARIES qident WITH_V . base_expression option(variation_type) [ SCOPE RULE LABEL EXCEPTION END_CODE DEFINITION DECLARATION ASSERTION ] ## @@ -438,7 +438,7 @@ the variable varies with an expression that was expected here source_file: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION VARIES YEAR ## -## Ends in an error in state: 238. +## Ends in an error in state: 233. ## ## assertion -> VARIES . qident WITH_V base_expression option(variation_type) [ SCOPE RULE LABEL EXCEPTION END_CODE DEFINITION DECLARATION ASSERTION ] ## @@ -450,7 +450,7 @@ expecting the name of the varying variable source_file: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION YEAR ## -## Ends in an error in state: 237. +## Ends in an error in state: 232. ## ## scope_item -> ASSERTION . assertion [ SCOPE RULE LABEL EXCEPTION END_CODE DEFINITION DECLARATION ASSERTION ] ## @@ -462,7 +462,7 @@ expected an expression that shoud be asserted during execution source_file: BEGIN_CODE SCOPE CONSTRUCTOR COLON DEFINITION IDENT DEFINED_AS YEAR ## -## Ends in an error in state: 291. +## Ends in an error in state: 286. ## ## definition -> option(label) option(exception_to) DEFINITION qident option(definition_parameters) option(state) option(condition_consequence) DEFINED_AS . expression [ SCOPE RULE LABEL EXCEPTION END_CODE DEFINITION DECLARATION ASSERTION ] ## @@ -474,7 +474,7 @@ expected an expression for the definition source_file: BEGIN_CODE SCOPE CONSTRUCTOR COLON DEFINITION IDENT OF IDENT DECREASING ## -## Ends in an error in state: 288. +## Ends in an error in state: 283. ## ## definition -> option(label) option(exception_to) DEFINITION qident option(definition_parameters) . option(state) option(condition_consequence) DEFINED_AS expression [ SCOPE RULE LABEL EXCEPTION END_CODE DEFINITION DECLARATION ASSERTION ] ## @@ -487,7 +487,7 @@ expected a expression for defining this function, introduced by the defined as k source_file: BEGIN_CODE SCOPE CONSTRUCTOR COLON DEFINITION IDENT WITH_V ## -## Ends in an error in state: 287. +## Ends in an error in state: 282. ## ## definition -> option(label) option(exception_to) DEFINITION qident . option(definition_parameters) option(state) option(condition_consequence) DEFINED_AS expression [ SCOPE RULE LABEL EXCEPTION END_CODE DEFINITION DECLARATION ASSERTION ] ## @@ -498,15 +498,15 @@ source_file: BEGIN_CODE SCOPE CONSTRUCTOR COLON DEFINITION IDENT WITH_V ## This implies that, although the LR(1) items shown above provide an ## accurate view of the past (what has been recognized so far), they ## may provide an INCOMPLETE view of the future (what was expected next). -## In state 247, spurious reduction of production separated_nonempty_list(DOT,ident) -> ident -## In state 239, spurious reduction of production qident -> separated_nonempty_list(DOT,ident) +## In state 242, spurious reduction of production separated_nonempty_list(DOT,ident) -> ident +## In state 234, spurious reduction of production qident -> separated_nonempty_list(DOT,ident) ## expected the defined as keyword to introduce the definition of this variable source_file: BEGIN_CODE SCOPE CONSTRUCTOR COLON DEFINITION YEAR ## -## Ends in an error in state: 286. +## Ends in an error in state: 281. ## ## definition -> option(label) option(exception_to) DEFINITION . qident option(definition_parameters) option(state) option(condition_consequence) DEFINED_AS expression [ SCOPE RULE LABEL EXCEPTION END_CODE DEFINITION DECLARATION ASSERTION ] ## @@ -518,7 +518,7 @@ expected the name of the variable you want to define source_file: BEGIN_CODE SCOPE CONSTRUCTOR COLON EXCEPTION IDENT YEAR ## -## Ends in an error in state: 269. +## Ends in an error in state: 264. ## ## definition -> option(label) option(exception_to) . DEFINITION qident option(definition_parameters) option(state) option(condition_consequence) DEFINED_AS expression [ SCOPE RULE LABEL EXCEPTION END_CODE DEFINITION DECLARATION ASSERTION ] ## rule -> option(label) option(exception_to) . RULE rule_expr option(condition_consequence) option(state) rule_consequence [ SCOPE RULE LABEL EXCEPTION END_CODE DEFINITION DECLARATION ASSERTION ] @@ -531,7 +531,7 @@ expected a rule or a definition after the exception declaration source_file: BEGIN_CODE SCOPE CONSTRUCTOR COLON EXCEPTION YEAR ## -## Ends in an error in state: 266. +## Ends in an error in state: 261. ## ## exception_to -> EXCEPTION . option(ident) [ RULE DEFINITION ] ## @@ -543,7 +543,7 @@ expected the label to which the exception is referring back source_file: BEGIN_CODE SCOPE CONSTRUCTOR COLON LABEL IDENT DEFINED_AS ## -## Ends in an error in state: 265. +## Ends in an error in state: 260. ## ## definition -> option(label) . option(exception_to) DEFINITION qident option(definition_parameters) option(state) option(condition_consequence) DEFINED_AS expression [ SCOPE RULE LABEL EXCEPTION END_CODE DEFINITION DECLARATION ASSERTION ] ## rule -> option(label) . option(exception_to) RULE rule_expr option(condition_consequence) option(state) rule_consequence [ SCOPE RULE LABEL EXCEPTION END_CODE DEFINITION DECLARATION ASSERTION ] @@ -556,7 +556,7 @@ expected a rule or a definition after the label declaration source_file: BEGIN_CODE SCOPE CONSTRUCTOR COLON LABEL YEAR ## -## Ends in an error in state: 235. +## Ends in an error in state: 230. ## ## label -> LABEL . ident [ RULE EXCEPTION DEFINITION ] ## @@ -568,7 +568,7 @@ expected the name of the label source_file: BEGIN_CODE SCOPE CONSTRUCTOR COLON RULE IDENT DOT YEAR ## -## Ends in an error in state: 248. +## Ends in an error in state: 243. ## ## separated_nonempty_list(DOT,ident) -> ident DOT . separated_nonempty_list(DOT,ident) [ WITH_V UNDER_CONDITION STATE OF NOT FILLED DEFINED_AS BY ] ## @@ -580,7 +580,7 @@ expected a struct field or a sub-scope context item after the dot source_file: BEGIN_CODE SCOPE CONSTRUCTOR COLON RULE IDENT NOT FALSE ## -## Ends in an error in state: 279. +## Ends in an error in state: 274. ## ## rule_consequence -> option(NOT) . FILLED [ SCOPE RULE LABEL EXCEPTION END_CODE DEFINITION DECLARATION ASSERTION ] ## @@ -592,7 +592,7 @@ expected the filled keyword the this rule source_file: BEGIN_CODE SCOPE CONSTRUCTOR COLON RULE IDENT OF IDENT YEAR ## -## Ends in an error in state: 271. +## Ends in an error in state: 266. ## ## rule -> option(label) option(exception_to) RULE rule_expr . option(condition_consequence) option(state) rule_consequence [ SCOPE RULE LABEL EXCEPTION END_CODE DEFINITION DECLARATION ASSERTION ] ## @@ -604,7 +604,7 @@ expected the expression of the rule source_file: BEGIN_CODE SCOPE CONSTRUCTOR COLON RULE IDENT OF YEAR ## -## Ends in an error in state: 282. +## Ends in an error in state: 277. ## ## definition_parameters -> OF . ident [ UNDER_CONDITION STATE NOT FILLED DEFINED_AS ] ## @@ -617,7 +617,7 @@ expected the name of the parameter for this dependent variable source_file: BEGIN_CODE SCOPE CONSTRUCTOR COLON RULE IDENT WITH_V ## -## Ends in an error in state: 281. +## Ends in an error in state: 276. ## ## rule_expr -> qident . option(definition_parameters) [ UNDER_CONDITION STATE NOT FILLED ] ## @@ -628,15 +628,15 @@ source_file: BEGIN_CODE SCOPE CONSTRUCTOR COLON RULE IDENT WITH_V ## This implies that, although the LR(1) items shown above provide an ## accurate view of the past (what has been recognized so far), they ## may provide an INCOMPLETE view of the future (what was expected next). -## In state 247, spurious reduction of production separated_nonempty_list(DOT,ident) -> ident -## In state 239, spurious reduction of production qident -> separated_nonempty_list(DOT,ident) +## In state 242, spurious reduction of production separated_nonempty_list(DOT,ident) -> ident +## In state 234, spurious reduction of production qident -> separated_nonempty_list(DOT,ident) ## expected a condition or a consequence for this rule source_file: BEGIN_CODE SCOPE CONSTRUCTOR COLON RULE IDENT YEAR ## -## Ends in an error in state: 247. +## Ends in an error in state: 242. ## ## separated_nonempty_list(DOT,ident) -> ident . [ WITH_V UNDER_CONDITION STATE OF NOT FILLED DEFINED_AS BY ] ## separated_nonempty_list(DOT,ident) -> ident . DOT separated_nonempty_list(DOT,ident) [ WITH_V UNDER_CONDITION STATE OF NOT FILLED DEFINED_AS BY ] @@ -649,7 +649,7 @@ expected a condition or a consequence for this rule, or the rest of the variable source_file: BEGIN_CODE SCOPE CONSTRUCTOR COLON RULE YEAR ## -## Ends in an error in state: 270. +## Ends in an error in state: 265. ## ## rule -> option(label) option(exception_to) RULE . rule_expr option(condition_consequence) option(state) rule_consequence [ SCOPE RULE LABEL EXCEPTION END_CODE DEFINITION DECLARATION ASSERTION ] ## @@ -661,7 +661,7 @@ expected the name of the variable subject to the rule source_file: BEGIN_CODE SCOPE CONSTRUCTOR COLON YEAR ## -## Ends in an error in state: 234. +## Ends in an error in state: 229. ## ## code_item -> SCOPE constructor option(scope_use_condition) COLON . nonempty_list(scope_item) [ SCOPE END_CODE DECLARATION ] ## @@ -673,10 +673,10 @@ expected a scope use item: a rule, definition or assertion source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION CARDINAL YEAR ## -## Ends in an error in state: 86. +## Ends in an error in state: 81. ## ## aggregate_func -> CARDINAL . [ FOR ] -## primitive_expression -> CARDINAL . [ XOR WITH THEN SEMICOLON SCOPE RULE RSQUARE RPAREN RBRACKET PLUSPLUS PLUSMONEY PLUSDURATION PLUSDEC PLUSDATE PLUS OR OF NOT_EQUAL MULTMONEY MULTDEC MULT MULDURATION MINUSMONEY MINUSDURATION MINUSDEC MINUSDATE MINUS LESSER_MONEY LESSER_EQUAL_MONEY LESSER_EQUAL_DURATION LESSER_EQUAL_DEC LESSER_EQUAL_DATE LESSER_EQUAL LESSER_DURATION LESSER_DEC LESSER_DATE LESSER LABEL INCREASING IN GREATER_MONEY GREATER_EQUAL_MONEY GREATER_EQUAL_DURATION GREATER_EQUAL_DEC GREATER_EQUAL_DATE GREATER_EQUAL GREATER_DURATION GREATER_DEC GREATER_DATE GREATER EXCEPTION EQUAL END_CODE ELSE DIVMONEY DIVDURATION DIVDEC DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] +## primitive_expression -> CARDINAL . [ XOR WITH THEN SEMICOLON SCOPE RULE RSQUARE RPAREN RBRACKET PLUSPLUS PLUSMONEY PLUSDURATION PLUSDEC PLUSDATE PLUS OR OF NOT_EQUAL MULTMONEY MULTDEC MULT MULDURATION MINUSMONEY MINUSDURATION MINUSDEC MINUSDATE MINUS LESSER_MONEY LESSER_EQUAL_MONEY LESSER_EQUAL_DURATION LESSER_EQUAL_DEC LESSER_EQUAL_DATE LESSER_EQUAL LESSER_DURATION LESSER_DEC LESSER_DATE LESSER LABEL INCREASING GREATER_MONEY GREATER_EQUAL_MONEY GREATER_EQUAL_DURATION GREATER_EQUAL_DEC GREATER_EQUAL_DATE GREATER_EQUAL GREATER_DURATION GREATER_DEC GREATER_DATE GREATER EXCEPTION EQUAL END_CODE ELSE DIVMONEY DIVDURATION DIVDEC DIV DEFINITION DECREASING DECLARATION CONTAINS CONSEQUENCE COLON ASSERTION AND ALT ] ## ## The known suffix of the stack is as follows: ## CARDINAL @@ -686,10 +686,10 @@ expected the keyword following cardinal to compute the number of elements in a s source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION CONSTRUCTOR CONTENT TRUE YEAR ## -## Ends in an error in state: 182. +## Ends in an error in state: 177. ## -## enum_inject_content -> CONTENT small_expression . [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RSQUARE RPAREN RBRACKET PLUSPLUS PLUSMONEY PLUSDURATION PLUSDEC PLUSDATE PLUS OR OF NOT_EQUAL MULTMONEY MULTDEC MULT MULDURATION MINUSMONEY MINUSDURATION MINUSDEC MINUSDATE MINUS LESSER_MONEY LESSER_EQUAL_MONEY LESSER_EQUAL_DURATION LESSER_EQUAL_DEC LESSER_EQUAL_DATE LESSER_EQUAL LESSER_DURATION LESSER_DEC LESSER_DATE LESSER LABEL INCREASING IN GREATER_MONEY GREATER_EQUAL_MONEY GREATER_EQUAL_DURATION GREATER_EQUAL_DEC GREATER_EQUAL_DATE GREATER_EQUAL GREATER_DURATION GREATER_DEC GREATER_DATE GREATER FOR EXCEPTION EQUAL END_CODE ELSE DIVMONEY DIVDURATION DIVDEC DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] -## small_expression -> small_expression . DOT option(terminated(constructor,DOT)) ident [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RSQUARE RPAREN RBRACKET PLUSPLUS PLUSMONEY PLUSDURATION PLUSDEC PLUSDATE PLUS OR OF NOT_EQUAL MULTMONEY MULTDEC MULT MULDURATION MINUSMONEY MINUSDURATION MINUSDEC MINUSDATE MINUS LESSER_MONEY LESSER_EQUAL_MONEY LESSER_EQUAL_DURATION LESSER_EQUAL_DEC LESSER_EQUAL_DATE LESSER_EQUAL LESSER_DURATION LESSER_DEC LESSER_DATE LESSER LABEL INCREASING IN GREATER_MONEY GREATER_EQUAL_MONEY GREATER_EQUAL_DURATION GREATER_EQUAL_DEC GREATER_EQUAL_DATE GREATER_EQUAL GREATER_DURATION GREATER_DEC GREATER_DATE GREATER FOR EXCEPTION EQUAL END_CODE ELSE DOT DIVMONEY DIVDURATION DIVDEC DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] +## enum_inject_content -> CONTENT small_expression . [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RSQUARE RPAREN RBRACKET PLUSPLUS PLUSMONEY PLUSDURATION PLUSDEC PLUSDATE PLUS OR OF NOT_EQUAL MULTMONEY MULTDEC MULT MULDURATION MINUSMONEY MINUSDURATION MINUSDEC MINUSDATE MINUS LESSER_MONEY LESSER_EQUAL_MONEY LESSER_EQUAL_DURATION LESSER_EQUAL_DEC LESSER_EQUAL_DATE LESSER_EQUAL LESSER_DURATION LESSER_DEC LESSER_DATE LESSER LABEL INCREASING GREATER_MONEY GREATER_EQUAL_MONEY GREATER_EQUAL_DURATION GREATER_EQUAL_DEC GREATER_EQUAL_DATE GREATER_EQUAL GREATER_DURATION GREATER_DEC GREATER_DATE GREATER FOR EXCEPTION EQUAL END_CODE ELSE DIVMONEY DIVDURATION DIVDEC DIV DEFINITION DECREASING DECLARATION CONTAINS CONSEQUENCE COLON ASSERTION AND ALT ] +## small_expression -> small_expression . DOT option(terminated(constructor,DOT)) ident [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RSQUARE RPAREN RBRACKET PLUSPLUS PLUSMONEY PLUSDURATION PLUSDEC PLUSDATE PLUS OR OF NOT_EQUAL MULTMONEY MULTDEC MULT MULDURATION MINUSMONEY MINUSDURATION MINUSDEC MINUSDATE MINUS LESSER_MONEY LESSER_EQUAL_MONEY LESSER_EQUAL_DURATION LESSER_EQUAL_DEC LESSER_EQUAL_DATE LESSER_EQUAL LESSER_DURATION LESSER_DEC LESSER_DATE LESSER LABEL INCREASING GREATER_MONEY GREATER_EQUAL_MONEY GREATER_EQUAL_DURATION GREATER_EQUAL_DEC GREATER_EQUAL_DATE GREATER_EQUAL GREATER_DURATION GREATER_DEC GREATER_DATE GREATER FOR EXCEPTION EQUAL END_CODE ELSE DOT DIVMONEY DIVDURATION DIVDEC DIV DEFINITION DECREASING DECLARATION CONTAINS CONSEQUENCE COLON ASSERTION AND ALT ] ## ## The known suffix of the stack is as follows: ## CONTENT small_expression @@ -699,9 +699,9 @@ the expression for the content of the enum case is already well-formed, expected source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION CONSTRUCTOR CONTENT YEAR ## -## Ends in an error in state: 181. +## Ends in an error in state: 176. ## -## enum_inject_content -> CONTENT . small_expression [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RSQUARE RPAREN RBRACKET PLUSPLUS PLUSMONEY PLUSDURATION PLUSDEC PLUSDATE PLUS OR OF NOT_EQUAL MULTMONEY MULTDEC MULT MULDURATION MINUSMONEY MINUSDURATION MINUSDEC MINUSDATE MINUS LESSER_MONEY LESSER_EQUAL_MONEY LESSER_EQUAL_DURATION LESSER_EQUAL_DEC LESSER_EQUAL_DATE LESSER_EQUAL LESSER_DURATION LESSER_DEC LESSER_DATE LESSER LABEL INCREASING IN GREATER_MONEY GREATER_EQUAL_MONEY GREATER_EQUAL_DURATION GREATER_EQUAL_DEC GREATER_EQUAL_DATE GREATER_EQUAL GREATER_DURATION GREATER_DEC GREATER_DATE GREATER FOR EXCEPTION EQUAL END_CODE ELSE DIVMONEY DIVDURATION DIVDEC DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] +## enum_inject_content -> CONTENT . small_expression [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RSQUARE RPAREN RBRACKET PLUSPLUS PLUSMONEY PLUSDURATION PLUSDEC PLUSDATE PLUS OR OF NOT_EQUAL MULTMONEY MULTDEC MULT MULDURATION MINUSMONEY MINUSDURATION MINUSDEC MINUSDATE MINUS LESSER_MONEY LESSER_EQUAL_MONEY LESSER_EQUAL_DURATION LESSER_EQUAL_DEC LESSER_EQUAL_DATE LESSER_EQUAL LESSER_DURATION LESSER_DEC LESSER_DATE LESSER LABEL INCREASING GREATER_MONEY GREATER_EQUAL_MONEY GREATER_EQUAL_DURATION GREATER_EQUAL_DEC GREATER_EQUAL_DATE GREATER_EQUAL GREATER_DURATION GREATER_DEC GREATER_DATE GREATER FOR EXCEPTION EQUAL END_CODE ELSE DIVMONEY DIVDURATION DIVDEC DIV DEFINITION DECREASING DECLARATION CONTAINS CONSEQUENCE COLON ASSERTION AND ALT ] ## ## The known suffix of the stack is as follows: ## CONTENT @@ -711,9 +711,9 @@ expected an expression for the content of this enum case source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION CONSTRUCTOR DOT CONSTRUCTOR ALL ## -## Ends in an error in state: 180. +## Ends in an error in state: 175. ## -## struct_or_enum_inject -> constructor option(preceded(DOT,constructor)) . option(enum_inject_content) [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RSQUARE RPAREN RBRACKET PLUSPLUS PLUSMONEY PLUSDURATION PLUSDEC PLUSDATE PLUS OR OF NOT_EQUAL MULTMONEY MULTDEC MULT MULDURATION MINUSMONEY MINUSDURATION MINUSDEC MINUSDATE MINUS LESSER_MONEY LESSER_EQUAL_MONEY LESSER_EQUAL_DURATION LESSER_EQUAL_DEC LESSER_EQUAL_DATE LESSER_EQUAL LESSER_DURATION LESSER_DEC LESSER_DATE LESSER LABEL INCREASING IN GREATER_MONEY GREATER_EQUAL_MONEY GREATER_EQUAL_DURATION GREATER_EQUAL_DEC GREATER_EQUAL_DATE GREATER_EQUAL GREATER_DURATION GREATER_DEC GREATER_DATE GREATER FOR EXCEPTION EQUAL END_CODE ELSE DIVMONEY DIVDURATION DIVDEC DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] +## struct_or_enum_inject -> constructor option(preceded(DOT,constructor)) . option(enum_inject_content) [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RSQUARE RPAREN RBRACKET PLUSPLUS PLUSMONEY PLUSDURATION PLUSDEC PLUSDATE PLUS OR OF NOT_EQUAL MULTMONEY MULTDEC MULT MULDURATION MINUSMONEY MINUSDURATION MINUSDEC MINUSDATE MINUS LESSER_MONEY LESSER_EQUAL_MONEY LESSER_EQUAL_DURATION LESSER_EQUAL_DEC LESSER_EQUAL_DATE LESSER_EQUAL LESSER_DURATION LESSER_DEC LESSER_DATE LESSER LABEL INCREASING GREATER_MONEY GREATER_EQUAL_MONEY GREATER_EQUAL_DURATION GREATER_EQUAL_DEC GREATER_EQUAL_DATE GREATER_EQUAL GREATER_DURATION GREATER_DEC GREATER_DATE GREATER FOR EXCEPTION EQUAL END_CODE ELSE DIVMONEY DIVDURATION DIVDEC DIV DEFINITION DECREASING DECLARATION CONTAINS CONSEQUENCE COLON ASSERTION AND ALT ] ## ## The known suffix of the stack is as follows: ## constructor option(preceded(DOT,constructor)) @@ -723,9 +723,9 @@ expected the rest of the path, or the content of the enum constructor source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION CONSTRUCTOR DOT YEAR ## -## Ends in an error in state: 97. +## Ends in an error in state: 92. ## -## option(preceded(DOT,constructor)) -> DOT . constructor [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RSQUARE RPAREN RBRACKET PLUSPLUS PLUSMONEY PLUSDURATION PLUSDEC PLUSDATE PLUS OR OF NOT_EQUAL MULTMONEY MULTDEC MULT MULDURATION MINUSMONEY MINUSDURATION MINUSDEC MINUSDATE MINUS LESSER_MONEY LESSER_EQUAL_MONEY LESSER_EQUAL_DURATION LESSER_EQUAL_DEC LESSER_EQUAL_DATE LESSER_EQUAL LESSER_DURATION LESSER_DEC LESSER_DATE LESSER LABEL INCREASING IN GREATER_MONEY GREATER_EQUAL_MONEY GREATER_EQUAL_DURATION GREATER_EQUAL_DEC GREATER_EQUAL_DATE GREATER_EQUAL GREATER_DURATION GREATER_DEC GREATER_DATE GREATER FOR EXCEPTION EQUAL END_CODE ELSE DIVMONEY DIVDURATION DIVDEC DIV DEFINITION DECREASING DECLARATION CONTENT CONSTRUCTOR CONSEQUENCE COLON ASSERTION AND ALT ] +## option(preceded(DOT,constructor)) -> DOT . constructor [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RSQUARE RPAREN RBRACKET PLUSPLUS PLUSMONEY PLUSDURATION PLUSDEC PLUSDATE PLUS OR OF NOT_EQUAL MULTMONEY MULTDEC MULT MULDURATION MINUSMONEY MINUSDURATION MINUSDEC MINUSDATE MINUS LESSER_MONEY LESSER_EQUAL_MONEY LESSER_EQUAL_DURATION LESSER_EQUAL_DEC LESSER_EQUAL_DATE LESSER_EQUAL LESSER_DURATION LESSER_DEC LESSER_DATE LESSER LABEL INCREASING GREATER_MONEY GREATER_EQUAL_MONEY GREATER_EQUAL_DURATION GREATER_EQUAL_DEC GREATER_EQUAL_DATE GREATER_EQUAL GREATER_DURATION GREATER_DEC GREATER_DATE GREATER FOR EXCEPTION EQUAL END_CODE ELSE DIVMONEY DIVDURATION DIVDEC DIV DEFINITION DECREASING DECLARATION CONTENT CONTAINS CONSTRUCTOR CONSEQUENCE COLON ASSERTION AND ALT ] ## ## The known suffix of the stack is as follows: ## DOT @@ -736,7 +736,7 @@ expected the rest of the path after the dot source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION CONSTRUCTOR LBRACKET ALT IDENT COLON CARDINAL THEN ## -## Ends in an error in state: 81. +## Ends in an error in state: 76. ## ## separated_nonempty_list(ALT,struct_content_field) -> struct_content_field . [ RBRACKET ] ## separated_nonempty_list(ALT,struct_content_field) -> struct_content_field . ALT separated_nonempty_list(ALT,struct_content_field) [ RBRACKET ] @@ -748,23 +748,23 @@ source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION CONSTRUCTOR LBRACKET A ## This implies that, although the LR(1) items shown above provide an ## accurate view of the past (what has been recognized so far), they ## may provide an INCOMPLETE view of the future (what was expected next). -## In state 86, spurious reduction of production primitive_expression -> CARDINAL -## In state 90, spurious reduction of production base_expression -> primitive_expression -## In state 116, spurious reduction of production unop_expression -> base_expression -## In state 87, spurious reduction of production mult_expression -> unop_expression -## In state 164, spurious reduction of production sum_expression -> mult_expression -## In state 117, spurious reduction of production compare_expression -> sum_expression -## In state 175, spurious reduction of production logical_atom -> compare_expression -## In state 170, spurious reduction of production logical_or_expression -> logical_atom -## In state 166, spurious reduction of production logical_expression -> logical_or_expression -## In state 176, spurious reduction of production struct_content_field -> ident COLON logical_expression +## In state 81, spurious reduction of production primitive_expression -> CARDINAL +## In state 85, spurious reduction of production base_expression -> primitive_expression +## In state 111, spurious reduction of production unop_expression -> base_expression +## In state 82, spurious reduction of production mult_expression -> unop_expression +## In state 159, spurious reduction of production sum_expression -> mult_expression +## In state 112, spurious reduction of production compare_expression -> sum_expression +## In state 170, spurious reduction of production logical_atom -> compare_expression +## In state 165, spurious reduction of production logical_or_expression -> logical_atom +## In state 161, spurious reduction of production logical_expression -> logical_or_expression +## In state 171, spurious reduction of production struct_content_field -> ident COLON logical_expression ## expected another structure field or the closing bracket source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION CONSTRUCTOR LBRACKET ALT IDENT COLON YEAR ## -## Ends in an error in state: 85. +## Ends in an error in state: 80. ## ## struct_content_field -> ident COLON . logical_expression [ RBRACKET ALT ] ## @@ -776,7 +776,7 @@ expected the expression for this struct field source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION CONSTRUCTOR LBRACKET ALT IDENT YEAR ## -## Ends in an error in state: 84. +## Ends in an error in state: 79. ## ## struct_content_field -> ident . COLON logical_expression [ RBRACKET ALT ] ## @@ -788,9 +788,9 @@ expected a colon source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION CONSTRUCTOR LBRACKET ALT YEAR ## -## Ends in an error in state: 80. +## Ends in an error in state: 75. ## -## struct_inject_content -> LBRACKET ALT . separated_nonempty_list(ALT,struct_content_field) RBRACKET [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RSQUARE RPAREN RBRACKET PLUSPLUS PLUSMONEY PLUSDURATION PLUSDEC PLUSDATE PLUS OR OF NOT_EQUAL MULTMONEY MULTDEC MULT MULDURATION MINUSMONEY MINUSDURATION MINUSDEC MINUSDATE MINUS LESSER_MONEY LESSER_EQUAL_MONEY LESSER_EQUAL_DURATION LESSER_EQUAL_DEC LESSER_EQUAL_DATE LESSER_EQUAL LESSER_DURATION LESSER_DEC LESSER_DATE LESSER LABEL INCREASING IN GREATER_MONEY GREATER_EQUAL_MONEY GREATER_EQUAL_DURATION GREATER_EQUAL_DEC GREATER_EQUAL_DATE GREATER_EQUAL GREATER_DURATION GREATER_DEC GREATER_DATE GREATER FOR EXCEPTION EQUAL END_CODE ELSE DIVMONEY DIVDURATION DIVDEC DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] +## struct_inject_content -> LBRACKET ALT . separated_nonempty_list(ALT,struct_content_field) RBRACKET [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RSQUARE RPAREN RBRACKET PLUSPLUS PLUSMONEY PLUSDURATION PLUSDEC PLUSDATE PLUS OR OF NOT_EQUAL MULTMONEY MULTDEC MULT MULDURATION MINUSMONEY MINUSDURATION MINUSDEC MINUSDATE MINUS LESSER_MONEY LESSER_EQUAL_MONEY LESSER_EQUAL_DURATION LESSER_EQUAL_DEC LESSER_EQUAL_DATE LESSER_EQUAL LESSER_DURATION LESSER_DEC LESSER_DATE LESSER LABEL INCREASING GREATER_MONEY GREATER_EQUAL_MONEY GREATER_EQUAL_DURATION GREATER_EQUAL_DEC GREATER_EQUAL_DATE GREATER_EQUAL GREATER_DURATION GREATER_DEC GREATER_DATE GREATER FOR EXCEPTION EQUAL END_CODE ELSE DIVMONEY DIVDURATION DIVDEC DIV DEFINITION DECREASING DECLARATION CONTAINS CONSEQUENCE COLON ASSERTION AND ALT ] ## ## The known suffix of the stack is as follows: ## LBRACKET ALT @@ -800,9 +800,9 @@ expected the name of the structure field source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION CONSTRUCTOR LBRACKET YEAR ## -## Ends in an error in state: 79. +## Ends in an error in state: 74. ## -## struct_inject_content -> LBRACKET . ALT separated_nonempty_list(ALT,struct_content_field) RBRACKET [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RSQUARE RPAREN RBRACKET PLUSPLUS PLUSMONEY PLUSDURATION PLUSDEC PLUSDATE PLUS OR OF NOT_EQUAL MULTMONEY MULTDEC MULT MULDURATION MINUSMONEY MINUSDURATION MINUSDEC MINUSDATE MINUS LESSER_MONEY LESSER_EQUAL_MONEY LESSER_EQUAL_DURATION LESSER_EQUAL_DEC LESSER_EQUAL_DATE LESSER_EQUAL LESSER_DURATION LESSER_DEC LESSER_DATE LESSER LABEL INCREASING IN GREATER_MONEY GREATER_EQUAL_MONEY GREATER_EQUAL_DURATION GREATER_EQUAL_DEC GREATER_EQUAL_DATE GREATER_EQUAL GREATER_DURATION GREATER_DEC GREATER_DATE GREATER FOR EXCEPTION EQUAL END_CODE ELSE DIVMONEY DIVDURATION DIVDEC DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] +## struct_inject_content -> LBRACKET . ALT separated_nonempty_list(ALT,struct_content_field) RBRACKET [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RSQUARE RPAREN RBRACKET PLUSPLUS PLUSMONEY PLUSDURATION PLUSDEC PLUSDATE PLUS OR OF NOT_EQUAL MULTMONEY MULTDEC MULT MULDURATION MINUSMONEY MINUSDURATION MINUSDEC MINUSDATE MINUS LESSER_MONEY LESSER_EQUAL_MONEY LESSER_EQUAL_DURATION LESSER_EQUAL_DEC LESSER_EQUAL_DATE LESSER_EQUAL LESSER_DURATION LESSER_DEC LESSER_DATE LESSER LABEL INCREASING GREATER_MONEY GREATER_EQUAL_MONEY GREATER_EQUAL_DURATION GREATER_EQUAL_DEC GREATER_EQUAL_DATE GREATER_EQUAL GREATER_DURATION GREATER_DEC GREATER_DATE GREATER FOR EXCEPTION EQUAL END_CODE ELSE DIVMONEY DIVDURATION DIVDEC DIV DEFINITION DECREASING DECLARATION CONTAINS CONSEQUENCE COLON ASSERTION AND ALT ] ## ## The known suffix of the stack is as follows: ## LBRACKET @@ -812,10 +812,10 @@ expected structure fields introduced by -- source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION CONSTRUCTOR YEAR ## -## Ends in an error in state: 78. +## Ends in an error in state: 73. ## -## struct_or_enum_inject -> constructor . option(preceded(DOT,constructor)) option(enum_inject_content) [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RSQUARE RPAREN RBRACKET PLUSPLUS PLUSMONEY PLUSDURATION PLUSDEC PLUSDATE PLUS OR OF NOT_EQUAL MULTMONEY MULTDEC MULT MULDURATION MINUSMONEY MINUSDURATION MINUSDEC MINUSDATE MINUS LESSER_MONEY LESSER_EQUAL_MONEY LESSER_EQUAL_DURATION LESSER_EQUAL_DEC LESSER_EQUAL_DATE LESSER_EQUAL LESSER_DURATION LESSER_DEC LESSER_DATE LESSER LABEL INCREASING IN GREATER_MONEY GREATER_EQUAL_MONEY GREATER_EQUAL_DURATION GREATER_EQUAL_DEC GREATER_EQUAL_DATE GREATER_EQUAL GREATER_DURATION GREATER_DEC GREATER_DATE GREATER FOR EXCEPTION EQUAL END_CODE ELSE DIVMONEY DIVDURATION DIVDEC DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] -## struct_or_enum_inject -> constructor . struct_inject_content [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RSQUARE RPAREN RBRACKET PLUSPLUS PLUSMONEY PLUSDURATION PLUSDEC PLUSDATE PLUS OR OF NOT_EQUAL MULTMONEY MULTDEC MULT MULDURATION MINUSMONEY MINUSDURATION MINUSDEC MINUSDATE MINUS LESSER_MONEY LESSER_EQUAL_MONEY LESSER_EQUAL_DURATION LESSER_EQUAL_DEC LESSER_EQUAL_DATE LESSER_EQUAL LESSER_DURATION LESSER_DEC LESSER_DATE LESSER LABEL INCREASING IN GREATER_MONEY GREATER_EQUAL_MONEY GREATER_EQUAL_DURATION GREATER_EQUAL_DEC GREATER_EQUAL_DATE GREATER_EQUAL GREATER_DURATION GREATER_DEC GREATER_DATE GREATER FOR EXCEPTION EQUAL END_CODE ELSE DIVMONEY DIVDURATION DIVDEC DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] +## struct_or_enum_inject -> constructor . option(preceded(DOT,constructor)) option(enum_inject_content) [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RSQUARE RPAREN RBRACKET PLUSPLUS PLUSMONEY PLUSDURATION PLUSDEC PLUSDATE PLUS OR OF NOT_EQUAL MULTMONEY MULTDEC MULT MULDURATION MINUSMONEY MINUSDURATION MINUSDEC MINUSDATE MINUS LESSER_MONEY LESSER_EQUAL_MONEY LESSER_EQUAL_DURATION LESSER_EQUAL_DEC LESSER_EQUAL_DATE LESSER_EQUAL LESSER_DURATION LESSER_DEC LESSER_DATE LESSER LABEL INCREASING GREATER_MONEY GREATER_EQUAL_MONEY GREATER_EQUAL_DURATION GREATER_EQUAL_DEC GREATER_EQUAL_DATE GREATER_EQUAL GREATER_DURATION GREATER_DEC GREATER_DATE GREATER FOR EXCEPTION EQUAL END_CODE ELSE DIVMONEY DIVDURATION DIVDEC DIV DEFINITION DECREASING DECLARATION CONTAINS CONSEQUENCE COLON ASSERTION AND ALT ] +## struct_or_enum_inject -> constructor . struct_inject_content [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RSQUARE RPAREN RBRACKET PLUSPLUS PLUSMONEY PLUSDURATION PLUSDEC PLUSDATE PLUS OR OF NOT_EQUAL MULTMONEY MULTDEC MULT MULDURATION MINUSMONEY MINUSDURATION MINUSDEC MINUSDATE MINUS LESSER_MONEY LESSER_EQUAL_MONEY LESSER_EQUAL_DURATION LESSER_EQUAL_DEC LESSER_EQUAL_DATE LESSER_EQUAL LESSER_DURATION LESSER_DEC LESSER_DATE LESSER LABEL INCREASING GREATER_MONEY GREATER_EQUAL_MONEY GREATER_EQUAL_DURATION GREATER_EQUAL_DEC GREATER_EQUAL_DATE GREATER_EQUAL GREATER_DURATION GREATER_DEC GREATER_DATE GREATER FOR EXCEPTION EQUAL END_CODE ELSE DIVMONEY DIVDURATION DIVDEC DIV DEFINITION DECREASING DECLARATION CONTAINS CONSEQUENCE COLON ASSERTION AND ALT ] ## ## The known suffix of the stack is as follows: ## constructor @@ -825,7 +825,7 @@ expected a payload for the enum case constructor, or the rest of the expression source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION CONTENT MAXIMUM TEXT INIT YEAR ## -## Ends in an error in state: 187. +## Ends in an error in state: 182. ## ## aggregate_func -> CONTENT MAXIMUM typ_base INIT . primitive_expression [ FOR ] ## @@ -837,7 +837,7 @@ expected the initial expression for the maximum source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION CONTENT MAXIMUM TEXT YEAR ## -## Ends in an error in state: 186. +## Ends in an error in state: 181. ## ## aggregate_func -> CONTENT MAXIMUM typ_base . INIT primitive_expression [ FOR ] ## @@ -849,7 +849,7 @@ expected the "initial" keyword introducing the initial expression for the maximu source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION CONTENT MAXIMUM YEAR ## -## Ends in an error in state: 185. +## Ends in an error in state: 180. ## ## aggregate_func -> CONTENT MAXIMUM . typ_base INIT primitive_expression [ FOR ] ## @@ -861,7 +861,7 @@ expected the type of the elements compared to get the maximum source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION CONTENT MINIMUM TEXT INIT YEAR ## -## Ends in an error in state: 68. +## Ends in an error in state: 63. ## ## aggregate_func -> CONTENT MINIMUM typ_base INIT . primitive_expression [ FOR ] ## @@ -873,7 +873,7 @@ expected the initial expression for the minimum source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION CONTENT MINIMUM TEXT YEAR ## -## Ends in an error in state: 67. +## Ends in an error in state: 62. ## ## aggregate_func -> CONTENT MINIMUM typ_base . INIT primitive_expression [ FOR ] ## @@ -885,7 +885,7 @@ expected the "initial" keyword introducing the initial expression for the minimu source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION CONTENT MINIMUM YEAR ## -## Ends in an error in state: 66. +## Ends in an error in state: 61. ## ## aggregate_func -> CONTENT MINIMUM . typ_base INIT primitive_expression [ FOR ] ## @@ -897,7 +897,7 @@ expected the type of the elements compared to get the minimum source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION CONTENT YEAR ## -## Ends in an error in state: 65. +## Ends in an error in state: 60. ## ## aggregate_func -> CONTENT . MAXIMUM typ_base INIT primitive_expression [ FOR ] ## aggregate_func -> CONTENT . MINIMUM typ_base INIT primitive_expression [ FOR ] @@ -910,7 +910,7 @@ this is the start of an arg-maximum or arg-minimum expression source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION EXISTS IDENT IN CARDINAL SUCH THAT YEAR ## -## Ends in an error in state: 208. +## Ends in an error in state: 203. ## ## expression -> exists_prefix . expression [ THEN SEMICOLON SCOPE RULE RSQUARE RPAREN LABEL EXCEPTION END_CODE ELSE DEFINITION DECLARATION CONSEQUENCE COLON ASSERTION ] ## @@ -922,7 +922,7 @@ expected an expression for the existential test source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION EXISTS IDENT IN TRUE SUCH YEAR ## -## Ends in an error in state: 214. +## Ends in an error in state: 209. ## ## exists_prefix -> exists_marked ident IN primitive_expression SUCH . THAT [ VERTICAL TRUE SUM NOT MONEY_AMOUNT MINUSMONEY MINUSDURATION MINUSDEC MINUS MINIMUM MAXIMUM MATCH MAP LSQUARE LPAREN INT_LITERAL IF IDENT FOR FILTER FALSE EXISTS DECIMAL_LITERAL CONTENT CONSTRUCTOR CARDINAL ] ## @@ -934,7 +934,7 @@ expected a keyword to complete the "such that" construction source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION EXISTS IDENT IN TRUE XOR ## -## Ends in an error in state: 213. +## Ends in an error in state: 208. ## ## exists_prefix -> exists_marked ident IN primitive_expression . SUCH THAT [ VERTICAL TRUE SUM NOT MONEY_AMOUNT MINUSMONEY MINUSDURATION MINUSDEC MINUS MINIMUM MAXIMUM MATCH MAP LSQUARE LPAREN INT_LITERAL IF IDENT FOR FILTER FALSE EXISTS DECIMAL_LITERAL CONTENT CONSTRUCTOR CARDINAL ] ## @@ -945,14 +945,14 @@ source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION EXISTS IDENT IN TRUE X ## This implies that, although the LR(1) items shown above provide an ## accurate view of the past (what has been recognized so far), they ## may provide an INCOMPLETE view of the future (what was expected next). -## In state 51, spurious reduction of production primitive_expression -> small_expression +## In state 46, spurious reduction of production primitive_expression -> small_expression ## expected a keyword to form the "such that" expression for the existential test source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION EXISTS IDENT IN YEAR ## -## Ends in an error in state: 212. +## Ends in an error in state: 207. ## ## exists_prefix -> exists_marked ident IN . primitive_expression SUCH THAT [ VERTICAL TRUE SUM NOT MONEY_AMOUNT MINUSMONEY MINUSDURATION MINUSDEC MINUS MINIMUM MAXIMUM MATCH MAP LSQUARE LPAREN INT_LITERAL IF IDENT FOR FILTER FALSE EXISTS DECIMAL_LITERAL CONTENT CONSTRUCTOR CARDINAL ] ## @@ -964,7 +964,7 @@ expected an expression that designates the set subject to the existential test source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION EXISTS IDENT YEAR ## -## Ends in an error in state: 211. +## Ends in an error in state: 206. ## ## exists_prefix -> exists_marked ident . IN primitive_expression SUCH THAT [ VERTICAL TRUE SUM NOT MONEY_AMOUNT MINUSMONEY MINUSDURATION MINUSDEC MINUS MINIMUM MAXIMUM MATCH MAP LSQUARE LPAREN INT_LITERAL IF IDENT FOR FILTER FALSE EXISTS DECIMAL_LITERAL CONTENT CONSTRUCTOR CARDINAL ] ## @@ -976,7 +976,7 @@ expected the "in" keyword to continue this existential test source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION EXISTS YEAR ## -## Ends in an error in state: 210. +## Ends in an error in state: 205. ## ## exists_prefix -> exists_marked . ident IN primitive_expression SUCH THAT [ VERTICAL TRUE SUM NOT MONEY_AMOUNT MINUSMONEY MINUSDURATION MINUSDEC MINUS MINIMUM MAXIMUM MATCH MAP LSQUARE LPAREN INT_LITERAL IF IDENT FOR FILTER FALSE EXISTS DECIMAL_LITERAL CONTENT CONSTRUCTOR CARDINAL ] ## @@ -988,7 +988,7 @@ expected an identifier that will designate the existential witness for the test source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION FOR ALL IDENT IN CARDINAL WE_HAVE YEAR ## -## Ends in an error in state: 201. +## Ends in an error in state: 196. ## ## expression -> forall_prefix . expression [ THEN SEMICOLON SCOPE RULE RSQUARE RPAREN LABEL EXCEPTION END_CODE ELSE DEFINITION DECLARATION CONSEQUENCE COLON ASSERTION ] ## @@ -1000,7 +1000,7 @@ expected an expression for the universal test source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION FOR ALL IDENT IN TRUE XOR ## -## Ends in an error in state: 205. +## Ends in an error in state: 200. ## ## forall_prefix -> for_all_marked ident IN primitive_expression . WE_HAVE [ VERTICAL TRUE SUM NOT MONEY_AMOUNT MINUSMONEY MINUSDURATION MINUSDEC MINUS MINIMUM MAXIMUM MATCH MAP LSQUARE LPAREN INT_LITERAL IF IDENT FOR FILTER FALSE EXISTS DECIMAL_LITERAL CONTENT CONSTRUCTOR CARDINAL ] ## @@ -1011,14 +1011,14 @@ source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION FOR ALL IDENT IN TRUE ## This implies that, although the LR(1) items shown above provide an ## accurate view of the past (what has been recognized so far), they ## may provide an INCOMPLETE view of the future (what was expected next). -## In state 51, spurious reduction of production primitive_expression -> small_expression +## In state 46, spurious reduction of production primitive_expression -> small_expression ## expected the "we have" keyword for this universal test source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION FOR ALL IDENT IN YEAR ## -## Ends in an error in state: 204. +## Ends in an error in state: 199. ## ## forall_prefix -> for_all_marked ident IN . primitive_expression WE_HAVE [ VERTICAL TRUE SUM NOT MONEY_AMOUNT MINUSMONEY MINUSDURATION MINUSDEC MINUS MINIMUM MAXIMUM MATCH MAP LSQUARE LPAREN INT_LITERAL IF IDENT FOR FILTER FALSE EXISTS DECIMAL_LITERAL CONTENT CONSTRUCTOR CARDINAL ] ## @@ -1030,7 +1030,7 @@ expected the expression designating the set on which to perform the universal te source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION FOR ALL IDENT YEAR ## -## Ends in an error in state: 203. +## Ends in an error in state: 198. ## ## forall_prefix -> for_all_marked ident . IN primitive_expression WE_HAVE [ VERTICAL TRUE SUM NOT MONEY_AMOUNT MINUSMONEY MINUSDURATION MINUSDEC MINUS MINIMUM MAXIMUM MATCH MAP LSQUARE LPAREN INT_LITERAL IF IDENT FOR FILTER FALSE EXISTS DECIMAL_LITERAL CONTENT CONSTRUCTOR CARDINAL ] ## @@ -1042,7 +1042,7 @@ expected the "in" keyword for the rest of the universal test source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION FOR ALL YEAR ## -## Ends in an error in state: 202. +## Ends in an error in state: 197. ## ## forall_prefix -> for_all_marked . ident IN primitive_expression WE_HAVE [ VERTICAL TRUE SUM NOT MONEY_AMOUNT MINUSMONEY MINUSDURATION MINUSDEC MINUS MINIMUM MAXIMUM MATCH MAP LSQUARE LPAREN INT_LITERAL IF IDENT FOR FILTER FALSE EXISTS DECIMAL_LITERAL CONTENT CONSTRUCTOR CARDINAL ] ## @@ -1054,7 +1054,7 @@ expected an identifier for the bound variable of the universal test source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION FOR YEAR ## -## Ends in an error in state: 197. +## Ends in an error in state: 192. ## ## for_all_marked -> FOR . ALL [ IDENT ] ## @@ -1066,7 +1066,7 @@ expected the "all" keyword to mean the "for all" construction of the universal t source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION IF TRUE SEMICOLON ## -## Ends in an error in state: 216. +## Ends in an error in state: 211. ## ## expression -> IF expression . THEN expression ELSE expression [ THEN SEMICOLON SCOPE RULE RSQUARE RPAREN LABEL EXCEPTION END_CODE ELSE DEFINITION DECLARATION CONSEQUENCE COLON ASSERTION ] ## @@ -1077,16 +1077,16 @@ source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION IF TRUE SEMICOLON ## This implies that, although the LR(1) items shown above provide an ## accurate view of the past (what has been recognized so far), they ## may provide an INCOMPLETE view of the future (what was expected next). -## In state 51, spurious reduction of production primitive_expression -> small_expression -## In state 90, spurious reduction of production base_expression -> primitive_expression -## In state 116, spurious reduction of production unop_expression -> base_expression -## In state 87, spurious reduction of production mult_expression -> unop_expression -## In state 164, spurious reduction of production sum_expression -> mult_expression -## In state 117, spurious reduction of production compare_expression -> sum_expression -## In state 175, spurious reduction of production logical_atom -> compare_expression -## In state 170, spurious reduction of production logical_or_expression -> logical_atom -## In state 166, spurious reduction of production logical_expression -> logical_or_expression -## In state 200, spurious reduction of production expression -> logical_expression +## In state 46, spurious reduction of production primitive_expression -> small_expression +## In state 85, spurious reduction of production base_expression -> primitive_expression +## In state 111, spurious reduction of production unop_expression -> base_expression +## In state 82, spurious reduction of production mult_expression -> unop_expression +## In state 159, spurious reduction of production sum_expression -> mult_expression +## In state 112, spurious reduction of production compare_expression -> sum_expression +## In state 170, spurious reduction of production logical_atom -> compare_expression +## In state 165, spurious reduction of production logical_or_expression -> logical_atom +## In state 161, spurious reduction of production logical_expression -> logical_or_expression +## In state 195, spurious reduction of production expression -> logical_expression ## expected the "then" keyword as the conditional expression is complete @@ -1096,7 +1096,7 @@ expected the "then" keyword as the conditional expression is complete source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION IF YEAR ## -## Ends in an error in state: 196. +## Ends in an error in state: 191. ## ## expression -> IF . expression THEN expression ELSE expression [ THEN SEMICOLON SCOPE RULE RSQUARE RPAREN LABEL EXCEPTION END_CODE ELSE DEFINITION DECLARATION CONSEQUENCE COLON ASSERTION ] ## @@ -1108,9 +1108,9 @@ expected an expression for the test of the conditional source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION INT_LITERAL WITH_V ## -## Ends in an error in state: 70. +## Ends in an error in state: 65. ## -## literal -> num_literal . option(unit_literal) [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RSQUARE RPAREN RBRACKET PLUSPLUS PLUSMONEY PLUSDURATION PLUSDEC PLUSDATE PLUS OR OF NOT_EQUAL MULTMONEY MULTDEC MULT MULDURATION MINUSMONEY MINUSDURATION MINUSDEC MINUSDATE MINUS LESSER_MONEY LESSER_EQUAL_MONEY LESSER_EQUAL_DURATION LESSER_EQUAL_DEC LESSER_EQUAL_DATE LESSER_EQUAL LESSER_DURATION LESSER_DEC LESSER_DATE LESSER LABEL INCREASING IN GREATER_MONEY GREATER_EQUAL_MONEY GREATER_EQUAL_DURATION GREATER_EQUAL_DEC GREATER_EQUAL_DATE GREATER_EQUAL GREATER_DURATION GREATER_DEC GREATER_DATE GREATER FOR EXCEPTION EQUAL END_CODE ELSE DOT DIVMONEY DIVDURATION DIVDEC DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] +## literal -> num_literal . option(unit_literal) [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RSQUARE RPAREN RBRACKET PLUSPLUS PLUSMONEY PLUSDURATION PLUSDEC PLUSDATE PLUS OR OF NOT_EQUAL MULTMONEY MULTDEC MULT MULDURATION MINUSMONEY MINUSDURATION MINUSDEC MINUSDATE MINUS LESSER_MONEY LESSER_EQUAL_MONEY LESSER_EQUAL_DURATION LESSER_EQUAL_DEC LESSER_EQUAL_DATE LESSER_EQUAL LESSER_DURATION LESSER_DEC LESSER_DATE LESSER LABEL INCREASING GREATER_MONEY GREATER_EQUAL_MONEY GREATER_EQUAL_DURATION GREATER_EQUAL_DEC GREATER_EQUAL_DATE GREATER_EQUAL GREATER_DURATION GREATER_DEC GREATER_DATE GREATER FOR EXCEPTION EQUAL END_CODE ELSE DOT DIVMONEY DIVDURATION DIVDEC DIV DEFINITION DECREASING DECLARATION CONTAINS CONSEQUENCE COLON ASSERTION AND ALT ] ## ## The known suffix of the stack is as follows: ## num_literal @@ -1120,9 +1120,9 @@ expected a unit for this literal, or a valid operator to complete the expression source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION LPAREN TRUE THEN ## -## Ends in an error in state: 221. +## Ends in an error in state: 216. ## -## atomic_expression -> LPAREN expression . RPAREN [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RSQUARE RPAREN RBRACKET PLUSPLUS PLUSMONEY PLUSDURATION PLUSDEC PLUSDATE PLUS OR OF NOT_EQUAL MULTMONEY MULTDEC MULT MULDURATION MINUSMONEY MINUSDURATION MINUSDEC MINUSDATE MINUS LESSER_MONEY LESSER_EQUAL_MONEY LESSER_EQUAL_DURATION LESSER_EQUAL_DEC LESSER_EQUAL_DATE LESSER_EQUAL LESSER_DURATION LESSER_DEC LESSER_DATE LESSER LABEL INCREASING IN GREATER_MONEY GREATER_EQUAL_MONEY GREATER_EQUAL_DURATION GREATER_EQUAL_DEC GREATER_EQUAL_DATE GREATER_EQUAL GREATER_DURATION GREATER_DEC GREATER_DATE GREATER FOR EXCEPTION EQUAL END_CODE ELSE DOT DIVMONEY DIVDURATION DIVDEC DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] +## atomic_expression -> LPAREN expression . RPAREN [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RSQUARE RPAREN RBRACKET PLUSPLUS PLUSMONEY PLUSDURATION PLUSDEC PLUSDATE PLUS OR OF NOT_EQUAL MULTMONEY MULTDEC MULT MULDURATION MINUSMONEY MINUSDURATION MINUSDEC MINUSDATE MINUS LESSER_MONEY LESSER_EQUAL_MONEY LESSER_EQUAL_DURATION LESSER_EQUAL_DEC LESSER_EQUAL_DATE LESSER_EQUAL LESSER_DURATION LESSER_DEC LESSER_DATE LESSER LABEL INCREASING GREATER_MONEY GREATER_EQUAL_MONEY GREATER_EQUAL_DURATION GREATER_EQUAL_DEC GREATER_EQUAL_DATE GREATER_EQUAL GREATER_DURATION GREATER_DEC GREATER_DATE GREATER FOR EXCEPTION EQUAL END_CODE ELSE DOT DIVMONEY DIVDURATION DIVDEC DIV DEFINITION DECREASING DECLARATION CONTAINS CONSEQUENCE COLON ASSERTION AND ALT ] ## ## The known suffix of the stack is as follows: ## LPAREN expression @@ -1131,25 +1131,25 @@ source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION LPAREN TRUE THEN ## This implies that, although the LR(1) items shown above provide an ## accurate view of the past (what has been recognized so far), they ## may provide an INCOMPLETE view of the future (what was expected next). -## In state 51, spurious reduction of production primitive_expression -> small_expression -## In state 90, spurious reduction of production base_expression -> primitive_expression -## In state 116, spurious reduction of production unop_expression -> base_expression -## In state 87, spurious reduction of production mult_expression -> unop_expression -## In state 164, spurious reduction of production sum_expression -> mult_expression -## In state 117, spurious reduction of production compare_expression -> sum_expression -## In state 175, spurious reduction of production logical_atom -> compare_expression -## In state 170, spurious reduction of production logical_or_expression -> logical_atom -## In state 166, spurious reduction of production logical_expression -> logical_or_expression -## In state 200, spurious reduction of production expression -> logical_expression +## In state 46, spurious reduction of production primitive_expression -> small_expression +## In state 85, spurious reduction of production base_expression -> primitive_expression +## In state 111, spurious reduction of production unop_expression -> base_expression +## In state 82, spurious reduction of production mult_expression -> unop_expression +## In state 159, spurious reduction of production sum_expression -> mult_expression +## In state 112, spurious reduction of production compare_expression -> sum_expression +## In state 170, spurious reduction of production logical_atom -> compare_expression +## In state 165, spurious reduction of production logical_or_expression -> logical_atom +## In state 161, spurious reduction of production logical_expression -> logical_or_expression +## In state 195, spurious reduction of production expression -> logical_expression ## unmatched parenthesis that should have been closed by here source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION LPAREN YEAR ## -## Ends in an error in state: 43. +## Ends in an error in state: 38. ## -## atomic_expression -> LPAREN . expression RPAREN [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RSQUARE RPAREN RBRACKET PLUSPLUS PLUSMONEY PLUSDURATION PLUSDEC PLUSDATE PLUS OR OF NOT_EQUAL MULTMONEY MULTDEC MULT MULDURATION MINUSMONEY MINUSDURATION MINUSDEC MINUSDATE MINUS LESSER_MONEY LESSER_EQUAL_MONEY LESSER_EQUAL_DURATION LESSER_EQUAL_DEC LESSER_EQUAL_DATE LESSER_EQUAL LESSER_DURATION LESSER_DEC LESSER_DATE LESSER LABEL INCREASING IN GREATER_MONEY GREATER_EQUAL_MONEY GREATER_EQUAL_DURATION GREATER_EQUAL_DEC GREATER_EQUAL_DATE GREATER_EQUAL GREATER_DURATION GREATER_DEC GREATER_DATE GREATER FOR EXCEPTION EQUAL END_CODE ELSE DOT DIVMONEY DIVDURATION DIVDEC DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] +## atomic_expression -> LPAREN . expression RPAREN [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RSQUARE RPAREN RBRACKET PLUSPLUS PLUSMONEY PLUSDURATION PLUSDEC PLUSDATE PLUS OR OF NOT_EQUAL MULTMONEY MULTDEC MULT MULDURATION MINUSMONEY MINUSDURATION MINUSDEC MINUSDATE MINUS LESSER_MONEY LESSER_EQUAL_MONEY LESSER_EQUAL_DURATION LESSER_EQUAL_DEC LESSER_EQUAL_DATE LESSER_EQUAL LESSER_DURATION LESSER_DEC LESSER_DATE LESSER LABEL INCREASING GREATER_MONEY GREATER_EQUAL_MONEY GREATER_EQUAL_DURATION GREATER_EQUAL_DEC GREATER_EQUAL_DATE GREATER_EQUAL GREATER_DURATION GREATER_DEC GREATER_DATE GREATER FOR EXCEPTION EQUAL END_CODE ELSE DOT DIVMONEY DIVDURATION DIVDEC DIV DEFINITION DECREASING DECLARATION CONTAINS CONSEQUENCE COLON ASSERTION AND ALT ] ## ## The known suffix of the stack is as follows: ## LPAREN @@ -1160,7 +1160,7 @@ expected an expression inside the parenthesis source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION LSQUARE TRUE THEN ## -## Ends in an error in state: 227. +## Ends in an error in state: 222. ## ## separated_nonempty_list(SEMICOLON,expression) -> expression . [ RSQUARE ] ## separated_nonempty_list(SEMICOLON,expression) -> expression . SEMICOLON separated_nonempty_list(SEMICOLON,expression) [ RSQUARE ] @@ -1172,25 +1172,25 @@ source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION LSQUARE TRUE THEN ## This implies that, although the LR(1) items shown above provide an ## accurate view of the past (what has been recognized so far), they ## may provide an INCOMPLETE view of the future (what was expected next). -## In state 51, spurious reduction of production primitive_expression -> small_expression -## In state 90, spurious reduction of production base_expression -> primitive_expression -## In state 116, spurious reduction of production unop_expression -> base_expression -## In state 87, spurious reduction of production mult_expression -> unop_expression -## In state 164, spurious reduction of production sum_expression -> mult_expression -## In state 117, spurious reduction of production compare_expression -> sum_expression -## In state 175, spurious reduction of production logical_atom -> compare_expression -## In state 170, spurious reduction of production logical_or_expression -> logical_atom -## In state 166, spurious reduction of production logical_expression -> logical_or_expression -## In state 200, spurious reduction of production expression -> logical_expression +## In state 46, spurious reduction of production primitive_expression -> small_expression +## In state 85, spurious reduction of production base_expression -> primitive_expression +## In state 111, spurious reduction of production unop_expression -> base_expression +## In state 82, spurious reduction of production mult_expression -> unop_expression +## In state 159, spurious reduction of production sum_expression -> mult_expression +## In state 112, spurious reduction of production compare_expression -> sum_expression +## In state 170, spurious reduction of production logical_atom -> compare_expression +## In state 165, spurious reduction of production logical_or_expression -> logical_atom +## In state 161, spurious reduction of production logical_expression -> logical_or_expression +## In state 195, spurious reduction of production expression -> logical_expression ## expected a semicolon or a right square bracket after the collection element source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION LSQUARE YEAR ## -## Ends in an error in state: 39. +## Ends in an error in state: 34. ## -## primitive_expression -> LSQUARE . loption(separated_nonempty_list(SEMICOLON,expression)) RSQUARE [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RSQUARE RPAREN RBRACKET PLUSPLUS PLUSMONEY PLUSDURATION PLUSDEC PLUSDATE PLUS OR OF NOT_EQUAL MULTMONEY MULTDEC MULT MULDURATION MINUSMONEY MINUSDURATION MINUSDEC MINUSDATE MINUS LESSER_MONEY LESSER_EQUAL_MONEY LESSER_EQUAL_DURATION LESSER_EQUAL_DEC LESSER_EQUAL_DATE LESSER_EQUAL LESSER_DURATION LESSER_DEC LESSER_DATE LESSER LABEL INCREASING IN GREATER_MONEY GREATER_EQUAL_MONEY GREATER_EQUAL_DURATION GREATER_EQUAL_DEC GREATER_EQUAL_DATE GREATER_EQUAL GREATER_DURATION GREATER_DEC GREATER_DATE GREATER FOR EXCEPTION EQUAL END_CODE ELSE DIVMONEY DIVDURATION DIVDEC DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] +## primitive_expression -> LSQUARE . loption(separated_nonempty_list(SEMICOLON,expression)) RSQUARE [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RSQUARE RPAREN RBRACKET PLUSPLUS PLUSMONEY PLUSDURATION PLUSDEC PLUSDATE PLUS OR OF NOT_EQUAL MULTMONEY MULTDEC MULT MULDURATION MINUSMONEY MINUSDURATION MINUSDEC MINUSDATE MINUS LESSER_MONEY LESSER_EQUAL_MONEY LESSER_EQUAL_DURATION LESSER_EQUAL_DEC LESSER_EQUAL_DATE LESSER_EQUAL LESSER_DURATION LESSER_DEC LESSER_DATE LESSER LABEL INCREASING GREATER_MONEY GREATER_EQUAL_MONEY GREATER_EQUAL_DURATION GREATER_EQUAL_DEC GREATER_EQUAL_DATE GREATER_EQUAL GREATER_DURATION GREATER_DEC GREATER_DATE GREATER FOR EXCEPTION EQUAL END_CODE ELSE DIVMONEY DIVDURATION DIVDEC DIV DEFINITION DECREASING DECLARATION CONTAINS CONSEQUENCE COLON ASSERTION AND ALT ] ## ## The known suffix of the stack is as follows: ## LSQUARE @@ -1200,7 +1200,7 @@ expected a collection element source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION MAP FOR IDENT IN TRUE OF YEAR ## -## Ends in an error in state: 111. +## Ends in an error in state: 106. ## ## aggregate -> aggregate_func FOR ident IN primitive_expression OF . base_expression [ XOR THEN SEMICOLON SCOPE RULE RSQUARE RPAREN RBRACKET PLUSPLUS PLUSMONEY PLUSDURATION PLUSDEC PLUSDATE PLUS OR NOT_EQUAL MULTMONEY MULTDEC MULT MULDURATION MINUSMONEY MINUSDURATION MINUSDEC MINUSDATE MINUS LESSER_MONEY LESSER_EQUAL_MONEY LESSER_EQUAL_DURATION LESSER_EQUAL_DEC LESSER_EQUAL_DATE LESSER_EQUAL LESSER_DURATION LESSER_DEC LESSER_DATE LESSER LABEL INCREASING GREATER_MONEY GREATER_EQUAL_MONEY GREATER_EQUAL_DURATION GREATER_EQUAL_DEC GREATER_EQUAL_DATE GREATER_EQUAL GREATER_DURATION GREATER_DEC GREATER_DATE GREATER EXCEPTION EQUAL END_CODE ELSE DIVMONEY DIVDURATION DIVDEC DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] ## @@ -1212,7 +1212,7 @@ expected an expression for the map predicate source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION MAP FOR IDENT IN TRUE XOR ## -## Ends in an error in state: 110. +## Ends in an error in state: 105. ## ## aggregate -> aggregate_func FOR ident IN primitive_expression . OF base_expression [ XOR THEN SEMICOLON SCOPE RULE RSQUARE RPAREN RBRACKET PLUSPLUS PLUSMONEY PLUSDURATION PLUSDEC PLUSDATE PLUS OR NOT_EQUAL MULTMONEY MULTDEC MULT MULDURATION MINUSMONEY MINUSDURATION MINUSDEC MINUSDATE MINUS LESSER_MONEY LESSER_EQUAL_MONEY LESSER_EQUAL_DURATION LESSER_EQUAL_DEC LESSER_EQUAL_DATE LESSER_EQUAL LESSER_DURATION LESSER_DEC LESSER_DATE LESSER LABEL INCREASING GREATER_MONEY GREATER_EQUAL_MONEY GREATER_EQUAL_DURATION GREATER_EQUAL_DEC GREATER_EQUAL_DATE GREATER_EQUAL GREATER_DURATION GREATER_DEC GREATER_DATE GREATER EXCEPTION EQUAL END_CODE ELSE DIVMONEY DIVDURATION DIVDEC DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] ## @@ -1223,14 +1223,14 @@ source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION MAP FOR IDENT IN TRUE ## This implies that, although the LR(1) items shown above provide an ## accurate view of the past (what has been recognized so far), they ## may provide an INCOMPLETE view of the future (what was expected next). -## In state 51, spurious reduction of production primitive_expression -> small_expression +## In state 46, spurious reduction of production primitive_expression -> small_expression ## expected the "of" keyword to introduce the map predicate source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION MAP FOR IDENT IN YEAR ## -## Ends in an error in state: 109. +## Ends in an error in state: 104. ## ## aggregate -> aggregate_func FOR ident IN . primitive_expression OF base_expression [ XOR THEN SEMICOLON SCOPE RULE RSQUARE RPAREN RBRACKET PLUSPLUS PLUSMONEY PLUSDURATION PLUSDEC PLUSDATE PLUS OR NOT_EQUAL MULTMONEY MULTDEC MULT MULDURATION MINUSMONEY MINUSDURATION MINUSDEC MINUSDATE MINUS LESSER_MONEY LESSER_EQUAL_MONEY LESSER_EQUAL_DURATION LESSER_EQUAL_DEC LESSER_EQUAL_DATE LESSER_EQUAL LESSER_DURATION LESSER_DEC LESSER_DATE LESSER LABEL INCREASING GREATER_MONEY GREATER_EQUAL_MONEY GREATER_EQUAL_DURATION GREATER_EQUAL_DEC GREATER_EQUAL_DATE GREATER_EQUAL GREATER_DURATION GREATER_DEC GREATER_DATE GREATER EXCEPTION EQUAL END_CODE ELSE DIVMONEY DIVDURATION DIVDEC DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] ## @@ -1242,7 +1242,7 @@ expected the collection argument to map source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION MAP FOR IDENT YEAR ## -## Ends in an error in state: 108. +## Ends in an error in state: 103. ## ## aggregate -> aggregate_func FOR ident . IN primitive_expression OF base_expression [ XOR THEN SEMICOLON SCOPE RULE RSQUARE RPAREN RBRACKET PLUSPLUS PLUSMONEY PLUSDURATION PLUSDEC PLUSDATE PLUS OR NOT_EQUAL MULTMONEY MULTDEC MULT MULDURATION MINUSMONEY MINUSDURATION MINUSDEC MINUSDATE MINUS LESSER_MONEY LESSER_EQUAL_MONEY LESSER_EQUAL_DURATION LESSER_EQUAL_DEC LESSER_EQUAL_DATE LESSER_EQUAL LESSER_DURATION LESSER_DEC LESSER_DATE LESSER LABEL INCREASING GREATER_MONEY GREATER_EQUAL_MONEY GREATER_EQUAL_DURATION GREATER_EQUAL_DEC GREATER_EQUAL_DATE GREATER_EQUAL GREATER_DURATION GREATER_DEC GREATER_DATE GREATER EXCEPTION EQUAL END_CODE ELSE DIVMONEY DIVDURATION DIVDEC DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] ## @@ -1254,7 +1254,7 @@ expected the "in" keyword to introduce the collection argument to map source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION MAP FOR YEAR ## -## Ends in an error in state: 107. +## Ends in an error in state: 102. ## ## aggregate -> aggregate_func FOR . ident IN primitive_expression OF base_expression [ XOR THEN SEMICOLON SCOPE RULE RSQUARE RPAREN RBRACKET PLUSPLUS PLUSMONEY PLUSDURATION PLUSDEC PLUSDATE PLUS OR NOT_EQUAL MULTMONEY MULTDEC MULT MULDURATION MINUSMONEY MINUSDURATION MINUSDEC MINUSDATE MINUS LESSER_MONEY LESSER_EQUAL_MONEY LESSER_EQUAL_DURATION LESSER_EQUAL_DEC LESSER_EQUAL_DATE LESSER_EQUAL LESSER_DURATION LESSER_DEC LESSER_DATE LESSER LABEL INCREASING GREATER_MONEY GREATER_EQUAL_MONEY GREATER_EQUAL_DURATION GREATER_EQUAL_DEC GREATER_EQUAL_DATE GREATER_EQUAL GREATER_DURATION GREATER_DEC GREATER_DATE GREATER EXCEPTION EQUAL END_CODE ELSE DIVMONEY DIVDURATION DIVDEC DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] ## @@ -1266,7 +1266,7 @@ expected the identifier for the map predicate source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION MAP YEAR ## -## Ends in an error in state: 106. +## Ends in an error in state: 101. ## ## aggregate -> aggregate_func . FOR ident IN primitive_expression OF base_expression [ XOR THEN SEMICOLON SCOPE RULE RSQUARE RPAREN RBRACKET PLUSPLUS PLUSMONEY PLUSDURATION PLUSDEC PLUSDATE PLUS OR NOT_EQUAL MULTMONEY MULTDEC MULT MULDURATION MINUSMONEY MINUSDURATION MINUSDEC MINUSDATE MINUS LESSER_MONEY LESSER_EQUAL_MONEY LESSER_EQUAL_DURATION LESSER_EQUAL_DEC LESSER_EQUAL_DATE LESSER_EQUAL LESSER_DURATION LESSER_DEC LESSER_DATE LESSER LABEL INCREASING GREATER_MONEY GREATER_EQUAL_MONEY GREATER_EQUAL_DURATION GREATER_EQUAL_DEC GREATER_EQUAL_DATE GREATER_EQUAL GREATER_DURATION GREATER_DEC GREATER_DATE GREATER EXCEPTION EQUAL END_CODE ELSE DIVMONEY DIVDURATION DIVDEC DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] ## @@ -1278,7 +1278,7 @@ expected the "for" keyword to introduce the identifier for the map predicate source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION MATCH TRUE WITH ALT CONSTRUCTOR COLON CARDINAL RBRACKET ## -## Ends in an error in state: 190. +## Ends in an error in state: 185. ## ## match_arms -> ALT match_arm . match_arms [ THEN SEMICOLON SCOPE RULE RSQUARE RPAREN LABEL EXCEPTION END_CODE ELSE DEFINITION DECLARATION CONSEQUENCE COLON ASSERTION ] ## @@ -1289,23 +1289,23 @@ source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION MATCH TRUE WITH ALT CO ## This implies that, although the LR(1) items shown above provide an ## accurate view of the past (what has been recognized so far), they ## may provide an INCOMPLETE view of the future (what was expected next). -## In state 86, spurious reduction of production primitive_expression -> CARDINAL -## In state 90, spurious reduction of production base_expression -> primitive_expression -## In state 116, spurious reduction of production unop_expression -> base_expression -## In state 87, spurious reduction of production mult_expression -> unop_expression -## In state 164, spurious reduction of production sum_expression -> mult_expression -## In state 117, spurious reduction of production compare_expression -> sum_expression -## In state 175, spurious reduction of production logical_atom -> compare_expression -## In state 170, spurious reduction of production logical_or_expression -> logical_atom -## In state 166, spurious reduction of production logical_expression -> logical_or_expression -## In state 194, spurious reduction of production match_arm -> constructor_binding COLON logical_expression +## In state 81, spurious reduction of production primitive_expression -> CARDINAL +## In state 85, spurious reduction of production base_expression -> primitive_expression +## In state 111, spurious reduction of production unop_expression -> base_expression +## In state 82, spurious reduction of production mult_expression -> unop_expression +## In state 159, spurious reduction of production sum_expression -> mult_expression +## In state 112, spurious reduction of production compare_expression -> sum_expression +## In state 170, spurious reduction of production logical_atom -> compare_expression +## In state 165, spurious reduction of production logical_or_expression -> logical_atom +## In state 161, spurious reduction of production logical_expression -> logical_or_expression +## In state 189, spurious reduction of production match_arm -> constructor_binding COLON logical_expression ## expected the "with pattern" keyword to complete the pattern matching expression source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION MATCH TRUE WITH ALT CONSTRUCTOR COLON YEAR ## -## Ends in an error in state: 193. +## Ends in an error in state: 188. ## ## match_arm -> constructor_binding COLON . logical_expression [ THEN SEMICOLON SCOPE RULE RSQUARE RPAREN LABEL EXCEPTION END_CODE ELSE DEFINITION DECLARATION CONSEQUENCE COLON ASSERTION ALT ] ## @@ -1317,7 +1317,7 @@ expected a correct expression for this match arm source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION MATCH TRUE WITH ALT CONSTRUCTOR XOR ## -## Ends in an error in state: 192. +## Ends in an error in state: 187. ## ## match_arm -> constructor_binding . COLON logical_expression [ THEN SEMICOLON SCOPE RULE RSQUARE RPAREN LABEL EXCEPTION END_CODE ELSE DEFINITION DECLARATION CONSEQUENCE COLON ASSERTION ALT ] ## @@ -1328,17 +1328,17 @@ source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION MATCH TRUE WITH ALT CO ## This implies that, although the LR(1) items shown above provide an ## accurate view of the past (what has been recognized so far), they ## may provide an INCOMPLETE view of the future (what was expected next). -## In state 96, spurious reduction of production option(preceded(DOT,constructor)) -> -## In state 99, spurious reduction of production maybe_qualified_constructor -> constructor option(preceded(DOT,constructor)) -## In state 92, spurious reduction of production optional_binding -> -## In state 101, spurious reduction of production constructor_binding -> maybe_qualified_constructor optional_binding +## In state 91, spurious reduction of production option(preceded(DOT,constructor)) -> +## In state 94, spurious reduction of production maybe_qualified_constructor -> constructor option(preceded(DOT,constructor)) +## In state 87, spurious reduction of production optional_binding -> +## In state 96, spurious reduction of production constructor_binding -> maybe_qualified_constructor optional_binding ## expected a constructor payload binding or a colon source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION MATCH TRUE WITH ALT YEAR ## -## Ends in an error in state: 60. +## Ends in an error in state: 55. ## ## match_arms -> ALT . match_arm match_arms [ THEN SEMICOLON SCOPE RULE RSQUARE RPAREN LABEL EXCEPTION END_CODE ELSE DEFINITION DECLARATION CONSEQUENCE COLON ASSERTION ] ## @@ -1350,7 +1350,7 @@ expected the name of the constructor for the enum case in the pattern matching source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION MATCH TRUE WITH YEAR ## -## Ends in an error in state: 59. +## Ends in an error in state: 54. ## ## expression -> MATCH primitive_expression WITH . match_arms [ THEN SEMICOLON SCOPE RULE RSQUARE RPAREN LABEL EXCEPTION END_CODE ELSE DEFINITION DECLARATION CONSEQUENCE COLON ASSERTION ] ## @@ -1362,7 +1362,7 @@ expected a pattern matching case source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION MATCH TRUE XOR ## -## Ends in an error in state: 58. +## Ends in an error in state: 53. ## ## expression -> MATCH primitive_expression . WITH match_arms [ THEN SEMICOLON SCOPE RULE RSQUARE RPAREN LABEL EXCEPTION END_CODE ELSE DEFINITION DECLARATION CONSEQUENCE COLON ASSERTION ] ## @@ -1373,14 +1373,14 @@ source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION MATCH TRUE XOR ## This implies that, although the LR(1) items shown above provide an ## accurate view of the past (what has been recognized so far), they ## may provide an INCOMPLETE view of the future (what was expected next). -## In state 51, spurious reduction of production primitive_expression -> small_expression +## In state 46, spurious reduction of production primitive_expression -> small_expression ## expected the "with pattern" keyword source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION MATCH YEAR ## -## Ends in an error in state: 44. +## Ends in an error in state: 39. ## ## expression -> MATCH . primitive_expression WITH match_arms [ THEN SEMICOLON SCOPE RULE RSQUARE RPAREN LABEL EXCEPTION END_CODE ELSE DEFINITION DECLARATION CONSEQUENCE COLON ASSERTION ] ## @@ -1392,7 +1392,7 @@ expected an expression to match with source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION MAXIMUM TEXT INIT YEAR ## -## Ends in an error in state: 42. +## Ends in an error in state: 37. ## ## aggregate_func -> MAXIMUM typ_base INIT . primitive_expression [ FOR ] ## @@ -1404,7 +1404,7 @@ expected the maximum initial expression source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION MAXIMUM TEXT YEAR ## -## Ends in an error in state: 41. +## Ends in an error in state: 36. ## ## aggregate_func -> MAXIMUM typ_base . INIT primitive_expression [ FOR ] ## @@ -1416,7 +1416,7 @@ expected the "initial" keyword to introduce the maximum initial expression source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION MAXIMUM YEAR ## -## Ends in an error in state: 40. +## Ends in an error in state: 35. ## ## aggregate_func -> MAXIMUM . typ_base INIT primitive_expression [ FOR ] ## @@ -1428,7 +1428,7 @@ expected the type of the elements compared for the maximum source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION MINIMUM TEXT INIT YEAR ## -## Ends in an error in state: 38. +## Ends in an error in state: 33. ## ## aggregate_func -> MINIMUM typ_base INIT . primitive_expression [ FOR ] ## @@ -1440,7 +1440,7 @@ expected the minimum initial expression source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION MINIMUM TEXT YEAR ## -## Ends in an error in state: 37. +## Ends in an error in state: 32. ## ## aggregate_func -> MINIMUM typ_base . INIT primitive_expression [ FOR ] ## @@ -1452,7 +1452,7 @@ expected the "initial" keyword to introduce the minimum initial expression source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION MINIMUM YEAR ## -## Ends in an error in state: 36. +## Ends in an error in state: 31. ## ## aggregate_func -> MINIMUM . typ_base INIT primitive_expression [ FOR ] ## @@ -1464,7 +1464,7 @@ expected the type of the elements compared for the minimum source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION MINUSMONEY YEAR ## -## Ends in an error in state: 88. +## Ends in an error in state: 83. ## ## unop_expression -> unop . unop_expression [ XOR THEN SEMICOLON SCOPE RULE RSQUARE RPAREN RBRACKET PLUSPLUS PLUSMONEY PLUSDURATION PLUSDEC PLUSDATE PLUS OR NOT_EQUAL MULTMONEY MULTDEC MULT MULDURATION MINUSMONEY MINUSDURATION MINUSDEC MINUSDATE MINUS LESSER_MONEY LESSER_EQUAL_MONEY LESSER_EQUAL_DURATION LESSER_EQUAL_DEC LESSER_EQUAL_DATE LESSER_EQUAL LESSER_DURATION LESSER_DEC LESSER_DATE LESSER LABEL GREATER_MONEY GREATER_EQUAL_MONEY GREATER_EQUAL_DURATION GREATER_EQUAL_DEC GREATER_EQUAL_DATE GREATER_EQUAL GREATER_DURATION GREATER_DEC GREATER_DATE GREATER EXCEPTION EQUAL END_CODE ELSE DIVMONEY DIVDURATION DIVDEC DIV DEFINITION DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] ## @@ -1476,7 +1476,7 @@ expected an expression to take the opposite of source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION SUM YEAR ## -## Ends in an error in state: 20. +## Ends in an error in state: 15. ## ## aggregate_func -> SUM . typ_base [ FOR ] ## @@ -1488,7 +1488,7 @@ expected the "for" keyword to spell the aggregation source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION TRUE ASSERTION ## -## Ends in an error in state: 233. +## Ends in an error in state: 228. ## ## code_item -> SCOPE constructor option(scope_use_condition) . COLON nonempty_list(scope_item) [ SCOPE END_CODE DECLARATION ] ## @@ -1499,27 +1499,27 @@ source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION TRUE ASSERTION ## This implies that, although the LR(1) items shown above provide an ## accurate view of the past (what has been recognized so far), they ## may provide an INCOMPLETE view of the future (what was expected next). -## In state 51, spurious reduction of production primitive_expression -> small_expression -## In state 90, spurious reduction of production base_expression -> primitive_expression -## In state 116, spurious reduction of production unop_expression -> base_expression -## In state 87, spurious reduction of production mult_expression -> unop_expression -## In state 164, spurious reduction of production sum_expression -> mult_expression -## In state 117, spurious reduction of production compare_expression -> sum_expression -## In state 175, spurious reduction of production logical_atom -> compare_expression -## In state 170, spurious reduction of production logical_or_expression -> logical_atom -## In state 166, spurious reduction of production logical_expression -> logical_or_expression -## In state 200, spurious reduction of production expression -> logical_expression -## In state 231, spurious reduction of production scope_use_condition -> UNDER_CONDITION expression -## In state 232, spurious reduction of production option(scope_use_condition) -> scope_use_condition +## In state 46, spurious reduction of production primitive_expression -> small_expression +## In state 85, spurious reduction of production base_expression -> primitive_expression +## In state 111, spurious reduction of production unop_expression -> base_expression +## In state 82, spurious reduction of production mult_expression -> unop_expression +## In state 159, spurious reduction of production sum_expression -> mult_expression +## In state 112, spurious reduction of production compare_expression -> sum_expression +## In state 170, spurious reduction of production logical_atom -> compare_expression +## In state 165, spurious reduction of production logical_or_expression -> logical_atom +## In state 161, spurious reduction of production logical_expression -> logical_or_expression +## In state 195, spurious reduction of production expression -> logical_expression +## In state 226, spurious reduction of production scope_use_condition -> UNDER_CONDITION expression +## In state 227, spurious reduction of production option(scope_use_condition) -> scope_use_condition ## expected a colon after the scope use precondition source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION TRUE DOT CONSTRUCTOR DOT YEAR ## -## Ends in an error in state: 53. +## Ends in an error in state: 48. ## -## small_expression -> small_expression DOT option(terminated(constructor,DOT)) . ident [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RSQUARE RPAREN RBRACKET PLUSPLUS PLUSMONEY PLUSDURATION PLUSDEC PLUSDATE PLUS OR OF NOT_EQUAL MULTMONEY MULTDEC MULT MULDURATION MINUSMONEY MINUSDURATION MINUSDEC MINUSDATE MINUS LESSER_MONEY LESSER_EQUAL_MONEY LESSER_EQUAL_DURATION LESSER_EQUAL_DEC LESSER_EQUAL_DATE LESSER_EQUAL LESSER_DURATION LESSER_DEC LESSER_DATE LESSER LABEL INCREASING IN GREATER_MONEY GREATER_EQUAL_MONEY GREATER_EQUAL_DURATION GREATER_EQUAL_DEC GREATER_EQUAL_DATE GREATER_EQUAL GREATER_DURATION GREATER_DEC GREATER_DATE GREATER FOR EXCEPTION EQUAL END_CODE ELSE DOT DIVMONEY DIVDURATION DIVDEC DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] +## small_expression -> small_expression DOT option(terminated(constructor,DOT)) . ident [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RSQUARE RPAREN RBRACKET PLUSPLUS PLUSMONEY PLUSDURATION PLUSDEC PLUSDATE PLUS OR OF NOT_EQUAL MULTMONEY MULTDEC MULT MULDURATION MINUSMONEY MINUSDURATION MINUSDEC MINUSDATE MINUS LESSER_MONEY LESSER_EQUAL_MONEY LESSER_EQUAL_DURATION LESSER_EQUAL_DEC LESSER_EQUAL_DATE LESSER_EQUAL LESSER_DURATION LESSER_DEC LESSER_DATE LESSER LABEL INCREASING GREATER_MONEY GREATER_EQUAL_MONEY GREATER_EQUAL_DURATION GREATER_EQUAL_DEC GREATER_EQUAL_DATE GREATER_EQUAL GREATER_DURATION GREATER_DEC GREATER_DATE GREATER FOR EXCEPTION EQUAL END_CODE ELSE DOT DIVMONEY DIVDURATION DIVDEC DIV DEFINITION DECREASING DECLARATION CONTAINS CONSEQUENCE COLON ASSERTION AND ALT ] ## ## The known suffix of the stack is as follows: ## small_expression DOT option(terminated(constructor,DOT)) @@ -1529,7 +1529,7 @@ expected the rest of the path after the dot source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION TRUE DOT CONSTRUCTOR YEAR ## -## Ends in an error in state: 56. +## Ends in an error in state: 51. ## ## option(terminated(constructor,DOT)) -> constructor . DOT [ IDENT ] ## @@ -1541,9 +1541,9 @@ expected the rest of the path after a dot source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION TRUE DOT YEAR ## -## Ends in an error in state: 52. +## Ends in an error in state: 47. ## -## small_expression -> small_expression DOT . option(terminated(constructor,DOT)) ident [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RSQUARE RPAREN RBRACKET PLUSPLUS PLUSMONEY PLUSDURATION PLUSDEC PLUSDATE PLUS OR OF NOT_EQUAL MULTMONEY MULTDEC MULT MULDURATION MINUSMONEY MINUSDURATION MINUSDEC MINUSDATE MINUS LESSER_MONEY LESSER_EQUAL_MONEY LESSER_EQUAL_DURATION LESSER_EQUAL_DEC LESSER_EQUAL_DATE LESSER_EQUAL LESSER_DURATION LESSER_DEC LESSER_DATE LESSER LABEL INCREASING IN GREATER_MONEY GREATER_EQUAL_MONEY GREATER_EQUAL_DURATION GREATER_EQUAL_DEC GREATER_EQUAL_DATE GREATER_EQUAL GREATER_DURATION GREATER_DEC GREATER_DATE GREATER FOR EXCEPTION EQUAL END_CODE ELSE DOT DIVMONEY DIVDURATION DIVDEC DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] +## small_expression -> small_expression DOT . option(terminated(constructor,DOT)) ident [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RSQUARE RPAREN RBRACKET PLUSPLUS PLUSMONEY PLUSDURATION PLUSDEC PLUSDATE PLUS OR OF NOT_EQUAL MULTMONEY MULTDEC MULT MULDURATION MINUSMONEY MINUSDURATION MINUSDEC MINUSDATE MINUS LESSER_MONEY LESSER_EQUAL_MONEY LESSER_EQUAL_DURATION LESSER_EQUAL_DEC LESSER_EQUAL_DATE LESSER_EQUAL LESSER_DURATION LESSER_DEC LESSER_DATE LESSER LABEL INCREASING GREATER_MONEY GREATER_EQUAL_MONEY GREATER_EQUAL_DURATION GREATER_EQUAL_DEC GREATER_EQUAL_DATE GREATER_EQUAL GREATER_DURATION GREATER_DEC GREATER_DATE GREATER FOR EXCEPTION EQUAL END_CODE ELSE DOT DIVMONEY DIVDURATION DIVDEC DIV DEFINITION DECREASING DECLARATION CONTAINS CONSEQUENCE COLON ASSERTION AND ALT ] ## ## The known suffix of the stack is as follows: ## small_expression DOT @@ -1551,21 +1551,10 @@ source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION TRUE DOT YEAR expected the name of the struct field of the expression before -source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION TRUE IN YEAR -## -## Ends in an error in state: 114. -## -## base_expression -> primitive_expression IN . base_expression [ XOR THEN SEMICOLON SCOPE RULE RSQUARE RPAREN RBRACKET PLUSPLUS PLUSMONEY PLUSDURATION PLUSDEC PLUSDATE PLUS OR NOT_EQUAL MULTMONEY MULTDEC MULT MULDURATION MINUSMONEY MINUSDURATION MINUSDEC MINUSDATE MINUS LESSER_MONEY LESSER_EQUAL_MONEY LESSER_EQUAL_DURATION LESSER_EQUAL_DEC LESSER_EQUAL_DATE LESSER_EQUAL LESSER_DURATION LESSER_DEC LESSER_DATE LESSER LABEL INCREASING GREATER_MONEY GREATER_EQUAL_MONEY GREATER_EQUAL_DURATION GREATER_EQUAL_DEC GREATER_EQUAL_DATE GREATER_EQUAL GREATER_DURATION GREATER_DEC GREATER_DATE GREATER EXCEPTION EQUAL END_CODE ELSE DIVMONEY DIVDURATION DIVDEC DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] -## -## The known suffix of the stack is as follows: -## primitive_expression IN -## - -expected an expression standing for the set you want to test for membership source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION TRUE INCREASING ## -## Ends in an error in state: 164. +## Ends in an error in state: 159. ## ## mult_expression -> mult_expression . mult_op unop_expression [ XOR THEN SEMICOLON SCOPE RULE RSQUARE RPAREN RBRACKET PLUSPLUS PLUSMONEY PLUSDURATION PLUSDEC PLUSDATE PLUS OR NOT_EQUAL MULTMONEY MULTDEC MULT MULDURATION MINUSMONEY MINUSDURATION MINUSDEC MINUSDATE MINUS LESSER_MONEY LESSER_EQUAL_MONEY LESSER_EQUAL_DURATION LESSER_EQUAL_DEC LESSER_EQUAL_DATE LESSER_EQUAL LESSER_DURATION LESSER_DEC LESSER_DATE LESSER LABEL GREATER_MONEY GREATER_EQUAL_MONEY GREATER_EQUAL_DURATION GREATER_EQUAL_DEC GREATER_EQUAL_DATE GREATER_EQUAL GREATER_DURATION GREATER_DEC GREATER_DATE GREATER EXCEPTION EQUAL END_CODE ELSE DIVMONEY DIVDURATION DIVDEC DIV DEFINITION DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] ## sum_expression -> mult_expression . [ XOR THEN SEMICOLON SCOPE RULE RSQUARE RPAREN RBRACKET PLUSPLUS PLUSMONEY PLUSDURATION PLUSDEC PLUSDATE PLUS OR NOT_EQUAL MINUSMONEY MINUSDURATION MINUSDEC MINUSDATE MINUS LESSER_MONEY LESSER_EQUAL_MONEY LESSER_EQUAL_DURATION LESSER_EQUAL_DEC LESSER_EQUAL_DATE LESSER_EQUAL LESSER_DURATION LESSER_DEC LESSER_DATE LESSER LABEL GREATER_MONEY GREATER_EQUAL_MONEY GREATER_EQUAL_DURATION GREATER_EQUAL_DEC GREATER_EQUAL_DATE GREATER_EQUAL GREATER_DURATION GREATER_DEC GREATER_DATE GREATER EXCEPTION EQUAL END_CODE ELSE DEFINITION DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] @@ -1577,17 +1566,17 @@ source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION TRUE INCREASING ## This implies that, although the LR(1) items shown above provide an ## accurate view of the past (what has been recognized so far), they ## may provide an INCOMPLETE view of the future (what was expected next). -## In state 51, spurious reduction of production primitive_expression -> small_expression -## In state 90, spurious reduction of production base_expression -> primitive_expression -## In state 116, spurious reduction of production unop_expression -> base_expression -## In state 87, spurious reduction of production mult_expression -> unop_expression +## In state 46, spurious reduction of production primitive_expression -> small_expression +## In state 85, spurious reduction of production base_expression -> primitive_expression +## In state 111, spurious reduction of production unop_expression -> base_expression +## In state 82, spurious reduction of production mult_expression -> unop_expression ## expected an operator to compose the expression on the left source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION TRUE MULTMONEY YEAR ## -## Ends in an error in state: 161. +## Ends in an error in state: 156. ## ## mult_expression -> mult_expression mult_op . unop_expression [ XOR THEN SEMICOLON SCOPE RULE RSQUARE RPAREN RBRACKET PLUSPLUS PLUSMONEY PLUSDURATION PLUSDEC PLUSDATE PLUS OR NOT_EQUAL MULTMONEY MULTDEC MULT MULDURATION MINUSMONEY MINUSDURATION MINUSDEC MINUSDATE MINUS LESSER_MONEY LESSER_EQUAL_MONEY LESSER_EQUAL_DURATION LESSER_EQUAL_DEC LESSER_EQUAL_DATE LESSER_EQUAL LESSER_DURATION LESSER_DEC LESSER_DATE LESSER LABEL GREATER_MONEY GREATER_EQUAL_MONEY GREATER_EQUAL_DURATION GREATER_EQUAL_DEC GREATER_EQUAL_DATE GREATER_EQUAL GREATER_DURATION GREATER_DEC GREATER_DATE GREATER EXCEPTION EQUAL END_CODE ELSE DIVMONEY DIVDURATION DIVDEC DIV DEFINITION DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] ## @@ -1599,7 +1588,7 @@ expected an expression on the right side of the multiplication or division opera source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION TRUE NOT_EQUAL YEAR ## -## Ends in an error in state: 163. +## Ends in an error in state: 158. ## ## compare_expression -> sum_expression compare_op . compare_expression [ XOR THEN SEMICOLON SCOPE RULE RSQUARE RPAREN RBRACKET OR LABEL EXCEPTION END_CODE ELSE DEFINITION DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] ## @@ -1611,7 +1600,7 @@ expected an expression on the right side of the comparison operator source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION TRUE OF YEAR ## -## Ends in an error in state: 103. +## Ends in an error in state: 98. ## ## base_expression -> primitive_expression OF . base_expression [ XOR THEN SEMICOLON SCOPE RULE RSQUARE RPAREN RBRACKET PLUSPLUS PLUSMONEY PLUSDURATION PLUSDEC PLUSDATE PLUS OR NOT_EQUAL MULTMONEY MULTDEC MULT MULDURATION MINUSMONEY MINUSDURATION MINUSDEC MINUSDATE MINUS LESSER_MONEY LESSER_EQUAL_MONEY LESSER_EQUAL_DURATION LESSER_EQUAL_DEC LESSER_EQUAL_DATE LESSER_EQUAL LESSER_DURATION LESSER_DEC LESSER_DATE LESSER LABEL INCREASING GREATER_MONEY GREATER_EQUAL_MONEY GREATER_EQUAL_DURATION GREATER_EQUAL_DEC GREATER_EQUAL_DATE GREATER_EQUAL GREATER_DURATION GREATER_DEC GREATER_DATE GREATER EXCEPTION EQUAL END_CODE ELSE DIVMONEY DIVDURATION DIVDEC DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] ## @@ -1623,7 +1612,7 @@ expected an expression for the argument of this function call source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION TRUE PLUSMONEY YEAR ## -## Ends in an error in state: 151. +## Ends in an error in state: 146. ## ## sum_expression -> sum_expression sum_op . mult_expression [ XOR THEN SEMICOLON SCOPE RULE RSQUARE RPAREN RBRACKET PLUSPLUS PLUSMONEY PLUSDURATION PLUSDEC PLUSDATE PLUS OR NOT_EQUAL MINUSMONEY MINUSDURATION MINUSDEC MINUSDATE MINUS LESSER_MONEY LESSER_EQUAL_MONEY LESSER_EQUAL_DURATION LESSER_EQUAL_DEC LESSER_EQUAL_DATE LESSER_EQUAL LESSER_DURATION LESSER_DEC LESSER_DATE LESSER LABEL GREATER_MONEY GREATER_EQUAL_MONEY GREATER_EQUAL_DURATION GREATER_EQUAL_DEC GREATER_EQUAL_DATE GREATER_EQUAL GREATER_DURATION GREATER_DEC GREATER_DATE GREATER EXCEPTION EQUAL END_CODE ELSE DEFINITION DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] ## @@ -1635,12 +1624,12 @@ expected an expression after the plus or minus operator source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION TRUE WE_HAVE ## -## Ends in an error in state: 90. +## Ends in an error in state: 85. ## ## base_expression -> primitive_expression . [ XOR THEN SEMICOLON SCOPE RULE RSQUARE RPAREN RBRACKET PLUSPLUS PLUSMONEY PLUSDURATION PLUSDEC PLUSDATE PLUS OR NOT_EQUAL MULTMONEY MULTDEC MULT MULDURATION MINUSMONEY MINUSDURATION MINUSDEC MINUSDATE MINUS LESSER_MONEY LESSER_EQUAL_MONEY LESSER_EQUAL_DURATION LESSER_EQUAL_DEC LESSER_EQUAL_DATE LESSER_EQUAL LESSER_DURATION LESSER_DEC LESSER_DATE LESSER LABEL INCREASING GREATER_MONEY GREATER_EQUAL_MONEY GREATER_EQUAL_DURATION GREATER_EQUAL_DEC GREATER_EQUAL_DATE GREATER_EQUAL GREATER_DURATION GREATER_DEC GREATER_DATE GREATER EXCEPTION EQUAL END_CODE ELSE DIVMONEY DIVDURATION DIVDEC DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] ## base_expression -> primitive_expression . OF base_expression [ XOR THEN SEMICOLON SCOPE RULE RSQUARE RPAREN RBRACKET PLUSPLUS PLUSMONEY PLUSDURATION PLUSDEC PLUSDATE PLUS OR NOT_EQUAL MULTMONEY MULTDEC MULT MULDURATION MINUSMONEY MINUSDURATION MINUSDEC MINUSDATE MINUS LESSER_MONEY LESSER_EQUAL_MONEY LESSER_EQUAL_DURATION LESSER_EQUAL_DEC LESSER_EQUAL_DATE LESSER_EQUAL LESSER_DURATION LESSER_DEC LESSER_DATE LESSER LABEL INCREASING GREATER_MONEY GREATER_EQUAL_MONEY GREATER_EQUAL_DURATION GREATER_EQUAL_DEC GREATER_EQUAL_DATE GREATER_EQUAL GREATER_DURATION GREATER_DEC GREATER_DATE GREATER EXCEPTION EQUAL END_CODE ELSE DIVMONEY DIVDURATION DIVDEC DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] ## base_expression -> primitive_expression . WITH constructor_binding [ XOR THEN SEMICOLON SCOPE RULE RSQUARE RPAREN RBRACKET PLUSPLUS PLUSMONEY PLUSDURATION PLUSDEC PLUSDATE PLUS OR NOT_EQUAL MULTMONEY MULTDEC MULT MULDURATION MINUSMONEY MINUSDURATION MINUSDEC MINUSDATE MINUS LESSER_MONEY LESSER_EQUAL_MONEY LESSER_EQUAL_DURATION LESSER_EQUAL_DEC LESSER_EQUAL_DATE LESSER_EQUAL LESSER_DURATION LESSER_DEC LESSER_DATE LESSER LABEL INCREASING GREATER_MONEY GREATER_EQUAL_MONEY GREATER_EQUAL_DURATION GREATER_EQUAL_DEC GREATER_EQUAL_DATE GREATER_EQUAL GREATER_DURATION GREATER_DEC GREATER_DATE GREATER EXCEPTION EQUAL END_CODE ELSE DIVMONEY DIVDURATION DIVDEC DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] -## base_expression -> primitive_expression . IN base_expression [ XOR THEN SEMICOLON SCOPE RULE RSQUARE RPAREN RBRACKET PLUSPLUS PLUSMONEY PLUSDURATION PLUSDEC PLUSDATE PLUS OR NOT_EQUAL MULTMONEY MULTDEC MULT MULDURATION MINUSMONEY MINUSDURATION MINUSDEC MINUSDATE MINUS LESSER_MONEY LESSER_EQUAL_MONEY LESSER_EQUAL_DURATION LESSER_EQUAL_DEC LESSER_EQUAL_DATE LESSER_EQUAL LESSER_DURATION LESSER_DEC LESSER_DATE LESSER LABEL INCREASING GREATER_MONEY GREATER_EQUAL_MONEY GREATER_EQUAL_DURATION GREATER_EQUAL_DEC GREATER_EQUAL_DATE GREATER_EQUAL GREATER_DURATION GREATER_DEC GREATER_DATE GREATER EXCEPTION EQUAL END_CODE ELSE DIVMONEY DIVDURATION DIVDEC DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] +## base_expression -> primitive_expression . CONTAINS base_expression [ XOR THEN SEMICOLON SCOPE RULE RSQUARE RPAREN RBRACKET PLUSPLUS PLUSMONEY PLUSDURATION PLUSDEC PLUSDATE PLUS OR NOT_EQUAL MULTMONEY MULTDEC MULT MULDURATION MINUSMONEY MINUSDURATION MINUSDEC MINUSDATE MINUS LESSER_MONEY LESSER_EQUAL_MONEY LESSER_EQUAL_DURATION LESSER_EQUAL_DEC LESSER_EQUAL_DATE LESSER_EQUAL LESSER_DURATION LESSER_DEC LESSER_DATE LESSER LABEL INCREASING GREATER_MONEY GREATER_EQUAL_MONEY GREATER_EQUAL_DURATION GREATER_EQUAL_DEC GREATER_EQUAL_DATE GREATER_EQUAL GREATER_DURATION GREATER_DEC GREATER_DATE GREATER EXCEPTION EQUAL END_CODE ELSE DIVMONEY DIVDURATION DIVDEC DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] ## ## The known suffix of the stack is as follows: ## primitive_expression @@ -1649,14 +1638,14 @@ source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION TRUE WE_HAVE ## This implies that, although the LR(1) items shown above provide an ## accurate view of the past (what has been recognized so far), they ## may provide an INCOMPLETE view of the future (what was expected next). -## In state 51, spurious reduction of production primitive_expression -> small_expression +## In state 46, spurious reduction of production primitive_expression -> small_expression ## the expression before ended, what follows next should be an operator or the rest of the code structure source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION TRUE WITH CONSTRUCTOR CONSTRUCTOR ## -## Ends in an error in state: 92. +## Ends in an error in state: 87. ## ## constructor_binding -> maybe_qualified_constructor . optional_binding [ XOR THEN SEMICOLON SCOPE RULE RSQUARE RPAREN RBRACKET PLUSPLUS PLUSMONEY PLUSDURATION PLUSDEC PLUSDATE PLUS OR NOT_EQUAL MULTMONEY MULTDEC MULT MULDURATION MINUSMONEY MINUSDURATION MINUSDEC MINUSDATE MINUS LESSER_MONEY LESSER_EQUAL_MONEY LESSER_EQUAL_DURATION LESSER_EQUAL_DEC LESSER_EQUAL_DATE LESSER_EQUAL LESSER_DURATION LESSER_DEC LESSER_DATE LESSER LABEL INCREASING GREATER_MONEY GREATER_EQUAL_MONEY GREATER_EQUAL_DURATION GREATER_EQUAL_DEC GREATER_EQUAL_DATE GREATER_EQUAL GREATER_DURATION GREATER_DEC GREATER_DATE GREATER EXCEPTION EQUAL END_CODE ELSE DIVMONEY DIVDURATION DIVDEC DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] ## @@ -1667,15 +1656,15 @@ source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION TRUE WITH CONSTRUCTOR ## This implies that, although the LR(1) items shown above provide an ## accurate view of the past (what has been recognized so far), they ## may provide an INCOMPLETE view of the future (what was expected next). -## In state 96, spurious reduction of production option(preceded(DOT,constructor)) -> -## In state 99, spurious reduction of production maybe_qualified_constructor -> constructor option(preceded(DOT,constructor)) +## In state 91, spurious reduction of production option(preceded(DOT,constructor)) -> +## In state 94, spurious reduction of production maybe_qualified_constructor -> constructor option(preceded(DOT,constructor)) ## a enum constructor pattern should be followed by a payload source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION TRUE WITH CONSTRUCTOR OF CONSTRUCTOR XOR ## -## Ends in an error in state: 94. +## Ends in an error in state: 89. ## ## optional_binding -> OF maybe_qualified_constructor . constructor_binding [ XOR THEN SEMICOLON SCOPE RULE RSQUARE RPAREN RBRACKET PLUSPLUS PLUSMONEY PLUSDURATION PLUSDEC PLUSDATE PLUS OR NOT_EQUAL MULTMONEY MULTDEC MULT MULDURATION MINUSMONEY MINUSDURATION MINUSDEC MINUSDATE MINUS LESSER_MONEY LESSER_EQUAL_MONEY LESSER_EQUAL_DURATION LESSER_EQUAL_DEC LESSER_EQUAL_DATE LESSER_EQUAL LESSER_DURATION LESSER_DEC LESSER_DATE LESSER LABEL INCREASING GREATER_MONEY GREATER_EQUAL_MONEY GREATER_EQUAL_DURATION GREATER_EQUAL_DEC GREATER_EQUAL_DATE GREATER_EQUAL GREATER_DURATION GREATER_DEC GREATER_DATE GREATER EXCEPTION EQUAL END_CODE ELSE DIVMONEY DIVDURATION DIVDEC DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] ## @@ -1686,15 +1675,15 @@ source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION TRUE WITH CONSTRUCTOR ## This implies that, although the LR(1) items shown above provide an ## accurate view of the past (what has been recognized so far), they ## may provide an INCOMPLETE view of the future (what was expected next). -## In state 96, spurious reduction of production option(preceded(DOT,constructor)) -> -## In state 99, spurious reduction of production maybe_qualified_constructor -> constructor option(preceded(DOT,constructor)) +## In state 91, spurious reduction of production option(preceded(DOT,constructor)) -> +## In state 94, spurious reduction of production maybe_qualified_constructor -> constructor option(preceded(DOT,constructor)) ## unexpected expression following a function application with an enum constructor name source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION TRUE WITH CONSTRUCTOR OF YEAR ## -## Ends in an error in state: 93. +## Ends in an error in state: 88. ## ## optional_binding -> OF . ident [ XOR THEN SEMICOLON SCOPE RULE RSQUARE RPAREN RBRACKET PLUSPLUS PLUSMONEY PLUSDURATION PLUSDEC PLUSDATE PLUS OR NOT_EQUAL MULTMONEY MULTDEC MULT MULDURATION MINUSMONEY MINUSDURATION MINUSDEC MINUSDATE MINUS LESSER_MONEY LESSER_EQUAL_MONEY LESSER_EQUAL_DURATION LESSER_EQUAL_DEC LESSER_EQUAL_DATE LESSER_EQUAL LESSER_DURATION LESSER_DEC LESSER_DATE LESSER LABEL INCREASING GREATER_MONEY GREATER_EQUAL_MONEY GREATER_EQUAL_DURATION GREATER_EQUAL_DEC GREATER_EQUAL_DATE GREATER_EQUAL GREATER_DURATION GREATER_DEC GREATER_DATE GREATER EXCEPTION EQUAL END_CODE ELSE DIVMONEY DIVDURATION DIVDEC DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] ## optional_binding -> OF . maybe_qualified_constructor constructor_binding [ XOR THEN SEMICOLON SCOPE RULE RSQUARE RPAREN RBRACKET PLUSPLUS PLUSMONEY PLUSDURATION PLUSDEC PLUSDATE PLUS OR NOT_EQUAL MULTMONEY MULTDEC MULT MULDURATION MINUSMONEY MINUSDURATION MINUSDEC MINUSDATE MINUS LESSER_MONEY LESSER_EQUAL_MONEY LESSER_EQUAL_DURATION LESSER_EQUAL_DEC LESSER_EQUAL_DATE LESSER_EQUAL LESSER_DURATION LESSER_DEC LESSER_DATE LESSER LABEL INCREASING GREATER_MONEY GREATER_EQUAL_MONEY GREATER_EQUAL_DURATION GREATER_EQUAL_DEC GREATER_EQUAL_DATE GREATER_EQUAL GREATER_DURATION GREATER_DEC GREATER_DATE GREATER EXCEPTION EQUAL END_CODE ELSE DIVMONEY DIVDURATION DIVDEC DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] @@ -1707,7 +1696,7 @@ expecting an expression to stand in as the function argument source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION TRUE WITH CONSTRUCTOR YEAR ## -## Ends in an error in state: 96. +## Ends in an error in state: 91. ## ## maybe_qualified_constructor -> constructor . option(preceded(DOT,constructor)) [ XOR THEN SEMICOLON SCOPE RULE RSQUARE RPAREN RBRACKET PLUSPLUS PLUSMONEY PLUSDURATION PLUSDEC PLUSDATE PLUS OR OF NOT_EQUAL MULTMONEY MULTDEC MULT MULDURATION MINUSMONEY MINUSDURATION MINUSDEC MINUSDATE MINUS LESSER_MONEY LESSER_EQUAL_MONEY LESSER_EQUAL_DURATION LESSER_EQUAL_DEC LESSER_EQUAL_DATE LESSER_EQUAL LESSER_DURATION LESSER_DEC LESSER_DATE LESSER LABEL INCREASING GREATER_MONEY GREATER_EQUAL_MONEY GREATER_EQUAL_DURATION GREATER_EQUAL_DEC GREATER_EQUAL_DATE GREATER_EQUAL GREATER_DURATION GREATER_DEC GREATER_DATE GREATER EXCEPTION EQUAL END_CODE ELSE DIVMONEY DIVDURATION DIVDEC DIV DEFINITION DECREASING DECLARATION CONSTRUCTOR CONSEQUENCE COLON ASSERTION AND ALT ] ## @@ -1719,7 +1708,7 @@ the expression before ended, what follows next should be an operator or the rest source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION TRUE WITH YEAR ## -## Ends in an error in state: 91. +## Ends in an error in state: 86. ## ## base_expression -> primitive_expression WITH . constructor_binding [ XOR THEN SEMICOLON SCOPE RULE RSQUARE RPAREN RBRACKET PLUSPLUS PLUSMONEY PLUSDURATION PLUSDEC PLUSDATE PLUS OR NOT_EQUAL MULTMONEY MULTDEC MULT MULDURATION MINUSMONEY MINUSDURATION MINUSDEC MINUSDATE MINUS LESSER_MONEY LESSER_EQUAL_MONEY LESSER_EQUAL_DURATION LESSER_EQUAL_DEC LESSER_EQUAL_DATE LESSER_EQUAL LESSER_DURATION LESSER_DEC LESSER_DATE LESSER LABEL INCREASING GREATER_MONEY GREATER_EQUAL_MONEY GREATER_EQUAL_DURATION GREATER_EQUAL_DEC GREATER_EQUAL_DATE GREATER_EQUAL GREATER_DURATION GREATER_DEC GREATER_DATE GREATER EXCEPTION EQUAL END_CODE ELSE DIVMONEY DIVDURATION DIVDEC DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] ## @@ -1731,7 +1720,7 @@ source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION TRUE WITH YEAR source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION TRUE XOR YEAR ## -## Ends in an error in state: 173. +## Ends in an error in state: 168. ## ## logical_or_expression -> logical_atom logical_or_op . logical_or_expression [ THEN SEMICOLON SCOPE RULE RSQUARE RPAREN RBRACKET LABEL EXCEPTION END_CODE ELSE DEFINITION DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] ## @@ -1743,10 +1732,10 @@ source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION TRUE XOR YEAR source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION TRUE YEAR ## -## Ends in an error in state: 51. +## Ends in an error in state: 46. ## -## primitive_expression -> small_expression . [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RSQUARE RPAREN RBRACKET PLUSPLUS PLUSMONEY PLUSDURATION PLUSDEC PLUSDATE PLUS OR OF NOT_EQUAL MULTMONEY MULTDEC MULT MULDURATION MINUSMONEY MINUSDURATION MINUSDEC MINUSDATE MINUS LESSER_MONEY LESSER_EQUAL_MONEY LESSER_EQUAL_DURATION LESSER_EQUAL_DEC LESSER_EQUAL_DATE LESSER_EQUAL LESSER_DURATION LESSER_DEC LESSER_DATE LESSER LABEL INCREASING IN GREATER_MONEY GREATER_EQUAL_MONEY GREATER_EQUAL_DURATION GREATER_EQUAL_DEC GREATER_EQUAL_DATE GREATER_EQUAL GREATER_DURATION GREATER_DEC GREATER_DATE GREATER FOR EXCEPTION EQUAL END_CODE ELSE DIVMONEY DIVDURATION DIVDEC DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] -## small_expression -> small_expression . DOT option(terminated(constructor,DOT)) ident [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RSQUARE RPAREN RBRACKET PLUSPLUS PLUSMONEY PLUSDURATION PLUSDEC PLUSDATE PLUS OR OF NOT_EQUAL MULTMONEY MULTDEC MULT MULDURATION MINUSMONEY MINUSDURATION MINUSDEC MINUSDATE MINUS LESSER_MONEY LESSER_EQUAL_MONEY LESSER_EQUAL_DURATION LESSER_EQUAL_DEC LESSER_EQUAL_DATE LESSER_EQUAL LESSER_DURATION LESSER_DEC LESSER_DATE LESSER LABEL INCREASING IN GREATER_MONEY GREATER_EQUAL_MONEY GREATER_EQUAL_DURATION GREATER_EQUAL_DEC GREATER_EQUAL_DATE GREATER_EQUAL GREATER_DURATION GREATER_DEC GREATER_DATE GREATER FOR EXCEPTION EQUAL END_CODE ELSE DOT DIVMONEY DIVDURATION DIVDEC DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] +## primitive_expression -> small_expression . [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RSQUARE RPAREN RBRACKET PLUSPLUS PLUSMONEY PLUSDURATION PLUSDEC PLUSDATE PLUS OR OF NOT_EQUAL MULTMONEY MULTDEC MULT MULDURATION MINUSMONEY MINUSDURATION MINUSDEC MINUSDATE MINUS LESSER_MONEY LESSER_EQUAL_MONEY LESSER_EQUAL_DURATION LESSER_EQUAL_DEC LESSER_EQUAL_DATE LESSER_EQUAL LESSER_DURATION LESSER_DEC LESSER_DATE LESSER LABEL INCREASING GREATER_MONEY GREATER_EQUAL_MONEY GREATER_EQUAL_DURATION GREATER_EQUAL_DEC GREATER_EQUAL_DATE GREATER_EQUAL GREATER_DURATION GREATER_DEC GREATER_DATE GREATER FOR EXCEPTION EQUAL END_CODE ELSE DIVMONEY DIVDURATION DIVDEC DIV DEFINITION DECREASING DECLARATION CONTAINS CONSEQUENCE COLON ASSERTION AND ALT ] +## small_expression -> small_expression . DOT option(terminated(constructor,DOT)) ident [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RSQUARE RPAREN RBRACKET PLUSPLUS PLUSMONEY PLUSDURATION PLUSDEC PLUSDATE PLUS OR OF NOT_EQUAL MULTMONEY MULTDEC MULT MULDURATION MINUSMONEY MINUSDURATION MINUSDEC MINUSDATE MINUS LESSER_MONEY LESSER_EQUAL_MONEY LESSER_EQUAL_DURATION LESSER_EQUAL_DEC LESSER_EQUAL_DATE LESSER_EQUAL LESSER_DURATION LESSER_DEC LESSER_DATE LESSER LABEL INCREASING GREATER_MONEY GREATER_EQUAL_MONEY GREATER_EQUAL_DURATION GREATER_EQUAL_DEC GREATER_EQUAL_DATE GREATER_EQUAL GREATER_DURATION GREATER_DEC GREATER_DATE GREATER FOR EXCEPTION EQUAL END_CODE ELSE DOT DIVMONEY DIVDURATION DIVDEC DIV DEFINITION DECREASING DECLARATION CONTAINS CONSEQUENCE COLON ASSERTION AND ALT ] ## ## The known suffix of the stack is as follows: ## small_expression @@ -1754,71 +1743,16 @@ source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION TRUE YEAR expected an enum constructor to test if the expression on the left -source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION VERTICAL INT_LITERAL MINUS INT_LITERAL MINUS INT_LITERAL YEAR -## -## Ends in an error in state: 17. -## -## literal -> VERTICAL date_int MINUS date_int MINUS date_int . VERTICAL [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RSQUARE RPAREN RBRACKET PLUSPLUS PLUSMONEY PLUSDURATION PLUSDEC PLUSDATE PLUS OR OF NOT_EQUAL MULTMONEY MULTDEC MULT MULDURATION MINUSMONEY MINUSDURATION MINUSDEC MINUSDATE MINUS LESSER_MONEY LESSER_EQUAL_MONEY LESSER_EQUAL_DURATION LESSER_EQUAL_DEC LESSER_EQUAL_DATE LESSER_EQUAL LESSER_DURATION LESSER_DEC LESSER_DATE LESSER LABEL INCREASING IN GREATER_MONEY GREATER_EQUAL_MONEY GREATER_EQUAL_DURATION GREATER_EQUAL_DEC GREATER_EQUAL_DATE GREATER_EQUAL GREATER_DURATION GREATER_DEC GREATER_DATE GREATER FOR EXCEPTION EQUAL END_CODE ELSE DOT DIVMONEY DIVDURATION DIVDEC DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] -## -## The known suffix of the stack is as follows: -## VERTICAL date_int MINUS date_int MINUS date_int -## -expected a vertical bar to end the date literal -source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION VERTICAL INT_LITERAL MINUS INT_LITERAL MINUS YEAR -## -## Ends in an error in state: 16. -## -## literal -> VERTICAL date_int MINUS date_int MINUS . date_int VERTICAL [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RSQUARE RPAREN RBRACKET PLUSPLUS PLUSMONEY PLUSDURATION PLUSDEC PLUSDATE PLUS OR OF NOT_EQUAL MULTMONEY MULTDEC MULT MULDURATION MINUSMONEY MINUSDURATION MINUSDEC MINUSDATE MINUS LESSER_MONEY LESSER_EQUAL_MONEY LESSER_EQUAL_DURATION LESSER_EQUAL_DEC LESSER_EQUAL_DATE LESSER_EQUAL LESSER_DURATION LESSER_DEC LESSER_DATE LESSER LABEL INCREASING IN GREATER_MONEY GREATER_EQUAL_MONEY GREATER_EQUAL_DURATION GREATER_EQUAL_DEC GREATER_EQUAL_DATE GREATER_EQUAL GREATER_DURATION GREATER_DEC GREATER_DATE GREATER FOR EXCEPTION EQUAL END_CODE ELSE DOT DIVMONEY DIVDURATION DIVDEC DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] -## -## The known suffix of the stack is as follows: -## VERTICAL date_int MINUS date_int MINUS -## -expected the day of the month -source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION VERTICAL INT_LITERAL MINUS INT_LITERAL YEAR -## -## Ends in an error in state: 15. -## -## literal -> VERTICAL date_int MINUS date_int . MINUS date_int VERTICAL [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RSQUARE RPAREN RBRACKET PLUSPLUS PLUSMONEY PLUSDURATION PLUSDEC PLUSDATE PLUS OR OF NOT_EQUAL MULTMONEY MULTDEC MULT MULDURATION MINUSMONEY MINUSDURATION MINUSDEC MINUSDATE MINUS LESSER_MONEY LESSER_EQUAL_MONEY LESSER_EQUAL_DURATION LESSER_EQUAL_DEC LESSER_EQUAL_DATE LESSER_EQUAL LESSER_DURATION LESSER_DEC LESSER_DATE LESSER LABEL INCREASING IN GREATER_MONEY GREATER_EQUAL_MONEY GREATER_EQUAL_DURATION GREATER_EQUAL_DEC GREATER_EQUAL_DATE GREATER_EQUAL GREATER_DURATION GREATER_DEC GREATER_DATE GREATER FOR EXCEPTION EQUAL END_CODE ELSE DOT DIVMONEY DIVDURATION DIVDEC DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] -## -## The known suffix of the stack is as follows: -## VERTICAL date_int MINUS date_int -## - -expected the "-" sign after the month of the year - -source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION VERTICAL INT_LITERAL MINUS YEAR -## -## Ends in an error in state: 14. -## -## literal -> VERTICAL date_int MINUS . date_int MINUS date_int VERTICAL [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RSQUARE RPAREN RBRACKET PLUSPLUS PLUSMONEY PLUSDURATION PLUSDEC PLUSDATE PLUS OR OF NOT_EQUAL MULTMONEY MULTDEC MULT MULDURATION MINUSMONEY MINUSDURATION MINUSDEC MINUSDATE MINUS LESSER_MONEY LESSER_EQUAL_MONEY LESSER_EQUAL_DURATION LESSER_EQUAL_DEC LESSER_EQUAL_DATE LESSER_EQUAL LESSER_DURATION LESSER_DEC LESSER_DATE LESSER LABEL INCREASING IN GREATER_MONEY GREATER_EQUAL_MONEY GREATER_EQUAL_DURATION GREATER_EQUAL_DEC GREATER_EQUAL_DATE GREATER_EQUAL GREATER_DURATION GREATER_DEC GREATER_DATE GREATER FOR EXCEPTION EQUAL END_CODE ELSE DOT DIVMONEY DIVDURATION DIVDEC DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] -## -## The known suffix of the stack is as follows: -## VERTICAL date_int MINUS -## - -expected the month of the year - -source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION VERTICAL INT_LITERAL YEAR -## -## Ends in an error in state: 13. -## -## literal -> VERTICAL date_int . MINUS date_int MINUS date_int VERTICAL [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RSQUARE RPAREN RBRACKET PLUSPLUS PLUSMONEY PLUSDURATION PLUSDEC PLUSDATE PLUS OR OF NOT_EQUAL MULTMONEY MULTDEC MULT MULDURATION MINUSMONEY MINUSDURATION MINUSDEC MINUSDATE MINUS LESSER_MONEY LESSER_EQUAL_MONEY LESSER_EQUAL_DURATION LESSER_EQUAL_DEC LESSER_EQUAL_DATE LESSER_EQUAL LESSER_DURATION LESSER_DEC LESSER_DATE LESSER LABEL INCREASING IN GREATER_MONEY GREATER_EQUAL_MONEY GREATER_EQUAL_DURATION GREATER_EQUAL_DEC GREATER_EQUAL_DATE GREATER_EQUAL GREATER_DURATION GREATER_DEC GREATER_DATE GREATER FOR EXCEPTION EQUAL END_CODE ELSE DOT DIVMONEY DIVDURATION DIVDEC DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] -## -## The known suffix of the stack is as follows: -## VERTICAL date_int -## - -expected the "-" sign after the year source_file: BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION VERTICAL YEAR ## ## Ends in an error in state: 11. ## -## literal -> VERTICAL . date_int MINUS date_int MINUS date_int VERTICAL [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RSQUARE RPAREN RBRACKET PLUSPLUS PLUSMONEY PLUSDURATION PLUSDEC PLUSDATE PLUS OR OF NOT_EQUAL MULTMONEY MULTDEC MULT MULDURATION MINUSMONEY MINUSDURATION MINUSDEC MINUSDATE MINUS LESSER_MONEY LESSER_EQUAL_MONEY LESSER_EQUAL_DURATION LESSER_EQUAL_DEC LESSER_EQUAL_DATE LESSER_EQUAL LESSER_DURATION LESSER_DEC LESSER_DATE LESSER LABEL INCREASING IN GREATER_MONEY GREATER_EQUAL_MONEY GREATER_EQUAL_DURATION GREATER_EQUAL_DEC GREATER_EQUAL_DATE GREATER_EQUAL GREATER_DURATION GREATER_DEC GREATER_DATE GREATER FOR EXCEPTION EQUAL END_CODE ELSE DOT DIVMONEY DIVDURATION DIVDEC DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] +## literal -> VERTICAL . DATE_LITERAL VERTICAL [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RSQUARE RPAREN RBRACKET PLUSPLUS PLUSMONEY PLUSDURATION PLUSDEC PLUSDATE PLUS OR OF NOT_EQUAL MULTMONEY MULTDEC MULT MULDURATION MINUSMONEY MINUSDURATION MINUSDEC MINUSDATE MINUS LESSER_MONEY LESSER_EQUAL_MONEY LESSER_EQUAL_DURATION LESSER_EQUAL_DEC LESSER_EQUAL_DATE LESSER_EQUAL LESSER_DURATION LESSER_DEC LESSER_DATE LESSER LABEL INCREASING GREATER_MONEY GREATER_EQUAL_MONEY GREATER_EQUAL_DURATION GREATER_EQUAL_DEC GREATER_EQUAL_DATE GREATER_EQUAL GREATER_DURATION GREATER_DEC GREATER_DATE GREATER FOR EXCEPTION EQUAL END_CODE ELSE DOT DIVMONEY DIVDURATION DIVDEC DIV DEFINITION DECREASING DECLARATION CONTAINS CONSEQUENCE COLON ASSERTION AND ALT ] ## ## The known suffix of the stack is as follows: ## VERTICAL @@ -1864,7 +1798,7 @@ expected the name of the scope being used source_file: BEGIN_CODE YEAR ## -## Ends in an error in state: 376. +## Ends in an error in state: 371. ## ## source_file_item -> BEGIN_CODE . code END_CODE [ LAW_TEXT LAW_HEADING EOF BEGIN_METADATA BEGIN_DIRECTIVE BEGIN_CODE ] ## diff --git a/compiler/surface/parser.mly b/compiler/surface/parser.mly index 4a3e9400..3378de7b 100644 --- a/compiler/surface/parser.mly +++ b/compiler/surface/parser.mly @@ -126,9 +126,6 @@ unit_literal: | MONTH { (Month, Pos.from_lpos $sloc) } | DAY { (Day, Pos.from_lpos $sloc) } -date_int: -| d = INT_LITERAL { (int_of_string d, Pos.from_lpos $sloc) } - literal: | l = num_literal u = option(unit_literal) { (LNumber (l, u), Pos.from_lpos $sloc) @@ -140,7 +137,8 @@ literal: money_amount_cents = cents; }, Pos.from_lpos $sloc) } -| VERTICAL y = date_int MINUS m = date_int MINUS d = date_int VERTICAL { +| VERTICAL d = DATE_LITERAL VERTICAL { + let (y,m,d) = d in (LDate { literal_date_year = y; literal_date_month = m; @@ -176,18 +174,18 @@ compare_op: aggregate_func: | CONTENT MAXIMUM t = typ_base INIT init = primitive_expression { - (Aggregate (AggregateArgExtremum (true, Pos.unmark t, init)), Pos.from_lpos $sloc) + (Aggregate (AggregateArgExtremum (true, Marked.unmark t, init)), Pos.from_lpos $sloc) } | CONTENT MINIMUM t = typ_base INIT init = primitive_expression { - (Aggregate (AggregateArgExtremum (false, Pos.unmark t, init)), Pos.from_lpos $sloc) + (Aggregate (AggregateArgExtremum (false, Marked.unmark t, init)), Pos.from_lpos $sloc) } | MAXIMUM t = typ_base INIT init = primitive_expression { - (Aggregate (AggregateExtremum (true, Pos.unmark t, init)), Pos.from_lpos $sloc) + (Aggregate (AggregateExtremum (true, Marked.unmark t, init)), Pos.from_lpos $sloc) } | MINIMUM t = typ_base INIT init = primitive_expression { - (Aggregate (AggregateExtremum (false, Pos.unmark t, init)), Pos.from_lpos $sloc) + (Aggregate (AggregateExtremum (false, Marked.unmark t, init)), Pos.from_lpos $sloc) } -| SUM t = typ_base { (Aggregate (AggregateSum (Pos.unmark t)), Pos.from_lpos $sloc) } +| SUM t = typ_base { (Aggregate (AggregateSum (Marked.unmark t)), Pos.from_lpos $sloc) } | CARDINAL { (Aggregate AggregateCount, Pos.from_lpos $sloc) } | FILTER { (Filter, Pos.from_lpos $sloc ) } | MAP { (Map, Pos.from_lpos $sloc) } @@ -207,8 +205,8 @@ base_expression: | e = primitive_expression WITH c = constructor_binding { (TestMatchCase (e, (c, Pos.from_lpos $sloc)), Pos.from_lpos $sloc) } -| e1 = primitive_expression IN e2 = base_expression { - (MemCollection (e1, e2), Pos.from_lpos $sloc) +| e1 = primitive_expression CONTAINS e2 = base_expression { + (MemCollection (e2, e1), Pos.from_lpos $sloc) } unop: @@ -379,7 +377,7 @@ rule: state = option(state) consequence = rule_consequence { let (name, param_applied) = name_and_param in - let cons : bool Pos.marked = consequence in + let cons : bool Marked.pos = consequence in let rule_exception = match except with | None -> NotAnException | Some x -> x in ({ rule_label = label; @@ -388,7 +386,7 @@ rule: rule_condition = cond; rule_name = name; rule_id = Desugared.Ast.RuleName.fresh - (String.concat "." (List.map (fun i -> Pos.unmark i) (Pos.unmark name)), + (String.concat "." (List.map (fun i -> Marked.unmark i) (Marked.unmark name)), Pos.from_lpos $sloc); rule_consequence = cons; rule_state = state; @@ -425,7 +423,7 @@ definition: definition_condition = cond; definition_id = Desugared.Ast.RuleName.fresh - (String.concat "." (List.map (fun i -> Pos.unmark i) (Pos.unmark name)), + (String.concat "." (List.map (fun i -> Marked.unmark i) (Marked.unmark name)), Pos.from_lpos $sloc); definition_expr = e; definition_state = state; diff --git a/compiler/surface/parser_driver.ml b/compiler/surface/parser_driver.ml index 9e319de9..2ef14d13 100644 --- a/compiler/surface/parser_driver.ml +++ b/compiler/surface/parser_driver.ml @@ -305,7 +305,9 @@ and expand_includes match command with | Ast.LawInclude (Ast.CatalaFile sub_source) -> let source_dir = Filename.dirname source_file in - let sub_source = Filename.concat source_dir (Pos.unmark sub_source) in + let sub_source = + Filename.concat source_dir (Marked.unmark sub_source) + in let includ_program = parse_source_file (FileName sub_source) language in { Ast.program_source_files = diff --git a/compiler/surface/tokens.mly b/compiler/surface/tokens.mly index 595cbaa8..e524edeb 100644 --- a/compiler/surface/tokens.mly +++ b/compiler/surface/tokens.mly @@ -32,12 +32,13 @@ %token CONSTRUCTOR IDENT %token END_CODE %token INT_LITERAL +%token DATE_LITERAL %token TRUE FALSE %token DECIMAL_LITERAL %token MONEY_AMOUNT %token BEGIN_CODE TEXT %token COLON ALT DATA VERTICAL -%token OF INTEGER COLLECTION +%token OF INTEGER COLLECTION CONTAINS %token RULE CONDITION DEFINED_AS %token LESSER GREATER LESSER_EQUAL GREATER_EQUAL %token LESSER_DEC GREATER_DEC LESSER_EQUAL_DEC GREATER_EQUAL_DEC diff --git a/compiler/utils/cli.ml b/compiler/utils/cli.ml index 9f52873a..5efcc913 100644 --- a/compiler/utils/cli.ml +++ b/compiler/utils/cli.ml @@ -94,18 +94,35 @@ let file = let debug = Arg.(value & flag & info ["debug"; "d"] ~doc:"Prints debug information.") +type when_enum = Auto | Always | Never + +let when_opt = Arg.enum ["auto", Auto; "always", Always; "never", Never] + +let color = + Arg.( + value + & opt ~vopt:Always when_opt Auto + & info ["color"] + ~doc: + "Allow output of colored and styled text. If set to $(i,auto), \ + enabled when the standard output is to a terminal.") + let unstyled = Arg.( - value & flag + value + & flag & info ["unstyled"; "u"] - ~doc:"Removes styling (colors, etc.) from terminal output.") + ~doc: + "Removes styling (colors, etc.) from terminal output. Equivalent to \ + $(b,--color=never)") let optimize = Arg.(value & flag & info ["optimize"; "O"] ~doc:"Run compiler optimizations.") let trace_opt = Arg.( - value & flag + value + & flag & info ["trace"; "t"] ~doc: "Displays a trace of the interpreter's computation or generates \ @@ -113,25 +130,29 @@ let trace_opt = let avoid_exceptions = Arg.( - value & flag + value + & flag & info ["avoid_exceptions"] ~doc:"Compiles the default calculus without exceptions") let closure_conversion = Arg.( - value & flag + value + & flag & info ["closure_conversion"] ~doc:"Performs closure conversion on the lambda calculus") let wrap_weaved_output = Arg.( - value & flag + value + & flag & info ["wrap"; "w"] ~doc:"Wraps literate programming output with a minimal preamble.") let print_only_law = Arg.( - value & flag + value + & flag & info ["print_only_law"] ~doc: "In literate programming output, skip all code and metadata sections \ @@ -174,7 +195,8 @@ let max_prec_digits_opt = let disable_counterexamples_opt = Arg.( - value & flag + value + & flag & info ["disable_counterexamples"] ~doc: @@ -200,7 +222,7 @@ let output = type options = { debug : bool; - unstyled : bool; + color : when_enum; wrap_weaved_output : bool; avoid_exceptions : bool; backend : string; @@ -219,6 +241,7 @@ type options = { let options = let make debug + color unstyled wrap_weaved_output avoid_exceptions @@ -235,7 +258,7 @@ let options = print_only_law : options = { debug; - unstyled; + color = (if unstyled then Never else color); wrap_weaved_output; avoid_exceptions; backend; @@ -252,16 +275,33 @@ let options = } in Term.( - const make $ debug $ unstyled $ wrap_weaved_output $ avoid_exceptions - $ closure_conversion $ backend $ plugins_dirs $ language - $ max_prec_digits_opt $ trace_opt $ disable_counterexamples_opt $ optimize - $ ex_scope $ output $ print_only_law) + const make + $ debug + $ color + $ unstyled + $ wrap_weaved_output + $ avoid_exceptions + $ closure_conversion + $ backend + $ plugins_dirs + $ language + $ max_prec_digits_opt + $ trace_opt + $ disable_counterexamples_opt + $ optimize + $ ex_scope + $ output + $ print_only_law) let catala_t f = Term.(const f $ file $ options) let set_option_globals options : unit = debug_flag := options.debug; - style_flag := not options.unstyled; + (style_flag := + match options.color with + | Always -> true + | Never -> false + | Auto -> Unix.isatty Unix.stdout); trace_flag := options.trace; optimize_flag := options.optimize; disable_counterexamples := options.disable_counterexamples; @@ -361,6 +401,13 @@ let format_with_style (styles : ANSITerminal.style list) fmt (str : string) = (ANSITerminal.sprintf styles "%s" str) else Format.pp_print_string fmt str +let call_unstyled f = + let prev = !style_flag in + style_flag := false; + let res = f () in + style_flag := prev; + res + let time_marker () = let new_time = Unix.gettimeofday () in let old_time = !time in @@ -405,7 +452,9 @@ let concat_with_line_depending_prefix_and_suffix let out, _ = List.fold_left (fun (acc, i) s -> - ( (acc ^ prefix i ^ s + ( (acc + ^ prefix i + ^ s ^ if i = List.length ss - 1 then "" else suffix i), i + 1 )) ((prefix 0 ^ hd ^ if 0 = List.length ss - 1 then "" else suffix 0), 1) diff --git a/compiler/utils/cli.mli b/compiler/utils/cli.mli index 9b127873..50ee3763 100644 --- a/compiler/utils/cli.mli +++ b/compiler/utils/cli.mli @@ -81,9 +81,12 @@ val max_prec_digits_opt : int option Cmdliner.Term.t val ex_scope : string option Cmdliner.Term.t val output : string option Cmdliner.Term.t +(** The usual auto/always/never option argument *) +type when_enum = Auto | Always | Never + type options = { debug : bool; - unstyled : bool; + color : when_enum; wrap_weaved_output : bool; avoid_exceptions : bool; backend : string; @@ -118,6 +121,10 @@ val with_style : ANSITerminal.style list -> ('a, unit, string) format -> 'a val format_with_style : ANSITerminal.style list -> Format.formatter -> string -> unit +val call_unstyled : (unit -> 'a) -> 'a +(** [call_unstyled f] calls the function [f] with the [style_flag] set to false + during the execution. *) + val debug_marker : unit -> string val error_marker : unit -> string val warning_marker : unit -> string diff --git a/compiler/utils/dune b/compiler/utils/dune index 2d1789a0..ccda381f 100644 --- a/compiler/utils/dune +++ b/compiler/utils/dune @@ -1,7 +1,7 @@ (library (name utils) (public_name catala.utils) - (libraries cmdliner ANSITerminal re)) + (libraries cmdliner ubase ANSITerminal re)) (documentation (package catala) diff --git a/compiler/utils/file.ml b/compiler/utils/file.ml index ff57c1bb..4f53f486 100644 --- a/compiler/utils/file.ml +++ b/compiler/utils/file.ml @@ -45,3 +45,18 @@ let with_formatter_of_opt_file filename_opt f = match filename_opt with | None -> finally (fun () -> flush stdout) (fun () -> f Format.std_formatter) | Some filename -> with_formatter_of_file filename f + +let get_out_channel ~source_file ~output_file ?ext () = + match output_file, ext with + | Some "-", _ | None, None -> None, fun f -> f stdout + | Some f, _ -> Some f, with_out_channel f + | None, Some ext -> + let src = + match source_file with Pos.FileName f -> f | Pos.Contents _ -> "a" + in + let f = Filename.remove_extension src ^ ext in + Some f, with_out_channel f + +let get_formatter_of_out_channel ~source_file ~output_file ?ext () = + let f, with_ = get_out_channel ~source_file ~output_file ?ext () in + f, fun fmt -> with_ (fun oc -> with_formatter_of_out_channel oc fmt) diff --git a/compiler/utils/file.mli b/compiler/utils/file.mli index 70e94b6d..270bc535 100644 --- a/compiler/utils/file.mli +++ b/compiler/utils/file.mli @@ -40,3 +40,23 @@ val with_formatter_of_opt_file : string option -> (Format.formatter -> 'a) -> 'a (** [with_formatter_of_opt_file filename_opt f] manages the formatter created from the file [filename_opt] if there is some (see {!with_formatter_of_file}), otherwise, uses the [Format.std_formatter]. *) + +val get_out_channel : + source_file:Pos.input_file -> + output_file:string option -> + ?ext:string -> + unit -> + string option * ((out_channel -> 'a) -> 'a) +(** [get_output ~source_file ~output_file ?ext ()] returns the infered filename + and its corresponding [with_out_channel] function. If the [output_file] is + equal to [Some "-"] returns a wrapper around [stdout]. *) + +val get_formatter_of_out_channel : + source_file:Pos.input_file -> + output_file:string option -> + ?ext:string -> + unit -> + string option * ((Format.formatter -> 'a) -> 'a) +(** [get_output_format ~source_file ~output_file ?ext ()] returns the infered + filename and its corresponding [with_formatter_of_out_channel] function. If + the [output_file] is equal to [Some "-"] returns a wrapper around [stdout]. *) diff --git a/compiler/utils/marked.ml b/compiler/utils/marked.ml new file mode 100644 index 00000000..d08b7890 --- /dev/null +++ b/compiler/utils/marked.ml @@ -0,0 +1,78 @@ +(* This file is part of the Catala compiler, a specification language for tax + and social benefits computation rules. Copyright (C) 2020 Inria, + contributors: Denis Merigoux , Louis Gesbert + + + Licensed under the Apache License, Version 2.0 (the "License"); you may not + use this file except in compliance with the License. You may obtain a copy of + the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + License for the specific language governing permissions and limitations under + the License. *) + +type ('a, 'm) t = 'a * 'm +type 'a pos = ('a, Pos.t) t + +let mark m e : ('a, 'm) t = e, m +let unmark ((x, _) : ('a, 'm) t) : 'a = x +let get_mark ((_, x) : ('a, 'm) t) : 'm = x +let map_under_mark (f : 'a -> 'b) ((x, y) : ('a, 'm) t) : ('b, 'c) t = f x, y +let same_mark_as (x : 'a) ((_, y) : ('b, 'm) t) : ('a, 'm) t = x, y + +let unmark_option (x : ('a, 'm) t option) : 'a option = + match x with Some x -> Some (unmark x) | None -> None + +let compare (cmp : 'a -> 'a -> int) ((x, _) : ('a, 'm) t) ((y, _) : ('a, 'm) t) + : int = + cmp x y + +class ['self] marked_map = + object (_self : 'self) + constraint + 'self = < visit_marked : + 'a. ('env -> 'a -> 'a) -> 'env -> ('a, 'm) t -> ('a, 'm) t + ; .. > + + method visit_marked + : 'a. ('env -> 'a -> 'a) -> 'env -> ('a, 'm) t -> ('a, 'm) t = + fun f env x -> same_mark_as (f env (unmark x)) x + end + +class ['self] marked_iter = + object (_self : 'self) + constraint + 'self = < visit_marked : + 'a. ('env -> 'a -> unit) -> 'env -> ('a, 'm) t -> unit + ; .. > + + method visit_marked : 'a. ('env -> 'a -> unit) -> 'env -> ('a, 'm) t -> unit + = + fun f env x -> f env (unmark x) + end + +class ['self] pos_map = + object (_self : 'self) + constraint + 'self = < visit_pos : + 'a. ('env -> 'a -> 'a) -> 'env -> ('a, 'm) t -> ('a, 'm) t + ; .. > + + method visit_pos + : 'a. ('env -> 'a -> 'a) -> 'env -> ('a, 'm) t -> ('a, 'm) t = + fun f env x -> same_mark_as (f env (unmark x)) x + end + +class ['self] pos_iter = + object (_self : 'self) + constraint + 'self = < visit_pos : 'a. ('env -> 'a -> unit) -> 'env -> ('a, 'm) t -> unit + ; .. > + + method visit_pos : 'a. ('env -> 'a -> unit) -> 'env -> ('a, 'm) t -> unit = + fun f env x -> f env (unmark x) + end diff --git a/compiler/utils/marked.mli b/compiler/utils/marked.mli new file mode 100644 index 00000000..03552460 --- /dev/null +++ b/compiler/utils/marked.mli @@ -0,0 +1,78 @@ +(* This file is part of the Catala compiler, a specification language for tax + and social benefits computation rules. Copyright (C) 2020 Inria, + contributors: Denis Merigoux , Louis Gesbert + + + Licensed under the Apache License, Version 2.0 (the "License"); you may not + use this file except in compliance with the License. You may obtain a copy of + the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + License for the specific language governing permissions and limitations under + the License. *) + +(** AST node annotations (used for position, type, etc.) *) + +type ('a, 'm) t = 'a * 'm +(** Everything related to the source code should keep at least its position + stored, to improve error messages *) + +type 'a pos = ('a, Pos.t) t +(** The type of marks containing only position information *) + +val mark : 'm -> 'a -> ('a, 'm) t +val unmark : ('a, 'm) t -> 'a +val get_mark : ('a, 'm) t -> 'm +val map_under_mark : ('a -> 'b) -> ('a, 'm) t -> ('b, 'm) t +val same_mark_as : 'a -> ('b, 'm) t -> ('a, 'm) t +val unmark_option : ('a, 'm) t option -> 'a option + +val compare : ('a -> 'a -> int) -> ('a, 'm) t -> ('a, 'm) t -> int +(** Compares two marked values {b ignoring positions} *) + +(** Visitors *) + +class ['self] marked_map : + object ('self) + constraint + 'self = < visit_marked : + 'a. ('env -> 'a -> 'a) -> 'env -> ('a, 'm) t -> ('a, 'm) t + ; .. > + + method visit_marked : + 'a. ('env -> 'a -> 'a) -> 'env -> ('a, 'm) t -> ('a, 'm) t + end + +class ['self] marked_iter : + object ('self) + constraint + 'self = < visit_marked : + 'a. ('env -> 'a -> unit) -> 'env -> ('a, 'm) t -> unit + ; .. > + + method visit_marked : 'a. ('env -> 'a -> unit) -> 'env -> ('a, 'm) t -> unit + end + +class ['self] pos_map : + object ('self) + constraint + 'self = < visit_pos : + 'a. ('env -> 'a -> 'a) -> 'env -> ('a, 'm) t -> ('a, 'm) t + ; .. > + + method visit_pos : + 'a. ('env -> 'a -> 'a) -> 'env -> ('a, 'm) t -> ('a, 'm) t + end + +class ['self] pos_iter : + object ('self) + constraint + 'self = < visit_pos : 'a. ('env -> 'a -> unit) -> 'env -> ('a, 'm) t -> unit + ; .. > + + method visit_pos : 'a. ('env -> 'a -> unit) -> 'env -> ('a, 'm) t -> unit + end diff --git a/compiler/utils/pos.ml b/compiler/utils/pos.ml index 9a682ea2..bb89c933 100644 --- a/compiler/utils/pos.ml +++ b/compiler/utils/pos.ml @@ -203,8 +203,6 @@ let retrieve_loc_text (pos : t) : string = else Cli.with_style blue_style "%*s+-+ " (spaces + (2 * i) - 1) "")) with Sys_error _ -> "Location:" ^ to_string pos -type 'a marked = 'a * t - let no_pos : t = let zero_pos = { @@ -215,42 +213,3 @@ let no_pos : t = } in { code_pos = zero_pos, zero_pos; law_pos = [] } - -let mark pos e : 'a marked = e, pos -let unmark ((x, _) : 'a marked) : 'a = x -let get_position ((_, x) : 'a marked) : t = x -let map_under_mark (f : 'a -> 'b) ((x, y) : 'a marked) : 'b marked = f x, y -let same_pos_as (x : 'a) ((_, y) : 'b marked) : 'a marked = x, y - -let compare_marked - (cmp : 'a -> 'a -> int) - ((x, _) : 'a marked) - ((y, _) : 'a marked) : int = - cmp x y - -let unmark_option (x : 'a marked option) : 'a option = - match x with Some x -> Some (unmark x) | None -> None - -class ['self] marked_map = - object (_self : 'self) - constraint - 'self = < visit_marked : - 'a. ('env -> 'a -> 'a) -> 'env -> 'a marked -> 'a marked - ; .. > - - method visit_marked - : 'a. ('env -> 'a -> 'a) -> 'env -> 'a marked -> 'a marked = - fun f env x -> same_pos_as (f env (unmark x)) x - end - -class ['self] marked_iter = - object (_self : 'self) - constraint - 'self = < visit_marked : - 'a. ('env -> 'a -> unit) -> 'env -> 'a marked -> unit - ; .. > - - method visit_marked : 'a. ('env -> 'a -> unit) -> 'env -> 'a marked -> unit - = - fun f env x -> f env (unmark x) - end diff --git a/compiler/utils/pos.mli b/compiler/utils/pos.mli index dad08092..9d8dec08 100644 --- a/compiler/utils/pos.mli +++ b/compiler/utils/pos.mli @@ -20,8 +20,6 @@ type t (** A position in the source code is a file, as well as begin and end location of the form col:line *) -(** Custom visitor for the [Pos.marked] type *) - (**{2 Constructor and getters}*) val from_lpos : Lexing.position * Lexing.position -> t @@ -52,44 +50,5 @@ val retrieve_loc_text : t -> string (** Open the file corresponding to the position and retrieves the text concerned by the position *) -(**{2 AST markings}*) - -type 'a marked = 'a * t -(** Everything related to the source code should keep its position stored, to - improve error messages *) - val no_pos : t (** Placeholder position *) - -val mark : t -> 'a -> 'a marked -val unmark : 'a marked -> 'a -val get_position : 'a marked -> t -val map_under_mark : ('a -> 'b) -> 'a marked -> 'b marked -val same_pos_as : 'a -> 'b marked -> 'a marked -val unmark_option : 'a marked option -> 'a option - -val compare_marked : ('a -> 'a -> int) -> 'a marked -> 'a marked -> int -(** Compares two marked values {b ignoring positions} *) - -(** Visitors *) - -class ['self] marked_map : - object ('self) - constraint - 'self = < visit_marked : - 'a. ('env -> 'a -> 'a) -> 'env -> 'a marked -> 'a marked - ; .. > - - method visit_marked : - 'a. ('env -> 'a -> 'a) -> 'env -> 'a marked -> 'a marked - end - -class ['self] marked_iter : - object ('self) - constraint - 'self = < visit_marked : - 'a. ('env -> 'a -> unit) -> 'env -> 'a marked -> unit - ; .. > - - method visit_marked : 'a. ('env -> 'a -> unit) -> 'env -> 'a marked -> unit - end diff --git a/compiler/utils/string_common.ml b/compiler/utils/string_common.ml new file mode 100644 index 00000000..747f030f --- /dev/null +++ b/compiler/utils/string_common.ml @@ -0,0 +1,52 @@ +(* This file is part of the Catala compiler, a specification language for tax + and social benefits computation rules. Copyright (C) 2020 Inria, contributor: + Denis Merigoux , Emile Rolley + + Licensed under the Apache License, Version 2.0 (the "License"); you may not + use this file except in compliance with the License. You may obtain a copy of + the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + License for the specific language governing permissions and limitations under + the License. *) + +let to_ascii : string -> string = Ubase.from_utf8 + +let is_uppercase_ascii (c : char) : bool = + let c = Char.code c in + (* 'A' <= c && c <= 'Z' *) + 0x41 <= c && c <= 0x5b + +let begins_with_uppercase (s : string) : bool = + if "" = s then false else is_uppercase_ascii (to_ascii s).[0] + +let to_snake_case (s : string) : string = + let out = ref "" in + to_ascii s + |> String.iteri (fun i c -> + out := + !out + ^ (if is_uppercase_ascii c && 0 <> i then "_" else "") + ^ String.lowercase_ascii (String.make 1 c)); + !out + +let to_camel_case (s : string) : string = + let last_was_underscore = ref false in + let out = ref "" in + to_ascii s + |> String.iteri (fun i c -> + let is_underscore = c = '_' in + let c_string = String.make 1 c in + out := + !out + ^ + if is_underscore then "" + else if !last_was_underscore || 0 = i then + String.uppercase_ascii c_string + else c_string; + last_was_underscore := is_underscore); + !out diff --git a/compiler/utils/string_common.mli b/compiler/utils/string_common.mli new file mode 100644 index 00000000..07bdc521 --- /dev/null +++ b/compiler/utils/string_common.mli @@ -0,0 +1,36 @@ +(* This file is part of the Catala compiler, a specification language for tax + and social benefits computation rules. Copyright (C) 2020 Inria, contributor: + Denis Merigoux , Emile Rolley + + Licensed under the Apache License, Version 2.0 (the "License"); you may not + use this file except in compliance with the License. You may obtain a copy of + the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + License for the specific language governing permissions and limitations under + the License. *) + +(** Helper functions used for string manipulation. *) + +val to_ascii : string -> string +(** Removes all non-ASCII diacritics from a string by converting them to their + base letter in the Latin alphabet. *) + +val is_uppercase_ascii : char -> bool +(** [is_uppercase c] returns if [c] is in the set ['A'...'Z']. *) + +val begins_with_uppercase : string -> bool +(** [begins_with_uppercase s] returns if the first letter of [s] + {!is_uppercase_ascii}. If [s] is empty returns false. *) + +val to_snake_case : string -> string +(** Converts CamlCase into snake_case after removing Remove all diacritics on + Latin letters. *) + +val to_camel_case : string -> string +(** Converts snake_case into CamlCase after removing Remove all diacritics on + Latin letters. *) diff --git a/compiler/utils/uid.ml b/compiler/utils/uid.ml index 60577ab1..58ffbfe8 100644 --- a/compiler/utils/uid.ml +++ b/compiler/utils/uid.ml @@ -51,7 +51,7 @@ module Make (X : Info) () : Id with type info = X.info = struct end module MarkedString = struct - type info = string Pos.marked + type info = string Marked.pos let format_info fmt (s, _) = Format.fprintf fmt "%s" s end diff --git a/compiler/utils/uid.mli b/compiler/utils/uid.mli index f7d9bc8f..8fb0a091 100644 --- a/compiler/utils/uid.mli +++ b/compiler/utils/uid.mli @@ -23,7 +23,7 @@ module type Info = sig val format_info : Format.formatter -> info -> unit end -module MarkedString : Info with type info = string Pos.marked +module MarkedString : Info with type info = string Marked.pos (** The only kind of information carried in Catala identifiers is the original string of the identifier annotated with the position where it is declared or used. *) diff --git a/compiler/utils/utils.mld b/compiler/utils/utils.mld index 3fbf7d4a..17fb6c01 100644 --- a/compiler/utils/utils.mld +++ b/compiler/utils/utils.mld @@ -37,8 +37,8 @@ Related modules: {!modules: Utils.Errors} -{1 File utilities} +{1 Other utilies} Related modules: -{!modules: Utils.File} +{!modules: Utils.File Utils.String_common} diff --git a/compiler/verification/conditions.ml b/compiler/verification/conditions.ml index 870bce15..9b2bf338 100644 --- a/compiler/verification/conditions.ml +++ b/compiler/verification/conditions.ml @@ -21,7 +21,7 @@ open Ast (** {1 Helpers and type definitions}*) -type vc_return = expr Pos.marked * typ Pos.marked VarMap.t +type vc_return = typed marked_expr * typ Marked.pos VarMap.t (** The return type of VC generators is the VC expression plus the types of any locally free variable inside that expression. *) @@ -29,33 +29,33 @@ type ctx = { current_scope_name : ScopeName.t; decl : decl_ctx; input_vars : Var.t list; - scope_variables_typs : typ Pos.marked VarMap.t; + scope_variables_typs : typ Marked.pos VarMap.t; } -let conjunction (args : vc_return list) (pos : Pos.t) : vc_return = +let conjunction (args : vc_return list) (mark : typed mark) : vc_return = let acc, list = match args with | hd :: tl -> hd, tl - | [] -> ((ELit (LBool true), pos), VarMap.empty), [] + | [] -> ((ELit (LBool true), mark), VarMap.empty), [] in List.fold_left (fun (acc, acc_ty) (arg, arg_ty) -> - ( (EApp ((EOp (Binop And), pos), [arg; acc]), pos), + ( (EApp ((EOp (Binop And), mark), [arg; acc]), mark), VarMap.union (fun _ _ _ -> failwith "should not happen") acc_ty arg_ty )) acc list -let negation ((arg, arg_ty) : vc_return) (pos : Pos.t) : vc_return = - (EApp ((EOp (Unop Not), pos), [arg]), pos), arg_ty +let negation ((arg, arg_ty) : vc_return) (mark : typed mark) : vc_return = + (EApp ((EOp (Unop Not), mark), [arg]), mark), arg_ty -let disjunction (args : vc_return list) (pos : Pos.t) : vc_return = +let disjunction (args : vc_return list) (mark : typed mark) : vc_return = let acc, list = match args with | hd :: tl -> hd, tl - | [] -> ((ELit (LBool false), pos), VarMap.empty), [] + | [] -> ((ELit (LBool false), mark), VarMap.empty), [] in List.fold_left (fun ((acc, acc_ty) : vc_return) (arg, arg_ty) -> - ( (EApp ((EOp (Binop Or), pos), [arg; acc]), pos), + ( (EApp ((EOp (Binop Or), mark), [arg; acc]), mark), VarMap.union (fun _ _ _ -> failwith "should not happen") acc_ty arg_ty )) acc list @@ -71,26 +71,26 @@ let half_product (l1 : 'a list) (l2 : 'b list) : ('a * 'b) list = variables, or [fun () -> e1] for subscope variables. But what we really want to analyze is only [e1], so we match this outermost structure explicitely and have a clean verification condition generator that only runs on [e1] *) -let match_and_ignore_outer_reentrant_default (ctx : ctx) (e : expr Pos.marked) : - expr Pos.marked = - match Pos.unmark e with +let match_and_ignore_outer_reentrant_default (ctx : ctx) (e : typed marked_expr) + : typed marked_expr = + match Marked.unmark e with | ErrorOnEmpty ( EDefault - ( [(EApp ((EVar (x, _), _), [(ELit LUnit, _)]), _)], + ( [(EApp ((EVar x, _), [(ELit LUnit, _)]), _)], (ELit (LBool true), _), cons ), _ ) - when List.exists (fun x' -> Bindlib.eq_vars x x') ctx.input_vars -> + when List.exists (fun x' -> Var.eq (Var.t x) x') ctx.input_vars -> (* scope variables*) cons - | EAbs ((binder, _), [(TLit TUnit, _)]) -> + | EAbs (binder, [(TLit TUnit, _)]) -> (* context sub-scope variables *) let _, body = Bindlib.unmbind binder in body | ErrorOnEmpty d -> d (* input subscope variables and non-input scope variable *) | _ -> - Errors.raise_spanned_error (Pos.get_position e) + Errors.raise_spanned_error (pos e) "Internal error: this expression does not have the structure expected by \ the VC generator:\n\ %a" @@ -103,18 +103,18 @@ let match_and_ignore_outer_reentrant_default (ctx : ctx) (e : expr Pos.marked) : [b] such that if [b] is true, then [e] will never return an empty error. It also returns a map of all the types of locally free variables inside the expression. *) -let rec generate_vc_must_not_return_empty (ctx : ctx) (e : expr Pos.marked) : +let rec generate_vc_must_not_return_empty (ctx : ctx) (e : typed marked_expr) : vc_return = let out = - match Pos.unmark e with + match Marked.unmark e with | ETuple (args, _) | EArray args -> conjunction (List.map (generate_vc_must_not_return_empty ctx) args) - (Pos.get_position e) + (Marked.get_mark e) | EMatch (arg, arms, _) -> conjunction (List.map (generate_vc_must_not_return_empty ctx) (arg :: arms)) - (Pos.get_position e) + (Marked.get_mark e) | ETupleAccess (e1, _, _, _) | EInj (e1, _, _, _) | EAssert e1 @@ -124,13 +124,13 @@ let rec generate_vc_must_not_return_empty (ctx : ctx) (e : expr Pos.marked) : (* Hot take: for a function never to return an empty error when called, it has to do so whatever its input. So we universally quantify over the variable of the function when inspecting the body, resulting in simply traversing through in the code here. *) - let vars, body = Bindlib.unmbind (Pos.unmark binder) in + let vars, body = Bindlib.unmbind binder in let vc_body_expr, vc_body_ty = (generate_vc_must_not_return_empty ctx) body in ( vc_body_expr, List.fold_left - (fun acc (var, ty) -> VarMap.add var ty acc) + (fun acc (var, ty) -> VarMap.add (Var.t var) ty acc) vc_body_ty (List.map2 (fun x y -> x, y) (Array.to_list vars) typs) ) | EApp (f, args) -> @@ -138,7 +138,7 @@ let rec generate_vc_must_not_return_empty (ctx : ctx) (e : expr Pos.marked) : all functions have been checked never to return empty errors. *) conjunction (List.map (generate_vc_must_not_return_empty ctx) (f :: args)) - (Pos.get_position e) + (Marked.get_mark e) | EIfThenElse (e1, e2, e3) -> let e1_vc, vc_typ1 = generate_vc_must_not_return_empty ctx e1 in let e2_vc, vc_typ2 = generate_vc_must_not_return_empty ctx e2 in @@ -146,18 +146,19 @@ let rec generate_vc_must_not_return_empty (ctx : ctx) (e : expr Pos.marked) : conjunction [ e1_vc, vc_typ1; - ( (EIfThenElse (e1, e2_vc, e3_vc), Pos.get_position e), + ( (EIfThenElse (e1, e2_vc, e3_vc), Marked.get_mark e), VarMap.union (fun _ _ _ -> failwith "should not happen") vc_typ2 vc_typ3 ); ] - (Pos.get_position e) - | ELit LEmptyError -> Pos.same_pos_as (ELit (LBool false)) e, VarMap.empty + (Marked.get_mark e) + | ELit LEmptyError -> + Marked.same_mark_as (ELit (LBool false)) e, VarMap.empty | EVar _ (* Per default calculus semantics, you cannot call a function with an argument that evaluates to the empty error. Thus, all variable evaluate to non-empty-error terms. *) | ELit _ | EOp _ -> - Pos.same_pos_as (ELit (LBool true)) e, VarMap.empty + Marked.same_mark_as (ELit (LBool true)) e, VarMap.empty | EDefault (exceptions, just, cons) -> (* never returns empty if and only if: - first we look if e1 .. en ejust can return empty; @@ -181,13 +182,13 @@ let rec generate_vc_must_not_return_empty (ctx : ctx) (e : expr Pos.marked) : surface language to intermediate representation translation preventing any default terms to appear in justifications.*) vc_just_expr, - (ELit (LBool false), Pos.get_position e) ), - Pos.get_position e ), + (ELit (LBool false), Marked.get_mark e) ), + Marked.get_mark e ), vc_just_ty )); ] - (Pos.get_position e); + (Marked.get_mark e); ]) - (Pos.get_position e) + (Marked.get_mark e) in out [@@ocamlformat "wrap-comments=false"] @@ -196,39 +197,39 @@ let rec generate_vc_must_not_return_empty (ctx : ctx) (e : expr Pos.marked) : [b] such that if [b] is true, then [e] will never return a conflict error. It also returns a map of all the types of locally free variables inside the expression. *) -let rec generate_vs_must_not_return_confict (ctx : ctx) (e : expr Pos.marked) : - vc_return = +let rec generate_vs_must_not_return_confict (ctx : ctx) (e : typed marked_expr) + : vc_return = let out = (* See the code of [generate_vc_must_not_return_empty] for a list of invariants on which this function relies on. *) - match Pos.unmark e with + match Marked.unmark e with | ETuple (args, _) | EArray args -> conjunction (List.map (generate_vs_must_not_return_confict ctx) args) - (Pos.get_position e) + (Marked.get_mark e) | EMatch (arg, arms, _) -> conjunction (List.map (generate_vs_must_not_return_confict ctx) (arg :: arms)) - (Pos.get_position e) + (Marked.get_mark e) | ETupleAccess (e1, _, _, _) | EInj (e1, _, _, _) | EAssert e1 | ErrorOnEmpty e1 -> generate_vs_must_not_return_confict ctx e1 | EAbs (binder, typs) -> - let vars, body = Bindlib.unmbind (Pos.unmark binder) in + let vars, body = Bindlib.unmbind binder in let vc_body_expr, vc_body_ty = (generate_vs_must_not_return_confict ctx) body in ( vc_body_expr, List.fold_left - (fun acc (var, ty) -> VarMap.add var ty acc) + (fun acc (var, ty) -> VarMap.add (Var.t var) ty acc) vc_body_ty (List.map2 (fun x y -> x, y) (Array.to_list vars) typs) ) | EApp (f, args) -> conjunction (List.map (generate_vs_must_not_return_confict ctx) (f :: args)) - (Pos.get_position e) + (Marked.get_mark e) | EIfThenElse (e1, e2, e3) -> let e1_vc, vc_typ1 = generate_vs_must_not_return_confict ctx e1 in let e2_vc, vc_typ2 = generate_vs_must_not_return_confict ctx e2 in @@ -236,14 +237,14 @@ let rec generate_vs_must_not_return_confict (ctx : ctx) (e : expr Pos.marked) : conjunction [ e1_vc, vc_typ1; - ( (EIfThenElse (e1, e2_vc, e3_vc), Pos.get_position e), + ( (EIfThenElse (e1, e2_vc, e3_vc), Marked.get_mark e), VarMap.union (fun _ _ _ -> failwith "should not happen") vc_typ2 vc_typ3 ); ] - (Pos.get_position e) + (Marked.get_mark e) | EVar _ | ELit _ | EOp _ -> - Pos.same_pos_as (ELit (LBool true)) e, VarMap.empty + Marked.same_mark_as (ELit (LBool true)) e, VarMap.empty | EDefault (exceptions, just, cons) -> (* never returns conflict if and only if: - neither e1 nor ... nor en nor ejust nor econs return conflict @@ -258,17 +259,17 @@ let rec generate_vs_must_not_return_confict (ctx : ctx) (e : expr Pos.marked) : generate_vc_must_not_return_empty ctx e1; generate_vc_must_not_return_empty ctx e2; ] - (Pos.get_position e)) + (Marked.get_mark e)) (half_product exceptions exceptions)) - (Pos.get_position e)) - (Pos.get_position e) + (Marked.get_mark e)) + (Marked.get_mark e) in let others = List.map (generate_vs_must_not_return_confict ctx) (just :: cons :: exceptions) in - let out = conjunction (quadratic :: others) (Pos.get_position e) in + let out = conjunction (quadratic :: others) (Marked.get_mark e) in out in out @@ -279,18 +280,18 @@ let rec generate_vs_must_not_return_confict (ctx : ctx) (e : expr Pos.marked) : type verification_condition_kind = NoEmptyError | NoOverlappingExceptions type verification_condition = { - vc_guard : expr Pos.marked; + vc_guard : typed marked_expr; (* should have type bool *) vc_kind : verification_condition_kind; vc_scope : ScopeName.t; - vc_variable : Var.t Pos.marked; - vc_free_vars_typ : typ Pos.marked VarMap.t; + vc_variable : Var.t Marked.pos; + vc_free_vars_typ : typ Marked.pos VarMap.t; } let rec generate_verification_conditions_scope_body_expr (ctx : ctx) - (scope_body_expr : expr scope_body_expr) : ctx * verification_condition list - = + (scope_body_expr : ('m expr, 'm) scope_body_expr) : + ctx * verification_condition list = match scope_body_expr with | Result _ -> ctx, [] | ScopeLet scope_let -> @@ -300,7 +301,7 @@ let rec generate_verification_conditions_scope_body_expr let new_ctx, vc_list = match scope_let.scope_let_kind with | DestructuringInputStruct -> - { ctx with input_vars = scope_let_var :: ctx.input_vars }, [] + { ctx with input_vars = Var.t scope_let_var :: ctx.input_vars }, [] | ScopeVarDefinition | SubScopeVarDefinition -> (* For scope variables, we should check both that they never evaluate to emptyError nor conflictError. But for subscope variable definitions, @@ -320,14 +321,14 @@ let rec generate_verification_conditions_scope_body_expr let vc_list = [ { - vc_guard = Pos.same_pos_as (Pos.unmark vc_confl) e; + vc_guard = Marked.same_mark_as (Marked.unmark vc_confl) e; vc_kind = NoOverlappingExceptions; vc_free_vars_typ = VarMap.union (fun _ _ -> failwith "should not happen") ctx.scope_variables_typs vc_confl_typs; vc_scope = ctx.current_scope_name; - vc_variable = scope_let_var, scope_let.scope_let_pos; + vc_variable = Var.t scope_let_var, scope_let.scope_let_pos; }; ] in @@ -343,14 +344,14 @@ let rec generate_verification_conditions_scope_body_expr else vc_empty in { - vc_guard = Pos.same_pos_as (Pos.unmark vc_empty) e; + vc_guard = Marked.same_mark_as (Marked.unmark vc_empty) e; vc_kind = NoEmptyError; vc_free_vars_typ = VarMap.union (fun _ _ -> failwith "should not happen") ctx.scope_variables_typs vc_empty_typs; vc_scope = ctx.current_scope_name; - vc_variable = scope_let_var, scope_let.scope_let_pos; + vc_variable = Var.t scope_let_var, scope_let.scope_let_pos; } :: vc_list | _ -> vc_list @@ -363,7 +364,7 @@ let rec generate_verification_conditions_scope_body_expr { new_ctx with scope_variables_typs = - VarMap.add scope_let_var scope_let.scope_let_typ + VarMap.add (Var.t scope_let_var) scope_let.scope_let_typ new_ctx.scope_variables_typs; } scope_let_next @@ -372,7 +373,7 @@ let rec generate_verification_conditions_scope_body_expr let rec generate_verification_conditions_scopes (decl_ctx : decl_ctx) - (scopes : expr scopes) + (scopes : ('m expr, 'm) scopes) (s : ScopeName.t option) : verification_condition list = match scopes with | Nil -> [] @@ -412,7 +413,7 @@ let rec generate_verification_conditions_scopes generate_verification_conditions_scopes decl_ctx next s @ vcs let generate_verification_conditions - (p : program) + (p : 'm program) (s : Dcalc.Ast.ScopeName.t option) : verification_condition list = let vcs = generate_verification_conditions_scopes p.decl_ctx p.scopes s in (* We sort this list by scope name and then variable name to ensure consistent @@ -422,7 +423,7 @@ let generate_verification_conditions let to_str vc = Format.asprintf "%s.%s" (Format.asprintf "%a" ScopeName.format_t vc.vc_scope) - (Bindlib.name_of (Pos.unmark vc.vc_variable)) + (Bindlib.name_of (Var.get (Marked.unmark vc.vc_variable))) in String.compare (to_str vc1) (to_str vc2)) vcs diff --git a/compiler/verification/conditions.mli b/compiler/verification/conditions.mli index 9be9e4ac..cd39ddbe 100644 --- a/compiler/verification/conditions.mli +++ b/compiler/verification/conditions.mli @@ -26,19 +26,19 @@ type verification_condition_kind = a conflict error *) type verification_condition = { - vc_guard : Dcalc.Ast.expr Utils.Pos.marked; + vc_guard : Dcalc.Ast.typed Dcalc.Ast.marked_expr; (** This expression should have type [bool]*) vc_kind : verification_condition_kind; vc_scope : Dcalc.Ast.ScopeName.t; - vc_variable : Dcalc.Ast.Var.t Utils.Pos.marked; - vc_free_vars_typ : Dcalc.Ast.typ Utils.Pos.marked Dcalc.Ast.VarMap.t; + vc_variable : Dcalc.Ast.Var.t Utils.Marked.pos; + vc_free_vars_typ : Dcalc.Ast.typ Utils.Marked.pos Dcalc.Ast.VarMap.t; (** Types of the locally free variables in [vc_guard]. The types of other free variables linked to scope variables can be obtained with [Dcalc.Ast.variable_types]. *) } val generate_verification_conditions : - Dcalc.Ast.program -> + Dcalc.Ast.typed Dcalc.Ast.program -> Dcalc.Ast.ScopeName.t option -> verification_condition list (** [generate_verification_conditions p None] will generate the verification diff --git a/compiler/verification/dune b/compiler/verification/dune index 0584a6c2..37df5b9a 100644 --- a/compiler/verification/dune +++ b/compiler/verification/dune @@ -5,8 +5,8 @@ bindlib utils dcalc - runtime - calendar + catala.runtime_ocaml + dates_calc (select z3backend.ml from diff --git a/compiler/verification/io.ml b/compiler/verification/io.ml index ca845d79..adeda41c 100644 --- a/compiler/verification/io.ml +++ b/compiler/verification/io.ml @@ -23,7 +23,7 @@ module type Backend = sig type backend_context - val make_context : decl_ctx -> typ Pos.marked VarMap.t -> backend_context + val make_context : decl_ctx -> typ Marked.pos VarMap.t -> backend_context type vc_encoding @@ -37,9 +37,7 @@ module type Backend = sig val is_model_empty : model -> bool val translate_expr : - backend_context -> - Dcalc.Ast.expr Utils.Pos.marked -> - backend_context * vc_encoding + backend_context -> 'm Dcalc.Ast.marked_expr -> backend_context * vc_encoding end module type BackendIO = sig @@ -47,14 +45,12 @@ module type BackendIO = sig type backend_context - val make_context : decl_ctx -> typ Pos.marked VarMap.t -> backend_context + val make_context : decl_ctx -> typ Marked.pos VarMap.t -> backend_context type vc_encoding val translate_expr : - backend_context -> - Dcalc.Ast.expr Utils.Pos.marked -> - backend_context * vc_encoding + backend_context -> 'm Dcalc.Ast.marked_expr -> backend_context * vc_encoding type model @@ -99,12 +95,12 @@ module MakeBackendIO (B : Backend) = struct Format.asprintf "%s This variable never returns an empty error" (Cli.with_style [ANSITerminal.yellow] "[%s.%s]" (Format.asprintf "%a" ScopeName.format_t vc.vc_scope) - (Bindlib.name_of (Pos.unmark vc.vc_variable))) + (Bindlib.name_of (Var.get (Marked.unmark vc.vc_variable)))) | Conditions.NoOverlappingExceptions -> Format.asprintf "%s No two exceptions to ever overlap for this variable" (Cli.with_style [ANSITerminal.yellow] "[%s.%s]" (Format.asprintf "%a" ScopeName.format_t vc.vc_scope) - (Bindlib.name_of (Pos.unmark vc.vc_variable))) + (Bindlib.name_of (Var.get (Marked.unmark vc.vc_variable)))) let print_negative_result (vc : Conditions.verification_condition) @@ -116,15 +112,15 @@ module MakeBackendIO (B : Backend) = struct Format.asprintf "%s This variable might return an empty error:\n%s" (Cli.with_style [ANSITerminal.yellow] "[%s.%s]" (Format.asprintf "%a" ScopeName.format_t vc.vc_scope) - (Bindlib.name_of (Pos.unmark vc.vc_variable))) - (Pos.retrieve_loc_text (Pos.get_position vc.vc_variable)) + (Bindlib.name_of (Var.get (Marked.unmark vc.vc_variable)))) + (Pos.retrieve_loc_text (Marked.get_mark vc.vc_variable)) | Conditions.NoOverlappingExceptions -> Format.asprintf "%s At least two exceptions overlap for this variable:\n%s" (Cli.with_style [ANSITerminal.yellow] "[%s.%s]" (Format.asprintf "%a" ScopeName.format_t vc.vc_scope) - (Bindlib.name_of (Pos.unmark vc.vc_variable))) - (Pos.retrieve_loc_text (Pos.get_position vc.vc_variable)) + (Bindlib.name_of (Var.get (Marked.unmark vc.vc_variable)))) + (Pos.retrieve_loc_text (Marked.get_mark vc.vc_variable)) in let counterexample : string option = if !Cli.disable_counterexamples then @@ -159,7 +155,7 @@ module MakeBackendIO (B : Backend) = struct let vc, z3_vc = vc in Cli.debug_print "For this variable:\n%s\n" - (Pos.retrieve_loc_text (Pos.get_position vc.Conditions.vc_guard)); + (Pos.retrieve_loc_text (pos vc.Conditions.vc_guard)); Cli.debug_format "This verification condition was generated for %a:@\n%a" (Cli.format_with_style [ANSITerminal.yellow]) (match vc.vc_kind with @@ -182,6 +178,6 @@ module MakeBackendIO (B : Backend) = struct Cli.error_print "%s The translation to Z3 failed:\n%s" (Cli.with_style [ANSITerminal.yellow] "[%s.%s]" (Format.asprintf "%a" ScopeName.format_t vc.vc_scope) - (Bindlib.name_of (Pos.unmark vc.vc_variable))) + (Bindlib.name_of (Var.get (Marked.unmark vc.vc_variable)))) msg end diff --git a/compiler/verification/io.mli b/compiler/verification/io.mli index 1364835b..7841887a 100644 --- a/compiler/verification/io.mli +++ b/compiler/verification/io.mli @@ -24,7 +24,7 @@ module type Backend = sig val make_context : Dcalc.Ast.decl_ctx -> - Dcalc.Ast.typ Utils.Pos.marked Dcalc.Ast.VarMap.t -> + Dcalc.Ast.typ Utils.Marked.pos Dcalc.Ast.VarMap.t -> backend_context type vc_encoding @@ -39,9 +39,7 @@ module type Backend = sig val is_model_empty : model -> bool val translate_expr : - backend_context -> - Dcalc.Ast.expr Utils.Pos.marked -> - backend_context * vc_encoding + backend_context -> 'm Dcalc.Ast.marked_expr -> backend_context * vc_encoding end module type BackendIO = sig @@ -51,15 +49,13 @@ module type BackendIO = sig val make_context : Dcalc.Ast.decl_ctx -> - Dcalc.Ast.typ Utils.Pos.marked Dcalc.Ast.VarMap.t -> + Dcalc.Ast.typ Utils.Marked.pos Dcalc.Ast.VarMap.t -> backend_context type vc_encoding val translate_expr : - backend_context -> - Dcalc.Ast.expr Utils.Pos.marked -> - backend_context * vc_encoding + backend_context -> 'm Dcalc.Ast.marked_expr -> backend_context * vc_encoding type model diff --git a/compiler/verification/z3backend.real.ml b/compiler/verification/z3backend.real.ml index 42e09354..eb074c8d 100644 --- a/compiler/verification/z3backend.real.ml +++ b/compiler/verification/z3backend.real.ml @@ -26,7 +26,7 @@ type context = { ctx_decl : decl_ctx; (* The declaration context from the Catala program, containing information to precisely pretty print Catala expressions *) - ctx_var : typ Pos.marked VarMap.t; + ctx_var : typ Marked.pos VarMap.t; (* A map from Catala variables to their types, needed to create Z3 expressions of the right sort *) ctx_funcdecl : FuncDecl.func_decl VarMap.t; @@ -99,7 +99,7 @@ let base_day = CalendarLib.Date.make 1900 1 1 (** [unique_name] returns the full, unique name corresponding to variable [v], as given by Bindlib **) -let unique_name (v : Var.t) : string = +let unique_name (v : 'm var) : string = Format.asprintf "%s_%d" (Bindlib.name_of v) (Bindlib.uid_of v) (** [date_to_int] translates [date] to an integer corresponding to the number of @@ -125,7 +125,7 @@ let nb_days_to_date (nb : int) : string = (** [print_z3model_expr] pretty-prints the value [e] given by a Z3 model according to the Catala type [ty], corresponding to [e] **) -let rec print_z3model_expr (ctx : context) (ty : typ Pos.marked) (e : Expr.expr) +let rec print_z3model_expr (ctx : context) (ty : typ Marked.pos) (e : Expr.expr) : string = let print_lit (ty : typ_lit) = match ty with @@ -156,12 +156,12 @@ let rec print_z3model_expr (ctx : context) (ty : typ Pos.marked) (e : Expr.expr) | TDuration -> Format.asprintf "%s days" (Expr.to_string e) in - match Pos.unmark ty with + match Marked.unmark ty with | TLit ty -> print_lit ty | TTuple (_, Some name) -> let s = StructMap.find name ctx.ctx_decl.ctx_structs in let get_fieldname (fn : StructFieldName.t) : string = - Pos.unmark (StructFieldName.get_info fn) + Marked.unmark (StructFieldName.get_info fn) in let fields = List.map2 @@ -174,7 +174,7 @@ let rec print_z3model_expr (ctx : context) (ty : typ Pos.marked) (e : Expr.expr) let fields_str = String.concat " " fields in Format.asprintf "%s { %s }" - (Pos.unmark (StructName.get_info name)) + (Marked.unmark (StructName.get_info name)) fields_str | TTuple (_, None) -> failwith "[Z3 model]: Pretty-printing of unnamed structs not supported" @@ -188,7 +188,7 @@ let rec print_z3model_expr (ctx : context) (ty : typ Pos.marked) (e : Expr.expr) let case = List.find (fun (ctr, _) -> - String.equal fd_name (Pos.unmark (EnumConstructor.get_info ctr))) + String.equal fd_name (Marked.unmark (EnumConstructor.get_info ctr))) enum_ctrs in @@ -223,7 +223,8 @@ let print_model (ctx : context) (model : Model.model) : string = let v = StringMap.find symbol_name ctx.ctx_z3vars in Format.fprintf fmt "%s %s : %s" (Cli.with_style [ANSITerminal.blue] "%s" "-->") - (Cli.with_style [ANSITerminal.yellow] "%s" (Bindlib.name_of v)) + (Cli.with_style [ANSITerminal.yellow] "%s" + (Bindlib.name_of (Var.get v))) (print_z3model_expr ctx (VarMap.find v ctx.ctx_var) e) else (* Declaration d is a function *) @@ -238,7 +239,8 @@ let print_model (ctx : context) (model : Model.model) : string = let v = StringMap.find symbol_name ctx.ctx_z3vars in Format.fprintf fmt "%s %s : %s" (Cli.with_style [ANSITerminal.blue] "%s" "-->") - (Cli.with_style [ANSITerminal.yellow] "%s" (Bindlib.name_of v)) + (Cli.with_style [ANSITerminal.yellow] "%s" + (Bindlib.name_of (Var.get v))) (* TODO: Model of a Z3 function should be pretty-printed *) (Model.FuncInterp.to_string f))) decls @@ -281,11 +283,11 @@ and find_or_create_enum (ctx : context) (enum : EnumName.t) : (* Creates a Z3 constructor corresponding to the Catala constructor [c] *) let create_constructor (ctx : context) - (c : EnumConstructor.t * typ Pos.marked) : + (c : EnumConstructor.t * typ Marked.pos) : context * Datatype.Constructor.constructor = let name, ty = c in - let name = Pos.unmark (EnumConstructor.get_info name) in - let ctx, arg_z3_ty = translate_typ ctx (Pos.unmark ty) in + let name = Marked.unmark (EnumConstructor.get_info name) in + let ctx, arg_z3_ty = translate_typ ctx (Marked.unmark ty) in (* The mk_constructor_s Z3 function is not so well documented. From my understanding, its argument are: - a string corresponding to the name of @@ -313,7 +315,7 @@ and find_or_create_enum (ctx : context) (enum : EnumName.t) : let ctx, z3_ctrs = List.fold_left_map create_constructor ctx ctrs in let z3_enum = Datatype.mk_sort_s ctx.ctx_z3 - (Pos.unmark (EnumName.get_info enum)) + (Marked.unmark (EnumName.get_info enum)) z3_ctrs in add_z3enum enum z3_enum ctx, z3_enum @@ -327,18 +329,18 @@ and find_or_create_struct (ctx : context) (s : StructName.t) : match StructMap.find_opt s ctx.ctx_z3structs with | Some s -> ctx, s | None -> - let s_name = Pos.unmark (StructName.get_info s) in + let s_name = Marked.unmark (StructName.get_info s) in let fields = StructMap.find s ctx.ctx_decl.ctx_structs in let z3_fieldnames = List.map (fun f -> - Pos.unmark (StructFieldName.get_info (fst f)) + Marked.unmark (StructFieldName.get_info (fst f)) |> Symbol.mk_string ctx.ctx_z3) fields in let ctx, z3_fieldtypes = List.fold_left_map - (fun ctx f -> Pos.unmark (snd f) |> translate_typ ctx) + (fun ctx f -> Marked.unmark (snd f) |> translate_typ ctx) ctx fields in let z3_sortrefs = List.map Sort.get_id z3_fieldtypes in @@ -392,11 +394,11 @@ let find_or_create_funcdecl (ctx : context) (v : Var.t) : | None -> ( (* Retrieves the Catala type of the function [v] *) let f_ty = VarMap.find v ctx.ctx_var in - match Pos.unmark f_ty with + match Marked.unmark f_ty with | TArrow (t1, t2) -> - let ctx, z3_t1 = translate_typ ctx (Pos.unmark t1) in - let ctx, z3_t2 = translate_typ ctx (Pos.unmark t2) in - let name = unique_name v in + let ctx, z3_t1 = translate_typ ctx (Marked.unmark t1) in + let ctx, z3_t2 = translate_typ ctx (Marked.unmark t2) in + let name = unique_name (Var.get v) in let fd = FuncDecl.mk_func_decl_s ctx.ctx_z3 name [z3_t1] z3_t2 in let ctx = add_funcdecl v fd ctx in let ctx = add_z3var name v ctx in @@ -415,7 +417,7 @@ let find_or_create_funcdecl (ctx : context) (v : Var.t) : let rec translate_op (ctx : context) (op : operator) - (args : expr Pos.marked list) : context * Expr.expr = + (args : 'm marked_expr list) : context * Expr.expr = match op with | Ternop _top -> let _e1, _e2, _e3 = @@ -426,7 +428,10 @@ let rec translate_op (Format.asprintf "[Z3 encoding] Ill-formed ternary operator application: %a" (Print.format_expr ctx.ctx_decl) - (EApp ((EOp op, Pos.no_pos), args), Pos.no_pos)) + ( EApp + ( (EOp op, Untyped { pos = Pos.no_pos }), + List.map (fun arg -> Bindlib.unbox (untype_expr arg)) args ), + Untyped { pos = Pos.no_pos } )) in failwith "[Z3 encoding] ternary operator application not supported" @@ -514,7 +519,12 @@ let rec translate_op (Format.asprintf "[Z3 encoding] Ill-formed binary operator application: %a" (Print.format_expr ctx.ctx_decl) - (EApp ((EOp op, Pos.no_pos), args), Pos.no_pos)) + ( EApp + ( (EOp op, Untyped { pos = Pos.no_pos }), + List.map + (fun arg -> arg |> untype_expr |> Bindlib.unbox) + args ), + Untyped { pos = Pos.no_pos } )) in match bop with @@ -561,7 +571,12 @@ let rec translate_op (Format.asprintf "[Z3 encoding] Ill-formed unary operator application: %a" (Print.format_expr ctx.ctx_decl) - (EApp ((EOp op, Pos.no_pos), args), Pos.no_pos)) + ( EApp + ( (EOp op, Untyped { pos = Pos.no_pos }), + List.map + (fun arg -> arg |> untype_expr |> Bindlib.unbox) + args ), + Untyped { pos = Pos.no_pos } )) in match uop with @@ -576,6 +591,12 @@ let rec translate_op | IntToRat -> failwith "[Z3 encoding] application of unary operator IntToRat not supported" + | MoneyToRat -> + failwith + "[Z3 encoding] application of unary operator MoneyToRat not supported" + | RatToMoney -> + failwith + "[Z3 encoding] application of unary operator RatToMoney not supported" | GetDay -> failwith "[Z3 encoding] application of unary operator GetDay not supported" @@ -586,6 +607,14 @@ let rec translate_op failwith "[Z3 encoding] GetYear operator only supported in comparisons with \ literal" + | FirstDayOfMonth -> + failwith + "[Z3 encoding] FirstDayOfMonth operator only supported in comparisons \ + with literal" + | LastDayOfMonth -> + failwith + "[Z3 encoding] LastDayOfMonth operator only supported in comparisons \ + with literal" | RoundDecimal -> failwith "[Z3 encoding] RoundDecimal operator not implemented yet" | RoundMoney -> @@ -593,45 +622,43 @@ let rec translate_op (** [translate_expr] translate the expression [vc] to its corresponding Z3 expression **) -and translate_expr (ctx : context) (vc : expr Pos.marked) : context * Expr.expr - = +and translate_expr (ctx : context) (vc : 'm marked_expr) : context * Expr.expr = let translate_match_arm (head : Expr.expr) (ctx : context) - (e : expr Pos.marked * FuncDecl.func_decl list) : context * Expr.expr = + (e : 'm marked_expr * FuncDecl.func_decl list) : context * Expr.expr = let e, accessors = e in - match Pos.unmark e with + match Marked.unmark e with | EAbs (e, _) -> (* Create a fresh Catala variable to substitue and obtain the body *) - let fresh_v = Var.make ("arm!tmp", Pos.no_pos) in - let fresh_e = EVar (fresh_v, Pos.no_pos) in + let fresh_v = new_var "arm!tmp" in + let fresh_e = EVar fresh_v in (* Invariant: Catala enums always have exactly one argument *) let accessor = List.hd accessors in let proj = Expr.mk_app ctx.ctx_z3 accessor [head] in (* The fresh variable should be substituted by a projection into the enum in the body, we add this to the context *) - let ctx = add_z3matchsubst fresh_v proj ctx in + let ctx = add_z3matchsubst (Var.t fresh_v) proj ctx in - let body = Bindlib.msubst (Pos.unmark e) [| fresh_e |] in + let body = Bindlib.msubst e [| fresh_e |] in translate_expr ctx body (* Invariant: Catala match arms are always lambda*) | _ -> failwith "[Z3 encoding] : Arms branches inside VCs should be lambdas" in - match Pos.unmark vc with + match Marked.unmark vc with | EVar v -> ( - match VarMap.find_opt (Pos.unmark v) ctx.ctx_z3matchsubsts with + match VarMap.find_opt (Var.t v) ctx.ctx_z3matchsubsts with | None -> (* We are in the standard case, where this is a true Catala variable *) - let v = Pos.unmark v in - let t = VarMap.find v ctx.ctx_var in + let t = VarMap.find (Var.t v) ctx.ctx_var in let name = unique_name v in - let ctx = add_z3var name v ctx in - let ctx, ty = translate_typ ctx (Pos.unmark t) in + let ctx = add_z3var name (Var.t v) ctx in + let ctx, ty = translate_typ ctx (Marked.unmark t) in let z3_var = Expr.mk_const_s ctx.ctx_z3 name ty in let ctx = - match Pos.unmark t with + match Marked.unmark t with (* If we are creating a new array, we need to log that its length is greater than 0 *) | TArray _ -> @@ -696,10 +723,10 @@ and translate_expr (ctx : context) (vc : expr Pos.marked) : context * Expr.expr | ELit l -> ctx, translate_lit ctx l | EAbs _ -> failwith "[Z3 encoding] EAbs unsupported" | EApp (head, args) -> ( - match Pos.unmark head with + match Marked.unmark head with | EOp op -> translate_op ctx op args | EVar v -> - let ctx, fd = find_or_create_funcdecl ctx (Pos.unmark v) in + let ctx, fd = find_or_create_funcdecl ctx (Var.t v) in (* Fold_right to preserve the order of the arguments: The head argument is appended at the head *) let ctx, z3_args = @@ -769,7 +796,7 @@ module Backend = struct let is_model_empty (m : model) : bool = List.length (Z3.Model.get_decls m) = 0 - let translate_expr (ctx : backend_context) (e : Dcalc.Ast.expr Pos.marked) = + let translate_expr (ctx : backend_context) (e : 'm marked_expr) = translate_expr ctx e let init_backend () = @@ -777,7 +804,7 @@ module Backend = struct let make_context (decl_ctx : decl_ctx) - (free_vars_typ : typ Pos.marked VarMap.t) : backend_context = + (free_vars_typ : typ Marked.pos VarMap.t) : backend_context = let cfg = (if !Cli.disable_counterexamples then [] else ["model", "true"]) @ ["proof", "false"] diff --git a/doc/formalization/Makefile b/doc/formalization/Makefile index 9974c05b..61308f21 100644 --- a/doc/formalization/Makefile +++ b/doc/formalization/Makefile @@ -96,4 +96,4 @@ include .depend clean: rm -rf $(CACHE_DIR) - rm .depend + rm -f .depend diff --git a/doc/syntax/Makefile b/doc/syntax/Makefile index 207e3869..af94c8d4 100644 --- a/doc/syntax/Makefile +++ b/doc/syntax/Makefile @@ -2,6 +2,6 @@ syntax.pdf: syntax.tex latexmk -pdf -halt-on-error -shell-escape -pvc syntax.tex clean: - latexmk -C syntax.tex + latexmk -f -C syntax.tex .PRECIOUS .SECONDARY: syntax.pdf diff --git a/dune b/dune index 664c4c44..001e5356 100644 --- a/dune +++ b/dune @@ -1,6 +1,16 @@ -(dirs compiler french_law build_system) +(dirs runtimes compiler french_law build_system examples) -(data_only_dirs tests examples syntax_highlighting) +(data_only_dirs tests syntax_highlighting) + +(copy_files compiler/surface/grammar.html) + +(rule + (action + (with-stdout-to + catala.html + (pipe-stdout + (run catala --help=groff) + (run groff -P -l -P -r -mandoc -Thtml))))) (alias (name exec) @@ -8,7 +18,7 @@ (rule (alias runtest) - (package clerk) + (package catala) (deps (source_tree tests)) (action @@ -16,7 +26,7 @@ (rule (alias runtest) - (package clerk) + (package catala) (deps (source_tree examples)) (action diff --git a/examples/Makefile.common.mk b/examples/Makefile.common.mk index 6b5c80d2..fb17e6a4 100644 --- a/examples/Makefile.common.mk +++ b/examples/Makefile.common.mk @@ -4,9 +4,13 @@ LATEXMK?=latexmk -CATALA=../../_build/default/compiler/catala.exe \ +CURR_DIR=examples/$(shell basename $(shell pwd))/ + +CATALA=cd ../../; _build/default/compiler/catala.exe \ $(CATALA_OPTS) --language=$(CATALA_LANG) +PLUGIN_DIR=_build/default/compiler/plugins + help : ../Makefile.common.mk @sed -n 's/^#> //p' $< @@ -24,25 +28,42 @@ help : ../Makefile.common.mk #> .ml : Compiles the file to OCaml %.ml: %.catala_$(CATALA_LANG) - @$(CATALA) Makefile $< + @$(CATALA) Makefile $(CURR_DIR)$< $(CATALA) \ OCaml \ - $< + $(CURR_DIR)$< + +#> _api_web.ml : Compiles the file to OCaml + generates the API web +%_api_web.ml: %.catala_$(CATALA_LANG) + @$(CATALA) Makefile $(CURR_DIR)$< + $(CATALA) \ + api_web \ + --plugin-dir=$(PLUGIN_DIR) \ + $(CURR_DIR)$< + +#> SCOPE= _api_web.ml : Generates the JSON schema +%_schema.json: %.catala_$(CATALA_LANG) + @$(CATALA) Makefile $(CURR_DIR)$< + $(CATALA) \ + json_schema \ + --plugin-dir=$(PLUGIN_DIR) \ + -s $(SCOPE) \ + $(CURR_DIR)$< #> .py : Compiles the file to Python %.py: %.catala_$(CATALA_LANG) - @$(CATALA) Makefile $< + @$(CATALA) Makefile $(CURR_DIR)$< $(CATALA) \ Python \ - $< + $(CURR_DIR)$< #> .tex : Weaves the file to LaTeX %.tex: %.catala_$(CATALA_LANG) - @$(CATALA) Makefile $< + @$(CATALA) Makefile $(CURR_DIR)$< $(CATALA) \ --wrap \ LaTeX \ - $< + $(CURR_DIR)$< #> .pdf : Weaves the file to PDF (via XeLaTeX) %.pdf: %.tex @@ -50,11 +71,11 @@ help : ../Makefile.common.mk #> .html : Weaves the file to HTML %.html: %.catala_$(CATALA_LANG) - @$(CATALA) Makefile $< + @$(CATALA) Makefile $(CURR_DIR)$< $(CATALA) \ --wrap \ HTML \ - $< + $(CURR_DIR)$< %.spellok: %.catala_$(CATALA_LANG) ../whitelist.$(CATALA_LANG) aspell list --lang=$(CATALA_LANG) --mode=markdown --camel-case --add-wordlists=../whitelist.$(CATALA_LANG) <$< | tee "$<".errors @@ -75,6 +96,8 @@ clean: _minted-$(SRC:.catala_$(CATALA_LANG)=) \ $(SRC:.catala_$(CATALA_LANG)=.html) \ $(SRC:.catala_$(CATALA_LANG)=.ml) \ + $(SRC:.catala_$(CATALA_LANG)=_api_web.ml) \ + $(SRC:.catala_$(CATALA_LANG)=_schema.json) include $(wildcard $(SRC:.catala_$(CATALA_LANG)=.d)) diff --git a/examples/README.md b/examples/README.md index 0b3090cf..5f956717 100644 --- a/examples/README.md +++ b/examples/README.md @@ -52,6 +52,12 @@ can be passed using the `CATALA_OPTS` Makefile variable. [Marianne](https://gouvfr.atlassian.net/wiki/spaces/DB/pages/223019527/Typographie+-+Typography) installed in your machine. +> Note: the OCaml, Javascript and Python artifacts that are generated here and +> used in ../french_law are generated using `dune` rules instead. See the +> examples in `aides_logement/dune` and `allocations_familiales/dune`. This +> allows the compilation of `french_law` to be streamlined from the compilation +> of the Catala compiler itself, and without polluting the source tree. + ## Testing examples Unit testing is important, and we encourage Catala developers to write lots diff --git a/examples/aides_logement/.gitignore b/examples/aides_logement/.gitignore index 584374e4..69ff37e1 100644 --- a/examples/aides_logement/.gitignore +++ b/examples/aides_logement/.gitignore @@ -16,3 +16,4 @@ _minted* *.ml *.py *.xdv +*.json diff --git a/examples/aides_logement/aides_logement.catala_fr b/examples/aides_logement/aides_logement.catala_fr index 2f70cd79..787c0bd6 100644 --- a/examples/aides_logement/aides_logement.catala_fr +++ b/examples/aides_logement/aides_logement.catala_fr @@ -15,3 +15,5 @@ > Inclusion: ../base_mensuelle_allocations_familiales/bmaf.catala_fr > Inclusion: ../prestations_familiales/prestations_familiales.catala_fr + +> Inclusion: archives.catala_fr \ No newline at end of file diff --git a/examples/aides_logement/archives.catala_fr b/examples/aides_logement/archives.catala_fr new file mode 100644 index 00000000..da5fb2c8 --- /dev/null +++ b/examples/aides_logement/archives.catala_fr @@ -0,0 +1,673 @@ +# Archives législatives et réglementaires + +## Articles valables du 1er octobre 2020 au 1er octobre 2021 + +### Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement + +#### Article 7 | LEGIARTI000042378448 + +Les plafonds de loyers visés au 2° de l'article D. 823-16 du même code sont fixés comme suit (en euros) : + +--------------------------------------------------------------------------------------------------- +Zone Personne seule Couple sans personne à charge Personne seule ou couple Par personne à + ayant une personne à charge charge supplémentaire +---- -------------- ----------------------------- --------------------------- --------------------- +I 296,82 357,99 404,60 58,70 + +II 258,69 316,64 356,30 51,86 + +III 242,46 293,92 329,56 47,23 +--------------------------------------------------------------------------------------------------- + + +Nota: + +Conformément à l’article 3, I de l’arrêté du 25 septembre 2020, +ces dispositions sont applicables pour les prestations dues à compter du 1er +octobre 2020. + + +```catala +champ d'application CalculAidePersonnaliséeLogementLocatif + sous condition date_courante <@ |2021-10-01| et + date_courante >=@ |2020-10-01|: + + # Colonne 1 + étiquette base définition plafond_loyer_d823_16_2 sous condition + (situation_familiale_calcul_apl sous forme PersonneSeule) et + nombre_personnes_à_charge = 0 + conséquence égal à + selon zone sous forme + -- Zone1: 296,82€ + -- Zone2: 258,59€ + -- Zone3: 242,46€ + + # Colonne 2 + étiquette base définition plafond_loyer_d823_16_2 sous condition + (situation_familiale_calcul_apl sous forme Couple) et + nombre_personnes_à_charge = 0 + conséquence égal à + selon zone sous forme + --Zone1: 357,99€ + --Zone2: 316,64€ + --Zone3: 293,92€ + + # Colonnes 3 et 4 + étiquette base définition plafond_loyer_d823_16_2 sous condition + nombre_personnes_à_charge >= 1 + conséquence égal à + selon zone sous forme + --Zone1: + 404,60€ +€ 58,70€ *€ (entier_vers_décimal de + (nombre_personnes_à_charge - 1)) + --Zone2: + 356,30€ +€ 51,86€ *€ (entier_vers_décimal de + (nombre_personnes_à_charge - 1)) + --Zone3: + 329,56€ +€ 47,23€ *€ (entier_vers_décimal de + (nombre_personnes_à_charge - 1)) + +``` + +#### Article 8 | LEGIARTI000042378446 + +Dans le cas où le logement occupé est une chambre, les plafonds +de loyers visés au 2° de l'article D. 823-16 du même code sont +fixés comme suit, quelle que soit la taille de la famille (en euros) : + +- 90 % des loyers plafonds de location pour une personne isolée ; +- 75 % des loyers plafonds de location pour une personne isolée, +dans le cas des personnes âgées ou handicapées adultes hébergées +à titre onéreux chez des particuliers. + +On obtient les loyers plafonds suivants (en euros) : + +MONTANTS DES LOYERS PLAFONDS CHAMBRE EN APL ET EN AL +(arrondis au centime d'euro le plus proche) + +---------------------------------------- +Bénéficiaires Zones Montants +------------------------- ----- -------- +Cas général I 267,14 + + II 232,82 + + III 218,21 + + +Cas des personnes âgées I 222,62 +ou handicapées adultes +hébergées à titre onéreux +chez des particuliers + + II 194,02 + + III 181,85 +---------------------------------------- + + +NOTA : + +Conformément à l’article 3, I de l’arrêté du 25 septembre 2020, ces dispositions +sont applicables pour les prestations dues à compter du 1er octobre 2020. + +```catala +champ d'application CalculAidePersonnaliséeLogementLocatif + sous condition + date_courante <@ |2021-10-01| et date_courante >=@ |2020-10-01| et + logement_est_chambre: + + étiquette chambre exception base + définition plafond_loyer_d823_16_2 égal à + selon zone sous forme + -- Zone1: 267,14€ + -- Zone2: 232,82€ + -- Zone3: 218,21€ + + exception chambre définition plafond_loyer_d823_16_2 sous condition + âgées_ou_handicap_adultes_hébergées_onéreux_particuliers + conséquence égal à + selon zone sous forme + -- Zone1: 222,62€ + -- Zone2: 194,02€ + -- Zone3: 181,85€ +``` + +#### Article 9 | LEGIARTI000042378444 + +Les montants forfaitaires au titre des charges visés au 3° de +l'article D. 823-16 du même code sont fixés comme suit (en euros) : + +---------------------------------- +Désignation Toutes zones +--------------------- ------------ +Bénéficiaire isolé ou 53,99 +couple sans personne +à charge + +Par personne 12,24 +supplémentaire +à charge +---------------------------------- + +NOTA : + +Conformément à l’article 3, I de l’arrêté du 25 septembre 2020, +ces dispositions sont applicables pour les prestations dues à +compter du 1er octobre 2020. + +```catala +champ d'application CalculAidePersonnaliséeLogementLocatif + sous condition date_courante <@ |2021-10-01| et + date_courante >=@ |2020-10-01|: + étiquette base définition montant_forfaitaire_charges_d823_16 égal à + 53,99€ +€ 12,24€ *€ (entier_vers_décimal de nombre_personnes_à_charge) +``` + +#### Article 13 | LEGIARTI000044137423 + +La participation minimale P0 définie au 2° de l'article D. 823-17 du même code est +égale à la plus élevée des deux valeurs suivantes : 8,5 % de la somme du loyer éligible +défini au 2° de l'article D. 823-16 du même code et du forfait charge ou 35,24 euros. + +```catala +champ d'application CalculAidePersonnaliséeLogementLocatif + sous condition date_courante <@ |2021-10-01| et + date_courante >=@ |2020-10-01|: + définition participation_minimale égal à + si + (loyer_éligible +€ montant_forfaitaire_charges_d823_16) + *€ 8,5% >=€ 35,24 € + alors + (loyer_éligible +€ montant_forfaitaire_charges_d823_16) *€ 8,5% + sinon + 35,24 € +``` + +NOTA : + +Conformément à l’article 3, I de l’arrêté du 25 septembre 2020, ces dispositions +sont applicables pour les prestations dues à compter du 1er octobre 2020. + +#### Article 14 | LEGIARTI000042378440 + +Pour l'application de l'article D. 823-17 du même code, le taux de participation +personnelle Tp du ménage, exprimé en pourcentage, est calculé selon la formule suivante : + +$$\text{Tp} = \text{TF} + \text{TL}$$ + +dans laquelle : + +1° TF représente un taux fonction de la taille de la famille donné par le tableau suivant : + + +VALEURS DE TF + +Bénéficiaires TF +---------------------------------------------------- ------ +Isolé 2,83% +Couple sans personne à charge 3,15% +Personne seule ou couple ayant une personne à charge 2,70% +2 enfants ou 2 personnes 2,38% +3 enfants ou 3 personnes 2,01% +4 enfants ou 4 personnes 1,85% +5 enfants ou 5 personnes 1,79% +6 enfants ou 6 personnes 1,73% +Majoration par personne à charge -0,06% + +```catala +champ d'application CalculAidePersonnaliséeLogementLocatif + sous condition date_courante >=@ |2020-10-01| et + date_courante <@ |2021-10-01|: + définition taux_composition_familiale égal à + si nombre_personnes_à_charge = 0 alors + selon situation_familiale_calcul_apl sous forme + -- PersonneSeule: 2,83% + -- Couple: 3,15% + sinon (si nombre_personnes_à_charge = 1 alors + 2,70% + sinon (si nombre_personnes_à_charge = 2 alors + 2,38% + sinon (si nombre_personnes_à_charge = 3 alors + 2,01% + sinon (si nombre_personnes_à_charge = 4 alors + 1,85% + sinon (si nombre_personnes_à_charge = 5 alors + 1,79% + sinon (si nombre_personnes_à_charge = 6 alors + 1,73% + sinon + (1,73% -. (0,06% *. (entier_vers_décimal de + (nombre_personnes_à_charge - 6)))) + )))))) +# TODO informatique: corriger le parseur pour éviter d'avoir à mettre +# toutes ces parenthèses. +``` + +2° TL représente un taux complémentaire fixé ci-dessous en fonction de la valeur du rapport +RL entre le loyer retenu dans la limite du plafond L et un loyer de référence LR : $\text{RL} = \text{L} / \text{LR}$. + +RL est exprimé en pourcentage et arrondi à la deuxième décimale. + +```catala +champ d'application CalculAidePersonnaliséeLogementLocatif + sous condition date_courante >=@ |2020-10-01| et + date_courante <@ |2021-10-01|: + définition rapport_loyers égal à + arrondi_décimal de ((loyer_éligible /€ loyer_référence) *. 100,0) /. 100,0 +``` + +Pour la détermination de TL , les taux progressifs et les tranches successives de RL mentionnés +au 3° de l'article D. 823-17 du même code sont fixés comme suit : + +- 0 % pour la tranche de RL inférieure à 45 % ; + +- 0,45 % pour la tranche de RL entre 45 % et 75 % ; + +- 0,68 % pour la tranche de RL supérieure à 75 %. + +TL est exprimé en pourcentage et arrondi à la troisième décimale. +Le tableau suivant traduit cette formule : + +Si $\text{RL}<45\%$ Si $45\% < \text{RL} < 75\%$ Si $\text{RL} >75 \%$ +------------------- ------------------------------------------ ----------------------------------------------------------- +$\text{TL}=0 \%$ $\text{TL}=0,45 \%\times (\text{RL}-45\%)$ $\text{TL}=0,45\%\times30 \%+0,68 \%\times(\text{RL}-75\%)$ + +```catala +champ d'application CalculAidePersonnaliséeLogementLocatif + sous condition date_courante >=@ |2020-10-01| et + date_courante <@ |2021-10-01|: + définition taux_loyer_éligible état formule égal à + si rapport_loyers <. 45% alors 0% sinon ( + si rapport_loyers >=. 45% et rapport_loyers <. 75% alors + 0,45% *. (rapport_loyers -. 0,45%) + sinon (si rapport_loyers >=. 75% alors + 0,45% *. 30% +. 0,68% *. (rapport_loyers -. 75%) + sinon 0,0)) + définition taux_loyer_éligible état arrondi égal à + # La troisième décimale en pourcentage est en fait la cinquième décimale + (arrondi_décimal de (taux_loyer_éligible *. 100000,0)) /. 100000,0 +``` + +Le loyer de référence LR est défini selon le tableau suivant (en euros) : + +Composition du ménage Montant +---------------------------------------------------- -------- +Bénéficiaire isolé 258,69 +Couple sans personne à charge 316,64 +Personne seule ou couple ayant une personne à charge 356,3 +Majoration par personne à charge 51,86 + +```catala +champ d'application CalculAidePersonnaliséeLogementLocatif + sous condition date_courante >=@ |2020-10-01| et + date_courante <@ |2021-10-01|: + définition loyer_référence égal à + si nombre_personnes_à_charge = 0 alors + selon situation_familiale_calcul_apl sous forme + -- PersonneSeule: 258,69€ + -- Couple: 316,64€ + sinon (356,30€ +€ + (51,86€ *€ (entier_vers_décimal de (nombre_personnes_à_charge - 1)))) +``` + +NOTA : +Conformément à l’article 3, I de l’arrêté du 25 septembre 2020, ces +dispositions sont applicables pour les prestations dues à compter du +1er octobre 2020. + + +#### Article 16 | LEGIARTI000042378438 + +Dans le cas des colocataires prévus à l'article D. 823-18 du même code : + +1° Les plafonds de loyers sont fixés à 75 % des plafonds de loyers définis au 2° de l'article +D. 823-16 du même code et fixés à l'article 7. + +Les montants obtenus par l'application de ces pourcentages sont arrondis au centime d'euro le plus proche. +On obtient les loyers plafonds suivants (en euros) : + +-------------------------------------------------------- +Zone I II III +---------------------------------- ------- ------ ------ +Personne seule 222,62 194,02 181,85 + +Couple sans personne à charge 268,49 237,48 220,44 + +Personne seule ou couple ayant une +personne à charge 303,45 267,23 247,17 + +Par personne à +charge supplémentaire 44,03 38,90 35,42 +-------------------------------------------------------- + +```catala +champ d'application CalculAidePersonnaliséeLogementLocatif + sous condition date_courante <@ |2021-10-01| et + date_courante >=@ |2020-10-01| et colocation: + + exception base définition plafond_loyer_d823_16_2 sous condition + (situation_familiale_calcul_apl sous forme PersonneSeule) et + nombre_personnes_à_charge = 0 + conséquence égal à + selon zone sous forme + -- Zone1: 222,62€ + -- Zone2: 194,02€ + -- Zone3: 181,85€ + + exception base définition plafond_loyer_d823_16_2 sous condition + (situation_familiale_calcul_apl sous forme Couple) et + nombre_personnes_à_charge = 0 + conséquence égal à + selon zone sous forme + --Zone1: 268,49€ + --Zone2: 237,48€ + --Zone3: 220,44€ + + exception base définition plafond_loyer_d823_16_2 sous condition + nombre_personnes_à_charge >= 1 + conséquence égal à + selon zone sous forme + --Zone1: + 303,45€ +€ 44,03€ *€ (entier_vers_décimal de + (nombre_personnes_à_charge - 1)) + --Zone2: + 267,23€ +€ 38,90€ *€ (entier_vers_décimal de + (nombre_personnes_à_charge - 1)) + --Zone3: + 247,17€ +€ 35,42€ *€ (entier_vers_décimal de + (nombre_personnes_à_charge - 1)) +``` + +2° Le montant forfaitaire au titre des charges est fixé comme suit (en euros) : + +Composition du foyer Montant +-------------------------------- ------- +Bénéficiaire isolé 26,99 +Couple sans personne à charge 53,99 +Majoration par personne à charge 12,24 + +```catala +champ d'application CalculAidePersonnaliséeLogementLocatif + sous condition date_courante <@ |2021-10-01| et + date_courante >=@ |2020-10-01| et colocation: + exception base définition montant_forfaitaire_charges_d823_16 égal à + (selon situation_familiale_calcul_apl sous forme + -- PersonneSeule: 26,99€ + -- Couple: 53,99€) +€ + 12,24€ *€ (entier_vers_décimal de nombre_personnes_à_charge) +``` + +NOTA : + +Conformément à l’article 3, I de l’arrêté du 25 septembre 2020, ces +dispositions sont applicables pour les prestations dues à compter du +1er octobre 2020. + + +#### Article 19 | LEGIARTI000042378432 + +Pour l'application du 4° de l'article D. 832-10 du code de la construction et +de l'habitation, le montant forfaitaire des charges est fixé comme suit +(en euros) : + +Désignation Toutes zones +--------------------------------------------------- ------------ +Bénéficiaire isolé ou couple sans personne à charge 54,22 +Par personne supplémentaire à charge 12,29 + +NOTA : + +Conformément à l’article 3, I de l’arrêté du 25 septembre 2020, ces dispositions +sont applicables pour les prestations dues à compter du 1er octobre 2020. + +```catala +champ d'application CalculAidePersonnaliséeLogementAccessionPropriété + sous condition date_courante <@ |2021-10-01| et + date_courante >=@ |2020-10-01|: + + étiquette base définition montant_forfaitaire_charges_d832_10 égal à + 53,99 € +€ 12,24 € *€ (entier_vers_décimal de nombre_personnes_à_charge) +``` + + +#### Article 24 | LEGIARTI000042378430 + +Dans le cas des copropriétaires prévus à l'article D. 832-16 du même code : + +1° Les plafonds de mensualités sont fixés à 75 % des plafonds de mensualités mentionnés aux articles 17 et 18 ; + +```catala +champ d'application CalculAidePersonnaliséeLogementAccessionPropriété + sous condition date_courante <@ |2021-10-01| et + date_courante >=@ |2020-10-01|: + définition plafond_mensualité_d832_10_3 état copropriétaires égal à + si copropriété alors + plafond_mensualité_d832_10_3 *€ 75% + sinon + plafond_mensualité_d832_10_3 +``` + +2° Le montant forfaitaire au titre des charges est fixé comme suit (en euros) : + +Composition du foyer Montant +-------------------------------- ------- +Bénéficiaire isolé 26,99 +Couple sans personne à charge 53,99 +Majoration par personne à charge 12,24 + +```catala +champ d'application CalculAidePersonnaliséeLogementAccessionPropriété + sous condition date_courante <@ |2021-10-01| et + date_courante >=@ |2020-10-01|: + exception base définition montant_forfaitaire_charges_d832_10 sous condition + copropriété + conséquence égal à + (selon situation_familiale_calcul_apl sous forme + -- PersonneSeule: 26,99€ + -- Couple: 53,99€) +€ + 12,24 € *€ (entier_vers_décimal de nombre_personnes_à_charge) +``` + +NOTA : + +Conformément à l’article 3, I de l’arrêté du 25 septembre 2020, ces dispositions +sont applicables pour les prestations dues à compter du 1er octobre 2020. + + + +#### Article 27 | LEGIARTI000042378428 + +Pour l'application de l'article D. 832-24 du même code, les équivalences de loyer et de charges locatives plafonds +sont fixées comme suit (en euros) : + +Désignation Zone I Zone II Zone III +------------------------------------------------------------ ------ ------- -------- +Bénéficiaire isolé 444,43 406,43 385,78 +Couple sans personne à charge 521,02 474,33 448,69 +Bénéficiaire isolé ou couple ayant une personne à charge 555,55 505,75 476,02 +Bénéficiaire isolé ou couple ayant deux personnes à charge 594,54 541,38 507,44 +Bénéficiaire isolé ou couple ayant trois personnes à charge 633,69 576,87 538,84 +Bénéficiaire isolé ou couple ayant quatre personnes à charge 683,5 614,69 574,16 +Par personne supplémentaire à charge 70,89 64,07 59,46 + +NOTA : +Conformément à l’article 3, I de l’arrêté du 25 septembre 2020, ces dispositions +sont applicables pour les prestations dues à compter du 1er octobre 2020. + +```catala +champ d'application CalculAidePersonnaliséeLogementFoyer sous condition + date_courante <@ |2021-10-01| et date_courante >=@ |2020-10-01|: + définition plafond_équivalence_loyer_éligible égal à + (selon zone sous forme + -- Zone1: ( + si nombre_personnes_à_charge = 0 alors + (selon situation_familiale_calcul_apl sous forme + -- PersonneSeule: 444,43 € + -- Couple: 521,01€) + sinon (si nombre_personnes_à_charge = 1 alors + 555,55 € + sinon (si nombre_personnes_à_charge = 2 alors + 594,54 € + sinon (si nombre_personnes_à_charge = 3 alors + 633,69 € + sinon + (683,5 € +€ + 70,89€ *€ (entier_vers_décimal de (nombre_personnes_à_charge - 4))))))) + -- Zone2: ( + si nombre_personnes_à_charge = 0 alors + (selon situation_familiale_calcul_apl sous forme + -- PersonneSeule: 406,43 € + -- Couple: 474,33€) + sinon (si nombre_personnes_à_charge = 1 alors + 505,75 € + sinon (si nombre_personnes_à_charge = 2 alors + 541,38 € + sinon (si nombre_personnes_à_charge = 3 alors + 576,87 € + sinon + (614,69 € +€ + 64,07€ *€ (entier_vers_décimal de (nombre_personnes_à_charge - 4))))))) + -- Zone3: ( + si nombre_personnes_à_charge = 0 alors + (selon situation_familiale_calcul_apl sous forme + -- PersonneSeule: 385,78 € + -- Couple: 448,69€) + sinon (si nombre_personnes_à_charge = 1 alors + 476,02 € + sinon (si nombre_personnes_à_charge = 2 alors + 507,44 € + sinon (si nombre_personnes_à_charge = 3 alors + 538,84 € + sinon + (574,16 € +€ + 59,46€ *€ (entier_vers_décimal de (nombre_personnes_à_charge - 4))))))) + ) +``` + +## Articles valables du 1er janvier 2022 au 1er juillet 2022 + +### Article 6 | LEGIARTI000045011471 + +Pour l'application de l'article D. 822-21 du même code, le montant forfaitaire auquel sont réputées +égales les ressources du bénéficiaire et, le cas échéant, de son conjoint, est fixé à 7 800 euros +pour la location et à 6 000 euros pour la résidence en logement-foyer. + +Toutefois, lorsque le demandeur est titulaire d'une bourse de l'enseignement supérieur qui n'est +pas assujettie à l'impôt sur le revenu, le montant forfaitaire de ressources est fixé à 6 300 euros +pour la location et à 4 900 euros pour la résidence en logement-foyer. + +```catala +# TODO informatique et juridique: traduire cet article qui vient définir +# ressources_forfaitaires_r822_20 +``` + +NOTA: + +Conformément à l’article 2 de l’arrêté du 20 décembre 2021 (NOR : LOGL2134477A), +ces dispositions sont applicables pour les prestations dues à compter du 1er janvier 2022. + +### Article 15 | LEGIARTI000045011468 + +Pour l'application du 5° de l'article D. 823-17 du même code, le forfait " R0 " est fixé selon +le tableau suivant (en euros) : + +Composition du foyer MONTANT (en euros) +----------------------------------------- ------------------- +Personne seule sans personne à charge 4 683 +Couple sans personne à charge 6 709 +Personne seule ou couple ayant : + - une personne à charge 8 002 + - deux personnes à charge 8 182 + - trois personnes à charge 8 495 + - quatre personnes à charge 8 811 + - cinq personnes à charge 9 124 + - six personnes à charge 9 439 + - par personne à charge supplémentaire 311 + +```catala +champ d'application CalculAidePersonnaliséeLogementLocatif + sous condition date_courante >=@ |2022-01-01| et + date_courante <@ |2022-07-01|: + définition abattement_forfaitaire_d823_17 égal à + si nombre_personnes_à_charge = 0 alors + selon situation_familiale_calcul_apl sous forme + -- PersonneSeule: 4 683 € + -- Couple: 6709 € + sinon (si nombre_personnes_à_charge = 1 alors + 8 002 € + sinon (si nombre_personnes_à_charge = 2 alors + 8 192 € + sinon (si nombre_personnes_à_charge = 3 alors + 8 495 € + sinon (si nombre_personnes_à_charge = 4 alors + 8 811 € + sinon (si nombre_personnes_à_charge = 5 alors + 9 124 € + sinon (si nombre_personnes_à_charge = 6 alors + 9 439 € + sinon + (9 439€ +€ (311 € *€ (entier_vers_décimal de + (nombre_personnes_à_charge - 6)))) + )))))) +``` + +NOTA : +Conformément à l’article 2 de l’arrêté du 20 décembre 2021 (NOR : LOGL2134477A), +ces dispositions sont applicables pour les prestations dues à compter du 1er janvier 2022. + + +## Articles valables du 1er janvier 2020 au 1er janvier 2022 + +### Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement + +#### Article 15 | LEGIARTI000041489192 + + +Pour l'application du 5° de l'article D. 823-17 du même code, le forfait " R0 " est fixé selon +le tableau suivant (en euros) : + +Composition du foyer MONTANT (en euros) +----------------------------------------- ------------------- +Personne seule sans personne à charge 4 588 +Couple sans personne à charge 6 572 +Personne seule ou couple ayant : + - une personne à charge 7 839 + - deux personnes à charge 8 015 + - trois personnes à charge 8 322 + - quatre personnes à charge 8 631 + - cinq personnes à charge 8 938 + - six personnes à charge 9 246 + - par personne à charge supplémentaire 305 + +```catala +champ d'application CalculAidePersonnaliséeLogementLocatif + sous condition date_courante <@ |2022-01-01| et + date_courante >=@ |2020-01-01|: + définition abattement_forfaitaire_d823_17 égal à + si nombre_personnes_à_charge = 0 alors + selon situation_familiale_calcul_apl sous forme + -- PersonneSeule: 4 588 € + -- Couple: 6 572 € + sinon (si nombre_personnes_à_charge = 1 alors + 7 839 € + sinon (si nombre_personnes_à_charge = 2 alors + 8 015 € + sinon (si nombre_personnes_à_charge = 3 alors + 8 322 € + sinon (si nombre_personnes_à_charge = 4 alors + 8 631 € + sinon (si nombre_personnes_à_charge = 5 alors + 8 938 € + sinon (si nombre_personnes_à_charge = 6 alors + 9 246 € + sinon + (9 246€ +€ (305 € *€ (entier_vers_décimal de + (nombre_personnes_à_charge - 6)))) + )))))) +``` + +NOTA : +Conformément à l'article 2 de l'arrêté du 3 janvier 2020 ( NOR : LOGL1934006A ), +ces dispositions sont applicables pour les prestations dues à compter +du 1er janvier 2020. diff --git a/examples/aides_logement/arrete_2019-09-27.catala_fr b/examples/aides_logement/arrete_2019-09-27.catala_fr index a57abb4f..e3c20659 100644 --- a/examples/aides_logement/arrete_2019-09-27.catala_fr +++ b/examples/aides_logement/arrete_2019-09-27.catala_fr @@ -21,21 +21,26 @@ champ d'application RessourcesAidesPersonnelleLogement: définition montant_forfaitaire_r_822_8 égal à 2 589€ ``` -### Article 6 | LEGIARTI000045011471 +### Article 6 | LEGIARTI000046126949 Pour l'application de l'article D. 822-21 du même code, le montant forfaitaire auquel sont réputées -égales les ressources du bénéficiaire et, le cas échéant, de son conjoint, est fixé à 7 800 euros -pour la location et à 6 000 euros pour la résidence en logement-foyer. +égales les ressources du bénéficiaire et, le cas échéant, de son conjoint, est fixé à 8 100 euros +pour la location et à 6 200 euros pour la résidence en logement-foyer. Toutefois, lorsque le demandeur est titulaire d'une bourse de l'enseignement supérieur qui n'est -pas assujettie à l'impôt sur le revenu, le montant forfaitaire de ressources est fixé à 6 300 euros -pour la location et à 4 900 euros pour la résidence en logement-foyer. +pas assujettie à l'impôt sur le revenu, le montant forfaitaire de ressources est fixé à 6 500 euros +pour la location et à 5 100 euros pour la résidence en logement-foyer. ```catala # TODO informatique et juridique: traduire cet article qui vient définir # ressources_forfaitaires_r822_20 ``` +NOTA: + +Conformément à l’article 3 de l’arrêté du 29 juillet 2022 (NOR : TREL2220748A), +ces dispositions sont applicables pour les prestations dues à compter du 1er juillet 2022. + ## Chapitre III : Calcul des aides personnelles au logement en secteur locatif ### Article 7 | LEGIARTI000044137432 @@ -221,7 +226,7 @@ du 1er octobre 2021. ```catala champ d'application CalculAidePersonnaliséeLogementLocatif sous condition date_courante >=@ |2021-10-01|: - définition montant_forfaitaire_charges_d823_16 égal à + étiquette base définition montant_forfaitaire_charges_d823_16 égal à 54,22€ +€ 12,29€ *€ (entier_vers_décimal de nombre_personnes_à_charge) ``` @@ -294,8 +299,11 @@ défini au 2° de l'article D. 823-16 du même code et du forfait charge ou 35,3 champ d'application CalculAidePersonnaliséeLogementLocatif sous condition date_courante >=@ |2021-10-01|: définition participation_minimale égal à - si loyer_éligible *€ 8,5% >=€ 35,39 € alors - loyer_éligible *€ 8,5% + si + (loyer_éligible +€ montant_forfaitaire_charges_d823_16) + *€ 8,5% >=€ 35,39 € + alors + (loyer_éligible +€ montant_forfaitaire_charges_d823_16) *€ 8,5% sinon 35,39 € ``` @@ -310,7 +318,7 @@ sont applicables pour les prestations dues à compter du 1er octobre 2021. Pour l'application de l'article D. 823-17 du même code, le taux de participation personnelle Tp du ménage, exprimé en pourcentage, est calculé selon la formule suivante : -$$\text{Tp} = \text{TF} + \text{TL}$$ +$$\textrm{Tp} = \textrm{TF} + \textrm{TL}$$ dans laquelle : @@ -323,32 +331,16 @@ Bénéficiaires TF ---------------------------------------------------- ------ Isolé 2,83% Couple sans personne à charge 3,15% -Personne seule ou couple ayant une personne à charge 2,70% -2 enfants ou 2 personnes 2,38% -3 enfants ou 3 personnes 2,01% -4 enfants ou 4 personnes 1,85% -5 enfants ou 5 personnes 1,79% -6 enfants ou 6 personnes 1,73% -Majoration par personne à charge -0,06% +Personne seule ou couple ayant: +une personne à charge 2,70% +2 personnes à charge 2,38% +3 personnes à charge 2,01% +4 personnes à charge 1,85% +5 personnes à charge 1,79% +6 personnes à charge 1,73% +Majoration par personne à charge supplémentaire -0,06% ```catala -# La distinction enfants/personnes est-elle juste -# un artefact de rédaction ou y-a-t-il vraiment une différence de calcul dans -# le cas où e.g. il y a 3 enfants + 2 adultes à charges : doit on prendre 1,79% -# ou 2,01% ? -# Réponse de DGALN/DHUP/FE4 du 25/05/2022: -# "Non pas de différence, « X enfants ou X personnes » signifie « personne seule -# ou couple ayant X personnes à charge » (ainsi, dans le cas d’un couple avec -# 3 enfants à charge et 2 adultes à charge, il faut prendre la ligne « 5 -# enfants ou personnes », soit la valeur 1,79 %). -# Nous notons le point pour uniformiser les rédactions (également pour le -# tableau du 4° de l’article 46, correspondant aux valeurs pour l’outre-mer)." -# Que se passe-t-il quand il y a 29 personnes à charge et que le taux devient -# négatif? -# Réponse de DGALN/DHUP/FE4 du 25/05/2022: -# "Cette situation étant très éloignée de la réalité elle n’a pas été traitée." -# Nous sommes donc libres de choisir une interprétation, et nous choisissons -# donc de laisser courir cette valeur dans le territoire négatif. champ d'application CalculAidePersonnaliséeLogementLocatif sous condition date_courante >=@ |2021-10-01|: définition taux_composition_familiale égal à @@ -377,7 +369,7 @@ champ d'application CalculAidePersonnaliséeLogementLocatif ``` 2° TL représente un taux complémentaire fixé ci-dessous en fonction de la valeur du rapport -RL entre le loyer retenu dans la limite du plafond L et un loyer de référence LR : $\text{RL} = \text{L} / \text{LR}$. +RL entre le loyer retenu dans la limite du plafond L et un loyer de référence LR : $\textrm{RL} = \textrm{L} / \textrm{LR}$. RL est exprimé en pourcentage et arrondi à la deuxième décimale. @@ -400,9 +392,9 @@ au 3° de l'article D. 823-17 du même code sont fixés comme suit : TL est exprimé en pourcentage et arrondi à la troisième décimale. Le tableau suivant traduit cette formule : -Si $\text{RL}<45\%$ Si $45\% < \text{RL} < 75\%$ Si $\text{RL} >75 \%$ +Si $\textrm{RL}<45\%$ Si $45\% < \textrm{RL} < 75\%$ Si $\textrm{RL} >75 \%$ ------------------- ------------------------------------------ ----------------------------------------------------------- -$\text{TL}=0 \%$ $\text{TL}=0,45 \%\times (\text{RL}-45\%)$ $\text{TL}=0,45\%\times30 \%+0,68 \%\times(\text{RL}-75\%)$ +$\textrm{TL}=0 \%$ $\textrm{TL}=0,45 \%\times (\textrm{RL}-45\%)$ $\textrm{TL}=0,45\%\times30 \%+0,68 \%\times(\textrm{RL}-75\%)$ ```catala champ d'application CalculAidePersonnaliséeLogementLocatif @@ -447,53 +439,53 @@ NOTA : Conformément au I de l’article 3 de l’arrêté du 23 septembre 2021, ces dispositions sont applicables pour les prestations dues à compter du 1er octobre 2021. -### Article 15 | LEGIARTI000045011468 +### Article 15 | LEGIARTI000046126962 Pour l'application du 5° de l'article D. 823-17 du même code, le forfait " R0 " est fixé selon le tableau suivant (en euros) : Composition du foyer MONTANT (en euros) ----------------------------------------- ------------------- -Personne seule sans personne à charge 4 683 -Couple sans personne à charge 6 709 +Personne seule sans personne à charge 4 870 +Couple sans personne à charge 6 977 Personne seule ou couple ayant : - - une personne à charge 8 002 - - deux personnes à charge 8 182 - - trois personnes à charge 8 495 - - quatre personnes à charge 8 811 - - cinq personnes à charge 9 124 - - six personnes à charge 9 439 - - par personne à charge supplémentaire 311 + - une personne à charge 8 322 + - deux personnes à charge 8 509 + - trois personnes à charge 8 834 + - quatre personnes à charge 9 163 + - cinq personnes à charge 9 488 + - six personnes à charge 9 816 + - par personne à charge supplémentaire 323 ```catala champ d'application CalculAidePersonnaliséeLogementLocatif - sous condition date_courante >=@ |2022-01-01|: + sous condition date_courante >=@ |2022-07-01|: définition abattement_forfaitaire_d823_17 égal à si nombre_personnes_à_charge = 0 alors selon situation_familiale_calcul_apl sous forme - -- PersonneSeule: 4 683 € - -- Couple: 6709 € + -- PersonneSeule: 4 870 € + -- Couple: 6 977 € sinon (si nombre_personnes_à_charge = 1 alors - 8 002 € + 8 322 € sinon (si nombre_personnes_à_charge = 2 alors - 8 192 € + 8 509 € sinon (si nombre_personnes_à_charge = 3 alors - 8 495 € + 8 834 € sinon (si nombre_personnes_à_charge = 4 alors - 8 811 € + 9 163 € sinon (si nombre_personnes_à_charge = 5 alors - 9 124 € + 9 488 € sinon (si nombre_personnes_à_charge = 6 alors - 9 439 € + 9 816 € sinon - (9 439€ +€ (311 € *€ (entier_vers_décimal de + (9 816€ +€ (323 € *€ (entier_vers_décimal de (nombre_personnes_à_charge - 6)))) )))))) ``` NOTA : -Conformément à l’article 2 de l’arrêté du 20 décembre 2021 (NOR : LOGL2134477A), -ces dispositions sont applicables pour les prestations dues à compter du 1er janvier 2022. +Conformément à l’article 3 de l’arrêté du 29 juillet 2022 (NOR : TREL2220748A), +ces dispositions sont applicables pour les prestations dues à compter du 1er juillet 2022. ### Article 16 | LEGIARTI000044137417 @@ -571,7 +563,7 @@ Majoration par personne à charge 12,29 ```catala champ d'application CalculAidePersonnaliséeLogementLocatif sous condition date_courante >=@ |2021-10-01| et colocation: - définition montant_forfaitaire_charges_d823_16 égal à + exception base définition montant_forfaitaire_charges_d823_16 égal à (selon situation_familiale_calcul_apl sous forme -- PersonneSeule: 27,10€ -- Couple: 54,22€) +€ @@ -613,10 +605,6 @@ Par personne supplémentaire à charge 430 379 346 # l'avènement de l'euro mais pour le calcul des APL en euros il faut # que la mensualité plafond soit exprimée en euros. Donc nous convertissons. champ d'application CalculAidePersonnaliséeLogementAccessionPropriété: - # TODO juridique: trouver le décret ou la loi qui définit ce taux de - # conversion. - définition taux_francs_vers_euros égal à (1,0 /. 6,55957) - définition calcul_plafond_mensualité_d832_10_3 de date_signature_prêt sous condition date_signature_prêt >=@ |1992-06-30| et @@ -1988,7 +1976,7 @@ DÉSIGNATION ZONE I ZONE II ZONE II Bénéficiaire isolé 358,55 319,98 298,72 Couple sans personne à charge 432,55 385,12 358,19 Bénéficiaire isolé ou couple ayant une personne à charge 506,55 450,29 417,67 -Par personne supplémentaire à charge 73,99 65,15 459,47 +Par personne supplémentaire à charge 73,99 65,15 59,47 ```catala champ d'application CalculAidePersonnaliséeLogementAccessionPropriété: @@ -2020,38 +2008,8 @@ champ d'application CalculAidePersonnaliséeLogementAccessionPropriété: -- PersonneSeule: 298,72€ -- Couple: 358,19€) sinon (417,67€ +€ - # Attention ici valeur différente du décret car décret - # incorrect selon information DGALN/DHUP/FE4 du 25/04/2022 59,47€ *€ (entier_vers_décimal de (nombre_personnes_à_charge - 1)))) ) - -# Concernant l'erreur dans la valeur, voici la réponse intégrale de -# DGALN/DHUP/FE4: -# "Pour les deux valeurs indiquées, il faut lire « 59,47 » à la place de -# « 459,47 » et « 47,99 » à la place de « 347,99 » (les valeurs des centaines -# sont à supprimer). -# L’arrêté du 27/09/2019 fait suite à la recodification des APL dans le CCH, -# opérée à l’été 2019. Il reprend et regroupe plusieurs anciens arrêtés, dont -# celui du 03/07/1978. -# Les valeurs citées correspondent à celles en vigueur pour des prêts signés en -# 2012 et découlent de l’arrêté du 28/12/2011 modifiant celui du 03/07/1978 : -# - la version JO « scannée » authentifiée de cet arrêté de 2011 (page 123 du -# JO du 30/12/2011) est correcte, avec les vraies valeurs, qui ont été -# intégrées dans les SI à l’époque (et le sont toujours). -# (https://www.legifrance.gouv.fr/download/pdf?id=MX15OwEPRjsyPR0h_40wx-7mT0ji9z3kMMVYU8Jy7sc=) -# - on constate cependant sur légifrance que la version remise en page comporte -# l’erreur (article 6, mais également article 5 pour des valeurs qui ont été -# « écrasées » depuis et ne sont donc pas reprises dans l’arrêté de 2019 -# (https://www.legifrance.gouv.fr/jorf/id/JORFTEXT000025054546) -# La correction a été demandé fin avril à légifrance, mais n’est pas encore -# effective. -# En conséquence, l’arrêté modifié de 1978 apparaissait erroné sur légifrance -# en 2019 (et jusqu’à fin avril 2022, légifrance l’ayant corrigé à la suite de -# notre signalement), lorsqu’il a servi de base pour la rédaction du nouvel -# arrêté du 27/09/2019. -# Nous procéderons à la correction de l’arrêté de 2019 lors de la prochaine -# revalorisation des barèmes. Dans l’attente, les valeurs SI ont toujours -# été correctes, sans impact dans le calcul des aides." ``` @@ -2063,7 +2021,7 @@ DÉSIGNATION ZONE I ZONE II ZONE II Bénéficiaire isolé 288,61 257,28 240,27 Couple sans personne à charge 348,29 309,87 288,24 Bénéficiaire isolé ou couple ayant une personne à charge 407,96 362,44 336,23 -Par personne supplémentaire à charge 59,68 52,58 347,99 +Par personne supplémentaire à charge 59,68 52,58 47,99 ```catala champ d'application CalculAidePersonnaliséeLogementAccessionPropriété: @@ -2095,8 +2053,6 @@ champ d'application CalculAidePersonnaliséeLogementAccessionPropriété: -- PersonneSeule: 240,27€ -- Couple: 288,24€) sinon (336,23€ +€ - # Attention ici valeur différente du décret car décret - # incorrect selon information DGALN/DHUP/FE4 du 25/04/2022 47,99€ *€ (entier_vers_décimal de (nombre_personnes_à_charge - 1)))) ) ``` @@ -2565,7 +2521,7 @@ du 1er octobre 2021. champ d'application CalculAidePersonnaliséeLogementAccessionPropriété sous condition date_courante >=@ |2021-10-01|: - définition montant_forfaitaire_charges_d832_10 égal à + étiquette base définition montant_forfaitaire_charges_d832_10 égal à 54,22 € +€ 12,29 € *€ (entier_vers_décimal de nombre_personnes_à_charge) ``` @@ -2643,13 +2599,13 @@ Majoration par personne à charge 12,29 ```catala champ d'application CalculAidePersonnaliséeLogementAccessionPropriété sous condition date_courante >=@ |2021-10-01|: - exception définition montant_forfaitaire_charges_d832_10 sous condition - copropriété - conséquence égal à - (selon situation_familiale_calcul_apl sous forme - -- PersonneSeule: 27,10€ - -- Couple: 54,22€) +€ - 12,29 € *€ (entier_vers_décimal de nombre_personnes_à_charge) + exception base définition montant_forfaitaire_charges_d832_10 sous condition + copropriété + conséquence égal à + (selon situation_familiale_calcul_apl sous forme + -- PersonneSeule: 27,10€ + -- Couple: 54,22€) +€ + 12,29 € *€ (entier_vers_décimal de nombre_personnes_à_charge) ``` NOTA : @@ -2813,6 +2769,8 @@ champ d'application CalculAidePersonnaliséeLogementFoyer: I. - Les pourcentages et les tranches de ressources intervenant dans le calcul de l'équivalence de loyer et de charges locatives minimale « E0 », mentionnés à l'article D. 832-26 du même code, sont fixés comme suit : +a) Au premier alinéa : + 1° 4,00 % pour la tranche de ressources inférieure ou égale à 1 948,10 euros ; 2° 10,40 % pour la tranche de ressources comprise entre 1 948,10 euros et 2 678,71 euros ; @@ -2826,57 +2784,83 @@ de charges locatives minimale « E0 », mentionnés à l'article D. 832-26 du m 6° 48,00 % pour la tranche de ressources supérieure à 6 331,29 euros. ```catala -champ d'application CalculAidePersonnaliséeLogementFoyer: +champ d'application CalculÉquivalenceLoyerMinimale: définition tranches_revenus_d832_26 égal à [ - TrancheRevenu { -- haut: Revenu contenu 1948,10€ -- bas: 0€ -- taux: 4%}; TrancheRevenu { - -- haut: Revenu contenu 2678,71€ + -- haut: LimiteTranche.Revenu contenu 1948,10€ + -- bas: 0€ + -- taux: 4% + }; + TrancheRevenu { + -- haut: LimiteTranche.Revenu contenu 2678,71€ -- bas: 1948,10€ -- taux: 10,40% }; TrancheRevenu { - -- haut: Revenu contenu 3896,18€ + -- haut: LimiteTranche.Revenu contenu 3896,18€ -- bas: 2678,71€ -- taux: 21,60% }; TrancheRevenu { - -- haut: Revenu contenu 5 357,44€ + -- haut: LimiteTranche.Revenu contenu 5 357,44€ -- bas: 3896,18€ -- taux: 26,40% }; TrancheRevenu { - -- haut: Revenu contenu 6 331,29€ + -- haut: LimiteTranche.Revenu contenu 6 331,29€ -- bas: 5 357,44€ -- taux: 32% }; - TrancheRevenu { -- haut: Infini -- bas: 6 331,29€ -- taux: 48%} + TrancheRevenu { + -- haut: LimiteTranche.Infini + -- bas: 6 331,29€ + -- taux: 48% + } ] +``` - # Cette exception ne figure pas dans le texte de l'arrête mais cette absence - # nous a été confirmée comme une erreur de recodification par DLGAN/DHUP/FE4 - # le 30/05/2022. Les valeurs et taux des tranches exceptionnelles sont - # décrites dans les éléments de calcul publiés par ce même bureau (page 33): - # https://www.ecologie.gouv.fr/sites/default/files/les_aides_personnelles_au_logement_element_de_calcul_septembre_2021.pdf +b) Au deuxième alinéa : + +1° 0 % pour la tranche de ressources inférieure ou égale à 1 423,03 euros ; + +2° 2,40 % pour la tranche de ressources comprise entre 1 423,03 euros et 2 047,61 euros ; + +3° 20,80 % pour la tranche de ressources comprise entre 2 047,61 et 2 629,85 euros ; + +4° 23,20 % pour la tranche de ressources comprise entre 2 629,85 euros et 4 095,05 euros ; + +5° 32,80 % pour la tranche de ressources supérieure à 4 095,05 euros. + +```catala +champ d'application CalculÉquivalenceLoyerMinimale: exception définition tranches_revenus_d832_26 sous condition condition_2_du_832_25 conséquence égal à [ - TrancheRevenu { -- haut: Revenu contenu 1423,03€ -- bas: 0€ -- taux: 0%}; TrancheRevenu { - -- haut: Revenu contenu 2047,61€ + -- haut: LimiteTranche.Revenu contenu 1423,03€ + -- bas: 0€ + -- taux: 0% + }; + TrancheRevenu { + -- haut: LimiteTranche.Revenu contenu 2047,61€ -- bas: 1423,03€ -- taux: 2,40% }; TrancheRevenu { - -- haut: Revenu contenu 2629,85€ + -- haut: LimiteTranche.Revenu contenu 2629,85€ -- bas: 2047,61€ -- taux: 20,80% }; TrancheRevenu { - -- haut: Revenu contenu 4095,05€ + -- haut: LimiteTranche.Revenu contenu 4095,05€ -- bas: 2629,85€ -- taux: 23,20% }; - TrancheRevenu { -- haut: Infini -- bas: 4095,05€ -- taux: 32,80%} + TrancheRevenu { + -- haut: LimiteTranche.Infini + -- bas: 4095,05€ + -- taux: 32,80% + } ] ``` @@ -2884,7 +2868,7 @@ II. - Les montants forfaitaires mentionnés aux premier et deuxième alinéas so fixés respectivement à 45,57 et 76,32. ```catala -champ d'application CalculAidePersonnaliséeLogementFoyer: +champ d'application CalculÉquivalenceLoyerMinimale: définition montant_forfaitaire_d832_26 égal à si condition_2_du_832_25 alors 76,32 € sinon 45,57 € ``` @@ -2983,7 +2967,7 @@ Certificats datés I 263,97 318,12 342,04 351,60 361,48 II 231,58 283,88 307,32 317,97 328,92 339,72 363,78 31,63 - III 217,23 263,50 2987,27 299,15 311,18 323,06 347,13 30,09 + III 217,23 263,50 287,27 299,15 311,18 323,06 347,13 30,09 Certificats datés I 267,14 321,94 346,14 355,82 365,82 375,64 383,61 33,41 à partir du @@ -3095,16 +3079,6 @@ Conformément à l'article 2 de l'arrêté du 3 janvier 2020 ( NOR : LOGL1934006 pour les prestations dues à compter du 1er janvier 2020. ```catala -# Dans le bloc "Certificats datés à partir du 01/07/02", dans la ligne -# correspondant à la zone III, dans la colonne "C+1", il est inscrit la valeur -# "2987,27" qui est clairement aberrante par rapport aux autres valeurs. -# Selon DGALN/DHUP/FE4 en date du 01/06/2022, la bonne valeur est "287,27" -# qui provient de l'article 2 de l'arrêté du 20 décembre 2002 relatif à la -# revalorisation des aides au logement - -champ d'application CalculAllocationLogementAccessionPropriété: - définition taux_francs_vers_euros égal à (1,0 /. 6,55957) - champ d'application CalculAllocationLogementAccessionPropriété sous condition date_courante >=@ |2020-01-01|: @@ -3512,8 +3486,6 @@ champ d'application CalculAllocationLogementAccessionPropriété sous condition -- PersonneSeule: 217,23 € -- Couple: 263,50€) sinon - # Première valeur différente de ce qui est marqué selon mail de - # DGALN/DHUP/FE4 du 01/06/2022. (si nombre_personnes_à_charge = 1 alors 287,27 € sinon (si nombre_personnes_à_charge = 2 alors 299,15 € sinon (si nombre_personnes_à_charge = 3 alors 311,18 € sinon diff --git a/examples/aides_logement/autres_sources.catala_fr b/examples/aides_logement/autres_sources.catala_fr index c0945740..2bf04a7e 100644 --- a/examples/aides_logement/autres_sources.catala_fr +++ b/examples/aides_logement/autres_sources.catala_fr @@ -154,11 +154,12 @@ ces dispositions entrent en vigueur le 1er janvier 2020. # Conseil d'État, 5ème - 4ème chambres réunies, 21/07/2017, 398563 | CETATEXT000035260342 RÉPUBLIQUE FRANCAISE + AU NOM DU PEUPLE FRANCAIS Vu la procédure suivante : -M. A...B...a demandé au tribunal administratif de Rennes d'annuler la décision +M. A... B... a demandé au tribunal administratif de Rennes d'annuler la décision du 15 octobre 2014 par laquelle la caisse d'allocations familiales les Côtes-d'Armor, après avis de la commission de recours amiable, a refusé de lui accorder le bénéfice de l'aide personnalisée au logement. Par un jugement @@ -170,7 +171,6 @@ du contentieux du Conseil d'Etat le 6 avril et le 5 juillet 2016, le ministre du logement et de l'habitat durable demande au Conseil d'Etat d'annuler ce jugement. - Vu les autres pièces du dossier ; Vu : @@ -257,9 +257,23 @@ champ d'application CalculetteAidesAuLogementGardeAlternée: de l'habitat durable n'est pas fondé à demander l'annulation du jugement qu'il attaque ; -D E C I D E : --------------- +DECIDE : Article 1er : Le pourvoi du ministre du logement et de l'habitat durable est rejeté. + Article 2 : La présente décision sera notifiée au ministre de la cohésion des territoires, à M. A... B...et à la caisse d'allocations familiales des Côtes-d'Armor. + +# Règlement (CE) n°2866/98 du conseil du 31 décembre 1998 concernant les taux de conversion entre l'euro et les monnaies des États membres adoptant l'euro + +## Article premier + +1 euro = 6,55957 francs français + +```catala +champ d'application CalculAidePersonnaliséeLogementAccessionPropriété: + définition taux_francs_vers_euros égal à (1,0 /. 6,55957) + +champ d'application CalculAllocationLogementAccessionPropriété: + définition taux_francs_vers_euros égal à (1,0 /. 6,55957) +``` diff --git a/examples/aides_logement/code_construction_reglementaire.catala_fr b/examples/aides_logement/code_construction_reglementaire.catala_fr index 51bc3761..a3f4ae33 100644 --- a/examples/aides_logement/code_construction_reglementaire.catala_fr +++ b/examples/aides_logement/code_construction_reglementaire.catala_fr @@ -83,8 +83,6 @@ applicables à ces catégories de prêts et le droit à l'allocation de logement est éteint à compter de l'ouverture du droit à l'aide personnalisée. ```catala -# TODO juridique: quelle est la différence entre "allocation de logement" et -# "aide personnalisée". # Hypothèse : peut-être que cet article est une disposition de transition avec # la période où les allocations de logement n'étaient pas fusionnées en aide # personnalisée au logement. @@ -142,13 +140,17 @@ droit à celle-ci. ```catala champ d'application RessourcesAidesPersonnelleLogement: assertion pour tout personne dans personnes_vivant_habituellement_foyer on a - personne.durée_résidence_durant_période_r_822_3_1 >=^ 6 mois -# TODO informatique et juridique: la comparaison avec 6 mois est ambiguë! -# Ici on pourrait coder ça de manière beaucoup plus précise en tenant compte -# des différentes périodes mentionnées et en forçant l'utilisateur à bien -# remplir toutes ses périodes de résidence mais cela rendrait le formulaire -# plus lourd et ne correspondrait peut-être pas au besoin d'un système expert -# comme celui utilisé à la CNAF. + personne.durée_résidence_durant_période_r_822_3_1_supérieure_à_6_mois + # Ici on pourrait coder ça de manière beaucoup plus précise en tenant compte + # des différentes périodes mentionnées et en forçant l'utilisateur à bien + # remplir toutes ses périodes de résidence mais cela rendrait le formulaire + # plus lourd et ne correspondrait peut-être pas au besoin d'un système expert + # comme celui utilisé à la CNAF. On pourrait également laisser l'utilisateur + # spécifier une durée en jours mais cela aurait deux inconvénients : + # premièrement c'est une intrusion dans la vie privée du potentiel + # bénéficiaire (cette information serait nécéssaire en cas de contrôle mais + # pas dans tous les cas), et deuxièmement la comparaison d'un nombre de jours + # avec "6 mois" est computationellement ambiguë. ``` NOTA: @@ -1172,15 +1174,18 @@ champ d'application ÉligibilitéAidesPersonnelleLogement: -- EnfantÀCharge de enfant: faux -- AutrePersonneÀCharge de parent: parent.parenté = Ascendant et - parent.AutrePersonneÀCharge.ressources <=€ plafond_individuel_l815_9_sécu *€ 1,25 et + parent.AutrePersonneÀCharge.ressources <=€ + plafond_individuel_l815_9_sécu *€ 1,25 et ( - (parent.AutrePersonneÀCharge.âge >=^ âge_l351_8_1_sécu ou - # TODO informatique: changer l'encodage de âge vers un entier - (parent.titulaire_allocation_personne_âgée et - parent.AutrePersonneÀCharge.âge >=^ 65 an) + (parent.AutrePersonneÀCharge.date_naissance +@ + âge_l351_8_1_sécu <=@ date_courante ou + (parent.titulaire_allocation_personne_âgée et + parent.AutrePersonneÀCharge.date_naissance +@ 65 an <=@ + date_courante) ) ou - (parent.AutrePersonneÀCharge.âge >=^ âge_l161_17_2_sécu et - parent.bénéficiaire_l161_19_l351_8_l643_3_sécu) + (parent.AutrePersonneÀCharge.date_naissance +@ + âge_l161_17_2_sécu <=@ date_courante et + parent.bénéficiaire_l161_19_l351_8_l643_3_sécu) ) conséquence rempli @@ -1850,7 +1855,7 @@ d'un mois à compter de la date de remboursement du solde du prêt. Pour les ménages mentionnés au 1° de l'article D. 823-9, le montant mensuel de l'aide est calculé selon la formule suivante : -$$\text{Af} = \text{L} + \text{C}-\text{Pp}$$ +$$\textrm{Af} = \textrm{L} + \textrm{C}-\textrm{Pp}$$ ```catala champ d'application CalculAidePersonnaliséeLogementLocatif: @@ -1991,7 +1996,7 @@ La participation personnelle du ménage, mentionnée au 4° de l'article D. 823- la somme d'une participation minimale et d'une participation au titre des ressources du ménage, calculée selon la formule suivante : -$$\text{Pp} = \text{P0} + \text{Tp}* (\text{R}-\text{R0})$$ +$$\textrm{Pp} = \textrm{P0} + \textrm{Tp}* (\textrm{R}-\textrm{R0})$$ ```catala champ d'application CalculAidePersonnaliséeLogementLocatif: @@ -2134,8 +2139,9 @@ champ d'application ÉligibilitéPrimeDeDéménagement: (selon date_naissance_ou_grossesse sous forme -- AvantPremierJourMoisCivilTroisièmeMoisDeGrossesse: faux -- AprèsPremierJourMoisCivilTroisièmeMoisDeGrossesse: vrai - -- DernierJourMoisPrécédantDateDeNaissance de date_naissance: - date_courante <=@ date_naissance +@ 2 an) + -- DateDeNaissance de date_naissance: + date_courante <=@ + ((premier_jour_du_mois de (date_naissance +@ 2 an))) +@ (-1 jour)) ) conséquence rempli @@ -3136,7 +3142,7 @@ ou les titulaires d'un contrat de location-accession conclu dans les conditions au 6° de l'article L. 831-1, le montant mensuel de l'aide est calculé selon la formule et les modalités suivantes : -$$\text{Af} = \text{K} \times (\text{L} + \text{C}-\text{L0})$$ +$$\textrm{Af} = \textrm{K} \times (\textrm{L} + \textrm{C}-\textrm{L0})$$ ```catala champ d'application CalculAidePersonnaliséeLogementAccessionPropriété: @@ -3252,7 +3258,7 @@ champ d'application CalculAidePersonnaliséeLogementAccessionPropriété: Le coefficient " K ", mentionné au 2° de l'article D. 832-10, est ainsi calculé selon la formule et les modalités suivantes : -$$\text{K} = 0,95 - \frac{\text{R}}{\text{cm} \times \text{N}}$$ +$$\textrm{K} = 0,95 - \frac{\textrm{R}}{\textrm{cm} \times \textrm{N}}$$ ```catala champ d'application CalculAidePersonnaliséeLogementAccessionPropriété: @@ -3273,8 +3279,6 @@ Lorsque le calcul le porte à une valeur supérieure à 0,95, il est considéré ```catala champ d'application CalculAidePersonnaliséeLogementAccessionPropriété: définition coefficient_prise_en_charge_d832_10 état arrondi égal à - # Cette formule implémente bien l'arrondi à deux décimales par défaut, - # à partir d'un arrondi au plus proche à l'unité. (arrondi_décimal de ((coefficient_prise_en_charge_d832_10 -. 0,005) *. 100,0)) /. 100,0 définition coefficient_prise_en_charge_d832_10 état seuil égal à @@ -3323,7 +3327,7 @@ majoration par personne à charge supplémentaire 0,5 ------------------------------------------------------------ --- ```catala -champ d'application CalculAidePersonnaliséeLogementAccessionPropriété: +champ d'application CalculNombrePartsAccessionPropriété: définition n_nombre_parts_d832_11 égal à si nombre_personnes_à_charge = 0 alors selon situation_familiale_calcul_apl sous forme @@ -3341,6 +3345,14 @@ champ d'application CalculAidePersonnaliséeLogementAccessionPropriété: ( 4,3 +. (0,5 *. (entier_vers_décimal de (nombre_personnes_à_charge - 4)))) )))) + +champ d'application CalculAidePersonnaliséeLogementAccessionPropriété: + définition n_nombre_parts_d832_11 égal à + calcul_nombre_parts.n_nombre_parts_d832_11 + définition calcul_nombre_parts.nombre_personnes_à_charge égal à + nombre_personnes_à_charge + définition calcul_nombre_parts.situation_familiale_calcul_apl égal à + situation_familiale_calcul_apl ``` ####### Article D832-12 | LEGIARTI000039048893 @@ -3481,25 +3493,48 @@ se situent les ressources ; champ d'application CalculAidePersonnaliséeLogementAccessionPropriété: définition mensualité_minimale sous condition - type_travaux_logement sous forme SurLocauxNonHabitation + type_travaux_logement sous forme TravauxPourAcquisitionD832_15_1 ou + # Comment interpetéter le R832-5 dans + # le cas d'un prêt conventionné D331-63 alinéa 3° où le prêt finance + # l'acquisition d'un logement existant sans travaux et donc sans + # amélioration; le demandeur est-il éligible à l'APL de ce cas et si oui, + # peut-on nous confirmer que le montant de la mensualité minimale est bien + # calculée selon l'alinéa 1° de D832-15 ? + # Réponse de DGALN/DHUP/FE4 le 25/05/2022: + # "Le demandeur est éligible à l’APL qui est calculée selon l’alinéa 1° + # du D832-15. Le 2° ne concerne que les travaux d’amélioration." + # La réponse à notre question est bien oui pour les deux items, + # d'où la ligne ci-dessous. + type_travaux_logement sous forme TypeTravauxLogementD832_15.PasDeTravaux conséquence égal à - # Pour la tranche supérieure - (si ressources_ménage_arrondies -€ montant_limite_tranches_d832_15_1 *€ - n_nombre_parts_d832_11 >=€ 0€ - alors - (ressources_ménage_arrondies -€ montant_limite_tranches_d832_15_1 *€ - n_nombre_parts_d832_11) *€ - taux_tranche_supérieure_d832_15_1 - sinon 0 €) +€ - # Pour la tranche inférieure - (si ressources_ménage_arrondies -€ montant_limite_tranches_d832_15_1 *€ - n_nombre_parts_d832_11 <=€ 0€ - alors - ressources_ménage_arrondies *€ taux_tranche_inférieure_d832_15_1 - sinon - (montant_limite_tranches_d832_15_1 *€ - taux_tranche_inférieure_d832_15_1)) - *€ (1,0/.12,0) + # Selon un mail de DGALN/DHUP/FE4 du 19/07/2022, il nest nécessaire pour le + # calcul de cette mensualité minimale de garder une précision infinie + # durant toutes les étapes du calcul. En Catala, nous utilisons donc le type + # décimal plutôt que argent qui arrondi systématiquement au centime près + # à chaque étape de calcul. + décimal_vers_argent de ( + ((si + # Pour la tranche supérieure + argent_vers_décimal de ressources_ménage_arrondies >=. + (argent_vers_décimal de montant_limite_tranches_d832_15_1 *. + n_nombre_parts_d832_11) + alors + ((argent_vers_décimal de ressources_ménage_arrondies -. + (argent_vers_décimal de montant_limite_tranches_d832_15_1 *. + n_nombre_parts_d832_11)) *. taux_tranche_supérieure_d832_15_1) + sinon 0,0) +. + (si + # Pour la tranche inférieure + argent_vers_décimal de ressources_ménage_arrondies <=. + argent_vers_décimal de montant_limite_tranches_d832_15_1 *. + n_nombre_parts_d832_11 + alors + argent_vers_décimal de ressources_ménage_arrondies *. + taux_tranche_inférieure_d832_15_1 + sinon + ((argent_vers_décimal de montant_limite_tranches_d832_15_1 *. + n_nombre_parts_d832_11) *. + taux_tranche_inférieure_d832_15_1))) /. 12,0) # PS: les ressources ont déjà été arrondies, voir D823-17. ``` @@ -3509,40 +3544,18 @@ mensualité minimale " L0 " se substitue à l'équivalence minimale de loyer et charges " E0 ". ```catala -champ d'application CalculAidePersonnaliséeLogement: - # Ce calcul marche car l'équivalence minimale de loyers ne dépend que - # de la situation familiale et des ressources du ménage. Afin de bien - # avoir le premier alinéa du D832-26 et non le second, il nous faut remettre - # à zéro la condition_2_du_832_25 qui contrôle dans le champ d'application - # CalculAidePersonnaliséeLogementFoyer comment l'équivalence minimale de loyer - # est calculée. - - définition logement_foyer.condition_2_du_832_25 sous condition - catégorie_calcul_apl sous forme AccessionPropriété - conséquence égal à faux - - # TODO recherche: citer cette structure de calcul comme un bon cas d'usage - # de la fonctionnalité "contexte" de Catala. - définition accession_propriété.équivalence_minimale_loyer égal à - logement_foyer.équivalence_minimale_loyer - champ d'application CalculAidePersonnaliséeLogementAccessionPropriété: définition mensualité_minimale sous condition - type_travaux_logement sous forme SurLogementExistant ou - # Comment interpetéter le R832-5 dans - # le cas d'un prêt conventionné D331-63 alinéa 3° où le prêt finance - # l'acquisition d'un logement existant sans travaux et donc sans - # amélioration; le demandeur est-il éligible à l'APL de ce cas et si oui, - # peut-on nous confirmer que le montant de la mensualité minimale est bien - # calculée selon l'alinéa 2° de D832-15 ? - # Réponse de DGALN/DHUP/FE4 le 25/05/2022: - # "Le demandeur est éligible à l’APL qui est calculée selon l’alinéa 1° - # du D832-15. Le 2° ne concerne que les travaux d’amélioration." - # La réponse à notre question est bien oui pour les deux items, - # d'où la ligne ci-dessous. - type_travaux_logement sous forme TypeTravauxLogementD832_15.PasDeTravaux + type_travaux_logement sous forme TravauxSurLogementDéjàAcquisD832_15_2 conséquence égal à - équivalence_minimale_loyer + calcul_équivalence_loyer_minimale.montant + + # Mettre la condition à "faux" permet d'activer le premier alinéa de D832-26 + définition calcul_équivalence_loyer_minimale.condition_2_du_832_25 égal à faux + définition calcul_équivalence_loyer_minimale.ressources_ménage_arrondies + égal à ressources_ménage_arrondies + définition calcul_équivalence_loyer_minimale.n_nombre_parts_d832_25 égal à + n_nombre_parts_d832_11 ``` ####### Article D832-16 | LEGIARTI000041477280 @@ -3685,6 +3698,10 @@ déclaration énumération TypeLogementFoyer: -- LogementPersonnesÂgéesOuHandicapées -- RésidenceSociale -- FoyerJeunesTrvailleursOuMigrantsConventionnéL353_2Avant1995 + -- Autre # TODO juridique: confirmer la présence de ce variant autre + # qui correspond aux logement mentionnés au R832-21, bien que + # la formulation de R832-20 semble impliquer que seuls les 3 + # variants du dessus existent. ``` ######## Article R832-21 | LEGIARTI000039048891 @@ -3777,15 +3794,15 @@ sous réserve que les autres conditions d'ouverture du droit soient réunies à Pour les ménages résidant dans un logement-foyer mentionné à l'article R. 832-22, le montant mensuel de l'aide est calculé selon la formule et les modalités suivantes : -$$\text{Af} = \text{K} \times (\text{E}-\text{E0})$$ +$$\textrm{Af} = \textrm{K} \times (\textrm{E}-\textrm{E0})$$ ```catala champ d'application CalculAidePersonnaliséeLogementFoyer: définition aide_finale_formule égal à - si (équivalence_loyer_éligible -€ équivalence_minimale_loyer) *€ + si (équivalence_loyer_éligible -€ équivalence_loyer_minimale) *€ coefficient_prise_en_charge_d832_25 <€ 0 € alors 0 € sinon - ((équivalence_loyer_éligible -€ équivalence_minimale_loyer) *€ + ((équivalence_loyer_éligible -€ équivalence_loyer_minimale) *€ coefficient_prise_en_charge_d832_25) ``` @@ -3812,6 +3829,18 @@ champ d'application CalculAidePersonnaliséeLogementFoyer: 4° " E0 " est l'équivalence de loyer et de charges locatives minimale ; elle est calculée selon les dispositions de l'article D. 832-26. +```catala +champ d'application CalculAidePersonnaliséeLogementFoyer: + définition équivalence_loyer_minimale égal à + calcul_équivalence_loyer_minimale.montant + définition calcul_équivalence_loyer_minimale.condition_2_du_832_25 égal à + condition_2_du_832_25 + définition calcul_équivalence_loyer_minimale.ressources_ménage_arrondies + égal à ressources_ménage_arrondies + définition calcul_équivalence_loyer_minimale.n_nombre_parts_d832_25 égal à + n_nombre_parts_d832_25 +``` + Le montant ainsi calculé est minoré d'un montant fixé forfaitairement par arrêté. ```catala @@ -3903,7 +3932,7 @@ champ d'application CalculAidePersonnaliséeLogementFoyer: 1° -$$\text{K} = 0,95 - \frac{\text{R} - \text{r} \times \text{N}}{\text{cm} \times \text{N}}$$ +$$\textrm{K} = 0,95 - \frac{\textrm{R} - \textrm{r} \times \textrm{N}}{\textrm{cm} \times \textrm{N}}$$ ```catala champ d'application CalculAidePersonnaliséeLogementFoyer: @@ -3924,8 +3953,6 @@ calcul le porte à une valeur supérieure à 0,95, il est considéré égal à 0 ```catala champ d'application CalculAidePersonnaliséeLogementFoyer: définition coefficient_prise_en_charge_d832_25 état arrondi égal à - # Cette formule implémente bien l'arrondi à deux décimales par défaut, - # à partir d'un arrondi au plus proche à l'unité. (arrondi_décimal de ((coefficient_prise_en_charge_d832_25 -. 0,005) *. 100,0)) /. 100,0 définition coefficient_prise_en_charge_d832_25 état seuil égal à @@ -3954,7 +3981,7 @@ majoration par personne à charge supplémentaire 0,5 ------------------------------------------------------------- --- ```catala -champ d'application CalculAidePersonnaliséeLogementFoyer: +champ d'application CalculNombrePartLogementFoyer: définition n_nombre_parts_d832_25 égal à si nombre_personnes_à_charge = 0 alors selon situation_familiale_calcul_apl sous forme @@ -3972,11 +3999,21 @@ champ d'application CalculAidePersonnaliséeLogementFoyer: ( 4,3 +. (0,5 *. (entier_vers_décimal de (nombre_personnes_à_charge - 4)))) )))) + +champ d'application CalculAidePersonnaliséeLogementFoyer: + définition calcul_nombre_parts.nombre_personnes_à_charge égal à + nombre_personnes_à_charge + définition calcul_nombre_parts.situation_familiale_calcul_apl égal à + situation_familiale_calcul_apl + définition calcul_nombre_parts.condition_2_du_832_25 égal à + condition_2_du_832_25 + définition n_nombre_parts_d832_25 égal à + calcul_nombre_parts.n_nombre_parts_d832_25 ``` 2° -$$\text{K} = 0,90 - \frac{\text{R}}{\text{cm} \times \text{N}}$$ +$$\textrm{K} = 0,90 - \frac{\textrm{R}}{\textrm{cm} \times \textrm{N}}$$ ```catala champ d'application CalculAidePersonnaliséeLogementFoyer: @@ -4001,8 +4038,6 @@ champ d'application CalculAidePersonnaliséeLogementFoyer: sous condition condition_2_du_832_25 conséquence égal à - # Cette formule implémente bien l'arrondi à deux décimales par défaut, - # à partir d'un arrondi au plus proche à l'unité. (arrondi_décimal de ((coefficient_prise_en_charge_d832_25 -. 0,005) *. 100,0)) /. 100,0 exception définition coefficient_prise_en_charge_d832_25 état seuil @@ -4032,7 +4067,7 @@ majoration par personne à charge supplémentaire 0,5 ------------------------------------------------------------ --- ```catala -champ d'application CalculAidePersonnaliséeLogementFoyer: +champ d'application CalculNombrePartLogementFoyer: exception définition n_nombre_parts_d832_25 sous condition condition_2_du_832_25 conséquence égal à @@ -4063,34 +4098,52 @@ de l'article D. 832-25. Le résultat est majoré du produit d'un montant forfait nombre de parts " N ", le total étant divisé par douze. ```catala -champ d'application CalculAidePersonnaliséeLogementFoyer: +# Selon un mail de DGALN/DHUP/FE4 du 19/07/2022, il nest nécessaire pour le +# calcul de cette équivalence de loyer de garder une précision infinie durant +# toutes les étapes du calcul. En Catala, nous utilisons donc le type +# décimal plutôt que argent qui arrondi systématiquement au centime près +# à chaque étape de calcul. +champ d'application CalculÉquivalenceLoyerMinimale: définition tranches_revenus_d832_26_multipliées égal à application pour tranche dans tranches_revenus_d832_26 de - TrancheRevenu { - -- haut: (selon tranche.haut sous forme - -- Infini: Infini - -- Revenu de tranche_haut: - Revenu contenu (tranche_haut *€ n_nombre_parts_d832_25)) - -- bas: tranche.bas *€ n_nombre_parts_d832_25 - -- taux: tranche.taux + TrancheRevenuDécimal { + -- haut: (selon tranche.TrancheRevenu.haut sous forme + -- LimiteTranche.Infini: LimiteTrancheDécimal.Infini + -- LimiteTranche.Revenu de tranche_haut: + LimiteTrancheDécimal.Revenu contenu + ((argent_vers_décimal de tranche_haut) *. n_nombre_parts_d832_25)) + -- bas: argent_vers_décimal de tranche.TrancheRevenu.bas *. + n_nombre_parts_d832_25 + -- taux: tranche.TrancheRevenu.taux } - définition équivalence_minimale_loyer égal à - (((somme argent pour tranche dans tranches_revenus_d832_26_multipliées de - (si ressources_ménage_arrondies <=€ tranche.bas - alors 0€ - sinon - (selon tranche.haut sous forme - -- Revenu de tranche_haut: - (si ressources_ménage_arrondies >=€ tranche_haut - alors - (tranche_haut -€ tranche.bas) *€ tranche.taux - sinon - ((ressources_ménage_arrondies -€ tranche.bas) *€ tranche.taux)) - -- Infini: - (ressources_ménage_arrondies -€ tranche.bas) *€ tranche.taux) - ))) +€ - montant_forfaitaire_d832_26 *€ n_nombre_parts_d832_25) *€ (1,0 /. 12,0) + définition montant égal à + décimal_vers_argent de ( + (((somme décimal pour tranche dans tranches_revenus_d832_26_multipliées de + (si + argent_vers_décimal de ressources_ménage_arrondies <=. + tranche.TrancheRevenuDécimal.bas + alors 0,0 + sinon + (selon tranche.TrancheRevenuDécimal.haut sous forme + -- LimiteTrancheDécimal.Revenu de tranche_haut: + (si + argent_vers_décimal de ressources_ménage_arrondies >=. + tranche_haut + alors + (tranche_haut -. tranche.TrancheRevenuDécimal.bas) *. + tranche.TrancheRevenuDécimal.taux + sinon + (((argent_vers_décimal de ressources_ménage_arrondies) -. + tranche.TrancheRevenuDécimal.bas) *. + tranche.TrancheRevenuDécimal.taux)) + -- LimiteTrancheDécimal.Infini: + (argent_vers_décimal de ressources_ménage_arrondies -. + tranche.TrancheRevenuDécimal.bas) *. + tranche.TrancheRevenuDécimal.taux) + ))) +. + argent_vers_décimal de montant_forfaitaire_d832_26 *. + n_nombre_parts_d832_25) /. 12,0) ``` Toutefois, pour les logements-foyers de jeunes travailleurs et pour les résidences sociales @@ -4100,8 +4153,35 @@ multipliées par le nombre de parts " N " défini au d du 2° de l'article D. 83 est majoré d'un montant forfaitaire, le total étant alors divisé par douze. ```catala -# Contrairement au texte de loi, nous avons factorisé le code (définition de -# n_nombre_parts_d832_25 avec case de base et exception pour le 1° et 2°). +champ d'application CalculÉquivalenceLoyerMinimale: + exception définition montant sous condition + condition_2_du_832_25 + conséquence égal à + décimal_vers_argent de ( + (((somme décimal pour tranche dans tranches_revenus_d832_26_multipliées de + (si + argent_vers_décimal de ressources_ménage_arrondies <=. + tranche.TrancheRevenuDécimal.bas + alors 0,0 + sinon + (selon tranche.TrancheRevenuDécimal.haut sous forme + -- LimiteTrancheDécimal.Revenu de tranche_haut: + (si + argent_vers_décimal de ressources_ménage_arrondies >=. + tranche_haut + alors + (tranche_haut -. tranche.TrancheRevenuDécimal.bas) *. + tranche.TrancheRevenuDécimal.taux + sinon + (((argent_vers_décimal de ressources_ménage_arrondies) -. + tranche.TrancheRevenuDécimal.bas) *. + tranche.TrancheRevenuDécimal.taux)) + -- LimiteTrancheDécimal.Infini: + (argent_vers_décimal de ressources_ménage_arrondies -. + tranche.TrancheRevenuDécimal.bas) *. + tranche.TrancheRevenuDécimal.taux) + ))) +. + argent_vers_décimal de montant_forfaitaire_d832_26) /. 12,0) ``` Les pourcentages et le coefficient " N " sont appliqués à la limite supérieure de l'intervalle @@ -4352,7 +4432,7 @@ champ d'application ÉligibilitéAllocationLogement: Pour les ménages mentionnés à l'article R. 842-5, le montant mensuel de l'allocation est calculé selon la formule et les modalités suivantes : -$$\text{Af} = \text{K} \times (\text{L} + \text{C}-\text{L0})$$ +$$\textrm{Af} = \textrm{K} \times (\textrm{L} + \textrm{C}-\textrm{L0})$$ ```catala champ d'application CalculAllocationLogementAccessionPropriété: @@ -4377,6 +4457,13 @@ champ d'application CalculAllocationLogementAccessionPropriété: # foyer prenne bien le 2° du D832-25 et non pas le 1°. définition calcul_apl_logement_foyer.condition_2_du_832_25 égal à vrai + # Attention ! Le calcul de K dépend également du nombre de parts N, qui + # est différent selon que l'on soit en secteur accession-propriété ou + # en secteur logement-foyer. Ici, nous sommes en secteur accession + # propriété donc il faut que le nombre de parts pris en compte pour le calcul + # soit le nombre de parts accession-propriété. + définition calcul_apl_logement_foyer.n_nombre_parts_d832_25 égal à + calcul_nombre_parts.n_nombre_parts_d832_11 définition coefficient_prise_en_charge égal à calcul_apl_logement_foyer.coefficient_prise_en_charge_d832_25 @@ -4405,7 +4492,18 @@ l'article D. 832-26, dans lesquelles elle se substitue à " E0 ". ```catala champ d'application CalculAllocationLogementAccessionPropriété: définition mensualité_minimale égal à - calcul_apl_logement_foyer.équivalence_minimale_loyer + calcul_équivalence_loyer_minimale.montant + + # Mettre la condition à "faux" permet d'activer le deuxième alinéa de D832-26 + définition calcul_équivalence_loyer_minimale.condition_2_du_832_25 égal à vrai + définition calcul_équivalence_loyer_minimale.ressources_ménage_arrondies + égal à ressources_ménage_arrondies + définition calcul_équivalence_loyer_minimale.n_nombre_parts_d832_25 égal à + calcul_nombre_parts.n_nombre_parts_d832_11 + définition calcul_nombre_parts.nombre_personnes_à_charge égal à + nombre_personnes_à_charge + définition calcul_nombre_parts.situation_familiale_calcul_apl égal à + situation_familiale_calcul_apl ``` Ce résultat, ainsi calculé, est minoré d'un montant fixé forfaitairement par arrêté. @@ -4721,8 +4819,14 @@ application du III de l'article 12 de la loi n° 57-908 du 7 août 1957 tendant à favoriser la construction de logements et les équipements collectifs. ```catala -# TODO informatique: dépend du refactoring pour dégager les règles communes -# d'éligibilité aux aides personnelles au logement. Ceci est une exception. +champ d'application ÉligibilitéAllocationLogement sous condition + selon ménage.logement.mode_occupation sous forme + -- RésidentLogementFoyer de logement_foyer: + logement_foyer.construit_application_loi_1957_12_III + -- n'importe quel: faux: + + règle éligibilité_commune.condition_logement_résidence_principale rempli + règle éligibilité_commune.condition_logement_surface rempli ``` ####### Article D842-15 | LEGIARTI000038878655 @@ -4733,7 +4837,7 @@ d'un logement-foyer défini à l'article L. 633-1 pour lesquels le montant mensu de l'aide est calculé selon les modalités précisées au 1° de l'article D. 823-9, le montant mensuel de l'aide est calculé selon la formule et les modalités suivantes : -$$\text{Af} = \text{K} \times (\text{L} + \text{C}-\text{L0})$$ +$$\textrm{Af} = \textrm{K} \times (\textrm{L} + \textrm{C}-\textrm{L0})$$ ```catala champ d'application CalculAllocationLogementFoyer: @@ -4784,10 +4888,20 @@ champ d'application CalculAllocationLogementFoyer: # En définissant comme vraie la condition du 2° de D832-25, on accède # logiquement aux disposition du deuxième alinéa de D832-26 (voir le jeu # des renvois). + définition calcul_équivalence_loyer_minimale.condition_2_du_832_25 égal à vrai + définition calcul_équivalence_loyer_minimale.ressources_ménage_arrondies + égal à ressources_ménage_arrondies - définition calcul_apl_logement_foyer.condition_2_du_832_25 égal à vrai + définition calcul_nombre_parts.nombre_personnes_à_charge égal à + nombre_personnes_à_charge + définition calcul_nombre_parts.situation_familiale_calcul_apl égal à + situation_familiale_calcul_apl + définition calcul_nombre_parts.condition_2_du_832_25 égal à vrai + + définition calcul_équivalence_loyer_minimale.n_nombre_parts_d832_25 égal à + calcul_nombre_parts.n_nombre_parts_d832_25 définition loyer_minimal égal à - calcul_apl_logement_foyer.équivalence_minimale_loyer + calcul_équivalence_loyer_minimale.montant ``` Le montant ainsi calculé est minoré d'un montant fixé forfaitairement par arrêté. diff --git a/examples/aides_logement/code_sécurité_sociale.catala_fr b/examples/aides_logement/code_sécurité_sociale.catala_fr index 0cc97f53..b4d33ee5 100644 --- a/examples/aides_logement/code_sécurité_sociale.catala_fr +++ b/examples/aides_logement/code_sécurité_sociale.catala_fr @@ -121,7 +121,7 @@ champ d'application OuvertureDroitsRetraite: champ d'application ÉligibilitéAidesPersonnelleLogement: définition ouverture_droits_retraite.date_naissance_assuré égal à - demandeur.date_naissance + demandeur.Demandeur.date_naissance définition âge_l161_17_2_sécu égal à ouverture_droits_retraite.âge_ouverture_droit ``` diff --git a/examples/aides_logement/dune b/examples/aides_logement/dune new file mode 100644 index 00000000..9396388d --- /dev/null +++ b/examples/aides_logement/dune @@ -0,0 +1,39 @@ +(rule + (targets aides_logement.ml aides_logement_api_web.ml) + (deps + (source_tree ..) + %{workspace_root}/compiler/plugins/api_web%{ext_plugin}) + (action + (chdir + %{workspace_root} + (run + catala + api_web + -t + --plugin-dir=compiler/plugins + %{dep:aides_logement.catala_fr})))) + +(rule + (targets aides_logement_schema.json) + (deps + (source_tree ..) + %{workspace_root}/compiler/plugins/json_schema%{ext_plugin}) + (action + (chdir + %{workspace_root} + (run + catala + json_schema + -t + --plugin-dir=compiler/plugins + "--scope=CalculetteAidesAuLogementGardeAltern\195\169e" + %{dep:aides_logement.catala_fr})))) + +(rule + (target aides_logement.py) + (deps + (source_tree ..)) + (action + (chdir + %{workspace_root} + (run catala Python -O %{dep:aides_logement.catala_fr})))) diff --git a/examples/aides_logement/output/allocations_logement.catala_fr.Typecheck b/examples/aides_logement/output/allocations_logement.catala_fr.Typecheck deleted file mode 100644 index cb4796c3..00000000 --- a/examples/aides_logement/output/allocations_logement.catala_fr.Typecheck +++ /dev/null @@ -1 +0,0 @@ -[RESULT] Typechecking successful! diff --git a/examples/aides_logement/prologue.catala_fr b/examples/aides_logement/prologue.catala_fr index d7e1d51c..f9406ed2 100644 --- a/examples/aides_logement/prologue.catala_fr +++ b/examples/aides_logement/prologue.catala_fr @@ -62,8 +62,8 @@ déclaration structure Propriétaire: donnée prêt contenu Prêt déclaration énumération TypeTravauxLogementD832_15: - -- SurLocauxNonHabitation - -- SurLogementExistant + -- TravauxPourAcquisitionD832_15_1 + -- TravauxSurLogementDéjàAcquisD832_15_2 -- PasDeTravaux déclaration énumération TypeTravauxLogementR842_5: @@ -107,12 +107,21 @@ déclaration structure TrancheRevenu: donnée bas contenu argent donnée taux contenu décimal +déclaration énumération LimiteTrancheDécimal: + -- Revenu contenu décimal + -- Infini + +déclaration structure TrancheRevenuDécimal: + donnée haut contenu LimiteTrancheDécimal + donnée bas contenu décimal + donnée taux contenu décimal + déclaration structure LogementFoyer: donnée type contenu TypeLogementFoyer donnée date_conventionnement contenu date donnée location contenu Location donnée remplit_conditions_r832_21 contenu booléen - donnée pour_jeunes_travailleurs_III_12_loi_1957 contenu booléen + donnée construit_application_loi_1957_12_III contenu booléen déclaration structure InformationsCalculAPLLogementFoyer: donnée redevance contenu argent @@ -163,7 +172,6 @@ déclaration structure Logement: donnée loué_ou_sous_loué_à_des_tiers contenu LouéOuSousLouéÀDesTiers donnée usufruit contenu ParentOuAutre donnée logement_decent_l89_462 contenu booléen - donnée loyers_l823_3 contenu argent donnée surface_m_carrés contenu entier donnée est_ancien_l831_2 contenu booléen donnée situé_commune_déséquilibre_l831_2 contenu booléen @@ -191,7 +199,7 @@ déclaration énumération Parenté: -- CollatéralDeuxièmeTroisièmeDegré déclaration structure AutrePersonneÀCharge: - donnée âge contenu durée + donnée date_naissance contenu date donnée ressources contenu argent donnée ascendant_descendant_collatéral_deuxième_troisième_degré contenu booléen @@ -205,7 +213,7 @@ déclaration énumération PersonneÀCharge: -- AutrePersonneÀCharge contenu AutrePersonneÀCharge déclaration énumération DateDeNaissanceOuMoisDeGrossesse: - -- DernierJourMoisPrécédantDateDeNaissance contenu date + -- DateDeNaissance contenu date -- AvantPremierJourMoisCivilTroisièmeMoisDeGrossesse -- AprèsPremierJourMoisCivilTroisièmeMoisDeGrossesse @@ -267,7 +275,8 @@ déclaration énumération InformationsCalculAPL: ```catala-metadata déclaration structure PersonneVivantHabituellementAuFoyer: - donnée durée_résidence_durant_période_r_822_3_1 contenu durée + donnée durée_résidence_durant_période_r_822_3_1_supérieure_à_6_mois + contenu booléen donnée ressources contenu argent déclaration énumération PaiementLogementDistinctProfessionnel: @@ -306,12 +315,12 @@ déclaration champ d'application ÉligibilitéAidesPersonnelleLogement: # Différentes conditions pour l'éligibilité interne condition_prêt condition dépend de Prêt interne condition_nationalité condition - interne condition_logement_résidence_principale condition + contexte condition_logement_résidence_principale condition interne condition_logement_mode_occupation condition interne condition_logement_location_tiers condition interne condition_logement_surface_minimale_sans_seuil_m_carrés contenu entier - interne condition_logement_surface condition + contexte condition_logement_surface condition interne condition_non_ouverture_l822_8 condition interne condition_non_ouverture_l822_9_decence_logement condition interne condition_non_ouverture_l822_10_peuplement_logement condition @@ -540,7 +549,7 @@ déclaration champ d'application ContributionsSocialesAidesPersonnelleLogement: sortie montant contenu argent dépend de argent ``` -### Calcul du montant de l'aide personnelle au logement +### Calcul du montant de l'aide personnalisée au logement #### Secteur locatif @@ -600,6 +609,25 @@ champ d'application CalculAidePersonnaliséeLogementLocatif: #### Secteur logement-foyer ```catala-metadata +déclaration champ d'application CalculÉquivalenceLoyerMinimale: + entrée ressources_ménage_arrondies contenu argent + entrée condition_2_du_832_25 contenu booléen + entrée n_nombre_parts_d832_25 contenu décimal + + interne tranches_revenus_d832_26 contenu collection TrancheRevenu + interne tranches_revenus_d832_26_multipliées contenu + collection TrancheRevenuDécimal + interne montant_forfaitaire_d832_26 contenu argent + + sortie montant contenu argent + +déclaration champ d'application CalculNombrePartLogementFoyer: + entrée condition_2_du_832_25 contenu booléen + entrée nombre_personnes_à_charge contenu entier + entrée situation_familiale_calcul_apl contenu SituationFamilialeCalculAPL + + sortie n_nombre_parts_d832_25 contenu décimal + déclaration champ d'application CalculAidePersonnaliséeLogementFoyer: entrée mode_occupation contenu ModeOccupation entrée ressources_ménage_arrondies contenu argent @@ -613,19 +641,20 @@ déclaration champ d'application CalculAidePersonnaliséeLogementFoyer: sortie coefficient_multiplicateur_d832_25 contenu argent sortie coefficient_r_d832_25 contenu argent - sortie n_nombre_parts_d832_25 contenu décimal - interne équivalence_loyer_éligible contenu argent + contexte sortie n_nombre_parts_d832_25 contenu décimal + sortie équivalence_loyer_éligible contenu argent sortie plafond_équivalence_loyer_éligible contenu argent interne abattement_dépense_nette_minimale_d832_27 contenu argent dépend de argent interne dépense_nette_minimale_d832_27 contenu argent dépend de argent interne montant_forfaitaire_d832_24 contenu argent - interne montant_forfaitaire_d832_26 contenu argent interne montant_forfaitaire_d832_27 contenu argent interne montant_minimal_aide_d823_24 contenu argent - interne tranches_revenus_d832_26 contenu collection TrancheRevenu - interne tranches_revenus_d832_26_multipliées contenu collection TrancheRevenu + sortie équivalence_loyer_minimale contenu argent + calcul_nombre_parts champ d'application CalculNombrePartLogementFoyer + calcul_équivalence_loyer_minimale champ d'application + CalculÉquivalenceLoyerMinimale contributions_sociales champ d'application ContributionsSocialesAidesPersonnelleLogement @@ -633,7 +662,6 @@ déclaration champ d'application CalculAidePersonnaliséeLogementFoyer: état formule état arrondi état seuil - sortie équivalence_minimale_loyer contenu argent sortie aide_finale_formule contenu argent sortie traitement_aide_finale contenu argent dépend de argent @@ -649,6 +677,13 @@ champ d'application CalculAidePersonnaliséeLogementFoyer: #### Secteur accession à la propriété ```catala-metadata +déclaration champ d'application CalculNombrePartsAccessionPropriété: + entrée nombre_personnes_à_charge contenu entier + entrée situation_familiale_calcul_apl contenu SituationFamilialeCalculAPL + + sortie n_nombre_parts_d832_11 contenu décimal + + déclaration champ d'application CalculAidePersonnaliséeLogementAccessionPropriété: entrée mensualité_principale contenu argent @@ -661,20 +696,19 @@ déclaration champ d'application entrée date_entrée_logement contenu date entrée copropriété contenu booléen entrée situation_r822_11_13_17 contenu booléen - entrée équivalence_minimale_loyer contenu argent entrée zone contenu ZoneDHabitation entrée type_prêt contenu TypePrêt entrée ancienneté_logement contenu NeufOuAncien entrée date_courante contenu date - interne mensualité_éligible contenu argent - interne mensualité_minimale contenu argent + sortie mensualité_éligible contenu argent + sortie mensualité_minimale contenu argent interne plafond_mensualité_d832_10_3 contenu argent état base état copropriétaires interne calcul_plafond_mensualité_d832_10_3 contenu argent dépend de date interne n_nombre_parts_d832_11 contenu décimal - interne coefficient_prise_en_charge_d832_10 contenu décimal + sortie coefficient_prise_en_charge_d832_10 contenu décimal état formule état arrondi état seuil @@ -693,6 +727,9 @@ déclaration champ d'application interne taux_tranche_supérieure_d832_15_1 contenu décimal interne taux_francs_vers_euros contenu décimal + calcul_nombre_parts champ d'application CalculNombrePartsAccessionPropriété + calcul_équivalence_loyer_minimale champ d'application + CalculÉquivalenceLoyerMinimale contributions_sociales champ d'application ContributionsSocialesAidesPersonnelleLogement @@ -794,7 +831,8 @@ champ d'application CalculAllocationLogementLocatif: définition calcul_apl_locatif.logement_est_chambre égal à logement_est_chambre définition - calcul_apl_locatif.âgées_ou_handicap_adultes_hébergées_onéreux_particuliers + calcul_apl_locatif. + âgées_ou_handicap_adultes_hébergées_onéreux_particuliers égal à âgées_ou_handicap_adultes_hébergées_onéreux_particuliers définition calcul_apl_locatif.type_aide égal à @@ -850,10 +888,13 @@ déclaration champ d'application CalculAllocationLogementAccessionPropriété: interne coefficient_d842_11 contenu décimal interne coefficient_d842_12 contenu décimal + calcul_nombre_parts champ d'application CalculNombrePartsAccessionPropriété calcul_apl_logement_foyer champ d'application CalculAidePersonnaliséeLogementFoyer contributions_sociales champ d'application ContributionsSocialesAidesPersonnelleLogement + calcul_équivalence_loyer_minimale champ d'application + CalculÉquivalenceLoyerMinimale sortie aide_finale_formule contenu argent @@ -873,7 +914,7 @@ champ d'application CalculAllocationLogementAccessionPropriété: RésidentLogementFoyer contenu (LogementFoyer { -- type: RésidenceSociale -- date_conventionnement: |2022-01-01| - -- pour_jeunes_travailleurs_III_12_loi_1957: faux + -- construit_application_loi_1957_12_III: faux -- location: Location { -- bailleur: Bailleur { -- type_bailleur: BailleurSocial @@ -924,10 +965,13 @@ déclaration champ d'application CalculAllocationLogementFoyer: sortie montant_forfaitaire_charges contenu argent sortie loyer_minimal contenu argent + calcul_nombre_parts champ d'application CalculNombrePartLogementFoyer calcul_apl_logement_foyer champ d'application CalculAidePersonnaliséeLogementFoyer contributions_sociales champ d'application ContributionsSocialesAidesPersonnelleLogement + calcul_équivalence_loyer_minimale champ d'application + CalculÉquivalenceLoyerMinimale sortie aide_finale_formule contenu argent sortie traitement_aide_finale contenu argent dépend de argent @@ -1083,7 +1127,9 @@ champ d'application CalculetteAidesAuLogement: ménage.situation_familiale définition calcul_allocation_logement.situation_familiale égal à ménage.situation_familiale - définition calcul_aide_personnalisée_logement.nombre_personnes_à_charge égal à + définition + calcul_aide_personnalisée_logement.nombre_personnes_à_charge + égal à éligibilité_aide_personnalisée_logement. nombre_personnes_à_charge_prises_en_compte définition calcul_allocation_logement.nombre_personnes_à_charge égal à diff --git a/examples/aides_logement/tests/output/tests_calcul_al_locatif.catala_fr.exemple1 b/examples/aides_logement/tests/output/tests_calcul_al_locatif.catala_fr.exemple1 new file mode 100644 index 00000000..1270e0c4 --- /dev/null +++ b/examples/aides_logement/tests/output/tests_calcul_al_locatif.catala_fr.exemple1 @@ -0,0 +1,2 @@ +[RESULT] Computation successful! Results: +[RESULT] montant = 345.73 € diff --git a/examples/aides_logement/tests/output/tests_calcul_al_locatif.catala_fr.exemple2 b/examples/aides_logement/tests/output/tests_calcul_al_locatif.catala_fr.exemple2 new file mode 100644 index 00000000..b68c09cb --- /dev/null +++ b/examples/aides_logement/tests/output/tests_calcul_al_locatif.catala_fr.exemple2 @@ -0,0 +1,2 @@ +[RESULT] Computation successful! Results: +[RESULT] montant = 352.77 € diff --git a/examples/aides_logement/tests/output/tests_calcul_al_logement_foyer.catala_fr.CasTest1.Interpret b/examples/aides_logement/tests/output/tests_calcul_al_logement_foyer.catala_fr.CasTest1.Interpret new file mode 100644 index 00000000..c5552913 --- /dev/null +++ b/examples/aides_logement/tests/output/tests_calcul_al_logement_foyer.catala_fr.CasTest1.Interpret @@ -0,0 +1,2 @@ +[RESULT] Computation successful! Results: +[RESULT] montant = 76.38 € diff --git a/examples/aides_logement/tests/output/tests_calcul_apl_accession_propriete.catala_fr.ex1 b/examples/aides_logement/tests/output/tests_calcul_apl_accession_propriete.catala_fr.ex1 new file mode 100644 index 00000000..00d4f961 --- /dev/null +++ b/examples/aides_logement/tests/output/tests_calcul_apl_accession_propriete.catala_fr.ex1 @@ -0,0 +1,2 @@ +[RESULT] Computation successful! Results: +[RESULT] montant = 181.91 € diff --git a/examples/aides_logement/tests/output/tests_calcul_apl_accession_propriete.catala_fr.ex2 b/examples/aides_logement/tests/output/tests_calcul_apl_accession_propriete.catala_fr.ex2 new file mode 100644 index 00000000..b73d51fe --- /dev/null +++ b/examples/aides_logement/tests/output/tests_calcul_apl_accession_propriete.catala_fr.ex2 @@ -0,0 +1,2 @@ +[RESULT] Computation successful! Results: +[RESULT] montant = 67.34 € diff --git a/examples/aides_logement/tests/output/tests_calcul_apl_accession_propriete.catala_fr.ex3 b/examples/aides_logement/tests/output/tests_calcul_apl_accession_propriete.catala_fr.ex3 new file mode 100644 index 00000000..00d4f961 --- /dev/null +++ b/examples/aides_logement/tests/output/tests_calcul_apl_accession_propriete.catala_fr.ex3 @@ -0,0 +1,2 @@ +[RESULT] Computation successful! Results: +[RESULT] montant = 181.91 € diff --git a/examples/aides_logement/tests/output/tests_calcul_apl_accession_propriete.catala_fr.ex4 b/examples/aides_logement/tests/output/tests_calcul_apl_accession_propriete.catala_fr.ex4 new file mode 100644 index 00000000..2e35b44c --- /dev/null +++ b/examples/aides_logement/tests/output/tests_calcul_apl_accession_propriete.catala_fr.ex4 @@ -0,0 +1,2 @@ +[RESULT] Computation successful! Results: +[RESULT] montant = 118.59 € diff --git a/examples/aides_logement/tests/output/tests_calcul_apl_locatif.catala_fr.Exemple2.Interpret b/examples/aides_logement/tests/output/tests_calcul_apl_locatif.catala_fr.Exemple2.Interpret index 5f198951..b68c09cb 100644 --- a/examples/aides_logement/tests/output/tests_calcul_apl_locatif.catala_fr.Exemple2.Interpret +++ b/examples/aides_logement/tests/output/tests_calcul_apl_locatif.catala_fr.Exemple2.Interpret @@ -1,2 +1,2 @@ [RESULT] Computation successful! Results: -[RESULT] montant = 358.80 € +[RESULT] montant = 352.77 € diff --git a/examples/aides_logement/tests/output/tests_calcul_apl_locatif.catala_fr.Exemple3.Interpret b/examples/aides_logement/tests/output/tests_calcul_apl_locatif.catala_fr.Exemple3.Interpret index 8568b622..a9ca8e07 100644 --- a/examples/aides_logement/tests/output/tests_calcul_apl_locatif.catala_fr.Exemple3.Interpret +++ b/examples/aides_logement/tests/output/tests_calcul_apl_locatif.catala_fr.Exemple3.Interpret @@ -1,2 +1,2 @@ [RESULT] Computation successful! Results: -[RESULT] montant = 328.65 € +[RESULT] montant = 321.61 € diff --git a/examples/aides_logement/tests/output/tests_calcul_apl_locatif.catala_fr.Exemple7.Interpret b/examples/aides_logement/tests/output/tests_calcul_apl_locatif.catala_fr.Exemple7.Interpret index 7a1b3dc7..2421371e 100644 --- a/examples/aides_logement/tests/output/tests_calcul_apl_locatif.catala_fr.Exemple7.Interpret +++ b/examples/aides_logement/tests/output/tests_calcul_apl_locatif.catala_fr.Exemple7.Interpret @@ -1,2 +1,2 @@ [RESULT] Computation successful! Results: -[RESULT] montant = 164.83 € +[RESULT] montant = 153.77 € diff --git a/examples/aides_logement/tests/output/tests_calcul_apl_logement_foyer.catala_fr.CasTest2.Interpret b/examples/aides_logement/tests/output/tests_calcul_apl_logement_foyer.catala_fr.CasTest2.Interpret index 73d0da5d..4ec4b8ae 100644 --- a/examples/aides_logement/tests/output/tests_calcul_apl_logement_foyer.catala_fr.CasTest2.Interpret +++ b/examples/aides_logement/tests/output/tests_calcul_apl_logement_foyer.catala_fr.CasTest2.Interpret @@ -1,2 +1,2 @@ [RESULT] Computation successful! Results: -[RESULT] montant = 22.11 € +[RESULT] montant = 23.12 € diff --git a/examples/aides_logement/tests/output/tests_calcul_apl_logement_foyer.catala_fr.CasTest3.Interpret b/examples/aides_logement/tests/output/tests_calcul_apl_logement_foyer.catala_fr.CasTest3.Interpret new file mode 100644 index 00000000..a2d52ace --- /dev/null +++ b/examples/aides_logement/tests/output/tests_calcul_apl_logement_foyer.catala_fr.CasTest3.Interpret @@ -0,0 +1,2 @@ +[RESULT] Computation successful! Results: +[RESULT] montant = 154.78 € diff --git a/examples/aides_logement/tests/output/tests_calcul_apl_logement_foyer.catala_fr.CasTest4.Interpret b/examples/aides_logement/tests/output/tests_calcul_apl_logement_foyer.catala_fr.CasTest4.Interpret new file mode 100644 index 00000000..a2d52ace --- /dev/null +++ b/examples/aides_logement/tests/output/tests_calcul_apl_logement_foyer.catala_fr.CasTest4.Interpret @@ -0,0 +1,2 @@ +[RESULT] Computation successful! Results: +[RESULT] montant = 154.78 € diff --git a/examples/aides_logement/tests/output/tests_calcul_apl_logement_foyer.catala_fr.CasTest5.Interpret b/examples/aides_logement/tests/output/tests_calcul_apl_logement_foyer.catala_fr.CasTest5.Interpret new file mode 100644 index 00000000..6ac6db15 --- /dev/null +++ b/examples/aides_logement/tests/output/tests_calcul_apl_logement_foyer.catala_fr.CasTest5.Interpret @@ -0,0 +1,2 @@ +[RESULT] Computation successful! Results: +[RESULT] montant = 129.65 € diff --git a/examples/aides_logement/tests/output/tests_eligibilite_apl.catala_fr.Exemple1.Interpret b/examples/aides_logement/tests/output/tests_eligibilite_apl.catala_fr.Exemple1.Interpret index 9077a865..12150c97 100644 --- a/examples/aides_logement/tests/output/tests_eligibilite_apl.catala_fr.Exemple1.Interpret +++ b/examples/aides_logement/tests/output/tests_eligibilite_apl.catala_fr.Exemple1.Interpret @@ -1,2 +1,2 @@ [RESULT] Computation successful! Results: -[RESULT] éligible = true \ No newline at end of file +[RESULT] éligible = true diff --git a/examples/aides_logement/tests/tests_calcul_al_locatif.catala_fr b/examples/aides_logement/tests/tests_calcul_al_locatif.catala_fr new file mode 100644 index 00000000..b51b555a --- /dev/null +++ b/examples/aides_logement/tests/tests_calcul_al_locatif.catala_fr @@ -0,0 +1,73 @@ +> Inclusion: ../aides_logement.catala_fr + +# Tests + +```catala +# Tiré de la page 24 de +# https://www.ecologie.gouv.fr/sites/default/files/les_aides_personnelles_au_logement_element_de_calcul_septembre_2021.pdf +déclaration champ d'application Exemple1 : + calcul champ d'application CalculAllocationLogementLocatif + sortie montant contenu argent + +champ d'application Exemple1 : + définition calcul.loyer_principal égal à 425 € + définition calcul.ressources_ménage_arrondies égal à 11 500€ + définition calcul.bénéficiaire_aide_adulte_ou_enfant_handicapés égal à faux + définition calcul.date_courante égal à |2021-09-29| + définition calcul.nombre_personnes_à_charge égal à 2 + définition calcul.situation_familiale_calcul_apl égal à Couple + définition calcul.zone égal à Zone2 + définition calcul.logement_est_chambre égal à faux + définition calcul.âgées_ou_handicap_adultes_hébergées_onéreux_particuliers + égal à faux + définition calcul.type_aide égal à + TypeAidesPersonnelleLogement.AllocationLogementFamiliale + définition calcul.colocation égal à faux + définition calcul.réduction_loyer_solidarité égal à 0 € + définition calcul.logement_meublé_d842_2 égal à faux + définition calcul.changement_logement_d842_4 égal à PasDeChangement + définition montant égal à + calcul.traitement_aide_finale de calcul.aide_finale_formule + # Attention dans cet exemple le taux de loyer éligible est bien arrondi à + # la troisième décimale en pourcentage comme le dit bien le 2° de l'article + # 14 de l'arrêté du 27 septembre 2019, et non à la deuxième décimale comme le + # montre l'exemple sur le document du gouvernement. + assertion montant = 345,73€ +``` + +```catala +# Transmis par DGALN/DHUP/FE4 le 12/07/2022 +déclaration champ d'application Exemple2 : + calcul champ d'application CalculAllocationLogementLocatif + sortie montant contenu argent + +champ d'application Exemple2 : + définition calcul.loyer_principal égal à 425 € + définition calcul.ressources_ménage_arrondies égal à 11 500€ + définition calcul.bénéficiaire_aide_adulte_ou_enfant_handicapés égal à faux + définition calcul.date_courante égal à |2022-05-01| + définition calcul.nombre_personnes_à_charge égal à 2 + définition calcul.situation_familiale_calcul_apl égal à Couple + définition calcul.zone égal à Zone2 + définition calcul.logement_est_chambre égal à faux + définition calcul.âgées_ou_handicap_adultes_hébergées_onéreux_particuliers + égal à faux + définition calcul.type_aide égal à + TypeAidesPersonnelleLogement.AllocationLogementFamiliale + définition calcul.colocation égal à faux + définition calcul.réduction_loyer_solidarité égal à 0 € + définition calcul.logement_meublé_d842_2 égal à faux + définition calcul.changement_logement_d842_4 égal à PasDeChangement + définition montant égal à + calcul.traitement_aide_finale de calcul.aide_finale_formule + assertion montant = 352,77€ +``` + + +```catala-test { id = "exemple1" } +catala Interpret -s Exemple1 +``` + +```catala-test { id = "exemple2" } +catala Interpret -s Exemple2 +``` diff --git a/examples/aides_logement/tests/tests_calcul_al_logement_foyer.catala_fr b/examples/aides_logement/tests/tests_calcul_al_logement_foyer.catala_fr new file mode 100644 index 00000000..dd57044c --- /dev/null +++ b/examples/aides_logement/tests/tests_calcul_al_logement_foyer.catala_fr @@ -0,0 +1,46 @@ +> Inclusion: ../aides_logement.catala_fr + +# Tests + +```catala +# Transmis par DGALN/DHUP/FE4 le 14/07/2022 +déclaration champ d'application CasTest1 : + calcul champ d'application CalculAllocationLogementFoyer + sortie montant contenu argent + +champ d'application CasTest1: + définition calcul.mode_occupation égal à RésidentLogementFoyer contenu (LogementFoyer { + -- type : TypeLogementFoyer.RésidenceSociale + -- date_conventionnement : |2020-01-01| + -- construit_application_loi_1957_12_III: faux + -- location : Location { + -- bailleur: Bailleur { + -- type_bailleur: BailleurSocial + -- respecte_convention_titre_V: vrai + -- respecte_convention_titre_II: vrai + -- construit_amélioré_conditions_l831_1_4: vrai + -- acquisition_aides_état_prêt_titre_II_ou_livre_III: vrai + } + } + -- remplit_conditions_r832_21 : vrai + }) + définition calcul.redevance égal à 350 € + définition calcul.ressources_ménage_arrondies égal à 7 500€ + définition calcul.nombre_personnes_à_charge égal à 0 + définition calcul.situation_familiale_calcul_apl égal à PersonneSeule + définition calcul.zone égal à Zone1 + définition calcul.date_courante égal à |2022-05-01| + définition calcul.catégorie_équivalence_loyer_d842_16 égal à + PersonnesÂgéesSelon3DeD842_16 + assertion calcul.équivalence_loyer = 206,40€ + assertion calcul.loyer_minimal = 124,64 € + assertion calcul.coefficient_prise_en_charge = 0,6 + définition montant égal à + calcul.traitement_aide_finale de + calcul.aide_finale_formule + assertion montant = 76,38 € +``` + +```catala-test {id="CasTest1.Interpret"} +catala Interpret -s CasTest1 +``` diff --git a/examples/aides_logement/tests/tests_calcul_apl_accession_propriete.catala_fr b/examples/aides_logement/tests/tests_calcul_apl_accession_propriete.catala_fr index 5b08bc73..48cc7937 100644 --- a/examples/aides_logement/tests/tests_calcul_apl_accession_propriete.catala_fr +++ b/examples/aides_logement/tests/tests_calcul_apl_accession_propriete.catala_fr @@ -3,25 +3,159 @@ # Tests ```catala +# Tiré de la page 45 de +# https://www.ecologie.gouv.fr/sites/default/files/les_aides_personnelles_au_logement_element_de_calcul_septembre_2021.pdf#page=45 déclaration champ d'application Exemple1: calcul champ d'application CalculAidePersonnaliséeLogementAccessionPropriété + sortie montant contenu argent champ d'application Exemple1: + définition calcul.ressources_ménage_arrondies égal à 18 000 € + définition calcul.date_signature_prêt égal à |2017-12-15| + définition calcul.zone égal à Zone2 définition calcul.mensualité_principale égal à 650 € - définition calcul.ressources_ménage_arrondies égal à 10 000 € - définition calcul.nombre_personnes_à_charge égal à 3 + définition calcul.nombre_personnes_à_charge égal à 2 définition calcul.situation_familiale_calcul_apl égal à Couple - définition calcul.type_travaux_logement égal à SurLogementExistant - définition calcul.date_signature_prêt égal à |2001-03-02| - définition calcul.local_habité_première_fois_bénéficiaire égal à vrai - définition calcul.date_entrée_logement égal à |2001-06-24| - définition calcul.copropriété égal à faux - définition calcul.situation_r822_11_13_17 égal à vrai - définition calcul.équivalence_minimale_loyer égal à 0 € - # Ne sert à rien car pas de travaux, TODO juridique à calculer à la main sinon - - définition calcul.zone égal à Zone3 + définition calcul.date_courante égal à |2021-09-15| définition calcul.type_prêt égal à D331_63_64 - définition calcul.ancienneté_logement égal à Ancien contenu (AmélioréParOccupant.Non) - définition calcul.date_courante égal à |2022-05-05| + + définition calcul.type_travaux_logement égal à + TypeTravauxLogementD832_15.PasDeTravaux + définition calcul.ancienneté_logement égal à Neuf + définition calcul.date_entrée_logement égal à |2017-12-15| + définition calcul.local_habité_première_fois_bénéficiaire égal à faux + définition calcul.copropriété égal à faux + définition calcul.situation_r822_11_13_17 égal à faux + + définition montant égal à + calcul.traitement_aide_finale de + calcul.aide_finale_formule + assertion montant = 181,91 € + assertion calcul.mensualité_éligible = 533,91 € + assertion calcul.mensualité_minimale = 332,75 € + assertion calcul.coefficient_prise_en_charge_d832_10 = 0,67 + assertion calcul.aide_finale_formule = 187,35€ +``` + +```catala +# Tiré de la page 45 de +# https://www.ecologie.gouv.fr/sites/default/files/les_aides_personnelles_au_logement_element_de_calcul_septembre_2021.pdf#page=45 +déclaration champ d'application Exemple2: + calcul champ d'application CalculAidePersonnaliséeLogementAccessionPropriété + sortie montant contenu argent + +champ d'application Exemple2: + définition calcul.ressources_ménage_arrondies égal à 19 000 € + définition calcul.date_signature_prêt égal à |2019-12-02| + définition calcul.zone égal à Zone3 + définition calcul.mensualité_principale égal à 495,73 € + définition calcul.nombre_personnes_à_charge égal à 2 + définition calcul.situation_familiale_calcul_apl égal à Couple + définition calcul.date_courante égal à |2021-09-15| + définition calcul.type_prêt égal à D331_63_64 + + définition calcul.type_travaux_logement égal à + TypeTravauxLogementD832_15.TravauxPourAcquisitionD832_15_1 + définition calcul.ancienneté_logement égal à (Ancien contenu (AmélioréParOccupant.Oui)) + définition calcul.date_entrée_logement égal à |2020-03-02| + définition calcul.local_habité_première_fois_bénéficiaire égal à faux + définition calcul.copropriété égal à faux + définition calcul.situation_r822_11_13_17 égal à faux + + # Ici nous sommes en désaccord avec la valeur finale, car la mensualité + # plafond est déterminée dans le cas d'un logement ancien acquis et amélioré + # par le 18° b° de l'article 18 de l'arrêté du 27 septembre 2019, et non + # par le 18° a). Ce qui donne une mensualité éligible de 399,20 € et non + # de 495,73 €. + définition montant égal à calcul.traitement_aide_finale de calcul.aide_finale_formule + assertion montant = 67,34 € + assertion calcul.mensualité_éligible = 399,20 € + assertion calcul.mensualité_minimale = 367,42 € + assertion calcul.coefficient_prise_en_charge_d832_10 = 0,66 + assertion calcul.aide_finale_formule = 72,77€ +``` + +```catala +# Transmis par DGALN/DHUP/FE4 le 14/07/2022 +déclaration champ d'application Exemple3: + calcul champ d'application CalculAidePersonnaliséeLogementAccessionPropriété + sortie montant contenu argent + +champ d'application Exemple3: + définition calcul.ressources_ménage_arrondies égal à 18 000 € + définition calcul.date_signature_prêt égal à |2017-12-15| + définition calcul.zone égal à Zone2 + définition calcul.mensualité_principale égal à 650 € + définition calcul.nombre_personnes_à_charge égal à 2 + définition calcul.situation_familiale_calcul_apl égal à Couple + définition calcul.date_courante égal à |2022-05-01| + définition calcul.type_prêt égal à D331_63_64 + + définition calcul.type_travaux_logement égal à + TypeTravauxLogementD832_15.PasDeTravaux + définition calcul.ancienneté_logement égal à Neuf + définition calcul.date_entrée_logement égal à |2017-12-15| + définition calcul.local_habité_première_fois_bénéficiaire égal à faux + définition calcul.copropriété égal à faux + définition calcul.situation_r822_11_13_17 égal à faux + + définition montant égal à + calcul.traitement_aide_finale de + calcul.aide_finale_formule + assertion montant = 181,91 € + assertion calcul.mensualité_éligible = 533,91 € + assertion calcul.mensualité_minimale = 332,75 € + assertion calcul.coefficient_prise_en_charge_d832_10 = 0,67 + assertion calcul.aide_finale_formule = 187,57€ +``` + +```catala +# Transmis par DGALN/DHUP/FE4 le 14/07/2022 +déclaration champ d'application Exemple4: + calcul champ d'application CalculAidePersonnaliséeLogementAccessionPropriété + sortie montant contenu argent + +champ d'application Exemple4: + définition calcul.ressources_ménage_arrondies égal à 19 000 € + définition calcul.date_signature_prêt égal à |2019-12-02| + définition calcul.zone égal à Zone3 + définition calcul.mensualité_principale égal à 495 € + définition calcul.nombre_personnes_à_charge égal à 2 + définition calcul.situation_familiale_calcul_apl égal à Couple + définition calcul.date_courante égal à |2022-05-01| + définition calcul.type_prêt égal à D331_63_64 + + définition calcul.type_travaux_logement égal à + TypeTravauxLogementD832_15.TravauxSurLogementDéjàAcquisD832_15_2 + définition calcul.ancienneté_logement égal à (Ancien contenu (AmélioréParOccupant.Oui)) + définition calcul.date_entrée_logement égal à |2020-03-02| + définition calcul.local_habité_première_fois_bénéficiaire égal à faux + définition calcul.copropriété égal à faux + définition calcul.situation_r822_11_13_17 égal à faux + + définition montant égal à + calcul.traitement_aide_finale de + calcul.aide_finale_formule + assertion montant = 118,59 € + assertion calcul.mensualité_éligible = 399,20 € + assertion calcul.mensualité_minimale = 290,20 € + assertion calcul.coefficient_prise_en_charge_d832_10 = 0,66 + assertion calcul.aide_finale_formule = 123,95 € +``` + +```catala-test { id = "ex1"} +catala Interpret -s Exemple1 +``` + +```catala-test { id = "ex2"} +catala Interpret -s Exemple2 +``` + +```catala-test { id = "ex3"} +catala Interpret -s Exemple3 +``` + + +```catala-test { id = "ex4"} +catala Interpret -s Exemple4 ``` diff --git a/examples/aides_logement/tests/tests_calcul_apl_locatif.catala_fr b/examples/aides_logement/tests/tests_calcul_apl_locatif.catala_fr index 204b7fea..fe6a91d3 100644 --- a/examples/aides_logement/tests/tests_calcul_apl_locatif.catala_fr +++ b/examples/aides_logement/tests/tests_calcul_apl_locatif.catala_fr @@ -27,9 +27,9 @@ champ d'application Exemple1: assertion montant = 0 € assertion calcul.montant_forfaitaire_charges_d823_16 = 91,09 € assertion calcul.plafond_loyer_d823_16_2 = 524,20 € - assertion calcul.participation_minimale = 44,56 € + assertion calcul.participation_minimale = 52,30 € assertion calcul.taux_composition_familiale = 2,01% - assertion calcul.participation_personnelle = 705,51 € + assertion calcul.participation_personnelle = 713,25 € ``` ```catala @@ -53,12 +53,12 @@ champ d'application Exemple2: calcul.âgées_ou_handicap_adultes_hébergées_onéreux_particuliers égal à faux définition calcul.bénéficiaire_aide_adulte_ou_enfant_handicapés égal à faux - assertion montant = 358,80 € + assertion montant = 352,77 € assertion calcul.montant_forfaitaire_charges_d823_16 = 78,80 € assertion calcul.plafond_loyer_d823_16_2 = 409,88 € - assertion calcul.participation_minimale = 35,39 € + assertion calcul.participation_minimale = 41,54 € assertion calcul.taux_composition_familiale = 2,38% - assertion calcul.participation_personnelle = 124,21 € + assertion calcul.participation_personnelle = 130,36 € ``` ```catala @@ -82,12 +82,12 @@ champ d'application Exemple3: définition calcul.réduction_loyer_solidarité égal à 0 € définition calcul.ressources_ménage_arrondies égal à 14300 € définition calcul.bénéficiaire_aide_adulte_ou_enfant_handicapés égal à faux - assertion montant = 328,65 € + assertion montant = 321,61 € assertion calcul.montant_forfaitaire_charges_d823_16 = 91,09 € assertion calcul.plafond_loyer_d823_16_2 = 425,80 € - assertion calcul.participation_minimale = 35,39 € + assertion calcul.participation_minimale = 42,42 € assertion calcul.taux_composition_familiale = 2,01% - assertion calcul.participation_personnelle = 165,02 € + assertion calcul.participation_personnelle = 172,05 € ``` ```catala @@ -114,9 +114,9 @@ champ d'application Exemple4: assertion montant = 0 € assertion calcul.montant_forfaitaire_charges_d823_16 = 66,51 € assertion calcul.plafond_loyer_d823_16_2 = 406,30 € - assertion calcul.participation_minimale = 35,39 € + assertion calcul.participation_minimale = 40,19€ assertion calcul.taux_composition_familiale = 2,70% - assertion calcul.participation_personnelle = 1011,83 € + assertion calcul.participation_personnelle = 1016,63 € ``` ```catala @@ -198,12 +198,12 @@ champ d'application Exemple7: définition calcul.réduction_loyer_solidarité égal à 0 € définition calcul.ressources_ménage_arrondies égal à 32200 € définition calcul.bénéficiaire_aide_adulte_ou_enfant_handicapés égal à faux - assertion montant = 164,83 € + assertion montant = 153,77 € assertion calcul.montant_forfaitaire_charges_d823_16 = 127,96 € assertion calcul.plafond_loyer_d823_16_2 = 618,20 € - assertion calcul.participation_minimale = 44,80 € + assertion calcul.participation_minimale = 55,67 € assertion calcul.taux_composition_familiale = 1,73% - assertion calcul.participation_personnelle = 484,77 € + assertion calcul.participation_personnelle = 495,64 € ``` ```catala diff --git a/examples/aides_logement/tests/tests_calcul_apl_logement_foyer.catala_fr b/examples/aides_logement/tests/tests_calcul_apl_logement_foyer.catala_fr index 00e1bf4f..f53f83a3 100644 --- a/examples/aides_logement/tests/tests_calcul_apl_logement_foyer.catala_fr +++ b/examples/aides_logement/tests/tests_calcul_apl_logement_foyer.catala_fr @@ -9,8 +9,9 @@ déclaration champ d'application CasTest1 : champ d'application CasTest1: définition calcul.mode_occupation égal à RésidentLogementFoyer contenu (LogementFoyer { - -- type : LogementPersonnesÂgéesOuHandicapées + -- type : TypeLogementFoyer.Autre -- date_conventionnement : |2022-01-01| + -- construit_application_loi_1957_12_III: faux -- location : Location { -- bailleur: Bailleur { -- type_bailleur: BailleurSocial @@ -20,8 +21,7 @@ champ d'application CasTest1: -- acquisition_aides_état_prêt_titre_II_ou_livre_III: vrai } } - -- remplit_conditions_r832_21 : faux - -- pour_jeunes_travailleurs_III_12_loi_1957 : faux + -- remplit_conditions_r832_21 : vrai }) définition calcul.redevance égal à 360 € définition calcul.ressources_ménage_arrondies égal à 15 000€ @@ -34,7 +34,7 @@ champ d'application CasTest1: assertion calcul.n_nombre_parts_d832_25 = 1,8 assertion calcul.coefficient_prise_en_charge_d832_25 = 0,41 assertion calcul.plafond_équivalence_loyer_éligible = 450,57 € - assertion calcul.équivalence_minimale_loyer = 318,13 € + assertion calcul.équivalence_loyer_minimale = 318,12 € définition montant égal à calcul.traitement_aide_finale de calcul.aide_finale_formule assertion montant = 12,06 € @@ -44,8 +44,9 @@ déclaration champ d'application CasTest2 : champ d'application CasTest2: définition calcul.mode_occupation égal à RésidentLogementFoyer contenu (LogementFoyer { - -- type : LogementPersonnesÂgéesOuHandicapées + -- type : TypeLogementFoyer.Autre -- date_conventionnement : |2022-01-01| + -- construit_application_loi_1957_12_III: faux -- location : Location { -- bailleur: Bailleur { -- type_bailleur: BailleurSocial @@ -55,8 +56,7 @@ champ d'application CasTest2: -- acquisition_aides_état_prêt_titre_II_ou_livre_III: vrai } } - -- remplit_conditions_r832_21 : faux - -- pour_jeunes_travailleurs_III_12_loi_1957 : faux + -- remplit_conditions_r832_21 : vrai }) définition calcul.redevance égal à 360 € définition calcul.ressources_ménage_arrondies égal à 15 000€ @@ -68,10 +68,126 @@ champ d'application CasTest2: PersonnesÂgéesSelon3DeD842_16 assertion calcul.équivalence_loyer = 320,73 € assertion calcul.montant_forfaitaire_charges = 54,22 € - assertion calcul.loyer_minimal = 311,15 € + assertion calcul.loyer_minimal = 307,96 € assertion calcul.coefficient_prise_en_charge = 0,43 + définition montant égal à + calcul.traitement_aide_finale de + calcul.aide_finale_formule + assertion montant = 23,12 € +``` + +```catala +# Tiré de la page 34 de +# https://www.ecologie.gouv.fr/sites/default/files/les_aides_personnelles_au_logement_element_de_calcul_septembre_2021.pdf#page=34 +déclaration champ d'application CasTest3 : + calcul champ d'application CalculAidePersonnaliséeLogementFoyer + sortie montant contenu argent + +champ d'application CasTest3: + définition calcul.mode_occupation égal à RésidentLogementFoyer contenu (LogementFoyer { + -- type : TypeLogementFoyer.Autre + -- date_conventionnement : |2020-01-01| + -- construit_application_loi_1957_12_III: faux + -- location : Location { + -- bailleur: Bailleur { + -- type_bailleur: BailleurSocial + -- respecte_convention_titre_V: vrai + -- respecte_convention_titre_II: vrai + -- construit_amélioré_conditions_l831_1_4: vrai + -- acquisition_aides_état_prêt_titre_II_ou_livre_III: vrai + } + } + -- remplit_conditions_r832_21 : vrai + }) + définition calcul.redevance égal à 350 € + définition calcul.ressources_ménage_arrondies égal à 7 500€ + définition calcul.nombre_personnes_à_charge égal à 0 + définition calcul.situation_familiale_calcul_apl égal à PersonneSeule + définition calcul.zone égal à Zone1 + définition calcul.date_courante égal à |2021-09-15| + assertion calcul.équivalence_loyer_éligible = 350 € + assertion calcul.plafond_équivalence_loyer_éligible = 444,43€ + assertion calcul.équivalence_loyer_minimale = 98,95 € + assertion calcul.coefficient_prise_en_charge_d832_25 = 0,64 définition montant égal à calcul.traitement_aide_finale de calcul.aide_finale_formule - assertion montant = 22,11 € + assertion montant = 154,78 € +``` + + +```catala +# Transmis par DGALN/DHUP/FE4 le 14/07/2022 +déclaration champ d'application CasTest4 : + calcul champ d'application CalculAidePersonnaliséeLogementFoyer + sortie montant contenu argent + +champ d'application CasTest4: + définition calcul.mode_occupation égal à RésidentLogementFoyer contenu (LogementFoyer { + -- type : TypeLogementFoyer.Autre + -- date_conventionnement : |2020-01-01| + -- construit_application_loi_1957_12_III: faux + -- location : Location { + -- bailleur: Bailleur { + -- type_bailleur: BailleurSocial + -- respecte_convention_titre_V: vrai + -- respecte_convention_titre_II: vrai + -- construit_amélioré_conditions_l831_1_4: vrai + -- acquisition_aides_état_prêt_titre_II_ou_livre_III: vrai + } + } + -- remplit_conditions_r832_21 : vrai + }) + définition calcul.redevance égal à 350 € + définition calcul.ressources_ménage_arrondies égal à 7 500€ + définition calcul.nombre_personnes_à_charge égal à 0 + définition calcul.situation_familiale_calcul_apl égal à PersonneSeule + définition calcul.zone égal à Zone1 + définition calcul.date_courante égal à |2022-05-01| + assertion calcul.équivalence_loyer_éligible = 350 € + assertion calcul.plafond_équivalence_loyer_éligible = 446,30€ + assertion calcul.équivalence_loyer_minimale = 98,95 € + assertion calcul.coefficient_prise_en_charge_d832_25 = 0,64 + définition montant égal à + calcul.traitement_aide_finale de + calcul.aide_finale_formule + assertion montant = 154,78 € +``` + +```catala +# Transmis par DGALN/DHUP/FE4 le 14/07/2022 +déclaration champ d'application CasTest5 : + calcul champ d'application CalculAidePersonnaliséeLogementFoyer + sortie montant contenu argent + +champ d'application CasTest5: + définition calcul.mode_occupation égal à RésidentLogementFoyer contenu (LogementFoyer { + -- type : TypeLogementFoyer.RésidenceSociale + -- date_conventionnement : |2020-01-01| + -- construit_application_loi_1957_12_III: faux + -- location : Location { + -- bailleur: Bailleur { + -- type_bailleur: BailleurSocial + -- respecte_convention_titre_V: vrai + -- respecte_convention_titre_II: vrai + -- construit_amélioré_conditions_l831_1_4: vrai + -- acquisition_aides_état_prêt_titre_II_ou_livre_III: vrai + } + } + -- remplit_conditions_r832_21 : vrai + }) + définition calcul.redevance égal à 350 € + définition calcul.ressources_ménage_arrondies égal à 7 500€ + définition calcul.nombre_personnes_à_charge égal à 0 + définition calcul.situation_familiale_calcul_apl égal à PersonneSeule + définition calcul.zone égal à Zone1 + définition calcul.date_courante égal à |2022-05-01| + assertion calcul.équivalence_loyer_éligible = 350 € + assertion calcul.plafond_équivalence_loyer_éligible = 446,30€ + assertion calcul.équivalence_loyer_minimale = 124,64 € + assertion calcul.coefficient_prise_en_charge_d832_25 = 0,6 + définition montant égal à + calcul.traitement_aide_finale de + calcul.aide_finale_formule + assertion montant = 129,65 € ``` ```catala-test {id="CasTest1.Interpret"} @@ -81,3 +197,15 @@ catala Interpret -s CasTest1 ```catala-test {id="CasTest2.Interpret"} catala Interpret -s CasTest2 ``` + +```catala-test {id="CasTest3.Interpret"} +catala Interpret -s CasTest3 +``` + +```catala-test {id="CasTest4.Interpret"} +catala Interpret -s CasTest4 +``` + +```catala-test {id="CasTest5.Interpret"} +catala Interpret -s CasTest5 +``` diff --git a/examples/aides_logement/tests/tests_calculette_globale.catala_fr b/examples/aides_logement/tests/tests_calculette_globale.catala_fr index 004597a5..61ce40a6 100644 --- a/examples/aides_logement/tests/tests_calculette_globale.catala_fr +++ b/examples/aides_logement/tests/tests_calculette_globale.catala_fr @@ -26,17 +26,17 @@ champ d'application Exemple1 : -- âge : 19 -- identifiant: 0 -- a_déjà_ouvert_droit_aux_allocations_familiales: vrai - -- date_de_naissance: |2001-01-01| + -- date_de_naissance: |2003-01-01| -- rémuneration_mensuelle: 0€ -- obligation_scolaire: Après - -- situation_garde_alternée: GardeAlternéeCoefficientPriseEnCharge contenu 0,4 + -- situation_garde_alternée: GardeAlternéeCoefficientPriseEnCharge contenu 0,5 }); EnfantÀCharge contenu (EnfantÀCharge { -- bénéficie_titre_personnel_aide_personnelle_logement : faux -- prise_en_charge : PriseEnCharge.EffectiveEtPermanente -- âge : 11 -- identifiant: 1 -- a_déjà_ouvert_droit_aux_allocations_familiales: vrai - -- date_de_naissance: |2009-01-01| + -- date_de_naissance: |2011-01-01| -- rémuneration_mensuelle: 0€ -- obligation_scolaire: Pendant -- situation_garde_alternée: PasDeGardeAlternée @@ -46,7 +46,7 @@ champ d'application Exemple1 : -- âge : 8 -- identifiant: 2 -- a_déjà_ouvert_droit_aux_allocations_familiales: vrai - -- date_de_naissance: |2012-01-01| + -- date_de_naissance: |2014-01-01| -- rémuneration_mensuelle: 0€ -- obligation_scolaire: Pendant -- situation_garde_alternée: PasDeGardeAlternée @@ -69,7 +69,6 @@ champ d'application Exemple1 : -- loué_ou_sous_loué_à_des_tiers : LouéOuSousLouéÀDesTiers.Non -- usufruit : ParentOuAutre.Autre -- logement_decent_l89_462 : vrai - -- loyers_l823_3 : 700€ -- surface_m_carrés : 80 -- est_ancien_l831_2 : faux -- situé_commune_déséquilibre_l831_2 : faux @@ -79,7 +78,7 @@ champ d'application Exemple1 : -- nombre_enfants_à_naître_après_troisième_mois_grossesse: 0 -- enfant_à_naître_après_quatrième_mois_grossesse: faux -- date_naissance_troisième_enfant_ou_dernier_si_plus : - PlusDeTroisEnfants contenu (DernierJourMoisPrécédantDateDeNaissance contenu |2014-08-30|) + PlusDeTroisEnfants contenu (DateDeNaissance contenu |2014-09-15|) } définition calculette.demandeur égal à Demandeur { -- personne_hébergée_centre_soin_l_L162_22_3_sécurité_sociale: faux @@ -104,5 +103,5 @@ champ d'application Exemple1 : -- logement_meublé_d842_2: faux -- changement_logement_d842_4: PasDeChangement }) - définition calculette.ressources_ménage_prises_en_compte égal à 30 000 € + définition calculette.ressources_ménage_prises_en_compte égal à 20 000 € ``` diff --git a/examples/aides_logement/tests/tests_eligibilite_apl.catala_fr b/examples/aides_logement/tests/tests_eligibilite_apl.catala_fr index 2685555c..a303691a 100644 --- a/examples/aides_logement/tests/tests_eligibilite_apl.catala_fr +++ b/examples/aides_logement/tests/tests_eligibilite_apl.catala_fr @@ -68,7 +68,6 @@ champ d'application Exemple1 : -- loué_ou_sous_loué_à_des_tiers : LouéOuSousLouéÀDesTiers.Non -- usufruit : ParentOuAutre.Autre -- logement_decent_l89_462 : vrai - -- loyers_l823_3 : 700€ -- surface_m_carrés : 80 -- est_ancien_l831_2 : faux -- situé_commune_déséquilibre_l831_2 : faux @@ -78,7 +77,7 @@ champ d'application Exemple1 : -- nombre_enfants_à_naître_après_troisième_mois_grossesse: 0 -- enfant_à_naître_après_quatrième_mois_grossesse: faux -- date_naissance_troisième_enfant_ou_dernier_si_plus : - PlusDeTroisEnfants contenu (DernierJourMoisPrécédantDateDeNaissance contenu |2014-08-30|) + PlusDeTroisEnfants contenu (DateDeNaissance contenu |2012-01-01|) } définition éligibilité.demandeur égal à Demandeur { -- satisfait_conditions_l512_2_code_sécurité_sociale : vrai @@ -121,7 +120,6 @@ champ d'application Exemple1 : # -- loué_ou_sous_loué_à_des_tiers : LouéOuSousLouéÀDesTiers.Non # -- usufruit : ParentOuAutre.Autre # -- logement_decent_l89_462 : vrai -# -- loyers_l823_3 : 750€ # -- surface_m_carrés : 25 # } # -- nombre_autres_occupants_logement: 0 @@ -171,7 +169,6 @@ champ d'application Exemple1 : # -- loué_ou_sous_loué_à_des_tiers : LouéOuSousLouéÀDesTiers.Non # -- usufruit : ParentOuAutre.Autre # -- logement_decent_l89_462 : vrai -# -- loyers_l823_3 : 750€ # -- surface_m_carrés : 25 # } # -- nombre_autres_occupants_logement: 0 @@ -199,5 +196,5 @@ catala Interpret -s Exemple1 ``` ```catala-test {id="Typecheck"} -catala Typecheck +catala Typecheck ``` diff --git a/examples/allocations_familiales/.gitignore b/examples/allocations_familiales/.gitignore index 584374e4..69ff37e1 100644 --- a/examples/allocations_familiales/.gitignore +++ b/examples/allocations_familiales/.gitignore @@ -16,3 +16,4 @@ _minted* *.ml *.py *.xdv +*.json diff --git a/examples/allocations_familiales/dune b/examples/allocations_familiales/dune new file mode 100644 index 00000000..503011ce --- /dev/null +++ b/examples/allocations_familiales/dune @@ -0,0 +1,39 @@ +(rule + (targets allocations_familiales.ml allocations_familiales_api_web.ml) + (deps + (source_tree ..) + %{workspace_root}/compiler/plugins/api_web%{ext_plugin}) + (action + (chdir + %{workspace_root} + (run + catala + api_web + -t + --plugin-dir=compiler/plugins + %{dep:allocations_familiales.catala_fr})))) + +(rule + (targets allocations_familiales_schema.json) + (deps + (source_tree ..) + %{workspace_root}/compiler/plugins/json_schema%{ext_plugin}) + (action + (chdir + %{workspace_root} + (run + catala + json_schema + -t + --plugin-dir=compiler/plugins + --scope=InterfaceAllocationsFamiliales + %{dep:allocations_familiales.catala_fr})))) + +(rule + (target allocations_familiales.py) + (deps + (source_tree ..)) + (action + (chdir + %{workspace_root} + (run catala Python -O %{dep:allocations_familiales.catala_fr})))) diff --git a/examples/allocations_familiales/tests/dune b/examples/allocations_familiales/tests/dune new file mode 100644 index 00000000..cb1bdfdf --- /dev/null +++ b/examples/allocations_familiales/tests/dune @@ -0,0 +1,7 @@ +(rule + (targets tests_allocations_familiales.ml) + (deps + (source_tree .) + ../allocations_familiales.ml) + (action + (run catala OCaml -t tests_allocations_familiales.catala_fr))) diff --git a/examples/tutoriel_fr/tutoriel_fr.catala_fr b/examples/tutoriel_fr/tutoriel_fr.catala_fr index 4c70bf8c..1d7d1c61 100644 --- a/examples/tutoriel_fr/tutoriel_fr.catala_fr +++ b/examples/tutoriel_fr/tutoriel_fr.catala_fr @@ -1,4 +1,4 @@ -## Tutoriel d'utilisation du langage Catala +# Tutoriel d'utilisation du langage Catala Bienvenue dans ce tutoriel, son objectif est de vous accompagner dans les fonctionnalités du langage Catala et de vous apprendre à annoter des textes @@ -13,7 +13,7 @@ en informatique devraient pouvoir s'en sortir. # la référence pour le langage. ``` -### Programmation littéraire +## Programmation littéraire Pour commencer à écrire un programme Catala, vous devez partir du texte d'une source législative qui va justifier le code que vous écrirez. @@ -34,7 +34,7 @@ diminuer l'importance du titre en augmentant le nombre de "#" après le titre de l'entête. Étudions un exemple fictif qui définit un impôt sur le revenu. -#### Article 1 +### Article 1 L'impôt sur le revenu d'un individu est calculé en tant qu'un pourcentage fixe des revenus d'une personne pour une année. @@ -52,7 +52,7 @@ et aussi proche que possible de la phrase qui justifie le code. Ce style s'appelle programmation littéraire, un paradigme de programmation inventé par le célèbre informaticien Donald Knuth dans les années 70. -### Définir un impôt sur le revenu fictif +## Définir un impôt sur le revenu fictif Le contenu de l'article 1 utilise beaucoup d'éléments du contexte implicite : il existe une personne avec un revenu et en même temps un impôt sur le revenu, @@ -128,7 +128,7 @@ déclaration champ d'application CalculImpôtRevenu: Nous avons maintenant tout ce dont nous avons besoin pour annoter le contenu de l'article 1 qui a été copié ci-dessous. -#### Article 1 +### Article 1 L'impôt sur le revenu pour une personne est défini comme un pourcentage fixe des revenus de la personne pour une année. @@ -162,7 +162,7 @@ Mais dans l'article 1, une question reste sans réponse: quelle est la valeur de la pourcentage fixe? Souvent, des valeurs précises sont définis ailleurs dans les sources législatives. Ici, supposons que nous avons: -#### Article 2 +### Article 2 Le pourcentage fixe mentionné à l'article 1 est égal à 20%. @@ -176,12 +176,12 @@ Vous pouvez voir ici que Catala permet des définitions réparties dans toute l'annotation du texte législatif, afin que chaque définition soit le plus proche possible de sa localisation dans le texte. -### Définitions conditionnelles +## Définitions conditionnelles Jusqu'à là tout va bien mais maintenant le texte législatif présente quelques difficultés. Supposons que le troisième article dispose : -#### Article 3 +### Article 3 Si l'individu a à sa charge deux ou plus enfants alors le pourcentage fixe mentionné à l'article 1 vaut 15 %. @@ -210,7 +210,7 @@ une seule condition soit vraie à tout moment. Toutefois, si ce n'est pas le cas Catala vous permettra de définir un ordre des priorités sur les conditions, qui doit être justifié par un raisonnement juridique. -### Fonctions +## Fonctions Catala vous permet de définir des fonctions partout dans vos données. Voici à quoi cela ressemble dans la définition des métadonnées quand nous voulons @@ -229,7 +229,7 @@ déclaration champ d'application CalculImpôtDeuxTranches : Et dans le code : -#### Article4 +### Article4 Le montant d'impôt pour le calcul à deux tranches est égal au montant d'impôt dans chaque tranche multiplié @@ -246,13 +246,13 @@ champ d'application CalculImpôtDeuxTranches : ) ``` -### Inclusion de champ d'application +## Inclusion de champ d'application Maintenant que nous avons défini notre champ d'application utilitaire pour calculer un impôt à deux tranches, nous voulons l'utiliser dans notre champ d'application principal de calcul de l'impôt. -#### Article 5 +### Article 5 Pour les individus dont le revenu est supérieur à 100 000€, l'impôt sur le revenu de l'article 1 est de 40% du revenu au-dessus de @@ -278,7 +278,7 @@ champ d'application NouveauCalculImpôtRevenu : deux_tranches.formule_imposition de personne.revenu ``` -#### Article 6 +### Article 6 Les personnes ayant moins de 10 000€ de revenus sont exemptés de l'impôt sur le revenu prévu à l'article 1. @@ -300,7 +300,7 @@ La loi ne le précise pas; nos articles sont clairement mal rédigés. Mais Catala vous aide à trouver ce genre d'erreur par de simples tests ou même la vérification formelle. Commençons par les tests. -### Tester les programmes Catala +## Tester les programmes Catala Tester les programmes Catala peut se faire directement en Catala. En effet, écrire des cas de tests pour chaque champ d'application Catala que vous @@ -308,7 +308,7 @@ définissez est une bonne pratique appelée "tests unitaires" dans la communauté du génie logicielle. Les cas de test sont définis dans des champ d'application : -#### Tester NouveauCalculImpotRevenu +### Tester NouveauCalculImpotRevenu ```catala déclaration champ d'application Test1: @@ -356,7 +356,7 @@ Ce cas de test devrait calculer un impôt sur le revenu de 0€, en raison de l'article 6. Mais au lieu de cela, l'exécution produira une erreur car il y a un conflit entre les règles. -### Définir des exceptions à des règles +## Définir des exceptions à des règles En effet, la définition d'un impôt sur le revenu à l'article 6 entre en conflit avec la définition de l'article 5. Mais en réalité, l'article 6 @@ -364,7 +364,7 @@ est une simple exception à l'article 5. Dans la loi, il est implicite que si l'article 6 est applicable, alors son application est prioritaire sur l'article 5. -#### Régler correctement le calcul +### Régler correctement le calcul Cette priorité implicite doit être explicitement déclaré en Catala. Voici une version correcte du champ d'application NouveauCalculImpotRevenu : @@ -413,7 +413,7 @@ champ d'application Test3: assertion impôt_revenu = 0€ ``` -### Conclusion +## Conclusion Ce tutoriel présente les concepts de base et la syntaxe des fonctionnalités du langage Catala. C'est à vous de les utiliser pour annoter du texte diff --git a/flake.lock b/flake.lock index 10b57e4d..66251bec 100644 --- a/flake.lock +++ b/flake.lock @@ -17,11 +17,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1658015103, - "narHash": "sha256-mO+23f3SO+fBzEvbxRe6GkSB5Xp43CT2sV8Rs8MYdz8=", + "lastModified": 1659219666, + "narHash": "sha256-pzYr5fokQPHv7CmUXioOhhzDy/XyWOIXP4LZvv/T7Mk=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "8f485713f5e6b6883a9b6959afa98688360a3ecb", + "rev": "7b9be38c7250b22d829ab6effdee90d5e40c6e5c", "type": "github" }, "original": { diff --git a/french_law/dune b/french_law/dune deleted file mode 100644 index e61b0a6c..00000000 --- a/french_law/dune +++ /dev/null @@ -1 +0,0 @@ -(dirs ocaml) diff --git a/french_law/js/Makefile b/french_law/js/Makefile index 18480dd5..33db2262 100644 --- a/french_law/js/Makefile +++ b/french_law/js/Makefile @@ -2,4 +2,4 @@ dependencies: npm install bench: - node allocations_familiales.js + node examples.js diff --git a/french_law/js/README.md b/french_law/js/README.md index c9cf01ac..2b02b0aa 100644 --- a/french_law/js/README.md +++ b/french_law/js/README.md @@ -8,8 +8,10 @@ algorithms coded up in Catala. The JS code is extracted from OCaml using [`js_of_ocaml`](https://ocsigen.org/js_of_ocaml/). See the [dedicated README](../ocaml/README.md) of the OCaml library for more precisions -about the OCaml code. The wrapping between OCaml and JS is done by the -`api_web.ml` module. +about the OCaml code. + +The wrapping between OCaml and JS is done by the generated +`../ocaml/law_source/_api_web.ml` modules. You can generate the `french_law.js` source JS module by invoking this command from the root of the repository: @@ -20,74 +22,47 @@ make build_french_law_library_js ## API description -
    +The `french_law.js` library exposes: -API content +- an [event manager](#the-event-manager) +- a list of [API functions](#api-functions) +- a list of fully exposed [sub-libraries](#sub-libraries) -### Data types +### The event manager -#### `source_position` - -Stores information about the log position. +A JavaScript object `eventsManager` is exposed with three callable methods: ```javascript -{ - fileName : string - startLine : int - endLine : int - startColumn : int - endColumn : int - lawHeadings : [string] - } +var frenchLaw = require("french_law.js"); + +// Clears the raw log event array. +frenchLaw.eventsManager.resetLog(0); + +// Returns the current content of the raw log event array. +let rawEvents = frenchLaw.eventsManager.retrieveRawEvents(0) + +// Returns the event array parsed from the current content of the raw log event array. +let events = frenchLaw.eventsManager.retrieveEvents(0) ``` -#### `log_event` +> **Important**: you need to give an arbitrary value as argument. -Stores information about one log event. +### Date and time -```javascript -{ - eventType : string - information : [string] - sourcePosition : source_position? - loggedValueJson : string -} -``` +Date values are encoded to JS string according the [ISO8601 +format](https://www.iso.org/iso-8601-date-and-time-format.html): 'YYYY-MM-DD'. -`loggedValueJson` is the resulting string representation of the -`Runtime.runtime_value` serialization via `yojson` -- see -`./src/compiler/runtime.mli`. +### API functions -### Functions +The `french_law.js` library exposes for each Catala program available in +`../ocaml/law_source/` a function to call in order to run the corresponding +encoded algorithm. -#### `french_law.resetLog()` +#### Available algorithms -Clears the log array. +##### Allocations familiales -Example of use: - -```javascript -french_law.resetLog(0) // Note that you have to pass an arbitrary argument. -``` - -#### `french_law.retrieveLog()` - -Returns the array of [`log_event`](#log_event) resulting of the computation of the -[algorithms](#available-algorithms). - -Example of use: - -```javascript -let logs = french_law.retrieveLog(0) // Note that you have to pass an arbitrary argument. -``` - -
    - -## Available algorithms - -### Allocations familiales - -The function of the library is `computeAllocationsFamiliales`. This computation +The function is `computeAllocationsFamiliales`. This computation returns the amount of _allocations familiales_ for one household described by the input. More precisely, the result returned is the sum of: @@ -99,35 +74,66 @@ by the input. More precisely, the result returned is the sum of: An example of use: ```javascript -Law.computeAllocationsFamiliales({ - currentDate: new Date("2020-05-20"), - children: [ +var frenchLaw = require("french_law.js"); + +let amount = frenchLaw.computeAllocationsFamiliales({ + iDateCouranteIn: "2020-04-20", + iEnfantsIn: [ { - id: 0, - remunerationMensuelle: 0, - dateNaissance: new Date("2003-03-02"), - priseEnCharge: "Effective et permanente", - aDejaOuvertDroitAuxAllocationsFamiliales: true, + dIdentifiant: 0, + dRemunerationMensuelle: 0, + dDateDeNaissance: "2003-02-02", + dPriseEnCharge: { kind: "EffectiveEtPermanente", payload: null }, + dADejaOuvertDroitAuxAllocationsFamiliales: true, + dBeneficieTitrePersonnelAidePersonnelleLogement: false, }, { - id: 1, - remunerationMensuelle: 300, - dateNaissance: new Date("2013-10-30"), - priseEnCharge: "Garde alternée, partage des allocations", - aDejaOuvertDroitAuxAllocationsFamiliales: true, + dIdentifiant: 1, + dRemunerationMensuelle: 300, + dDateDeNaissance: "2013-09-30", + dPriseEnCharge: { + kind: "GardeAlterneePartageAllocations", + payload: null, + }, + dADejaOuvertDroitAuxAllocationsFamiliales: true, + dBeneficieTitrePersonnelAidePersonnelleLogement: false, }, ], - income: 30000, - residence: "Métropole", - personneQuiAssumeLaChargeEffectivePermanenteEstParent: true, - personneQuiAssumeLaChargeEffectivePermanenteRemplitConditionsTitreISecuriteSociale: true, + iRessourcesMenageIn: 30000, + iResidenceIn: { kind: "Metropole", payload: null }, + iPersonneChargeEffectivePermanenteEstParentIn: true, + iPersonneChargeEffectivePermanenteRemplitTitreIIn: true, + iAvaitEnfantAChargeAvant1erJanvier2012In: false, }); ``` -Notably, the `priseEnCharge` variable for each child expects a value among: +Notably, the `dPriseEnCharge` variable for each child expects a value among: +- "GardeAlterneePartageAllocations" +- "GardeAlterneeAllocataireUnique" +- "EffectiveEtPermanente" +- "ServicesSociauxAllocationVerseeALaFamille" +- "ServicesSociauxAllocationVerseeAuxServicesSociaux" -- `"Effective et permanente"` -- `"Garde alternée, allocataire unique"` -- `"Garde alternée, partage des allocations"` -- `"Confié aux service sociaux, allocation versée à la famille"` -- `"Confié aux service sociaux, allocation versée aux services sociaux"` +> See `../ocaml/law_source/allocations_familiales_api_web.ml` for more +> information about data types. + +##### Aides logement + +> TODO: add information about `aides_logement_api_web.ml`. + +### Sub libraries + +All declared types and scopes of a Catala program are available in JavaScript +via the following sub libs: + +```javascript +var frenchLaw = require("french_law.js"); + +// Allocations familiales +// corresponding to the file: `../ocaml/law_source/allocations_familiales_api_web.ml +var allocationsFamiliales = frenchLaw.AllocationsFamilialesLib + +// APL +// corresponding to the file: `../ocaml/law_source/aides_logement_api_web.ml +var aidesLogement = frenchLaw.AidesLogementLib +``` diff --git a/french_law/js/allocations_familiales.js b/french_law/js/allocations_familiales.js deleted file mode 100644 index ab76f5f0..00000000 --- a/french_law/js/allocations_familiales.js +++ /dev/null @@ -1,55 +0,0 @@ -var Law = require("./french_law.js"); -var Benchmark = require("benchmark"); -const util = require("util"); -var suite = new Benchmark.Suite(); - -function run_computation(log) { - var result = Law.computeAllocationsFamiliales({ - currentDate: new Date(Date.UTC(2020, 04, 20)), - children: [ - { - id: 0, - remunerationMensuelle: 0, - dateNaissance: new Date(Date.UTC(2003, 02, 02)), - priseEnCharge: "Effective et permanente", - aDejaOuvertDroitAuxAllocationsFamiliales: true, - beneficieATitrePersonnelAidePersonnelleAuLogement: false, - }, - { - id: 1, - remunerationMensuelle: 300, - dateNaissance: new Date(Date.UTC(2013, 09, 30)), - priseEnCharge: "Garde alternée, partage des allocations", - aDejaOuvertDroitAuxAllocationsFamiliales: true, - beneficieATitrePersonnelAidePersonnelleAuLogement: false, - }, - ], - income: 30000, - residence: "Métropole", - personneQuiAssumeLaChargeEffectivePermanenteEstParent: true, - personneQuiAssumeLaChargeEffectivePermanenteRemplitConditionsTitreISecuriteSociale: true, - avaitEnfantAChargeAvant1erJanvier2012: false, - }); - if (log) { - console.log( - util.inspect(Law.retrieveLog(0).slice(1, 10), { - showHidden: false, - depth: null, - colors: true, - }) - ); - } - Law.resetLog(); -} - -// run_computation(true); -// process.exit(0); - -suite - .add("AllocationFamiliales#benchmark", function () { - run_computation(false); - }) - .on("cycle", function (event) { - console.log(String(event.target)); - }) - .run({ async: true }); diff --git a/french_law/js/dune b/french_law/js/dune new file mode 100644 index 00000000..68715f30 --- /dev/null +++ b/french_law/js/dune @@ -0,0 +1,4 @@ +(rule + (mode promote) + (action + (copy ../ocaml/api_web.bc.js french_law.js))) diff --git a/french_law/js/examples.js b/french_law/js/examples.js new file mode 100644 index 00000000..0b7bd6f4 --- /dev/null +++ b/french_law/js/examples.js @@ -0,0 +1,212 @@ +var Law = require("./french_law.js"); +var Benchmark = require("benchmark"); +const util = require("util"); +const { cachedDataVersionTag } = require("v8"); +const { truncateSync } = require("fs"); +var suite = new Benchmark.Suite(); + +function run_computation_AF(log) { + var result = Law.computeAllocationsFamiliales({ + iDateCouranteIn: "2020-04-20", + iEnfantsIn: [ + { + dIdentifiant: 0, + dRemunerationMensuelle: 0, + dDateDeNaissance: "2003-02-02", + dPriseEnCharge: { kind: "EffectiveEtPermanente", payload: null }, + dADejaOuvertDroitAuxAllocationsFamiliales: true, + dBeneficieTitrePersonnelAidePersonnelleLogement: false, + }, + { + dIdentifiant: 1, + dRemunerationMensuelle: 300, + dDateDeNaissance: "2013-09-30", + dPriseEnCharge: { + kind: "GardeAlterneePartageAllocations", + payload: null, + }, + dADejaOuvertDroitAuxAllocationsFamiliales: true, + dBeneficieTitrePersonnelAidePersonnelleLogement: false, + }, + ], + iRessourcesMenageIn: 30000, + iResidenceIn: { kind: "Metropole", payload: null }, + iPersonneChargeEffectivePermanenteEstParentIn: true, + iPersonneChargeEffectivePermanenteRemplitTitreIIn: true, + iAvaitEnfantAChargeAvant1erJanvier2012In: false, + }); + if (log) { + console.log( + util.inspect(Law.eventsManager.retrieveEvents(0).slice(1, 10), { + showHidden: false, + depth: null, + colors: true, + }) + ); + } + Law.eventsManager.resetLog(); + console.log("Family benefits mounthly amount:", result, "€"); +} + +function run_computation_AL(log) { + var result = Law.computeAidesAuLogement({ + dateCouranteIn: "2022-01-01", + menageIn: { + prestationsRecues: [ + { kind: "AllocationSoutienEnfantHandicape", payload: null }, + { kind: "ComplementFamilial", payload: null }, + { kind: "AllocationsFamiliales", payload: null }, + ], + situationFamiliale: { + kind: "Maries", + payload: "2010-11-26", + }, + personnesACharge: [ + { + kind: "EnfantACharge", + payload: { + beneficieTitrePersonnelAidePersonnelleLogement: false, + priseEnCharge: { kind: "EffectiveEtPermanente", payload: null }, + age: 19, + identifiant: 0, + aDejaOuvertDroitAuxAllocationsFamiliales: true, + dateDeNaissance: "2003-01-01", + remunerationMensuelle: 0, + obligationScolaire: { kind: "Apres", payload: null }, + situationGardeAlternee: { + kind: "GardeAlterneeCoefficientPriseEnCharge", + payload: 0.5, + }, + }, + }, + { + kind: "EnfantACharge", + payload: { + beneficieTitrePersonnelAidePersonnelleLogement: false, + priseEnCharge: { kind: "EffectiveEtPermanente", payload: null }, + age: 11, + identifiant: 1, + aDejaOuvertDroitAuxAllocationsFamiliales: true, + dateDeNaissance: "2011-01-01", + remunerationMensuelle: 0, + obligationScolaire: { kind: "Pendant", payload: null }, + situationGardeAlternee: { + kind: "PasDeGardeAlternee", + payload: null, + }, + }, + }, + { + kind: "EnfantACharge", + payload: { + beneficieTitrePersonnelAidePersonnelleLogement: false, + priseEnCharge: { kind: "EffectiveEtPermanente", payload: null }, + age: 8, + identifiant: 2, + aDejaOuvertDroitAuxAllocationsFamiliales: true, + dateDeNaissance: "2014-01-01", + remunerationMensuelle: 0, + obligationScolaire: { kind: "Pendant", payload: null }, + situationGardeAlternee: { + kind: "PasDeGardeAlternee", + payload: null, + }, + }, + }, + ], + logement: { + zone: { kind: "Zone1", payload: null }, + residencePrincipale: true, + estEhpadOuMaisonAutonomieL31312Asf: false, + modeOccupation: { + kind: "Locataire", + payload: { + bailleur: { + typeBailleur: { kind: "BailleurPrive", payload: null }, + respecteConventionTitreV: true, + respecteConventionTitreII: true, + construitAmelioreConditionsL83114: false, + acquisitionAidesEtatPretTitreIIOuLivreIII: false, + }, + }, + }, + proprietaire: { kind: "Autre", payload: null }, + loueOuSousLoueADesTiers: { kind: "Non", payload: null }, + usufruit: { kind: "Autre", payload: null }, + logementDecentL89462: true, + loyersL8233: 700, + surfaceMCarres: 80, + estAncienL8312: false, + situeCommuneDesequilibreL8312: false, + }, + nombreAutresOccupantsLogement: 1, + conditionRattacheFoyerFiscalParentIfi: false, + nombreEnfantsANaitreApresTroisiemeMoisGrossesse: 0, + enfantANaitreApresQuatriemeMoisGrossesse: false, + dateNaissanceTroisiemeEnfantOuDernierSiPlus: { + kind: "PlusDeTroisEnfants", + payload: { + kind: "DateDeNaissance", + payload: "2014-09-15", + }, + }, + }, + demandeurIn: { + personneHebergeeCentreSoinLL162223SecuriteSociale: false, + satisfaitConditionsL5122CodeSecuriteSociale: true, + ageDemandeur: 52, + dateNaissance: "1970-05-02", + contratDeTravail: { kind: "CDI", payload: null }, + nationalite: { kind: "Francaise", payload: null }, + patrimoine: { + produisantRevenuPeriodeR82233R8224: 0, + neProduisantPasRevenuPeriodeR82233R8224: 0, + }, + }, + informationsCalculIn: { + kind: "InfosLocatif", + payload: { + loyerPrincipal: 1700, + beneficiaireAideAdulteOuEnfantHandicapes: false, + logementEstChambre: false, + colocation: false, + ageesOuHandicapAdultesHebergeesOnereuxParticuliers: false, + reductionLoyerSolidarite: 0, + logementMeubleD8422: false, + changementLogementD8424: { + kind: "PasDeChangement", + payload: null, + }, + }, + }, + ressourcesMenagePrisesEnCompteIn: 20000, + }); + if (log) { + console.log( + util.inspect(Law.eventsManager.retrieveEvents(0).slice(1, 10), { + showHidden: false, + depth: null, + colors: true, + }) + ); + } + Law.eventsManager.resetLog(); + console.log("Housing benefits mounthly amount:", result, "€"); +} + +try { + run_computation_AF(false); + run_computation_AL(false); +} catch (error) { + console.log(error.message); +} +process.exit(0); + +// suite +// .add("AllocationFamiliales#benchmark", function () { +// run_computation_AF(false); +// }) +// .on("cycle", function (event) { +// console.log(String(event.target)); +// }) +// .run({ async: true }); diff --git a/french_law/js/french_law.js b/french_law/js/french_law.js index 49a01f48..0363886e 100644 --- a/french_law/js/french_law.js +++ b/french_law/js/french_law.js @@ -1,141 +1,143 @@ -// Generated by js_of_ocaml 4.0.0 +// Generated by js_of_ocaml 4.0.0+git-0.5.0-666-g0ac754b7-dirty (function(a){typeof globalThis!=="object"&&(this?b():(a.defineProperty(a.prototype,"_T_",{configurable:true,get:b}),_T_));function b(){var b=this||self;b.globalThis=b;delete -a.prototype._T_}}(Object));(function(C){"use strict";var -OJ=C,OM=typeof -module==="object"&&module.exports||C,lD=214,lC=" is too large for shifting.",nB="Invalid_argument",lB="0.08",fH="Map.bal",nA="EndCall([ ",lA="@[",v="Code de la s\xc3\xa9curit\xc3\xa9 sociale",ov="Article L521-1",cF=123,nz="577500",ny="%ni",gh=365180284,ou=43200.,hL="ml_z_overflow",mI=159,ot="EMFILE",af=86400.,aV=2020,a4=0xff,nx="ENOMEM",mH="Arr\xc3\xaat\xc3\xa9 du 19 avril 2022 relatif au rel\xc3\xa8vement du salaire minimum de croissance",h0=-12,nw=-45,lz=-752863768,mG=458,fY="Titre 5 : Dispositions particuli\xc3\xa8res \xc3\xa0 la Guadeloupe, \xc3\xa0 la Guyane, \xc3\xa0 la Martinique, \xc3\xa0 La R\xc3\xa9union, \xc3\xa0 Saint-Barth\xc3\xa9lemy et \xc3\xa0 Saint-Martin",os="559500",bZ="Article 1",fX=3654863,cj=122,ly="582700",fG=167,or=992015837,nv="EPROTONOSUPPORT",s="0",oq=299,nu="ENETRESET",il=181,op="EACCES",lx=197,nt="EINVAL",mF="0.5",ns="EDOM",bB=128,lw="Sys_blocked_io",mE="fd ",nr="EFBIG",lu="Chapitre 2 : Champ d'application.",fF="Chapitre 2 : Champ d'application",lv="0.0588",Q=248,eB=146,lt="EXDEV",gg=">",dD=153,oo=1027,mD=409,on="EINPROGRESS",bq=0xFF,nq=301,mC=338,np="562800",ci="Chapitre 5 : Prestations familiales et prestations assimil\xc3\xa9es",R=246,mB="%B",ls="%u",no="resetLog",dC=2011,f="AllocationsFamiliales",nn=3268,lr="EHOSTUNREACH",bp="./securite_sociale_R.catala_fr",z="Livre 5 : Prestations familiales et prestations assimil\xc3\xa9es",fW=108,aM="2",bz=127,eq=1024,lq="@{",dx=-2147483648,ad="1",f8=133,gf="e",cB="Montant de la base mensuelle des allocations familiales",lp=" : flags Open_rdonly and Open_wronly are not compatible",lo="D\xc3\xa9cret n\xc2\xb0 2019-1387 du 18 d\xc3\xa9cembre 2019 portant rel\xc3\xa8vement du salaire minimum de croissance",aL="-",cA=803994948,mA="EAGAIN",hZ=": Not a directory",lm=216,ln=" : file already exists",mz="b",om="smic",my="Article D521-3",nm=184,h_=366,cg=0xffffff,dw=2012,mx="EDESTADDRREQ",nk="::z",nl="EISCONN",ok=-43,U="./securite_sociale_D.catala_fr",ol="EROFS",fV=86400,mw="Out_of_memory",ll="retrieveEvents",oj="inf",hY="index out of bounds",oi="EPIPE",lk="ENOEXEC",fU="_bigarr02",nj=465,og="Circulaire interminist\xc3\xa9rielle N\xc2\xb0 DSS/SD2B/2017/352 du 22 d\xc3\xa9cembre 2017 relative \xc3\xa0 la revalorisation au 1er janvier 2018 des plafonds de ressources d\xe2\x80\x99attribution de certaines prestations familiales servies en m\xc3\xa9tropole, en Guadeloupe, en Guyane, en Martinique, \xc3\xa0 la R\xc3\xa9union, \xc3\xa0 Saint-Barth\xc3\xa9lemy, \xc3\xa0 Saint-Martin et \xc3\xa0 Mayotte",oh=394,mv=0xffffffff,eA=111,h9=2147483647,ni=208,lj="\\b",li="Martinique",ng=", characters ",nh=0x7F,lh="EPFNOSUPPORT",bR=0xffff,h8="BaseMensuelleAllocationsFamiliales",mu="EBUSY",fT=417088404,ms="%.17g",mt="ENETUNREACH",of="ENOLCK",lf="ENOTTY",lg=12520,hX=400,ne=".0",nf="ESHUTDOWN",ld=-46,le="ENXIO",lc=401,a3=3600,E="Chapitre 1er : Allocations familiales",h7="AllocationFamilialesAvril2008",oe="ERANGE",dq=2016,od="AM",bQ="\xc3\xa2ge_minimum_alin\xc3\xa9a_1_l521_3",ik="\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\0\0\xff\xff\x03\0\0\0\x86\0\xff\xff\x03\0\xff\xff\x86\0E\x01\x92\x019\0\xff\xffE\x01\x92\x01\xff\xff\xff\xff\xff\xff\xff\xff}\0\x8a\0\xff\xff\0\0\xff\xff\0\0\x03\0\xa9\0\x86\0\xae\0\xff\xff\0\0\n\x01E\x01\x92\x01\f\x01\0\0\n\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x05\0s\0\0\0}\0\x81\0\x05\0\xec\x01\x88\0\xff\x01&\0\xff\xff\n\0\x88\0f\0:\0\0\0k\0f\0\xff\xff\x0b\0\0\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x1d\0&\0\0\0o\0\xd0\0\xe9\0\xff\0\f\x01\x0f\0\x11\0<\0\x0b\0\n\0\0\0\x14\0\x18\0\x1f\0 \0\"\0\x16\0\x1a\0\0\0\x0e\0\x1b\0!\0\x12\0\x17\0\0\0\x10\0\x13\0#\0(\0$\0&\0\0\0)\0*\0+\0,\0-\0.\0:\0R\0\x0b\0\r\0\r\0\r\0\r\0\r\0\r\0\r\0\r\0\r\0\r\0'\0?\0'\0'\0'\0'\0'\0'\0'\0'\0'\0'\0U\0\x8c\0<\0\r\0\x8f\0\x90\0\x91\x000\0\x93\x000\0\x94\0'\x000\x000\x000\x000\x000\x000\x000\x000\x000\x000\x001\x001\x001\x001\x001\x001\x001\x001\x001\x001\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\0A\0'\0\x95\0\x96\0\x9c\0?\0\x9d\x003\0\x9e\x003\0\x9f\x002\x003\x003\x003\x003\x003\x003\x003\x003\x003\x003\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x005\x005\x005\x005\x005\x005\x005\x005\x005\x005\0\x9b\x002\x006\x006\x006\x006\x006\x006\x006\x006\x006\x006\0\xa1\0\xa2\0\x9b\0[\0A\0\0\x007\x007\x007\x007\x007\x007\x007\x007\x007\x007\x009\0D\0f\0k\0s\0\x83\0\x85\0\x85\0}\0\x8a\0\x85\0\xa3\0^\0\xa5\0D\0\xa6\0\xa7\0\xa8\0\xab\0o\0\xac\0\xad\0\xce\0\xcb\0\xcf\0\xd2\0\xd3\0:\0R\0\x85\0\xd4\0\xd5\0\xd6\0\xd7\0\xd9\0\x8c\0\xda\0a\0\xdb\0\xdc\0w\0\xdd\0\xde\0\xdf\0\x85\0[\0\xcb\0\"\x01>\x01\xe9\0\x98\0\x01\x01P\x01\xf7\0<\0\xfb\x006\x01:\x01Q\x01D\0)\x01R\x01S\x01\x06\x01\x1a\x01D\0w\0\x1e\x01\x0f\x01D\0^\0\x0f\x01T\x01U\x01V\x01G\x01X\x01D\0\xcb\x002\x01G\x01D\0Y\x01D\0D\0G\0G\0G\0G\0G\0G\0G\0G\0G\0G\0a\0L\x01w\0Z\x01?\0\x01\x01\\\x01G\0G\0G\0G\0G\0G\0N\0N\0N\0N\0N\0N\0N\0N\0N\0N\0\x98\0L\x01]\x01_\x01a\x01b\x01-\x01N\0N\0N\0N\0N\0N\0c\x01\x98\0d\x01G\0G\0G\0G\0G\0G\0\xb4\0\xb4\0\xb4\0\xb4\0\xb4\0\xb4\0\xb4\0\xb4\0\xb4\0\xb4\0\x14\x01L\x01A\0\x14\x01e\x01f\x01h\x01N\0N\0N\0N\0N\0N\0O\0O\0O\0O\0O\0O\0O\0O\0O\0O\0i\x01j\x01-\x01$\x01k\x01l\x01m\x01O\0O\0O\0O\0O\0O\0P\0P\0P\0P\0P\0P\0P\0P\0P\0P\0n\x01\x1a\x01y\x01\x9d\x01\x1e\x01\x9e\x01\x14\x01P\0P\0P\0P\0P\0P\0[\0\x9f\x01>\x01O\0O\0O\0O\0O\0O\0\xf7\0\xa0\x01\xfb\0\xa1\x01:\x01D\0V\0V\0V\0V\0V\0V\0V\0V\0V\0V\0^\0P\0P\0P\0P\0P\0P\0V\0V\0V\0V\0V\0V\0W\0W\0W\0W\0W\0W\0W\0W\0W\0W\0$\x01)\x01a\0\xa2\x01\xa3\x01w\0\x01\x01W\0W\0W\0W\0W\0W\0\xa5\x016\x01\x98\0V\0V\0V\0V\0V\0V\0\x06\x01\xa6\x01\xa7\x01\xa8\x01\x0f\x01\xa9\x01X\0X\0X\0X\0X\0X\0X\0X\0X\0X\x002\x01W\0W\0W\0W\0W\0W\0X\0X\0X\0X\0X\0X\0Y\0Y\0Y\0Y\0Y\0Y\0Y\0Y\0Y\0Y\0_\0\x85\x01\xaa\x01\xab\x01\x9a\x01\x85\x01\xac\x01Y\0Y\0Y\0Y\0Y\0Y\0_\0\xb0\0\xad\x01X\0X\0X\0X\0X\0X\0-\x01\xae\x01\xaf\x01\xb0\0\xb0\x01\x9a\x01\xb0\0\xb0\0\xb0\0\xb0\0\xb0\0\xb0\0\xb0\0\xb0\0\xb0\0\xb0\0z\x01Y\0Y\0Y\0Y\0Y\0Y\0\x94\x01\xb1\x01\x14\x01\xb2\x01b\0\x94\x01\xb3\x01\xb4\x01\xb5\x01\xb6\x01\xb7\x01\xd8\x01\xc1\x01_\0\x9a\x01\xd8\x01\xcd\x01b\0\xde\x01_\0\xcd\x01\xe5\x01\x01\x02_\0\xda\x01$\x01\xd7\x01\xd7\x01\x02\x02\xda\x01\xd7\x01_\0\x04\x02\x05\x02\xd8\x01_\0\x06\x02_\0_\0`\0`\0`\0`\0`\0`\0`\0`\0`\0`\0\xd7\x01\x07\x02z\x01\b\x02\t\x02\n\x02\x0b\x02`\0`\0`\0`\0`\0`\0b\0\f\x02\xd7\x01\xf7\x01\r\x02\x0e\x02b\0\x0f\x02}\x01\x80\x01b\0\x10\x02\xdc\x01\x11\x02\xfb\x01\x12\x02\x13\x02\x14\x02b\0y\x01\x15\x02\xc2\x01b\0\x16\x02b\0b\0`\0`\0`\0`\0`\0`\0c\0c\0c\0c\0c\0c\0c\0c\0c\0c\0\xe7\x01\x17\x02\xee\x01\x18\x02\xfb\x01\xee\x01\x19\x02c\0c\0c\0c\0c\0c\0d\0d\0d\0d\0d\0d\0d\0d\0d\0d\0\xf3\x01}\x01\x80\x01\xe0\x01\x1a\x02\xc5\x01\x1b\x02d\0d\0d\0d\0d\0d\0\x1c\x02\xc2\x01\x1d\x02c\0c\0c\0c\0c\0c\0\x1e\x02\x1f\x02 \x02\xc8\x01\xe7\x01\x85\x01e\0e\0e\0e\0e\0e\0e\0e\0e\0e\0\xff\xffd\0d\0d\0d\0d\0d\0e\0e\0e\0e\0e\0e\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xff\xff\xff\xff\xc5\x01\xb0\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb9\0\xff\xffe\0e\0e\0e\0e\0e\0\xc8\x01\xe0\x01\xff\xff\xb9\0\xcd\x01z\x01\xb9\0\xb9\0\xb9\0\xb9\0\xb9\0\xb9\0\xb9\0\xb9\0\xb9\0\xb9\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbf\0\xbf\0\xbf\0\xbf\0\xbf\0\xbf\0\xbf\0\xbf\0\xbf\0\xbf\0\xc0\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc0\0\xc1\x01\xf7\x01\xc0\0\xc0\0\xc0\0\xc0\0\xc0\0\xc0\0\xc0\0\xc0\0\xc0\0\xc0\0\xc6\0\xc6\0\xc6\0\xc6\0\xc6\0\xc6\0\xc6\0\xc6\0\xc6\0\xc6\0\xc7\0\xe2\0\xe2\0\xe2\0\xe2\0\xe2\0\xe2\0\xe2\0\xe2\0\xe2\0\xe2\0\xc7\0}\x01\x80\x01\xc7\0\xc7\0\xc7\0\xc7\0\xc7\0\xc7\0\xc7\0\xc7\0\xc7\0\xc7\0\xcc\0\xc2\x01\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xe7\x01\xff\xff\xff\xff\xc7\0\xdc\x01\xee\x01\xfb\x01\xff\xff\xc7\0\xf3\x01\xff\xff\xcc\0\xcd\0\xcd\0\xcd\0\xcd\0\xcd\0\xcd\0\xcd\0\xcd\0\xcd\0\xcd\0\xe1\0\xff\xff\xe1\0\xff\xff\xe0\x01\xe1\0\xe1\0\xe1\0\xe1\0\xe1\0\xe1\0\xe1\0\xe1\0\xe1\0\xe1\0\xcd\0\xc5\x01\xff\xff\xff\xff\xff\xff\xff\xff\xcc\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xff\xff\xff\xff\xff\xff\xff\xff\xc8\x01\xff\xff\xff\xff\xe4\0\xff\xff\xe4\0\xff\xff\xe3\0\xe4\0\xe4\0\xe4\0\xe4\0\xe4\0\xe4\0\xe4\0\xe4\0\xe4\0\xe4\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe6\0\xe6\0\xe6\0\xe6\0\xe6\0\xe6\0\xe6\0\xe6\0\xe6\0\xe6\0\xff\xff\xe3\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xb9\0\xe8\0\xe8\0\xe8\0\xe8\0\xe8\0\xe8\0\xe8\0\xe8\0\xe8\0\xe8\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xed\0\xff\xffM\x01\xff\xffM\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01q\x01q\x01q\x01q\x01q\x01q\x01q\x01q\x01q\x01q\x01\xff\xffM\x01\xff\xff\xff\xff\xc0\0\xff\xff\xff\xff\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0M\x01\xff\xff\xff\xff\xff\xff\xed\0\xc7\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xff\xff\xf2\0\xff\xff\xff\xff\xf0\0\xff\xff\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xff\xff\xff\xff\xff\xff\xff\xff\xf2\0\xff\xff\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xed\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xff\xff\xff\xff\xff\xff\xff\xff\xf5\0\xff\xff\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0B\x01B\x01\xff\xff\xff\xffB\x01O\x01O\x01O\x01O\x01O\x01O\x01O\x01O\x01O\x01O\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xffB\x01\xff\xffB\x01\xff\xff\xff\xff\xff\xff\xff\xffO\x01B\x01\xff\xff\xff\xff\xff\xff\xff\xffB\x01\xff\xffB\x01B\x01B\x01B\x01B\x01B\x01B\x01B\x01B\x01B\x01B\x01\xff\xff\xff\xffB\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf2\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xffB\x01p\x01\xff\xffp\x01\xff\xffB\x01p\x01p\x01p\x01p\x01p\x01p\x01p\x01p\x01p\x01p\x01\xff\xff\xff\xffB\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01B\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xffB\x01\xff\xff\xff\xffr\x01\xff\xff\xff\xffB\x01\xff\xff\xff\xffs\x01\xff\xffs\x01\xff\xffB\x01s\x01s\x01s\x01s\x01s\x01s\x01s\x01s\x01s\x01s\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01\xff\xffr\x01u\x01u\x01u\x01u\x01u\x01u\x01u\x01u\x01u\x01u\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01w\x01w\x01w\x01w\x01w\x01w\x01w\x01w\x01w\x01w\x01\xff\xff~\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\xff\xff\xff\xff~\x01\xff\xff\xff\xff\xff\xff\x81\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x81\x01\xff\xff\xff\xff\x9b\x01\xff\xff\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x9b\x01\xff\xff~\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff~\x01\xff\xff\xff\xff\xff\xff~\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x81\x01~\x01\xff\xff\xff\xffB\x01~\x01\x81\x01~\x01~\x01\xff\xff\x81\x01\xff\xff\xff\xff\x9b\x01\xff\xff\xff\xff\xff\xff\xff\xff\x81\x01\xff\xff\xff\xff\xff\xff\x81\x01\xff\xff\x81\x01\x81\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\xff\xff\xff\xff\xff\xff\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\xff\xff\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\xb8\x01\x8a\x01\xb8\x01\xff\xff\xff\xff\xb8\x01\xb8\x01\xb8\x01\xb8\x01\xb8\x01\xb8\x01\xb8\x01\xb8\x01\xb8\x01\xb8\x01\xb9\x01\xb9\x01\xb9\x01\xb9\x01\xb9\x01\xb9\x01\xb9\x01\xb9\x01\xb9\x01\xb9\x01\xff\xff\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\xff\xff\xff\xff\xff\xff\xff\xff\x8a\x01\xff\xff\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\xff\xff\xff\xff\xff\xff\xff\xff\x8d\x01\xff\xff\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8f\x01\x8f\x01\xff\xff\xff\xff\x8f\x01\x9c\x01\x9c\x01\x9c\x01\x9c\x01\x9c\x01\x9c\x01\x9c\x01\x9c\x01\x9c\x01\x9c\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc6\x01\x8f\x01\xff\xff\x8f\x01\xff\xff\xff\xff\xff\xff\xff\xff\x9c\x01\x8f\x01\xff\xff\xff\xff\xff\xff\xc6\x01\x8f\x01\xff\xff\x8f\x01\x8f\x01\x8f\x01\x8f\x01\x8f\x01\x8f\x01\x8f\x01\x8f\x01\x8f\x01\x8f\x01\x8f\x01\xff\xff\xff\xff\x8f\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x8a\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x8f\x01\xff\xff\xff\xff\xff\xff\xff\xff\x8f\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xc6\x01\xff\xff\x8f\x01\xff\xff\xff\xff\xff\xff\xc6\x01\xff\xff\xff\xff\xff\xff\xc6\x01\xba\x01\xff\xff\x8f\x01\xff\xff\xff\xff\xff\xff\xff\xff\xc6\x01\xff\xff\xff\xff\x8f\x01\xc6\x01\xff\xff\xc6\x01\xc6\x01\xff\xff\x8f\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x8f\x01\xff\xff\xff\xff\xff\xff\xff\xff\xbb\x01\xff\xff\xbb\x01\xff\xff\xba\x01\xbb\x01\xbb\x01\xbb\x01\xbb\x01\xbb\x01\xbb\x01\xbb\x01\xbb\x01\xbb\x01\xbb\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbd\x01\xbd\x01\xbd\x01\xbd\x01\xbd\x01\xbd\x01\xbd\x01\xbd\x01\xbd\x01\xbd\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbf\x01\xbf\x01\xbf\x01\xbf\x01\xbf\x01\xbf\x01\xbf\x01\xbf\x01\xbf\x01\xbf\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc9\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc9\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc9\x01\xff\xff\xff\xff\xff\xff\xff\xff\x8f\x01\xc9\x01\xff\xff\xff\xff\xff\xff\xc9\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc9\x01\xff\xff\xff\xff\xff\xff\xc9\x01\xff\xff\xc9\x01\xc9\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xff\xff\xff\xff\xff\xff\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xff\xff\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xff\xff\xd2\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xff\xff\xff\xff\xff\xff\xff\xff\xd2\x01\xff\xff\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xff\xff\xff\xff\xff\xff\xff\xff\xd5\x01\xff\xff\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xd2\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff",oc="infinity",dv=963043957,a2=1000,mr=142,fS=126,l="",hK=737456202,lb="^",cz=3600.,ob="\\t",la=86400000,mq=416,an="Partie l\xc3\xa9gislative",dp=0x3f,hW=124,at="./epilogue.catala_fr",oa=330,fR="Article L512-3",I="./decrets_divers.catala_fr",F="Titre 2 : Prestations g\xc3\xa9n\xc3\xa9rales d'entretien",fQ=150,ez=112,k$="Match_failure",cH="Montant des plafonds de ressources",S="Annexe",fP=135,bO=2021,mp="enfant_le_plus_\xc3\xa2g\xc3\xa9",fO=252,bb=0x00,mo="EPROTOTYPE",bP=".",ef="montant_initial_majoration",bN="+",fN=147,mn="EINTR",k_="ESRCH",mm=0xf0,bs="12.",ml="Guadeloupe",n$="ESOCKTNOSUPPORT",k9=179,f7=187,aE="PrestationsFamiliales",ey=110,cE=116,k8="%li",mk="EALREADY",dA=2015,fM=365,cf="prise_en_compte",n_=352,hJ="Smic",ij=-32,cD="R\xc3\xa8gles diverses",bY=1023,k7=373,nd=138,mi=-1080,hV=291,mj="EAFNOSUPPORT",aq="./securite_sociale_L.catala_fr",i="./prologue.catala_fr",fE=2299161,k6=267,mh=969837588,h6="nan",mg="PM",mf="ENFILE",k5=0xe0,me=-1023,cJ=117,k4="z",nb="ECHILD",nc=0xdfff,ex="compl\xc3\xa9ment_d\xc3\xa9gressif",k3="%",hU="Article L755-12",na="ETOOMANYREFS",bT="/",n9="Assert_failure",fD=2400000.5,k2="ENAMETOOLONG",n8="568400",hT="lib/read.mll",f6="ENOTDIR",n7="0.32",h5=1073741823,m$="ETIMEDOUT",k1="EMSGSIZE",bg=250,m_="\\r",en=1582,m9=154,f5=513,n6="ENOTCONN",o="Allocations familiales",k0="ECONNREFUSED",m8="src/time_Zone.ml",n5=1e14,ge="Article R521-3",md="Arr\xc3\xaat\xc3\xa9 du 14 d\xc3\xa9cembre 2020 relatif au montant des plafonds de ressources de certaines prestations familiales et aux tranches du bar\xc3\xa8me applicable au recouvrement des indus et \xc3\xa0 la saisie des prestations",cC='"',m6="Guyane",m7="EWOULDBLOCK",bX=2022,kZ="allocations_familiales",hI=1255,hS="<",m5=311,n4="Fatal error: exception %s\n",mc=0x800,dz=255,mb="EPERM",a1=2019,fC="Article R521-1",hH="jsError",bM=0x8000,ae="droit_ouvert_majoration",bt="Partie r\xc3\xa9glementaire - D\xc3\xa9crets en Conseil d'Etat",ew=146097,n3="Article 2",bW=256,ma=0.012,n2="Article L521-3",m4="End_of_file",l_="M\xc3\xa9tropole",l$=156,h4="Failure",n1="ENOSPC",fB=129,kY="\n",hR=204,em="conditions_hors_\xc3\xa2ge",f4=218,n0="D\xc3\xa9cret n\xc2\xb0 2021-1741 du 22 d\xc3\xa9cembre 2021 portant rel\xc3\xa8vement du salaire minimum de croissance",aU="./../smic/smic.catala_fr",gd="ENOENT",O="Dispositions sp\xc3\xa9ciales relatives \xc3\xa0 Mayotte",l9=726928360,l7=165,l8="([^/]+)",nZ=315,m3="ENETDOWN",ii="EnfantLePlus\xc3\x82g\xc3\xa9",nY=259,hQ=0xf,nW=437,nX="EOVERFLOW",fA=-48,h3="\xff\xff\xff\xff\xff\xff\x11\0\xff\xff\x13\0\xff\xff\xff\xff\xff\xff\xff\xff\x07\0\x07\0\xff\xff\x13\0\x13\0\x13\0\x13\0\x13\0\x13\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\b\0\b\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\t\0\xff\xff\t\0\xff\xff\t\0\xff\xff\xff\xff\x0e\0\xff\xff\xff\xff\x02\0\xff\xff\xff\xff\xff\xff\xff\xff\x02\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x07\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x03\0\xff\xff\x01\0\xff\xff\x04\0\x03\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x04\0\x04\0\x04\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x03\0\xff\xff\0\0\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\x02\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\x02\0\xff\xff\xff\xff\xff\xff\xff\xff\x03\0\x03\0\x05\0\x05\0\x05\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x03\0\xff\xff\x03\0\xff\xff\x03\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\x02\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x10\0\xff\xff\x12\0\xff\xff\xff\xff\xff\xff\xff\xff\x07\0\x07\0\xff\xff\x12\0\x12\0\x12\0\x12\0\x12\0\x12\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\b\0\xff\xff\b\0\xff\xff\b\0\xff\xff\xff\xff\r\0\xff\xff\xff\xff\xff\xff\x01\0\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\t\0\xff\xff\x0b\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\0\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\0\0\xff\xff\0\0\xff\xff\xff\xff\x06\0\xff\xff\xff\xff\xff\xff\x01\0\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\x04\0\x03\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x03\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff",m2=0xdc00,el="montant_initial_m\xc3\xa9tropole_majoration",du=125,ih="ENOTEMPTY",kW=423,kX="EBADF",ax="camlinternalFormat.ml",l6="Division_by_zero",nV=162,fz=148,kV="EMLINK",m1="Sys_error",nU="x",l5=430,f3=130,dn=2017,l4=708012133,m0=275,cG="Article D521-2",ev="Article D755-5",dm="Titre 1 : Champ d'application - G\xc3\xa9n\xc3\xa9ralit\xc3\xa9s",ce=60.,hG="EEXIST",dt=2014,ig="%d",mZ="Printexc.handle_uncaught_exception",nT="Z.of_substring_base: invalid digit",kU=32082,l3=380,fL=118,ch=1900,fy=121,l2="EADDRNOTAVAIL",nS="buffer.ml",l1=119,f2="int_of_string",kT="\\n",ej=104,ek="montant_avec_garde_altern\xc3\xa9e_majoration",l0="version_avril_2008",mX="name",mY=":z",fx=120,fK=127686388,h2=103,nR="ENOBUFS",hF="16",ds=2013,lZ=102,hE=512,gc=113,kS=0x7ff0,br=101,kR=177,lY="body",mW=132,kQ="0x",mV=" ])",kP="D\xc3\xa9cret n\xc2\xb0 2020-1598 du 16 d\xc3\xa9cembre 2020 portant rel\xc3\xa8vement du salaire minimum de croissance",hP="\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x03\0\x04\0\0\0\x03\0\x03\0\x86\0\0\0\x03\0\0\0\x86\0E\x01\x92\x01\xff\xff\0\0E\x01\x92\x01\0\0\0\0\0\0\0\0\x7f\0\x8b\0\0\0\x03\0\0\0\f\0\x03\0\xaa\0\x86\0\xaf\0\0\0\x07\0\x0b\x01E\x01\x92\x01\x0e\x01\r\x001\0\x05\0\n\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\x008\0v\0\x06\0\x81\0\x82\x009\0\xed\x01\x89\0\0\x021\0\0\x000\0\x8a\0j\0>\0\x0e\0n\0i\0\0\x001\0\x0f\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x1e\x000\0\b\0r\0\xd1\0\xec\0\0\x01\r\x01\x1d\0\x16\0\xff\xff0\x000\0\x11\0\x15\0\x19\0 \0!\0#\0\x17\0\x1b\0\x10\0\x1f\0\x1c\0\"\0\x13\0\x18\0\x12\0\x1a\0\x14\0$\0)\0%\x000\0\t\0*\0+\0,\0-\0.\0/\0=\0U\x000\0&\0'\0'\0'\0'\0'\0'\0'\0'\0'\x001\0C\0'\0'\0'\0'\0'\0'\0'\0'\0'\0'\0V\0\x8f\0\xff\xff(\0\x90\0\x91\0\x92\x007\0\x94\x007\0\x95\x000\x006\x006\x006\x006\x006\x006\x006\x006\x006\x006\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\0\xff\xff0\0\x96\0\x97\0\xa1\0B\0\x9e\x005\0\x9f\x005\0\xa0\x003\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\0\xa5\x003\x006\x006\x006\x006\x006\x006\x006\x006\x006\x006\0\xa2\0\xa3\0\xa6\0]\0\xff\xff\x02\x006\x006\x006\x006\x006\x006\x006\x006\x006\x006\0\xff\xffM\0g\0l\0t\0\x84\0\x86\0\x87\0\x80\0\x8b\0\x86\0\xa4\0]\0\xab\0M\0\xa7\0\xa8\0\xa9\0\xac\0p\0\xad\0\xae\0\xd2\0\xe2\0\xd0\0\xd3\0\xd4\0;\0S\0\x86\0\xd5\0\xd6\0\xd7\0\xd8\0\xda\0\x8d\0\xdb\0]\0\xdc\0\xdd\0{\0\xde\0\xdf\0\xe0\0\x88\0_\0\xe1\0#\x01A\x01\xea\0\x9b\0\x05\x01a\x01\xfa\0\xff\xff\xfe\x009\x01=\x01_\x01M\0,\x01\\\x01X\x01\t\x01\x1d\x01L\0|\0!\x01\x12\x01K\0b\0\x13\x01U\x01V\x01W\x01x\x01Y\x01J\0\xe1\x005\x01y\x01I\0Z\x01H\0G\0N\0N\0N\0N\0N\0N\0N\0N\0N\0N\0b\0q\x01z\0[\x01@\0\x04\x01]\x01N\0N\0N\0N\0N\0N\0O\0O\0O\0O\0O\0O\0O\0O\0O\0O\0\x9c\0p\x01^\x01`\x01b\x01c\x011\x01O\0O\0O\0O\0O\0O\0d\x01\x9d\0e\x01N\0N\0N\0N\0N\0N\0\xb7\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\x18\x01p\x01\xff\xff\x19\x01f\x01g\x01i\x01O\0O\0O\0O\0O\0O\0P\0P\0P\0P\0P\0P\0P\0P\0P\0P\0j\x01k\x010\x01(\x01l\x01m\x01n\x01P\0P\0P\0P\0P\0P\0Q\0Q\0Q\0Q\0Q\0Q\0Q\0Q\0Q\0Q\0o\x01\x1b\x01\xff\xff\xab\x01\x1f\x01\xaa\x01\x17\x01Q\0Q\0Q\0Q\0Q\0Q\0\\\0\xa8\x01?\x01P\0P\0P\0P\0P\0P\0\xf8\0\xa5\x01\xfc\0\xa2\x01;\x01E\0W\0W\0W\0W\0W\0W\0W\0W\0W\0W\0\xff\xffQ\0Q\0Q\0Q\0Q\0Q\0W\0W\0W\0W\0W\0W\0X\0X\0X\0X\0X\0X\0X\0X\0X\0X\0'\x01*\x01\xff\xff\xa3\x01\xa4\x01x\0\x02\x01X\0X\0X\0X\0X\0X\0\xa6\x017\x01\x99\0W\0W\0W\0W\0W\0W\0\x07\x01\xa7\x01\xa4\x01\xa9\x01\x10\x01\xa4\x01Y\0Y\0Y\0Y\0Y\0Y\0Y\0Y\0Y\0Y\x003\x01X\0X\0X\0X\0X\0X\0Y\0Y\0Y\0Y\0Y\0Y\0Z\0Z\0Z\0Z\0Z\0Z\0Z\0Z\0Z\0Z\0a\0\x89\x01\xa4\x01\xac\x01\xb9\x01\x88\x01\xad\x01Z\0Z\0Z\0Z\0Z\0Z\0a\0\xb3\0\xae\x01Y\0Y\0Y\0Y\0Y\0Y\0.\x01\xaf\x01\xb0\x01\xb4\0\xa4\x01\xb8\x01\xb5\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0|\x01Z\0Z\0Z\0Z\0Z\0Z\0\xc0\x01\xb2\x01\x15\x01\xb3\x01a\0\xc1\x01\xb4\x01\xb5\x01\xb6\x01\xb7\x01\xa4\x01\xd8\x01\xff\xffa\0\xb8\x01\xd8\x01\xd1\x01a\0\xdf\x01a\0\xd0\x01\xe6\x01\x03\x02a\0\xdb\x01%\x01\xd8\x01\xd9\x01\x03\x02\xdc\x01\xd8\x01a\0\x03\x02\x03\x02\xd8\x01a\0\x03\x02a\0`\0c\0c\0c\0c\0c\0c\0c\0c\0c\0c\0\xd8\x01\x03\x02~\x01\x03\x02\x03\x02\x03\x02\x03\x02c\0c\0c\0c\0c\0c\0a\0\x03\x02\xda\x01\xfa\x01\x03\x02\x03\x02a\0\x03\x02|\x01|\x01a\0\x03\x02\xdd\x01\x03\x02\xfd\x01\x03\x02\x03\x02\x03\x02a\0\xff\xff\x03\x02\xc4\x01a\0\x03\x02a\0`\0c\0c\0c\0c\0c\0c\0d\0d\0d\0d\0d\0d\0d\0d\0d\0d\0\xeb\x01\x03\x02\xf1\x01\x03\x02\xff\x01\xf2\x01\x03\x02d\0d\0d\0d\0d\0d\0e\0e\0e\0e\0e\0e\0e\0e\0e\0e\0\xf6\x01\x81\x01\x81\x01\xe4\x01\x03\x02\xc4\x01\x03\x02e\0e\0e\0e\0e\0e\0\x03\x02\xc6\x01\x03\x02d\0d\0d\0d\0d\0d\0\x03\x02\x03\x02\x03\x02\xc4\x01\xea\x01\x86\x01a\0a\0a\0a\0a\0a\0a\0a\0a\0a\0\0\0e\0e\0e\0e\0e\0e\0a\0a\0a\0a\0a\0a\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\0\0\0\0\xc9\x01\xb1\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xbc\0\0\0a\0a\0a\0a\0a\0a\0\xc9\x01\xe3\x01\0\0\xbf\0\xce\x01{\x01\xbd\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbd\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xc3\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc6\0\xff\xff\xf8\x01\xc4\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc4\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xca\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xcd\0\xff\xff\xff\xff\xcb\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xe2\0\xc3\x01\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xe8\x01\0\0\0\0\xce\0\xdd\x01\xef\x01\xfe\x01\0\0\xcf\0\xf4\x01\0\0\xe1\0\xcb\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xe8\0\0\0\xe8\0\0\0\xe1\x01\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xd9\0\xff\xff\0\0\0\0\0\0\0\0\xe1\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\0\0\0\0\0\0\0\0\xff\xff\0\0\0\0\xe6\0\0\0\xe6\0\0\0\xe4\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\0\0\xe4\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xba\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\0\0\0\0\0\0\0\0\0\0\xf1\0\0\0q\x01\0\0M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01\0\0p\x01\0\0\0\0\xc1\0\0\0\0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0p\x01\0\0\0\0\0\0\xf0\0\xc8\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\0\0\xf6\0\0\0\0\0\xf0\0\0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\0\0\0\0\0\0\0\0\xf5\0\0\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xee\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\0\0\0\0\0\0\0\0\xf5\0\0\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0E\x01F\x01\0\0\0\0E\x01L\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0E\x01\0\0N\x01\0\0\0\0\0\0\0\0h\x01I\x01\0\0\0\0\0\0\0\0O\x01\0\0G\x01L\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01\0\0\0\0H\x01\0\0\0\0\0\0\0\0\0\0\xf3\0\0\0\0\0\0\0\0\0\0\0\0\0P\x01w\x01\0\0w\x01\0\0Q\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01\0\0\0\0J\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01S\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0R\x01\0\0\0\0s\x01\0\0\0\0T\x01\0\0\0\0u\x01\0\0u\x01\0\0K\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01\0\0s\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01\0\0\x80\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\0\0\0\0\x80\x01\0\0\0\0\0\0\x80\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\0\0\0\0\0\0\0\0\0\0\0\0\x80\x01\0\0\0\0\xb9\x01\0\0\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\0\0\0\0\0\0\0\0\0\0\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\xb8\x01\0\0\x80\x01\0\0\0\0\0\0\0\0\0\0\x80\x01\0\0\0\0\0\0\x80\x01\0\0\0\0\0\0\0\0\0\0\0\0\x80\x01\x80\x01\0\0\0\0D\x01\x80\x01\x80\x01\x80\x01\x7f\x01\0\0\x80\x01\0\0\0\0\xb8\x01\0\0\0\0\0\0\0\0\x80\x01\0\0\0\0\0\0\x80\x01\0\0\x80\x01\x7f\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\0\0\0\0\0\0\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\0\0\0\0\0\0\0\0\0\0\0\0\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\0\0\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\xbf\x01\x8e\x01\xbf\x01\0\0\0\0\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\0\0\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\0\0\0\0\0\0\0\0\x8d\x01\0\0\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\0\0\0\0\0\0\0\0\x8d\x01\0\0\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x92\x01\x93\x01\0\0\0\0\x92\x01\x9a\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xc8\x01\x92\x01\0\0\x99\x01\0\0\0\0\0\0\0\0\xb1\x01\x96\x01\0\0\0\0\0\0\xc8\x01\x9c\x01\0\0\x94\x01\x9a\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\0\0\0\0\x95\x01\0\0\0\0\0\0\0\0\0\0\0\0\x8b\x01\0\0\0\0\0\0\0\0\0\0\x9d\x01\0\0\0\0\0\0\0\0\x9e\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xc8\x01\0\0\x97\x01\0\0\0\0\0\0\xc8\x01\0\0\0\0\0\0\xc8\x01\xbb\x01\0\0\xa0\x01\0\0\0\0\0\0\0\0\xc8\x01\0\0\0\0\x9f\x01\xc8\x01\0\0\xc8\x01\xc7\x01\0\0\xa1\x01\0\0\0\0\0\0\0\0\0\0\0\0\x98\x01\0\0\0\0\0\0\0\0\xbd\x01\0\0\xbd\x01\0\0\xbb\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xc8\x01\0\0\0\0\0\0\0\0\0\0\0\0\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xc8\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xc8\x01\0\0\0\0\0\0\0\0\x91\x01\xc8\x01\0\0\0\0\0\0\xc8\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xc8\x01\0\0\0\0\0\0\xc8\x01\0\0\xc8\x01\xc7\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\0\0\0\0\0\0\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\0\0\0\0\0\0\0\0\0\0\0\0\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\0\0\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\0\0\xd6\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\0\0\0\0\0\0\0\0\xd5\x01\0\0\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\0\0\0\0\0\0\0\0\xd5\x01\0\0\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xd3\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0",c1=1e7,nQ=451,e="Prologue",ei=254,mU=354,bc=100,lW="ECONNABORTED",lX="EFAULT",dy="Article 7",mT="ENODEV",lV=" : flags Open_text and Open_binary are not compatible",mS="%Li",lT="EIO",lU="EDEADLK",gb="3",T="Partie r\xc3\xa9glementaire - D\xc3\xa9crets simples",fw=105,kO="Invalid function call ([ ",nP="169.",kN="Instruction interminist\xc3\xa9rielle n\xc2\xb0 DSS/SD2B/2018/279 du 17 d\xc3\xa9cembre 2018 relative \xc3\xa0 la revalorisation au 1er janvier 2019 des plafonds de ressources d\xe2\x80\x99attribution de certaines prestations familiales servies en m\xc3\xa9tropole, en Guadeloupe, en Guyane, en Martinique, \xc3\xa0 la R\xc3\xa9union, \xc3\xa0 Saint-Barth\xc3\xa9lemy, \xc3\xa0 Saint-Martin et \xc3\xa0 Mayotte",kM="Article R512-2",cI=0.5,lS="\\\\",aW="Article D521-1",lR="Instruction interministerielle no DSS/SD2B/2019/261 du 18 d\xc3\xa9cembre 2019 relative \xc3\xa0 la revalorisation au 1er janvier 2020 des plafonds de ressources d\xe2\x80\x99attribution de certaines prestations familiales servies en m\xc3\xa9tropole, en Guadeloupe, en Guyane, en Martinique, \xc3\xa0 La R\xc3\xa9union, \xc3\xa0 Saint-Barth\xc3\xa9lemy, \xc3\xa0 Saint-Martin et \xc3\xa0 Mayotte",lQ=188,bV="Livre 7 : R\xc3\xa9gimes divers - Dispositions diverses",kK=158,aw="input",kL="str.ml",lP=160,eu=107,nO=345,nN="prestations_familiales",et="est_enfant_le_plus_\xc3\xa2g\xc3\xa9",lO="0.0463",kJ="D\xc3\xa9cret n\xc2\xb0 2018-1173 du 19 d\xc3\xa9cembre 2018 portant rel\xc3\xa8vement du salaire minimum de croissance",f1="_z",nM="computeAllocationsFamiliales",es="Unix.Unix_error",fv=283,lM="0.55",hO="\0\0\xec\xff\xed\xff\x03\0\xef\xff\x10\0\xf2\xff\xf3\xff\xf4\xff\xf5\xff\0\0\x1f\0\xf9\xffU\0\x01\0\0\0\0\0\x01\0\0\0\x01\0\x02\0\xff\xff\0\0\0\0\x03\0\xfe\xff\x01\0\x04\0\xfd\xff\x0b\0\xfc\xff\x03\0\x01\0\x03\0\x02\0\x03\0\0\0\xfb\xff\x15\0a\0\n\0\x16\0\x14\0\x10\0\x16\0\f\0\b\0\xfa\xffw\0\x81\0\x8b\0\xa1\0\xab\0\xb5\0\xc1\0\xd1\0\xf0\xff\x0b\0&\0\xfc\xffA\0\xfe\xff\xff\xffn\0\xfc\xff\xa3\0\xfe\xff\xff\xff\xea\0\xf7\xff\xf8\xff0\x01\xfa\xff\xfb\xff\xfc\xff\xfd\xff\xfe\xff\xff\xffG\x01~\x01\x95\x01\xf9\xff'\0\xfd\xff\xfe\xff&\0\xbb\x01\xd2\x01\xf8\x01\x0f\x02\xff\xff\xdc\0\xfd\xff\xff\xff\xf5\0'\x02m\x02\x0e\x01X\x02\xa4\x02\xbb\x02\xe1\x02\r\0\xfc\xff\xfd\xff\xfe\xff\xff\xff\x0e\0\xfd\xff\xfe\xff\xff\xff\x1e\0\xfd\xff\xfe\xff\xff\xff\x0f\0\xfd\xff\xfe\xff\xff\xff\x11\x01\xfb\xff\xfc\xff\xfd\xff\xfe\xff\xff\xff\x13\0\xfc\xff\xfd\xff\xfe\xff\x0f\0\xff\xff\x10\0\xff\xff\b\x01\x05\0\xfd\xff\x17\0\xfe\xff\x14\0\xff\xff.\0\xfd\xff\xfe\xff*\x004\x005\0\xff\xff5\x000\0[\0\\\0\xff\xff\x1b\x01\xfa\xff\xfb\xff\x89\0h\0Y\0X\0j\0\xff\xff\x8f\0\x89\0\xb1\0\xfe\xff\xb7\0\xa8\0\xa6\0\xb7\0\x02\0\xfd\xff\xb1\0\xac\0\xbb\0\x04\0\xfc\xff5\x02\xfb\xff\xfc\xff\xfd\xffg\x01\xff\xff\xf8\x02\xfe\xff\x06\x03\x1e\x03\xfc\xff\xfd\xff\xfe\xff\xff\xff(\x032\x03J\x03\xfc\xff\xfd\xff\xfe\xff\xff\xff=\x03T\x03l\x03\xf9\xff\xfa\xff\xfb\xff\xf4\0x\x03\x8e\x03\xb3\0\xc2\0\x0f\0\xff\xff\xbe\0\xbc\0\xbb\0\xc1\0\xb7\0\xb3\0\xfe\xff\xbf\0\xc9\0\xc8\0\xc4\0\xcb\0\xc1\0\xbd\0\xfd\xff\x9d\x03_\x03\xae\x03\xc4\x03\xce\x03\xd8\x03\xe4\x03\xef\x03<\0\xfd\xff\xfe\xff\xff\xff\f\x04\xfc\xff\xfd\xffW\x04\xff\xff\x91\x04\xfc\xff\xfd\xff\xdd\x04\xff\xff\xe5\0\xfd\xff\xfe\xff\xff\xff\xe7\0\xfd\xff\xfe\xff\xff\xff\x02\0\xff\xff\x12\x01\xfc\xff\xfd\xff\xfe\xff\xff\xff\"\x01\xfd\xff\xfe\xff\xff\xff\0\0\xff\xff\x03\0\xfe\xff\xff\xff&\x01\xfc\xff\xfd\xff\xfe\xff\xff\xffx\x01\xfb\xff\xfc\xff\xfd\xff\xfe\xff\xff\xff\xd0\0\xfd\xff\xfe\xff\xff\xff\xd3\0\xfd\xff\xfe\xff\xff\xff\xbd\0\xff\xff\x8f\x01\xfc\xff\xfd\xff\xfe\xff\xff\xff\r\x01\xfd\xff\xfe\xff\xff\xff_\x01\xfc\xff\xfd\xff\xfe\xff\xff\xff2\x01\xfd\xff\xfe\xff\xff\xff\x1a\x01\xfd\xff\xfe\xff\xff\xff\xe9\0\xfd\xff\xfe\xff\xff\xff\xde\0\xfd\xff\xfe\xff\xff\xffO\x05\xed\xff\xee\xff\n\0\xf0\xff,\x01\xf3\xff\xf4\xff\xf5\xff\xf6\xff=\x01\x02\x04\xf9\xff-\x05\xd1\0\xe4\0\xd3\0\xe8\0\xe1\0\xdf\0\xf0\0\xff\xff\xeb\0\xea\0\b\x01\xfe\xff\x04\x01\x17\x01\xfd\xff6\x01\xfc\xff\x1f\x01\x1d\x01 \x01'\x011\x01-\x01\xfb\xff9\x01R\x01P\x01N\x01T\x01J\x01V\x01\xfa\xffn\x05\f\x04{\x05\x9b\x05\xa5\x05\xb1\x05\xbb\x05\xc5\x05\xf1\xff\xc7\x01M\x02\xfd\xff\xff\xff\x9a\x02\xde\x05\xd1\x05\x9b\x02\xef\x055\x06L\x06r\x06\x10\x02\xfc\xff\xfd\xff\xfe\xff\xff\xff\x98\x06\xfc\xff\xfd\xff\xe3\x06\xff\xffU\x07\xf4\xff\xf5\xff\x0b\0\xf7\xffL\x02\xfa\xff\xfb\xff\xfc\xff\xfd\xff\xfe\xff\x1f\x02\xf3\x053\x07d\x01s\x01h\x01\x85\x01v\x01\x9a\x01\xab\x01\xff\xff\xad\x01\xb0\x01\xbf\x01\xb9\x01\xbb\x01\xfd\x01\xe6\x01\xe6\x01\xea\x01\xf7\x01\xed\x01\xea\x01\t\x02\x13\x02\x13\x02\x0f\x02\x15\x02\x0b\x02\x07\x02\x8e\x06\x98\x06t\x07\xaa\x07\xb4\x07\xbe\x07\xc8\x07\xd2\x07\xf8\xffx\x02\xa7\x02\xfd\xff\xff\xff\xd8\x02R\x07\xdc\x07\xec\x02\xf4\x07:\bQ\bw\bL\x02\xfc\xff\xfd\xff\xfe\xff\xff\xff\x9d\b\xfc\xff\xfd\xff\xe8\b\xff\xff\x87\x02x\x02\xfd\xffd\x02\xfe\xff\xb6\x02\xff\xff\x0b\x02\xff\xff\xcc\x02\xfc\xff\xfd\xff\xfe\xff\xff\xff.\x02\xff\xff\xb2\x02\xfc\xff\xfd\xff\xfe\xff\xff\xff\x17\0\xff\xff\xb7\x02\xfc\xff\xfd\xff\xfe\xff\xff\xff\xbb\x02\xfd\xff\xfe\xff\xff\xffy\x02\xfd\xff\xfe\xff\xff\xff\xb8\x02\xfc\xff\xfd\xff\xfe\xff\x13\0\xff\xff\x8c\x01\x92\x01\xff\xff\x96\x01\x97\x01\x9a\x01\xa8\x01\xaa\x01\xab\x01\xac\x01\xad\x01\xb5\x01\xb8\x01\xb9\x01\xbb\x01\xbf\x01\xc1\x01\xc3\x01\xc4\x01\xc5\x01\xc8\x01\xcb\x01\xdf\x01\xe1\x01\xe4\x01\xf9\x01\xfb\x01\x02\x02\x04\x02\x0b\x02\f\x02\r\x02\0\0",lN="EHOSTDOWN",eh="droit_ouvert",fJ=109,h="Champs d'applications",hD="mkdir",lL="ENOTSOCK",f0=136,nL="Stack_overflow",fu=": No such file or directory",bh="Interface du programme",nK="/static/",dl="Titre 5 : D\xc3\xa9partements d'outre-mer",hN=-97,nJ=253,cy="src/printer.ml",fZ=137,nI="Not_found",cx="./../base_mensuelle_allocations_familiales/bmaf.catala_fr",eg=1461,bA="InterfaceAllocationsFamiliales",mR="retrieveRawEvents",ie="\x01\0\0\0\0\0\xff\xff\0\0\xff\xff\0\0\0\0\0\0\0\0\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\0\0\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\x009\0<\0\0\0<\0\0\0\0\0A\0\0\0A\0\0\0\0\0F\0\0\0\0\0\xff\xff\0\0\0\0\0\0\0\0\0\0\0\0\xff\xff\xff\xff\xff\xff\0\0T\0\0\0\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0^\0\0\0\0\0a\0\xff\xff\xff\xffa\0\xff\xff\xff\xff\xff\xff\xff\xffh\0\0\0\0\0\0\0\0\0m\0\0\0\0\0\0\0q\0\0\0\0\0\0\0u\0\0\0\0\0\0\0y\0\0\0\0\0\0\0\0\0\0\0~\0\0\0\0\0\0\0\xff\xff\0\0\xff\xff\0\0\xff\xff\xff\xff\0\0\xff\xff\0\0\x8a\0\0\0\x8e\0\0\0\0\0\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\0\0\x9a\0\0\0\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xb2\0\0\0\0\0\0\0\xff\xff\0\0\xff\xff\0\0\xff\xff\xbb\0\0\0\0\0\0\0\0\0\xff\xff\xff\xff\xc2\0\0\0\0\0\0\0\0\0\xff\xff\xff\xff\xc9\0\0\0\0\0\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xeb\0\0\0\0\0\0\0\xef\0\0\0\0\0\xff\xff\0\0\xf4\0\0\0\0\0\xff\xff\0\0\xf9\0\0\0\0\0\0\0\xfd\0\0\0\0\0\0\0\xff\xff\0\0\x03\x01\0\0\0\0\0\0\0\0\b\x01\0\0\0\0\0\0\xff\xff\0\0\xff\xff\0\0\0\0\x11\x01\0\0\0\0\0\0\0\0\x16\x01\0\0\0\0\0\0\0\0\0\0\x1c\x01\0\0\0\0\0\0 \x01\0\0\0\0\0\0\xff\xff\0\0&\x01\0\0\0\0\0\0\0\0+\x01\0\0\0\0\0\0/\x01\0\0\0\0\0\0\0\x004\x01\0\0\0\0\0\x008\x01\0\0\0\0\0\0<\x01\0\0\0\0\0\0@\x01\0\0\0\0\0\0C\x01\0\0\0\0\xff\xff\0\0\xff\xff\0\0\0\0\0\0\0\0\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\0\0\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0y\x01}\x01\0\0\0\0\x80\x01\xff\xff\xff\xff\x80\x01\xff\xff\xff\xff\xff\xff\xff\xff\x87\x01\0\0\0\0\0\0\0\0\x8c\x01\0\0\0\0\xff\xff\0\0\x90\x01\0\0\0\0\xff\xff\0\0\xff\xff\0\0\0\0\0\0\0\0\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xc1\x01\xc5\x01\0\0\0\0\xc8\x01\xff\xff\xff\xff\xc8\x01\xff\xff\xff\xff\xff\xff\xff\xff\xcf\x01\0\0\0\0\0\0\0\0\xd4\x01\0\0\0\0\xff\xff\0\0\xff\xff\xff\xff\0\0\xff\xff\0\0\xdc\x01\0\0\xff\xff\0\0\xe2\x01\0\0\0\0\0\0\0\0\xff\xff\0\0\xe9\x01\0\0\0\0\0\0\0\0\xff\xff\0\0\xf0\x01\0\0\0\0\0\0\0\0\xf5\x01\0\0\0\0\0\0\xf9\x01\0\0\0\0\0\0\xfc\x01\0\0\0\0\0\0\xff\xff\0\0\x02\x02\x04\x02\0\0\x05\x02\x06\x02\x07\x02\b\x02\t\x02\n\x02\x0b\x02\f\x02\r\x02\x0e\x02\x0f\x02\x10\x02\x11\x02\x12\x02\x13\x02\x14\x02\x15\x02\x16\x02\x17\x02\x18\x02\x19\x02\x1a\x02\x1b\x02\x1c\x02\x1d\x02\x1e\x02\x1f\x02 \x02!\x02\x03\x02",c0=151,N="D\xc3\xa9cret n\xc2\xb02002-423 du 29 mars 2002 relatif aux prestations familiales \xc3\xa0 Mayotte",hM=195,dr="1.",mP=32044,mQ="%a",cd=", ",bS=2018,nH="Mayotte",az=848054398,lJ="DecisionTaken(_)",lK="EOPNOTSUPP",kI="BeginCall([ ",kG=0xFE,kH="ENOPROTOOPT",lI=2440588,aN="Prestations familiales",id="rmdir",mO="src/date.ml",nG=32752,lH="ECONNRESET",nF="ELOOP",lG="ESPIPE",as="\xc3\x89pilogue",mN="EADDRINUSE",ga=149,nE=1026,bU="Article L521-2",mM="ENOSYS",kF="bmaf",nD="false",f$="Invalid integer: ",kE=472,fI=2440587.5,lF="E2BIG",ep=359,kC="Pervasives.do_at_exit",kD="utf8",f_=106,mL=258,cc=" ",ib=186,ic="Fatal error: exception ",bu=0x80,mK="Undefined_recursive_module",ay="output",f9="src/calendar_builder.ml",kB="EISDIR",aP=-976970511,ia="_",aT="Montant du salaire minimum de croissance",mJ="%.16g",h$="compare: functional value",hC="0.16",eo="droit_ouvert_forfaitaire",nC=444,er="0.",ft=134,h1="%i",kA=387,lE="true",dB=529348384;function -NR(d,b,e,c,f){if(c<=b)for(var +a.prototype._T_}}(Object));(function(aO){"use strict";var +bOF=aO,bOI=typeof +module==="object"&&module.exports||aO,io=1066,IJ="38527",II=424,s8=1650,i6=857,cG="\xc3\x89ligibilit\xc3\xa9PrestationsFamiliales",nL="logement_foyer",ek=319,tE=1110,EO="Article L521-1",AV=794,kt="Paragraphe 2 : Ouverture du droit et liquidation.",AU=43200.,ox=365180284,AT="Changement",Mw="26714",i5=635,AS="EMFILE",IH="locatif.date_courante",pN=163,pM="SaintMartin",IG="1015",pL=891,ey="Section 1 : Seuils de constitution d'un impay\xc3\xa9",AQ=4865,AR=4458,cQ="Article 1",IF="559500",fS="aide_finale_formule",dl=122,IE="35630",EN=992015837,ss="Article 31",e1="50",ID=2915,be="Unexpected '",IC=299,hn=181,IB="EACCES",AP=3862,EL=305,EM=862,s7="Article 19",cH=128,j1="Avant",EK="43000",s6="identifiant",pK="Oui",AN=2387,AO=459,s5="Article D832-26",mL=573,gU=146,mK=">",gA=575,EJ=941,i3=153,i4=731,Mv=1027,IA="EINPROGRESS",gT=1053,pJ="Article 17",aJ="Section 2 : Accession \xc3\xa0 la propri\xc3\xa9t\xc3\xa9",ff="Chapitre 5 : Prestations familiales et prestations assimil\xc3\xa9es",nK="baseMensuelleAllocationsFamiliales",Iz=933,Mu="logement_foyer.mode_occupation",AM="35762",pI=739,t="Calcul du montant de l'allocation logement",EI=358,ec=2011,r5=2023,EH=3331,Mt=462,h8="Article L841-1",EG=1183,ow=583,s4="ServicesSociauxAllocationVerseeALaFamille",AJ="186000",AK=796,AL="Instruction interminist\xc3\xa9rielle no DSS/SD2B/2020/33 du 18 f\xc3\xa9vrier 2020 relative \xc3\xa0 la revalorisation au 1er avril 2020 des prestations familiales servies en m\xc3\xa9tropole, en Guadeloupe, en Guyane, en Martinique, \xc3\xa0 La R\xc3\xa9union, \xc3\xa0 Saint-Barth\xc3\xa9lemy, \xc3\xa0 Saint-Martin et dans le d\xc3\xa9partement de Mayotte",AH=999,AI="16.25",AF="0.0315",AG=4379,fK="traitement_aide_finale_diminu\xc3\xa9",Ms=989,Iy=1118,Mr="\xc3\xa9ligibilit\xc3\xa9_commune.date_courante",mJ=720,Ix="40758",EF=5025,pH="e",hm=313,iJ=896,Mq=692,h7="Autre",AE="locatif.b\xc3\xa9n\xc3\xa9ficiaire_aide_adulte_ou_enfant_handicap\xc3\xa9s",im=395,Iw=798,AD=1150,EE="Article L822-2",eb=392,ED=4178,gz="smic",ov=980,AC="39445",Iv=1071,dn="Article D842-6",Iu=1628,AB=-43,It="Neuf",Mp="EROFS",gp=485,Mn="Article 27",Mo="inf",EC="calculetteAidesAuLogementGardeAlternee",Is="EPIPE",mI=394,EB="Circulaire interminist\xc3\xa9rielle N\xc2\xb0 DSS/SD2B/2017/352 du 22 d\xc3\xa9cembre 2017 relative \xc3\xa0 la revalorisation au 1er janvier 2018 des plafonds de ressources d\xe2\x80\x99attribution de certaines prestations familiales servies en m\xc3\xa9tropole, en Guadeloupe, en Guyane, en Martinique, \xc3\xa0 la R\xc3\xa9union, \xc3\xa0 Saint-Barth\xc3\xa9lemy, \xc3\xa0 Saint-Martin et \xc3\xa0 Mayotte",Mm="41392",kb=111,AA=929,EA="Location",ah=709,Iq=4862,Ir="240400",Az="ENOLCK",tD="Ordonnance n\xc2\xb0 96-50 du 24 janvier 1996 relative au remboursement de la dette sociale",Ez="33500",ks="CalculNombrePartsAccessionPropri\xc3\xa9t\xc3\xa9",ao="Article D823-9",i2=393,ag="traitement_aide_finale_minoration_forfaitaire",Ay="ERANGE",Ip="AM",r4="\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\0\0\xff\xff\x03\0\0\0\x86\0\xff\xff\x03\0\xff\xff\x86\0E\x01\x92\x019\0\xff\xffE\x01\x92\x01\xff\xff\xff\xff\xff\xff\xff\xff}\0\x8a\0\xff\xff\0\0\xff\xff\0\0\x03\0\xa9\0\x86\0\xae\0\xff\xff\0\0\n\x01E\x01\x92\x01\f\x01\0\0\n\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x05\0s\0\0\0}\0\x81\0\x05\0\xec\x01\x88\0\xff\x01&\0\xff\xff\n\0\x88\0f\0:\0\0\0k\0f\0\xff\xff\x0b\0\0\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x1d\0&\0\0\0o\0\xd0\0\xe9\0\xff\0\f\x01\x0f\0\x11\0<\0\x0b\0\n\0\0\0\x14\0\x18\0\x1f\0 \0\"\0\x16\0\x1a\0\0\0\x0e\0\x1b\0!\0\x12\0\x17\0\0\0\x10\0\x13\0#\0(\0$\0&\0\0\0)\0*\0+\0,\0-\0.\0:\0R\0\x0b\0\r\0\r\0\r\0\r\0\r\0\r\0\r\0\r\0\r\0\r\0'\0?\0'\0'\0'\0'\0'\0'\0'\0'\0'\0'\0U\0\x8c\0<\0\r\0\x8f\0\x90\0\x91\x000\0\x93\x000\0\x94\0'\x000\x000\x000\x000\x000\x000\x000\x000\x000\x000\x001\x001\x001\x001\x001\x001\x001\x001\x001\x001\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\0A\0'\0\x95\0\x96\0\x9c\0?\0\x9d\x003\0\x9e\x003\0\x9f\x002\x003\x003\x003\x003\x003\x003\x003\x003\x003\x003\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x005\x005\x005\x005\x005\x005\x005\x005\x005\x005\0\x9b\x002\x006\x006\x006\x006\x006\x006\x006\x006\x006\x006\0\xa1\0\xa2\0\x9b\0[\0A\0\0\x007\x007\x007\x007\x007\x007\x007\x007\x007\x007\x009\0D\0f\0k\0s\0\x83\0\x85\0\x85\0}\0\x8a\0\x85\0\xa3\0^\0\xa5\0D\0\xa6\0\xa7\0\xa8\0\xab\0o\0\xac\0\xad\0\xce\0\xcb\0\xcf\0\xd2\0\xd3\0:\0R\0\x85\0\xd4\0\xd5\0\xd6\0\xd7\0\xd9\0\x8c\0\xda\0a\0\xdb\0\xdc\0w\0\xdd\0\xde\0\xdf\0\x85\0[\0\xcb\0\"\x01>\x01\xe9\0\x98\0\x01\x01P\x01\xf7\0<\0\xfb\x006\x01:\x01Q\x01D\0)\x01R\x01S\x01\x06\x01\x1a\x01D\0w\0\x1e\x01\x0f\x01D\0^\0\x0f\x01T\x01U\x01V\x01G\x01X\x01D\0\xcb\x002\x01G\x01D\0Y\x01D\0D\0G\0G\0G\0G\0G\0G\0G\0G\0G\0G\0a\0L\x01w\0Z\x01?\0\x01\x01\\\x01G\0G\0G\0G\0G\0G\0N\0N\0N\0N\0N\0N\0N\0N\0N\0N\0\x98\0L\x01]\x01_\x01a\x01b\x01-\x01N\0N\0N\0N\0N\0N\0c\x01\x98\0d\x01G\0G\0G\0G\0G\0G\0\xb4\0\xb4\0\xb4\0\xb4\0\xb4\0\xb4\0\xb4\0\xb4\0\xb4\0\xb4\0\x14\x01L\x01A\0\x14\x01e\x01f\x01h\x01N\0N\0N\0N\0N\0N\0O\0O\0O\0O\0O\0O\0O\0O\0O\0O\0i\x01j\x01-\x01$\x01k\x01l\x01m\x01O\0O\0O\0O\0O\0O\0P\0P\0P\0P\0P\0P\0P\0P\0P\0P\0n\x01\x1a\x01y\x01\x9d\x01\x1e\x01\x9e\x01\x14\x01P\0P\0P\0P\0P\0P\0[\0\x9f\x01>\x01O\0O\0O\0O\0O\0O\0\xf7\0\xa0\x01\xfb\0\xa1\x01:\x01D\0V\0V\0V\0V\0V\0V\0V\0V\0V\0V\0^\0P\0P\0P\0P\0P\0P\0V\0V\0V\0V\0V\0V\0W\0W\0W\0W\0W\0W\0W\0W\0W\0W\0$\x01)\x01a\0\xa2\x01\xa3\x01w\0\x01\x01W\0W\0W\0W\0W\0W\0\xa5\x016\x01\x98\0V\0V\0V\0V\0V\0V\0\x06\x01\xa6\x01\xa7\x01\xa8\x01\x0f\x01\xa9\x01X\0X\0X\0X\0X\0X\0X\0X\0X\0X\x002\x01W\0W\0W\0W\0W\0W\0X\0X\0X\0X\0X\0X\0Y\0Y\0Y\0Y\0Y\0Y\0Y\0Y\0Y\0Y\0_\0\x85\x01\xaa\x01\xab\x01\x9a\x01\x85\x01\xac\x01Y\0Y\0Y\0Y\0Y\0Y\0_\0\xb0\0\xad\x01X\0X\0X\0X\0X\0X\0-\x01\xae\x01\xaf\x01\xb0\0\xb0\x01\x9a\x01\xb0\0\xb0\0\xb0\0\xb0\0\xb0\0\xb0\0\xb0\0\xb0\0\xb0\0\xb0\0z\x01Y\0Y\0Y\0Y\0Y\0Y\0\x94\x01\xb1\x01\x14\x01\xb2\x01b\0\x94\x01\xb3\x01\xb4\x01\xb5\x01\xb6\x01\xb7\x01\xd8\x01\xc1\x01_\0\x9a\x01\xd8\x01\xcd\x01b\0\xde\x01_\0\xcd\x01\xe5\x01\x01\x02_\0\xda\x01$\x01\xd7\x01\xd7\x01\x02\x02\xda\x01\xd7\x01_\0\x04\x02\x05\x02\xd8\x01_\0\x06\x02_\0_\0`\0`\0`\0`\0`\0`\0`\0`\0`\0`\0\xd7\x01\x07\x02z\x01\b\x02\t\x02\n\x02\x0b\x02`\0`\0`\0`\0`\0`\0b\0\f\x02\xd7\x01\xf7\x01\r\x02\x0e\x02b\0\x0f\x02}\x01\x80\x01b\0\x10\x02\xdc\x01\x11\x02\xfb\x01\x12\x02\x13\x02\x14\x02b\0y\x01\x15\x02\xc2\x01b\0\x16\x02b\0b\0`\0`\0`\0`\0`\0`\0c\0c\0c\0c\0c\0c\0c\0c\0c\0c\0\xe7\x01\x17\x02\xee\x01\x18\x02\xfb\x01\xee\x01\x19\x02c\0c\0c\0c\0c\0c\0d\0d\0d\0d\0d\0d\0d\0d\0d\0d\0\xf3\x01}\x01\x80\x01\xe0\x01\x1a\x02\xc5\x01\x1b\x02d\0d\0d\0d\0d\0d\0\x1c\x02\xc2\x01\x1d\x02c\0c\0c\0c\0c\0c\0\x1e\x02\x1f\x02 \x02\xc8\x01\xe7\x01\x85\x01e\0e\0e\0e\0e\0e\0e\0e\0e\0e\0\xff\xffd\0d\0d\0d\0d\0d\0e\0e\0e\0e\0e\0e\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xff\xff\xff\xff\xc5\x01\xb0\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb9\0\xff\xffe\0e\0e\0e\0e\0e\0\xc8\x01\xe0\x01\xff\xff\xb9\0\xcd\x01z\x01\xb9\0\xb9\0\xb9\0\xb9\0\xb9\0\xb9\0\xb9\0\xb9\0\xb9\0\xb9\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbf\0\xbf\0\xbf\0\xbf\0\xbf\0\xbf\0\xbf\0\xbf\0\xbf\0\xbf\0\xc0\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc0\0\xc1\x01\xf7\x01\xc0\0\xc0\0\xc0\0\xc0\0\xc0\0\xc0\0\xc0\0\xc0\0\xc0\0\xc0\0\xc6\0\xc6\0\xc6\0\xc6\0\xc6\0\xc6\0\xc6\0\xc6\0\xc6\0\xc6\0\xc7\0\xe2\0\xe2\0\xe2\0\xe2\0\xe2\0\xe2\0\xe2\0\xe2\0\xe2\0\xe2\0\xc7\0}\x01\x80\x01\xc7\0\xc7\0\xc7\0\xc7\0\xc7\0\xc7\0\xc7\0\xc7\0\xc7\0\xc7\0\xcc\0\xc2\x01\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xe7\x01\xff\xff\xff\xff\xc7\0\xdc\x01\xee\x01\xfb\x01\xff\xff\xc7\0\xf3\x01\xff\xff\xcc\0\xcd\0\xcd\0\xcd\0\xcd\0\xcd\0\xcd\0\xcd\0\xcd\0\xcd\0\xcd\0\xe1\0\xff\xff\xe1\0\xff\xff\xe0\x01\xe1\0\xe1\0\xe1\0\xe1\0\xe1\0\xe1\0\xe1\0\xe1\0\xe1\0\xe1\0\xcd\0\xc5\x01\xff\xff\xff\xff\xff\xff\xff\xff\xcc\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xff\xff\xff\xff\xff\xff\xff\xff\xc8\x01\xff\xff\xff\xff\xe4\0\xff\xff\xe4\0\xff\xff\xe3\0\xe4\0\xe4\0\xe4\0\xe4\0\xe4\0\xe4\0\xe4\0\xe4\0\xe4\0\xe4\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe6\0\xe6\0\xe6\0\xe6\0\xe6\0\xe6\0\xe6\0\xe6\0\xe6\0\xe6\0\xff\xff\xe3\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xb9\0\xe8\0\xe8\0\xe8\0\xe8\0\xe8\0\xe8\0\xe8\0\xe8\0\xe8\0\xe8\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xed\0\xff\xffM\x01\xff\xffM\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01q\x01q\x01q\x01q\x01q\x01q\x01q\x01q\x01q\x01q\x01\xff\xffM\x01\xff\xff\xff\xff\xc0\0\xff\xff\xff\xff\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0M\x01\xff\xff\xff\xff\xff\xff\xed\0\xc7\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xff\xff\xf2\0\xff\xff\xff\xff\xf0\0\xff\xff\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xff\xff\xff\xff\xff\xff\xff\xff\xf2\0\xff\xff\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xed\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xff\xff\xff\xff\xff\xff\xff\xff\xf5\0\xff\xff\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0B\x01B\x01\xff\xff\xff\xffB\x01O\x01O\x01O\x01O\x01O\x01O\x01O\x01O\x01O\x01O\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xffB\x01\xff\xffB\x01\xff\xff\xff\xff\xff\xff\xff\xffO\x01B\x01\xff\xff\xff\xff\xff\xff\xff\xffB\x01\xff\xffB\x01B\x01B\x01B\x01B\x01B\x01B\x01B\x01B\x01B\x01B\x01\xff\xff\xff\xffB\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf2\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xffB\x01p\x01\xff\xffp\x01\xff\xffB\x01p\x01p\x01p\x01p\x01p\x01p\x01p\x01p\x01p\x01p\x01\xff\xff\xff\xffB\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01B\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xffB\x01\xff\xff\xff\xffr\x01\xff\xff\xff\xffB\x01\xff\xff\xff\xffs\x01\xff\xffs\x01\xff\xffB\x01s\x01s\x01s\x01s\x01s\x01s\x01s\x01s\x01s\x01s\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01\xff\xffr\x01u\x01u\x01u\x01u\x01u\x01u\x01u\x01u\x01u\x01u\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01w\x01w\x01w\x01w\x01w\x01w\x01w\x01w\x01w\x01w\x01\xff\xff~\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\xff\xff\xff\xff~\x01\xff\xff\xff\xff\xff\xff\x81\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x81\x01\xff\xff\xff\xff\x9b\x01\xff\xff\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x9b\x01\xff\xff~\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff~\x01\xff\xff\xff\xff\xff\xff~\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x81\x01~\x01\xff\xff\xff\xffB\x01~\x01\x81\x01~\x01~\x01\xff\xff\x81\x01\xff\xff\xff\xff\x9b\x01\xff\xff\xff\xff\xff\xff\xff\xff\x81\x01\xff\xff\xff\xff\xff\xff\x81\x01\xff\xff\x81\x01\x81\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\xff\xff\xff\xff\xff\xff\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\xff\xff\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\xb8\x01\x8a\x01\xb8\x01\xff\xff\xff\xff\xb8\x01\xb8\x01\xb8\x01\xb8\x01\xb8\x01\xb8\x01\xb8\x01\xb8\x01\xb8\x01\xb8\x01\xb9\x01\xb9\x01\xb9\x01\xb9\x01\xb9\x01\xb9\x01\xb9\x01\xb9\x01\xb9\x01\xb9\x01\xff\xff\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\xff\xff\xff\xff\xff\xff\xff\xff\x8a\x01\xff\xff\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\xff\xff\xff\xff\xff\xff\xff\xff\x8d\x01\xff\xff\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8f\x01\x8f\x01\xff\xff\xff\xff\x8f\x01\x9c\x01\x9c\x01\x9c\x01\x9c\x01\x9c\x01\x9c\x01\x9c\x01\x9c\x01\x9c\x01\x9c\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc6\x01\x8f\x01\xff\xff\x8f\x01\xff\xff\xff\xff\xff\xff\xff\xff\x9c\x01\x8f\x01\xff\xff\xff\xff\xff\xff\xc6\x01\x8f\x01\xff\xff\x8f\x01\x8f\x01\x8f\x01\x8f\x01\x8f\x01\x8f\x01\x8f\x01\x8f\x01\x8f\x01\x8f\x01\x8f\x01\xff\xff\xff\xff\x8f\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x8a\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x8f\x01\xff\xff\xff\xff\xff\xff\xff\xff\x8f\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xc6\x01\xff\xff\x8f\x01\xff\xff\xff\xff\xff\xff\xc6\x01\xff\xff\xff\xff\xff\xff\xc6\x01\xba\x01\xff\xff\x8f\x01\xff\xff\xff\xff\xff\xff\xff\xff\xc6\x01\xff\xff\xff\xff\x8f\x01\xc6\x01\xff\xff\xc6\x01\xc6\x01\xff\xff\x8f\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x8f\x01\xff\xff\xff\xff\xff\xff\xff\xff\xbb\x01\xff\xff\xbb\x01\xff\xff\xba\x01\xbb\x01\xbb\x01\xbb\x01\xbb\x01\xbb\x01\xbb\x01\xbb\x01\xbb\x01\xbb\x01\xbb\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbd\x01\xbd\x01\xbd\x01\xbd\x01\xbd\x01\xbd\x01\xbd\x01\xbd\x01\xbd\x01\xbd\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbf\x01\xbf\x01\xbf\x01\xbf\x01\xbf\x01\xbf\x01\xbf\x01\xbf\x01\xbf\x01\xbf\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc9\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc9\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc9\x01\xff\xff\xff\xff\xff\xff\xff\xff\x8f\x01\xc9\x01\xff\xff\xff\xff\xff\xff\xc9\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc9\x01\xff\xff\xff\xff\xff\xff\xc9\x01\xff\xff\xc9\x01\xc9\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xff\xff\xff\xff\xff\xff\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xff\xff\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xff\xff\xd2\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xff\xff\xff\xff\xff\xff\xff\xff\xd2\x01\xff\xff\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xff\xff\xff\xff\xff\xff\xff\xff\xd5\x01\xff\xff\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xd2\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff",Ml="infinity",Mk=4072,h6="2.5",Aw="locatif.loyer_principal",Ax=1114,eB="Chapitre IV : Impay\xc3\xa9s de d\xc3\xa9penses de logement",s3=278,Au=3194,Av="90100",Ey=2598,fb=318,ex="examples/allocations_familiales/../base_mensuelle_allocations_familiales/bmaf.catala_fr",Ex=2615,At="\\t",Mj=4008,Ew=955,Mi=1011,aT="examples/aides_logement/code_construction_legislatif.catala_fr",ej=391,s2=330,Ev=1542,aS="Titre 2 : Prestations g\xc3\xa9n\xc3\xa9rales d'entretien",Mh=1537,kK=112,s1=831,iI="1000",Io=1131,mH=563,Et=2252,Eu=701,dX="examples/aides_logement/code_s\xc3\xa9curit\xc3\xa9_sociale.catala_fr",Es="Unexpected '%s' kind for the enumeration 'ElementPrestationsFamiliales.t'",i1=599,As=1146,In=1638,Mg=3621,Ar="Couple",mG="SaintPierreEtMiquelon",Mf="ESOCKTNOSUPPORT",cF="PrestationsFamiliales",Er="\xc3\x89l\xc3\xa9mentPrestationsFamiliales",iH=110,Me=464,Im=1103,Md="214700",Aq=352,go=615,ei="Calcul\xc3\x89quivalenceLoyerMinimale",Ap=1488,Mc="42926",Mb="Autres",r3=-32,mF=889,Il="39016",iG=632,s0=847,pG="AllocationLogementFamiliale",Ma=3718,ew=1023,L$="interfaceAllocationsFamiliales",Ao=1616,il=1076,mE="AllocationLogementSociale",ev=323,r2=1862,An=1487,Am="plafond_l512_3_2",bt=117,sZ="Chapitre II : Des contributions pour le remboursement de la dette sociale.",a5="examples/allocations_familiales/decrets_divers.catala_fr",ka="compl\xc3\xa9ment_d\xc3\xa9gressif",ou=348,r1="Livre VIII : Allocations aux personnes \xc3\xa2g\xc3\xa9es - Allocation aux adultes handicap\xc3\xa9s - Aides \xc3\xa0 l'emploi pour la garde des jeunes enfants - Protection compl\xc3\xa9mentaire en mati\xc3\xa8re de sant\xc3\xa9",Eq="accession_propri\xc3\xa9t\xc3\xa9.copropri\xc3\xa9t\xc3\xa9",L9="240200",L_="Assert_failure",tC="Section 1 : Secteur locatif ordinaire",L8="568400",Al=3955,L7=496,tB="0.32",Ik="40961",kJ="Non",Ak="ENOTCONN",Ij=1664,kI="Article R824-2",Ii=1128,L6=1e14,Aj="D331_76_1",nJ="Article R521-3",Ai=3400,Ep=935,bS=2022,Eo="Fatal error: exception %s\n",L5="34865",Em=865,En=1623,sY="261800",El=1429,os=740,ot=349,or=725,mD="Article 2",kH=146097,dC=256,mC=558,Ah="Article L521-3",Ek="Article R822-1",mB=874,Ag="45064",Ei=4983,gy=614,Ej="taux_francs_vers_euros",cp="Archives l\xc3\xa9gislatives et r\xc3\xa9glementaires",Af="ENOSPC",fR="abattement_d\xc3\xa9pense_nette_minimale_d832_10",Eh=699,L4="mensualit\xc3\xa9_\xc3\xa9ligible",oq="D\xc3\xa9cret n\xc2\xb0 2021-1741 du 22 d\xc3\xa9cembre 2021 portant rel\xc3\xa8vement du salaire minimum de croissance",i0=440,pF="ENOENT",L3=1395,Eg=3265,Ad="0.0006",Ae=315,r0="EnfantLePlus\xc3\x82g\xc3\xa9",Ih=259,Ac=751,L1=437,L2="EOVERFLOW",nI=885,b3="examples/aides_logement/../prestations_familiales/../smic/smic.catala_fr",Ig=1012,If="228000",tA="ENOTEMPTY",Ee="Article 13",Ef="calcul_apl_logement_foyer.nombre_personnes_\xc3\xa0_charge",L0=4719,Ed="35947",Ie="D331_59_8",LZ="Loyer",Id=162,pE=564,Eb=3583,Ec=1496,Ib=1724,Ic="brut_horaire",nH=647,Ea="x",Ia=1187,Ab="Sous-section 1 : Aides personnelles au logement",j$=335,LY="calculAidePersonnaliseeLogementAccessionPropriete",gn=547,j0="Article D755-5",a3=588,LX=4166,LW="Article D842-4",LV=791,sr="%d",LU=4218,D$="ServicesSociauxAllocationVers\xc3\xa9e\xc3\x80LaFamille",iF=637,fQ=1900,mA=285,H$="buffer.ml",gx=708,d="Prologue : aides au logement",z="Secteur accession \xc3\xa0 la propri\xc3\xa9t\xc3\xa9",Aa=1624,D_=1559,LT=4785,D8="39590",D9="accession_propri\xc3\xa9t\xc3\xa9.date_signature_pr\xc3\xaat",H_="ENOBUFS",D7=3557,op=527,nG=113,z$=1478,hl=2008,H9="0.0179",mz=1089,gw=1051,D6=908,j_=1173,z_=3446,pD=681,z9=3838,H7="245700",H8=1474,B="Prologue",LS=760,pC=451,my="calcul_nombre_parts.nombre_personnes_\xc3\xa0_charge",D5="Metropole",cA=100,c8=1021,kG="prise_en_compte_personne_\xc3\xa0_charge",z7=4243,z8=702,ak="3",bd="Partie r\xc3\xa9glementaire - D\xc3\xa9crets simples",z6=230,H6=1614,LR=413,pB="169.",eU=0.5,z5=790,c$="Article D521-1",iZ=622,nF=399,z4=3879,pA=965,nE="Article D842-11",ea="Livre 7 : R\xc3\xa9gimes divers - Dispositions diverses",bc=107,H5=381,pz=571,z3=345,oo="Article D842-12",rZ=937,nD="prestations_familiales",LQ=690,kF="est_enfant_le_plus_\xc3\xa2g\xc3\xa9",H4="26440",LP=2646,gm=590,mx=649,H3=4505,LO="201700",kE="Unix.Unix_error",H2=1139,D4="calculAidePersonnaliseeLogement",mv=4278,mw=1088,gI=347,z2="Stack_overflow",bH=767,fB="condition_2_r823_4",bF="Sous-Section 2 : Conditions d'octroi de l'aide personnalis\xc3\xa9e au logement aux personnes r\xc3\xa9sidant dans un logement-foyer",aW="\xc3\x89ligibilit\xc3\xa9AidesPersonnelleLogement",LN=1008,mu=585,H1="/static/",H0=3628,on=253,z0=368,z1=894,D3="Not_found",zZ=235,rY="\x01\0\0\0\0\0\xff\xff\0\0\xff\xff\0\0\0\0\0\0\0\0\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\0\0\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\x009\0<\0\0\0<\0\0\0\0\0A\0\0\0A\0\0\0\0\0F\0\0\0\0\0\xff\xff\0\0\0\0\0\0\0\0\0\0\0\0\xff\xff\xff\xff\xff\xff\0\0T\0\0\0\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0^\0\0\0\0\0a\0\xff\xff\xff\xffa\0\xff\xff\xff\xff\xff\xff\xff\xffh\0\0\0\0\0\0\0\0\0m\0\0\0\0\0\0\0q\0\0\0\0\0\0\0u\0\0\0\0\0\0\0y\0\0\0\0\0\0\0\0\0\0\0~\0\0\0\0\0\0\0\xff\xff\0\0\xff\xff\0\0\xff\xff\xff\xff\0\0\xff\xff\0\0\x8a\0\0\0\x8e\0\0\0\0\0\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\0\0\x9a\0\0\0\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xb2\0\0\0\0\0\0\0\xff\xff\0\0\xff\xff\0\0\xff\xff\xbb\0\0\0\0\0\0\0\0\0\xff\xff\xff\xff\xc2\0\0\0\0\0\0\0\0\0\xff\xff\xff\xff\xc9\0\0\0\0\0\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xeb\0\0\0\0\0\0\0\xef\0\0\0\0\0\xff\xff\0\0\xf4\0\0\0\0\0\xff\xff\0\0\xf9\0\0\0\0\0\0\0\xfd\0\0\0\0\0\0\0\xff\xff\0\0\x03\x01\0\0\0\0\0\0\0\0\b\x01\0\0\0\0\0\0\xff\xff\0\0\xff\xff\0\0\0\0\x11\x01\0\0\0\0\0\0\0\0\x16\x01\0\0\0\0\0\0\0\0\0\0\x1c\x01\0\0\0\0\0\0 \x01\0\0\0\0\0\0\xff\xff\0\0&\x01\0\0\0\0\0\0\0\0+\x01\0\0\0\0\0\0/\x01\0\0\0\0\0\0\0\x004\x01\0\0\0\0\0\x008\x01\0\0\0\0\0\0<\x01\0\0\0\0\0\0@\x01\0\0\0\0\0\0C\x01\0\0\0\0\xff\xff\0\0\xff\xff\0\0\0\0\0\0\0\0\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\0\0\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0y\x01}\x01\0\0\0\0\x80\x01\xff\xff\xff\xff\x80\x01\xff\xff\xff\xff\xff\xff\xff\xff\x87\x01\0\0\0\0\0\0\0\0\x8c\x01\0\0\0\0\xff\xff\0\0\x90\x01\0\0\0\0\xff\xff\0\0\xff\xff\0\0\0\0\0\0\0\0\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xc1\x01\xc5\x01\0\0\0\0\xc8\x01\xff\xff\xff\xff\xc8\x01\xff\xff\xff\xff\xff\xff\xff\xff\xcf\x01\0\0\0\0\0\0\0\0\xd4\x01\0\0\0\0\xff\xff\0\0\xff\xff\xff\xff\0\0\xff\xff\0\0\xdc\x01\0\0\xff\xff\0\0\xe2\x01\0\0\0\0\0\0\0\0\xff\xff\0\0\xe9\x01\0\0\0\0\0\0\0\0\xff\xff\0\0\xf0\x01\0\0\0\0\0\0\0\0\xf5\x01\0\0\0\0\0\0\xf9\x01\0\0\0\0\0\0\xfc\x01\0\0\0\0\0\0\xff\xff\0\0\x02\x02\x04\x02\0\0\x05\x02\x06\x02\x07\x02\b\x02\t\x02\n\x02\x0b\x02\f\x02\r\x02\x0e\x02\x0f\x02\x10\x02\x11\x02\x12\x02\x13\x02\x14\x02\x15\x02\x16\x02\x17\x02\x18\x02\x19\x02\x1a\x02\x1b\x02\x1c\x02\x1d\x02\x1e\x02\x1f\x02 \x02!\x02\x03\x02",HZ="1085",LM=1490,zY="41268",D2="calcul_apl_logement_foyer.date_courante",bp="examples/allocations_familiales/epilogue.catala_fr",tz=695,D1=1607,nC="Mayotte",cm=848054398,LL="smic.date_courante",HY=4022,HX=2247,nB="1224",D0="calcul_apl_locatif",LK="accession_propri\xc3\xa9t\xc3\xa9.situation_r822_11_13_17",cl="calcul_plafond_mensualit\xc3\xa9_d832_10_3",jZ=979,h5=1049,rX="rmdir",DZ=696,nA=1069,LJ=32752,sq="19100",HW="33623",LI="ELOOP",HV="37478",gS="calcul_nombre_parts",nz=280,sp="Article R842-5",ty="Article 23",h4=1026,ny=149,al="montant",eA="Article L521-2",b0="examples/allocations_familiales/../smic/smic.catala_fr",zW="calculAllocationLogementLocatif",zX="false",HU="37906",py="Invalid integer: ",HT="PasDeChangement",bN="\xc3\x89ligibilit\xc3\xa9 \xc3\xa0 la prime de d\xc3\xa9m\xc3\xa9nagement",ik=875,bo=106,LH=346,mt=186,d8=0x80,so="Fatal error: exception ",iE=663,gR="Chapitre 1er : Dispositions relatives aux prestations",sX="\xc3\xa2ge",px="\xc3\xa9ligibilit\xc3\xa9_commune",sn="0.0234",DY="43378",HS=3538,DX=1926,LF="25978",LG=3208,om="src/calendar_builder.ml",pw=493,LE="Section 2 : R\xc3\xa8gles de non-cumul",HR=4895,LD="_",nx=833,HQ="eligibilitePrimeDeDemenagement",sW="compare: functional value",cw="0.",gH=444,zU="40928",zV="19300",h3=529348384,LC=1564,kD=721,jY=978,zT="197700",zS="Invalid_argument",ij=656,DW="EndCall([ ",kr=823,nw="0.9",sm="prise_en_charge",LB="Article R822-22",HP="calcul_aide_personnalis\xc3\xa9e_logement",LA=1191,zR=249,DU="34301",DV="577500",zQ="%ni",zP=949,gv=324,DT=1465,bV=86400.,ar=2020,Lz="PersonneSeule",DS="ENOMEM",DR=-45,kC=559,HO="0.0238",Lx="Article 9",Ly="225100",HN=1610,Lw="AutresPersonnes",gQ="6",zO="EPROTONOSUPPORT",ol=602,HL="173600",HM=858,p="0",aV="Section 3 : Logements-foyers",zN="ENETRESET",zM=3149,Lv="EINVAL",Lu="EDOM",c="examples/aides_logement/prologue.catala_fr",sV="Article L161-17-2",Lt="EFBIG",DQ=2410,Ls="eligibiliteAidesPersonnelleLogement",zL=4198,bl=248,zK="PlusDeTroisEnfants",fa=341,pv=651,HK=1510,iY=2007,tx="208200",zI="Zone1",zJ="R\xc3\xa8glement (CE) n\xc2\xb02866/98 du conseil du 31 d\xc3\xa9cembre 1998 concernant les taux de conversion entre l'euro et les monnaies des \xc3\x89tats membres adoptant l'euro",HH="Locataire",HI="37457",HJ=301,Lr="562800",HG="535744",zH="235800",DP="resetLog",X="AllocationsFamiliales",HF="\xc3\xa2ge_l512_3_2",Lq=3268,zG="situation_familiale_calcul_apl",rW="GardeAlterneeAllocataireUnique",HE=1880,pu=1025,zF=2782,DO="haut",HD=1644,HC=1476,sU=1107,kq=1024,Lp=1143,zD="204761",zE="3.1",nv=726,Lo=802,e$=133,Ln="35780",zC="calculAidePersonnaliseeLogementFoyer",iD=636,pt=567,ms=982,Lm=184,zB=2613,sT=366,fJ=0xffffff,Ll="34829",cg=1082,mq=524,mr="locatif",nu="Titre III: Titre III : Dispositions communes relatives au financement",DM="36378",as="Calculette globale",DN="EISCONN",HB=2567,Lk="::z",zA=1670,HA=1416,ok=1091,iX=435,kp=671,kB="Article R824-1",dj=1994,zz=465,dB=2010,bQ="Prologue : prestations familiales",zy=1531,sl=2147483647,DL=4513,Li="774",Lj=208,DK=689,zx=", characters ",DI=4924,DJ=757,Lh=0x7F,Hy=4289,Hz="180100",gP="BaseMensuelleAllocationsFamiliales",DH="819",sS="4999",Hx="prestations_familiales.r\xc3\xa9sidence",bs="Chapitre IV : Calcul des allocations de logement en secteur accession",Hw="AllocationJournali\xc3\xa8rePresenceParentale",DG="ESHUTDOWN",Hv=".0",Lg="36733",zw=1665,rV="AllocationFamilialesAvril2008",eT=328,DF=693,DD=855,DE="AllocationRentreeScolaire",zv="mensualit\xc3\xa9_minimale",kA="2.",zu=691,Hu=2589,zt="Concubins",gG=578,co="calcul_plafond_mensualit\xc3\xa9_d842_6_avec_copropri\xc3\xa9t\xc3\xa9",zs=4901,DC=4911,Lf=224,zq=816,zr="SaintBarth\xc3\xa9lemy",rU=357,am="Partie l\xc3\xa9gislative",gl=2003,bw="examples/allocations_familiales/securite_sociale_D.catala_fr",Hs=4107,ko="Article R823-4",Ht="32956",DB=1504,Hr="294500",DA=1612,sR="examples/aides_logement/../prestations_familiales/s\xc3\xa9curit\xc3\xa9_sociale_R.catala_fr",d$="RessourcesAidesPersonnelleLogement",Hq=2868,iC=140,gO="Montant des plafonds de ressources",bx="Annexe",gu="Section 1 : B\xc3\xa9n\xc3\xa9ficiaires",Le="3524",Dz=2362,Hp="Article D832-27",ps=723,Dy=1101,sQ=3763,jX="500",Ho="Zone3",Ld="locatif.type_aide",mp=187,pr=770,zp="40144",nt=581,eh=2015,fE="prise_en_compte",Dx=3985,zo=838,fI=613,sk="223900",hr=718,zn="ServicesSociauxAllocationVers\xc3\xa9eAuxServicesSociaux",pq=138,ns=1998,w="Livre VIII : Aides personnelles au logement",Hn="225500",mo=905,kn="caract\xc3\xa9ristiques_pr\xc3\xaat_l831_1_6",Dv="38892",Dw="accession_propri\xc3\xa9t\xc3\xa9.mensualit\xc3\xa9_principale",sP="nan",Hm="calculNombrePartLogementFoyer",gF=646,kz="Impay\xc3\xa9D\xc3\xa9penseLogement",Lc=1403,jW=712,bv="Calculette avec garde altern\xc3\xa9e",Hl="ECHILD",Lb=0xdfff,zm=2148,eS="/",iB="4.3",Hk="ETOOMANYREFS",jV=756,oj=1017,Hj=951,Du=1179,pp="ENOTDIR",zl="ETIMEDOUT",tw=1073741823,Dt="135000",Ds="0.0068",Hi="\\r",zk="34600",nr=560,Dr=154,La="calcul_allocation_logement",po=513,zi="coefficient_prise_en_charge",cv=1085,zj=206,Dq="src/time_Zone.ml",Hh=4045,j9="Article D161-2-1-9",Dp=674,zh="EWOULDBLOCK",nq="Guyane",np="PasDeTravaux",Do=4697,gt=311,km=883,iA=255,zg=4439,K$=3250,K_="Revenu",dk="Partie r\xc3\xa9glementaire - D\xc3\xa9crets en Conseil d'Etat",bU="droit_ouvert_majoration",D="Partie r\xc3\xa9glementaire",Dn=2268,Dm="Sous-section 4 : Prise en compte du patrimoine",j="D\xc3\xa9clarations des champs d'application",Hg="Chapitre 1er : G\xc3\xa9n\xc3\xa9ralit\xc3\xa9s",Hf="End_of_file",K9="calcul_apl_logement_foyer.condition_2_du_832_25",fA="Chapitre V : Calcul de l'aide personnalis\xc3\xa9e au logement en secteur logement-foyer",He="calculAllocationLogementFoyer",fH="traitement_aide_finale_r\xc3\xa9duction_loyer_solidarit\xc3\xa9",pn="Article 24",sO="Failure",K8="267871",iW=662,zf=1480,oi=771,K7=4892,mn=218,Hd="167800",tv=247,a6="CalculetteAidesAuLogement",iz=664,Dl="ENETDOWN",jU=684,iy=715,sN="\xff\xff\xff\xff\xff\xff\x11\0\xff\xff\x13\0\xff\xff\xff\xff\xff\xff\xff\xff\x07\0\x07\0\xff\xff\x13\0\x13\0\x13\0\x13\0\x13\0\x13\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\b\0\b\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\t\0\xff\xff\t\0\xff\xff\t\0\xff\xff\xff\xff\x0e\0\xff\xff\xff\xff\x02\0\xff\xff\xff\xff\xff\xff\xff\xff\x02\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x07\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x03\0\xff\xff\x01\0\xff\xff\x04\0\x03\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x04\0\x04\0\x04\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x03\0\xff\xff\0\0\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\x02\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\x02\0\xff\xff\xff\xff\xff\xff\xff\xff\x03\0\x03\0\x05\0\x05\0\x05\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x03\0\xff\xff\x03\0\xff\xff\x03\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\x02\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x10\0\xff\xff\x12\0\xff\xff\xff\xff\xff\xff\xff\xff\x07\0\x07\0\xff\xff\x12\0\x12\0\x12\0\x12\0\x12\0\x12\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\b\0\xff\xff\b\0\xff\xff\b\0\xff\xff\xff\xff\r\0\xff\xff\xff\xff\xff\xff\x01\0\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\t\0\xff\xff\x0b\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\0\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\0\0\xff\xff\0\0\xff\xff\xff\xff\x06\0\xff\xff\xff\xff\xff\xff\x01\0\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\x04\0\x03\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x03\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff",Hc=0xdc00,ze="389618",Hb=1494,pm="3.",K6=4844,Dk=3225,Ha=1473,zd="185800",K5="0.0201",iV=880,K4="Sys_error",pl=130,no=275,gE="Article D521-2",zc=1630,fD=60.,tu="nombre_personnes_\xc3\xa0_charge_prises_en_compte",gk="Sous-section 4 : Assurance vieillesse",Dj="Printexc.handle_uncaught_exception",eR="Article D832-24",sj="30500",pk=618,e_=1079,zb=1580,mm="int_of_string",G_="194810",G$=3822,za="Chapitre Ier : Principes g\xc3\xa9n\xc3\xa9raux",Di="Article 37",V="examples/aides_logement/arrete_2019-09-27.catala_fr",y$="39340",y_=":z",G9="name",pj=103,y9=1122,nn=966,G8=4795,aP="Chapitre 2 : Modalit\xc3\xa9s de liquidation et de versement des allocations de logement",G7="DateDeNaissance",Dh=792,G6=1622,bT="traitement_aide_finale_redevance",Dg=132,Dd="1.4",De=698,Df=803,G5=" ])",rT="31797",G4="19484",y8=354,gj=432,gi=325,dA="Article 7",Dc="ENODEV",K3="%Li",G3=864,G2=3610,y6=4120,y7=2771,Db=1014,oh=591,rS="r\xc3\xa9muneration_mensuelle",G1=1936,og=960,d7="Article 14",G0="34570",sM="date_de_naissance",pi=1090,Da=795,of="base_mensuelle_allocations_familiales",K2="MoinsDeTroisEnfants",dc=344,oe="_z",iT=2000,iU=1951,K1="locatif.\xc3\xa2g\xc3\xa9es_ou_handicap_adultes_h\xc3\xa9berg\xc3\xa9es_on\xc3\xa9reux_particuliers",od=762,GZ=860,ph=738,K0=593,nm=136,db="Titre IV : Allocations de logement",y5=5034,nl=959,e0=137,ez="InterfaceAllocationsFamiliales",GY="retrieveRawEvents",C$=3437,y4=985,y3=1681,C_=4078,jT="Pendant",y2="%a",GX=32044,fG=", ",fz="5422",dE=2018,C9="17012",nk="calcul_\xc3\xa9quivalence_loyer_minimale.condition_2_du_832_25",y1="AllocationJournalierePresenceParentale",yZ=3921,y0=4891,nj=579,ky=710,b9="Chapitre III : Calcul des aides personnelles au logement en secteur locatif",C8="' kind for the enumeration 'ElementPrestationsFamiliales.t'",ml=682,bE="Prestations familiales",GW=467,KZ="src/date.ml",C5="Enfant\xc3\x80Charge",C6="calculette",C7="GardeAltern\xc3\xa9eAllocataireUnique",e9="Article D823-16",C4="172500",yY=410,C3=1109,KX=754,KY="EADDRINUSE",KW="n_nombre_parts_d832_25",yX="ENOSYS",tt="Apres",yW="locatif.zone",mk=1929,yV=4156,hh=359,bO="examples/aides_logement/../prestations_familiales/prologue.catala_fr",kx=887,KV=408,yU=258,C2="179800",fP=" ",yT=361,N="Secteur locatif",C1="Undefined_recursive_module",KU=1619,O="output",pg=1074,mj="accession_propri\xc3\xa9t\xc3\xa9",yS=1194,GV=1193,mi=884,KT="base_mensuelle_allocations_familiales.date_courante",sL="199900",yR=752,yQ=1424,c0=-976970511,yO="' kind for the enumeration 'SituationObligationScolaire.t'",yP="%.16g",C0="220100",KS=189,jS="droit_ouvert_forfaitaire",mh=620,sK="%i",rR="0.01",CZ="262985",GU="409505",pf=670,yN="LogementFoyer",GT="33026",CY="139700",ni="PrestationAccueilJeuneEnfant",ii=629,CX="Article L822-4",ts=856,GS="41252",yM=1618,ih=640,CV="0.1",CW="Allocation\xc3\x89ducationEnfantHandicap\xc3\xa9",mg="5399",pe=337,e8=123,nh=650,CU=3169,oc=570,KR="accession_propri\xc3\xa9t\xc3\xa9.local_habit\xc3\xa9_premi\xc3\xa8re_fois_b\xc3\xa9n\xc3\xa9ficiaire",mf="0.0173",R="Arr\xc3\xaat\xc3\xa9 du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de d\xc3\xa9m\xc3\xa9nagement",GR=806,GQ=159,yL="LocationAccession",ng=1067,CT="CDI",e7=577,rQ="a_d\xc3\xa9j\xc3\xa0_ouvert_droit_aux_allocations_familiales",KQ="41338",di=0xff,me="Arr\xc3\xaat\xc3\xa9 du 19 avril 2022 relatif au rel\xc3\xa8vement du salaire minimum de croissance",si=-12,ob="calcul_\xc3\xa9quivalence_loyer_minimale.ressources_m\xc3\xa9nage_arrondies",md=458,oa=704,yK="Article 15",GP=3284,fF="0.75",kl="Titre 5 : Dispositions particuli\xc3\xa8res \xc3\xa0 la Guadeloupe, \xc3\xa0 la Guyane, \xc3\xa0 la Martinique, \xc3\xa0 La R\xc3\xa9union, \xc3\xa0 Saint-Barth\xc3\xa9lemy et \xc3\xa0 Saint-Martin",KP="22355",n$=3654863,CS="140800",cV=436,tr="Chapitre 5 : Allocation de solidarit\xc3\xa9 aux personnes \xc3\xa2g\xc3\xa9es",yJ=455,CR=1997,GO="163000",KO=991,jR="0.5",KN="Article R842-14",yI="fd ",GN=3904,GM=1120,KM=2829,CQ=1233,GL=1116,yH="194200",GK="41751",mc=871,CP=409,GJ="181800",yG="41316",a4="traitement_aide_finale_contributions_sociales_arrondi",yF=993,GI="cat\xc3\xa9gorie_calcul_apl",iS=338,cc="Prise en compte des ressources pour les aides personnelles au logement",GH="757",rP=827,CO=4479,kw="coefficents_enfants_garde_altern\xc3\xa9e_pris_en_compte",yE=2032,pd=442,KL="%B",gh=2001,rO="Compl\xc3\xa9mentFamilial",yD=4122,ix=633,KK="smic.r\xc3\xa9sidence",h2=489,aE="Livre 5 : Prestations familiales et prestations assimil\xc3\xa9es",j8=1018,CN="Article D832-18",dV=108,GG=1984,h1=-2147483648,x="1",fe=2002,yC=1708,GF="Chapitre II : Dispositions applicables aux ressources",yB=522,CM=606,GE=1657,yA="Article R822-7",CL="42605",GD=4307,yx="VendeurQuandDemandeurAContratLocationAccession",yy="Article R755-0-2",yz="EAGAIN",CK="calculNombrePartsAccessionPropriete",sJ=406,yw=4947,sh=": Not a directory",KJ="allocationFamilialesAvril2008",yv="b",KI="Article D521-3",GC=4265,CJ="accession_propri\xc3\xa9t\xc3\xa9.nombre_personnes_\xc3\xa0_charge",aA="CalculAidePersonnalis\xc3\xa9eLogement",yt="D331_63_64",yu="EDESTADDRREQ",d_=2012,CI=287,CH="Out_of_memory",n_=86400,KH="42469",ys=4897,pc=530,an="4",C="examples/aides_logement/code_construction_reglementaire.catala_fr",tq="index out of bounds",nf=601,kv=668,pa=903,pb="_bigarr02",sI=1006,yr="31264",gD=881,KG=0xffffffff,KF="LaR\xc3\xa9union",mb="Article L822-5",eQ=0xffff,KE="accession_propri\xc3\xa9t\xc3\xa9.type_travaux_logement",ig=2009,Gz=3836,GA=3262,GB="EBUSY",yq="ENETUNREACH",n9=417088404,Gy=222,KD="%.17g",rN=400,n8="calcul_\xc3\xa9quivalence_loyer_minimale.n_nombre_parts_d832_25",dU="100.",dh=3600,CG="1.25",ne=143,KC=2282,gg=1050,yp="44729",KB=3124,fd="\xc3\xa2ge_minimum_alin\xc3\xa9a_1_l521_3",hg=963043957,eZ=126,T="5",iw=142,o$=741,iR="AllocationSoutienFamilial",yo=840,CF="SousLocataire",Gx=4527,Gw="34713",n7=416,ad="Section 1 : Calcul, liquidation et versement des aides",ku=124,hf="Article L512-3",Gv="0.98",KA=3417,tp=1626,Gu="633129",Kz=2578,dH=150,to=427,yn="41440",nd=899,dD="\xc3\x89ligibilit\xc3\xa9PrimeDeD\xc3\xa9m\xc3\xa9nagement",e6=135,dT="Sous-section 2 : Calcul de l'aide en secteur locatif",Ky=1112,ma=252,CE="enfant_le_plus_\xc3\xa2g\xc3\xa9",H="examples/allocations_familiales/prologue.catala_fr",Kx="EPROTOTYPE",_="CalculAidePersonnalis\xc3\xa9eLogementFoyer",Gt="PriseEnCharge",e5=".",ym="EINTR",iQ=147,CD=0xf0,hq=634,Kw=4006,yl="eligibilitePrestationsFamiliales",cY="12.",CC=744,Gs=694,n6="Guadeloupe",yk=276,nc="230500",hp=116,yi=1482,yj="enfantLePlusAge",eY=576,Gr="EALREADY",nb=365,n5=627,h0=813,CB=1007,Kv=294,bD="traitement_aide_finale_montant_minimal",yh="impossible case",em="examples/allocations_familiales/securite_sociale_R.catala_fr",yg=1095,gs="R\xc3\xa8gles diverses",iP=968,CA=-1080,Gq=500,tn=291,Ku="EAFNOSUPPORT",Kt="18185",Cz=969837588,ie=872,Gp="PM",yf="SaintBarthelemy",iv=638,Ks="ENFILE",Go=3673,Kp=-1023,Kq=2717,Kr=3801,Ko=859,ye="ressources_m\xc3\xa9nage_avec_arrondi",Cy=4241,n4=763,Km="ouvertureDroitsRetraite",Kn="\xc3\xa9ligibilit\xc3\xa9_aide_personnalis\xc3\xa9e_logement",Cx="204700",sg="Article L755-12",yd="TravauxPourAcquisitionD832_15_1",Cw="Ancien",sf="lib/read.mll",hk="1229",yc=1530,Kk="Article premier",Kl=939,yb=501,a8="\xc3\x89ligibilit\xc3\xa9 \xc3\xa0 l'aide personnalis\xc3\xa9e au logement",kk=1582,el=1048,gf='"',Kj="Arr\xc3\xaat\xc3\xa9 du 14 d\xc3\xa9cembre 2020 relatif au montant des plafonds de ressources de certaines prestations familiales et aux tranches du bar\xc3\xa8me applicable au recouvrement des indus et \xc3\xa0 la saisie des prestations",bJ=1022,l$="examples/aides_logement/../prestations_familiales/s\xc3\xa9curit\xc3\xa9_sociale_L.catala_fr",az="CalculAllocationLogement",Ki="3539",tm="<",ya=931,Gl="208500",Gm="prestations_familiales.date_courante",Gn=0x800,Cv="EPERM",Kh=869,hZ=617,hY=182,l_=398,na=331,iO=327,o_="\xc3\xa9ligibilit\xc3\xa9",x_=3943,x$=0.012,Gj=3958,Gk="233000",c_=719,Gi="calculAidePersonnaliseeLogementLocatif",b_="Article 33",rM=156,Cu="InfosLogementFoyer",Kg="M\xc3\xa9tropole",x9=842,Ct="40696",Kf="ressources_m\xc3\xa9nage_arrondies_seuil",l9=204,se="Article D815-1",id="conditions_hors_\xc3\xa2ge",x8=997,m$=727,aR="traitement_aide_finale_abattement",sd=534,bi="Dispositions sp\xc3\xa9ciales relatives \xc3\xa0 Mayotte",x7=726928360,l8=562,Gh="221100",x6="([^/]+)",sH=165,e4=1171,Cs="Article 39",Gg=700,tl=0xf,bM=809,x5="798",Cr="BailleurSocial",Gf="logement_foyer.nombre_personnes_\xc3\xa0_charge",jQ="montant_initial_m\xc3\xa9tropole_majoration",eX=125,Gd=2796,Ge=490,Cq=658,sG=818,Cp=1092,Gc="Division_by_zero",o9=736,rL="Article L832-3",x4=3352,Co=430,x3=708012133,Ke="SituationObligationScolaire",aY=877,ge=589,Cn="AutrePersonne\xc3\x80Charge",o8=879,Kd="44440",hX=532,Gb=1200,Kc="AllocationJeuneEnfant",o7=566,d6=2014,Cm="22262",Ga=552,Ck="Article D842-17",Cl=380,l7=118,iN=973,F$="EADDRNOTAVAIL",Ka=697,Kb="Article L751-1",o6=119,cX=104,kj="montant_avec_garde_altern\xc3\xa9e_majoration",J$="70",x1="calculette_sans_garde_altern\xc3\xa9e",x2="Instruction interminist\xc3\xa9rielle n\xc2\xb0DSS/2B/2022/82 du 28 mars 2022 relative \xc3\xa0 la revalorisation au 1er avril 2022 des prestations familiales servies en m\xc3\xa9tropole, en Guadeloupe, en Guyane, en Martinique, \xc3\xa0 la R\xc3\xa9union, \xc3\xa0 Saint-Barth\xc3\xa9lemy, \xc3\xa0 Saint-Martin et dans le d\xc3\xa9partement de Mayotte",m_=321,x0=1975,F_="version_avril_2008",xZ="38361",m8=127686388,m9=714,F9="locatif.r\xc3\xa9duction_loyer_solidarit\xc3\xa9",gd=2013,Ci="ouverture_droits_retraite",Cj=102,jP=340,J_=1486,l6=722,l5="100000.",xY="18261",m7=652,Ch="logement_foyer.ressources_m\xc3\xa9nage_arrondies",eg=101,o5="calcul_nombre_parts.situation_familiale_calcul_apl",Cg="body",n3=642,dQ="Calcul des contributions sociales s'appliquant aux aides personnelles au logement",xX="Unexpected '%s' kind for the enumeration 'Collectivite.t'",hj=1e7,tk="\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x03\0\x04\0\0\0\x03\0\x03\0\x86\0\0\0\x03\0\0\0\x86\0E\x01\x92\x01\xff\xff\0\0E\x01\x92\x01\0\0\0\0\0\0\0\0\x7f\0\x8b\0\0\0\x03\0\0\0\f\0\x03\0\xaa\0\x86\0\xaf\0\0\0\x07\0\x0b\x01E\x01\x92\x01\x0e\x01\r\x001\0\x05\0\n\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\x008\0v\0\x06\0\x81\0\x82\x009\0\xed\x01\x89\0\0\x021\0\0\x000\0\x8a\0j\0>\0\x0e\0n\0i\0\0\x001\0\x0f\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x1e\x000\0\b\0r\0\xd1\0\xec\0\0\x01\r\x01\x1d\0\x16\0\xff\xff0\x000\0\x11\0\x15\0\x19\0 \0!\0#\0\x17\0\x1b\0\x10\0\x1f\0\x1c\0\"\0\x13\0\x18\0\x12\0\x1a\0\x14\0$\0)\0%\x000\0\t\0*\0+\0,\0-\0.\0/\0=\0U\x000\0&\0'\0'\0'\0'\0'\0'\0'\0'\0'\x001\0C\0'\0'\0'\0'\0'\0'\0'\0'\0'\0'\0V\0\x8f\0\xff\xff(\0\x90\0\x91\0\x92\x007\0\x94\x007\0\x95\x000\x006\x006\x006\x006\x006\x006\x006\x006\x006\x006\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\0\xff\xff0\0\x96\0\x97\0\xa1\0B\0\x9e\x005\0\x9f\x005\0\xa0\x003\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\0\xa5\x003\x006\x006\x006\x006\x006\x006\x006\x006\x006\x006\0\xa2\0\xa3\0\xa6\0]\0\xff\xff\x02\x006\x006\x006\x006\x006\x006\x006\x006\x006\x006\0\xff\xffM\0g\0l\0t\0\x84\0\x86\0\x87\0\x80\0\x8b\0\x86\0\xa4\0]\0\xab\0M\0\xa7\0\xa8\0\xa9\0\xac\0p\0\xad\0\xae\0\xd2\0\xe2\0\xd0\0\xd3\0\xd4\0;\0S\0\x86\0\xd5\0\xd6\0\xd7\0\xd8\0\xda\0\x8d\0\xdb\0]\0\xdc\0\xdd\0{\0\xde\0\xdf\0\xe0\0\x88\0_\0\xe1\0#\x01A\x01\xea\0\x9b\0\x05\x01a\x01\xfa\0\xff\xff\xfe\x009\x01=\x01_\x01M\0,\x01\\\x01X\x01\t\x01\x1d\x01L\0|\0!\x01\x12\x01K\0b\0\x13\x01U\x01V\x01W\x01x\x01Y\x01J\0\xe1\x005\x01y\x01I\0Z\x01H\0G\0N\0N\0N\0N\0N\0N\0N\0N\0N\0N\0b\0q\x01z\0[\x01@\0\x04\x01]\x01N\0N\0N\0N\0N\0N\0O\0O\0O\0O\0O\0O\0O\0O\0O\0O\0\x9c\0p\x01^\x01`\x01b\x01c\x011\x01O\0O\0O\0O\0O\0O\0d\x01\x9d\0e\x01N\0N\0N\0N\0N\0N\0\xb7\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\x18\x01p\x01\xff\xff\x19\x01f\x01g\x01i\x01O\0O\0O\0O\0O\0O\0P\0P\0P\0P\0P\0P\0P\0P\0P\0P\0j\x01k\x010\x01(\x01l\x01m\x01n\x01P\0P\0P\0P\0P\0P\0Q\0Q\0Q\0Q\0Q\0Q\0Q\0Q\0Q\0Q\0o\x01\x1b\x01\xff\xff\xab\x01\x1f\x01\xaa\x01\x17\x01Q\0Q\0Q\0Q\0Q\0Q\0\\\0\xa8\x01?\x01P\0P\0P\0P\0P\0P\0\xf8\0\xa5\x01\xfc\0\xa2\x01;\x01E\0W\0W\0W\0W\0W\0W\0W\0W\0W\0W\0\xff\xffQ\0Q\0Q\0Q\0Q\0Q\0W\0W\0W\0W\0W\0W\0X\0X\0X\0X\0X\0X\0X\0X\0X\0X\0'\x01*\x01\xff\xff\xa3\x01\xa4\x01x\0\x02\x01X\0X\0X\0X\0X\0X\0\xa6\x017\x01\x99\0W\0W\0W\0W\0W\0W\0\x07\x01\xa7\x01\xa4\x01\xa9\x01\x10\x01\xa4\x01Y\0Y\0Y\0Y\0Y\0Y\0Y\0Y\0Y\0Y\x003\x01X\0X\0X\0X\0X\0X\0Y\0Y\0Y\0Y\0Y\0Y\0Z\0Z\0Z\0Z\0Z\0Z\0Z\0Z\0Z\0Z\0a\0\x89\x01\xa4\x01\xac\x01\xb9\x01\x88\x01\xad\x01Z\0Z\0Z\0Z\0Z\0Z\0a\0\xb3\0\xae\x01Y\0Y\0Y\0Y\0Y\0Y\0.\x01\xaf\x01\xb0\x01\xb4\0\xa4\x01\xb8\x01\xb5\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0|\x01Z\0Z\0Z\0Z\0Z\0Z\0\xc0\x01\xb2\x01\x15\x01\xb3\x01a\0\xc1\x01\xb4\x01\xb5\x01\xb6\x01\xb7\x01\xa4\x01\xd8\x01\xff\xffa\0\xb8\x01\xd8\x01\xd1\x01a\0\xdf\x01a\0\xd0\x01\xe6\x01\x03\x02a\0\xdb\x01%\x01\xd8\x01\xd9\x01\x03\x02\xdc\x01\xd8\x01a\0\x03\x02\x03\x02\xd8\x01a\0\x03\x02a\0`\0c\0c\0c\0c\0c\0c\0c\0c\0c\0c\0\xd8\x01\x03\x02~\x01\x03\x02\x03\x02\x03\x02\x03\x02c\0c\0c\0c\0c\0c\0a\0\x03\x02\xda\x01\xfa\x01\x03\x02\x03\x02a\0\x03\x02|\x01|\x01a\0\x03\x02\xdd\x01\x03\x02\xfd\x01\x03\x02\x03\x02\x03\x02a\0\xff\xff\x03\x02\xc4\x01a\0\x03\x02a\0`\0c\0c\0c\0c\0c\0c\0d\0d\0d\0d\0d\0d\0d\0d\0d\0d\0\xeb\x01\x03\x02\xf1\x01\x03\x02\xff\x01\xf2\x01\x03\x02d\0d\0d\0d\0d\0d\0e\0e\0e\0e\0e\0e\0e\0e\0e\0e\0\xf6\x01\x81\x01\x81\x01\xe4\x01\x03\x02\xc4\x01\x03\x02e\0e\0e\0e\0e\0e\0\x03\x02\xc6\x01\x03\x02d\0d\0d\0d\0d\0d\0\x03\x02\x03\x02\x03\x02\xc4\x01\xea\x01\x86\x01a\0a\0a\0a\0a\0a\0a\0a\0a\0a\0\0\0e\0e\0e\0e\0e\0e\0a\0a\0a\0a\0a\0a\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\0\0\0\0\xc9\x01\xb1\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xbc\0\0\0a\0a\0a\0a\0a\0a\0\xc9\x01\xe3\x01\0\0\xbf\0\xce\x01{\x01\xbd\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbd\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xc3\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc6\0\xff\xff\xf8\x01\xc4\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc4\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xca\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xcd\0\xff\xff\xff\xff\xcb\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xe2\0\xc3\x01\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xe8\x01\0\0\0\0\xce\0\xdd\x01\xef\x01\xfe\x01\0\0\xcf\0\xf4\x01\0\0\xe1\0\xcb\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xe8\0\0\0\xe8\0\0\0\xe1\x01\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xd9\0\xff\xff\0\0\0\0\0\0\0\0\xe1\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\0\0\0\0\0\0\0\0\xff\xff\0\0\0\0\xe6\0\0\0\xe6\0\0\0\xe4\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\0\0\xe4\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xba\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\0\0\0\0\0\0\0\0\0\0\xf1\0\0\0q\x01\0\0M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01\0\0p\x01\0\0\0\0\xc1\0\0\0\0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0p\x01\0\0\0\0\0\0\xf0\0\xc8\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\0\0\xf6\0\0\0\0\0\xf0\0\0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\0\0\0\0\0\0\0\0\xf5\0\0\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xee\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\0\0\0\0\0\0\0\0\xf5\0\0\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0E\x01F\x01\0\0\0\0E\x01L\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0E\x01\0\0N\x01\0\0\0\0\0\0\0\0h\x01I\x01\0\0\0\0\0\0\0\0O\x01\0\0G\x01L\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01\0\0\0\0H\x01\0\0\0\0\0\0\0\0\0\0\xf3\0\0\0\0\0\0\0\0\0\0\0\0\0P\x01w\x01\0\0w\x01\0\0Q\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01\0\0\0\0J\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01S\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0R\x01\0\0\0\0s\x01\0\0\0\0T\x01\0\0\0\0u\x01\0\0u\x01\0\0K\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01\0\0s\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01\0\0\x80\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\0\0\0\0\x80\x01\0\0\0\0\0\0\x80\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\0\0\0\0\0\0\0\0\0\0\0\0\x80\x01\0\0\0\0\xb9\x01\0\0\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\0\0\0\0\0\0\0\0\0\0\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\xb8\x01\0\0\x80\x01\0\0\0\0\0\0\0\0\0\0\x80\x01\0\0\0\0\0\0\x80\x01\0\0\0\0\0\0\0\0\0\0\0\0\x80\x01\x80\x01\0\0\0\0D\x01\x80\x01\x80\x01\x80\x01\x7f\x01\0\0\x80\x01\0\0\0\0\xb8\x01\0\0\0\0\0\0\0\0\x80\x01\0\0\0\0\0\0\x80\x01\0\0\x80\x01\x7f\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\0\0\0\0\0\0\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\0\0\0\0\0\0\0\0\0\0\0\0\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\0\0\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\xbf\x01\x8e\x01\xbf\x01\0\0\0\0\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\0\0\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\0\0\0\0\0\0\0\0\x8d\x01\0\0\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\0\0\0\0\0\0\0\0\x8d\x01\0\0\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x92\x01\x93\x01\0\0\0\0\x92\x01\x9a\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xc8\x01\x92\x01\0\0\x99\x01\0\0\0\0\0\0\0\0\xb1\x01\x96\x01\0\0\0\0\0\0\xc8\x01\x9c\x01\0\0\x94\x01\x9a\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\0\0\0\0\x95\x01\0\0\0\0\0\0\0\0\0\0\0\0\x8b\x01\0\0\0\0\0\0\0\0\0\0\x9d\x01\0\0\0\0\0\0\0\0\x9e\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xc8\x01\0\0\x97\x01\0\0\0\0\0\0\xc8\x01\0\0\0\0\0\0\xc8\x01\xbb\x01\0\0\xa0\x01\0\0\0\0\0\0\0\0\xc8\x01\0\0\0\0\x9f\x01\xc8\x01\0\0\xc8\x01\xc7\x01\0\0\xa1\x01\0\0\0\0\0\0\0\0\0\0\0\0\x98\x01\0\0\0\0\0\0\0\0\xbd\x01\0\0\xbd\x01\0\0\xbb\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xc8\x01\0\0\0\0\0\0\0\0\0\0\0\0\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xc8\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xc8\x01\0\0\0\0\0\0\0\0\x91\x01\xc8\x01\0\0\0\0\0\0\xc8\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xc8\x01\0\0\0\0\0\0\xc8\x01\0\0\xc8\x01\xc7\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\0\0\0\0\0\0\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\0\0\0\0\0\0\0\0\0\0\0\0\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\0\0\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\0\0\xd6\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\0\0\0\0\0\0\0\0\xd5\x01\0\0\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\0\0\0\0\0\0\0\0\xd5\x01\0\0\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xd3\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0",Cf=1633,ki=254,J9="calcul_apl_logement_foyer.zone",Ce="accession_propri\xc3\xa9t\xc3\xa9.zone",J8="6.",xW="1003",Cc="ECONNABORTED",Cd="EFAULT",he="Article L841-2",J7=" : flags Open_text and Open_binary are not compatible",xU=1516,jO=902,xV="EDEADLK",Cb="' kind for the enumeration 'PriseEnCharge.t'",J6="EIO",kh="Article D832-15",gC="Titre VI : Dispositions relatives aux prestations et aux soins - Contr\xc3\xb4le m\xc3\xa9dical - Tutelle aux prestations sociales",F8="43248",hi=1992,d9="examples/aides_logement/../base_mensuelle_allocations_familiales/bmaf.catala_fr",xT="\\\\",fO=584,v="Code de la construction et de l'habitation",F6=1489,F7="Instruction interministerielle no DSS/SD2B/2019/261 du 18 d\xc3\xa9cembre 2019 relative \xc3\xa0 la revalorisation au 1er janvier 2020 des plafonds de ressources d\xe2\x80\x99attribution de certaines prestations familiales servies en m\xc3\xa9tropole, en Guadeloupe, en Guyane, en Martinique, \xc3\xa0 La R\xc3\xa9union, \xc3\xa0 Saint-Barth\xc3\xa9lemy, \xc3\xa0 Saint-Martin et \xc3\xa0 Mayotte",J5="Article 38",F5=188,J4=1045,Ca="0.04",J3=160,F4="0.0226",xS="192500",J2="230700",sc=926,B$="0.0463",F3="217600",xR=4708,sF="GardeAlterneePartageAllocations",J1=519,B_="EHOSTDOWN",sE="\0\0\xec\xff\xed\xff\x03\0\xef\xff\x10\0\xf2\xff\xf3\xff\xf4\xff\xf5\xff\0\0\x1f\0\xf9\xffU\0\x01\0\0\0\0\0\x01\0\0\0\x01\0\x02\0\xff\xff\0\0\0\0\x03\0\xfe\xff\x01\0\x04\0\xfd\xff\x0b\0\xfc\xff\x03\0\x01\0\x03\0\x02\0\x03\0\0\0\xfb\xff\x15\0a\0\n\0\x16\0\x14\0\x10\0\x16\0\f\0\b\0\xfa\xffw\0\x81\0\x8b\0\xa1\0\xab\0\xb5\0\xc1\0\xd1\0\xf0\xff\x0b\0&\0\xfc\xffA\0\xfe\xff\xff\xffn\0\xfc\xff\xa3\0\xfe\xff\xff\xff\xea\0\xf7\xff\xf8\xff0\x01\xfa\xff\xfb\xff\xfc\xff\xfd\xff\xfe\xff\xff\xffG\x01~\x01\x95\x01\xf9\xff'\0\xfd\xff\xfe\xff&\0\xbb\x01\xd2\x01\xf8\x01\x0f\x02\xff\xff\xdc\0\xfd\xff\xff\xff\xf5\0'\x02m\x02\x0e\x01X\x02\xa4\x02\xbb\x02\xe1\x02\r\0\xfc\xff\xfd\xff\xfe\xff\xff\xff\x0e\0\xfd\xff\xfe\xff\xff\xff\x1e\0\xfd\xff\xfe\xff\xff\xff\x0f\0\xfd\xff\xfe\xff\xff\xff\x11\x01\xfb\xff\xfc\xff\xfd\xff\xfe\xff\xff\xff\x13\0\xfc\xff\xfd\xff\xfe\xff\x0f\0\xff\xff\x10\0\xff\xff\b\x01\x05\0\xfd\xff\x17\0\xfe\xff\x14\0\xff\xff.\0\xfd\xff\xfe\xff*\x004\x005\0\xff\xff5\x000\0[\0\\\0\xff\xff\x1b\x01\xfa\xff\xfb\xff\x89\0h\0Y\0X\0j\0\xff\xff\x8f\0\x89\0\xb1\0\xfe\xff\xb7\0\xa8\0\xa6\0\xb7\0\x02\0\xfd\xff\xb1\0\xac\0\xbb\0\x04\0\xfc\xff5\x02\xfb\xff\xfc\xff\xfd\xffg\x01\xff\xff\xf8\x02\xfe\xff\x06\x03\x1e\x03\xfc\xff\xfd\xff\xfe\xff\xff\xff(\x032\x03J\x03\xfc\xff\xfd\xff\xfe\xff\xff\xff=\x03T\x03l\x03\xf9\xff\xfa\xff\xfb\xff\xf4\0x\x03\x8e\x03\xb3\0\xc2\0\x0f\0\xff\xff\xbe\0\xbc\0\xbb\0\xc1\0\xb7\0\xb3\0\xfe\xff\xbf\0\xc9\0\xc8\0\xc4\0\xcb\0\xc1\0\xbd\0\xfd\xff\x9d\x03_\x03\xae\x03\xc4\x03\xce\x03\xd8\x03\xe4\x03\xef\x03<\0\xfd\xff\xfe\xff\xff\xff\f\x04\xfc\xff\xfd\xffW\x04\xff\xff\x91\x04\xfc\xff\xfd\xff\xdd\x04\xff\xff\xe5\0\xfd\xff\xfe\xff\xff\xff\xe7\0\xfd\xff\xfe\xff\xff\xff\x02\0\xff\xff\x12\x01\xfc\xff\xfd\xff\xfe\xff\xff\xff\"\x01\xfd\xff\xfe\xff\xff\xff\0\0\xff\xff\x03\0\xfe\xff\xff\xff&\x01\xfc\xff\xfd\xff\xfe\xff\xff\xffx\x01\xfb\xff\xfc\xff\xfd\xff\xfe\xff\xff\xff\xd0\0\xfd\xff\xfe\xff\xff\xff\xd3\0\xfd\xff\xfe\xff\xff\xff\xbd\0\xff\xff\x8f\x01\xfc\xff\xfd\xff\xfe\xff\xff\xff\r\x01\xfd\xff\xfe\xff\xff\xff_\x01\xfc\xff\xfd\xff\xfe\xff\xff\xff2\x01\xfd\xff\xfe\xff\xff\xff\x1a\x01\xfd\xff\xfe\xff\xff\xff\xe9\0\xfd\xff\xfe\xff\xff\xff\xde\0\xfd\xff\xfe\xff\xff\xffO\x05\xed\xff\xee\xff\n\0\xf0\xff,\x01\xf3\xff\xf4\xff\xf5\xff\xf6\xff=\x01\x02\x04\xf9\xff-\x05\xd1\0\xe4\0\xd3\0\xe8\0\xe1\0\xdf\0\xf0\0\xff\xff\xeb\0\xea\0\b\x01\xfe\xff\x04\x01\x17\x01\xfd\xff6\x01\xfc\xff\x1f\x01\x1d\x01 \x01'\x011\x01-\x01\xfb\xff9\x01R\x01P\x01N\x01T\x01J\x01V\x01\xfa\xffn\x05\f\x04{\x05\x9b\x05\xa5\x05\xb1\x05\xbb\x05\xc5\x05\xf1\xff\xc7\x01M\x02\xfd\xff\xff\xff\x9a\x02\xde\x05\xd1\x05\x9b\x02\xef\x055\x06L\x06r\x06\x10\x02\xfc\xff\xfd\xff\xfe\xff\xff\xff\x98\x06\xfc\xff\xfd\xff\xe3\x06\xff\xffU\x07\xf4\xff\xf5\xff\x0b\0\xf7\xffL\x02\xfa\xff\xfb\xff\xfc\xff\xfd\xff\xfe\xff\x1f\x02\xf3\x053\x07d\x01s\x01h\x01\x85\x01v\x01\x9a\x01\xab\x01\xff\xff\xad\x01\xb0\x01\xbf\x01\xb9\x01\xbb\x01\xfd\x01\xe6\x01\xe6\x01\xea\x01\xf7\x01\xed\x01\xea\x01\t\x02\x13\x02\x13\x02\x0f\x02\x15\x02\x0b\x02\x07\x02\x8e\x06\x98\x06t\x07\xaa\x07\xb4\x07\xbe\x07\xc8\x07\xd2\x07\xf8\xffx\x02\xa7\x02\xfd\xff\xff\xff\xd8\x02R\x07\xdc\x07\xec\x02\xf4\x07:\bQ\bw\bL\x02\xfc\xff\xfd\xff\xfe\xff\xff\xff\x9d\b\xfc\xff\xfd\xff\xe8\b\xff\xff\x87\x02x\x02\xfd\xffd\x02\xfe\xff\xb6\x02\xff\xff\x0b\x02\xff\xff\xcc\x02\xfc\xff\xfd\xff\xfe\xff\xff\xff.\x02\xff\xff\xb2\x02\xfc\xff\xfd\xff\xfe\xff\xff\xff\x17\0\xff\xff\xb7\x02\xfc\xff\xfd\xff\xfe\xff\xff\xff\xbb\x02\xfd\xff\xfe\xff\xff\xffy\x02\xfd\xff\xfe\xff\xff\xff\xb8\x02\xfc\xff\xfd\xff\xfe\xff\x13\0\xff\xff\x8c\x01\x92\x01\xff\xff\x96\x01\x97\x01\x9a\x01\xa8\x01\xaa\x01\xab\x01\xac\x01\xad\x01\xb5\x01\xb8\x01\xb9\x01\xbb\x01\xbf\x01\xc1\x01\xc3\x01\xc4\x01\xc5\x01\xc8\x01\xcb\x01\xdf\x01\xe1\x01\xe4\x01\xf9\x01\xfb\x01\x02\x02\x04\x02\x0b\x02\f\x02\r\x02\0\0",o3=528,o4="0.55",xQ=474,o2=109,dG="droit_ouvert",I="Champs d'applications",xP=1105,B8=4569,B9=952,B7="ENOTSOCK",o1=669,tj=995,gr=326,xO="locatif.nombre_personnes_\xc3\xa0_charge",af="ContributionsSocialesAidesPersonnelleLogement",ic="Article D832-10",J0=2614,bP="Interface du programme",sD=-97,n2=976,cn="examples/aides_logement/archives.catala_fr",JZ=469,B6=953,o0=666,iM=1461,xN=1713,rJ="Article D823-20",rK="ServicesSociauxAllocationVerseeAuxServicesSociaux",fC="d\xc3\xa9pense_nette_minimale_d832_27",m6=195,F2="218700",eP="1.",oZ=443,F0=3599,F1=1015,JY=1492,B5="EOPNOTSUPP",FZ="DecisionTaken(_)",xM="20",B4=4225,FY=1574,xL="45200",cT="d\xc3\xa9pense_nette_minimale",JX=2440588,B3=954,n1=728,JW="calcul_apl_logement_foyer.mode_occupation",rI="Titre I : Allocations aux personnes \xc3\xa2g\xc3\xa9es",JV=1202,FX=4503,JU="ECONNRESET",kg="Livre I : G\xc3\xa9n\xc3\xa9ralit\xc3\xa9s - Dispositions communes \xc3\xa0 tout ou partie des r\xc3\xa9gimes de base",ti=1189,xK="ESPIPE",FW=4210,JT=4338,sC=388,th="Article D823-17",B2="Instruction minist\xc3\xa9rielle N\xc2\xb0DSS/SD2B/2019/65 du 25 mars 2019 relative \xc3\xa0 la revalorisation au 1er avril 2019 des prestations familiales servies en m\xc3\xa9tropole",FV=1553,oY=546,m5=596,B1="E2BIG",oW=2440587.5,oX="AllocationLogement",FT="5186",FU="Unexpected '%s' kind for the enumeration 'SituationObligationScolaire.t'",xJ="accession_propri\xc3\xa9t\xc3\xa9.date_courante",B0="calcul_apl_logement_foyer.situation_familiale_calcul_apl",FS=155,xI="142303",hW=316,FQ="37778",FR=4828,xH=296,JS=2378,oV=565,oU=569,JR=799,hd="Article D832-11",FP="LaReunion",JQ=4871,sB=971,aZ="Montant du salaire minimum de croissance",JP="AgrandirOuRendreHabitableD331_63",FO=386,xF="0.3",xG="true",bk="Chapitre II : Conditions g\xc3\xa9n\xc3\xa9rales d'attribution",BZ=2672,Q="Titre II : Dispositions communes aux aides personnelles au logement",tg=426,FN=3834,sb=214,JN="25116",JO=1177,rH="Paragraphe 1 : Information et simplification des d\xc3\xa9marches des assur\xc3\xa9s.",m4=1068,sA="1500",FM=" is too large for shifting.",JM="237200",l4="Map.bal",BX="5208",BY="0.08",kf="242800",xD=2690,xE="@[",av="Titre III : Aide personnalis\xc3\xa9e au logement",JK=1485,JL="Apr\xc3\xa8s",FL=1185,ai="Code de la s\xc3\xa9curit\xc3\xa9 sociale",BV="42892",BW=4468,JJ=4498,BU=3549,FK=3308,BT=4394,n0="ml_z_overflow",xC="1.8",j7="contributions_sociales.date_courante",sa=807,r$=268,nZ=653,FJ=3808,xB="calcul_apl_logement_foyer.redevance",l3=582,xA=4899,BS=-752863768,FI=4650,r_="Article D832-17",m3=904,tf="202500",gN=705,b1=765,BR="allocationsFamiliales",JG="Article 10",JH=1181,JI="Instruction interminist\xc3\xa9rielle n\xc2\xb0DSS/2B/2021/65 du 19 mars 2021 relative \xc3\xa0 la revalorisation au 1er avril 2021 des prestations familiales servies en m\xc3\xa9tropole, en Guadeloupe, en Guyane, en Martinique, \xc3\xa0 la R\xc3\xa9union, \xc3\xa0 Saint-Barth\xc3\xa9lemy, \xc3\xa0 Saint-Martin et dans le d\xc3\xa9partement de Mayotte",j6=167,FH="582700",JF="4986",l2=888,m2=433,aj="CalculAidePersonnalis\xc3\xa9eLogementLocatif",JE=3491,sz=197,m1=531,cS="abattement_d\xc3\xa9pense_nette_minimale",hV=811,BQ="Sys_blocked_io",rG="b\xc3\xa9n\xc3\xa9ficie_titre_personnel_aide_personnelle_logement",cy="Articles valables du 1er octobre 2020 au 1er octobre 2021",FG=450,xz="0.0588",m0="Chapitre 2 : Champ d'application.",ho="Chapitre 2 : Champ d'application",xy="EXDEV",BP=3939,BO=3281,oT=457,ef=0xFF,Z="\xc3\x89ligibilit\xc3\xa9 aux aides personnelles au logement",c7="Article D842-15",cR=892,oS=1010,bu=246,ib=441,rF="37900",xx="%u",ke="Article L831-1",aK="Chapitre IV : Calcul de l'aide personnalis\xc3\xa9e au logement en secteur accession",gB="calcul_\xc3\xa9quivalence_loyer_minimale",FF="logement_foyer.zone",JD="type_pr\xc3\xaat",FD=3216,FE="EHOSTUNREACH",xw=1718,JC=405,cf="\xc3\x89ligibilit\xc3\xa9AidePersonnalis\xc3\xa9eLogement",xv="19402",JB=4010,ab="2",cu=127,xu="Article 30",FC="@{",xt=4039,b7="Montant de la base mensuelle des allocations familiales",nY=886,FB=" : flags Open_rdonly and Open_wronly are not compatible",xr=1620,xs="0.232",te="OuvertureDroitsRetraite",BN=1703,Fz="Zone2",FA="43505",oR="D\xc3\xa9cret n\xc2\xb0 2019-1387 du 18 d\xc3\xa9cembre 2019 portant rel\xc3\xa8vement du salaire minimum de croissance",cU="-",BM=950,gc=803994948,BL=3652,mZ=336,l1=603,xp="n_nombre_parts_d832_11",xq=216,Fy=" : file already exists",gb=397,xo=2291,hc="EffectiveEtPermanente",BK=1548,JA=987,xn=1499,Jy="calculAllocationLogementAccessionPropriete",Jz="41481",BJ=2041,hU="0.0045",fy="Date d'ouverture des droits \xc3\xa0 la retraite",xl=866,xm=1099,BI="retrieveEvents",Jx="accession_propri\xc3\xa9t\xc3\xa9.date_entr\xc3\xa9e_logement",Fx="ENOEXEC",BH="2699",iu=644,nX=625,xk="prestationsFamiliales",Fw="Infini",xj="\\b",nW="Article 43",l0="Martinique",BG=2903,mY=404,aM="Titre IV : Allocations de Logement",dS="Article D832-25",Fv="EPFNOSUPPORT",lZ=487,xi=12520,BF="ENOTTY",xh="ENXIO",Jv=-46,Jw="Collectivit\xc3\xa9",Js=2806,Jt="42228",Ju=401,aQ="Chapitre 1er : Allocations familiales",nV=981,cz="Quantification des impay\xc3\xa9s de d\xc3\xa9pense de logement",xg="AllocationEducationEnfantHandicape",it=2016,BE="AllocationRentr\xc3\xa9eScolaire",Fu=1408,oQ=963,dp=1000,S="CalculAllocationLogementAccessionPropri\xc3\xa9t\xc3\xa9",ac="",BD="^",td=737456202,oP="Sous-section 2 : Principes de neutralisation et d'abattement",gM=3600.,Jr=4829,lY="Section 2 : Prime de d\xc3\xa9m\xc3\xa9nagement",Jq=86400000,hT=0x3f,BC="' kind for the enumeration 'Collectivite.t'",tc="184000",xf=334,Fs="251500",Ft=758,gq="Article 16",Jp="Article D842-9",Fr="Match_failure",Jo=4499,Jn=759,xe="Bailleur",nU=716,ax=2021,xd=3848,mX="0.085",j5="CalculNombrePartLogementFoyer",fN="d\xc3\xa9pense_nette_minimale_d832_10",dF=0x00,BB="35130",jN="montant_initial_majoration",fc="+",xc=2174,Bz=4501,BA="ESRCH",kd=339,tb="Section 3 : Conditions relatives au logement",Bx=4206,By="1057",da=587,Jm=179,xb=3555,Fq=425,Jl="%li",Bw="234600",is="Smic",mW=342,Bu=4632,Bv=1608,Jk="39051",oO=3354,Fp="20900",oN="calcul_apl_logement_foyer",ta="208600",Jj=1484,Fo=373,Bt=1595,Jh=829,Ji=4465,xa=1569,rE=267,ce=431,oM=2299161,Jg="impayeDepenseLogement",Fn=801,oL=962,rD=753,Je="calcul_nombre_parts.condition_2_du_832_25",Jf="logement_foyer.redevance",Fm=0xe0,Fl="z",Bs="20100",nT=873,Fj=1126,Fk="%",Jc=4959,Jd=1523,lX=882,Bq="D331_32",eW="contributions_sociales",Br="ENAMETOOLONG",oK=2400000.5,mV=580,Bp=1138,Jb=1136,mU=526,bC=1020,dP=250,Bo="EMSGSIZE",G="Secteur logement-foyer",Fi="calcul_apl_logement_foyer.ressources_m\xc3\xa9nage_arrondies",sy=1196,rC="Article L831-2",Bn="ECONNREFUSED",L="Allocations familiales",iL=707,Ja=3898,w$=1621,mT=1034,I$=1080,Bm="locatif.ressources_m\xc3\xa9nage_arrondies",Fh="0.027",w8=3350,w9="\xc3\xa9ligibilit\xc3\xa9_commune.m\xc3\xa9nage",w_="allocations_familiales",r9=1255,e3=1170,fM=351,Bl=1686,b8="examples/allocations_familiales/securite_sociale_L.catala_fr",Fg=4494,oJ="Article 8",mS="Article R521-1",eV=0x8000,Ff=245,bI=2019,s$="jsError",dR=964,bG="Chapitre Ier : Champ d'application",I_="Section 1 : Conditions relatives au b\xc3\xa9n\xc3\xa9ficiaire",Bk="43074",Fe="6.55957",lW="Sous-section 1 : Modalit\xc3\xa9s g\xc3\xa9n\xc3\xa9rales de l'appr\xc3\xa9ciation des ressources",c9=969,Fd="eligibiliteAidePersonnaliseeLogement",oI=1174,I9=4144,Fc="InfosLocatif",e2=320,ia=129,j4=486,lV=958,dz=766,Fb="\n",fL="abattement_d\xc3\xa9pense_nette_minimale_d832_27",w7=497,aI="Chapitre II : Modalit\xc3\xa9s de liquidation et de versement de l'aide personnalis\xc3\xa9e au logement",rB="3.7",Fa=4236,h$=537,gL=483,$="Tous secteurs",Bj=3170,c6=1033,dO="calcul_plafond_mensualit\xc3\xa9_d842_6_base",mR=-48,iK=2005,I8=1692,rA="9",h_=423,E$="EBADF",Bi="1025",cx="camlinternalFormat.ml",h9=312,oH=549,sx=1729,E_="EMLINK",I7=943,oG=148,w5=2310,w6=1675,Bg=4033,Bh="132000",oF=730,rz="Article R822-25",E8="0.0185",E9="924600",oE=713,dm=2017,E7=1124,I6="date_naissance",oD=343,gK=317,lU="Article R822-2",U="CalculAidePersonnalis\xc3\xa9eLogementAccessionPropri\xc3\xa9t\xc3\xa9",ir=878,eE="Titre 1 : Champ d'application - G\xc3\xa9n\xc3\xa9ralit\xc3\xa9s",w4=1141,r8="obligation_scolaire",sw="EEXIST",sv=846,Bf=32082,nS=733,ee=121,oC=961,I5="prestations_familiales.prestation_courante",j3=1999,Be="\\n",I4="\xc3\xa9ligibilit\xc3\xa9_commune.demandeur",eC=544,nR=120,hb="16",Bd="Article D832-14",r7=512,mQ=724,Bc=3660,E6=0x7ff0,E5="eligibiliteAllocationLogement",I3=861,E4="montant_forfaitaire_charges",j2=177,bn="traitement_aide_finale_d\xc3\xa9pense_nette_minimale",Bb="Ascendant",E3="0x",I2=3853,lT="0.005",o="Calcul du montant de l'aide personnalis\xc3\xa9e au logement",ga=484,w3=797,nQ="D\xc3\xa9cret n\xc2\xb0 2020-1598 du 16 d\xc3\xa9cembre 2020 portant rel\xc3\xa8vement du salaire minimum de croissance",E2="locatif.situation_familiale_calcul_apl",oB=645,I1="40888",w2="0.208",E1="bas",E0="210900",I0="219900",w0="r\xc3\xa9gime_outre_mer_l751_1",w1="Invalid function call ([ ",a7="traitement_aide_finale",ed=105,wZ="Instruction interminist\xc3\xa9rielle n\xc2\xb0 DSS/SD2B/2018/279 du 17 d\xc3\xa9cembre 2018 relative \xc3\xa0 la revalorisation au 1er janvier 2019 des plafonds de ressources d\xe2\x80\x99attribution de certaines prestations familiales servies en m\xc3\xa9tropole, en Guadeloupe, en Guyane, en Martinique, \xc3\xa0 la R\xc3\xa9union, \xc3\xa0 Saint-Barth\xc3\xa9lemy, \xc3\xa0 Saint-Martin et \xc3\xa0 Mayotte",nP="Article R512-2",Ba="31664",EZ=1135,wY=820,EY="44693",ry="2710",nO="0.45",IZ=1914,cW=429,A_="Unexpected '%s' kind for the enumeration 'PriseEnCharge.t'",A$="str.ml",s_=158,P="input",wW=4903,wX="39839",A9="\xc3\xa9ligibilit\xc3\xa9_logement",su="0.2",lS="D\xc3\xa9cret n\xc2\xb0 2018-1173 du 19 d\xc3\xa9cembre 2018 portant rel\xc3\xa8vement du salaire minimum de croissance",EX=4346,cd=390,IY=498,f$="examples/aides_logement/autres_sources.catala_fr",A8=2627,mP=283,IX="Allocation de solidarit\xc3\xa9 aux personnes \xc3\xa2g\xc3\xa9es",wV="calculAllocationLogement",EW=3554,IW=4004,st="mkdir",ha="Article L822-3",wU="logement_foyer.situation_familiale_calcul_apl",aa="Chapitre III : Modalit\xc3\xa9s de liquidation et de versement",A7=1013,EV=825,oA=": No such file or directory",rx=266,iq=655,gJ="Chapitre VII : Calcul des allocations de logement en secteur logement-foyer",hs="Titre 5 : D\xc3\xa9partements d'outre-mer",wT=948,f_="src/printer.ml",EU="766",cP="CalculetteAidesAuLogementGardeAltern\xc3\xa9e",wS="locatif.colocation",A6="calculetteAidesAuLogement",r6="Section 1 : Ouverture du droit et liquidation de l'allocation de solidarit\xc3\xa9 aux personnes \xc3\xa2g\xc3\xa9es",cZ=151,ET=1137,IU="Descendant",IV=2334,b2="\xc3\x89ligibilit\xc3\xa9AllocationLogement",bh="D\xc3\xa9cret n\xc2\xb02002-423 du 29 mars 2002 relatif aux prestations familiales \xc3\xa0 Mayotte",mN=600,mO=626,IT="\xc3\xa9ligibilit\xc3\xa9_apl",rw="Demandeur",A5=1097,ES="taux",wR=1587,cb="CalculAllocationLogementLocatif",A4="BeginCall([ ",wQ=868,ER=0xFE,IS="ENOPROTOOPT",dW=329,wP=3988,A3=3840,kc="caract\xc3\xa9ristiques_pr\xc3\xaat_l831_1_1",A2="GardeAltern\xc3\xa9ePartageAllocations",bq="\xc3\x89pilogue",A1="943900",Y="CalculAllocationLogementFoyer",A0="bmaf",lR=1166,IQ="calculEquivalenceLoyerMinimale",IR=867,wO=472,AZ="contributionsSocialesAidesPersonnelleLogement",nN=2006,ip="0.95",IP="ressourcesAidesPersonnelleLogement",rv=363,wM="Pervasives.do_at_exit",wN="utf8",AY="222300",EQ=863,ru="ComplementFamilial",IO="225000",AX="locatif.logement_est_chambre",lQ=529,wL=4546,IN=1697,wJ="\xc3\xa9ligibilit\xc3\xa9_allocation_logement",wK="EISDIR",IM="0.0283",IL=854,EP="logement_foyer.date_courante",s9="0.16",wI=4158,bb="Article 18",AW="36815",nM=643,IK="accession_propri\xc3\xa9t\xc3\xa9.situation_familiale_calcul_apl",oz=134,mM=1167,oy=387,eD="Section 2 : Conditions relatives aux ressources",aF="\xc3\x89ligibilit\xc3\xa9 aux allocations de logement";function +bNN(d,b,e,c,f){if(c<=b)for(var a=1;a<=f;a++)e[c+a]=d[b+a];else for(var a=f;a>=1;a--)e[c+a]=d[b+a];return 0}function -NS(e,f,d){var +bNO(b,d,c,e){for(var +a=0;a=b.l||b.t==2&&c>=b.c.length)){b.c=d.t==4?gu(d.c,e,c):e==0&&d.c.length==c?d.c:d.c.substr(e,c);b.t=b.c.length==b.l?0:2}else -if(b.t==2&&f==b.c.length){b.c+=d.t==4?gu(d.c,e,c):e==0&&d.c.length==c?d.c:d.c.substr(e,c);b.t=b.c.length==b.l?0:2}else{if(b.t!=4)gi(b);var +gW(d,e,b,f,c){if(c==0)return 0;if(f==0&&(c>=b.l||b.t==2&&c>=b.c.length)){b.c=d.t==4?p1(d.c,e,c):e==0&&d.c.length==c?d.c:d.c.substr(e,c);b.t=b.c.length==b.l?0:2}else +if(b.t==2&&f==b.c.length){b.c+=d.t==4?p1(d.c,e,c):e==0&&d.c.length==c?d.c:d.c.substr(e,c);b.t=b.c.length==b.l?0:2}else{if(b.t!=4)pP(b);var g=d.c,h=b.c;if(d.t==4)if(f<=e)for(var a=0;a=0;a--)h[f+a]=g[e+a];else{var i=Math.min(c,g.length-e);for(var a=0;a>=1;if(b==0)return d;a+=a;c++;if(c==9)a.slice(0,1)}}function -c2(a){if(a.t==2)a.c+=dK(a.l-a.c.length,"\0");else -a.c=gu(a.c,0,a.c.length);a.t=0}function -oH(a,b){if(a===b)return 1;a.t&6&&c2(a);b.t&6&&c2(b);return a.c==b.c?1:0}function -Oz(b,a){throw[0,b,a]}function -o5(a){if(a.length<24){for(var -b=0;bbz)return false;return true}else +eG(a){return a}function +eF(a,b,c,d,e){gW(eG(a),b,c,d,e);return 0}function +i$(b,a){if(b==0)return ac;if(a.repeat)return a.repeat(b);var +d=ac,c=0;for(;;){if(b&1)d+=a;b>>=1;if(b==0)return d;a+=a;c++;if(c==9)a.slice(0,1)}}function +ht(a){if(a.t==2)a.c+=i$(a.l-a.c.length,"\0");else +a.c=p1(a.c,0,a.c.length);a.t=0}function +MI(a,b){if(a===b)return 1;a.t&6&&ht(a);b.t&6&&ht(b);return a.c==b.c?1:0}function +bOv(b,a){throw[0,b,a]}function +M6(a){if(a.length<24){for(var +b=0;bcu)return false;return true}else return!/[^\x00-\x7f]/.test(a)}function -iH(e){for(var -j=l,c=l,g,f,h,a,b=0,i=e.length;bhE){c.substr(0,1);j+=c;c=l;j+=e.slice(b,d)}else -c+=e.slice(b,d);if(d==i)break;b=d}a=1;if(++b=0xd7ff&&a<0xe000)a=2}else{a=3;if(++b0x10ffff)a=3}}}}}if(a<4){b-=a;c+="\ufffd"}else -if(a>bR)c+=String.fromCharCode(0xd7c0+(a>>10),m2+(a&0x3FF));else -c+=String.fromCharCode(a);if(c.length>eq){c.substr(0,1);j+=c;c=l}}return j+c}function -b0(c,a,b){this.t=c;this.c=a;this.l=b}b0.prototype.toString=function(){switch(this.t){case -9:return this.c;default:c2(this);case -0:if(o5(this.c)){this.t=9;return this.c}this.t=8;case -8:return this.c}};b0.prototype.toUtf16=function(){var -a=this.toString();if(this.t==9)return a;return iH(a)};b0.prototype.slice=function(){var +tV(e){for(var +j=ac,c=ac,g,f,h,a,b=0,i=e.length;br7){c.substr(0,1);j+=c;c=ac;j+=e.slice(b,d)}else +c+=e.slice(b,d);if(d==i)break;b=d}a=1;if(++b=0xd7ff&&a<0xe000)a=2}else{a=3;if(++b0x10ffff)a=3}}}}}if(a<4){b-=a;c+="\ufffd"}else +if(a>eQ)c+=String.fromCharCode(0xd7c0+(a>>10),Hc+(a&0x3FF));else +c+=String.fromCharCode(a);if(c.length>kq){c.substr(0,1);j+=c;c=ac}}return j+c}function +fg(c,a,b){this.t=c;this.c=a;this.l=b}fg.prototype.toString=function(){switch(this.t){case +9:return this.c;default:ht(this);case +0:if(M6(this.c)){this.t=9;return this.c}this.t=8;case +8:return this.c}};fg.prototype.toUtf16=function(){var +a=this.toString();if(this.t==9)return a;return tV(a)};fg.prototype.slice=function(){var a=this.t==4?this.c.slice():this.c;return new -b0(this.t,a,this.l)};function -oI(a){return new -b0(0,a,a.length)}function -a(a){return oI(a)}function -iF(c,b){Oz(c,a(b))}var -ag=[0];function -ah(a){iF(ag.Invalid_argument,a)}function -oF(){ah(hY)}function -eD(a,b){switch(a.t&6){default:if(b>=a.c.length)return 0;case +fg(this.t,a,this.l)};function +MJ(a){return new +fg(0,a,a.length)}function +a(a){return MJ(a)}function +tT(c,b){bOv(c,a(b))}var +bW=[0];function +b4(a){tT(bW.Invalid_argument,a)}function +MG(){b4(tq)}function +kM(a,b){switch(a.t&6){default:if(b>=a.c.length)return 0;case 0:return a.c.charCodeAt(b);case 4:return a.c[b]}}function -cM(b,a){if(a>>>0>=b.l)oF();return eD(b,a)}function -ao(a,c,b){b&=a4;if(a.t!=4){if(c==a.c.length){a.c+=String.fromCharCode(b);if(c+1==a.l)a.t=0;return 0}gi(a)}a.c[c]=b;return 0}function -bv(b,a,c){if(a>>>0>=b.l)oF();return ao(b,a,c)}function -bE(c,a){if(c.fun)return bE(c.fun,a);if(typeof +gX(b,a){if(a>>>0>=b.l)MG();return kM(b,a)}function +b$(a,c,b){b&=di;if(a.t!=4){if(c==a.c.length){a.c+=String.fromCharCode(b);if(c+1==a.l)a.t=0;return 0}pP(a)}a.c[c]=b;return 0}function +c1(b,a,c){if(a>>>0>=b.l)MG();return b$(b,a,c)}function +en(c,a){if(c.fun)return en(c.fun,a);if(typeof c!=="function")return c;var b=c.length|0;if(b===0)return c.apply(null,a);var e=a.length|0,d=b-e|0;if(d==0)return c.apply(null,a);else -if(d<0)return bE(c.apply(null,a.slice(0,b)),a.slice(b));else +if(d<0)return en(c.apply(null,a.slice(0,b)),a.slice(b));else return function(){var e=arguments.length==0?1:arguments.length,d=new Array(a.length+e);for(var b=0;b>>0>=a.length-1)eC();return a}function -io(a){if(isFinite(a)){if(Math.abs(a)>=2.2250738585072014e-308)return 0;if(a!=0)return 1;return 2}return isNaN(a)?4:3}function -a5(a){a.t&6&&c2(a);return a.c}var -OP=Math.log2&&Math.log2(1.1235582092889474E+307)==1020;function -ON(a){if(OP)return Math.floor(Math.log2(a));var +b=0;b>>0>=a.length-1)kL();return a}function +pO(a){if(isFinite(a)){if(Math.abs(a)>=2.2250738585072014e-308)return 0;if(a!=0)return 1;return 2}return isNaN(a)?4:3}function +dq(a){a.t&6&&ht(a);return a.c}var +bOK=Math.log2&&Math.log2(1.1235582092889474E+307)==bC;function +M5(a){if(bOK)return Math.floor(Math.log2(a));var b=0;if(a==0)return-Infinity;if(a>=1)while(a>=2){a/=2;b++}else while(a<1){a*=2;b--}return b}function -iw(c){var -a=new(C.Float32Array)(1);a[0]=c;var -b=new(C.Int32Array)(a.buffer);return b[0]|0}var -oR=Math.pow(2,-24);function -gr(a){throw a}function -dJ(){gr(ag.Division_by_zero)}function -G(b,c,a){this.lo=b&cg;this.mi=c&cg;this.hi=a&bR}G.prototype.caml_custom="_j";G.prototype.copy=function(){return new -G(this.lo,this.mi,this.hi)};G.prototype.ucompare=function(a){if(this.hi>a.hi)return 1;if(this.hia.mi)return 1;if(this.mia.lo)return 1;if(this.loc)return 1;if(ba.mi)return 1;if(this.mia.lo)return 1;if(this.loa.hi)return 1;if(this.hia.mi)return 1;if(this.mia.lo)return 1;if(this.loc)return 1;if(ba.mi)return 1;if(this.mia.lo)return 1;if(this.lo>24),c=-this.hi+(b>>24);return new -G(a,b,c)};G.prototype.add=function(a){var +a0(a,b,c)};a0.prototype.add=function(a){var b=this.lo+a.lo,c=this.mi+a.mi+(b>>24),d=this.hi+a.hi+(c>>24);return new -G(b,c,d)};G.prototype.sub=function(a){var +a0(b,c,d)};a0.prototype.sub=function(a){var b=this.lo-a.lo,c=this.mi-a.mi+(b>>24),d=this.hi-a.hi+(c>>24);return new -G(b,c,d)};G.prototype.mul=function(a){var -b=this.lo*a.lo,c=(b*oR|0)+this.mi*a.lo+this.lo*a.mi,d=(c*oR|0)+this.hi*a.lo+this.mi*a.mi+this.lo*a.hi;return new -G(b,c,d)};G.prototype.isZero=function(){return(this.lo|this.mi|this.hi)==0};G.prototype.isNeg=function(){return this.hi<<16<0};G.prototype.and=function(a){return new -G(this.lo&a.lo,this.mi&a.mi,this.hi&a.hi)};G.prototype.or=function(a){return new -G(this.lo|a.lo,this.mi|a.mi,this.hi|a.hi)};G.prototype.xor=function(a){return new -G(this.lo^a.lo,this.mi^a.mi,this.hi^a.hi)};G.prototype.shift_left=function(a){a=a&63;if(a==0)return this;if(a<24)return new -G(this.lo<>24-a,this.hi<>24-a);if(a<48)return new -G(0,this.lo<>48-a);return new -G(0,0,this.lo<>a|this.mi<<24-a,this.mi>>a|this.hi<<24-a,this.hi>>a);if(a<48)return new -G(this.mi>>a-24|this.hi<<48-a,this.hi>>a-24,0);return new -G(this.hi>>a-48,0,0)};G.prototype.shift_right=function(a){a=a&63;if(a==0)return this;var +a0(b,c,d)};a0.prototype.mul=function(a){var +b=this.lo*a.lo,c=(b*MS|0)+this.mi*a.lo+this.lo*a.mi,d=(c*MS|0)+this.hi*a.lo+this.mi*a.mi+this.lo*a.hi;return new +a0(b,c,d)};a0.prototype.isZero=function(){return(this.lo|this.mi|this.hi)==0};a0.prototype.isNeg=function(){return this.hi<<16<0};a0.prototype.and=function(a){return new +a0(this.lo&a.lo,this.mi&a.mi,this.hi&a.hi)};a0.prototype.or=function(a){return new +a0(this.lo|a.lo,this.mi|a.mi,this.hi|a.hi)};a0.prototype.xor=function(a){return new +a0(this.lo^a.lo,this.mi^a.mi,this.hi^a.hi)};a0.prototype.shift_left=function(a){a=a&63;if(a==0)return this;if(a<24)return new +a0(this.lo<>24-a,this.hi<>24-a);if(a<48)return new +a0(0,this.lo<>48-a);return new +a0(0,0,this.lo<>a|this.mi<<24-a,this.mi>>a|this.hi<<24-a,this.hi>>a);if(a<48)return new +a0(this.mi>>a-24|this.hi<<48-a,this.hi>>a-24,0);return new +a0(this.hi>>a-48,0,0)};a0.prototype.shift_right=function(a){a=a&63;if(a==0)return this;var c=this.hi<<16>>16;if(a<24)return new -G(this.lo>>a|this.mi<<24-a,this.mi>>a|c<<24-a,this.hi<<16>>a>>>16);var +a0(this.lo>>a|this.mi<<24-a,this.mi>>a|c<<24-a,this.hi<<16>>a>>>16);var b=this.hi<<16>>31;if(a<48)return new -G(this.mi>>a-24|this.hi<<48-a,this.hi<<16>>a-24>>16,b&bR);return new -G(this.hi<<16>>a-32,b,b)};G.prototype.lsl1=function(){this.hi=this.hi<<1|this.mi>>23;this.mi=(this.mi<<1|this.lo>>23)&cg;this.lo=this.lo<<1&cg};G.prototype.lsr1=function(){this.lo=(this.lo>>>1|this.mi<<23)&cg;this.mi=(this.mi>>>1|this.hi<<23)&cg;this.hi=this.hi>>>1};G.prototype.udivmod=function(e){var +a0(this.mi>>a-24|this.hi<<48-a,this.hi<<16>>a-24>>16,b&eQ);return new +a0(this.hi<<16>>a-32,b,b)};a0.prototype.lsl1=function(){this.hi=this.hi<<1|this.mi>>23;this.mi=(this.mi<<1|this.lo>>23)&fJ;this.lo=this.lo<<1&fJ};a0.prototype.lsr1=function(){this.lo=(this.lo>>>1|this.mi<<23)&fJ;this.mi=(this.mi>>>1|this.hi<<23)&fJ;this.hi=this.hi>>>1};a0.prototype.udivmod=function(e){var c=0,b=this.copy(),a=e.copy(),d=new -G(0,0,0);while(b.ucompare(a)>0){c++;a.lsl1()}while(c>=0){c--;d.lsl1();if(b.ucompare(a)>=0){d.lo++;b=b.sub(a)}a.lsr1()}return{quotient:d,modulus:b}};G.prototype.div=function(a){var -b=this;if(a.isZero())dJ();var -d=b.hi^a.hi;if(b.hi&bM)b=b.neg();if(a.hi&bM)a=a.neg();var -c=b.udivmod(a).quotient;if(d&bM)c=c.neg();return c};G.prototype.mod=function(b){var -a=this;if(b.isZero())dJ();var -d=a.hi;if(a.hi&bM)a=a.neg();if(b.hi&bM)b=b.neg();var -c=a.udivmod(b).modulus;if(d&bM)c=c.neg();return c};G.prototype.toInt=function(){return this.lo|this.mi<<24};G.prototype.toFloat=function(){return(this.hi<<16)*Math.pow(2,32)+this.mi*Math.pow(2,24)+this.lo};G.prototype.toArray=function(){return[this.hi>>8,this.hi&a4,this.mi>>16,this.mi>>8&a4,this.mi&a4,this.lo>>16,this.lo>>8&a4,this.lo&a4]};G.prototype.lo32=function(){return this.lo|(this.mi&a4)<<24};G.prototype.hi32=function(){return this.mi>>>8&bR|this.hi<<16};function -cN(b,c,a){return new -G(b,c,a)}function -gl(a){if(!isFinite(a)){if(isNaN(a))return cN(1,0,kS);return a>0?cN(0,0,kS):cN(0,0,0xfff0)}var -f=a==0&&1/a==-Infinity?bM:a>=0?0:bM;if(f)a=-a;var -b=ON(a)+bY;if(b<=0){b=0;a/=Math.pow(2,-nE)}else{a/=Math.pow(2,b-oo);if(a<16){a*=2;b-=1}if(b==0)a/=2}var +a0(0,0,0);while(b.ucompare(a)>0){c++;a.lsl1()}while(c>=0){c--;d.lsl1();if(b.ucompare(a)>=0){d.lo++;b=b.sub(a)}a.lsr1()}return{quotient:d,modulus:b}};a0.prototype.div=function(a){var +b=this;if(a.isZero())i_();var +d=b.hi^a.hi;if(b.hi&eV)b=b.neg();if(a.hi&eV)a=a.neg();var +c=b.udivmod(a).quotient;if(d&eV)c=c.neg();return c};a0.prototype.mod=function(b){var +a=this;if(b.isZero())i_();var +d=a.hi;if(a.hi&eV)a=a.neg();if(b.hi&eV)b=b.neg();var +c=a.udivmod(b).modulus;if(d&eV)c=c.neg();return c};a0.prototype.toInt=function(){return this.lo|this.mi<<24};a0.prototype.toFloat=function(){return(this.hi<<16)*Math.pow(2,32)+this.mi*Math.pow(2,24)+this.lo};a0.prototype.toArray=function(){return[this.hi>>8,this.hi&di,this.mi>>16,this.mi>>8&di,this.mi&di,this.lo>>16,this.lo>>8&di,this.lo&di]};a0.prototype.lo32=function(){return this.lo|(this.mi&di)<<24};a0.prototype.hi32=function(){return this.mi>>>8&eQ|this.hi<<16};function +gY(b,c,a){return new +a0(b,c,a)}function +pT(a){if(!isFinite(a)){if(isNaN(a))return gY(1,0,E6);return a>0?gY(0,0,E6):gY(0,0,0xfff0)}var +f=a==0&&1/a==-Infinity?eV:a>=0?0:eV;if(f)a=-a;var +b=M5(a)+ew;if(b<=0){b=0;a/=Math.pow(2,-h4)}else{a/=Math.pow(2,b-Mv);if(a<16){a*=2;b-=1}if(b==0)a/=2}var d=Math.pow(2,24),c=a|0;a=(a-c)*d;var e=a|0;a=(a-e)*d;var -g=a|0;c=c&hQ|f|b<<4;return cN(g,e,c)}function -eG(a){return a.toArray()}function -oE(c,b,g){c.write(32,b.dims.length);c.write(32,b.kind|b.layout<<8);if(b.caml_custom==fU)for(var -a=0;a>4;if(c==2047)return(f|g|b&hQ)==0?b&bM?-Infinity:Infinity:NaN;var -e=Math.pow(2,-24),a=(f*e+g)*e+(b&hQ);if(c>0){a+=16;a*=Math.pow(2,c-oo)}else -a*=Math.pow(2,-nE);if(b&bM)a=-a;return a}function -im(b){var +a(e*MD(c));return d}function +tN(c){var +a=new(aO.Int32Array)(1);a[0]=c;var +b=new(aO.Float32Array)(a.buffer);return b[0]}function +kP(a){return new +a0(a[7]<<0|a[6]<<8|a[5]<<16,a[4]<<0|a[3]<<8|a[2]<<16,a[1]<<0|a[0]<<8)}function +i9(d){var +f=d.lo,g=d.mi,b=d.hi,c=(b&0x7fff)>>4;if(c==2047)return(f|g|b&tl)==0?b&eV?-Infinity:Infinity:NaN;var +e=Math.pow(2,-24),a=(f*e+g)*e+(b&tl);if(c>0){a+=16;a*=Math.pow(2,c-Mv)}else +a*=Math.pow(2,-h4);if(b&eV)a=-a;return a}function +tF(b){var d=b.length,c=1;for(var -a=0;a>>24&a4|(a&bR)<<8,a>>>16&bR)}function -iy(a){return a.hi32()}function -iz(a){return a.lo32()}var -NU=fU;function -cK(c,d,b,a){this.kind=c;this.layout=d;this.dims=b;this.data=a}cK.prototype.caml_custom=NU;cK.prototype.offset=function(b){var +a=0;a>>24&di|(a&eQ)<<8,a>>>16&eQ)}function +tO(a){return a.hi32()}function +tP(a){return a.lo32()}var +bNR=pb;function +gV(c,d,b,a){this.kind=c;this.layout=d;this.dims=b;this.data=a}gV.prototype.caml_custom=bNR;gV.prototype.offset=function(b){var c=0;if(typeof b==="number")b=[b];if(!(b instanceof -Array))ah("bigarray.js: invalid offset");if(this.dims.length!=b.length)ah("Bigarray.get/set: bad number of dimensions");if(this.layout==0)for(var -a=0;a=this.dims[a])eC();c=c*this.dims[a]+b[a]}else +Array))b4("bigarray.js: invalid offset");if(this.dims.length!=b.length)b4("Bigarray.get/set: bad number of dimensions");if(this.layout==0)for(var +a=0;a=this.dims[a])kL();c=c*this.dims[a]+b[a]}else for(var -a=this.dims.length-1;a>=0;a--){if(b[a]<1||b[a]>this.dims[a])eC();c=c*this.dims[a]+(b[a]-1)}return c};cK.prototype.get=function(a){switch(this.kind){case +a=this.dims.length-1;a>=0;a--){if(b[a]<1||b[a]>this.dims[a])kL();c=c*this.dims[a]+(b[a]-1)}return c};gV.prototype.get=function(a){switch(this.kind){case 7:var -d=this.data[a*2+0],b=this.data[a*2+1];return oQ(d,b);case +d=this.data[a*2+0],b=this.data[a*2+1];return MR(d,b);case 10:case 11:var -e=this.data[a*2+0],c=this.data[a*2+1];return[ei,e,c];default:return this.data[a]}};cK.prototype.set=function(a,b){switch(this.kind){case -7:this.data[a*2+0]=iz(b);this.data[a*2+1]=iy(b);break;case +e=this.data[a*2+0],c=this.data[a*2+1];return[ki,e,c];default:return this.data[a]}};gV.prototype.set=function(a,b){switch(this.kind){case +7:this.data[a*2+0]=tP(b);this.data[a*2+1]=tO(b);break;case 10:case -11:this.data[a*2+0]=b[1];this.data[a*2+1]=b[2];break;default:this.data[a]=b;break}return 0};cK.prototype.fill=function(b){switch(this.kind){case +11:this.data[a*2+0]=b[1];this.data[a*2+1]=b[2];break;default:this.data[a]=b;break}return 0};gV.prototype.fill=function(b){switch(this.kind){case 7:var -c=iz(b),e=iy(b);if(c==e)this.data.fill(c);else +c=tP(b),e=tO(b);if(c==e)this.data.fill(c);else for(var a=0;ab.data[a])return 1}break}return 0};function -dE(c,d,b,a){this.kind=c;this.layout=d;this.dims=b;this.data=a}dE.prototype=new -cK();dE.prototype.offset=function(a){if(typeof +i7(c,d,b,a){this.kind=c;this.layout=d;this.dims=b;this.data=a}i7.prototype=new +gV();i7.prototype.offset=function(a){if(typeof a!=="number")if(a instanceof Array&&a.length==1)a=a[0];else -ah("Ml_Bigarray_c_1_1.offset");if(a<0||a>=this.dims[0])eC();return a};dE.prototype.get=function(a){return this.data[a]};dE.prototype.set=function(a,b){this.data[a]=b;return 0};dE.prototype.fill=function(a){this.data.fill(a);return 0};function -oA(c,d,a,b){var -e=oC(c);if(im(a)*e!=b.length)ah("length doesn't match dims");if(d==0&&a.length==1&&e==1)return new -dE(c,d,a,b);return new -cK(c,d,a,b)}function -bd(b){if(!ag.Failure)ag.Failure=[Q,a(h4),-3];iF(ag.Failure,b)}function -oB(b,v,r){var -i=b.read32s();if(i<0||i>16)bd("input_value: wrong number of bigarray dimensions");var -p=b.read32s(),j=p&a4,o=p>>8&1,h=[];if(r==fU)for(var +b4("Ml_Bigarray_c_1_1.offset");if(a<0||a>=this.dims[0])kL();return a};i7.prototype.get=function(a){return this.data[a]};i7.prototype.set=function(a,b){this.data[a]=b;return 0};i7.prototype.fill=function(a){this.data.fill(a);return 0};function +MB(c,d,a,b){var +e=MD(c);if(tF(a)*e!=b.length)b4("length doesn't match dims");if(d==0&&a.length==1&&e==1)return new +i7(c,d,a,b);return new +gV(c,d,a,b)}function +dI(b){if(!bW.Failure)bW.Failure=[bl,a(sO),-3];tT(bW.Failure,b)}function +MC(b,v,r){var +i=b.read32s();if(i<0||i>16)dI("input_value: wrong number of bigarray dimensions");var +p=b.read32s(),j=p&di,o=p>>8&1,h=[];if(r==pb)for(var a=0;a>>32-15;a=bi(a,0x1b873593);b^=a;b=b<<13|b>>>32-13;return(b+(b<<2)|0)+(0xe6546b64|0)|0}function -N6(a,b){a=aH(a,iz(b));a=aH(a,iy(b));return a}function -iu(a,b){return N6(a,gl(b))}function -oD(c){var -b=im(c.dims),d=0;switch(c.kind){case +l=i9(kP(e));g.set(a,[ki,m,l])}break}v[0]=(4+i)*4;return MB(j,o,h,f)}function +MA(a,b,c){return a.compare(b,c)}function +dZ(a,b){return Math.imul(a,b)}function +cL(b,a){a=dZ(a,0xcc9e2d51|0);a=a<<15|a>>>32-15;a=dZ(a,0x1b873593);b^=a;b=b<<13|b>>>32-13;return(b+(b<<2)|0)+(0xe6546b64|0)|0}function +bN4(a,b){a=cL(a,tP(b));a=cL(a,tO(b));return a}function +tK(a,b){return bN4(a,pT(b))}function +ME(c){var +b=tF(c.dims),d=0;switch(c.kind){case 2:case 3:case -12:if(b>bW)b=bW;var -e=0,a=0;for(a=0;a+4<=c.data.length;a+=4){e=c.data[a+0]|c.data[a+1]<<8|c.data[a+2]<<16|c.data[a+3]<<24;d=aH(d,e)}e=0;switch(b&3){case +12:if(b>dC)b=dC;var +e=0,a=0;for(a=0;a+4<=c.data.length;a+=4){e=c.data[a+0]|c.data[a+1]<<8|c.data[a+2]<<16|c.data[a+3]<<24;d=cL(d,e)}e=0;switch(b&3){case 3:e=c.data[a+2]<<16;case 2:e|=c.data[a+1]<<8;case -1:e|=c.data[a+0];d=aH(d,e)}break;case +1:e|=c.data[a+0];d=cL(d,e)}break;case 4:case -5:if(b>bB)b=bB;var -e=0,a=0;for(a=0;a+2<=c.data.length;a+=2){e=c.data[a+0]|c.data[a+1]<<16;d=aH(d,e)}if((b&1)!=0)d=aH(d,c.data[a]);break;case +5:if(b>cH)b=cH;var +e=0,a=0;for(a=0;a+2<=c.data.length;a+=2){e=c.data[a+0]|c.data[a+1]<<16;d=cL(d,e)}if((b&1)!=0)d=cL(d,c.data[a]);break;case 6:if(b>64)b=64;for(var -a=0;a64)b=64;for(var -a=0;a32)b=32;b*=2;for(var -a=0;a64)b=64;for(var -a=0;a32)b=32;for(var -a=0;a0?b(c,f,e):b(f,c,e);if(e&&a!=a)return d;if(+a!=+a)return+a;if((a|0)!=0)return a|0}return d}function -eH(a){return a +kT(a){return a instanceof -b0}function -go(a){return eH(a)}function -oL(a){if(typeof -a==="number")return a2;else -if(eH(a))return fO;else -if(go(a))return 1252;else +fg}function +pV(a){return kT(a)}function +MM(a){if(typeof +a==="number")return dp;else +if(kT(a))return ma;else +if(pV(a))return 1252;else if(a instanceof -Array&&a[0]===a[0]>>>0&&a[0]<=dz){var -b=a[0]|0;return b==ei?0:b}else +Array&&a[0]===a[0]>>>0&&a[0]<=iA){var +b=a[0]|0;return b==ki?0:b}else if(a instanceof -String)return lg;else +String)return xi;else if(typeof -a=="string")return lg;else +a=="string")return xi;else if(a instanceof -Number)return a2;else -if(a&&a.caml_custom)return hI;else +Number)return dp;else +if(a&&a.caml_custom)return r9;else if(a&&a.compare)return 1256;else if(typeof a=="function")return 1247;else if(typeof a=="symbol")return 1251;return 1001}function -gn(a,b){if(ab.c?1:0}function -gt(a,b){return oG(a,b)}function -dF(a,b,d){var +kR(a,b){if(ab.c?1:0}function +p0(a,b){return MH(a,b)}function +kN(a,b,d){var e=[];for(;;){if(!(d&&a===b)){var -f=oL(a);if(f==bg){a=a[1];continue}var -g=oL(b);if(g==bg){b=b[1];continue}if(f!==g){if(f==a2){if(g==hI)return oK(a,b,-1,d);return-1}if(g==a2){if(f==hI)return oK(b,a,1,d);return 1}return fb)return 1;if(a!=b){if(!d)return NaN;if(a==a)return 1;if(b==b)return-1}break;case 1251:if(a!==b){if(!d)return NaN;return 1}break;case 1252:var -a=a5(a),b=a5(b);if(a!==b){if(ab)return 1}break;case +a=dq(a),b=dq(b);if(a!==b){if(ab)return 1}break;case 12520:var a=a.toString(),b=b.toString();if(a!==b){if(ab)return 1}break;case 246:case 254:default:if(a.length!=b.length)return a.length1)e.push(a,b,1);break}}if(e.length==0)return 0;var h=e.pop();b=e.pop();a=e.pop();if(h+10)if(c==0&&(b>=a.l||a.t==2&&b>=a.c.length))if(d==0){a.c=l;a.t=2}else{a.c=dK(b,String.fromCharCode(d));a.t=b==a.l?0:2}else{if(a.t!=4)gi(a);for(b+=c;c0&&b===b)return b;a=a.replace(/_/g,l);b=+a;if(a.length>0&&b===b||/^[+-]?nan$/i.test(a))return b;var +MK(a,b){return kN(a,b,true)}function +bNU(){return[0]}function +bR(a){if(a<0)b4("Bytes.create");return new +fg(a?2:9,ac,a)}function +pQ(b,a){if(a==0)i_();return b/a|0}function +g(a,b){return+(kN(a,b,false)==0)}function +bNW(a,c,b,d){if(b>0)if(c==0&&(b>=a.l||a.t==2&&b>=a.c.length))if(d==0){a.c=ac;a.t=2}else{a.c=i$(b,String.fromCharCode(d));a.t=b==a.l?0:2}else{if(a.t!=4)pP(a);for(b+=c;c0&&b===b)return b;a=a.replace(/_/g,ac);b=+a;if(a.length>0&&b===b||/^[+-]?nan$/i.test(a))return b;var c=/^ *([+-]?)0x([0-9a-f]+)\.?([0-9a-f]*)(p([+-]?[0-9]+))?/i.exec(a);if(c){var -d=c[3].replace(/0+$/,l),f=parseInt(c[1]+c[2]+d,16),e=(c[5]|0)-4*d.length;b=f*Math.pow(2,e);return b}if(/^\+?inf(inity)?$/i.test(a))return Infinity;if(/^-inf(inity)?$/i.test(a))return-Infinity;bd("float_of_string")}function -iE(d){d=a5(d);var -e=d.length;if(e>31)ah("format_int: format too long");var -a={justify:bN,signstyle:aL,filler:cc,alternate:false,base:0,signedconv:false,width:0,uppercase:false,sign:1,prec:-1,conv:"f"};for(var +d=c[3].replace(/0+$/,ac),f=parseInt(c[1]+c[2]+d,16),e=(c[5]|0)-4*d.length;b=f*Math.pow(2,e);return b}if(/^\+?inf(inity)?$/i.test(a))return Infinity;if(/^-inf(inity)?$/i.test(a))return-Infinity;dI("float_of_string")}function +tS(d){d=dq(d);var +e=d.length;if(e>31)b4("format_int: format too long");var +a={justify:fc,signstyle:cU,filler:fP,alternate:false,base:0,signedconv:false,width:0,uppercase:false,sign:1,prec:-1,conv:"f"};for(var c=0;c=0&&b<=9){a.width=a.width*10+b;c++}c--;break;case".":a.prec=0;c++;while(b=d.charCodeAt(c)-48,b>=0&&b<=9){a.prec=a.prec*10+b;c++}c--;case"d":case"i":a.signedconv=true;case"u":a.base=10;break;case"x":a.base=16;break;case"X":a.base=16;a.uppercase=true;break;case"o":a.base=8;break;case"e":case"f":case"g":a.signedconv=true;a.conv=b;break;case"E":case"F":case"G":a.signedconv=true;a.uppercase=true;a.conv=b.toLowerCase();break}}return a}function -ir(b,f){if(b.uppercase)f=f.toUpperCase();var -e=f.length;if(b.signedconv&&(b.sign<0||b.signstyle!=aL))e++;if(b.alternate){if(b.base==8)e+=1;if(b.base==16)e+=2}var -c=l;if(b.justify==bN&&b.filler==cc)for(var -d=e;d=0&&b<=9){a.width=a.width*10+b;c++}c--;break;case".":a.prec=0;c++;while(b=d.charCodeAt(c)-48,b>=0&&b<=9){a.prec=a.prec*10+b;c++}c--;case"d":case"i":a.signedconv=true;case"u":a.base=10;break;case"x":a.base=16;break;case"X":a.base=16;a.uppercase=true;break;case"o":a.base=8;break;case"e":case"f":case"g":a.signedconv=true;a.conv=b;break;case"E":case"F":case"G":a.signedconv=true;a.uppercase=true;a.conv=b.toLowerCase();break}}return a}function +tH(b,f){if(b.uppercase)f=f.toUpperCase();var +e=f.length;if(b.signedconv&&(b.sign<0||b.signstyle!=cU))e++;if(b.alternate){if(b.base==8)e+=1;if(b.base==16)e+=2}var +c=ac;if(b.justify==fc&&b.filler==fP)for(var +d=e;d20){c-=20;a/=Math.pow(10,c);a+=new -Array(c+1).join(s);if(b>0)a=a+bP+new -Array(b+1).join(s);return a}else +c=parseInt(a.toString().split(fc)[1]);if(c>20){c-=20;a/=Math.pow(10,c);a+=new +Array(c+1).join(p);if(b>0)a=a+e5+new +Array(b+1).join(p);return a}else return a.toFixed(b)}}var -a,e=iE(i),d=e.prec<0?6:e.prec;if(c<0||c==0&&1/c==-Infinity){e.sign=-1;c=-c}if(isNaN(c)){a=h6;e.filler=cc}else -if(!isFinite(c)){a=oj;e.filler=cc}else +a,e=tS(i),d=e.prec<0?6:e.prec;if(c<0||c==0&&1/c==-Infinity){e.sign=-1;c=-c}if(isNaN(c)){a=sP;e.filler=fP}else +if(!isFinite(c)){a=Mo;e.filler=fP}else switch(e.conv){case"e":var -a=c.toExponential(d),b=a.length;if(a.charAt(b-3)==gf)a=a.slice(0,b-1)+s+a.slice(b-1);break;case"f":a=j(c,d);break;case"g":d=d?d:1;a=c.toExponential(d-1);var -h=a.indexOf(gf),g=+a.slice(h+1);if(g<-4||c>=1e21||c.toFixed(0).length>d){var -b=h-1;while(a.charAt(b)==s)b--;if(a.charAt(b)==bP)b--;a=a.slice(0,b+1)+a.slice(h);b=a.length;if(a.charAt(b-3)==gf)a=a.slice(0,b-1)+s+a.slice(b-1);break}else{var +a=c.toExponential(d),b=a.length;if(a.charAt(b-3)==pH)a=a.slice(0,b-1)+p+a.slice(b-1);break;case"f":a=j(c,d);break;case"g":d=d?d:1;a=c.toExponential(d-1);var +h=a.indexOf(pH),g=+a.slice(h+1);if(g<-4||c>=1e21||c.toFixed(0).length>d){var +b=h-1;while(a.charAt(b)==p)b--;if(a.charAt(b)==e5)b--;a=a.slice(0,b+1)+a.slice(h);b=a.length;if(a.charAt(b-3)==pH)a=a.slice(0,b-1)+p+a.slice(b-1);break}else{var f=d;if(g<0){f-=g+1;a=c.toFixed(f)}else while(a=c.toFixed(f),a.length>d+1)f--;if(f){var -b=a.length-1;while(a.charAt(b)==s)b--;if(a.charAt(b)==bP)b--;a=a.slice(0,b+1)}}break}return ir(e,a)}function -gj(e,c){if(a5(e)==ig)return a(l+c);var -b=iE(e);if(c<0)if(b.signedconv){b.sign=-1;c=-c}else +b=a.length-1;while(a.charAt(b)==p)b--;if(a.charAt(b)==e5)b--;a=a.slice(0,b+1)}}break}return tH(e,a)}function +pR(e,c){if(dq(e)==sr)return a(ac+c);var +b=tS(e);if(c<0)if(b.signedconv){b.sign=-1;c=-c}else c>>>=0;var -d=c.toString(b.base);if(b.prec>=0){b.filler=cc;var -f=b.prec-d.length;if(f>0)d=dK(f,s)+d}return ir(b,d)}var -oY=0;function -aO(){return oY++}function -cO(a){return a.toUtf16()}function -eL(){return typeof -C.process!=="undefined"&&typeof -C.process.versions!=="undefined"&&typeof -C.process.versions.node!=="undefined"}function -OQ(){function -a(a){if(a.charAt(0)===bT)return[l,a.substring(1)];return}function +d=c.toString(b.base);if(b.prec>=0){b.filler=fP;var +f=b.prec-d.length;if(f>0)d=i$(f,p)+d}return tH(b,d)}var +MY=0;function +cK(){return MY++}function +bNY(a){if(a==0||!isFinite(a))return[0,a,0];var +c=a<0;if(c)a=-a;var +b=Math.max(-ew,M5(a)+1);a*=Math.pow(2,-b);while(a=1){a*=eU;b++}if(c)a=-a;return[0,a,b]}function +eH(a){return a.toUtf16()}function +kX(){return typeof +aO.process!=="undefined"&&typeof +aO.process.versions!=="undefined"&&typeof +aO.process.versions.node!=="undefined"}function +bOL(){function +a(a){if(a.charAt(0)===eS)return[ac,a.substring(1)];return}function b(c){var -g=/^([a-zA-Z]:|[\\/]{2}[^\\/]+[\\/]+[^\\/]+)?([\\/])?([\s\S]*?)$/,a=g.exec(c),b=a[1]||l,e=Boolean(b&&b.charAt(1)!==":");if(Boolean(a[2]||e)){var -d=a[1]||l,f=a[2]||l;return[d,c.substring(d.length+f.length)]}return}return eL()&&C.process&&C.process.platform?C.process.platform==="win32"?b:a:a}var -iJ=OQ();function -o3(a){return a.slice(-1)!==bT?a+bT:a}if(eL()&&C.process&&C.process.cwd)var -eE=C.process.cwd().replace(/\\/g,bT);else +g=/^([a-zA-Z]:|[\\/]{2}[^\\/]+[\\/]+[^\\/]+)?([\\/])?([\s\S]*?)$/,a=g.exec(c),b=a[1]||ac,e=Boolean(b&&b.charAt(1)!==":");if(Boolean(a[2]||e)){var +d=a[1]||ac,f=a[2]||ac;return[d,c.substring(d.length+f.length)]}return}return kX()&&aO.process&&aO.process.platform?aO.process.platform==="win32"?b:a:a}var +tZ=bOL();function +M3(a){return a.slice(-1)!==eS?a+eS:a}if(kX()&&aO.process&&aO.process.cwd)var +kO=aO.process.cwd().replace(/\\/g,eS);else var -eE="/static";eE=o3(eE);function -Om(a){a=cO(a);if(!iJ(a))a=eE+a;var -e=iJ(a),d=e[1].split(bT),b=[];for(var +kO="/static";kO=M3(kO);function +bOi(a){a=eH(a);if(!tZ(a))a=kO+a;var +e=tZ(a),d=e[1].split(eS),b=[];for(var c=0;c1)b.pop();break;case".":break;default:b.push(d[c]);break}b.unshift(e[0]);b.orig=a;return b}function -OG(e){for(var -f=l,b=f,a,h,c=0,g=e.length;chE){b.substr(0,1);f+=b;b=l;f+=e.slice(c,d)}else -b+=e.slice(c,d);if(d==g)break;c=d}if(a>6);b+=String.fromCharCode(bu|a&dp)}else -if(a<0xd800||a>=nc)b+=String.fromCharCode(k5|a>>12,bu|a>>6&dp,bu|a&dp);else -if(a>=0xdbff||c+1==g||(h=e.charCodeAt(c+1))nc)b+="\xef\xbf\xbd";else{c++;a=(a<<10)+h-0x35fdc00;b+=String.fromCharCode(mm|a>>18,bu|a>>12&dp,bu|a>>6&dp,bu|a&dp)}if(b.length>eq){b.substr(0,1);f+=b;b=l}}return f+b}function -NW(a){var -b=9;if(!o5(a))b=8,a=OG(a);return new -b0(b,a,a.length)}function -a6(a){return NW(a)}var -O7=[lF,op,mA,kX,mu,nb,lU,ns,hG,lX,nr,mn,nt,lT,kB,ot,kV,k2,mf,mT,gd,lk,of,nx,n1,mM,f6,ih,lf,le,mb,oi,oe,ol,lG,k_,lt,m7,on,mk,lL,mx,k1,mo,kH,nv,n$,lK,lh,mj,mN,l2,m3,mt,nu,lW,lH,nR,nl,n6,nf,na,m$,k0,lN,lr,nF,nX];function -c7(d,f,e,a){var -b=O7.indexOf(d);if(b<0){if(a==null)a=-9999;b=[0,a]}var -c=[b,a6(f||l),a6(e||l)];return c}var -oW={};function -cl(a){return oW[a]}function -c5(b,a){throw[0,b].concat(a)}function -NV(a){return new -b0(4,a,a.length)}function -Y(a){iF(ag.Sys_error,a)}function -Ox(a){Y(a+fu)}function -be(a){return a.l}function -ow(){}function -aF(a){this.data=a}aF.prototype=new -ow();aF.prototype.truncate=function(a){var -b=this.data;this.data=am(a|0);cL(b,0,this.data,0,a)};aF.prototype.length=function(){return be(this.data)};aF.prototype.write=function(b,d,g,a){var +bOC(e){for(var +f=ac,b=f,a,h,c=0,g=e.length;cr7){b.substr(0,1);f+=b;b=ac;f+=e.slice(c,d)}else +b+=e.slice(c,d);if(d==g)break;c=d}if(a>6);b+=String.fromCharCode(d8|a&hT)}else +if(a<0xd800||a>=Lb)b+=String.fromCharCode(Fm|a>>12,d8|a>>6&hT,d8|a&hT);else +if(a>=0xdbff||c+1==g||(h=e.charCodeAt(c+1))Lb)b+="\xef\xbf\xbd";else{c++;a=(a<<10)+h-0x35fdc00;b+=String.fromCharCode(CD|a>>18,d8|a>>12&hT,d8|a>>6&hT,d8|a&hT)}if(b.length>kq){b.substr(0,1);f+=b;b=ac}}return f+b}function +bNT(a){var +b=9;if(!M6(a))b=8,a=bOC(a);return new +fg(b,a,a.length)}function +aN(a){return bNT(a)}var +bO4=[B1,IB,yz,E$,GB,Hl,xV,Lu,sw,Cd,Lt,ym,Lv,J6,wK,AS,E_,Br,Ks,Dc,pF,Fx,Az,DS,Af,yX,pp,tA,BF,xh,Cv,Is,Ay,Mp,xK,BA,xy,zh,IA,Gr,B7,yu,Bo,Kx,IS,zO,Mf,B5,Fv,Ku,KY,F$,Dl,yq,zN,Cc,JU,H_,DN,Ak,DG,Hk,zl,Bn,B_,FE,LI,L2];function +hz(d,f,e,a){var +b=bO4.indexOf(d);if(b<0){if(a==null)a=-9999;b=[0,a]}var +c=[b,aN(f||ac),aN(e||ac)];return c}var +MW={};function +fk(a){return MW[a]}function +hx(b,a){throw[0,b].concat(a)}function +bNS(a){return new +fg(4,a,a.length)}function +bz(a){tT(bW.Sys_error,a)}function +bOt(a){bz(a+oA)}function +dJ(a){return a.l}function +Mx(){}function +cI(a){this.data=a}cI.prototype=new +Mx();cI.prototype.truncate=function(a){var +b=this.data;this.data=bR(a|0);gW(b,0,this.data,0,a)};cI.prototype.length=function(){return dJ(this.data)};cI.prototype.write=function(b,d,g,a){var c=this.length();if(b+a>=c){var -e=am(b+a),f=this.data;this.data=e;cL(f,0,this.data,0,c)}bC(d,g,this.data,b,a);return 0};aF.prototype.read=function(c,a,d,b){var -e=this.length();cL(this.data,c,a,d,b);return 0};aF.prototype.read_one=function(a){return cM(this.data,a)};aF.prototype.close=function(){};aF.prototype.constructor=aF;function -aX(b,a){this.content={};this.root=b;this.lookupFun=a}aX.prototype.nm=function(a){return this.root+a};aX.prototype.create_dir_if_needed=function(d){var -c=d.split(bT),b=l;for(var -a=0;a>1|1;if(h=0)}function -iv(d,b){var -e=b.length,a,c;for(a=0;a+4<=e;a+=4){c=b.charCodeAt(a)|b.charCodeAt(a+1)<<8|b.charCodeAt(a+2)<<16|b.charCodeAt(a+3)<<24;d=aH(d,c)}c=0;switch(e&3){case +a=c}pY[d]=a+1;return h==b[a+1]?b[a]:0}function +MQ(a,b){return+(kN(a,b,false)>=0)}function +tL(d,b){var +e=b.length,a,c;for(a=0;a+4<=e;a+=4){c=b.charCodeAt(a)|b.charCodeAt(a+1)<<8|b.charCodeAt(a+2)<<16|b.charCodeAt(a+3)<<24;d=cL(d,c)}c=0;switch(e&3){case 3:c=b.charCodeAt(a+2)<<16;case 2:c|=b.charCodeAt(a+1)<<8;case -1:c|=b.charCodeAt(a);d=aH(d,c)}d^=e;return d}function -N7(a,b){return iv(a,a5(b))}function -N4(d,b){var -e=b.length,a,c;for(a=0;a+4<=e;a+=4){c=b[a]|b[a+1]<<8|b[a+2]<<16|b[a+3]<<24;d=aH(d,c)}c=0;switch(e&3){case +1:c|=b.charCodeAt(a);d=cL(d,c)}d^=e;return d}function +bN5(a,b){return tL(a,dq(b))}function +bN2(d,b){var +e=b.length,a,c;for(a=0;a+4<=e;a+=4){c=b[a]|b[a+1]<<8|b[a+2]<<16|b[a+3]<<24;d=cL(d,c)}c=0;switch(e&3){case 3:c=b[a+2]<<16;case 2:c|=b[a+1]<<8;case -1:c|=b[a];d=aH(d,c)}d^=e;return d}function -oT(a){switch(a.t&6){default:c2(a);case +1:c|=b[a];d=cL(d,c)}d^=e;return d}function +MT(a){switch(a.t&6){default:ht(a);case 0:return a.c;case 4:return a.c}}function -N3(b,c){var -a=oT(c);return typeof -a==="string"?iv(b,a):N4(b,a)}function -N5(a){a^=a>>>16;a=bi(a,0x85ebca6b|0);a^=a>>>13;a=bi(a,0xc2b2ae35|0);a^=a>>>16;return a}function -N2(j,l,n,m){var -f,g,h,d,c,b,a,e,i;d=l;if(d<0||d>bW)d=bW;c=j;b=n;f=[m];g=0;h=1;while(g0){a=f[g++];if(a&&a.caml_custom){if(dG[a.caml_custom]&&dG[a.caml_custom].hash){var -k=dG[a.caml_custom].hash(a);b=aH(b,k);c--}}else +bN1(b,c){var +a=MT(c);return typeof +a==="string"?tL(b,a):bN2(b,a)}function +bN3(a){a^=a>>>16;a=dZ(a,0x85ebca6b|0);a^=a>>>13;a=dZ(a,0xc2b2ae35|0);a^=a>>>16;return a}function +bN0(j,l,n,m){var +f,g,h,d,c,b,a,e,i;d=l;if(d<0||d>dC)d=dC;c=j;b=n;f=[m];g=0;h=1;while(g0){a=f[g++];if(a&&a.caml_custom){if(i8[a.caml_custom]&&i8[a.caml_custom].hash){var +k=i8[a.caml_custom].hash(a);b=cL(b,k);c--}}else if(a instanceof Array&&a[0]===(a[0]|0))switch(a[0]){case -248:b=aH(b,a[2]);c--;break;case +248:b=cL(b,a[2]);c--;break;case 250:f[--g]=a[1];break;default:var -o=a.length-1<<10|a[0];b=aH(b,o);for(e=1,i=a.length;e=d)break;f[h++]=a[e]}break}else -if(eH(a)){b=N3(b,a);c--}else -if(go(a)){b=N7(b,a);c--}else +o=a.length-1<<10|a[0];b=cL(b,o);for(e=1,i=a.length;e=d)break;f[h++]=a[e]}break}else +if(kT(a)){b=bN1(b,a);c--}else +if(pV(a)){b=bN5(b,a);c--}else if(typeof -a==="string"){b=iv(b,a);c--}else -if(a===(a|0)){b=aH(b,a+a+1);c--}else -if(a===+a){b=iu(b,a);c--}}b=N5(b);return b&0x3FFFFFFF}function -N8(a,c,k){if(!isFinite(a)){if(isNaN(a))return a6(h6);return a6(a>0?oc:"-infinity")}var +a==="string"){b=tL(b,a);c--}else +if(a===(a|0)){b=cL(b,a+a+1);c--}else +if(a===+a){b=tK(b,a);c--}}b=bN3(b);return b&0x3FFFFFFF}function +bN6(a,c,k){if(!isFinite(a)){if(isNaN(a))return aN(sP);return aN(a>0?Ml:"-infinity")}var i=a==0&&1/a==-Infinity?1:a>=0?0:1;if(i)a=-a;var d=0;if(a==0);else -if(a<1)while(a<1&&d>-1022){a*=2;d--}else +if(a<1)while(a<1&&d>-bJ){a*=2;d--}else while(a>=2){a/=2;d++}var -j=d<0?l:bN,e=l;if(i)e=aL;else +j=d<0?ac:fc,e=ac;if(i)e=cU;else switch(k){case -43:e=bN;break;case -32:e=cc;break;default:break}if(c>=0&&c<13){var +43:e=fc;break;case +32:e=fP;break;default:break}if(c>=0&&c<13){var g=Math.pow(2,c*4);a=Math.round(a*g)/g}var b=a.toString(16);if(c>=0){var -h=b.indexOf(bP);if(h<0)b+=bP+dK(c,s);else{var -f=h+1+c;if(b.length>24&cg,a>>31&bR)}function -Oh(a){return a.toInt()}function -Ob(a){return+a.isNeg()}function -Oe(a){return a.neg()}function -N$(g,c){var -a=iE(g);if(a.signedconv&&Ob(c)){a.sign=-1;c=Oe(c)}var -b=l,h=Of(a.base),f="0123456789abcdef";do{var -e=c.udivmod(h);c=e.quotient;b=f.charAt(Oh(e.modulus))+b}while(!Oc(c));if(a.prec>=0){a.filler=cc;var -d=a.prec-b.length;if(d>0)b=dK(d,s)+b}return ir(a,b)}function -Og(a,b){return a.or(b)}function -gm(a){return a.toFloat()}function -Ow(c){var -a=0,e=w(c),b=10,d=1;if(e>0)switch(bx(c,a)){case +h=b.indexOf(e5);if(h<0)b+=e5+i$(c,p);else{var +f=h+1+c;if(b.length>24&fJ,a>>31&eQ)}function +bOf(a){return a.toInt()}function +bN$(a){return+a.isNeg()}function +bOc(a){return a.neg()}function +bN9(g,c){var +a=tS(g);if(a.signedconv&&bN$(c)){a.sign=-1;c=bOc(c)}var +b=ac,h=bOd(a.base),f="0123456789abcdef";do{var +e=c.udivmod(h);c=e.quotient;b=f.charAt(bOf(e.modulus))+b}while(!bOa(c));if(a.prec>=0){a.filler=fP;var +d=a.prec-b.length;if(d>0)b=i$(d,p)+b}return tH(a,b)}function +bOe(a,b){return a.or(b)}function +pU(a){return a.toFloat()}function +bOs(c){var +a=0,e=ay(c),b=10,d=1;if(e>0)switch(ep(c,a)){case 45:a++;d=-1;break;case -43:a++;d=1;break}if(a+10)switch(bx(c,a)){case 66:b=2;a+=2;break;case 117:case 85:a+=2;break}return[a,d,b]}function -oZ(a){if(a>=48&&a<=57)return a-48;if(a>=65&&a<=90)return a-55;if(a>=97&&a<=cj)return a-87;return-1}function -oS(f){var -h=Ow(f),c=h[0],i=h[1],d=h[2],g=w(f),j=-1>>>0,e=c=d)bd(f2);var -a=b;for(c++;c=d)break;a=d*a+b;if(a>j)bd(f2)}if(c!=g)bd(f2);a=i*a;if(d==10&&(a|0)!=a)bd(f2);return a|0}function -dI(a){return a.slice(1)}function -Ok(c){var +MZ(a){if(a>=48&&a<=57)return a-48;if(a>=65&&a<=90)return a-55;if(a>=97&&a<=dl)return a-87;return-1}function +kS(f){var +h=bOs(f),c=h[0],i=h[1],d=h[2],g=ay(f),j=-1>>>0,e=c=d)dI(mm);var +a=b;for(c++;c=d)break;a=d*a+b;if(a>j)dI(mm)}if(c!=g)dI(mm);a=i*a;if(d==10&&(a|0)!=a)dI(mm);return a|0}function +fi(a){return a.slice(1)}function +hu(c){var d=c.length,b=new Array(d+1);b[0]=0;for(var a=0;a0){var c=new Array(b);for(var -a=0;abY){a-=bY;b*=Math.pow(2,bY);if(a>bY){a-=bY;b*=Math.pow(2,bY)}}if(a<-bY){a+=bY;b*=Math.pow(2,-bY)}b*=Math.pow(2,a);return b}function -Ol(a,b){return+(dF(a,b,false)<=0)}function -iB(a,b){return+(dF(a,b,false)<0)}function -eJ(b){b=a5(b);var +a=0;aew){a-=ew;b*=Math.pow(2,ew);if(a>ew){a-=ew;b*=Math.pow(2,ew)}}if(a<-ew){a+=ew;b*=Math.pow(2,-ew)}b*=Math.pow(2,a);return b}function +pX(a,b){return+(kN(a,b,false)<0)}function +kU(b){b=dq(b);var d=b.length/2,c=new Array(d);for(var a=0;a>16;return c}function -iC(b,t,a){var -n=2,o=3,r=5,d=6,h=7,g=8,j=9,m=1,l=2,q=3,s=4,p=5;if(!b.lex_default){b.lex_base=eJ(b[m]);b.lex_backtrk=eJ(b[l]);b.lex_check=eJ(b[p]);b.lex_trans=eJ(b[s]);b.lex_default=eJ(b[q])}var -e,c=t,k=ox(a[n]);if(c>=0){a[h]=a[r]=a[d];a[g]=-1}else +tQ(b,t,a){var +n=2,o=3,r=5,d=6,h=7,g=8,j=9,m=1,l=2,q=3,s=4,p=5;if(!b.lex_default){b.lex_base=kU(b[m]);b.lex_backtrk=kU(b[l]);b.lex_check=kU(b[p]);b.lex_trans=kU(b[s]);b.lex_default=kU(b[q])}var +e,c=t,k=My(a[n]);if(c>=0){a[h]=a[r]=a[d];a[g]=-1}else c=-c-1;for(;;){var f=b.lex_base[c];if(f<0)return-f-1;var i=b.lex_backtrk[c];if(i>=0){a[h]=a[d];a[g]=i}if(a[d]>=a[o])if(a[j]==0)return-c-1;else -e=bW;else{e=k[a[d]];a[d]++}if(b.lex_check[f+e]==c)c=b.lex_trans[f+e];else -c=b.lex_default[c];if(c<0){a[d]=a[h];if(a[g]==-1)bd("lexing: empty token");else +e=dC;else{e=k[a[d]];a[d]++}if(b.lex_check[f+e]==c)c=b.lex_trans[f+e];else +c=b.lex_default[c];if(c<0){a[d]=a[h];if(a[g]==-1)dI("lexing: empty token");else return a[g]}else -if(e==bW)a[j]=0}}function -ck(a,d){if(a<0)eC();var +if(e==dC)a[j]=0}}function +dY(a,d){if(a<0)kL();var a=a+1|0,b=new Array(a);b[0]=0;for(var c=1;c>>32-b,c)}function g(c,b,d,e,h,f,g){return a(b&d|~b&e,c,b,h,f,g)}function @@ -751,41 +755,41 @@ h(d,b,e,c,h,f,g){return a(b&c|e&~c,d,b,h,f,g)}function i(c,b,d,e,h,f,g){return a(b^d^e,c,b,h,f,g)}function j(c,b,d,e,h,f,g){return a(d^(b|~e),c,b,h,f,g)}function k(f,n){var -e=n;f[e>>2]|=bu<<8*(e&3);for(e=(e&~0x3)+8;(e&0x3F)<60;e+=4)f[(e>>2)-1]=0;f[(e>>2)-1]=n<<3;f[e>>2]=n>>29&0x1FFFFFFF;var +e=n;f[e>>2]|=d8<<8*(e&3);for(e=(e&~0x3)+8;(e&0x3F)<60;e+=4)f[(e>>2)-1]=0;f[(e>>2)-1]=n<<3;f[e>>2]=n>>29&0x1FFFFFFF;var k=[0x67452301,0xEFCDAB89,0x98BADCFE,0x10325476];for(e=0;e>8*m&bq;return o}return function(i,g,f){var -e=[],h=oT(i);if(typeof +m=0;m<4;m++)o[e*4+m]=k[e]>>8*m&ef;return o}return function(i,g,f){var +e=[],h=MT(i);if(typeof h==="string"){var d=h;for(var a=0;a>2]=d.charCodeAt(b)|d.charCodeAt(b+1)<<8|d.charCodeAt(b+2)<<16|d.charCodeAt(b+3)<<24}for(;a>2]|=d.charCodeAt(a+g)<<8*(a&3)}else{var c=h;for(var a=0;a>2]=c[b]|c[b+1]<<8|c[b+2]<<16|c[b+3]<<24}for(;a>2]|=c[a+g]<<8*(a&3)}return OD(k(e,f))}}();function -Oo(c,b,a){return On(bD(c),b,a)}function -Op(){return 0}var -b2=new +b=a+g;e[a>>2]=c[b]|c[b+1]<<8|c[b+2]<<16|c[b+3]<<24}for(;a>2]|=c[a+g]<<8*(a&3)}return bOz(k(e,f))}}();function +bOk(c,b,a){return bOj(eG(c),b,a)}function +bOl(){return 0}var +fj=new Array();function -c3(c){var -a=b2[c];if(!a.opened)Y("Cannot flush a closed channel");if(!a.buffer||a.buffer==l)return 0;if(a.fd&&ag.fds[a.fd]&&ag.fds[a.fd].output){var -b=ag.fds[a.fd].output;switch(b.length){case -2:b(c,a.buffer);break;default:b(a.buffer)}}a.buffer=l;return 0}function -o1(e,f){var -b=b2[e],d=a(f),c=w(d);b.file.write(b.offset,d,0,c);b.offset+=c;return 0}function -OK(a){var -a=iH(a),b=C;if(b.process&&b.process.stdout&&b.process.stdout.write)b.process.stderr.write(a);else{if(a.charCodeAt(a.length-1)==10)a=a.substr(0,a.length-1);var +hv(c){var +a=fj[c];if(!a.opened)bz("Cannot flush a closed channel");if(!a.buffer||a.buffer==ac)return 0;if(a.fd&&bW.fds[a.fd]&&bW.fds[a.fd].output){var +b=bW.fds[a.fd].output;switch(b.length){case +2:b(c,a.buffer);break;default:b(a.buffer)}}a.buffer=ac;return 0}function +M1(e,f){var +b=fj[e],d=a(f),c=ay(d);b.file.write(b.offset,d,0,c);b.offset+=c;return 0}function +bOG(a){var +a=tV(a),b=aO;if(b.process&&b.process.stdout&&b.process.stdout.write)b.process.stderr.write(a);else{if(a.charCodeAt(a.length-1)==10)a=a.substr(0,a.length-1);var c=b.console;c&&c.error&&c.error(a)}}function -OL(a){var -a=iH(a),b=C;if(b.process&&b.process.stdout&&b.process.stdout.write)b.process.stdout.write(a);else{if(a.charCodeAt(a.length-1)==10)a=a.substr(0,a.length-1);var +bOH(a){var +a=tV(a),b=aO;if(b.process&&b.process.stdout&&b.process.stdout.write)b.process.stdout.write(a);else{if(a.charCodeAt(a.length-1)==10)a=a.substr(0,a.length-1);var c=b.console;c&&c.log&&c.log(a)}}function -gv(c,e,d,a){if(ag.fds===undefined)ag.fds=new +p2(c,e,d,a){if(bW.fds===undefined)bW.fds=new Array();a=a?a:{};var -b={};b.file=d;b.offset=a.append?d.length():0;b.flags=a;b.output=e;ag.fds[c]=b;if(!ag.fd_last_idx||c>ag.fd_last_idx)ag.fd_last_idx=c;return c}function -O9(c,b,g){var +b={};b.file=d;b.offset=a.append?d.length():0;b.flags=a;b.output=e;bW.fds[c]=b;if(!bW.fd_last_idx||c>bW.fd_last_idx)bW.fd_last_idx=c;return c}function +bO6(c,b,g){var a={};while(b){switch(b[1]){case 0:a.rdonly=1;break;case 1:a.wronly=1;break;case @@ -795,140 +799,140 @@ a={};while(b){switch(b[1]){case 5:a.excl=1;break;case 6:a.binary=1;break;case 7:a.text=1;break;case -8:a.nonblock=1;break}b=b[2]}if(a.rdonly&&a.wronly)Y(a5(c)+lp);if(a.text&&a.binary)Y(a5(c)+lV);var -d=pc(c),e=d.device.open(d.rest,a),f=ag.fd_last_idx?ag.fd_last_idx:0;return gv(f+1,o1,e,a)}gv(0,o1,new -aF(am(0)));gv(1,OL,new -aF(am(0)));gv(2,OK,new -aF(am(0)));function -Oq(a){var -c=ag.fds[a];if(c.flags.wronly)Y(mE+a+" is writeonly");var -d=null;if(a==0&&eL()){var -e=require("fs");d=function(){return a6(e.readFileSync(0,kD))}}var -b={file:c.file,offset:c.offset,fd:a,opened:true,out:false,refill:d};b2[b.fd]=b;return b.fd}function -oU(c){var -b=ag.fds[c];if(b.flags.rdonly)Y(mE+c+" is readonly");var -a={file:b.file,offset:b.offset,fd:c,opened:true,out:true,buffer:l};b2[a.fd]=a;return a.fd}function -Or(){var +8:a.nonblock=1;break}b=b[2]}if(a.rdonly&&a.wronly)bz(dq(c)+FB);if(a.text&&a.binary)bz(dq(c)+J7);var +d=Na(c),e=d.device.open(d.rest,a),f=bW.fd_last_idx?bW.fd_last_idx:0;return p2(f+1,M1,e,a)}p2(0,M1,new +cI(bR(0)));p2(1,bOH,new +cI(bR(0)));p2(2,bOG,new +cI(bR(0)));function +bOm(a){var +c=bW.fds[a];if(c.flags.wronly)bz(yI+a+" is writeonly");var +d=null;if(a==0&&kX()){var +e=require("fs");d=function(){return aN(e.readFileSync(0,wN))}}var +b={file:c.file,offset:c.offset,fd:a,opened:true,out:false,refill:d};fj[b.fd]=b;return b.fd}function +MU(c){var +b=bW.fds[c];if(b.flags.rdonly)bz(yI+c+" is readonly");var +a={file:b.file,offset:b.offset,fd:c,opened:true,out:true,buffer:ac};fj[a.fd]=a;return a.fd}function +bOn(){var b=0;for(var -a=0;a>>0)return a[0];else -if(eH(a))return fO;else -if(go(a))return fO;else +if(kT(a))return ma;else +if(pV(a))return ma;else if(a instanceof Function||typeof -a=="function")return 247;else -if(a&&a.caml_custom)return dz;else -return a2}function -bw(b,c,a){if(a&&C.toplevelReloc)b=C.toplevelReloc(a);ag[b+1]=c;if(a)ag[a]=c}function -iG(a,b){oW[a5(a)]=b;return 0}function -OA(a){a[2]=oY++;return a}function -cP(a,b){return oH(a,b)}function -OC(){ah(hY)}function -B(b,a){if(a>>>0>=w(b))OC();return bx(b,a)}function -K(a,b){return 1-cP(a,b)}function -OE(){return 0x7FFFFFFF/4|0}function -Oy(){gr(ag.Not_found)}function -o2(c){var -a=C,b=cO(c);if(a.process&&a.process.env&&a.process.env[b]!=undefined)return a6(a.process.env[b]);if(C.jsoo_static_env&&C.jsoo_static_env[b])return a6(C.jsoo_static_env[b]);Oy()}function -OF(){if(C.crypto)if(typeof -C.crypto.getRandomValues==="function"){var -a=new(C.Uint32Array)(1);C.crypto.getRandomValues(a);return[0,a[0]]}else -if(C.crypto.randomBytes==="function"){var -b=C.crypto.randomBytes(4),a=new(C.Uint32Array)(b);return[0,a[0]]}var +a=="function")return tv;else +if(a&&a.caml_custom)return iA;else +return dp}function +eo(b,c,a){if(a&&aO.toplevelReloc)b=aO.toplevelReloc(a);bW[b+1]=c;if(a)bW[a]=c}function +tU(a,b){MW[dq(a)]=b;return 0}function +bOw(a){a[2]=MY++;return a}function +gZ(a,b){return MI(a,b)}function +bOy(){b4(tq)}function +aL(b,a){if(a>>>0>=ay(b))bOy();return ep(b,a)}function +M(a,b){return 1-gZ(a,b)}function +bOA(){return 0x7FFFFFFF/4|0}function +bOu(){kW(bW.Not_found)}function +M2(c){var +a=aO,b=eH(c);if(a.process&&a.process.env&&a.process.env[b]!=undefined)return aN(a.process.env[b]);if(aO.jsoo_static_env&&aO.jsoo_static_env[b])return aN(aO.jsoo_static_env[b]);bOu()}function +bOB(){if(aO.crypto)if(typeof +aO.crypto.getRandomValues==="function"){var +a=new(aO.Uint32Array)(1);aO.crypto.getRandomValues(a);return[0,a[0]]}else +if(aO.crypto.randomBytes==="function"){var +b=aO.crypto.randomBytes(4),a=new(aO.Uint32Array)(b);return[0,a[0]]}var c=new -Date().getTime(),d=c^mv*Math.random();return[0,d]}function -c6(a){var +Date().getTime(),d=c^KG*Math.random();return[0,d]}function +hy(a){var b=1;while(a&&a.joo_tramp){a=a.joo_tramp.apply(null,a.joo_args);b++}return a}function -ai(b,a){return{joo_tramp:b,joo_args:a}}function -o0(a){return a}function -p(a){if(a +bX(b,a){return{joo_tramp:b,joo_args:a}}function +M0(a){return a}function +m(a){if(a instanceof -Array)return a;if(C.RangeError&&a +Array)return a;if(aO.RangeError&&a instanceof -C.RangeError&&a.message&&a.message.match(/maximum call stack/i))return o0(ag.Stack_overflow);if(C.InternalError&&a +aO.RangeError&&a.message&&a.message.match(/maximum call stack/i))return M0(bW.Stack_overflow);if(aO.InternalError&&a instanceof -C.InternalError&&a.message&&a.message.match(/too much recursion/i))return o0(ag.Stack_overflow);if(a +aO.InternalError&&a.message&&a.message.match(/too much recursion/i))return M0(bW.Stack_overflow);if(a instanceof -C.Error&&cl(hH))return[0,cl(hH),a];return[0,ag.Failure,a6(String(a))]}var -x=function(A){"use strict";var -f=c1,aa=7,t=9007199254740992,I=p(t),N="0123456789abcdefghijklmnopqrstuvwxyz",g=OJ.BigInt,G=typeof +aO.Error&&fk(s$))return[0,fk(s$),a];return[0,bW.Failure,aN(String(a))]}var +aw=function(z){"use strict";var +f=hj,$=7,s=9007199254740992,H=q(s),M="0123456789abcdefghijklmnopqrstuvwxyz",g=bOF.BigInt,F=typeof g==="function";function d(a,b,c,f){if(typeof a==="undefined")return d[0];if(typeof -b!=="undefined")return+b===10&&!c?e(a):af(a,b,c,f);return e(a)}function -a(b,a){this.value=b;this.sign=a;this.isSmall=false;this.caml_custom=f1}a.prototype=Object.create(d.prototype);function -b(a){this.value=a;this.sign=a<0;this.isSmall=true;this.caml_custom=f1}b.prototype=Object.create(d.prototype);function -c(a){this.value=a;this.caml_custom=f1}c.prototype=Object.create(d.prototype);function -m(a){return-t0)return Math.floor(a);return Math.ceil(a)}function -O(g,h){var +N(g,h){var i=g.length,j=h.length,e=new Array(i),b=0,d=f,c,a;for(a=0;a=d?1:0;e[a]=c-b*d}while(a0)e.push(b);return e}function -u(a,b){if(a.length>=b.length)return O(a,b);return O(b,a)}function -B(g,a){var +t(a,b){if(a.length>=b.length)return N(a,b);return N(b,a)}function +A(g,a){var h=g.length,d=new Array(h),c=f,e,b;for(b=0;b0){d[b++]=a%c;a=Math.floor(a/c)}return d}a.prototype.add=function(f){var b=e(f);if(this.sign!==b.sign)return this.subtract(b.negate());var c=this.value,d=b.value;if(b.isSmall)return new -a(B(c,Math.abs(d)),this.sign);return new -a(u(c,d),this.sign)};a.prototype.plus=a.prototype.add;b.prototype.add=function(g){var +a(A(c,Math.abs(d)),this.sign);return new +a(t(c,d),this.sign)};a.prototype.plus=a.prototype.add;b.prototype.add=function(g){var f=e(g),c=this.value;if(c<0!==f.sign)return this.subtract(f.negate());var -d=f.value;if(f.isSmall){if(m(c+d))return new -b(c+d);d=p(Math.abs(d))}return new -a(B(d,Math.abs(c)),c<0)};b.prototype.plus=b.prototype.add;c.prototype.add=function(a){return new +d=f.value;if(f.isSmall){if(l(c+d))return new +b(c+d);d=q(Math.abs(d))}return new +a(A(d,Math.abs(c)),c<0)};b.prototype.plus=b.prototype.add;c.prototype.add=function(a){return new c(this.value+e(a).value)};c.prototype.plus=c.prototype.add;function -y(d,h){var +w(d,h){var g=d.length,i=h.length,c=new Array(g),e=0,j=f,a,b;for(a=0;a=0)c=y(e,f);else{c=y(f,e);d=!d}c=n(c);if(typeof +e=0;c[a]=b}for(a=i;a=0)c=w(e,f);else{c=w(f,e);d=!d}c=n(c);if(typeof c==="number"){if(d)c=-c;return new b(c)}return new a(c,d)}function -F(h,l,k){var +E(h,l,k){var j=h.length,c=new Array(j),i=-l,g=f,e,d;for(e=0;e=0)};b.prototype.minus=b.prototype.subtract;c.prototype.subtract=function(a){return new +b(a-d);return E(d,Math.abs(a),a>=0)};b.prototype.minus=b.prototype.subtract;c.prototype.subtract=function(a){return new c(this.value-e(a).value)};c.prototype.minus=c.prototype.subtract;a.prototype.negate=function(){return new a(this.value,!this.sign)};b.prototype.negate=function(){var c=this.sign,a=new @@ -937,58 +941,58 @@ c(-this.value)};a.prototype.abs=function(){return new a(this.value,false)};b.prototype.abs=function(){return new b(Math.abs(this.value))};c.prototype.abs=function(){return new c(this.value>=0?this.value:-this.value)};function -M(g,j){var -i=g.length,l=j.length,n=i+l,c=C(n),m=f,e,d,a,h,k;for(a=0;a0){e[b++]=a%c;a=Math.floor(a/c)}return e}function -X(c,b){var +W(c,b){var a=[];while(b-->0)a.push(0);return a.concat(c)}function -D(b,c){var -a=Math.max(b.length,c.length);if(a<=30)return M(b,c);a=Math.ceil(a/2);var -f=b.slice(a),d=b.slice(0,a),i=c.slice(a),h=c.slice(0,a),e=D(d,h),g=D(f,i),k=D(u(d,f),u(h,i)),j=u(u(e,X(y(y(k,e),g),a)),X(g,2*a));q(j);return j}function -ak(a,b){return-(ma*a)-ma*b+0.000015*a*b>0}a.prototype.multiply=function(j){var +C(b,c){var +a=Math.max(b.length,c.length);if(a<=30)return L(b,c);a=Math.ceil(a/2);var +f=b.slice(a),d=b.slice(0,a),i=c.slice(a),h=c.slice(0,a),e=C(d,h),g=C(f,i),k=C(t(d,f),t(h,i)),j=t(t(e,W(w(w(k,e),g),a)),W(g,2*a));m(j);return j}function +aj(a,b){return-(x$*a)-x$*b+0.000015*a*b>0}a.prototype.multiply=function(j){var h=e(j),c=this.value,b=h.value,i=this.sign!==h.sign,g;if(h.isSmall){if(b===0)return d[0];if(b===1)return this;if(b===-1)return this.negate();g=Math.abs(b);if(g=0;d--){j=g-1;if(b[d+h]!==l)j=Math.floor((b[d+h]*g+b[d+h-1])/l);c=0;e=0;m=i.length;for(a=0;ah)d=(d+1)*i;c=Math.ceil(d/m);do{j=v(b,c);if(o(j,a)<=0)break;c--}while(c);e.push(c);a=y(a,j)}e.reverse();return[n(e),n(a)]}function -P(i,e){var -g=i.length,h=C(g),j=f,a,d,b,c;b=0;for(a=g-1;a>=0;--a){c=b*j+i[a];d=r(c/e);b=c-d*e;h[a]=d|0}return[h,b|0]}function +aa(q,k){var +r=q.length,h=k.length,g=f,s=B(k.length),l=k[h-1],o=Math.ceil(g/(2*l)),b=u(q,o),i=u(k,o),j,d,c,e,a,m,p;if(b.length<=r)b.push(0);i.push(0);l=i[h-1];for(d=r-h;d>=0;d--){j=g-1;if(b[d+h]!==l)j=Math.floor((b[d+h]*g+b[d+h-1])/l);c=0;e=0;m=i.length;for(a=0;ah)d=(d+1)*i;c=Math.ceil(d/p);do{j=u(b,c);if(o(j,a)<=0)break;c--}while(c);e.push(c);a=w(a,j)}e.reverse();return[n(e),n(a)]}function +O(i,e){var +g=i.length,h=B(g),j=f,a,d,b,c;b=0;for(a=g-1;a>=0;--a){c=b*j+i[a];d=r(c/e);b=c-d*e;h[a]=d|0}return[h,b|0]}function i(h,w){var -m,j=e(w);if(G)return[new +m,j=e(w);if(F)return[new c(h.value/j.value),new c(h.value%j.value)];var l=h.value,i=j.value,g;if(i===0)throw new Error("Cannot divide by zero");if(h.isSmall){if(j.isSmall)return[new b(r(l/i)),new b(l%i)];return[d[0],h]}if(j.isSmall){if(i===1)return[h,d[0]];if(i==-1)return[h.negate(),d[0]];var -s=Math.abs(i);if(sd?1:-1;if(a<0!==b.sign)return a<0?-1:1;return a<0?1:-1};b.prototype.compareTo=b.prototype.compare;c.prototype.compare=function(a){if(a===Infinity)return-1;if(a===-Infinity)return 1;var b=this.value,c=e(a).value;return b===c?0:b>c?1:-1};c.prototype.compareTo=c.prototype.compare;a.prototype.equals=function(a){return this.compare(a)===0};c.prototype.eq=c.prototype.equals=b.prototype.eq=b.prototype.equals=a.prototype.eq=a.prototype.equals;a.prototype.notEquals=function(a){return this.compare(a)!==0};c.prototype.neq=c.prototype.notEquals=b.prototype.neq=b.prototype.notEquals=a.prototype.neq=a.prototype.notEquals;a.prototype.greater=function(a){return this.compare(a)>0};c.prototype.gt=c.prototype.greater=b.prototype.gt=b.prototype.greater=a.prototype.gt=a.prototype.greater;a.prototype.lesser=function(a){return this.compare(a)<0};c.prototype.lt=c.prototype.lesser=b.prototype.lt=b.prototype.lesser=a.prototype.lt=a.prototype.lesser;a.prototype.greaterOrEquals=function(a){return this.compare(a)>=0};c.prototype.geq=c.prototype.greaterOrEquals=b.prototype.geq=b.prototype.greaterOrEquals=a.prototype.geq=a.prototype.greaterOrEquals;a.prototype.lesserOrEquals=function(a){return this.compare(a)<=0};c.prototype.leq=c.prototype.lesserOrEquals=b.prototype.leq=b.prototype.lesserOrEquals=a.prototype.leq=a.prototype.lesserOrEquals;a.prototype.isEven=function(){return(this.value[0]&1)===0};b.prototype.isEven=function(){return(this.value&1)===0};c.prototype.isEven=function(){return(this.value&g(1))===g(0)};a.prototype.isOdd=function(){return(this.value[0]&1)===1};b.prototype.isOdd=function(){return(this.value&1)===1};c.prototype.isOdd=function(){return(this.value&g(1))===g(1)};a.prototype.isPositive=function(){return!this.sign};b.prototype.isPositive=function(){return this.value>0};c.prototype.isPositive=b.prototype.isPositive;a.prototype.isNegative=function(){return this.sign};b.prototype.isNegative=function(){return this.value<0};c.prototype.isNegative=b.prototype.isNegative;a.prototype.isUnit=function(){return false};b.prototype.isUnit=function(){return Math.abs(this.value)===1};c.prototype.isUnit=function(){return this.abs().value===g(1)};a.prototype.isZero=function(){return false};b.prototype.isZero=function(){return this.value===0};c.prototype.isZero=function(){return this.value===g(0)};a.prototype.isDivisibleBy=function(b){var a=e(b);if(a.isZero())return false;if(a.isUnit())return true;if(a.compareAbs(2)===0)return this.isEven();return this.mod(a).isZero()};c.prototype.isDivisibleBy=b.prototype.isDivisibleBy=a.prototype.isDivisibleBy;function -S(b){var +R(b){var a=b.abs();if(a.isUnit())return false;if(a.equals(2)||a.equals(3)||a.equals(5))return true;if(a.isEven()||a.isDivisibleBy(3)||a.isDivisibleBy(5))return false;if(a.lesser(49))return true}function -K(d,e){var -g=d.prev(),c=g,h=0,f,i,b,a;while(c.isEven())c=c.divide(2),h++;next:for(b=0;b-t)return new +a(A(b,1),true);return E(b,1,this.sign)};b.prototype.prev=function(){var +c=this.value;if(c-1>-s)return new b(c-1);return new -a(I,true)};c.prototype.prev=function(){return new +a(H,true)};c.prototype.prev=function(){return new c(this.value-g(1))};var h=[1];while(2*h[h.length-1]<=f)h.push(2*h[h.length-1]);var -w=h.length,j=h[w-1];function -Y(a){return Math.abs(a)<=f}a.prototype.shiftLeft=function(c){var -a=e(c).toJSNumber();if(!Y(a))throw new -Error(String(a)+lC);if(a<0)return this.shiftRight(-a);var -b=this;if(b.isZero())return b;while(a>=w){b=b.multiply(j);a-=w-1}return b.multiply(h[a])};c.prototype.shiftLeft=b.prototype.shiftLeft=a.prototype.shiftLeft;a.prototype.shiftRight=function(d){var -a,b=e(d).toJSNumber();if(!Y(b))throw new -Error(String(b)+lC);if(b<0)return this.shiftLeft(-b);var -c=this;while(b>=w){if(c.isZero()||c.isNegative()&&c.isUnit())return c;a=i(c,j);c=a[1].isNegative()?a[0].prev():a[0];b-=w-1}a=i(c,h[b]);return a[1].isNegative()?a[0].prev():a[0]};c.prototype.shiftRight=b.prototype.shiftRight=a.prototype.shiftRight;function -J(h,a,q){a=e(a);var +v=h.length,j=h[v-1];function +X(a){return Math.abs(a)<=f}a.prototype.shiftLeft=function(c){var +a=e(c).toJSNumber();if(!X(a))throw new +Error(String(a)+FM);if(a<0)return this.shiftRight(-a);var +b=this;if(b.isZero())return b;while(a>=v){b=b.multiply(j);a-=v-1}return b.multiply(h[a])};c.prototype.shiftLeft=b.prototype.shiftLeft=a.prototype.shiftLeft;a.prototype.shiftRight=function(d){var +a,b=e(d).toJSNumber();if(!X(b))throw new +Error(String(b)+FM);if(b<0)return this.shiftLeft(-b);var +c=this;while(b>=v){if(c.isZero()||c.isNegative()&&c.isUnit())return c;a=i(c,j);c=a[1].isNegative()?a[0].prev():a[0];b-=v-1}a=i(c,h[b]);return a[1].isNegative()?a[0].prev():a[0]};c.prototype.shiftRight=b.prototype.shiftRight=a.prototype.shiftRight;function +I(h,a,q){a=e(a);var m=h.isNegative(),p=a.isNegative(),l=m?h.not():h,o=p?a.not():a,b=0,c=0,k=null,n=null,f=[];while(!l.isZero()||!o.isZero()){k=i(l,j);b=k[1].toJSNumber();if(m)b=j-1-b;n=i(o,j);c=n[1].toJSNumber();if(p)c=j-1-c;l=k[0];o=n[0];f.push(q(b,c))}var -g=q(m?1:0,p?1:0)!==0?x(-1):x(0);for(var -d=f.length-1;d>=0;d-=1)g=g.multiply(j).add(x(f[d]));return g}a.prototype.not=function(){return this.negate().prev()};c.prototype.not=b.prototype.not=a.prototype.not;a.prototype.and=function(a){return J(this,a,function(a,b){return a&b})};c.prototype.and=b.prototype.and=a.prototype.and;a.prototype.or=function(a){return J(this,a,function(a,b){return a|b})};c.prototype.or=b.prototype.or=a.prototype.or;a.prototype.xor=function(a){return J(this,a,function(a,b){return a^b})};c.prototype.xor=b.prototype.xor=a.prototype.xor;var -H=1<<30,$=(f&-f)*(f&-f)|H;function -E(c){var +g=q(m?1:0,p?1:0)!==0?aw(-1):aw(0);for(var +d=f.length-1;d>=0;d-=1)g=g.multiply(j).add(aw(f[d]));return g}a.prototype.not=function(){return this.negate().prev()};c.prototype.not=b.prototype.not=a.prototype.not;a.prototype.and=function(a){return I(this,a,function(a,b){return a&b})};c.prototype.and=b.prototype.and=a.prototype.and;a.prototype.or=function(a){return I(this,a,function(a,b){return a|b})};c.prototype.or=b.prototype.or=a.prototype.or;a.prototype.xor=function(a){return I(this,a,function(a,b){return a^b})};c.prototype.xor=b.prototype.xor=a.prototype.xor;var +G=1<<30,_=(f&-f)*(f&-f)|G;function +D(c){var a=c.value,b=typeof -a==="number"?a|H:typeof -a==="bigint"?a|g(H):a[0]+a[1]*f|$;return b&-b}function -R(b,a){if(a.compareTo(b)<=0){var -f=R(b,a.square(a)),d=f.p,c=f.e,e=d.multiply(a);return e.compareTo(b)<=0?{p:e,e:c*2+1}:{p:d,e:c*2}}return{p:x(1),e:0}}a.prototype.bitLength=function(){var -a=this;if(a.compareTo(x(0))<0)a=a.negate().subtract(x(1));if(a.compareTo(x(0))===0)return x(0);return x(R(a,x(2)).e).add(x(1))};c.prototype.bitLength=b.prototype.bitLength=a.prototype.bitLength;function -T(a,b){a=e(a);b=e(b);return a.greater(b)?a:b}function -L(a,b){a=e(a);b=e(b);return a.lesser(b)?a:b}function -Q(a,b){a=e(a).abs();b=e(b).abs();if(a.equals(b))return a;if(a.isZero())return b;if(b.isZero())return a;var -c=d[1],f,g;while(a.isEven()&&b.isEven()){f=L(E(a),E(b));a=a.divide(f);b=b.divide(f);c=c.multiply(f)}while(a.isEven())a=a.divide(E(a));do{while(b.isEven())b=b.divide(E(b));if(a.greater(b)){g=b;b=a;a=g}b=b.subtract(a)}while(!b.isZero());return c.isUnit()?a:a.multiply(c)}function -ae(a,b){a=e(a).abs();b=e(b).abs();return a.divide(Q(a,b)).multiply(b)}function -ah(a,b){a=e(a);b=e(b);var -g=L(a,b),n=T(a,b),h=n.subtract(g).add(1);if(h.isSmall)return g.add(Math.floor(Math.random()*h));var -j=z(h,f).value,l=[],k=true;for(var +a==="number"?a|G:typeof +a==="bigint"?a|g(G):a[0]+a[1]*f|_;return b&-b}function +Q(b,a){if(a.compareTo(b)<=0){var +f=Q(b,a.square(a)),d=f.p,c=f.e,e=d.multiply(a);return e.compareTo(b)<=0?{p:e,e:c*2+1}:{p:d,e:c*2}}return{p:aw(1),e:0}}a.prototype.bitLength=function(){var +a=this;if(a.compareTo(aw(0))<0)a=a.negate().subtract(aw(1));if(a.compareTo(aw(0))===0)return aw(0);return aw(Q(a,aw(2)).e).add(aw(1))};c.prototype.bitLength=b.prototype.bitLength=a.prototype.bitLength;function +S(a,b){a=e(a);b=e(b);return a.greater(b)?a:b}function +K(a,b){a=e(a);b=e(b);return a.lesser(b)?a:b}function +P(a,b){a=e(a).abs();b=e(b).abs();if(a.equals(b))return a;if(a.isZero())return b;if(b.isZero())return a;var +c=d[1],f,g;while(a.isEven()&&b.isEven()){f=K(D(a),D(b));a=a.divide(f);b=b.divide(f);c=c.multiply(f)}while(a.isEven())a=a.divide(D(a));do{while(b.isEven())b=b.divide(D(b));if(a.greater(b)){g=b;b=a;a=g}b=b.subtract(a)}while(!b.isZero());return c.isUnit()?a:a.multiply(c)}function +ad(a,b){a=e(a).abs();b=e(b).abs();return a.divide(P(a,b)).multiply(b)}function +ag(a,b){a=e(a);b=e(b);var +g=K(a,b),n=S(a,b),h=n.subtract(g).add(1);if(h.isSmall)return g.add(Math.floor(Math.random()*h));var +j=y(h,f).value,l=[],k=true;for(var c=0;c=i){if(c===ad&&i===1)continue;throw new -Error(c+" is not a valid digit in base "+g+bP)}}g=e(g);var -h=[],j=b[0]===aL;for(a=j?1:0;a=i){if(c===x&&i===1)continue;throw new +Error(c+" is not a valid digit in base "+g+e5)}}g=e(g);var +h=[],j=b[0]===cU;for(a=j?1:0;a=0;a--){b=b.add(e[a].times(c));c=c.times(f)}return g?b.negate():b}function -ai(b,a){a=a||N;if(b=0){e=c.divmod(b);c=e.quotient;var d=e.remainder;if(d.isNegative()){d=b.minus(d).abs();c=c.next()}g.push(d.toJSNumber())}g.push(c.toJSNumber());return{value:g.reverse(),isNegative:f}}function -_(d,c,b){var -a=z(d,c);return(a.isNegative?aL:l)+a.value.map(function(a){return ai(a,b)}).join(l)}a.prototype.toArray=function(a){return z(this,a)};b.prototype.toArray=function(a){return z(this,a)};c.prototype.toArray=function(a){return z(this,a)};a.prototype.toString=function(a,f){if(a===A)a=10;if(a!==10)return _(this,a,f);var +Z(d,c,b){var +a=y(d,c);return(a.isNegative?cU:ac)+a.value.map(function(a){return ah(a,b)}).join(ac)}a.prototype.toArray=function(a){return y(this,a)};b.prototype.toArray=function(a){return y(this,a)};c.prototype.toArray=function(a){return y(this,a)};a.prototype.toString=function(a,f){if(a===z)a=10;if(a!==10)return Z(this,a,f);var d=this.value,c=d.length,e=String(d[--c]),h="0000000",b;while(--c>=0){b=String(d[c]);e+=h.slice(b.length)+b}var -g=this.sign?aL:l;return g+e};b.prototype.toString=function(a,b){if(a===A)a=10;if(a!=10)return _(this,a,b);return String(this.value)};c.prototype.toString=b.prototype.toString;c.prototype.toJSON=a.prototype.toJSON=b.prototype.toJSON=function(){return this.toString()};a.prototype.valueOf=function(){return parseInt(this.toString(),10)};a.prototype.toJSNumber=a.prototype.valueOf;b.prototype.valueOf=function(){return this.value};b.prototype.toJSNumber=b.prototype.valueOf;c.prototype.valueOf=c.prototype.toJSNumber=function(){return parseInt(this.toString(),10)};function -W(d){if(m(+d)){var -l=+d;if(l===r(l))return G?new -c(g(l)):new -b(l);throw new -Error(f$+d)}var -p=d[0]===aL;if(p)d=d.slice(1);var +g=this.sign?cU:ac;return g+e};b.prototype.toString=function(a,b){if(a===z)a=10;if(a!=10)return Z(this,a,b);return String(this.value)};c.prototype.toString=b.prototype.toString;c.prototype.toJSON=a.prototype.toJSON=b.prototype.toJSON=function(){return this.toString()};a.prototype.valueOf=function(){return parseInt(this.toString(),10)};a.prototype.toJSNumber=a.prototype.valueOf;b.prototype.valueOf=function(){return this.value};b.prototype.toJSNumber=b.prototype.valueOf;c.prototype.valueOf=c.prototype.toJSNumber=function(){return parseInt(this.toString(),10)};function +V(d){if(l(+d)){var +n=+d;if(n===r(n))return F?new +c(g(n)):new +b(n);throw new +Error(py+d)}var +s=d[0]===cU;if(s)d=d.slice(1);var h=d.split(/e/i);if(h.length>2)throw new -Error(f$+h.join(gf));if(h.length===2){var -e=h[1];if(e[0]===bN)e=e.slice(1);e=+e;if(e!==r(e)||!m(e))throw new -Error(f$+e+" is not a valid exponent.");var -f=h[0],i=f.indexOf(bP);if(i>=0){e-=f.length-i-1;f=f.slice(0,i)+f.slice(i+1)}if(e<0)throw new +Error(py+h.join(pH));if(h.length===2){var +e=h[1];if(e[0]===fc)e=e.slice(1);e=+e;if(e!==r(e)||!l(e))throw new +Error(py+e+" is not a valid exponent.");var +f=h[0],i=f.indexOf(e5);if(i>=0){e-=f.length-i-1;f=f.slice(0,i)+f.slice(i+1)}if(e<0)throw new Error("Cannot include negative exponent part for integers");f+=new -Array(e+1).join(s);d=f}var +Array(e+1).join(p);d=f}var t=/^([0-9][0-9]*)$/.test(d);if(!t)throw new -Error(f$+d);if(G)return new -c(g(p?aL+d:d));var -o=[],j=d.length,n=aa,k=j-n;while(j>0){o.push(+d.slice(k,j));k-=n;if(k<0)k=0;j-=n}q(o);return new -a(o,p)}function -ag(a){if(G)return new -c(g(a));if(m(a)){if(a!==r(a))throw new +Error(py+d);if(F)return new +c(g(s?cU+d:d));var +q=[],j=d.length,o=$,k=j-o;while(j>0){q.push(+d.slice(k,j));k-=o;if(k<0)k=0;j-=o}m(q);return new +a(q,s)}function +af(a){if(F)return new +c(g(a));if(l(a)){if(a!==r(a))throw new Error(a+" is not an integer.");return new -b(a)}return W(a.toString())}function +b(a)}return V(a.toString())}function e(a){if(typeof -a==="number")return ag(a);if(typeof -a==="string")return W(a);if(typeof +a==="number")return af(a);if(typeof +a==="string")return V(a);if(typeof a==="bigint")return new c(a);return a}for(var -k=0;k0)d[-k]=e(-k)}d.one=d[1];d.zero=d[0];d.minusOne=d[-1];d.max=T;d.min=L;d.gcd=Q;d.lcm=ae;d.isInstance=function(d){return d +k=0;k0)d[-k]=e(-k)}d.one=d[1];d.zero=d[0];d.minusOne=d[-1];d.max=S;d.min=K;d.gcd=P;d.lcm=ad;d.isInstance=function(d){return d instanceof a||d instanceof b||d instanceof -c};d.randBetween=ah;d.fromArray=function(b,a,c){return V(b.map(e),e(a||10),c)};return d}();function -aY(a){var -b=a.toJSNumber()|0;if(a.equals(x(b)))return b;return a}function -o6(a){return aY(x(a).abs())}function -o7(a,b){return aY(x(a).add(x(b)))}function -c8(a,b){return x(a).compare(x(b))}function -o8(b,a){a=x(a);if(a.equals(x(0)))dJ();return aY(x(b).divide(x(a)))}function -O1(b,a){a=x(a);if(a.equals(x(0)))dJ();return aY(x(b).mod(a))}function -o9(a,b){return[0,o8(a,b),O1(a,b)]}function -o_(a,b){return o8(a,b)}function -OR(a,b){return x(a).equals(x(b))?1:0}function -OT(a,b){return aY(x.gcd(x(a),x(b)).abs())}function -OH(c,e,g){e=x(e);var +c};d.randBetween=ag;d.fromArray=function(b,a,c){return U(b.map(e),e(a||10),c)};return d}();function +c2(a){var +b=a.toJSNumber()|0;if(a.equals(aw(b)))return b;return a}function +M7(a){return c2(aw(a).abs())}function +M8(a,b){return c2(aw(a).add(aw(b)))}function +eq(a,b){return aw(a).compare(aw(b))}function +jb(b,a){a=aw(a);if(a.equals(aw(0)))i_();return c2(aw(b).divide(aw(a)))}function +bOY(b,a){a=aw(a);if(a.equals(aw(0)))i_();return c2(aw(b).mod(a))}function +tW(a,b){return[0,jb(a,b),bOY(a,b)]}function +M9(a,b){return jb(a,b)}function +bOM(a,b){return aw(a).equals(aw(b))}function +dr(a){return aw(a).compare(aw.zero)}function +tY(a,b){return c2(aw(a).subtract(aw(b)))}function +bON(a,b){var +c=dr(a),d=dr(b);if(c*d<0)if(!aw(a).mod(aw(b)).equals(aw(0)))return tY(jb(a,b),aw(1));return jb(a,b)}function +bOP(a,b){return c2(aw.gcd(aw(a),aw(b)).abs())}function +bOD(c,e,g){e=aw(e);var a=e.toArray(Math.pow(2,32));c.write(8,a.isNegative?1:0);var f=a.value.length,d=f*4;c.write(32,d);for(var -b=f-1;b>=0;b--){c.write(8,a.value[b]>>>0&a4);c.write(8,a.value[b]>>>8&a4);c.write(8,a.value[b]>>>16&a4);c.write(8,a.value[b]>>>24&a4)}g[0]=4*(1+((d+3)/4|0));g[1]=8*(1+((d+7)/8|0))}function -OI(b,g){var +b=f-1;b>=0;b--){c.write(8,a.value[b]>>>0&di);c.write(8,a.value[b]>>>8&di);c.write(8,a.value[b]>>>16&di);c.write(8,a.value[b]>>>24&di)}g[0]=4*(1+((d+3)/4|0));g[1]=8*(1+((d+7)/8|0))}function +bOE(b,g){var e;switch(b.read8u()){case 1:e=true;break;case -0:e=false;break;default:bd("input_value: z (malformed input)")}var -f=b.read32u(),c=x(0);for(var +0:e=false;break;default:dI("input_value: z (malformed input)")}var +f=b.read32u(),c=aw(0);for(var d=0;d>>0);c=a.shiftLeft(d*32).add(c)}if(e)c=c.negate();g[0]=f+4;return aY(c)}function -OU(d){var -b=x(d).toArray(Math.pow(2,32)),a=0;for(var -c=0;c>>0);c=a.shiftLeft(d*32).add(c)}if(e)c=c.negate();g[0]=f+4;return c2(c)}function +bOQ(d){var +b=aw(d).toArray(Math.pow(2,32)),a=0;for(var +c=0;c=48&&a<=57)return a-48;if(a>=97&&a<=lZ)return a-97+10;if(a>=65&&a<=70)return a-65+10}var -d=0;if(a[d]==bN)a=a.substring(1);else -if(a[d]==aL)d++;if(a[d]==ia)ah(nT);a=a.replace(/_/g,l);if(a==aL||a==l)a=s;for(;d=c)ah(nT)}return aY(x(a,c))}function -c9(d,a,b,c){a=a5(a);if(b!=0||c!=a.length){if(a.length-b=0?1:0}function -gw(a){a=x(a);if(!OS(a))gr(cl(hL));var -b=x(mv),d=a.and(b).toJSNumber(),c=a.shiftRight(32).and(b).toJSNumber(),e=oQ(d,c);return e}var -O5=function(){var -b=[bb,bb,bb,bb,bb,bb,bq,0x03,kG,bq,bq,0x87,kG,bq,bq,0x07,bb,bb,bb,bb,bb,bb,bb,bb,bq,bq,nh,bq,bq,bq,nh,bq],c={CHAR:0,CHARNORM:1,STRING:2,STRINGNORM:3,CHARCLASS:4,BOL:5,EOL:6,WORDBOUNDARY:7,BEGGROUP:8,ENDGROUP:9,REFGROUP:10,ACCEPT:11,SIMPLEOPT:12,SIMPLESTAR:13,SIMPLEPLUS:14,GOTO:15,PUSHBACK:16,SETMARK:17,CHECKPROGRESS:18};function +bOV(a){return c2(aw(a).negate())}function +tX(b){b=aw(b).abs();var +c=0,a=aw.one;while(a.leq(b)){c+=1;a=a.multiply(2)}return c}function +bOW(a){if(a==Infinity||a==-Infinity||a!=a)kW(fk(n0));return c2(aw(a<0?Math.ceil(a):Math.floor(a)))}function +bOJ(c,a){if(c==0){c=10;var +b=0,g=1;if(a[b]==cU){g=-1;b++}else +if(a[b]==fc)b++;if(a[b]==p){b++;if(a.length==b)return 0;else{var +d=a[b];if(d=="o"||d=="O")c=8;else +if(d==Ea||d=="X")c=16;else +if(d==yv||d=="B")c=2;if(c!=10){a=a.substring(b+1);if(g==-1)a=cU+a}}}}if(a[0]==fc)a=a.substring(1);a=a.replace(/^0+/,ac);if(a==cU||a==ac)a=p;function +h(a){if(a>=48&&a<=57)return a-48;if(a>=97&&a<=Cj)return a-97+10;if(a>=65&&a<=70)return a-65+10}var +e=0;if(a[e]==cU)e++;for(;e=c)b4("Z.of_substring_base: invalid digit")}return c2(aw(a,c))}function +hA(d,a,b,c){a=dq(a);if(b!=0||c!=a.length){if(a.length-b=0?1:0}function +p3(a){a=aw(a);if(!bOO(a))kW(fk(n0));var +b=aw(KG),d=a.and(b).toJSNumber(),c=a.shiftRight(32).and(b).toJSNumber(),e=MR(d,c);return e}var +bO2=function(){var +b=[dF,dF,dF,dF,dF,dF,ef,0x03,ER,ef,ef,0x87,ER,ef,ef,0x07,dF,dF,dF,dF,dF,dF,dF,dF,ef,ef,Lh,ef,ef,ef,Lh,ef],c={CHAR:0,CHARNORM:1,STRING:2,STRINGNORM:3,CHARCLASS:4,BOL:5,EOL:6,WORDBOUNDARY:7,BEGGROUP:8,ENDGROUP:9,REFGROUP:10,ACCEPT:11,SIMPLEOPT:12,SIMPLESTAR:13,SIMPLEPLUS:14,GOTO:15,PUSHBACK:16,SETMARK:17,CHECKPROGRESS:18};function r(a){return b[a>>3]>>(a&7)&1}function -o(b,a){return B(b,a>>3)>>(a&7)&1}function +o(b,a){return aL(b,a>>3)>>(a&7)&1}function a(m,b,a,B){var -w=dI(m[1]),k=dI(m[2]),v=a5(m[3]),y=m[4]|0,z=m[5]|0,C=m[6]|0,b=oy(b),l=0,x=false,t=[],i=new +w=fi(m[1]),k=fi(m[2]),v=dq(m[3]),y=m[4]|0,z=m[5]|0,C=m[6]|0,b=Mz(b),l=0,x=false,t=[],i=new Array(y),q=new Array(z);for(var f=0;f>8,d=s&a4,g=b[a],h;l++;switch(A){case +A=w[l]&di,s=w[l]>>8,d=s&di,g=b[a],h;l++;switch(A){case c.CHAR:if(a===b.length){j();break}if(g===d)a++;else e();break;case c.CHARNORM:if(a===b.length){j();break}if(v.charCodeAt(g)===d)a++;else e();break;case c.STRING:for(var -n=a5(k[d]),f=0;f0&&b[a-1]!=10)e();break;case @@ -1241,621 +1247,643 @@ c.PUSHBACK:p({pos:{pc:l+s,txt:a}});break;case c.SETMARK:p({undo:{obj:q,prop:d,value:q[d]}});q[d]=a;break;case c.CHECKPROGRESS:if(q[d]===a)e();break;default:throw new Error("Invalid bytecode")}}return 0}return a}();function -O6(d,b,a){if(a<0||a>w(b))ah("Str.search_forward");while(a<=w(b)){var -c=O5(d,b,a,0);if(c)return c;a++}return[0]}function -gx(){return new -Date().getTime()/a2}function -dM(e){var +bO3(d,b,a){if(a<0||a>ay(b))b4("Str.search_forward");while(a<=ay(b)){var +c=bO2(d,b,a,0);if(c)return c;a++}return[0]}function +p4(){return new +Date().getTime()/dp}function +jc(e){var a=new -Date(e*a2),b=a.getTime(),d=new -Date(Date.UTC(a.getUTCFullYear(),0,1)).getTime(),c=Math.floor((b-d)/la);return[0,a.getUTCSeconds(),a.getUTCMinutes(),a.getUTCHours(),a.getUTCDate(),a.getUTCMonth(),a.getUTCFullYear()-ch,a.getUTCDay(),c,false|0]}function -gy(){return 0}function -O8(h){var +Date(e*dp),b=a.getTime(),d=new +Date(Date.UTC(a.getUTCFullYear(),0,1)).getTime(),c=Math.floor((b-d)/Jq);return[0,a.getUTCSeconds(),a.getUTCMinutes(),a.getUTCHours(),a.getUTCDate(),a.getUTCMonth(),a.getUTCFullYear()-fQ,a.getUTCDay(),c,false|0]}function +p5(){return 0}function +bO5(h){var a=new -Date(h*a2),b=a.getTime(),e=new -Date(a.getFullYear(),0,1).getTime(),c=Math.floor((b-e)/la),d=new +Date(h*dp),b=a.getTime(),e=new +Date(a.getFullYear(),0,1).getTime(),c=Math.floor((b-e)/Jq),d=new Date(a.getFullYear(),0,1),f=new -Date(a.getFullYear(),6,1),g=Math.max(d.getTimezoneOffset(),f.getTimezoneOffset());return[0,a.getSeconds(),a.getMinutes(),a.getHours(),a.getDate(),a.getMonth(),a.getFullYear()-ch,a.getDay(),c,a.getTimezoneOffset()f)a+=cd;var +d=f;df)a+=fG;var c=e[d];if(typeof c=="number")a+=c.toString();else if(c instanceof -b0)a+=cC+c.toString()+cC;else +fg)a+=gf+c.toString()+gf;else if(typeof -c=="string")a+=cC+c.toString()+cC;else -a+=ia}a+=")"}else -if(b[0]==Q)a+=b[1];return a}function -oM(a){if(a +c=="string")a+=gf+c.toString()+gf;else +a+=LD}a+=")"}else +if(b[0]==bl)a+=b[1];return a}function +MN(a){if(a instanceof -Array&&(a[0]==0||a[0]==Q)){var -c=cl(mZ);if(c)c(a,false);else{var -d=N0(a),b=cl(kC);if(b)b(0);C.console.error(ic+d+kY)}}else +Array&&(a[0]==0||a[0]==bl)){var +c=fk(Dj);if(c)c(a,false);else{var +d=bNX(a),b=fk(wM);if(b)b(0);aO.console.error(so+d+Fb)}}else throw a}function -OB(){var -a=C;if(a.process&&a.process.on)a.process.on("uncaughtException",function(b,c){oM(b);a.process.exit(2)});else -if(a.addEventListener)a.addEventListener("error",function(a){if(a.error)oM(a.error)})}OB();function -b(a,b){return a.length==1?a(b):bE(a,[b])}function -j(a,b,c){return a.length==2?a(b,c):bE(a,[b,c])}function -P(a,b,c,d){return a.length==3?a(b,c,d):bE(a,[b,c,d])}function -fs(a,b,c,d,e,f){return a.length==5?a(b,c,d,e,f):bE(a,[b,c,d,e,f])}function -NQ(a,b,c,d,e,f,g,h){return a.length==7?a(b,c,d,e,f,g,h):bE(a,[b,c,d,e,f,g,h])}N1();var -gA=[Q,a(mw),-1],iN=[Q,a(m1),-2],cm=[Q,a(h4),-3],cQ=[Q,a(nB),-4],iO=[Q,a(l6),-6],aC=[Q,a(nI),-7],iL=[Q,a(k$),-8],iM=[Q,a(nL),-9],H=[Q,a(n9),-11],iP=[Q,a(mK),h0],NP=[4,0,0,0,[12,45,[4,0,0,0,0]]],gN=[0,[11,a('File "'),[2,0,[11,a('", line '),[4,0,0,0,[11,a(ng),[4,0,0,0,[12,45,[4,0,0,0,[11,a(": "),[2,0,0]]]]]]]]]],a('File "%s", line %d, characters %d-%d: %s')],de=[0,0,0],fr=[0,a(mR),a(no),a(nM),a(ll)];bw(11,iP,mK);bw(10,H,n9);bw(9,[Q,a(lw),-10],lw);bw(8,iM,nL);bw(7,iL,k$);bw(6,aC,nI);bw(5,iO,l6);bw(4,[Q,a(m4),-5],m4);bw(3,cQ,nB);bw(2,cm,h4);bw(1,iN,m1);bw(0,gA,mw);var -ps=a("output_substring"),pp=a("%.12g"),po=a(bP),pm=a(lE),pn=a(nD),pd=a("Stdlib.Exit"),pf=cN(0,0,nG),ph=cN(0,0,65520),pj=cN(1,0,nG),pv=a(lS),pw=a("\\'"),px=a(lj),py=a(ob),pz=a(kT),pA=a(m_),pu=a("Char.chr"),pE=a("nth"),pF=a("List.nth"),pD=a("tl"),pC=a("hd"),pI=a("String.blit / Bytes.blit_string"),pH=a("Bytes.blit"),pG=a("String.sub / Bytes.sub"),pM=a("String.contains_from / Bytes.contains_from"),pK=a(l),pJ=a("String.concat"),pQ=a("Array.blit"),pP=a("Array.sub"),pV=a("Map.remove_min_elt"),pW=[0,0,0,0],pX=[0,a("map.ml"),hX,10],pY=[0,0,0],pR=a(fH),pS=a(fH),pT=a(fH),pU=a(fH),pZ=a("Stdlib.Queue.Empty"),p1=a("CamlinternalLazy.Undefined"),p8=a("Buffer.add_substring/add_subbytes"),p7=a("Buffer.add: cannot grow buffer"),p6=[0,a(nS),93,2],p5=[0,a(nS),94,2],p4=a("Buffer.sub"),qf=a("%c"),qg=a("%s"),qh=a(h1),qi=a(k8),qj=a(ny),qk=a(mS),ql=a("%f"),qm=a(mB),qn=a("%{"),qo=a("%}"),qp=a("%("),qq=a("%)"),qr=a(mQ),qs=a("%t"),qt=a("%?"),qu=a("%r"),qv=a("%_r"),qw=[0,a(ax),850,23],qH=[0,a(ax),814,21],qz=[0,a(ax),815,21],qI=[0,a(ax),818,21],qA=[0,a(ax),819,21],qJ=[0,a(ax),822,19],qB=[0,a(ax),823,19],qK=[0,a(ax),826,22],qC=[0,a(ax),827,22],qL=[0,a(ax),831,30],qD=[0,a(ax),832,30],qF=[0,a(ax),836,26],qx=[0,a(ax),837,26],qG=[0,a(ax),846,28],qy=[0,a(ax),847,28],qE=[0,a(ax),851,23],rO=a(ls),rM=[0,a(ax),1558,4],rN=a("Printf: bad conversion %["),rP=[0,a(ax),1626,39],rQ=[0,a(ax),1649,31],rR=[0,a(ax),1650,31],rS=a("Printf: bad conversion %_"),rT=a(lq),rU=a(lA),rV=a(lq),rW=a(lA),r0=[0,[11,a("invalid box description "),[3,0,0]],a("invalid box description %S")],rY=a(l),rZ=[0,0,4],r1=a(l),r2=a(mz),r3=a("h"),r4=a("hov"),r5=a("hv"),r6=a("v"),rK=a(h6),rI=a("neg_infinity"),rJ=a(oc),rH=a(bP),rC=[0,h2],rq=a("%+nd"),rr=a("% nd"),rt=a("%+ni"),ru=a("% ni"),rv=a("%nx"),rw=a("%#nx"),rx=a("%nX"),ry=a("%#nX"),rz=a("%no"),rA=a("%#no"),rp=a("%nd"),rs=a(ny),rB=a("%nu"),rd=a("%+ld"),re=a("% ld"),rg=a("%+li"),rh=a("% li"),ri=a("%lx"),rj=a("%#lx"),rk=a("%lX"),rl=a("%#lX"),rm=a("%lo"),rn=a("%#lo"),rc=a("%ld"),rf=a(k8),ro=a("%lu"),q2=a("%+Ld"),q3=a("% Ld"),q5=a("%+Li"),q6=a("% Li"),q7=a("%Lx"),q8=a("%#Lx"),q9=a("%LX"),q_=a("%#LX"),q$=a("%Lo"),ra=a("%#Lo"),q1=a("%Ld"),q4=a(mS),rb=a("%Lu"),qP=a("%+d"),qQ=a("% d"),qS=a("%+i"),qT=a("% i"),qU=a("%x"),qV=a("%#x"),qW=a("%X"),qX=a("%#X"),qY=a("%o"),qZ=a("%#o"),qO=a(ig),qR=a(h1),q0=a(ls),p9=a("@]"),p_=a("@}"),p$=a("@?"),qa=a("@\n"),qb=a("@."),qc=a("@@"),qd=a("@%"),qe=a("@"),qM=a("CamlinternalFormat.Type_mismatch"),r_=a(l),r$=[0,[11,a(cd),[2,0,[2,0,0]]],a(", %s%s")],sy=[0,[11,a(ic),[2,0,[12,10,0]]],a(n4)],sz=[0,[11,a("Fatal error in uncaught exception handler: exception "),[2,0,[12,10,0]]],a("Fatal error in uncaught exception handler: exception %s\n")],sx=a("Fatal error: out of memory in uncaught exception handler"),sv=[0,[11,a(ic),[2,0,[12,10,0]]],a(n4)],sr=[0,[2,0,[12,10,0]],a("%s\n")],sj=a("Raised at"),sk=a("Re-raised at"),sl=a("Raised by primitive operation at"),sm=a("Called from"),sn=a(" (inlined)"),sp=a(l),so=[0,[2,0,[12,32,[2,0,[11,a(' in file "'),[2,0,[12,34,[2,0,[11,a(", line "),[4,0,0,0,[11,a(ng),NP]]]]]]]]]],a('%s %s in file "%s"%s, line %d, characters %d-%d')],sq=[0,[2,0,[11,a(" unknown location"),0]],a("%s unknown location")],se=a("Out of memory"),sf=a("Stack overflow"),sg=a("Pattern matching failed"),sh=a("Assertion failed"),si=a("Undefined recursive module"),sa=[0,[12,40,[2,0,[2,0,[12,41,0]]]],a("(%s%s)")],sb=a(l),sc=a(l),sd=[0,[12,40,[2,0,[12,41,0]]],a("(%s)")],r9=[0,[4,0,0,0,0],a(ig)],r7=[0,[3,0,0],a("%S")],r8=a(ia),ss=[0,a(l),a("(Cannot print locations:\n bytecode executable program file not found)"),a("(Cannot print locations:\n bytecode executable program file appears to be corrupt)"),a("(Cannot print locations:\n bytecode executable program file has wrong magic number)"),a("(Cannot print locations:\n bytecode executable program file cannot be opened;\n -- too many open files. Try running with OCAMLRUNPARAM=b=2)")],sC=a("Fun.Finally_raised: "),sA=a("Stdlib.Fun.Finally_raised"),sD=a(nU),NN=a("OCAMLRUNPARAM"),NL=a("CAMLRUNPARAM"),sE=a(l),s5=[3,0,3],s6=a(bP),s0=a(gg),s1=a("<\/"),s2=a(l),sW=a(gg),sX=a(hS),sY=a(l),sU=a("\n"),sQ=a(l),sR=a(l),sS=a(l),sT=a(l),sP=[0,a(l)],sL=a(l),sM=a(l),sN=a(l),sO=a(l),sJ=[0,a(l),0,a(l)],sI=a(l),sH=a("Stdlib.Format.String_tag"),tf=a(l),tk=a(lF),tm=a(op),tn=a(mA),to=a(kX),tp=a(mu),tq=a(nb),tr=a(lU),ts=a(ns),tt=a(hG),tu=a(lX),tv=a(nr),tw=a(mn),tx=a(nt),ty=a(lT),tz=a(kB),tA=a(ot),tB=a(kV),tC=a(k2),tD=a(mf),tE=a(mT),tF=a(gd),tG=a(lk),tH=a(of),tI=a(nx),tJ=a(n1),tK=a(mM),tL=a(f6),tM=a(ih),tN=a(lf),tO=a(le),tP=a(mb),tQ=a(oi),tR=a(oe),tS=a(ol),tT=a(lG),tU=a(k_),tV=a(lt),tW=a(m7),tX=a(on),tY=a(mk),tZ=a(lL),t0=a(mx),t1=a(k1),t2=a(mo),t3=a(kH),t4=a(nv),t5=a(n$),t6=a(lK),t7=a(lh),t8=a(mj),t9=a(mN),t_=a(l2),t$=a(m3),ua=a(mt),ub=a(nu),uc=a(lW),ud=a(lH),ue=a(nR),uf=a(nl),ug=a(n6),uh=a(nf),ui=a(na),uj=a(m$),uk=a(k0),ul=a(lN),um=a(lr),un=a(nF),uo=a(nX),up=[0,[11,a("EUNKNOWNERR "),[4,0,0,0,0]],a("EUNKNOWNERR %d")],tl=[0,[11,a("Unix.Unix_error(Unix."),[2,0,[11,a(cd),[3,0,[11,a(cd),[3,0,[12,41,0]]]]]]],a("Unix.Unix_error(Unix.%s, %S, %S)")],tg=a(es),th=a(l),ti=a(l),tj=a(es),uq=a("0.0.0.0"),ur=a("127.0.0.1"),NK=a("::"),NJ=a("::1"),uH=a(l),uI=a(l),uT=a("Str.matched_group"),uO=[0,92],uQ=a("\\( group not closed by \\)"),uP=[0,a(kL),520,10],uR=a("[ class not closed by ]"),uS=a("spurious \\) in regular expression"),uK=a("too many r* or r+ where r is nullable"),uL=a(l),uM=a(l),uJ=[0,a(kL),213,11],uX=[0,a(m8),52,4],uW=[0,a(m8),58,34],uV=a("Not a valid time zone"),w9=a("Not a month"),w7=a("Not a day"),w4=a("from_business: bad week"),w5=a("from_business: bad date"),wf=[0,a(mO),l1,4],we=[0,a(mO),cj,4],v9=[0,-4713,12,31],v_=[0,nn,1,23],v$=[0,en,10,14],wa=[0,en,10,5],v7=a("Date.Out_of_bounds"),v8=a("Date.Undefined"),wv=a("Date.Period.Not_computable"),wE=[0,31,59,90,fx,c0,il,212,243,273,304,334,fM],xb=[0,a(f9),429,6],xa=[0,a(f9),230,4],w$=[0,a(f9),fG,6],w_=[0,a(f9),67,4],yy=a("seconds_since_1970"),yv=a("second"),yt=a("minute"),yr=a("hour"),yn=a("date"),yk=a("Cannot create the "),yb=a("%j (year not provided)"),xZ=a("%:"),xY=a("%::::"),yi=[0,a(cy),402,6],x0=a(k4),x1=a(":::z"),x2=a(nk),x3=a(mY),x4=[0,a(cy),509,12],x5=a("am"),x6=a("pm"),x7=a(cC),x8=a(cC),x9=a("%P"),x_=a("%V"),x$=a("%W"),ya=a("%j"),yh=a("%w"),xX=a(k3),yc=a(od),yd=a(mg),ye=a(cC),yf=a(cC),yg=a("%p"),yj=[0,a(cy),f5,6],xT=a("[\\+-]"),xU=a(bN),xV=a(aL),xW=[0,a(cy),396,8],xR=a(" (either week or year is not provided)"),xS=a("[0-9][0-9]\\(\\.[0-9]*\\)?"),xP=[0,a(cy),fv,6],xO=a("z\\|:z\\|::z"),xK=a(nk),xL=a(mY),xM=a(k4),xN=[0,a(cy),278,13],xJ=a(k3),xQ=[0,a(cy),297,6],xI=a(od),xH=a(mg),xA=a(" does not match the format "),xz=a("bad format: "),xy=[0,a(cy),81,2],xm=a("January"),xn=a("February"),xo=a("March"),xp=a("April"),xq=a("May"),xr=a("June"),xs=a("July"),xt=a("August"),xu=a("September"),xv=a("October"),xw=a("November"),xx=a("December"),xf=a("Sunday"),xg=a("Monday"),xh=a("Tuesday"),xi=a("Wednesday"),xj=a("Thursday"),xk=a("Friday"),xl=a("Saturday"),xB=a("%b"),xC=a(mB),xD=a("%A"),xE=a("[a-zA-Z]+"),yp=a(h1),yE=cN(1,0,0),yA=a("Z.Overflow"),yB=a(hL),yI=a(l),yJ=a("+inf"),yK=a("-inf"),yL=a(oj),yM=a("undef"),yO=[0,a("q.ml"),486,25],yN=a("Q.of_string: invalid digit"),yG=a("impossible case"),zl=[0,a(hT),72,32],zi=[0,a(hT),72,32],zh=a(l),zd=a("NaN value not allowed in standard JSON"),ze=[0,[8,[0,0,3],0,[0,16],0],a(mJ)],zg=[0,[8,[0,0,3],0,[0,17],0],a(ms)],zf=a(ne),zb=a("Infinity value not allowed in standard JSON"),zc=a("-Infinity value not allowed in standard JSON"),y9=a("NaN"),y_=[0,[8,[0,0,3],0,[0,16],0],a(mJ)],za=[0,[8,[0,0,3],0,[0,17],0],a(ms)],y$=a(ne),y7=a("Infinity"),y8=a("-Infinity"),y5=a(lE),y6=a(nD),y4=a("null"),yY=a(lj),yZ=a(ob),y0=a(kT),y1=a("\\f"),y2=a(m_),y3=a('\\"'),yX=a(lS),yW=[0,[11,a("src="),[3,0,[11,a(" start="),[4,3,0,0,[11,a(" len="),[4,3,0,0,[12,10,[10,0]]]]]]]],a("src=%S start=%i len=%i\n%!")],yU=a("\\u00"),yR=[0,a(hT),72,32],yP=a("Yojson.Json_error"),yT=[0,a(hO),a(h3),a(ie),a(hP),a(ik),a(l),a(l),a(l),a(l),a(l),a(l)],zk=[0,a(hO),a(h3),a(ie),a(hP),a(ik),a(l),a(l),a(l),a(l),a(l),a(l)],zn=[0,a(hO),a(h3),a(ie),a(hP),a(ik),a(l),a(l),a(l),a(l),a(l),a(l)],Al=a("unreachable due to the [is_subscope_call] test"),An=a("unreachable due to the [is_subscope_input_var_def] test"),Ao=a("]"),Ap=a("["),Aq=a(" ]): expected variable definition (function output), found: "),Ar=a(cd),As=a(kO),At=a(" ]): expected variable definition (function output), found: end of tokens"),Au=a(cd),Av=a(kO),Am=a("Unexpected event: "),Ax=a("Missing function output variable definition."),Aw=a("Invalid start of function call."),Ak=a(aw),Aj=a(ay),Ay=[0,[11,a("An error occurred while parsing raw events: "),[2,0,[12,10,0]]],a("An error occurred while parsing raw events: %s\n")],z$=a(mV),Aa=a(cd),Ab=[0,[11,a(kI),0],a(kI)],Ac=a(mV),Ad=a(cd),Ae=[0,[11,a(nA),0],a(nA)],Af=a(cd),Ag=[0,[11,a("VariableDefinition([ "),[2,0,[11,a(" ], "),[2,0,[12,41,0]]]]],a("VariableDefinition([ %s ], %s)")],Ah=[0,[11,a(lJ),0],a(lJ)],zV=[0,aP,a("VarComputation")],zW=[0,aP,a("FunCall")],zX=a(lY),zY=a("inputs"),zZ=a(mX),z0=[0,aP,a("SubScopeCall")],z1=a("fun_calls"),z2=a("value"),z3=a(mX),z4=a("pos"),z5=a(ay),z6=a(lY),z7=a(aw),z8=a("fun_name"),zK=[0,az,[0,[0,aP,a("Unit")],0]],zL=[0,az,[0,[0,aP,a("Unembeddable")],0]],zM=[0,aP,a("Bool")],zN=[0,aP,a("Money")],zO=[0,aP,a("Integer")],zP=[0,aP,a("Decimal")],zQ=[0,aP,a("Date")],zR=[0,aP,a("Duration")],zS=[0,aP,a("Enum")],zT=[0,aP,a("Struct")],zU=[0,aP,a("Array")],zH=[0,[12,44,[17,[0,a("@ "),1,0],0]],a(",@ ")],zG=[0,[4,0,0,0,[12,32,[2,0,0]]],a("%d %s")],zD=a("days"),zE=a("months"),zF=a("years"),zI=[0,[15,0],a(mQ)],zJ=a("empty duration"),zp=a("law_headings"),zq=a("end_column"),zr=a("end_line"),zs=a("start_column"),zt=a("start_line"),zu=a("filename"),zv=a("Runtime.EmptyError"),zw=a("Runtime.AssertionFailed"),zy=a("Runtime.ConflictError"),zA=a("Runtime.ImpossibleDate"),zC=a("Runtime.NoValueProvided"),MX=[0,a(at),90,14,90,29,[0,a(bh),[0,a(as),0]]],MW=[0,a(at),80,34,80,40,[0,a(bh),[0,a(as),0]]],MR=[0,a(at),br,18,br,64,[0,a(bh),[0,a(as),0]]],MQ=[0,a(i),cE,55,cE,64,[0,a(o),[0,a(h),[0,a(e),0]]]],MN=[0,a(at),87,14,87,53,[0,a(bh),[0,a(as),0]]],MM=[0,a(i),95,35,95,52,[0,a(o),[0,a(h),[0,a(e),0]]]],MJ=[0,a(at),86,14,86,50,[0,a(bh),[0,a(as),0]]],MI=[0,a(i),92,32,92,36,[0,a(o),[0,a(h),[0,a(e),0]]]],MF=[0,a(at),89,14,89,46,[0,a(bh),[0,a(as),0]]],ME=[0,a(i),89,28,89,40,[0,a(o),[0,a(h),[0,a(e),0]]]],MB=[0,a(at),88,14,88,54,[0,a(bh),[0,a(as),0]]],MA=[0,a(i),88,36,88,42,[0,a(o),[0,a(h),[0,a(e),0]]]],Mx=[0,a(at),97,18,97,72,[0,a(bh),[0,a(as),0]]],Mw=[0,a(i),87,63,87,72,[0,a(o),[0,a(h),[0,a(e),0]]]],Mt=[0,a(at),93,18,93,67,[0,a(bh),[0,a(as),0]]],Ms=[0,a(i),86,58,86,67,[0,a(o),[0,a(h),[0,a(e),0]]]],Mp=[0,a(at),cJ,14,cJ,30,[0,a("Article L131-1"),[0,a(bh),[0,a(as),0]]]],Mm=[0,0],Mn=[1,0],Mo=[2,0],Ml=[0,a(at),76,36,76,53,[0,a(bh),[0,a(as),0]]],Mk=[0,a(at),76,11,76,27,[0,a(bh),[0,a(as),0]]],Mq=[0,a(bA),[0,a("enfants_\xc3\xa0_charge"),0]],Mu=[0,a(bA),[0,a("allocations_familiales.personne_charge_effective_permanente_est_parent"),0]],Mr=[0,a(i),86,10,86,57,[0,a(o),[0,a(h),[0,a(e),0]]]],My=[0,a(bA),[0,a("allocations_familiales.personne_charge_effective_permanente_remplit_titre_I"),0]],Mv=[0,a(i),87,10,87,62,[0,a(o),[0,a(h),[0,a(e),0]]]],MC=[0,a(bA),[0,a("allocations_familiales.ressources_m\xc3\xa9nage"),0]],Mz=[0,a(i),88,10,88,27,[0,a(o),[0,a(h),[0,a(e),0]]]],MG=[0,a(bA),[0,a("allocations_familiales.r\xc3\xa9sidence"),0]],MD=[0,a(i),89,10,89,19,[0,a(o),[0,a(h),[0,a(e),0]]]],MK=[0,a(bA),[0,a("allocations_familiales.date_courante"),0]],MH=[0,a(i),92,10,92,23,[0,a(o),[0,a(h),[0,a(e),0]]]],MO=[0,a(bA),[0,a("allocations_familiales.enfants_\xc3\xa0_charge"),0]],ML=[0,a(i),95,10,95,26,[0,a(o),[0,a(h),[0,a(e),0]]]],MS=[0,a(bA),[0,a("allocations_familiales.avait_enfant_\xc3\xa0_charge_avant_1er_janvier_2012"),0]],MP=[0,a(i),cE,10,cE,54,[0,a(o),[0,a(h),[0,a(e),0]]]],MT=[0,a(bA),[0,a(kZ),[0,a(f),0]]],MU=[0,a(bA),[0,a(kZ),[0,a(f),0]]],MV=[0,a(at),80,10,80,25,[0,a(bh),[0,a(as),0]]],MY=[0,a(bA),[0,a("i_montant_vers\xc3\xa9"),0]],Mh=[0,a(at),45,14,45,27,[0,a(cD),[0,a(as),0]]],Mg=a(s),Mf=[0,a(i),br,32,br,38,[0,a(o),[0,a(h),[0,a(e),0]]]],Mc=[0,a(U),il,14,il,62,[0,a(aW),[0,a(E),[0,a(F),[0,a(z),[0,a(T),[0,a(v),0]]]]]]],L9=[0,a(f),[0,a(ex),[0,a(aw),0]]],L_=[0,a(f),[0,a(ex),0]],L$=[0,a(f),[0,a(ex),[0,a(ay),0]]],Ma=[0,a(f),[0,a(ex),0]],Mb=a(s),L8=[0,a(i),f0,68,f0,74,[0,a(o),[0,a(h),[0,a(e),0]]]],L5=[0,a(U),f7,14,f7,61,[0,a(aW),[0,a(E),[0,a(F),[0,a(z),[0,a(T),[0,a(v),0]]]]]]],L4=[0,a(i),ft,67,ft,73,[0,a(o),[0,a(h),[0,a(e),0]]]],L1=[0,a(at),39,14,39,38,[0,a(cD),[0,a(as),0]]],LW=[0,a(f),[0,a(ek),[0,a(aw),0]]],LX=[0,a(f),[0,a(ek),0]],LY=[0,a(f),[0,a(ek),[0,a(ay),0]]],LZ=[0,a(f),[0,a(ek),0]],LV=a(s),L0=a(s),LU=[0,a(i),f3,44,f3,50,[0,a(o),[0,a(h),[0,a(e),0]]]],LR=[0,a(at),37,14,37,32,[0,a(cD),[0,a(as),0]]],LQ=a(s),LP=[0,a(i),gc,38,gc,44,[0,a(o),[0,a(h),[0,a(e),0]]]],LM=[0,a(bp),f7,5,f7,43,[0,a("Article R521-4"),[0,a(E),[0,a(F),[0,a(z),[0,a(bt),[0,a(v),0]]]]]]],LB=[0,a(f),[0,a(cf),[0,a(aw),0]]],LC=[0,a(f),[0,a(cf),0]],LD=[0,a(f),[0,a(cf),[0,a(ay),0]]],LE=[0,a(f),[0,a(cf),0]],LF=a(dr),LK=a(mF),LL=a(er),LG=[0,a(f),[0,a(ef),[0,a(aw),0]]],LH=[0,a(f),[0,a(ef),0]],LI=[0,a(f),[0,a(ef),[0,a(ay),0]]],LJ=[0,a(f),[0,a(ef),0]],LA=[0,a(i),fB,3,fB,81,[0,a(o),[0,a(h),[0,a(e),0]]]],Lz=[0,a(i),fB,11,fB,49,[0,a(o),[0,a(h),[0,a(e),0]]]],Lx=[0,a(bp),du,14,du,46,[0,a(ge),[0,a(E),[0,a(F),[0,a(z),[0,a(bt),[0,a(v),0]]]]]]],Lw=[0,a(i),ez,52,ez,58,[0,a(o),[0,a(h),[0,a(e),0]]]],Ls=a(bs),Lt=[0,a(U),265,5,k6,42,[0,a(cG),[0,a(E),[0,a(F),[0,a(z),[0,a(T),[0,a(v),0]]]]]]],Lp=a(bs),Lq=a(dr),Lr=a(bs),Ln=a(bs),Lo=[0,a(U),m0,5,277,41,[0,a(cG),[0,a(E),[0,a(F),[0,a(z),[0,a(T),[0,a(v),0]]]]]]],Lk=a(bs),Ll=a(dr),Lm=a(bs),Lj=[0,a(U),fv,14,fv,55,[0,a(cG),[0,a(E),[0,a(F),[0,a(z),[0,a(T),[0,a(v),0]]]]]]],Li=a(s),Lh=[0,a(i),fZ,61,fZ,67,[0,a(o),[0,a(h),[0,a(e),0]]]],K_=[0,a(f),[0,a(ae),[0,a(aw),0]]],K$=[0,a(f),[0,a(ae),0]],La=[0,a(f),[0,a(ae),[0,a(ay),0]]],Lb=[0,a(f),[0,a(ae),0]],Lc=a(ad),Ld=a(hF),Le=[0,a(U),385,5,388,23,[0,a(ev),[0,a(ci),[0,a(dl),[0,a(bV),[0,a(T),[0,a(v),0]]]]]]],K9=a("0.0567"),K1=[0,a(f),[0,a(ae),[0,a(aw),0]]],K2=[0,a(f),[0,a(ae),0]],K3=[0,a(f),[0,a(ae),[0,a(ay),0]]],K4=[0,a(f),[0,a(ae),0]],K5=a(ad),K6=a("11"),K7=a(hF),K8=[0,a(U),376,5,379,42,[0,a(ev),[0,a(ci),[0,a(dl),[0,a(bV),[0,a(T),[0,a(v),0]]]]]]],K0=a("0.0369"),KZ=[0,a(U),22,14,22,40,[0,a(aW),[0,a(E),[0,a(F),[0,a(z),[0,a(T),[0,a(v),0]]]]]]],KV=[0,a(f),[0,a(el),[0,a(aw),0]]],KW=[0,a(f),[0,a(el),0]],KX=[0,a(f),[0,a(el),[0,a(ay),0]]],KY=[0,a(f),[0,a(el),0]],KU=[0,a(i),bB,3,bB,69,[0,a(o),[0,a(h),[0,a(e),0]]]],KT=[0,a(i),bB,11,bB,37,[0,a(o),[0,a(h),[0,a(e),0]]]],KQ=[8,0],KR=[0,a(I),c0,24,c0,44,[0,a(dy),[0,a(N),[0,a(O),0]]]],KO=a(ad),KP=[0,a(U),353,5,mU,69,[0,a(ev),[0,a(ci),[0,a(dl),[0,a(bV),[0,a(T),[0,a(v),0]]]]]]],KN=[0,a(U),18,14,18,34,[0,a(aW),[0,a(E),[0,a(F),[0,a(z),[0,a(T),[0,a(v),0]]]]]]],KM=[0,a(i),fw,40,fw,46,[0,a(o),[0,a(h),[0,a(e),0]]]],KJ=[0,a(U),lx,14,lx,39,[0,a(cG),[0,a(E),[0,a(F),[0,a(z),[0,a(T),[0,a(v),0]]]]]]],KE=[0,a(f),[0,a(eo),[0,a(aw),0]]],KF=[0,a(f),[0,a(eo),0]],KG=[0,a(f),[0,a(eo),[0,a(ay),0]]],KH=[0,a(f),[0,a(eo),0]],KI=a(ad),KD=a(s),KC=[0,a(i),cF,45,cF,51,[0,a(o),[0,a(h),[0,a(e),0]]]],Kv=[0,a(f),[0,a(ae),[0,a(aw),0]]],Kw=[0,a(f),[0,a(ae),0]],Kx=[0,a(f),[0,a(ae),[0,a(ay),0]]],Ky=[0,a(f),[0,a(ae),0]],Kz=[0,a(at),28,5,28,44,[0,a(cD),[0,a(as),0]]],Ku=a(s),Kp=[0,a(f),[0,a(ae),[0,a(aw),0]]],Kq=[0,a(f),[0,a(ae),0]],Kr=[0,a(f),[0,a(ae),[0,a(ay),0]]],Ks=[0,a(f),[0,a(ae),0]],Kt=[0,a(U),nd,5,nd,38,[0,a(aW),[0,a(E),[0,a(F),[0,a(z),[0,a(T),[0,a(v),0]]]]]]],Ko=a("0.04"),Kj=[0,a(f),[0,a(ae),[0,a(aw),0]]],Kk=[0,a(f),[0,a(ae),0]],Kl=[0,a(f),[0,a(ae),[0,a(ay),0]]],Km=[0,a(f),[0,a(ae),0]],Kn=[0,a(U),br,5,br,38,[0,a(aW),[0,a(E),[0,a(F),[0,a(z),[0,a(T),[0,a(v),0]]]]]]],Ki=a(lB),Kd=[0,a(f),[0,a(ae),[0,a(aw),0]]],Ke=[0,a(f),[0,a(ae),0]],Kf=[0,a(f),[0,a(ae),[0,a(ay),0]]],Kg=[0,a(f),[0,a(ae),0]],Kh=[0,a(U),60,5,60,38,[0,a(aW),[0,a(E),[0,a(F),[0,a(z),[0,a(T),[0,a(v),0]]]]]]],Kc=a(hC),Kb=[0,a(i),bz,3,bz,79,[0,a(o),[0,a(h),[0,a(e),0]]]],Ka=[0,a(i),bz,11,bz,47,[0,a(o),[0,a(h),[0,a(e),0]]]],J_=[0,a(bp),bB,14,bB,41,[0,a(ge),[0,a(E),[0,a(F),[0,a(z),[0,a(bt),[0,a(v),0]]]]]]],J8=a(er),J9=a(er),J7=[0,a(i),fJ,47,fJ,54,[0,a(o),[0,a(h),[0,a(e),0]]]],J3=[8,0],J4=[0,a(I),lc,5,lc,69,[0,a(S),[0,a(N),[0,a(O),0]]]],J0=a(ad),J1=a("0.3068"),J2=a(s),JY=[8,0],JZ=[0,a(I),oh,5,oh,69,[0,a(S),[0,a(N),[0,a(O),0]]]],JV=a(ad),JW=a("0.2936"),JX=a(s),JT=[8,0],JU=[0,a(I),kA,5,kA,69,[0,a(S),[0,a(N),[0,a(O),0]]]],JQ=a(ad),JR=a("0.2804"),JS=a(s),JO=[8,0],JP=[0,a(I),l3,5,l3,69,[0,a(S),[0,a(N),[0,a(O),0]]]],JL=a(ad),JM=a("0.2672"),JN=a(s),JJ=[8,0],JK=[0,a(I),k7,5,k7,69,[0,a(S),[0,a(N),[0,a(O),0]]]],JG=a(ad),JH=a("0.2613"),JI=a(s),JE=[8,0],JF=[0,a(I),h_,5,h_,69,[0,a(S),[0,a(N),[0,a(O),0]]]],JB=a(ad),JC=a("0.2555"),JD=a(s),Jz=[8,0],JA=[0,a(I),ep,5,ep,69,[0,a(S),[0,a(N),[0,a(O),0]]]],Jw=a(ad),Jx=a("0.2496"),Jy=a(s),Ju=[8,0],Jv=[0,a(I),n_,5,n_,69,[0,a(S),[0,a(N),[0,a(O),0]]]],Jr=a(ad),Js=a("0.2437"),Jt=a(s),Jp=[8,0],Jq=[0,a(I),nO,5,nO,69,[0,a(S),[0,a(N),[0,a(O),0]]]],Jm=a(ad),Jn=a("0.2379"),Jo=a(s),Jk=[8,0],Jl=[0,a(I),mC,5,mC,69,[0,a(S),[0,a(N),[0,a(O),0]]]],Jh=a(ad),Ji=a("0.232"),Jj=a(s),Jf=[8,0],Jg=[0,a(I),kR,14,kR,50,[0,a(dy),[0,a(N),[0,a(O),0]]]],Jc=a(ad),Jd=a(n7),Je=a(s),Jb=[0,a(U),38,14,38,50,[0,a(aW),[0,a(E),[0,a(F),[0,a(z),[0,a(T),[0,a(v),0]]]]]]],I_=a(ad),I$=a(n7),Ja=a(s),I9=[0,a(U),79,14,79,50,[0,a(aW),[0,a(E),[0,a(F),[0,a(z),[0,a(T),[0,a(v),0]]]]]]],I6=a(ad),I7=a(hC),I8=a(s),I5=[0,a(U),cJ,14,cJ,50,[0,a(aW),[0,a(E),[0,a(F),[0,a(z),[0,a(T),[0,a(v),0]]]]]]],I2=a(ad),I3=a(lB),I4=a(s),I1=[0,a(i),eu,56,eu,62,[0,a(o),[0,a(h),[0,a(e),0]]]],IY=[0,a(U),cj,14,cj,59,[0,a(aW),[0,a(E),[0,a(F),[0,a(z),[0,a(T),[0,a(v),0]]]]]]],IU=a(aM),IV=a(aM),IW=a("0.1025"),IX=a(s),IT=[0,a(U),84,14,84,59,[0,a(aW),[0,a(E),[0,a(F),[0,a(z),[0,a(T),[0,a(v),0]]]]]]],IP=a(aM),IQ=a(aM),IR=a("0.205"),IS=a(s),IO=[0,a(U),43,14,43,59,[0,a(aW),[0,a(E),[0,a(F),[0,a(z),[0,a(T),[0,a(v),0]]]]]]],IK=a(aM),IL=a(aM),IM=a("0.41"),IN=a(s),IJ=[0,a(i),fW,65,fW,71,[0,a(o),[0,a(h),[0,a(e),0]]]],IG=[0,a(U),R,5,R,43,[0,a(cG),[0,a(E),[0,a(F),[0,a(z),[0,a(T),[0,a(v),0]]]]]]],IF=a("0.05059"),IE=[0,a(U),232,5,233,46,[0,a(cG),[0,a(E),[0,a(F),[0,a(z),[0,a(T),[0,a(v),0]]]]]]],ID=a("0.10117"),IC=[0,a(U),f4,5,f4,43,[0,a(cG),[0,a(E),[0,a(F),[0,a(z),[0,a(T),[0,a(v),0]]]]]]],IB=a("0.20234"),IA=[0,a(i),cj,56,cj,62,[0,a(o),[0,a(h),[0,a(e),0]]]],Iw=a(bs),Ix=[0,a(U),l7,5,166,68,[0,a(aW),[0,a(E),[0,a(F),[0,a(z),[0,a(T),[0,a(v),0]]]]]]],It=a(bs),Iu=a(dr),Iv=a(bs),Ir=a(bs),Is=[0,a(U),173,5,174,68,[0,a(aW),[0,a(E),[0,a(F),[0,a(z),[0,a(T),[0,a(v),0]]]]]]],Io=a(bs),Ip=a(dr),Iq=a(bs),In=[0,a(U),k9,14,k9,34,[0,a(aW),[0,a(E),[0,a(F),[0,a(z),[0,a(T),[0,a(v),0]]]]]]],Im=a(s),Il=[0,a(i),fP,3,fP,63,[0,a(o),[0,a(h),[0,a(e),0]]]],Ik=[0,a(i),fP,11,fP,31,[0,a(o),[0,a(h),[0,a(e),0]]]],Ie=[0,a(f),[0,a(bQ),[0,a(aw),0]]],If=[0,a(f),[0,a(bQ),0]],Ig=[0,a(f),[0,a(bQ),[0,a(ay),0]]],Ih=[0,a(f),[0,a(bQ),0]],Ii=[0,a(aq),313,5,nZ,58,[0,a(n2),[0,a(E),[0,a(F),[0,a(z),[0,a(an),[0,a(v),0]]]]]]],H7=[0,a(f),[0,a(et),[0,a(aw),0]]],H8=[0,a(f),[0,a(et),0]],H9=[0,a(f),[0,a(et),[0,a(ay),0]]],H_=[0,a(f),[0,a(et),0]],H$=[0,a(f),[0,a(bQ),[0,a(aw),0]]],Ia=[0,a(f),[0,a(bQ),0]],Ib=[0,a(f),[0,a(bQ),[0,a(ay),0]]],Ic=[0,a(f),[0,a(bQ),0]],Id=[0,a(aq),oq,5,300,58,[0,a(n2),[0,a(E),[0,a(F),[0,a(z),[0,a(an),[0,a(v),0]]]]]]],H6=[0,a(i),fS,3,fS,61,[0,a(o),[0,a(h),[0,a(e),0]]]],H5=[0,a(i),fS,11,fS,34,[0,a(o),[0,a(h),[0,a(e),0]]]],H2=a(ad),H3=[0,a(aq),406,5,407,72,[0,a(hU),[0,a(ci),[0,a(fY),[0,a(bV),[0,a(an),[0,a(v),0]]]]]]],HZ=[8,0],H0=a(ad),H1=[0,a(I),mI,6,mI,71,[0,a(dy),[0,a(N),[0,a(O),0]]]],HX=a(aM),HY=[0,a(aq),br,5,br,70,[0,a(ov),[0,a(E),[0,a(F),[0,a(z),[0,a(an),[0,a(v),0]]]]]]],HW=[0,a(i),ej,29,ej,38,[0,a(o),[0,a(h),[0,a(e),0]]]],HS=[8,0],HT=[0,a(I),oa,5,oa,49,[0,a(S),[0,a(N),[0,a(O),0]]]],HP=a(s),HQ=a("5728"),HR=a(s),HN=[8,0],HO=[0,a(I),322,5,323,53,[0,a(S),[0,a(N),[0,a(O),0]]]],HK=a(s),HL=a("0.0717"),HM=a(s),HI=[8,0],HJ=[0,a(I),314,5,nZ,53,[0,a(S),[0,a(N),[0,a(O),0]]]],HF=a(s),HG=a("0.0847"),HH=a(s),HD=[8,0],HE=[0,a(I),306,5,307,53,[0,a(S),[0,a(N),[0,a(O),0]]]],HA=a(s),HB=a("0.0976"),HC=a(s),Hy=[8,0],Hz=[0,a(I),298,5,oq,53,[0,a(S),[0,a(N),[0,a(O),0]]]],Hv=a(s),Hw=a("0.1105"),Hx=a(s),Ht=[8,0],Hu=[0,a(I),290,5,hV,53,[0,a(S),[0,a(N),[0,a(O),0]]]],Hq=a(s),Hr=a("0.1163"),Hs=a(s),Ho=[8,0],Hp=[0,a(I),282,5,fv,53,[0,a(S),[0,a(N),[0,a(O),0]]]],Hl=a(s),Hm=a("0.122"),Hn=a(s),Hj=[8,0],Hk=[0,a(I),274,5,m0,53,[0,a(S),[0,a(N),[0,a(O),0]]]],Hg=a(s),Hh=a("0.1278"),Hi=a(s),He=[8,0],Hf=[0,a(I),266,5,k6,53,[0,a(S),[0,a(N),[0,a(O),0]]]],Hb=a(s),Hc=a("0.1335"),Hd=a(s),G$=[8,0],Ha=[0,a(I),mL,5,nY,53,[0,a(S),[0,a(N),[0,a(O),0]]]],G8=a(s),G9=a("0.1393"),G_=a(s),G6=[8,0],G7=[0,a(I),bg,5,251,53,[0,a(S),[0,a(N),[0,a(O),0]]]],G3=a(s),G4=a("0.145"),G5=a(s),G1=[8,0],G2=[0,a(I),fG,14,fG,49,[0,a(dy),[0,a(N),[0,a(O),0]]]],GY=a(s),GZ=a(lv),G0=a(s),GW=a(ad),GX=[0,a(U),362,5,363,71,[0,a(ev),[0,a(ci),[0,a(dl),[0,a(bV),[0,a(T),[0,a(v),0]]]]]]],GV=a(lv),GU=[0,a(U),ep,29,ep,64,[0,a(ev),[0,a(ci),[0,a(dl),[0,a(bV),[0,a(T),[0,a(v),0]]]]]]],GT=a(s),GS=[0,a(i),f_,55,f_,61,[0,a(o),[0,a(h),[0,a(e),0]]]],GP=[0,a(bp),mr,14,mr,34,[0,a(ge),[0,a(E),[0,a(F),[0,a(z),[0,a(bt),[0,a(v),0]]]]]]],GI=[0,a(f),[0,a(cf),[0,a(aw),0]]],GJ=[0,a(f),[0,a(cf),0]],GK=[0,a(f),[0,a(cf),[0,a(ay),0]]],GL=[0,a(f),[0,a(cf),0]],GM=a(dr),GN=a(mF),GO=a(er),GH=a(er),GG=[0,a(i),ey,40,ey,47,[0,a(o),[0,a(h),[0,a(e),0]]]],GD=[0,a(bp),nV,14,nV,34,[0,a(ge),[0,a(E),[0,a(F),[0,a(z),[0,a(bt),[0,a(v),0]]]]]]],GC=[0,a(i),eA,40,eA,47,[0,a(o),[0,a(h),[0,a(e),0]]]],Gy=[8,0],Gz=[0,a(I),kE,5,kE,69,[0,a(S),[0,a(N),[0,a(O),0]]]],Gv=a(aM),Gw=a("0.143"),Gx=a(s),Gt=[8,0],Gu=[0,a(I),nj,5,nj,69,[0,a(S),[0,a(N),[0,a(O),0]]]],Gq=a(aM),Gr=a("0.1259"),Gs=a(s),Go=[8,0],Gp=[0,a(I),mG,5,mG,69,[0,a(S),[0,a(N),[0,a(O),0]]]],Gl=a(aM),Gm=a("0.1089"),Gn=a(s),Gj=[8,0],Gk=[0,a(I),nQ,5,nQ,69,[0,a(S),[0,a(N),[0,a(O),0]]]],Gg=a(aM),Gh=a("0.0918"),Gi=a(s),Ge=[8,0],Gf=[0,a(I),nC,5,nC,69,[0,a(S),[0,a(N),[0,a(O),0]]]],Gb=a(aM),Gc=a("0.0842"),Gd=a(s),F$=[8,0],Ga=[0,a(I),nW,5,nW,69,[0,a(S),[0,a(N),[0,a(O),0]]]],F8=a(aM),F9=a("0.0766"),F_=a(s),F6=[8,0],F7=[0,a(I),l5,5,l5,69,[0,a(S),[0,a(N),[0,a(O),0]]]],F3=a(aM),F4=a("0.069"),F5=a(s),F1=[8,0],F2=[0,a(I),kW,5,kW,69,[0,a(S),[0,a(N),[0,a(O),0]]]],FY=a(aM),FZ=a("0.0615"),F0=a(s),FW=[8,0],FX=[0,a(I),mq,5,mq,69,[0,a(S),[0,a(N),[0,a(O),0]]]],FT=a(aM),FU=a("0.0539"),FV=a(s),FR=[8,0],FS=[0,a(I),mD,5,mD,69,[0,a(S),[0,a(N),[0,a(O),0]]]],FO=a(aM),FP=a(lO),FQ=a(s),FN=[0,a(I),ib,14,ib,59,[0,a(dy),[0,a(N),[0,a(O),0]]]],FK=a(aM),FL=a(hC),FM=a(s),FJ=[0,a(i),cJ,65,cJ,71,[0,a(o),[0,a(h),[0,a(e),0]]]],FG=[0,a(I),hM,14,hM,67,[0,a(dy),[0,a(N),[0,a(O),0]]]],FC=a(gb),FD=a(gb),FE=a(lO),FF=a(s),FB=[0,a(i),fL,73,fL,79,[0,a(o),[0,a(h),[0,a(e),0]]]],Fx=a(ad),Fy=[0,a(aq),420,6,421,72,[0,a(hU),[0,a(ci),[0,a(fY),[0,a(bV),[0,a(an),[0,a(v),0]]]]]]],Fs=[0,a(aE),[0,a(em),[0,a(aw),0]]],Ft=[0,a(aE),[0,a(em),0]],Fu=[0,a(aE),[0,a(em),[0,a(ay),0]]],Fv=[0,a(aE),[0,a(em),0]],Fw=[0,a(aq),l1,5,du,59,[0,a(ov),[0,a(E),[0,a(F),[0,a(z),[0,a(an),[0,a(v),0]]]]]]],Fr=[0,a(i),fy,3,fy,62,[0,a(o),[0,a(h),[0,a(e),0]]]],Fq=[0,a(i),fy,11,fy,35,[0,a(o),[0,a(h),[0,a(e),0]]]],Fn=a(ad),Fo=[0,a(aq),426,5,427,71,[0,a(hU),[0,a(ci),[0,a(fY),[0,a(bV),[0,a(an),[0,a(v),0]]]]]]],Fm=[0,a(at),31,9,31,32,[0,a(cD),[0,a(as),0]]],Fl=[0,a(i),f8,35,f8,44,[0,a(o),[0,a(h),[0,a(e),0]]]],Fi=[0,a(I),cE,5,cE,69,[0,a(bZ),[0,a(md),[0,a(cH),0]]]],Fg=a(ly),Fh=a("5827900"),Ff=[0,a(I),89,5,89,69,[0,a(lR),[0,a(cH),0]]],Fd=a(nz),Fe=a("5775900"),Fc=[0,a(I),56,5,56,69,[0,a(kN),[0,a(cH),0]]],Fa=a(n8),Fb=a("5684900"),E$=[0,a(I),23,5,23,69,[0,a(og),[0,a(cH),0]]],E9=a(np),E_=a("5628600"),E8=[0,a(U),nq,14,nq,30,[0,a(my),[0,a(E),[0,a(F),[0,a(z),[0,a(T),[0,a(v),0]]]]]]],E6=a(os),E7=a("5595000"),E5=[0,a(i),fQ,36,fQ,42,[0,a(o),[0,a(h),[0,a(e),0]]]],E2=[0,a(I),mW,5,mW,69,[0,a(bZ),[0,a(md),[0,a(cH),0]]]],E0=a(ly),E1=a("8155800"),EZ=[0,a(I),96,5,96,69,[0,a(lR),[0,a(cH),0]]],EX=a(nz),EY=a("8083100"),EW=[0,a(I),63,5,63,69,[0,a(kN),[0,a(cH),0]]],EU=a(n8),EV=a("7955800"),ET=[0,a(I),30,5,30,69,[0,a(og),[0,a(cH),0]]],ER=a(np),ES=a("7877000"),EQ=[0,a(U),m5,14,m5,31,[0,a(my),[0,a(E),[0,a(F),[0,a(z),[0,a(T),[0,a(v),0]]]]]]],EO=a(os),EP=a("7830000"),EN=[0,a(i),c0,37,c0,43,[0,a(o),[0,a(h),[0,a(e),0]]]],EK=[0,a(at),34,14,34,36,[0,a(cD),[0,a(as),0]]],EJ=[0,a(i),ga,3,ga,66,[0,a(o),[0,a(h),[0,a(e),0]]]],EI=[0,a(i),ga,11,ga,33,[0,a(o),[0,a(h),[0,a(e),0]]]],EG=[0,a(aq),75,14,75,64,[0,a(fR),[0,a(fF),[0,a(dm),[0,a(z),[0,a(an),[0,a(v),0]]]]]]],EC=[0,a(aE),[0,a(eh),[0,a(aw),0]]],ED=[0,a(aE),[0,a(eh),0]],EE=[0,a(aE),[0,a(eh),[0,a(ay),0]]],EF=[0,a(aE),[0,a(eh),0]],EB=[0,a(i),97,13,97,30,[0,a(o),[0,a(h),[0,a(e),0]]]],Ey=[0,a(bp),83,19,83,69,[0,a(fC),[0,a(E),[0,a(F),[0,a(z),[0,a(bt),[0,a(v),0]]]]]]],Ex=[0,a(bp),56,14,56,41,[0,a(fC),[0,a(E),[0,a(F),[0,a(z),[0,a(bt),[0,a(v),0]]]]]]],Ew=a("14"),Ev=[0,a(i),fN,3,fN,70,[0,a(o),[0,a(h),[0,a(e),0]]]],Eu=[0,a(i),fN,11,fN,38,[0,a(o),[0,a(h),[0,a(e),0]]]],Eq=[0,a(at),33,14,33,40,[0,a(cD),[0,a(as),0]]],Ep=[0,a(i),80,26,80,43,[0,a(o),[0,a(h),[0,a(e),0]]]],Ek=[0,a(i),kK,14,kK,46,[0,a(o),[0,a(h),[0,a(e),0]]]],Ej=[0,a(i),65,28,65,40,[0,a(aN),[0,a(h),[0,a(e),0]]]],Eg=[0,a(i),m9,14,m9,56,[0,a(o),[0,a(h),[0,a(e),0]]]],Ef=[1,0],Ee=[0,a(i),64,38,64,66,[0,a(aN),[0,a(h),[0,a(e),0]]]],Eb=[0,a(i),l$,14,l$,50,[0,a(o),[0,a(h),[0,a(e),0]]]],Ea=[0,a(i),63,32,63,36,[0,a(aN),[0,a(h),[0,a(e),0]]]],D7=[0,a(i),lP,14,lP,32,[0,a(o),[0,a(h),[0,a(e),0]]]],D6=[0,a(cx),5,32,5,36,[0,a(cB),0]],D1=[0,a(bp),64,14,64,44,[0,a(fC),[0,a(E),[0,a(F),[0,a(z),[0,a(bt),[0,a(v),0]]]]]]],D0=a(gb),DZ=[0,a(i),fz,50,fz,56,[0,a(o),[0,a(h),[0,a(e),0]]]],DW=[0,a(U),hV,14,hV,35,[0,a(cG),[0,a(E),[0,a(F),[0,a(z),[0,a(T),[0,a(v),0]]]]]]],DV=a(gb),DU=[0,a(i),eB,41,eB,47,[0,a(o),[0,a(h),[0,a(e),0]]]],DR=[0,a(aq),mL,5,nY,56,[0,a(bU),[0,a(E),[0,a(F),[0,a(z),[0,a(an),[0,a(v),0]]]]]]],DQ=[1,0],DP=[0,a(aq),lQ,5,lQ,60,[0,a(bU),[0,a(E),[0,a(F),[0,a(z),[0,a(an),[0,a(v),0]]]]]]],DO=[0,0],DN=[0,a(aq),ni,5,ni,69,[0,a(bU),[0,a(E),[0,a(F),[0,a(z),[0,a(an),[0,a(v),0]]]]]]],DM=[0,0],DL=[0,a(aq),f4,5,f4,70,[0,a(bU),[0,a(E),[0,a(F),[0,a(z),[0,a(an),[0,a(v),0]]]]]]],DK=[0,0],DJ=[0,a(aq),269,5,270,48,[0,a(bU),[0,a(E),[0,a(F),[0,a(z),[0,a(an),[0,a(v),0]]]]]]],DI=[0,0],DH=[0,a(i),99,3,99,66,[0,a(o),[0,a(h),[0,a(e),0]]]],DG=[0,a(i),99,11,99,20,[0,a(o),[0,a(h),[0,a(e),0]]]],DE=[0,a(aq),nJ,5,ei,56,[0,a(bU),[0,a(E),[0,a(F),[0,a(z),[0,a(an),[0,a(v),0]]]]]]],DD=[2,0],DC=[0,a(aq),lD,5,lD,70,[0,a(bU),[0,a(E),[0,a(F),[0,a(z),[0,a(an),[0,a(v),0]]]]]]],DB=[1,0],DA=[0,a(aq),nm,5,nm,60,[0,a(bU),[0,a(E),[0,a(F),[0,a(z),[0,a(an),[0,a(v),0]]]]]]],Dz=[0,0],Dy=[0,a(aq),hR,5,hR,69,[0,a(bU),[0,a(E),[0,a(F),[0,a(z),[0,a(an),[0,a(v),0]]]]]]],Dx=[0,0],Dw=[0,a(aq),263,5,264,48,[0,a(bU),[0,a(E),[0,a(F),[0,a(z),[0,a(an),[0,a(v),0]]]]]]],Dv=[0,0],Du=[0,a(i),98,3,98,65,[0,a(o),[0,a(h),[0,a(e),0]]]],Dt=[0,a(i),98,11,98,26,[0,a(o),[0,a(h),[0,a(e),0]]]],DF=[0,a(f),[0,a(cf),0]],DS=[0,a(f),[0,a("versement"),0]],DT=[0,a(i),eB,11,eB,32,[0,a(o),[0,a(h),[0,a(e),0]]]],DX=[0,a(f),[0,a("nombre_enfants_l521_1"),0]],DY=[0,a(i),fz,11,fz,41,[0,a(o),[0,a(h),[0,a(e),0]]]],D2=[0,a(f),[0,a("nombre_enfants_alin\xc3\xa9a_2_l521_3"),0]],D3=[0,a(f),[0,a(l0),[0,a(h7),0]]],D4=[0,a(f),[0,a(l0),[0,a(h7),0]]],D8=[0,a(f),[0,a("bmaf.date_courante"),0]],D5=[0,a(cx),5,10,5,23,[0,a(cB),0]],D9=[0,a(f),[0,a(kF),[0,a(h8),0]]],D_=[0,a(f),[0,a(kF),[0,a(h8),0]]],Ec=[0,a(f),[0,a("prestations_familiales.date_courante"),0]],D$=[0,a(i),63,10,63,23,[0,a(aN),[0,a(h),[0,a(e),0]]]],Eh=[0,a(f),[0,a("prestations_familiales.prestation_courante"),0]],Ed=[0,a(i),64,10,64,29,[0,a(aN),[0,a(h),[0,a(e),0]]]],El=[0,a(f),[0,a("prestations_familiales.r\xc3\xa9sidence"),0]],Ei=[0,a(i),65,10,65,19,[0,a(aN),[0,a(h),[0,a(e),0]]]],Em=[0,a(f),[0,a(nN),[0,a(aE),0]]],En=[0,a(f),[0,a(nN),[0,a(aE),0]]],Er=[0,a(f),[0,a("enfant_le_plus_\xc3\xa2g\xc3\xa9.enfants"),0]],Eo=[0,a(i),80,10,80,17,[0,a(o),[0,a(h),[0,a(e),0]]]],Es=[0,a(f),[0,a(mp),[0,a(ii),0]]],Et=[0,a(f),[0,a(mp),[0,a(ii),0]]],Ez=[0,a(f),[0,a(bQ),0]],EA=[0,a(i),96,11,96,61,[0,a(o),[0,a(h),[0,a(e),0]]]],EH=[0,a(f),[0,a("enfants_\xc3\xa0_charge_droit_ouvert_prestation_familiale"),0]],EL=[0,a(f),[0,a(et),0]],EM=[0,a(i),c0,11,c0,28,[0,a(o),[0,a(h),[0,a(e),0]]]],E3=[0,a(f),[0,a("plafond_II_d521_3"),0]],E4=[0,a(i),fQ,11,fQ,27,[0,a(o),[0,a(h),[0,a(e),0]]]],Fj=[0,a(f),[0,a("plafond_I_d521_3"),0]],Fk=[0,a(i),f8,11,f8,34,[0,a(o),[0,a(h),[0,a(e),0]]]],Fp=[0,a(f),[0,a("droit_ouvert_compl\xc3\xa9ment"),0]],Fz=[0,a(f),[0,a(eo),0]],FA=[0,a(i),fL,11,fL,64,[0,a(o),[0,a(h),[0,a(e),0]]]],FH=[0,a(f),[0,a("montant_initial_base_quatri\xc3\xa8me_enfant_et_plus_mayotte"),0]],FI=[0,a(i),cJ,11,cJ,56,[0,a(o),[0,a(h),[0,a(e),0]]]],GA=[0,a(f),[0,a("montant_initial_base_troisi\xc3\xa8me_enfant_mayotte"),0]],GB=[0,a(i),eA,11,eA,31,[0,a(o),[0,a(h),[0,a(e),0]]]],GE=[0,a(f),[0,a("nombre_total_enfants"),0]],GF=[0,a(i),ey,11,ey,31,[0,a(o),[0,a(h),[0,a(e),0]]]],GQ=[0,a(f),[0,a("nombre_moyen_enfants"),0]],GR=[0,a(i),f_,11,f_,46,[0,a(o),[0,a(h),[0,a(e),0]]]],HU=[0,a(f),[0,a("montant_initial_base_premier_enfant"),0]],HV=[0,a(i),ej,11,ej,28,[0,a(o),[0,a(h),[0,a(e),0]]]],H4=[0,a(f),[0,a("droit_ouvert_base"),0]],Ij=[0,a(f),[0,a(ae),0]],Iy=[0,a(f),[0,a(ex),0]],Iz=[0,a(i),cj,11,cj,47,[0,a(o),[0,a(h),[0,a(e),0]]]],IH=[0,a(f),[0,a("montant_vers\xc3\xa9_forfaitaire_par_enfant"),0]],II=[0,a(i),fW,11,fW,56,[0,a(o),[0,a(h),[0,a(e),0]]]],IZ=[0,a(f),[0,a("montant_initial_base_troisi\xc3\xa8me_enfant_et_plus"),0]],I0=[0,a(i),eu,11,eu,47,[0,a(o),[0,a(h),[0,a(e),0]]]],J5=[0,a(f),[0,a("montant_initial_base_deuxi\xc3\xa8me_enfant"),0]],J6=[0,a(i),fJ,11,fJ,38,[0,a(o),[0,a(h),[0,a(e),0]]]],J$=[0,a(f),[0,a("rapport_enfants_total_moyen"),0]],KA=[0,a(f),[0,a(el),0]],KB=[0,a(i),cF,11,cF,36,[0,a(o),[0,a(h),[0,a(e),0]]]],KK=[0,a(f),[0,a("montant_vers\xc3\xa9_forfaitaire"),0]],KL=[0,a(i),fw,11,fw,31,[0,a(o),[0,a(h),[0,a(e),0]]]],KS=[0,a(f),[0,a("montant_initial_base"),0]],Lf=[0,a(f),[0,a(ef),0]],Lg=[0,a(i),fZ,11,fZ,52,[0,a(o),[0,a(h),[0,a(e),0]]]],Lu=[0,a(f),[0,a("montant_vers\xc3\xa9_compl\xc3\xa9ment_pour_forfaitaire"),0]],Lv=[0,a(i),ez,11,ez,43,[0,a(o),[0,a(h),[0,a(e),0]]]],Ly=[0,a(f),[0,a("montant_avec_garde_altern\xc3\xa9e_base"),0]],LN=[0,a(f),[0,a(ek),0]],LO=[0,a(i),gc,11,gc,29,[0,a(o),[0,a(h),[0,a(e),0]]]],LS=[0,a(f),[0,a("montant_vers\xc3\xa9_base"),0]],LT=[0,a(i),f3,11,f3,35,[0,a(o),[0,a(h),[0,a(e),0]]]],L2=[0,a(f),[0,a("montant_vers\xc3\xa9_majoration"),0]],L3=[0,a(i),ft,11,ft,58,[0,a(o),[0,a(h),[0,a(e),0]]]],L6=[0,a(f),[0,a("montant_base_compl\xc3\xa9ment_pour_base_et_majoration"),0]],L7=[0,a(i),f0,11,f0,59,[0,a(o),[0,a(h),[0,a(e),0]]]],Md=[0,a(f),[0,a("montant_vers\xc3\xa9_compl\xc3\xa9ment_pour_base_et_majoration"),0]],Me=[0,a(i),br,10,br,23,[0,a(o),[0,a(h),[0,a(e),0]]]],Mi=[0,a(f),[0,a("montant_vers\xc3\xa9"),0]],Dq=[0,a("./autres_codes.catala_fr"),24,5,24,63,[0,a("Article L821-3"),[0,a("Sous-section 1 : Aides personnelles au logement"),[0,a("Section 2 : R\xc3\xa8gles de non-cumul"),[0,a("Chapitre Ier : Principes g\xc3\xa9n\xc3\xa9raux"),[0,a("Titre II : Dispositions communes aux aides personnelles au logement"),[0,a("Livre VIII : Aides personnelles au logement"),[0,a(an),[0,a("Code de la construction et de l'habitation"),0]]]]]]]]],Dp=[0,a(aq),60,5,62,32,[0,a(fR),[0,a(fF),[0,a(dm),[0,a(z),[0,a(an),[0,a(v),0]]]]]]],Do=[0,a(aq),49,5,50,50,[0,a(fR),[0,a(fF),[0,a(dm),[0,a(z),[0,a(an),[0,a(v),0]]]]]]],Dn=[0,a(i),58,3,58,49,[0,a(aN),[0,a(h),[0,a(e),0]]]],Dm=[0,a(i),58,10,58,22,[0,a(aN),[0,a(h),[0,a(e),0]]]],Dk=[0,a(aq),68,5,71,57,[0,a(fR),[0,a(fF),[0,a(dm),[0,a(z),[0,a(an),[0,a(v),0]]]]]]],Dj=[0,a(i),59,3,59,56,[0,a(aN),[0,a(h),[0,a(e),0]]]],Di=[0,a(i),59,10,59,29,[0,a(aN),[0,a(h),[0,a(e),0]]]],Dg=[0,a(bp),lm,18,lm,41,[0,a("Article R755-0-2"),[0,a(ci),[0,a(dl),[0,a(bV),[0,a(bt),[0,a(v),0]]]]]]],De=a(nP),Df=a(lM),Dd=[0,a(bp),31,14,31,30,[0,a(kM),[0,a(lu),[0,a(dm),[0,a(z),[0,a(bt),[0,a(v),0]]]]]]],Db=a(nP),Dc=a(lM),Da=[0,a(i),60,36,60,42,[0,a(aN),[0,a(h),[0,a(e),0]]]],C3=[0,0],C5=[1,0],C6=[2,0],C7=[3,0],C8=[4,0],C9=[5,0],C4=[0,a(aq),mU,5,ep,30,[0,a("Article L751-1"),[0,a("Chapitre 1er : G\xc3\xa9n\xc3\xa9ralit\xc3\xa9s"),[0,a(fY),[0,a(bV),[0,a(an),[0,a(v),0]]]]]]],C2=[0,a(i),62,34,62,43,[0,a(aN),[0,a(h),[0,a(e),0]]]],CX=[0,a(i),69,14,69,28,[0,a(aN),[0,a(h),[0,a(e),0]]]],CW=[0,a(aU),10,28,10,40,[0,a(e),[0,a(aT),0]]],CT=[0,a(i),70,14,70,32,[0,a(aN),[0,a(h),[0,a(e),0]]]],CS=[0,a(aU),9,32,9,36,[0,a(e),[0,a(aT),0]]],CP=[0,a(bp),21,14,21,26,[0,a(kM),[0,a(lu),[0,a(dm),[0,a(z),[0,a(bt),[0,a(v),0]]]]]]],CO=a("20"),CN=[0,a(i),61,31,61,37,[0,a(aN),[0,a(h),[0,a(e),0]]]],CM=[0,a(i),61,10,61,22,[0,a(aN),[0,a(h),[0,a(e),0]]]],CQ=[0,a(aE),[0,a("\xc3\xa2ge_l512_3_2"),0]],CU=[0,a(aE),[0,a("smic.date_courante"),0]],CR=[0,a(aU),9,10,9,23,[0,a(e),[0,a(aT),0]]],CY=[0,a(aE),[0,a("smic.r\xc3\xa9sidence"),0]],CV=[0,a(aU),10,10,10,19,[0,a(e),[0,a(aT),0]]],CZ=[0,a(aE),[0,a(om),[0,a(hJ),0]]],C0=[0,a(aE),[0,a(om),[0,a(hJ),0]]],C1=[0,a(i),62,10,62,33,[0,a(aN),[0,a(h),[0,a(e),0]]]],C_=[0,a(aE),[0,a("r\xc3\xa9gime_outre_mer_l751_1"),0]],C$=[0,a(i),60,11,60,27,[0,a(aN),[0,a(h),[0,a(e),0]]]],Dh=[0,a(aE),[0,a("plafond_l512_3_2"),0]],Dl=[0,a(aE),[0,a(em),0]],Dr=[0,a(aE),[0,a(eh),0]],CJ=[0,a(cx),82,5,83,34,[0,a("Instruction interminist\xc3\xa9rielle n\xc2\xb0DSS/2B/2022/82 du 28 mars 2022 relative \xc3\xa0 la revalorisation au 1er avril 2022 des prestations familiales servies en m\xc3\xa9tropole, en Guadeloupe, en Guyane, en Martinique, \xc3\xa0 la R\xc3\xa9union, \xc3\xa0 Saint-Barth\xc3\xa9lemy, \xc3\xa0 Saint-Martin et dans le d\xc3\xa9partement de Mayotte"),[0,a(cB),0]]],CI=a("42228"),CH=[0,a(cx),64,5,65,34,[0,a("Instruction interminist\xc3\xa9rielle n\xc2\xb0DSS/2B/2021/65 du 19 mars 2021 relative \xc3\xa0 la revalorisation au 1er avril 2021 des prestations familiales servies en m\xc3\xa9tropole, en Guadeloupe, en Guyane, en Martinique, \xc3\xa0 la R\xc3\xa9union, \xc3\xa0 Saint-Barth\xc3\xa9lemy, \xc3\xa0 Saint-Martin et dans le d\xc3\xa9partement de Mayotte"),[0,a(cB),0]]],CG=a("41481"),CF=[0,a(cx),48,5,49,34,[0,a("Instruction interminist\xc3\xa9rielle no DSS/SD2B/2020/33 du 18 f\xc3\xa9vrier 2020 relative \xc3\xa0 la revalorisation au 1er avril 2020 des prestations familiales servies en m\xc3\xa9tropole, en Guadeloupe, en Guyane, en Martinique, \xc3\xa0 La R\xc3\xa9union, \xc3\xa0 Saint-Barth\xc3\xa9lemy, \xc3\xa0 Saint-Martin et dans le d\xc3\xa9partement de Mayotte"),[0,a(cB),0]]],CE=a("41440"),CD=[0,a(cx),28,5,29,34,[0,a("Instruction minist\xc3\xa9rielle N\xc2\xb0DSS/SD2B/2019/65 du 25 mars 2019 relative \xc3\xa0 la revalorisation au 1er avril 2019 des prestations familiales servies en m\xc3\xa9tropole"),[0,a(cB),0]]],CC=a("41316"),CB=[0,a(cx),6,26,6,32,[0,a(cB),0]],CA=[0,a(cx),6,10,6,17,[0,a(cB),0]],CK=[0,a(h8),[0,a("montant"),0]],Cw=[8,0],Cx=[0,a(aU),hR,5,206,6,[0,a(n3),[0,a(mH),[0,a(aT),0]]]],Cv=a("819"),Cm=[6,0],Co=[0,0],Cp=[1,0],Cq=[2,0],Cr=[3,0],Cs=[4,0],Ct=[5,0],Cu=[7,0],Cn=[0,a(aU),ib,5,hM,6,[0,a(n3),[0,a(mH),[0,a(aT),0]]]],Cl=a("1085"),Cj=[8,0],Ck=[0,a(aU),l7,5,fG,6,[0,a(bZ),[0,a(n0),[0,a(aT),0]]]],Ci=a("798"),B$=[6,0],Cb=[0,0],Cc=[1,0],Cd=[2,0],Ce=[3,0],Cf=[4,0],Cg=[5,0],Ch=[7,0],Ca=[0,a(aU),eB,5,155,6,[0,a(bZ),[0,a(n0),[0,a(aT),0]]]],B_=a("1057"),B8=[8,0],B9=[0,a(aU),du,5,bz,6,[0,a(bZ),[0,a(kP),[0,a(aT),0]]]],B7=a("774"),BY=[6,0],B0=[0,0],B1=[1,0],B2=[2,0],B3=[3,0],B4=[4,0],B5=[5,0],B6=[7,0],BZ=[0,a(aU),eu,5,cE,6,[0,a(bZ),[0,a(kP),[0,a(aT),0]]]],BX=a("1025"),BV=[8,0],BW=[0,a(aU),86,5,88,6,[0,a(bZ),[0,a(lo),[0,a(aT),0]]]],BU=a("766"),BL=[6,0],BN=[0,0],BO=[1,0],BP=[2,0],BQ=[3,0],BR=[4,0],BS=[5,0],BT=[7,0],BM=[0,a(aU),68,5,77,6,[0,a(bZ),[0,a(lo),[0,a(aT),0]]]],BK=a("1015"),BI=[8,0],BJ=[0,a(aU),47,5,49,6,[0,a(bZ),[0,a(kJ),[0,a(aT),0]]]],BH=a("757"),By=[6,0],BA=[0,0],BB=[1,0],BC=[2,0],BD=[3,0],BE=[4,0],BF=[5,0],BG=[7,0],Bz=[0,a(aU),29,5,38,6,[0,a(bZ),[0,a(kJ),[0,a(aT),0]]]],Bx=a("1003"),Bw=[0,a(aU),11,31,11,37,[0,a(e),[0,a(aT),0]]],Bv=[0,a(aU),11,10,11,22,[0,a(e),[0,a(aT),0]]],Cy=[0,a(hJ),[0,a("brut_horaire"),0]],Bs=[0,a(at),12,14,12,25,[0,a(cD),[0,a(as),0]]],Bn=[2,0],Bo=a(s),Bp=a(s),Bq=[1,0],Br=a(ad),Bm=[0,a(i),81,30,81,36,[0,a(o),[0,a(h),[0,a(e),0]]]],Bl=[0,a(i),81,10,81,21,[0,a(o),[0,a(h),[0,a(e),0]]]],Bt=[0,a(ii),[0,a("le_plus_\xc3\xa2g\xc3\xa9"),0]],Bi=[0,a(bp),78,14,78,41,[0,a(fC),[0,a(E),[0,a(F),[0,a(z),[0,a(bt),[0,a(v),0]]]]]]],Bh=a(hF),Bg=[0,a(i),77,46,77,52,[0,a(o),[0,a(h),[0,a(e),0]]]],Bf=[0,a(i),77,10,77,37,[0,a(o),[0,a(h),[0,a(e),0]]]],Bj=[0,a(h7),[0,a(bQ),0]],A7=a("b\xc3\xa9n\xc3\xa9ficie_titre_personnel_aide_personnelle_logement"),A8=a("a_d\xc3\xa9j\xc3\xa0_ouvert_droit_aux_allocations_familiales"),A9=a("prise_en_charge"),A_=a("\xc3\xa2ge"),A$=a("date_de_naissance"),Ba=a("r\xc3\xa9muneration_mensuelle"),Bb=a("obligation_scolaire"),Bc=a("identifiant"),Bd=[0,a("Enfant"),0],AX=a(ml),AZ=a(m6),A0=a(li),A1=a("LaR\xc3\xa9union"),A2=a("SaintBarth\xc3\xa9lemy"),A3=a("SaintMartin"),A4=a(l_),A5=a("SaintPierreEtMiquelon"),A6=a(nH),AY=[0,a("Collectivit\xc3\xa9"),0],AO=a("PrestationAccueilJeuneEnfant"),AQ=a(f),AR=a("Compl\xc3\xa9mentFamilial"),AS=a("AllocationLogement"),AT=a("Allocation\xc3\x89ducationEnfantHandicap\xc3\xa9"),AU=a("AllocationSoutienFamilial"),AV=a("AllocationRentr\xc3\xa9eScolaire"),AW=a("AllocationJournali\xc3\xa8rePresenceParentale"),AP=[0,a("\xc3\x89l\xc3\xa9mentPrestationsFamiliales"),0],AJ=a("Compl\xc3\xa8te"),AL=a("Partag\xc3\xa9e"),AM=a("Z\xc3\xa9ro"),AK=[0,a("PriseEnCompte"),0],AF=a("Avant"),AH=a("Pendant"),AI=a("Apr\xc3\xa8s"),AG=[0,a("SituationObligationScolaire"),0],Az=a("GardeAltern\xc3\xa9ePartageAllocations"),AB=a("GardeAltern\xc3\xa9eAllocataireUnique"),AC=a("EffectiveEtPermanente"),AD=a("ServicesSociauxAllocationVers\xc3\xa9e\xc3\x80LaFamille"),AE=a("ServicesSociauxAllocationVers\xc3\xa9eAuxServicesSociaux"),AA=[0,a("PriseEnCharge"),0],MZ=a("Jsoo_runtime.Error.Exn"),M0=a(hH),NC=a("Begin call"),ND=a("End call"),NE=a("Variable definition"),NF=a("Decision taken"),Nh=a("Confi\xc3\xa9 aux service sociaux, allocation vers\xc3\xa9e aux services sociaux"),Ni=a("Confi\xc3\xa9 aux service sociaux, allocation vers\xc3\xa9e \xc3\xa0 la famille"),Nj=a("Effective et permanente"),Nk=a("Garde altern\xc3\xa9e, allocataire unique"),Nl=a("Garde altern\xc3\xa9e, partage des allocations"),Nn=[0,0],No=[1,0],Np=[2,0],Nq=[3,0],Nr=[4,0],Nm=a("Unknown prise en charge"),M9=a(ml),M_=a(m6),M$=a("La R\xc3\xa9union"),Na=a(li),Nb=a(nH),Nc=a(l_),Nd=a("Saint Barth\xc3\xa9lemy"),Ne=a("Saint Martin"),Nf=a("Saint Pierre et Miquelon"),Ns=[7,0],Nt=[5,0],Nu=[4,0],Nv=[6,0],Nw=[8,0],Nx=[2,0],Ny=[3,0],Nz=[1,0],NA=[0,0],Ng=a("unknown collectivite!"),M7=a(l),M5=[0,a(mR),a(ll),a(no),a(nM)];function -aj(a){if(typeof +bOx(){var +a=aO;if(a.process&&a.process.on)a.process.on("uncaughtException",function(b,c){MN(b);a.process.exit(2)});else +if(a.addEventListener)a.addEventListener("error",function(a){if(a.error)MN(a.error)})}bOx();function +k(a,b){return a.length==1?a(b):en(a,[b])}function +W(a,b,c){return a.length==2?a(b,c):en(a,[b,c])}function +bj(a,b,c,d){return a.length==3?a(b,c,d):en(a,[b,c,d])}function +lP(a,b,c,d,e,f){return a.length==5?a(b,c,d,e,f):en(a,[b,c,d,e,f])}function +bNM(a,b,c,d,e,f,g){return a.length==6?a(b,c,d,e,f,g):en(a,[b,c,d,e,f,g])}function +bNL(a,b,c,d,e,f,g,h){return a.length==7?a(b,c,d,e,f,g,h):en(a,[b,c,d,e,f,g,h])}bNZ();var +p7=[bl,a(CH),-1],t3=[bl,a(K4),-2],fT=[bl,a(sO),-3],g0=[bl,a(zS),-4],p8=[bl,a(Gc),-6],b5=[bl,a(D3),-7],t1=[bl,a(Fr),-8],t2=[bl,a(z2),-9],a1=[bl,a(L_),-11],t4=[bl,a(C1),si],bNJ=[4,0,0,0,[12,45,[4,0,0,0,0]]],qn=[0,[11,a('File "'),[2,0,[11,a('", line '),[4,0,0,0,[11,a(zx),[4,0,0,0,[12,45,[4,0,0,0,[11,a(": "),[2,0,0]]]]]]]]]],a('File "%s", line %d, characters %d-%d: %s')],hJ=[0,0,0],bNK=[4,0,0,0,[12,46,0]],wH=[0,a("eventsManager"),a("computeAllocationsFamiliales"),a("computeAidesAuLogement")];eo(11,t4,C1);eo(10,a1,L_);eo(9,[bl,a(BQ),-10],BQ);eo(8,t2,z2);eo(7,t1,Fr);eo(6,b5,D3);eo(5,p8,Gc);eo(4,[bl,a(Hf),-5],Hf);eo(3,g0,zS);eo(2,fT,sO);eo(1,t3,K4);eo(0,p7,CH);var +No=a("output_substring"),Nl=a("%.12g"),Nk=a(e5),Ni=a(xG),Nj=a(zX),Nb=a("Stdlib.Exit"),Nd=gY(0,0,LJ),Ne=gY(0,0,65520),Nf=gY(1,0,LJ),Nr=a(xT),Ns=a("\\'"),Nt=a(xj),Nu=a(At),Nv=a(Be),Nw=a(Hi),Nq=a("Char.chr"),NA=a("nth"),NB=a("List.nth"),Nz=a("tl"),Ny=a("hd"),NE=a("String.blit / Bytes.blit_string"),ND=a("Bytes.blit"),NC=a("String.sub / Bytes.sub"),NI=a("String.contains_from / Bytes.contains_from"),NG=a(ac),NF=a("String.concat"),NN=a("Array.blit"),NM=a("Array.fill"),NL=a("Array.sub"),NS=a("Map.remove_min_elt"),NT=[0,0,0,0],NU=[0,a("map.ml"),rN,10],NV=[0,0,0],NO=a(l4),NP=a(l4),NQ=a(l4),NR=a(l4),NW=a("Stdlib.Queue.Empty"),NY=a("CamlinternalLazy.Undefined"),N5=a("Buffer.add_substring/add_subbytes"),N4=a("Buffer.add: cannot grow buffer"),N3=[0,a(H$),93,2],N2=[0,a(H$),94,2],N1=a("Buffer.sub"),Oc=a("%c"),Od=a("%s"),Oe=a(sK),Of=a(Jl),Og=a(zQ),Oh=a(K3),Oi=a("%f"),Oj=a(KL),Ok=a("%{"),Ol=a("%}"),Om=a("%("),On=a("%)"),Oo=a(y2),Op=a("%t"),Oq=a("%?"),Or=a("%r"),Os=a("%_r"),Ot=[0,a(cx),850,23],OE=[0,a(cx),814,21],Ow=[0,a(cx),815,21],OF=[0,a(cx),sG,21],Ox=[0,a(cx),819,21],OG=[0,a(cx),822,19],Oy=[0,a(cx),kr,19],OH=[0,a(cx),826,22],Oz=[0,a(cx),rP,22],OI=[0,a(cx),s1,30],OA=[0,a(cx),832,30],OC=[0,a(cx),836,26],Ou=[0,a(cx),837,26],OD=[0,a(cx),sv,28],Ov=[0,a(cx),s0,28],OB=[0,a(cx),851,23],PL=a(xx),PJ=[0,a(cx),1558,4],PK=a("Printf: bad conversion %["),PM=[0,a(cx),tp,39],PN=[0,a(cx),1649,31],PO=[0,a(cx),s8,31],PP=a("Printf: bad conversion %_"),PQ=a(FC),PR=a(xE),PS=a(FC),PT=a(xE),PX=[0,[11,a("invalid box description "),[3,0,0]],a("invalid box description %S")],PV=a(ac),PW=[0,0,4],PY=a(ac),PZ=a(yv),P0=a("h"),P1=a("hov"),P2=a("hv"),P3=a("v"),PH=a(sP),PF=a("neg_infinity"),PG=a(Ml),PE=a(e5),Pz=[0,pj],Pn=a("%+nd"),Po=a("% nd"),Pq=a("%+ni"),Pr=a("% ni"),Ps=a("%nx"),Pt=a("%#nx"),Pu=a("%nX"),Pv=a("%#nX"),Pw=a("%no"),Px=a("%#no"),Pm=a("%nd"),Pp=a(zQ),Py=a("%nu"),Pa=a("%+ld"),Pb=a("% ld"),Pd=a("%+li"),Pe=a("% li"),Pf=a("%lx"),Pg=a("%#lx"),Ph=a("%lX"),Pi=a("%#lX"),Pj=a("%lo"),Pk=a("%#lo"),O$=a("%ld"),Pc=a(Jl),Pl=a("%lu"),OZ=a("%+Ld"),O0=a("% Ld"),O2=a("%+Li"),O3=a("% Li"),O4=a("%Lx"),O5=a("%#Lx"),O6=a("%LX"),O7=a("%#LX"),O8=a("%Lo"),O9=a("%#Lo"),OY=a("%Ld"),O1=a(K3),O_=a("%Lu"),OM=a("%+d"),ON=a("% d"),OP=a("%+i"),OQ=a("% i"),OR=a("%x"),OS=a("%#x"),OT=a("%X"),OU=a("%#X"),OV=a("%o"),OW=a("%#o"),OL=a(sr),OO=a(sK),OX=a(xx),N6=a("@]"),N7=a("@}"),N8=a("@?"),N9=a("@\n"),N_=a("@."),N$=a("@@"),Oa=a("@%"),Ob=a("@"),OJ=a("CamlinternalFormat.Type_mismatch"),P7=a(ac),P8=[0,[11,a(fG),[2,0,[2,0,0]]],a(", %s%s")],Qv=[0,[11,a(so),[2,0,[12,10,0]]],a(Eo)],Qw=[0,[11,a("Fatal error in uncaught exception handler: exception "),[2,0,[12,10,0]]],a("Fatal error in uncaught exception handler: exception %s\n")],Qu=a("Fatal error: out of memory in uncaught exception handler"),Qs=[0,[11,a(so),[2,0,[12,10,0]]],a(Eo)],Qo=[0,[2,0,[12,10,0]],a("%s\n")],Qg=a("Raised at"),Qh=a("Re-raised at"),Qi=a("Raised by primitive operation at"),Qj=a("Called from"),Qk=a(" (inlined)"),Qm=a(ac),Ql=[0,[2,0,[12,32,[2,0,[11,a(' in file "'),[2,0,[12,34,[2,0,[11,a(", line "),[4,0,0,0,[11,a(zx),bNJ]]]]]]]]]],a('%s %s in file "%s"%s, line %d, characters %d-%d')],Qn=[0,[2,0,[11,a(" unknown location"),0]],a("%s unknown location")],Qb=a("Out of memory"),Qc=a("Stack overflow"),Qd=a("Pattern matching failed"),Qe=a("Assertion failed"),Qf=a("Undefined recursive module"),P9=[0,[12,40,[2,0,[2,0,[12,41,0]]]],a("(%s%s)")],P_=a(ac),P$=a(ac),Qa=[0,[12,40,[2,0,[12,41,0]]],a("(%s)")],P6=[0,[4,0,0,0,0],a(sr)],P4=[0,[3,0,0],a("%S")],P5=a(LD),Qp=[0,a(ac),a("(Cannot print locations:\n bytecode executable program file not found)"),a("(Cannot print locations:\n bytecode executable program file appears to be corrupt)"),a("(Cannot print locations:\n bytecode executable program file has wrong magic number)"),a("(Cannot print locations:\n bytecode executable program file cannot be opened;\n -- too many open files. Try running with OCAMLRUNPARAM=b=2)")],Qz=a("Fun.Finally_raised: "),Qx=a("Stdlib.Fun.Finally_raised"),QA=a(Ea),QP=[0,0],bNH=a("OCAMLRUNPARAM"),bNF=a("CAMLRUNPARAM"),QB=a(ac),Rc=[3,0,3],Rd=a(e5),Q9=a(mK),Q_=a("<\/"),Q$=a(ac),Q5=a(mK),Q6=a(tm),Q7=a(ac),Q3=a("\n"),QZ=a(ac),Q0=a(ac),Q1=a(ac),Q2=a(ac),QY=[0,a(ac)],QU=a(ac),QV=a(ac),QW=a(ac),QX=a(ac),QS=[0,a(ac),0,a(ac)],QR=a(ac),QQ=a("Stdlib.Format.String_tag"),Rn=a(ac),Rs=a(B1),Ru=a(IB),Rv=a(yz),Rw=a(E$),Rx=a(GB),Ry=a(Hl),Rz=a(xV),RA=a(Lu),RB=a(sw),RC=a(Cd),RD=a(Lt),RE=a(ym),RF=a(Lv),RG=a(J6),RH=a(wK),RI=a(AS),RJ=a(E_),RK=a(Br),RL=a(Ks),RM=a(Dc),RN=a(pF),RO=a(Fx),RP=a(Az),RQ=a(DS),RR=a(Af),RS=a(yX),RT=a(pp),RU=a(tA),RV=a(BF),RW=a(xh),RX=a(Cv),RY=a(Is),RZ=a(Ay),R0=a(Mp),R1=a(xK),R2=a(BA),R3=a(xy),R4=a(zh),R5=a(IA),R6=a(Gr),R7=a(B7),R8=a(yu),R9=a(Bo),R_=a(Kx),R$=a(IS),Sa=a(zO),Sb=a(Mf),Sc=a(B5),Sd=a(Fv),Se=a(Ku),Sf=a(KY),Sg=a(F$),Sh=a(Dl),Si=a(yq),Sj=a(zN),Sk=a(Cc),Sl=a(JU),Sm=a(H_),Sn=a(DN),So=a(Ak),Sp=a(DG),Sq=a(Hk),Sr=a(zl),Ss=a(Bn),St=a(B_),Su=a(FE),Sv=a(LI),Sw=a(L2),Sx=[0,[11,a("EUNKNOWNERR "),[4,0,0,0,0]],a("EUNKNOWNERR %d")],Rt=[0,[11,a("Unix.Unix_error(Unix."),[2,0,[11,a(fG),[3,0,[11,a(fG),[3,0,[12,41,0]]]]]]],a("Unix.Unix_error(Unix.%s, %S, %S)")],Ro=a(kE),Rp=a(ac),Rq=a(ac),Rr=a(kE),Sy=a("0.0.0.0"),Sz=a("127.0.0.1"),bNE=a("::"),bND=a("::1"),SP=a(ac),SQ=a(ac),S1=a("Str.matched_group"),SW=[0,92],SY=a("\\( group not closed by \\)"),SX=[0,a(A$),521,10],SZ=a("[ class not closed by ]"),S0=a("spurious \\) in regular expression"),SS=a("too many r* or r+ where r is nullable"),ST=a(ac),SU=a(ac),SR=[0,a(A$),sb,11],S5=[0,a(Dq),52,4],S4=[0,a(Dq),58,34],S3=a("Not a valid time zone"),Vf=a("Not a month"),Vd=a("Not a day"),Va=a("from_business: bad week"),Vb=a("from_business: bad date"),Un=[0,a(KZ),o6,4],Um=[0,a(KZ),dl,4],Uf=[0,-4713,12,31],Ug=[0,Lq,1,23],Uh=[0,kk,10,14],Ui=[0,kk,10,5],Ud=a("Date.Out_of_bounds"),Ue=a("Date.Undefined"),UD=a("Date.Period.Not_computable"),UM=[0,31,59,90,nR,cZ,hn,212,243,273,304,xf,nb],Vj=[0,a(om),cW,6],Vi=[0,a(om),z6,4],Vh=[0,a(om),j6,6],Vg=[0,a(om),67,4],WG=a("seconds_since_1970"),WD=a("second"),WB=a("minute"),Wz=a("hour"),Wv=a("date"),Ws=a("Cannot create the "),Wj=a("%j (year not provided)"),V7=a("%:"),V6=a("%::::"),Wq=[0,a(f_),402,6],V8=a(Fl),V9=a(":::z"),V_=a(Lk),V$=a(y_),Wa=[0,a(f_),509,12],Wb=a("am"),Wc=a("pm"),Wd=a(gf),We=a(gf),Wf=a("%P"),Wg=a("%V"),Wh=a("%W"),Wi=a("%j"),Wp=a("%w"),V5=a(Fk),Wk=a(Ip),Wl=a(Gp),Wm=a(gf),Wn=a(gf),Wo=a("%p"),Wr=[0,a(f_),po,6],V1=a("[\\+-]"),V2=a(fc),V3=a(cU),V4=[0,a(f_),396,8],VZ=a(" (either week or year is not provided)"),V0=a("[0-9][0-9]\\(\\.[0-9]*\\)?"),VX=[0,a(f_),mP,6],VW=a("z\\|:z\\|::z"),VS=a(Lk),VT=a(y_),VU=a(Fl),VV=[0,a(f_),s3,13],VR=a(Fk),VY=[0,a(f_),297,6],VQ=a(Ip),VP=a(Gp),VI=a(" does not match the format "),VH=a("bad format: "),VG=[0,a(f_),81,2],Vu=a("January"),Vv=a("February"),Vw=a("March"),Vx=a("April"),Vy=a("May"),Vz=a("June"),VA=a("July"),VB=a("August"),VC=a("September"),VD=a("October"),VE=a("November"),VF=a("December"),Vn=a("Sunday"),Vo=a("Monday"),Vp=a("Tuesday"),Vq=a("Wednesday"),Vr=a("Thursday"),Vs=a("Friday"),Vt=a("Saturday"),VJ=a("%b"),VK=a(KL),VL=a("%A"),VM=a("[a-zA-Z]+"),Wx=a(sK),WM=gY(1,0,0),WI=a("Z.Overflow"),WJ=a(n0),WQ=a(ac),WR=a("+inf"),WS=a("-inf"),WT=a(Mo),WU=a("undef"),WW=[0,a("q.ml"),j4,25],WV=a("Q.of_string: invalid digit"),WO=a(yh),WN=a(yh),W0=a("Buf.extend: reached Sys.max_string_length"),Xy=[0,a(sf),72,32],Xv=[0,a(sf),72,32],Xu=a("Root is not an object or array"),Xq=a("NaN value not allowed in standard JSON"),Xr=[0,[8,[0,0,3],0,[0,16],0],a(yP)],Xt=[0,[8,[0,0,3],0,[0,17],0],a(KD)],Xs=a(Hv),Xo=a("Infinity value not allowed in standard JSON"),Xp=a("-Infinity value not allowed in standard JSON"),Xk=a("NaN"),Xl=[0,[8,[0,0,3],0,[0,16],0],a(yP)],Xn=[0,[8,[0,0,3],0,[0,17],0],a(KD)],Xm=a(Hv),Xi=a("Infinity"),Xj=a("-Infinity"),Xf=a(xG),Xg=a(zX),Xe=a("null"),W_=a(xj),W$=a(At),Xa=a(Be),Xb=a("\\f"),Xc=a(Hi),Xd=a('\\"'),W9=a(xT),W8=[0,[11,a("src="),[3,0,[11,a(" start="),[4,3,0,0,[11,a(" len="),[4,3,0,0,[12,10,[10,0]]]]]]]],a("src=%S start=%i len=%i\n%!")],W6=a("\\u00"),W3=[0,a(sf),72,32],W1=a("Yojson.Json_error"),W5=[0,a(sE),a(sN),a(rY),a(tk),a(r4),a(ac),a(ac),a(ac),a(ac),a(ac),a(ac)],Xx=[0,a(sE),a(sN),a(rY),a(tk),a(r4),a(ac),a(ac),a(ac),a(ac),a(ac),a(ac)],XA=[0,a(sE),a(sN),a(rY),a(tk),a(r4),a(ac),a(ac),a(ac),a(ac),a(ac),a(ac)],Yy=a("unreachable due to the [is_subscope_call] test"),YA=a("unreachable due to the [is_subscope_input_var_def] test"),YB=a("]"),YC=a("["),YD=a(" ]): expected variable definition (function output), found: "),YE=a(fG),YF=a(w1),YG=a(" ]): expected variable definition (function output), found: end of tokens"),YH=a(fG),YI=a(w1),Yz=a("Unexpected event: "),YK=a("Missing function output variable definition."),YJ=a("Invalid start of function call."),Yx=a(P),Yw=a(O),YL=[0,[11,a("An error occurred while parsing raw events: "),[2,0,[12,10,0]]],a("An error occurred while parsing raw events: %s\n")],Ym=a(G5),Yn=a(fG),Yo=[0,[11,a(A4),0],a(A4)],Yp=a(G5),Yq=a(fG),Yr=[0,[11,a(DW),0],a(DW)],Ys=a(fG),Yt=[0,[11,a("VariableDefinition([ "),[2,0,[11,a(" ], "),[2,0,[12,41,0]]]]],a("VariableDefinition([ %s ], %s)")],Yu=[0,[11,a(FZ),0],a(FZ)],X8=[0,c0,a("VarComputation")],X9=[0,c0,a("FunCall")],X_=a(Cg),X$=a("inputs"),Ya=a(G9),Yb=[0,c0,a("SubScopeCall")],Yc=a("fun_calls"),Yd=a("value"),Ye=a(G9),Yf=a("pos"),Yg=a(O),Yh=a(Cg),Yi=a(P),Yj=a("fun_name"),XX=[0,cm,[0,[0,c0,a("Unit")],0]],XY=[0,cm,[0,[0,c0,a("Unembeddable")],0]],XZ=[0,c0,a("Bool")],X0=[0,c0,a("Money")],X1=[0,c0,a("Integer")],X2=[0,c0,a("Decimal")],X3=[0,c0,a("Date")],X4=[0,c0,a("Duration")],X5=[0,c0,a("Enum")],X6=[0,c0,a("Struct")],X7=[0,c0,a("Array")],XU=[0,[12,44,[17,[0,a("@ "),1,0],0]],a(",@ ")],XT=[0,[4,0,0,0,[12,32,[2,0,0]]],a("%d %s")],XQ=a("days"),XR=a("months"),XS=a("years"),XV=[0,[15,0],a(y2)],XW=a("empty duration"),XC=a("law_headings"),XD=a("end_column"),XE=a("end_line"),XF=a("start_column"),XG=a("start_line"),XH=a("filename"),XI=a("Runtime_ocaml.Runtime.EmptyError"),XJ=a("Runtime_ocaml.Runtime.AssertionFailed"),XK=a("Runtime_ocaml.Runtime.ConflictError"),XL=a("Runtime_ocaml.Runtime.UncomparableDurations"),XN=a("Runtime_ocaml.Runtime.ImpossibleDate"),XP=a("Runtime_ocaml.Runtime.NoValueProvided"),YN=a("Jsoo_runtime.Error.Exn"),YO=a(s$),Y6=[0,[2,0,[11,a(" in file "),[2,0,[11,a(", position "),[4,0,0,0,[12,58,[4,0,0,0,[11,a("--"),[4,0,0,0,[12,58,bNK]]]]]]]]]],a("%s in file %s, position %d:%d--%d:%d.")],Y7=a("No rule applies in the given context to give a value to the variable"),Y8=a("A conflict happend between two rules giving a value to the variable"),Y9=a("A failure happened in the assertion"),YZ=a("Begin call"),Y0=a("End call"),Y1=a("Variable definition"),Y2=a("Decision taken"),YX=a(ac),YV=a("date_of_jsoo: invalid date"),YT=[0,a(GY),a(BI),a(DP)],YU=[0,a(GY),a(DP),a(BI)],alr=[0,a(bp),90,14,90,29,[0,a(bP),[0,a(bq),0]]],alk=[0,a(bp),eg,18,eg,64,[0,a(bP),[0,a(bq),0]]],all=[0,a(bp),77,3,77,25,[0,a(bP),[0,a(bq),0]]],alj=[0,a(bp),77,3,77,25,[0,a(bP),[0,a(bq),0]]],alf=[0,a(bp),87,14,87,53,[0,a(bP),[0,a(bq),0]]],alb=[0,a(bp),86,14,86,50,[0,a(bP),[0,a(bq),0]]],ak9=[0,a(bp),89,14,89,46,[0,a(bP),[0,a(bq),0]]],ak5=[0,a(bp),88,14,88,54,[0,a(bP),[0,a(bq),0]]],ak0=[0,a(bp),97,18,97,72,[0,a(bP),[0,a(bq),0]]],ak1=[0,a(bp),77,3,77,25,[0,a(bP),[0,a(bq),0]]],akZ=[0,a(bp),77,3,77,25,[0,a(bP),[0,a(bq),0]]],akU=[0,a(bp),93,18,93,67,[0,a(bP),[0,a(bq),0]]],akV=[0,a(bp),77,3,77,25,[0,a(bP),[0,a(bq),0]]],akT=[0,a(bp),77,3,77,25,[0,a(bP),[0,a(bq),0]]],akP=[0,a(bp),bt,14,bt,30,[0,a("Article L131-1"),[0,a(bP),[0,a(bq),0]]]],akM=[0,0],akN=[1,0],akO=[2,0],akQ=[0,a(bp),76,11,76,27,[0,a(bP),[0,a(bq),0]]],akL=[0,a(bp),76,11,76,27,[0,a(bP),[0,a(bq),0]]],akR=[0,a(ez),[0,a("enfants_\xc3\xa0_charge"),0]],akW=[0,a(bp),77,3,77,25,[0,a(bP),[0,a(bq),0]]],akX=[0,a(ez),[0,a("allocations_familiales.personne_charge_effective_permanente_est_parent"),0]],akS=[0,a(H),86,10,86,57,[0,a(L),[0,a(I),[0,a(B),0]]]],ak2=[0,a(bp),77,3,77,25,[0,a(bP),[0,a(bq),0]]],ak3=[0,a(ez),[0,a("allocations_familiales.personne_charge_effective_permanente_remplit_titre_I"),0]],akY=[0,a(H),87,10,87,62,[0,a(L),[0,a(I),[0,a(B),0]]]],ak6=[0,a(bp),77,3,77,25,[0,a(bP),[0,a(bq),0]]],ak7=[0,a(ez),[0,a("allocations_familiales.ressources_m\xc3\xa9nage"),0]],ak4=[0,a(H),88,10,88,27,[0,a(L),[0,a(I),[0,a(B),0]]]],ak_=[0,a(bp),77,3,77,25,[0,a(bP),[0,a(bq),0]]],ak$=[0,a(ez),[0,a("allocations_familiales.r\xc3\xa9sidence"),0]],ak8=[0,a(H),89,10,89,19,[0,a(L),[0,a(I),[0,a(B),0]]]],alc=[0,a(bp),77,3,77,25,[0,a(bP),[0,a(bq),0]]],ald=[0,a(ez),[0,a("allocations_familiales.date_courante"),0]],ala=[0,a(H),92,10,92,23,[0,a(L),[0,a(I),[0,a(B),0]]]],alg=[0,a(bp),77,3,77,25,[0,a(bP),[0,a(bq),0]]],alh=[0,a(ez),[0,a("allocations_familiales.enfants_\xc3\xa0_charge"),0]],ale=[0,a(H),95,10,95,26,[0,a(L),[0,a(I),[0,a(B),0]]]],alm=[0,a(bp),77,3,77,25,[0,a(bP),[0,a(bq),0]]],aln=[0,a(ez),[0,a("allocations_familiales.avait_enfant_\xc3\xa0_charge_avant_1er_janvier_2012"),0]],ali=[0,a(H),hp,10,hp,54,[0,a(L),[0,a(I),[0,a(B),0]]]],alo=[0,a(ez),[0,a(w_),[0,a(X),0]]],alp=[0,a(ez),[0,a(w_),[0,a(X),0]]],als=[0,a(bp),80,10,80,25,[0,a(bP),[0,a(bq),0]]],alq=[0,a(bp),80,10,80,25,[0,a(bP),[0,a(bq),0]]],alt=[0,a(ez),[0,a("i_montant_vers\xc3\xa9"),0]],akG=[0,a(bp),45,14,45,27,[0,a(gs),[0,a(bq),0]]],akF=a(p),akB=[0,a(bw),hn,14,hn,62,[0,a(c$),[0,a(aQ),[0,a(aS),[0,a(aE),[0,a(bd),[0,a(ai),0]]]]]]],akw=[0,a(X),[0,a(ka),[0,a(P),0]]],akx=[0,a(X),[0,a(ka),0]],aky=[0,a(X),[0,a(ka),[0,a(O),0]]],akz=[0,a(X),[0,a(ka),0]],akA=a(p),aks=[0,a(bw),mp,14,mp,61,[0,a(c$),[0,a(aQ),[0,a(aS),[0,a(aE),[0,a(bd),[0,a(ai),0]]]]]]],ako=[0,a(bp),39,14,39,38,[0,a(gs),[0,a(bq),0]]],akj=[0,a(X),[0,a(kj),[0,a(P),0]]],akk=[0,a(X),[0,a(kj),0]],akl=[0,a(X),[0,a(kj),[0,a(O),0]]],akm=[0,a(X),[0,a(kj),0]],aki=a(p),akn=a(p),ake=[0,a(bp),37,14,37,32,[0,a(gs),[0,a(bq),0]]],akd=a(p),aj$=[0,a(em),mp,5,mp,43,[0,a("Article R521-4"),[0,a(aQ),[0,a(aS),[0,a(aE),[0,a(dk),[0,a(ai),0]]]]]]],aj0=[0,a(X),[0,a(fE),[0,a(P),0]]],aj1=[0,a(X),[0,a(fE),0]],aj2=[0,a(X),[0,a(fE),[0,a(O),0]]],aj3=[0,a(X),[0,a(fE),0]],aj4=a(eP),aj9=a(jR),aj_=a(cw),aj5=[0,a(X),[0,a(jN),[0,a(P),0]]],aj6=[0,a(X),[0,a(jN),0]],aj7=[0,a(X),[0,a(jN),[0,a(O),0]]],aj8=[0,a(X),[0,a(jN),0]],aka=[0,a(H),ia,11,ia,49,[0,a(L),[0,a(I),[0,a(B),0]]]],ajZ=[0,a(H),ia,11,ia,49,[0,a(L),[0,a(I),[0,a(B),0]]]],ajW=[0,a(em),eX,14,eX,46,[0,a(nJ),[0,a(aQ),[0,a(aS),[0,a(aE),[0,a(dk),[0,a(ai),0]]]]]]],ajO=a(cY),ajP=[0,a(bw),no,5,277,41,[0,a(gE),[0,a(aQ),[0,a(aS),[0,a(aE),[0,a(bd),[0,a(ai),0]]]]]]],ajL=a(cY),ajM=a(eP),ajN=a(cY),ajQ=[0,a(H),e0,11,e0,52,[0,a(L),[0,a(I),[0,a(B),0]]]],ajJ=a(cY),ajK=[0,a(bw),265,5,rE,42,[0,a(gE),[0,a(aQ),[0,a(aS),[0,a(aE),[0,a(bd),[0,a(ai),0]]]]]]],ajG=a(cY),ajH=a(eP),ajI=a(cY),ajR=[0,a(H),e0,11,e0,52,[0,a(L),[0,a(I),[0,a(B),0]]]],ajS=[0,a(H),e0,11,e0,52,[0,a(L),[0,a(I),[0,a(B),0]]]],ajF=[0,a(bw),mP,14,mP,55,[0,a(gE),[0,a(aQ),[0,a(aS),[0,a(aE),[0,a(bd),[0,a(ai),0]]]]]]],ajE=a(p),ajr=[0,a(X),[0,a(bU),[0,a(P),0]]],ajs=[0,a(X),[0,a(bU),0]],ajt=[0,a(X),[0,a(bU),[0,a(O),0]]],aju=[0,a(X),[0,a(bU),0]],ajv=a(x),ajw=a("11"),ajx=a(hb),ajy=[0,a(bw),376,5,379,42,[0,a(j0),[0,a(ff),[0,a(hs),[0,a(ea),[0,a(bd),[0,a(ai),0]]]]]]],ajq=a("0.0369"),ajz=[0,a(H),cH,11,cH,37,[0,a(L),[0,a(I),[0,a(B),0]]]],aji=[0,a(X),[0,a(bU),[0,a(P),0]]],ajj=[0,a(X),[0,a(bU),0]],ajk=[0,a(X),[0,a(bU),[0,a(O),0]]],ajl=[0,a(X),[0,a(bU),0]],ajm=a(x),ajn=a(hb),ajo=[0,a(bw),385,5,sC,23,[0,a(j0),[0,a(ff),[0,a(hs),[0,a(ea),[0,a(bd),[0,a(ai),0]]]]]]],ajh=a("0.0567"),ajp=[0,a(H),cH,11,cH,37,[0,a(L),[0,a(I),[0,a(B),0]]]],ajA=[0,a(H),cH,11,cH,37,[0,a(L),[0,a(I),[0,a(B),0]]]],ajg=[0,a(bw),22,14,22,40,[0,a(c$),[0,a(aQ),[0,a(aS),[0,a(aE),[0,a(bd),[0,a(ai),0]]]]]]],ajc=[0,a(X),[0,a(jQ),[0,a(P),0]]],ajd=[0,a(X),[0,a(jQ),0]],aje=[0,a(X),[0,a(jQ),[0,a(O),0]]],ajf=[0,a(X),[0,a(jQ),0]],ajB=[0,a(H),cH,11,cH,37,[0,a(L),[0,a(I),[0,a(B),0]]]],ajb=[0,a(H),cH,11,cH,37,[0,a(L),[0,a(I),[0,a(B),0]]]],ai7=a(x),ai8=[0,a(bw),353,5,y8,69,[0,a(j0),[0,a(ff),[0,a(hs),[0,a(ea),[0,a(bd),[0,a(ai),0]]]]]]],ai9=[0,a(H),ed,11,ed,31,[0,a(L),[0,a(I),[0,a(B),0]]]],ai4=[8,0],ai5=[0,a(a5),cZ,24,cZ,44,[0,a(dA),[0,a(bh),[0,a(bi),0]]]],ai6=[0,a(H),ed,11,ed,31,[0,a(L),[0,a(I),[0,a(B),0]]]],ai_=[0,a(H),ed,11,ed,31,[0,a(L),[0,a(I),[0,a(B),0]]]],ai3=[0,a(bw),18,14,18,34,[0,a(c$),[0,a(aQ),[0,a(aS),[0,a(aE),[0,a(bd),[0,a(ai),0]]]]]]],aiZ=[0,a(bw),sz,14,sz,39,[0,a(gE),[0,a(aQ),[0,a(aS),[0,a(aE),[0,a(bd),[0,a(ai),0]]]]]]],aiU=[0,a(X),[0,a(jS),[0,a(P),0]]],aiV=[0,a(X),[0,a(jS),0]],aiW=[0,a(X),[0,a(jS),[0,a(O),0]]],aiX=[0,a(X),[0,a(jS),0]],aiY=a(x),aiT=a(p),aiK=[0,a(X),[0,a(bU),[0,a(P),0]]],aiL=[0,a(X),[0,a(bU),0]],aiM=[0,a(X),[0,a(bU),[0,a(O),0]]],aiN=[0,a(X),[0,a(bU),0]],aiO=[0,a(bw),60,5,60,38,[0,a(c$),[0,a(aQ),[0,a(aS),[0,a(aE),[0,a(bd),[0,a(ai),0]]]]]]],aiJ=a(s9),aiP=[0,a(H),cu,11,cu,47,[0,a(L),[0,a(I),[0,a(B),0]]]],aiD=[0,a(X),[0,a(bU),[0,a(P),0]]],aiE=[0,a(X),[0,a(bU),0]],aiF=[0,a(X),[0,a(bU),[0,a(O),0]]],aiG=[0,a(X),[0,a(bU),0]],aiH=[0,a(bw),eg,5,eg,38,[0,a(c$),[0,a(aQ),[0,a(aS),[0,a(aE),[0,a(bd),[0,a(ai),0]]]]]]],aiC=a(BY),aiI=[0,a(H),cu,11,cu,47,[0,a(L),[0,a(I),[0,a(B),0]]]],aiw=[0,a(X),[0,a(bU),[0,a(P),0]]],aix=[0,a(X),[0,a(bU),0]],aiy=[0,a(X),[0,a(bU),[0,a(O),0]]],aiz=[0,a(X),[0,a(bU),0]],aiA=[0,a(bw),pq,5,pq,38,[0,a(c$),[0,a(aQ),[0,a(aS),[0,a(aE),[0,a(bd),[0,a(ai),0]]]]]]],aiv=a(Ca),aiB=[0,a(H),cu,11,cu,47,[0,a(L),[0,a(I),[0,a(B),0]]]],aip=[0,a(X),[0,a(bU),[0,a(P),0]]],aiq=[0,a(X),[0,a(bU),0]],air=[0,a(X),[0,a(bU),[0,a(O),0]]],ais=[0,a(X),[0,a(bU),0]],ait=[0,a(bp),28,5,28,44,[0,a(gs),[0,a(bq),0]]],aio=a(p),aiu=[0,a(H),cu,11,cu,47,[0,a(L),[0,a(I),[0,a(B),0]]]],aiQ=[0,a(H),cu,11,cu,47,[0,a(L),[0,a(I),[0,a(B),0]]]],ain=[0,a(H),cu,11,cu,47,[0,a(L),[0,a(I),[0,a(B),0]]]],aik=[0,a(em),cH,14,cH,41,[0,a(nJ),[0,a(aQ),[0,a(aS),[0,a(aE),[0,a(dk),[0,a(ai),0]]]]]]],aii=a(cw),aij=a(cw),aia=[8,0],aib=[0,a(a5),iS,5,iS,69,[0,a(bx),[0,a(bh),[0,a(bi),0]]]],ah9=a(x),ah_=a(xs),ah$=a(p),aic=[0,a(H),bc,11,bc,47,[0,a(L),[0,a(I),[0,a(B),0]]]],ah6=[8,0],ah7=[0,a(a5),z3,5,z3,69,[0,a(bx),[0,a(bh),[0,a(bi),0]]]],ah3=a(x),ah4=a("0.2379"),ah5=a(p),ah8=[0,a(H),bc,11,bc,47,[0,a(L),[0,a(I),[0,a(B),0]]]],ah0=[8,0],ah1=[0,a(a5),Aq,5,Aq,69,[0,a(bx),[0,a(bh),[0,a(bi),0]]]],ahX=a(x),ahY=a("0.2437"),ahZ=a(p),ah2=[0,a(H),bc,11,bc,47,[0,a(L),[0,a(I),[0,a(B),0]]]],ahU=[8,0],ahV=[0,a(a5),hh,5,hh,69,[0,a(bx),[0,a(bh),[0,a(bi),0]]]],ahR=a(x),ahS=a("0.2496"),ahT=a(p),ahW=[0,a(H),bc,11,bc,47,[0,a(L),[0,a(I),[0,a(B),0]]]],ahO=[8,0],ahP=[0,a(a5),sT,5,sT,69,[0,a(bx),[0,a(bh),[0,a(bi),0]]]],ahL=a(x),ahM=a("0.2555"),ahN=a(p),ahQ=[0,a(H),bc,11,bc,47,[0,a(L),[0,a(I),[0,a(B),0]]]],ahI=[8,0],ahJ=[0,a(a5),Fo,5,Fo,69,[0,a(bx),[0,a(bh),[0,a(bi),0]]]],ahF=a(x),ahG=a("0.2613"),ahH=a(p),ahK=[0,a(H),bc,11,bc,47,[0,a(L),[0,a(I),[0,a(B),0]]]],ahC=[8,0],ahD=[0,a(a5),Cl,5,Cl,69,[0,a(bx),[0,a(bh),[0,a(bi),0]]]],ahz=a(x),ahA=a("0.2672"),ahB=a(p),ahE=[0,a(H),bc,11,bc,47,[0,a(L),[0,a(I),[0,a(B),0]]]],ahw=[8,0],ahx=[0,a(a5),oy,5,oy,69,[0,a(bx),[0,a(bh),[0,a(bi),0]]]],aht=a(x),ahu=a("0.2804"),ahv=a(p),ahy=[0,a(H),bc,11,bc,47,[0,a(L),[0,a(I),[0,a(B),0]]]],ahq=[8,0],ahr=[0,a(a5),mI,5,mI,69,[0,a(bx),[0,a(bh),[0,a(bi),0]]]],ahn=a(x),aho=a("0.2936"),ahp=a(p),ahs=[0,a(H),bc,11,bc,47,[0,a(L),[0,a(I),[0,a(B),0]]]],ahk=[8,0],ahl=[0,a(a5),Ju,5,Ju,69,[0,a(bx),[0,a(bh),[0,a(bi),0]]]],ahh=a(x),ahi=a("0.3068"),ahj=a(p),ahm=[0,a(H),bc,11,bc,47,[0,a(L),[0,a(I),[0,a(B),0]]]],aid=[0,a(H),bc,11,bc,47,[0,a(L),[0,a(I),[0,a(B),0]]]],ahf=[8,0],ahg=[0,a(a5),j2,14,j2,50,[0,a(dA),[0,a(bh),[0,a(bi),0]]]],ahc=a(x),ahd=a(tB),ahe=a(p),aie=[0,a(H),bc,11,bc,47,[0,a(L),[0,a(I),[0,a(B),0]]]],ag$=[0,a(bw),38,14,38,50,[0,a(c$),[0,a(aQ),[0,a(aS),[0,a(aE),[0,a(bd),[0,a(ai),0]]]]]]],ag8=a(x),ag9=a(tB),ag_=a(p),aha=[0,a(H),bc,11,bc,47,[0,a(L),[0,a(I),[0,a(B),0]]]],ag6=[0,a(bw),79,14,79,50,[0,a(c$),[0,a(aQ),[0,a(aS),[0,a(aE),[0,a(bd),[0,a(ai),0]]]]]]],ag3=a(x),ag4=a(s9),ag5=a(p),ag7=[0,a(H),bc,11,bc,47,[0,a(L),[0,a(I),[0,a(B),0]]]],ag1=[0,a(bw),bt,14,bt,50,[0,a(c$),[0,a(aQ),[0,a(aS),[0,a(aE),[0,a(bd),[0,a(ai),0]]]]]]],agY=a(x),agZ=a(BY),ag0=a(p),ag2=[0,a(H),bc,11,bc,47,[0,a(L),[0,a(I),[0,a(B),0]]]],ahb=[0,a(H),bc,11,bc,47,[0,a(L),[0,a(I),[0,a(B),0]]]],agT=[0,a(bw),43,14,43,59,[0,a(c$),[0,a(aQ),[0,a(aS),[0,a(aE),[0,a(bd),[0,a(ai),0]]]]]]],agP=a(ab),agQ=a(ab),agR=a("0.41"),agS=a(p),agU=[0,a(H),dV,11,dV,56,[0,a(L),[0,a(I),[0,a(B),0]]]],agN=[0,a(bw),84,14,84,59,[0,a(c$),[0,a(aQ),[0,a(aS),[0,a(aE),[0,a(bd),[0,a(ai),0]]]]]]],agJ=a(ab),agK=a(ab),agL=a("0.205"),agM=a(p),agO=[0,a(H),dV,11,dV,56,[0,a(L),[0,a(I),[0,a(B),0]]]],agH=[0,a(bw),dl,14,dl,59,[0,a(c$),[0,a(aQ),[0,a(aS),[0,a(aE),[0,a(bd),[0,a(ai),0]]]]]]],agD=a(ab),agE=a(ab),agF=a("0.1025"),agG=a(p),agI=[0,a(H),dV,11,dV,56,[0,a(L),[0,a(I),[0,a(B),0]]]],agy=[0,a(bw),mn,5,mn,43,[0,a(gE),[0,a(aQ),[0,a(aS),[0,a(aE),[0,a(bd),[0,a(ai),0]]]]]]],agx=a("0.20234"),agz=[0,a(H),dl,11,dl,47,[0,a(L),[0,a(I),[0,a(B),0]]]],agv=[0,a(bw),232,5,233,46,[0,a(gE),[0,a(aQ),[0,a(aS),[0,a(aE),[0,a(bd),[0,a(ai),0]]]]]]],agu=a("0.10117"),agw=[0,a(H),dl,11,dl,47,[0,a(L),[0,a(I),[0,a(B),0]]]],ags=[0,a(bw),bu,5,bu,43,[0,a(gE),[0,a(aQ),[0,a(aS),[0,a(aE),[0,a(bd),[0,a(ai),0]]]]]]],agr=a("0.05059"),agt=[0,a(H),dl,11,dl,47,[0,a(L),[0,a(I),[0,a(B),0]]]],agj=a(cY),agk=[0,a(bw),173,5,174,68,[0,a(c$),[0,a(aQ),[0,a(aS),[0,a(aE),[0,a(bd),[0,a(ai),0]]]]]]],agg=a(cY),agh=a(eP),agi=a(cY),agl=[0,a(H),e6,11,e6,31,[0,a(L),[0,a(I),[0,a(B),0]]]],age=a(cY),agf=[0,a(bw),sH,5,166,68,[0,a(c$),[0,a(aQ),[0,a(aS),[0,a(aE),[0,a(bd),[0,a(ai),0]]]]]]],agb=a(cY),agc=a(eP),agd=a(cY),agm=[0,a(H),e6,11,e6,31,[0,a(L),[0,a(I),[0,a(B),0]]]],agn=[0,a(H),e6,11,e6,31,[0,a(L),[0,a(I),[0,a(B),0]]]],aga=[0,a(bw),Jm,14,Jm,34,[0,a(c$),[0,a(aQ),[0,a(aS),[0,a(aE),[0,a(bd),[0,a(ai),0]]]]]]],af$=a(p),ago=[0,a(H),e6,11,e6,31,[0,a(L),[0,a(I),[0,a(B),0]]]],af_=[0,a(H),e6,11,e6,31,[0,a(L),[0,a(I),[0,a(B),0]]]],af1=[0,a(X),[0,a(fd),[0,a(P),0]]],af2=[0,a(X),[0,a(fd),0]],af3=[0,a(X),[0,a(fd),[0,a(O),0]]],af4=[0,a(X),[0,a(fd),0]],af5=[0,a(b8),hm,5,Ae,58,[0,a(Ah),[0,a(aQ),[0,a(aS),[0,a(aE),[0,a(am),[0,a(ai),0]]]]]]],af6=[0,a(H),eZ,11,eZ,34,[0,a(L),[0,a(I),[0,a(B),0]]]],afS=[0,a(X),[0,a(kF),[0,a(P),0]]],afT=[0,a(X),[0,a(kF),0]],afU=[0,a(X),[0,a(kF),[0,a(O),0]]],afV=[0,a(X),[0,a(kF),0]],afW=[0,a(X),[0,a(fd),[0,a(P),0]]],afX=[0,a(X),[0,a(fd),0]],afY=[0,a(X),[0,a(fd),[0,a(O),0]]],afZ=[0,a(X),[0,a(fd),0]],af0=[0,a(b8),IC,5,300,58,[0,a(Ah),[0,a(aQ),[0,a(aS),[0,a(aE),[0,a(am),[0,a(ai),0]]]]]]],af7=[0,a(H),eZ,11,eZ,34,[0,a(L),[0,a(I),[0,a(B),0]]]],afR=[0,a(H),eZ,11,eZ,34,[0,a(L),[0,a(I),[0,a(B),0]]]],af8=[0,a(H),eZ,11,eZ,34,[0,a(L),[0,a(I),[0,a(B),0]]]],afQ=[0,a(H),eZ,11,eZ,34,[0,a(L),[0,a(I),[0,a(B),0]]]],afH=[8,0],afI=a(x),afJ=[0,a(a5),GQ,6,GQ,71,[0,a(dA),[0,a(bh),[0,a(bi),0]]]],afK=[0,a(H),cX,11,cX,28,[0,a(L),[0,a(I),[0,a(B),0]]]],afF=a(x),afG=[0,a(b8),sJ,5,407,72,[0,a(sg),[0,a(ff),[0,a(kl),[0,a(ea),[0,a(am),[0,a(ai),0]]]]]]],afL=[0,a(H),cX,11,cX,28,[0,a(L),[0,a(I),[0,a(B),0]]]],afM=[0,a(H),cX,11,cX,28,[0,a(L),[0,a(I),[0,a(B),0]]]],afD=a(ab),afE=[0,a(b8),eg,5,eg,70,[0,a(EO),[0,a(aQ),[0,a(aS),[0,a(aE),[0,a(am),[0,a(ai),0]]]]]]],afN=[0,a(H),cX,11,cX,28,[0,a(L),[0,a(I),[0,a(B),0]]]],afC=[0,a(H),cX,11,cX,28,[0,a(L),[0,a(I),[0,a(B),0]]]],afu=[8,0],afv=[0,a(a5),dP,5,251,53,[0,a(bx),[0,a(bh),[0,a(bi),0]]]],afr=a(p),afs=a("0.145"),aft=a(p),afw=[0,a(H),bo,11,bo,46,[0,a(L),[0,a(I),[0,a(B),0]]]],afo=[8,0],afp=[0,a(a5),yU,5,Ih,53,[0,a(bx),[0,a(bh),[0,a(bi),0]]]],afl=a(p),afm=a("0.1393"),afn=a(p),afq=[0,a(H),bo,11,bo,46,[0,a(L),[0,a(I),[0,a(B),0]]]],afi=[8,0],afj=[0,a(a5),rx,5,rE,53,[0,a(bx),[0,a(bh),[0,a(bi),0]]]],aff=a(p),afg=a("0.1335"),afh=a(p),afk=[0,a(H),bo,11,bo,46,[0,a(L),[0,a(I),[0,a(B),0]]]],afc=[8,0],afd=[0,a(a5),274,5,no,53,[0,a(bx),[0,a(bh),[0,a(bi),0]]]],ae$=a(p),afa=a("0.1278"),afb=a(p),afe=[0,a(H),bo,11,bo,46,[0,a(L),[0,a(I),[0,a(B),0]]]],ae8=[8,0],ae9=[0,a(a5),282,5,mP,53,[0,a(bx),[0,a(bh),[0,a(bi),0]]]],ae5=a(p),ae6=a("0.122"),ae7=a(p),ae_=[0,a(H),bo,11,bo,46,[0,a(L),[0,a(I),[0,a(B),0]]]],ae2=[8,0],ae3=[0,a(a5),290,5,tn,53,[0,a(bx),[0,a(bh),[0,a(bi),0]]]],aeZ=a(p),ae0=a("0.1163"),ae1=a(p),ae4=[0,a(H),bo,11,bo,46,[0,a(L),[0,a(I),[0,a(B),0]]]],aeW=[8,0],aeX=[0,a(a5),298,5,IC,53,[0,a(bx),[0,a(bh),[0,a(bi),0]]]],aeT=a(p),aeU=a("0.1105"),aeV=a(p),aeY=[0,a(H),bo,11,bo,46,[0,a(L),[0,a(I),[0,a(B),0]]]],aeQ=[8,0],aeR=[0,a(a5),306,5,307,53,[0,a(bx),[0,a(bh),[0,a(bi),0]]]],aeN=a(p),aeO=a("0.0976"),aeP=a(p),aeS=[0,a(H),bo,11,bo,46,[0,a(L),[0,a(I),[0,a(B),0]]]],aeK=[8,0],aeL=[0,a(a5),314,5,Ae,53,[0,a(bx),[0,a(bh),[0,a(bi),0]]]],aeH=a(p),aeI=a("0.0847"),aeJ=a(p),aeM=[0,a(H),bo,11,bo,46,[0,a(L),[0,a(I),[0,a(B),0]]]],aeE=[8,0],aeF=[0,a(a5),322,5,ev,53,[0,a(bx),[0,a(bh),[0,a(bi),0]]]],aeB=a(p),aeC=a("0.0717"),aeD=a(p),aeG=[0,a(H),bo,11,bo,46,[0,a(L),[0,a(I),[0,a(B),0]]]],aey=[8,0],aez=[0,a(a5),s2,5,s2,49,[0,a(bx),[0,a(bh),[0,a(bi),0]]]],aev=a(p),aew=a("5728"),aex=a(p),aeA=[0,a(H),bo,11,bo,46,[0,a(L),[0,a(I),[0,a(B),0]]]],afx=[0,a(H),bo,11,bo,46,[0,a(L),[0,a(I),[0,a(B),0]]]],aet=[8,0],aeu=[0,a(a5),j6,14,j6,49,[0,a(dA),[0,a(bh),[0,a(bi),0]]]],aeq=a(p),aer=a(xz),aes=a(p),afy=[0,a(H),bo,11,bo,46,[0,a(L),[0,a(I),[0,a(B),0]]]],aen=a(x),aeo=[0,a(bw),362,5,rv,71,[0,a(j0),[0,a(ff),[0,a(hs),[0,a(ea),[0,a(bd),[0,a(ai),0]]]]]]],aem=a(xz),aep=[0,a(H),bo,11,bo,46,[0,a(L),[0,a(I),[0,a(B),0]]]],ael=[0,a(bw),hh,29,hh,64,[0,a(j0),[0,a(ff),[0,a(hs),[0,a(ea),[0,a(bd),[0,a(ai),0]]]]]]],aek=a(p),aeg=[0,a(em),iw,14,iw,34,[0,a(nJ),[0,a(aQ),[0,a(aS),[0,a(aE),[0,a(dk),[0,a(ai),0]]]]]]],ad$=[0,a(X),[0,a(fE),[0,a(P),0]]],aea=[0,a(X),[0,a(fE),0]],aeb=[0,a(X),[0,a(fE),[0,a(O),0]]],aec=[0,a(X),[0,a(fE),0]],aed=a(eP),aee=a(jR),aef=a(cw),ad_=a(cw),ad6=[0,a(em),Id,14,Id,34,[0,a(nJ),[0,a(aQ),[0,a(aS),[0,a(aE),[0,a(dk),[0,a(ai),0]]]]]]],adZ=[8,0],ad0=[0,a(a5),CP,5,CP,69,[0,a(bx),[0,a(bh),[0,a(bi),0]]]],adW=a(ab),adX=a(B$),adY=a(p),ad1=[0,a(H),bt,11,bt,56,[0,a(L),[0,a(I),[0,a(B),0]]]],adT=[8,0],adU=[0,a(a5),n7,5,n7,69,[0,a(bx),[0,a(bh),[0,a(bi),0]]]],adQ=a(ab),adR=a("0.0539"),adS=a(p),adV=[0,a(H),bt,11,bt,56,[0,a(L),[0,a(I),[0,a(B),0]]]],adN=[8,0],adO=[0,a(a5),h_,5,h_,69,[0,a(bx),[0,a(bh),[0,a(bi),0]]]],adK=a(ab),adL=a("0.0615"),adM=a(p),adP=[0,a(H),bt,11,bt,56,[0,a(L),[0,a(I),[0,a(B),0]]]],adH=[8,0],adI=[0,a(a5),Co,5,Co,69,[0,a(bx),[0,a(bh),[0,a(bi),0]]]],adE=a(ab),adF=a("0.069"),adG=a(p),adJ=[0,a(H),bt,11,bt,56,[0,a(L),[0,a(I),[0,a(B),0]]]],adB=[8,0],adC=[0,a(a5),L1,5,L1,69,[0,a(bx),[0,a(bh),[0,a(bi),0]]]],ady=a(ab),adz=a("0.0766"),adA=a(p),adD=[0,a(H),bt,11,bt,56,[0,a(L),[0,a(I),[0,a(B),0]]]],adv=[8,0],adw=[0,a(a5),gH,5,gH,69,[0,a(bx),[0,a(bh),[0,a(bi),0]]]],ads=a(ab),adt=a("0.0842"),adu=a(p),adx=[0,a(H),bt,11,bt,56,[0,a(L),[0,a(I),[0,a(B),0]]]],adp=[8,0],adq=[0,a(a5),pC,5,pC,69,[0,a(bx),[0,a(bh),[0,a(bi),0]]]],adm=a(ab),adn=a("0.0918"),ado=a(p),adr=[0,a(H),bt,11,bt,56,[0,a(L),[0,a(I),[0,a(B),0]]]],adj=[8,0],adk=[0,a(a5),md,5,md,69,[0,a(bx),[0,a(bh),[0,a(bi),0]]]],adg=a(ab),adh=a("0.1089"),adi=a(p),adl=[0,a(H),bt,11,bt,56,[0,a(L),[0,a(I),[0,a(B),0]]]],add=[8,0],ade=[0,a(a5),zz,5,zz,69,[0,a(bx),[0,a(bh),[0,a(bi),0]]]],ada=a(ab),adb=a("0.1259"),adc=a(p),adf=[0,a(H),bt,11,bt,56,[0,a(L),[0,a(I),[0,a(B),0]]]],ac9=[8,0],ac_=[0,a(a5),wO,5,wO,69,[0,a(bx),[0,a(bh),[0,a(bi),0]]]],ac6=a(ab),ac7=a("0.143"),ac8=a(p),ac$=[0,a(H),bt,11,bt,56,[0,a(L),[0,a(I),[0,a(B),0]]]],ad2=[0,a(H),bt,11,bt,56,[0,a(L),[0,a(I),[0,a(B),0]]]],ac5=[0,a(a5),mt,14,mt,59,[0,a(dA),[0,a(bh),[0,a(bi),0]]]],ac2=a(ab),ac3=a(s9),ac4=a(p),acY=[0,a(a5),m6,14,m6,67,[0,a(dA),[0,a(bh),[0,a(bi),0]]]],acU=a(ak),acV=a(ak),acW=a(B$),acX=a(p),acN=a(x),acO=[0,a(b8),420,6,421,72,[0,a(sg),[0,a(ff),[0,a(kl),[0,a(ea),[0,a(am),[0,a(ai),0]]]]]]],acP=[0,a(H),ee,11,ee,35,[0,a(L),[0,a(I),[0,a(B),0]]]],acI=[0,a(cF),[0,a(id),[0,a(P),0]]],acJ=[0,a(cF),[0,a(id),0]],acK=[0,a(cF),[0,a(id),[0,a(O),0]]],acL=[0,a(cF),[0,a(id),0]],acM=[0,a(b8),o6,5,eX,59,[0,a(EO),[0,a(aQ),[0,a(aS),[0,a(aE),[0,a(am),[0,a(ai),0]]]]]]],acQ=[0,a(H),ee,11,ee,35,[0,a(L),[0,a(I),[0,a(B),0]]]],acH=[0,a(H),ee,11,ee,35,[0,a(L),[0,a(I),[0,a(B),0]]]],acR=[0,a(H),ee,11,ee,35,[0,a(L),[0,a(I),[0,a(B),0]]]],acG=[0,a(H),ee,11,ee,35,[0,a(L),[0,a(I),[0,a(B),0]]]],acA=a(x),acB=[0,a(b8),tg,5,to,71,[0,a(sg),[0,a(ff),[0,a(kl),[0,a(ea),[0,a(am),[0,a(ai),0]]]]]]],acC=[0,a(H),e$,11,e$,34,[0,a(L),[0,a(I),[0,a(B),0]]]],acz=[0,a(bp),31,9,31,32,[0,a(gs),[0,a(bq),0]]],acD=[0,a(H),e$,11,e$,34,[0,a(L),[0,a(I),[0,a(B),0]]]],acy=[0,a(H),e$,11,e$,34,[0,a(L),[0,a(I),[0,a(B),0]]]],acs=[0,a(a5),23,5,23,69,[0,a(EB),[0,a(gO),0]]],acq=a(Lr),acr=a("5628600"),act=[0,a(H),dH,11,dH,27,[0,a(L),[0,a(I),[0,a(B),0]]]],aco=[0,a(a5),56,5,56,69,[0,a(wZ),[0,a(gO),0]]],acm=a(L8),acn=a("5684900"),acp=[0,a(H),dH,11,dH,27,[0,a(L),[0,a(I),[0,a(B),0]]]],ack=[0,a(a5),89,5,89,69,[0,a(F7),[0,a(gO),0]]],aci=a(DV),acj=a("5775900"),acl=[0,a(H),dH,11,dH,27,[0,a(L),[0,a(I),[0,a(B),0]]]],acg=[0,a(a5),hp,5,hp,69,[0,a(cQ),[0,a(Kj),[0,a(gO),0]]]],ace=a(FH),acf=a("5827900"),ach=[0,a(H),dH,11,dH,27,[0,a(L),[0,a(I),[0,a(B),0]]]],acu=[0,a(H),dH,11,dH,27,[0,a(L),[0,a(I),[0,a(B),0]]]],acd=[0,a(bw),HJ,14,HJ,30,[0,a(KI),[0,a(aQ),[0,a(aS),[0,a(aE),[0,a(bd),[0,a(ai),0]]]]]]],acb=a(IF),acc=a("5595000"),ab7=[0,a(a5),30,5,30,69,[0,a(EB),[0,a(gO),0]]],ab5=a(Lr),ab6=a("7877000"),ab8=[0,a(H),cZ,11,cZ,28,[0,a(L),[0,a(I),[0,a(B),0]]]],ab3=[0,a(a5),63,5,63,69,[0,a(wZ),[0,a(gO),0]]],ab1=a(L8),ab2=a("7955800"),ab4=[0,a(H),cZ,11,cZ,28,[0,a(L),[0,a(I),[0,a(B),0]]]],abZ=[0,a(a5),96,5,96,69,[0,a(F7),[0,a(gO),0]]],abX=a(DV),abY=a("8083100"),ab0=[0,a(H),cZ,11,cZ,28,[0,a(L),[0,a(I),[0,a(B),0]]]],abV=[0,a(a5),Dg,5,Dg,69,[0,a(cQ),[0,a(Kj),[0,a(gO),0]]]],abT=a(FH),abU=a("8155800"),abW=[0,a(H),cZ,11,cZ,28,[0,a(L),[0,a(I),[0,a(B),0]]]],ab9=[0,a(H),cZ,11,cZ,28,[0,a(L),[0,a(I),[0,a(B),0]]]],abS=[0,a(bw),gt,14,gt,31,[0,a(KI),[0,a(aQ),[0,a(aS),[0,a(aE),[0,a(bd),[0,a(ai),0]]]]]]],abQ=a(IF),abR=a("7830000"),abM=[0,a(bp),34,14,34,36,[0,a(gs),[0,a(bq),0]]],abN=[0,a(H),ny,11,ny,33,[0,a(L),[0,a(I),[0,a(B),0]]]],abL=[0,a(H),ny,11,ny,33,[0,a(L),[0,a(I),[0,a(B),0]]]],abI=[0,a(b8),75,14,75,64,[0,a(hf),[0,a(ho),[0,a(eE),[0,a(aE),[0,a(am),[0,a(ai),0]]]]]]],abE=[0,a(cF),[0,a(dG),[0,a(P),0]]],abF=[0,a(cF),[0,a(dG),0]],abG=[0,a(cF),[0,a(dG),[0,a(O),0]]],abH=[0,a(cF),[0,a(dG),0]],abz=[0,a(em),83,19,83,69,[0,a(mS),[0,a(aQ),[0,a(aS),[0,a(aE),[0,a(dk),[0,a(ai),0]]]]]]],abA=[0,a(H),iQ,11,iQ,38,[0,a(L),[0,a(I),[0,a(B),0]]]],aby=[0,a(em),56,14,56,41,[0,a(mS),[0,a(aQ),[0,a(aS),[0,a(aE),[0,a(dk),[0,a(ai),0]]]]]]],abx=a("14"),abB=[0,a(H),iQ,11,iQ,38,[0,a(L),[0,a(I),[0,a(B),0]]]],abw=[0,a(H),iQ,11,iQ,38,[0,a(L),[0,a(I),[0,a(B),0]]]],abr=[0,a(bp),33,14,33,40,[0,a(gs),[0,a(bq),0]]],abl=[0,a(H),s_,14,s_,46,[0,a(L),[0,a(I),[0,a(B),0]]]],abh=[0,a(H),Dr,14,Dr,56,[0,a(L),[0,a(I),[0,a(B),0]]]],abg=[1,0],abc=[0,a(H),rM,14,rM,50,[0,a(L),[0,a(I),[0,a(B),0]]]],aa8=[0,a(H),J3,14,J3,32,[0,a(L),[0,a(I),[0,a(B),0]]]],aa2=[0,a(em),64,14,64,44,[0,a(mS),[0,a(aQ),[0,a(aS),[0,a(aE),[0,a(dk),[0,a(ai),0]]]]]]],aa1=a(ak),aaX=[0,a(bw),tn,14,tn,35,[0,a(gE),[0,a(aQ),[0,a(aS),[0,a(aE),[0,a(bd),[0,a(ai),0]]]]]]],aaW=a(ak),aaR=[0,a(b8),yU,5,Ih,56,[0,a(eA),[0,a(aQ),[0,a(aS),[0,a(aE),[0,a(am),[0,a(ai),0]]]]]]],aaQ=[1,0],aaS=[0,a(H),99,11,99,20,[0,a(L),[0,a(I),[0,a(B),0]]]],aaL=[0,a(b8),269,5,270,48,[0,a(eA),[0,a(aQ),[0,a(aS),[0,a(aE),[0,a(am),[0,a(ai),0]]]]]]],aaK=[0,0],aaM=[0,a(H),99,11,99,20,[0,a(L),[0,a(I),[0,a(B),0]]]],aaJ=[0,a(b8),mn,5,mn,70,[0,a(eA),[0,a(aQ),[0,a(aS),[0,a(aE),[0,a(am),[0,a(ai),0]]]]]]],aaI=[0,0],aaN=[0,a(H),99,11,99,20,[0,a(L),[0,a(I),[0,a(B),0]]]],aaH=[0,a(b8),Lj,5,Lj,69,[0,a(eA),[0,a(aQ),[0,a(aS),[0,a(aE),[0,a(am),[0,a(ai),0]]]]]]],aaG=[0,0],aaO=[0,a(H),99,11,99,20,[0,a(L),[0,a(I),[0,a(B),0]]]],aaF=[0,a(b8),F5,5,F5,60,[0,a(eA),[0,a(aQ),[0,a(aS),[0,a(aE),[0,a(am),[0,a(ai),0]]]]]]],aaE=[0,0],aaP=[0,a(H),99,11,99,20,[0,a(L),[0,a(I),[0,a(B),0]]]],aaT=[0,a(H),99,11,99,20,[0,a(L),[0,a(I),[0,a(B),0]]]],aaD=[0,a(H),99,11,99,20,[0,a(L),[0,a(I),[0,a(B),0]]]],aaz=[0,a(b8),sb,5,sb,70,[0,a(eA),[0,a(aQ),[0,a(aS),[0,a(aE),[0,a(am),[0,a(ai),0]]]]]]],aay=[1,0],aaA=[0,a(H),98,11,98,26,[0,a(L),[0,a(I),[0,a(B),0]]]],aaw=[0,a(b8),on,5,ki,56,[0,a(eA),[0,a(aQ),[0,a(aS),[0,a(aE),[0,a(am),[0,a(ai),0]]]]]]],aav=[2,0],aax=[0,a(H),98,11,98,26,[0,a(L),[0,a(I),[0,a(B),0]]]],aar=[0,a(b8),263,5,264,48,[0,a(eA),[0,a(aQ),[0,a(aS),[0,a(aE),[0,a(am),[0,a(ai),0]]]]]]],aaq=[0,0],aas=[0,a(H),98,11,98,26,[0,a(L),[0,a(I),[0,a(B),0]]]],aap=[0,a(b8),l9,5,l9,69,[0,a(eA),[0,a(aQ),[0,a(aS),[0,a(aE),[0,a(am),[0,a(ai),0]]]]]]],aao=[0,0],aat=[0,a(H),98,11,98,26,[0,a(L),[0,a(I),[0,a(B),0]]]],aan=[0,a(b8),Lm,5,Lm,60,[0,a(eA),[0,a(aQ),[0,a(aS),[0,a(aE),[0,a(am),[0,a(ai),0]]]]]]],aam=[0,0],aau=[0,a(H),98,11,98,26,[0,a(L),[0,a(I),[0,a(B),0]]]],aaB=[0,a(H),98,11,98,26,[0,a(L),[0,a(I),[0,a(B),0]]]],aal=[0,a(H),98,11,98,26,[0,a(L),[0,a(I),[0,a(B),0]]]],aaC=[0,a(X),[0,a(fE),0]],aaU=[0,a(X),[0,a("versement"),0]],aaY=[0,a(H),gU,11,gU,32,[0,a(L),[0,a(I),[0,a(B),0]]]],aaV=[0,a(H),gU,11,gU,32,[0,a(L),[0,a(I),[0,a(B),0]]]],aaZ=[0,a(X),[0,a("nombre_enfants_l521_1"),0]],aa3=[0,a(H),oG,11,oG,41,[0,a(L),[0,a(I),[0,a(B),0]]]],aa0=[0,a(H),oG,11,oG,41,[0,a(L),[0,a(I),[0,a(B),0]]]],aa4=[0,a(X),[0,a("nombre_enfants_alin\xc3\xa9a_2_l521_3"),0]],aa5=[0,a(X),[0,a(F_),[0,a(rV),0]]],aa6=[0,a(X),[0,a(F_),[0,a(rV),0]]],aa9=[0,a(H),ne,3,ne,7,[0,a(L),[0,a(I),[0,a(B),0]]]],aa_=[0,a(X),[0,a("bmaf.date_courante"),0]],aa7=[0,a(ex),5,10,5,23,[0,a(b7),0]],aa$=[0,a(X),[0,a(A0),[0,a(gP),0]]],aba=[0,a(X),[0,a(A0),[0,a(gP),0]]],abd=[0,a(H),iC,3,iC,25,[0,a(L),[0,a(I),[0,a(B),0]]]],abe=[0,a(X),[0,a(Gm),0]],abb=[0,a(H),63,10,63,23,[0,a(bE),[0,a(I),[0,a(B),0]]]],abi=[0,a(H),iC,3,iC,25,[0,a(L),[0,a(I),[0,a(B),0]]]],abj=[0,a(X),[0,a(I5),0]],abf=[0,a(H),64,10,64,29,[0,a(bE),[0,a(I),[0,a(B),0]]]],abm=[0,a(H),iC,3,iC,25,[0,a(L),[0,a(I),[0,a(B),0]]]],abn=[0,a(X),[0,a(Hx),0]],abk=[0,a(H),65,10,65,19,[0,a(bE),[0,a(I),[0,a(B),0]]]],abo=[0,a(X),[0,a(nD),[0,a(cF),0]]],abp=[0,a(X),[0,a(nD),[0,a(cF),0]]],abs=[0,a(H),iw,3,iw,21,[0,a(L),[0,a(I),[0,a(B),0]]]],abt=[0,a(X),[0,a("enfant_le_plus_\xc3\xa2g\xc3\xa9.enfants"),0]],abq=[0,a(H),80,10,80,17,[0,a(L),[0,a(I),[0,a(B),0]]]],abu=[0,a(X),[0,a(CE),[0,a(r0),0]]],abv=[0,a(X),[0,a(CE),[0,a(r0),0]]],abC=[0,a(X),[0,a(fd),0]],abJ=[0,a(H),96,11,96,61,[0,a(L),[0,a(I),[0,a(B),0]]]],abD=[0,a(H),96,11,96,61,[0,a(L),[0,a(I),[0,a(B),0]]]],abK=[0,a(X),[0,a("enfants_\xc3\xa0_charge_droit_ouvert_prestation_familiale"),0]],abO=[0,a(X),[0,a(kF),0]],ab_=[0,a(H),cZ,11,cZ,28,[0,a(L),[0,a(I),[0,a(B),0]]]],abP=[0,a(H),cZ,11,cZ,28,[0,a(L),[0,a(I),[0,a(B),0]]]],ab$=[0,a(X),[0,a("plafond_II_d521_3"),0]],acv=[0,a(H),dH,11,dH,27,[0,a(L),[0,a(I),[0,a(B),0]]]],aca=[0,a(H),dH,11,dH,27,[0,a(L),[0,a(I),[0,a(B),0]]]],acw=[0,a(X),[0,a("plafond_I_d521_3"),0]],acE=[0,a(H),e$,11,e$,34,[0,a(L),[0,a(I),[0,a(B),0]]]],acx=[0,a(H),e$,11,e$,34,[0,a(L),[0,a(I),[0,a(B),0]]]],acF=[0,a(X),[0,a("droit_ouvert_compl\xc3\xa9ment"),0]],acS=[0,a(X),[0,a(jS),0]],acZ=[0,a(H),l7,11,l7,64,[0,a(L),[0,a(I),[0,a(B),0]]]],acT=[0,a(H),l7,11,l7,64,[0,a(L),[0,a(I),[0,a(B),0]]]],ac0=[0,a(X),[0,a("montant_initial_base_quatri\xc3\xa8me_enfant_et_plus_mayotte"),0]],ad3=[0,a(H),bt,11,bt,56,[0,a(L),[0,a(I),[0,a(B),0]]]],ac1=[0,a(H),bt,11,bt,56,[0,a(L),[0,a(I),[0,a(B),0]]]],ad4=[0,a(X),[0,a("montant_initial_base_troisi\xc3\xa8me_enfant_mayotte"),0]],ad7=[0,a(H),kb,11,kb,31,[0,a(L),[0,a(I),[0,a(B),0]]]],ad5=[0,a(H),kb,11,kb,31,[0,a(L),[0,a(I),[0,a(B),0]]]],ad8=[0,a(X),[0,a("nombre_total_enfants"),0]],aeh=[0,a(H),iH,11,iH,31,[0,a(L),[0,a(I),[0,a(B),0]]]],ad9=[0,a(H),iH,11,iH,31,[0,a(L),[0,a(I),[0,a(B),0]]]],aei=[0,a(X),[0,a("nombre_moyen_enfants"),0]],afz=[0,a(H),bo,11,bo,46,[0,a(L),[0,a(I),[0,a(B),0]]]],aej=[0,a(H),bo,11,bo,46,[0,a(L),[0,a(I),[0,a(B),0]]]],afA=[0,a(X),[0,a("montant_initial_base_premier_enfant"),0]],afO=[0,a(H),cX,11,cX,28,[0,a(L),[0,a(I),[0,a(B),0]]]],afB=[0,a(H),cX,11,cX,28,[0,a(L),[0,a(I),[0,a(B),0]]]],afP=[0,a(X),[0,a("droit_ouvert_base"),0]],af9=[0,a(X),[0,a(bU),0]],agp=[0,a(X),[0,a(ka),0]],agA=[0,a(H),dl,11,dl,47,[0,a(L),[0,a(I),[0,a(B),0]]]],agq=[0,a(H),dl,11,dl,47,[0,a(L),[0,a(I),[0,a(B),0]]]],agB=[0,a(X),[0,a("montant_vers\xc3\xa9_forfaitaire_par_enfant"),0]],agV=[0,a(H),dV,11,dV,56,[0,a(L),[0,a(I),[0,a(B),0]]]],agC=[0,a(H),dV,11,dV,56,[0,a(L),[0,a(I),[0,a(B),0]]]],agW=[0,a(X),[0,a("montant_initial_base_troisi\xc3\xa8me_enfant_et_plus"),0]],aif=[0,a(H),bc,11,bc,47,[0,a(L),[0,a(I),[0,a(B),0]]]],agX=[0,a(H),bc,11,bc,47,[0,a(L),[0,a(I),[0,a(B),0]]]],aig=[0,a(X),[0,a("montant_initial_base_deuxi\xc3\xa8me_enfant"),0]],ail=[0,a(H),o2,11,o2,38,[0,a(L),[0,a(I),[0,a(B),0]]]],aih=[0,a(H),o2,11,o2,38,[0,a(L),[0,a(I),[0,a(B),0]]]],aim=[0,a(X),[0,a("rapport_enfants_total_moyen"),0]],aiR=[0,a(X),[0,a(jQ),0]],ai0=[0,a(H),e8,11,e8,36,[0,a(L),[0,a(I),[0,a(B),0]]]],aiS=[0,a(H),e8,11,e8,36,[0,a(L),[0,a(I),[0,a(B),0]]]],ai1=[0,a(X),[0,a("montant_vers\xc3\xa9_forfaitaire"),0]],ai$=[0,a(H),ed,11,ed,31,[0,a(L),[0,a(I),[0,a(B),0]]]],ai2=[0,a(H),ed,11,ed,31,[0,a(L),[0,a(I),[0,a(B),0]]]],aja=[0,a(X),[0,a("montant_initial_base"),0]],ajC=[0,a(X),[0,a(jN),0]],ajT=[0,a(H),e0,11,e0,52,[0,a(L),[0,a(I),[0,a(B),0]]]],ajD=[0,a(H),e0,11,e0,52,[0,a(L),[0,a(I),[0,a(B),0]]]],ajU=[0,a(X),[0,a("montant_vers\xc3\xa9_compl\xc3\xa9ment_pour_forfaitaire"),0]],ajX=[0,a(H),kK,11,kK,43,[0,a(L),[0,a(I),[0,a(B),0]]]],ajV=[0,a(H),kK,11,kK,43,[0,a(L),[0,a(I),[0,a(B),0]]]],ajY=[0,a(X),[0,a("montant_avec_garde_altern\xc3\xa9e_base"),0]],akb=[0,a(X),[0,a(kj),0]],akf=[0,a(H),nG,11,nG,29,[0,a(L),[0,a(I),[0,a(B),0]]]],akc=[0,a(H),nG,11,nG,29,[0,a(L),[0,a(I),[0,a(B),0]]]],akg=[0,a(X),[0,a("montant_vers\xc3\xa9_base"),0]],akp=[0,a(H),pl,11,pl,35,[0,a(L),[0,a(I),[0,a(B),0]]]],akh=[0,a(H),pl,11,pl,35,[0,a(L),[0,a(I),[0,a(B),0]]]],akq=[0,a(X),[0,a("montant_vers\xc3\xa9_majoration"),0]],akt=[0,a(H),oz,11,oz,58,[0,a(L),[0,a(I),[0,a(B),0]]]],akr=[0,a(H),oz,11,oz,58,[0,a(L),[0,a(I),[0,a(B),0]]]],aku=[0,a(X),[0,a("montant_base_compl\xc3\xa9ment_pour_base_et_majoration"),0]],akC=[0,a(H),nm,11,nm,59,[0,a(L),[0,a(I),[0,a(B),0]]]],akv=[0,a(H),nm,11,nm,59,[0,a(L),[0,a(I),[0,a(B),0]]]],akD=[0,a(X),[0,a("montant_vers\xc3\xa9_compl\xc3\xa9ment_pour_base_et_majoration"),0]],akH=[0,a(H),eg,10,eg,23,[0,a(L),[0,a(I),[0,a(B),0]]]],akE=[0,a(H),eg,10,eg,23,[0,a(L),[0,a(I),[0,a(B),0]]]],akI=[0,a(X),[0,a("montant_vers\xc3\xa9"),0]],akJ=[0,a(b8),z6,5,234,6,[0,a(eA),[0,a(aQ),[0,a(aS),[0,a(aE),[0,a(am),[0,a(ai),0]]]]]]],aag=[0,a("examples/allocations_familiales/autres_codes.catala_fr"),24,5,24,63,[0,a("Article L821-3"),[0,a(Ab),[0,a(LE),[0,a(za),[0,a(Q),[0,a(w),[0,a(am),[0,a(v),0]]]]]]]]],aah=[0,a(H),58,10,58,22,[0,a(bE),[0,a(I),[0,a(B),0]]]],aac=[0,a(b8),60,5,62,32,[0,a(hf),[0,a(ho),[0,a(eE),[0,a(aE),[0,a(am),[0,a(ai),0]]]]]]],aad=[0,a(H),58,10,58,22,[0,a(bE),[0,a(I),[0,a(B),0]]]],aab=[0,a(b8),49,5,50,50,[0,a(hf),[0,a(ho),[0,a(eE),[0,a(aE),[0,a(am),[0,a(ai),0]]]]]]],aae=[0,a(H),58,10,58,22,[0,a(bE),[0,a(I),[0,a(B),0]]]],aaf=[0,a(H),58,10,58,22,[0,a(bE),[0,a(I),[0,a(B),0]]]],aai=[0,a(H),58,10,58,22,[0,a(bE),[0,a(I),[0,a(B),0]]]],aaa=[0,a(H),58,10,58,22,[0,a(bE),[0,a(I),[0,a(B),0]]]],aaj=[0,a(H),58,10,58,22,[0,a(bE),[0,a(I),[0,a(B),0]]]],$$=[0,a(H),58,10,58,22,[0,a(bE),[0,a(I),[0,a(B),0]]]],$7=[0,a(b8),68,5,71,57,[0,a(hf),[0,a(ho),[0,a(eE),[0,a(aE),[0,a(am),[0,a(ai),0]]]]]]],$8=[0,a(H),59,10,59,29,[0,a(bE),[0,a(I),[0,a(B),0]]]],$6=[0,a(H),59,10,59,29,[0,a(bE),[0,a(I),[0,a(B),0]]]],$9=[0,a(H),59,10,59,29,[0,a(bE),[0,a(I),[0,a(B),0]]]],$5=[0,a(H),59,10,59,29,[0,a(bE),[0,a(I),[0,a(B),0]]]],$1=[0,a(em),xq,18,xq,41,[0,a(yy),[0,a(ff),[0,a(hs),[0,a(ea),[0,a(dk),[0,a(ai),0]]]]]]],$Z=a(pB),$0=a(o4),$2=[0,a(H),60,11,60,27,[0,a(bE),[0,a(I),[0,a(B),0]]]],$Y=[0,a(em),31,14,31,30,[0,a(nP),[0,a(m0),[0,a(eE),[0,a(aE),[0,a(dk),[0,a(ai),0]]]]]]],$W=a(pB),$X=a(o4),$L=[0,0],$N=[1,0],$O=[2,0],$P=[3,0],$Q=[4,0],$R=[5,0],$M=[0,a(b8),y8,5,hh,30,[0,a(Kb),[0,a(Hg),[0,a(kl),[0,a(ea),[0,a(am),[0,a(ai),0]]]]]]],$S=[0,a(H),62,10,62,33,[0,a(bE),[0,a(I),[0,a(B),0]]]],$K=[0,a(H),62,10,62,33,[0,a(bE),[0,a(I),[0,a(B),0]]]],$E=[0,a(H),69,14,69,28,[0,a(bE),[0,a(I),[0,a(B),0]]]],$A=[0,a(H),70,14,70,32,[0,a(bE),[0,a(I),[0,a(B),0]]]],$w=[0,a(em),21,14,21,26,[0,a(nP),[0,a(m0),[0,a(eE),[0,a(aE),[0,a(dk),[0,a(ai),0]]]]]]],$v=a(xM),$x=[0,a(H),61,10,61,22,[0,a(bE),[0,a(I),[0,a(B),0]]]],$u=[0,a(H),61,10,61,22,[0,a(bE),[0,a(I),[0,a(B),0]]]],$y=[0,a(cF),[0,a(HF),0]],$B=[0,a(H),66,3,66,7,[0,a(bE),[0,a(I),[0,a(B),0]]]],$C=[0,a(cF),[0,a(LL),0]],$z=[0,a(b0),9,10,9,23,[0,a(B),[0,a(aZ),0]]],$F=[0,a(H),66,3,66,7,[0,a(bE),[0,a(I),[0,a(B),0]]]],$G=[0,a(cF),[0,a(KK),0]],$D=[0,a(b0),10,10,10,19,[0,a(B),[0,a(aZ),0]]],$H=[0,a(cF),[0,a(gz),[0,a(is),0]]],$I=[0,a(cF),[0,a(gz),[0,a(is),0]]],$T=[0,a(H),62,10,62,33,[0,a(bE),[0,a(I),[0,a(B),0]]]],$J=[0,a(H),62,10,62,33,[0,a(bE),[0,a(I),[0,a(B),0]]]],$U=[0,a(cF),[0,a(w0),0]],$3=[0,a(H),60,11,60,27,[0,a(bE),[0,a(I),[0,a(B),0]]]],$V=[0,a(H),60,11,60,27,[0,a(bE),[0,a(I),[0,a(B),0]]]],$4=[0,a(cF),[0,a(Am),0]],$_=[0,a(cF),[0,a(id),0]],aak=[0,a(cF),[0,a(dG),0]],$q=[0,a(ex),28,5,29,34,[0,a(B2),[0,a(b7),0]]],$p=a(yG),$r=[0,a(ex),6,10,6,17,[0,a(b7),0]],$n=[0,a(ex),48,5,49,34,[0,a(AL),[0,a(b7),0]]],$m=a(yn),$o=[0,a(ex),6,10,6,17,[0,a(b7),0]],$k=[0,a(ex),64,5,65,34,[0,a(JI),[0,a(b7),0]]],$j=a(Jz),$l=[0,a(ex),6,10,6,17,[0,a(b7),0]],$h=[0,a(ex),82,5,83,34,[0,a(x2),[0,a(b7),0]]],$g=a(Jt),$i=[0,a(ex),6,10,6,17,[0,a(b7),0]],$s=[0,a(ex),6,10,6,17,[0,a(b7),0]],$f=[0,a(ex),6,10,6,17,[0,a(b7),0]],$t=[0,a(gP),[0,a(al),0]],_5=[6,0],_7=[0,0],_8=[1,0],_9=[2,0],__=[3,0],_$=[4,0],$a=[5,0],$b=[7,0],_6=[0,a(b0),29,5,38,6,[0,a(cQ),[0,a(lS),[0,a(aZ),0]]]],_4=a(xW),$c=[0,a(b0),11,10,11,22,[0,a(B),[0,a(aZ),0]]],_1=[8,0],_2=[0,a(b0),47,5,49,6,[0,a(cQ),[0,a(lS),[0,a(aZ),0]]]],_0=a(GH),_3=[0,a(b0),11,10,11,22,[0,a(B),[0,a(aZ),0]]],_Q=[6,0],_S=[0,0],_T=[1,0],_U=[2,0],_V=[3,0],_W=[4,0],_X=[5,0],_Y=[7,0],_R=[0,a(b0),68,5,77,6,[0,a(cQ),[0,a(oR),[0,a(aZ),0]]]],_P=a(IG),_Z=[0,a(b0),11,10,11,22,[0,a(B),[0,a(aZ),0]]],_M=[8,0],_N=[0,a(b0),86,5,88,6,[0,a(cQ),[0,a(oR),[0,a(aZ),0]]]],_L=a(EU),_O=[0,a(b0),11,10,11,22,[0,a(B),[0,a(aZ),0]]],_B=[6,0],_D=[0,0],_E=[1,0],_F=[2,0],_G=[3,0],_H=[4,0],_I=[5,0],_J=[7,0],_C=[0,a(b0),bc,5,hp,6,[0,a(cQ),[0,a(nQ),[0,a(aZ),0]]]],_A=a(Bi),_K=[0,a(b0),11,10,11,22,[0,a(B),[0,a(aZ),0]]],_x=[8,0],_y=[0,a(b0),eX,5,cu,6,[0,a(cQ),[0,a(nQ),[0,a(aZ),0]]]],_w=a(Li),_z=[0,a(b0),11,10,11,22,[0,a(B),[0,a(aZ),0]]],_m=[6,0],_o=[0,0],_p=[1,0],_q=[2,0],_r=[3,0],_s=[4,0],_t=[5,0],_u=[7,0],_n=[0,a(b0),gU,5,FS,6,[0,a(cQ),[0,a(oq),[0,a(aZ),0]]]],_l=a(By),_v=[0,a(b0),11,10,11,22,[0,a(B),[0,a(aZ),0]]],_i=[8,0],_j=[0,a(b0),sH,5,j6,6,[0,a(cQ),[0,a(oq),[0,a(aZ),0]]]],_h=a(x5),_k=[0,a(b0),11,10,11,22,[0,a(B),[0,a(aZ),0]]],Z9=[6,0],Z$=[0,0],_a=[1,0],_b=[2,0],_c=[3,0],_d=[4,0],_e=[5,0],_f=[7,0],Z_=[0,a(b0),mt,5,m6,6,[0,a(mD),[0,a(me),[0,a(aZ),0]]]],Z8=a(HZ),_g=[0,a(b0),11,10,11,22,[0,a(B),[0,a(aZ),0]]],Z5=[8,0],Z6=[0,a(b0),l9,5,zj,6,[0,a(mD),[0,a(me),[0,a(aZ),0]]]],Z4=a(DH),Z7=[0,a(b0),11,10,11,22,[0,a(B),[0,a(aZ),0]]],$d=[0,a(b0),11,10,11,22,[0,a(B),[0,a(aZ),0]]],Z3=[0,a(b0),11,10,11,22,[0,a(B),[0,a(aZ),0]]],$e=[0,a(is),[0,a(Ic),0]],Z0=[0,a(bp),12,14,12,25,[0,a(gs),[0,a(bq),0]]],ZV=[2,0],ZW=a(p),ZX=a(p),ZY=[1,0],ZZ=a("-1"),Z1=[0,a(H),81,10,81,21,[0,a(L),[0,a(I),[0,a(B),0]]]],ZU=[0,a(H),81,10,81,21,[0,a(L),[0,a(I),[0,a(B),0]]]],Z2=[0,a(r0),[0,a("le_plus_\xc3\xa2g\xc3\xa9"),0]],ZR=[0,a(em),78,14,78,41,[0,a(mS),[0,a(aQ),[0,a(aS),[0,a(aE),[0,a(dk),[0,a(ai),0]]]]]]],ZQ=a(hb),ZS=[0,a(H),77,10,77,37,[0,a(L),[0,a(I),[0,a(B),0]]]],ZP=[0,a(H),77,10,77,37,[0,a(L),[0,a(I),[0,a(B),0]]]],ZT=[0,a(rV),[0,a(fd),0]],ZG=a(rG),ZH=a(rQ),ZI=a(sm),ZJ=a(sX),ZK=a(sM),ZL=a(rS),ZM=a(r8),ZN=a(s6),ZO=[0,a("Enfant"),0],Zw=a(n6),Zy=a(nq),Zz=a(l0),ZA=a(KF),ZB=a(zr),ZC=a(pM),ZD=a(Kg),ZE=a(mG),ZF=a(nC),Zx=[0,a(Jw),0],Zn=a(ni),Zp=a(X),Zq=a(rO),Zr=a(oX),Zs=a(CW),Zt=a(iR),Zu=a(BE),Zv=a(Hw),Zo=[0,a(Er),0],Zi=a("Compl\xc3\xa8te"),Zk=a("Partag\xc3\xa9e"),Zl=a("Z\xc3\xa9ro"),Zj=[0,a("PriseEnCompte"),0],Ze=a(j1),Zg=a(jT),Zh=a(JL),Zf=[0,a(Ke),0],Y_=a(A2),Za=a(C7),Zb=a(hc),Zc=a(D$),Zd=a(zn),Y$=[0,a(Gt),0],amt=a(ac),al5=a(n6),al6=a(nq),al7=a(FP),al8=a(l0),al9=a(nC),al_=a(D5),al$=a(yf),ama=a(pM),amb=a(mG),amd=[7,0],ame=[5,0],amf=[4,0],amg=[6,0],amh=[8,0],ami=[2,0],amj=[3,0],amk=[1,0],aml=[0,0],amc=[0,[11,a(be),[2,0,[11,a(BC),0]]],a(xX)],alO=a(xg),alP=a(y1),alQ=a(oX),alR=a(DE),alS=a(iR),alT=a(X),alU=a(ru),alV=a(ni),alX=[0,0],alY=[2,0],alZ=[1,0],al0=[5,0],al1=[6,0],al2=[3,0],al3=[7,0],al4=[4,0],alW=[0,[11,a(be),[2,0,[11,a(C8),0]]],a(Es)],alH=a(tt),alI=a(j1),alJ=a(jT),alL=[1,0],alM=[0,0],alN=[2,0],alK=[0,[11,a(be),[2,0,[11,a(yO),0]]],a(FU)],alw=a(hc),alx=a(rW),aly=a(sF),alz=a(s4),alA=a(rK),alC=[4,0],alD=[3,0],alE=[0,0],alF=[1,0],alG=[2,0],alB=[0,[11,a(be),[2,0,[11,a(Cb),0]]],a(A_)],alu=[0,a(BR),a(nK),a(gz),a(KJ),a(L$),a(xk),a(yj)],alv=[0,a(gz),a(xk),a(L$),a(yj),a(nK),a(BR),a(KJ)],amB=a("AllocationsFamilialesLib"),bIT=[0,a(f$),zZ,14,zZ,25,[0,a("Conseil d'\xc3\x89tat, 5\xc3\xa8me - 4\xc3\xa8me chambres r\xc3\xa9unies, 21/07/2017, 398563"),0]],bIM=a(p),bIN=a(p),bIS=a(cw),bIO=[0,a(a6),[0,a(a7),[0,a(P),0]]],bIP=[0,a(a6),[0,a(a7),0]],bIQ=[0,a(a6),[0,a(a7),[0,a(O),0]]],bIR=[0,a(a6),[0,a(a7),0]],bII=[0,a(c),Gb,14,Gb,63,[0,a(bv),[0,a(d),0]]],bIE=[0,a(c),CQ,14,CQ,25,[0,a(bv),[0,a(d),0]]],bIy=[0,a(c),sy,5,sy,70,[0,a(bv),[0,a(d),0]]],bIu=[0,a(c),GV,14,GV,58,[0,a(bv),[0,a(d),0]]],bIq=[0,a(c),LA,14,LA,64,[0,a(bv),[0,a(d),0]]],bIm=[0,a(c),ti,14,ti,54,[0,a(bv),[0,a(d),0]]],bIi=[0,a(c),Ia,14,Ia,51,[0,a(bv),[0,a(d),0]]],bIc=[0,a(c),FL,14,FL,59,[0,a(bv),[0,a(d),0]]],bH_=[0,a(c),EG,14,EG,38,[0,a(bv),[0,a(d),0]]],bH6=[0,a(c),JH,14,JH,44,[0,a(bv),[0,a(d),0]]],bH2=[0,a(c),Du,14,Du,34,[0,a(bv),[0,a(d),0]]],bHY=[0,a(c),JO,14,JO,31,[0,a(bv),[0,a(d),0]]],bHU=[0,a(c),JV,14,JV,48,[0,a(bv),[0,a(d),0]]],bHV=[0,a(c),lR,11,lR,45,[0,a(bv),[0,a(d),0]]],bHT=[0,a(c),lR,11,lR,45,[0,a(bv),[0,a(d),0]]],bHW=[0,a(cP),[0,a("m\xc3\xa9nage_sans_enfants_garde_altern\xc3\xa9e"),0]],bHZ=[0,a(c),e3,3,e3,13,[0,a(bv),[0,a(d),0]]],bH0=[0,a(cP),[0,a("calculette.m\xc3\xa9nage"),0]],bHX=[0,a(c),io,10,io,16,[0,a(as),[0,a(d),0]]],bH3=[0,a(c),e3,3,e3,13,[0,a(bv),[0,a(d),0]]],bH4=[0,a(cP),[0,a("calculette.demandeur"),0]],bH1=[0,a(c),ng,10,ng,19,[0,a(as),[0,a(d),0]]],bH7=[0,a(c),e3,3,e3,13,[0,a(bv),[0,a(d),0]]],bH8=[0,a(cP),[0,a("calculette.informations_calcul"),0]],bH5=[0,a(c),m4,10,m4,29,[0,a(as),[0,a(d),0]]],bH$=[0,a(c),e3,3,e3,13,[0,a(bv),[0,a(d),0]]],bIa=[0,a(cP),[0,a("calculette.date_courante"),0]],bH9=[0,a(c),nA,10,nA,23,[0,a(as),[0,a(d),0]]],bId=[0,a(c),e3,3,e3,13,[0,a(bv),[0,a(d),0]]],bIe=[0,a(cP),[0,a("calculette.ressources_m\xc3\xa9nage_prises_en_compte"),0]],bIb=[0,a(c),pg,10,pg,44,[0,a(as),[0,a(d),0]]],bIf=[0,a(cP),[0,a(C6),[0,a(a6),0]]],bIg=[0,a(cP),[0,a(C6),[0,a(a6),0]]],bIj=[0,a(c),e4,3,e4,33,[0,a(bv),[0,a(d),0]]],bIk=[0,a(cP),[0,a("calculette_sans_garde_altern\xc3\xa9e.m\xc3\xa9nage"),0]],bIh=[0,a(c),io,10,io,16,[0,a(as),[0,a(d),0]]],bIn=[0,a(c),e4,3,e4,33,[0,a(bv),[0,a(d),0]]],bIo=[0,a(cP),[0,a("calculette_sans_garde_altern\xc3\xa9e.demandeur"),0]],bIl=[0,a(c),ng,10,ng,19,[0,a(as),[0,a(d),0]]],bIr=[0,a(c),e4,3,e4,33,[0,a(bv),[0,a(d),0]]],bIs=[0,a(cP),[0,a("calculette_sans_garde_altern\xc3\xa9e.informations_calcul"),0]],bIp=[0,a(c),m4,10,m4,29,[0,a(as),[0,a(d),0]]],bIv=[0,a(c),e4,3,e4,33,[0,a(bv),[0,a(d),0]]],bIw=[0,a(cP),[0,a("calculette_sans_garde_altern\xc3\xa9e.date_courante"),0]],bIt=[0,a(c),nA,10,nA,23,[0,a(as),[0,a(d),0]]],bIz=[0,a(c),e4,3,e4,33,[0,a(bv),[0,a(d),0]]],bIA=[0,a(cP),[0,a("calculette_sans_garde_altern\xc3\xa9e.ressources_m\xc3\xa9nage_prises_en_compte"),0]],bIx=[0,a(c),pg,10,pg,44,[0,a(as),[0,a(d),0]]],bIB=[0,a(cP),[0,a(x1),[0,a(a6),0]]],bIC=[0,a(cP),[0,a(x1),[0,a(a6),0]]],bIF=[0,a(c),j_,10,j_,21,[0,a(bv),[0,a(d),0]]],bID=[0,a(c),j_,10,j_,21,[0,a(bv),[0,a(d),0]]],bIG=[0,a(cP),[0,a(o_),0]],bIJ=[0,a(c),mM,11,mM,60,[0,a(bv),[0,a(d),0]]],bIH=[0,a(c),mM,11,mM,60,[0,a(bv),[0,a(d),0]]],bIK=[0,a(cP),[0,a(kw),0]],bIU=[0,a(c),oI,10,oI,21,[0,a(bv),[0,a(d),0]]],bIL=[0,a(c),oI,10,oI,21,[0,a(bv),[0,a(d),0]]],bIV=[0,a(cP),[0,a("aide_finale"),0]],bHP=[0,a(aT),Cp,14,Cp,33,[0,a(he),[0,a(bG),[0,a(db),[0,a(w),[0,a(am),[0,a(v),0]]]]]]],bHO=a(p),bHG=[0,a(az),[0,a(a7),[0,a(P),0]]],bHH=[0,a(az),[0,a(a7),0]],bHI=[0,a(az),[0,a(a7),[0,a(O),0]]],bHJ=[0,a(az),[0,a(a7),0]],bHK=[0,a(aA),[0,a(a7),[0,a(P),0]]],bHL=[0,a(aA),[0,a(a7),0]],bHM=[0,a(aA),[0,a(a7),[0,a(O),0]]],bHN=[0,a(aA),[0,a(a7),0]],bHC=[0,a(aT),C3,14,C3,36,[0,a(he),[0,a(bG),[0,a(db),[0,a(w),[0,a(am),[0,a(v),0]]]]]]],bHm=[0,a(az),[0,a(a7),[0,a(P),0]]],bHn=[0,a(az),[0,a(a7),0]],bHo=[0,a(az),[0,a(a7),[0,a(O),0]]],bHp=[0,a(az),[0,a(a7),0]],bHq=[0,a(aA),[0,a(a7),[0,a(P),0]]],bHr=[0,a(aA),[0,a(a7),0]],bHs=[0,a(aA),[0,a(a7),[0,a(O),0]]],bHt=[0,a(aA),[0,a(a7),0]],bHu=[0,a(aA),[0,a(a7),[0,a(P),0]]],bHv=[0,a(aA),[0,a(a7),0]],bHw=[0,a(aA),[0,a(a7),[0,a(O),0]]],bHx=[0,a(aA),[0,a(a7),0]],bHy=[0,a(az),[0,a(a7),[0,a(P),0]]],bHz=[0,a(az),[0,a(a7),0]],bHA=[0,a(az),[0,a(a7),[0,a(O),0]]],bHB=[0,a(az),[0,a(a7),0]],bHe=[0,a(aA),[0,a(a7),[0,a(P),0]]],bHf=[0,a(aA),[0,a(a7),0]],bHg=[0,a(aA),[0,a(a7),[0,a(O),0]]],bHh=[0,a(aA),[0,a(a7),0]],bHi=[0,a(az),[0,a(a7),[0,a(P),0]]],bHj=[0,a(az),[0,a(a7),0]],bHk=[0,a(az),[0,a(a7),[0,a(O),0]]],bHl=[0,a(az),[0,a(a7),0]],bHD=[0,a(c),pi,10,pi,32,[0,a(as),[0,a(d),0]]],bHd=[0,a(c),pi,10,pi,32,[0,a(as),[0,a(d),0]]],bHa=[0,a(aT),Iv,14,Iv,25,[0,a(he),[0,a(bG),[0,a(db),[0,a(w),[0,a(am),[0,a(v),0]]]]]]],bG8=[0,a(c),As,14,As,63,[0,a(as),[0,a(d),0]]],bG2=[0,a(c),w4,14,w4,62,[0,a(as),[0,a(d),0]]],bGY=[0,a(c),ET,14,ET,53,[0,a(as),[0,a(d),0]]],bGU=[0,a(c),Io,5,Io,65,[0,a(as),[0,a(d),0]]],bGQ=[0,a(c),Fj,14,Fj,68,[0,a(as),[0,a(d),0]]],bGM=[0,a(c),y9,14,y9,66,[0,a(as),[0,a(d),0]]],bGG=[0,a(c),Ax,14,Ax,68,[0,a(as),[0,a(d),0]]],bGH=[0,a(c),cg,3,cg,37,[0,a(as),[0,a(d),0]]],bGF=[0,a(c),tE,14,tE,68,[0,a(as),[0,a(d),0]]],bGI=[0,a(c),cg,3,cg,37,[0,a(as),[0,a(d),0]]],bGB=[0,a(aT),I$,14,I$,58,[0,a(he),[0,a(bG),[0,a(db),[0,a(w),[0,a(am),[0,a(v),0]]]]]]],bGA=[0,0],bGw=[0,a(c),Iy,14,Iy,64,[0,a(as),[0,a(d),0]]],bGq=[0,a(aT),cg,14,cg,50,[0,a(he),[0,a(bG),[0,a(db),[0,a(w),[0,a(am),[0,a(v),0]]]]]]],bGn=[2,0],bGo=[1,0],bGp=[2,0],bGj=[0,a(c),Lp,14,Lp,54,[0,a(as),[0,a(d),0]]],bGf=[0,a(c),H2,14,H2,45,[0,a(as),[0,a(d),0]]],bGb=[0,a(c),EZ,14,EZ,66,[0,a(as),[0,a(d),0]]],bF9=[0,a(c),Ii,14,Ii,60,[0,a(as),[0,a(d),0]]],bF5=[0,a(c),E7,14,E7,58,[0,a(as),[0,a(d),0]]],bFZ=[0,a(c),GL,14,GL,60,[0,a(as),[0,a(d),0]]],bF0=[0,a(c),cv,3,cv,29,[0,a(as),[0,a(d),0]]],bFY=[0,a(c),Ky,14,Ky,60,[0,a(as),[0,a(d),0]]],bF1=[0,a(c),cv,3,cv,29,[0,a(as),[0,a(d),0]]],bFU=[0,a(c),GM,14,GM,56,[0,a(as),[0,a(d),0]]],bFO=[0,a(c),Im,14,Im,67,[0,a(as),[0,a(d),0]]],bFK=[0,a(c),xm,14,xm,63,[0,a(as),[0,a(d),0]]],bFG=[0,a(c),yg,14,yg,60,[0,a(as),[0,a(d),0]]],bFA=[0,a(c),sU,14,sU,65,[0,a(as),[0,a(d),0]]],bFw=[0,a(aT),io,5,io,74,[0,a(he),[0,a(bG),[0,a(db),[0,a(w),[0,a(am),[0,a(v),0]]]]]]],bFs=[0,a(c),Dy,14,Dy,55,[0,a(as),[0,a(d),0]]],bFo=[0,a(c),A5,14,A5,52,[0,a(as),[0,a(d),0]]],bFk=[0,a(c),xP,14,xP,59,[0,a(as),[0,a(d),0]]],bFl=[0,a(c),e_,3,e_,34,[0,a(as),[0,a(d),0]]],bFm=[0,a(a6),[0,a("\xc3\xa9ligibilit\xc3\xa9_allocation_logement.date_courante"),0]],bFj=[0,a(c),h_,10,h_,23,[0,a(aF),[0,a(j),[0,a(d),0]]]],bFp=[0,a(c),e_,3,e_,34,[0,a(as),[0,a(d),0]]],bFq=[0,a(a6),[0,a("\xc3\xa9ligibilit\xc3\xa9_allocation_logement.m\xc3\xa9nage"),0]],bFn=[0,a(c),II,10,II,16,[0,a(aF),[0,a(j),[0,a(d),0]]]],bFt=[0,a(c),e_,3,e_,34,[0,a(as),[0,a(d),0]]],bFu=[0,a(a6),[0,a("\xc3\xa9ligibilit\xc3\xa9_allocation_logement.demandeur"),0]],bFr=[0,a(c),Fq,10,Fq,19,[0,a(aF),[0,a(j),[0,a(d),0]]]],bFx=[0,a(c),e_,3,e_,34,[0,a(as),[0,a(d),0]]],bFy=[0,a(a6),[0,a("\xc3\xa9ligibilit\xc3\xa9_allocation_logement.b\xc3\xa9n\xc3\xa9ficie_aide_personnalis\xc3\xa9e_logement"),0]],bFv=[0,a(c),tg,10,tg,47,[0,a(aF),[0,a(j),[0,a(d),0]]]],bFB=[0,a(c),e_,3,e_,34,[0,a(as),[0,a(d),0]]],bFC=[0,a(a6),[0,a("\xc3\xa9ligibilit\xc3\xa9_allocation_logement.informations_calcul"),0]],bFz=[0,a(c),to,10,to,29,[0,a(aF),[0,a(j),[0,a(d),0]]]],bFD=[0,a(a6),[0,a(wJ),[0,a(b2),0]]],bFE=[0,a(a6),[0,a(wJ),[0,a(b2),0]]],bFH=[0,a(c),il,3,il,42,[0,a(as),[0,a(d),0]]],bFI=[0,a(a6),[0,a("\xc3\xa9ligibilit\xc3\xa9_aide_personnalis\xc3\xa9e_logement.m\xc3\xa9nage"),0]],bFF=[0,a(c),FO,10,FO,16,[0,a(a8),[0,a(j),[0,a(d),0]]]],bFL=[0,a(c),il,3,il,42,[0,a(as),[0,a(d),0]]],bFM=[0,a(a6),[0,a("\xc3\xa9ligibilit\xc3\xa9_aide_personnalis\xc3\xa9e_logement.demandeur"),0]],bFJ=[0,a(c),oy,10,oy,19,[0,a(a8),[0,a(j),[0,a(d),0]]]],bFP=[0,a(c),il,3,il,42,[0,a(as),[0,a(d),0]]],bFQ=[0,a(a6),[0,a("\xc3\xa9ligibilit\xc3\xa9_aide_personnalis\xc3\xa9e_logement.date_courante"),0]],bFN=[0,a(c),sC,17,sC,30,[0,a(a8),[0,a(j),[0,a(d),0]]]],bFR=[0,a(a6),[0,a(Kn),[0,a(cf),0]]],bFS=[0,a(a6),[0,a(Kn),[0,a(cf),0]]],bFV=[0,a(c),cv,3,cv,29,[0,a(as),[0,a(d),0]]],bFW=[0,a(a6),[0,a("calcul_allocation_logement.mode_occupation"),0]],bFT=[0,a(c),sI,10,sI,25,[0,a($),[0,a(G),[0,a(t),[0,a(d),0]]]]],bF2=[0,a(c),cv,3,cv,29,[0,a(as),[0,a(d),0]]],bF3=[0,a(a6),[0,a("calcul_allocation_logement.informations_calcul"),0]],bFX=[0,a(c),CB,10,CB,29,[0,a($),[0,a(G),[0,a(t),[0,a(d),0]]]]],bF6=[0,a(c),cv,3,cv,29,[0,a(as),[0,a(d),0]]],bF7=[0,a(a6),[0,a("calcul_allocation_logement.ressources_m\xc3\xa9nage_sans_arrondi"),0]],bF4=[0,a(c),LN,10,LN,27,[0,a($),[0,a(G),[0,a(t),[0,a(d),0]]]]],bF_=[0,a(c),cv,3,cv,29,[0,a(as),[0,a(d),0]]],bF$=[0,a(a6),[0,a("calcul_allocation_logement.situation_familiale"),0]],bF8=[0,a(c),Mi,10,Mi,29,[0,a($),[0,a(G),[0,a(t),[0,a(d),0]]]]],bGc=[0,a(c),cv,3,cv,29,[0,a(as),[0,a(d),0]]],bGd=[0,a(a6),[0,a("calcul_allocation_logement.nombre_personnes_\xc3\xa0_charge"),0]],bGa=[0,a(c),Ig,10,Ig,35,[0,a($),[0,a(G),[0,a(t),[0,a(d),0]]]]],bGg=[0,a(c),cv,3,cv,29,[0,a(as),[0,a(d),0]]],bGh=[0,a(a6),[0,a("calcul_allocation_logement.zone"),0]],bGe=[0,a(c),A7,10,A7,14,[0,a($),[0,a(G),[0,a(t),[0,a(d),0]]]]],bGk=[0,a(c),cv,3,cv,29,[0,a(as),[0,a(d),0]]],bGl=[0,a(a6),[0,a("calcul_allocation_logement.date_courante"),0]],bGi=[0,a(c),Db,10,Db,23,[0,a($),[0,a(G),[0,a(t),[0,a(d),0]]]]],bGr=[0,a(c),cv,3,cv,29,[0,a(as),[0,a(d),0]]],bGs=[0,a(a6),[0,a("calcul_allocation_logement.type_aide"),0]],bGm=[0,a(c),F1,10,F1,19,[0,a($),[0,a(G),[0,a(t),[0,a(d),0]]]]],bGt=[0,a(a6),[0,a(La),[0,a(az),0]]],bGu=[0,a(a6),[0,a(La),[0,a(az),0]]],bGx=[0,a(c),cg,3,cg,37,[0,a(as),[0,a(d),0]]],bGy=[0,a(a6),[0,a("calcul_aide_personnalis\xc3\xa9e_logement.mode_occupation"),0]],bGv=[0,a(c),Ac,10,Ac,25,[0,a($),[0,a(o),[0,a(j),[0,a(d),0]]]]],bGC=[0,a(c),cg,3,cg,37,[0,a(as),[0,a(d),0]]],bGD=[0,a(a6),[0,a("calcul_aide_personnalis\xc3\xa9e_logement.type_aide"),0]],bGz=[0,a(c),yR,10,yR,19,[0,a($),[0,a(o),[0,a(j),[0,a(d),0]]]]],bGJ=[0,a(c),cg,3,cg,37,[0,a(as),[0,a(d),0]]],bGK=[0,a(a6),[0,a("calcul_aide_personnalis\xc3\xa9e_logement.informations_calcul"),0]],bGE=[0,a(c),rD,10,rD,29,[0,a($),[0,a(o),[0,a(j),[0,a(d),0]]]]],bGN=[0,a(c),cg,3,cg,37,[0,a(as),[0,a(d),0]]],bGO=[0,a(a6),[0,a("calcul_aide_personnalis\xc3\xa9e_logement.ressources_m\xc3\xa9nage_sans_arrondi"),0]],bGL=[0,a(c),KX,10,KX,27,[0,a($),[0,a(o),[0,a(j),[0,a(d),0]]]]],bGR=[0,a(c),cg,3,cg,37,[0,a(as),[0,a(d),0]]],bGS=[0,a(a6),[0,a("calcul_aide_personnalis\xc3\xa9e_logement.situation_familiale"),0]],bGP=[0,a(c),DJ,10,DJ,29,[0,a($),[0,a(o),[0,a(j),[0,a(d),0]]]]],bGV=[0,a(c),cg,3,cg,37,[0,a(as),[0,a(d),0]]],bGW=[0,a(a6),[0,a("calcul_aide_personnalis\xc3\xa9e_logement.nombre_personnes_\xc3\xa0_charge"),0]],bGT=[0,a(c),Ft,10,Ft,35,[0,a($),[0,a(o),[0,a(j),[0,a(d),0]]]]],bGZ=[0,a(c),cg,3,cg,37,[0,a(as),[0,a(d),0]]],bG0=[0,a(a6),[0,a("calcul_aide_personnalis\xc3\xa9e_logement.zone"),0]],bGX=[0,a(c),Jn,10,Jn,14,[0,a($),[0,a(o),[0,a(j),[0,a(d),0]]]]],bG3=[0,a(c),cg,3,cg,37,[0,a(as),[0,a(d),0]]],bG4=[0,a(a6),[0,a("calcul_aide_personnalis\xc3\xa9e_logement.date_courante"),0]],bG1=[0,a(c),LS,10,LS,23,[0,a($),[0,a(o),[0,a(j),[0,a(d),0]]]]],bG5=[0,a(a6),[0,a(HP),[0,a(aA),0]]],bG6=[0,a(a6),[0,a(HP),[0,a(aA),0]]],bG9=[0,a(c),ok,10,ok,59,[0,a(as),[0,a(d),0]]],bG7=[0,a(c),ok,10,ok,59,[0,a(as),[0,a(d),0]]],bG_=[0,a(a6),[0,a(kw),0]],bHb=[0,a(c),mw,10,mw,21,[0,a(as),[0,a(d),0]]],bG$=[0,a(c),mw,10,mw,21,[0,a(as),[0,a(d),0]]],bHc=[0,a(a6),[0,a(o_),0]],bHE=[0,a(a6),[0,a(a7),0]],bHQ=[0,a(c),mz,10,mz,29,[0,a(as),[0,a(d),0]]],bHF=[0,a(c),mz,10,mz,29,[0,a(as),[0,a(d),0]]],bHR=[0,a(a6),[0,a(fS),0]],bFd=[0,a(C),Lc,14,Lc,33,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bE$=[0,a(C),Fu,14,Fu,36,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bEZ=[0,a(cb),[0,a(a7),[0,a(P),0]]],bE0=[0,a(cb),[0,a(a7),0]],bE1=[0,a(cb),[0,a(a7),[0,a(O),0]]],bE2=[0,a(cb),[0,a(a7),0]],bE3=[0,a(S),[0,a(bD),[0,a(P),0]]],bE4=[0,a(S),[0,a(bD),0]],bE5=[0,a(S),[0,a(bD),[0,a(O),0]]],bE6=[0,a(S),[0,a(bD),0]],bE7=[0,a(Y),[0,a(bD),[0,a(P),0]]],bE8=[0,a(Y),[0,a(bD),0]],bE9=[0,a(Y),[0,a(bD),[0,a(O),0]]],bE_=[0,a(Y),[0,a(bD),0]],bFa=[0,a(c),h4,10,h4,32,[0,a($),[0,a(G),[0,a(t),[0,a(d),0]]]]],bEY=[0,a(c),h4,10,h4,32,[0,a($),[0,a(G),[0,a(t),[0,a(d),0]]]]],bET=[0,a(C),w6,14,w6,48,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bER=[1,0],bES=[1,0],bEN=[0,a(C),zA,14,zA,44,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bEJ=[0,a(C),zw,14,zw,48,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bEH=a(p),bEI=a(p),bED=[0,a(C),s8,14,s8,32,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bEz=[0,a(C),Ij,14,Ij,31,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bEv=[0,a(C),GE,5,GE,69,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bEr=[0,a(C),HD,14,HD,42,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bEn=[0,a(C),yM,14,yM,26,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bEj=[0,a(C),Aa,14,Aa,52,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bEf=[0,a(C),DA,14,DA,47,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bEb=[0,a(C),w$,14,w$,35,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bD9=[0,a(C),In,14,In,67,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bD5=[0,a(C),D1,14,D1,49,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bD1=[0,a(C),Cf,14,Cf,37,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bDZ=a(p),bD0=a(p),bDT=[0,a(C),sx,14,sx,64,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bDR=[3,0],bDS=[3,0],bDN=[0,a(C),G6,14,G6,42,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bDJ=[0,a(C),KU,14,KU,33,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bDF=[0,a(C),tp,14,tp,59,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bDB=[0,a(C),H6,14,H6,54,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bDx=[0,a(C),Bv,14,Bv,56,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bDt=[0,a(C),zc,14,zc,44,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bDp=[0,a(C),Ib,14,Ib,38,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bDn=a(p),bDo=a(p),bDh=[0,a(C),yC,14,yC,45,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bDd=[0,a(C),xw,14,xw,57,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bDb=a(p),bDc=a(p),bC9=[0,a(C),BN,14,BN,54,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bC5=[0,a(C),IN,14,IN,73,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bC1=[0,a(C),Bl,14,Bl,55,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bCZ=[3,0],bC0=[3,0],bCV=[0,a(C),I8,14,I8,53,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bCR=[0,a(C),xN,14,xN,57,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bCN=[0,a(C),y3,14,y3,55,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bCL=a(p),bCM=a(p),bCH=[0,a(C),En,14,En,47,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bCD=[0,a(C),xr,14,xr,38,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bCz=[0,a(C),Iu,14,Iu,64,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bCv=[0,a(C),Ao,14,Ao,59,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bCr=[0,a(C),HN,14,HN,61,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bCn=[0,a(V),81,14,81,44,[0,a(dA),[0,a(b9),[0,a(R),0]]]],bCh=[0,0],bCi=[1,0],bCj=[1,0],bCk=[1,0],bCl=[0,0],bCm=[1,0],bCd=[0,a(C),JQ,14,JQ,31,[0,a(c7),[0,a(aV),[0,a(aP),[0,a(aM),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bCa=a(dU),bCb=a(rR),bCc=a(sS),bB8=[0,a(C),L3,14,L3,34,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bB3=[0,0],bB4=[2,0],bB5=[1,0],bB6=[0,0],bB7=[1,0],bB9=[0,a(c),oj,11,oj,31,[0,a($),[0,a(G),[0,a(t),[0,a(d),0]]]]],bB2=[0,a(c),oj,11,oj,31,[0,a($),[0,a(G),[0,a(t),[0,a(d),0]]]]],bB_=[0,a(az),[0,a(GI),0]],bCe=[0,a(c),oS,10,oS,22,[0,a($),[0,a(G),[0,a(t),[0,a(d),0]]]]],bB$=[0,a(c),oS,10,oS,22,[0,a($),[0,a(G),[0,a(t),[0,a(d),0]]]]],bCf=[0,a(az),[0,a(ye),0]],bCo=[0,a(c),j8,11,j8,41,[0,a($),[0,a(G),[0,a(t),[0,a(d),0]]]]],bCg=[0,a(c),j8,11,j8,41,[0,a($),[0,a(G),[0,a(t),[0,a(d),0]]]]],bCp=[0,a(az),[0,a(zG),0]],bCs=[0,a(c),bJ,3,bJ,22,[0,a($),[0,a(G),[0,a(t),[0,a(d),0]]]]],bCt=[0,a(az),[0,a("accession_propri\xc3\xa9t\xc3\xa9.ressources_m\xc3\xa9nage_arrondies_base"),0]],bCq=[0,a(c),DD,10,DD,37,[0,a(z),[0,a(t),[0,a(d),0]]]],bCw=[0,a(c),bJ,3,bJ,22,[0,a($),[0,a(G),[0,a(t),[0,a(d),0]]]]],bCx=[0,a(az),[0,a(CJ),0]],bCu=[0,a(c),HM,10,HM,35,[0,a(z),[0,a(t),[0,a(d),0]]]],bCA=[0,a(c),bJ,3,bJ,22,[0,a($),[0,a(G),[0,a(t),[0,a(d),0]]]]],bCB=[0,a(az),[0,a(IK),0]],bCy=[0,a(c),Ko,10,Ko,40,[0,a(z),[0,a(t),[0,a(d),0]]]],bCE=[0,a(c),bJ,3,bJ,22,[0,a($),[0,a(G),[0,a(t),[0,a(d),0]]]]],bCF=[0,a(az),[0,a(Ce),0]],bCC=[0,a(c),GZ,10,GZ,14,[0,a(z),[0,a(t),[0,a(d),0]]]],bCI=[0,a(c),bJ,3,bJ,22,[0,a($),[0,a(G),[0,a(t),[0,a(d),0]]]]],bCJ=[0,a(az),[0,a(xJ),0]],bCG=[0,a(c),I3,10,I3,23,[0,a(z),[0,a(t),[0,a(d),0]]]],bCO=[0,a(c),bJ,3,bJ,22,[0,a($),[0,a(G),[0,a(t),[0,a(d),0]]]]],bCP=[0,a(az),[0,a(Dw),0]],bCK=[0,a(c),EM,10,EM,31,[0,a(z),[0,a(t),[0,a(d),0]]]],bCS=[0,a(c),bJ,3,bJ,22,[0,a($),[0,a(G),[0,a(t),[0,a(d),0]]]]],bCT=[0,a(az),[0,a(LK),0]],bCQ=[0,a(c),EQ,10,EQ,33,[0,a(z),[0,a(t),[0,a(d),0]]]],bCW=[0,a(c),bJ,3,bJ,22,[0,a($),[0,a(G),[0,a(t),[0,a(d),0]]]]],bCX=[0,a(az),[0,a(D9),0]],bCU=[0,a(c),G3,10,G3,29,[0,a(z),[0,a(t),[0,a(d),0]]]],bC2=[0,a(c),bJ,3,bJ,22,[0,a($),[0,a(G),[0,a(t),[0,a(d),0]]]]],bC3=[0,a(az),[0,a(KE),0]],bCY=[0,a(c),Em,10,Em,31,[0,a(z),[0,a(t),[0,a(d),0]]]],bC6=[0,a(c),bJ,3,bJ,22,[0,a($),[0,a(G),[0,a(t),[0,a(d),0]]]]],bC7=[0,a(az),[0,a(KR),0]],bC4=[0,a(c),xl,10,xl,49,[0,a(z),[0,a(t),[0,a(d),0]]]],bC_=[0,a(c),bJ,3,bJ,22,[0,a($),[0,a(G),[0,a(t),[0,a(d),0]]]]],bC$=[0,a(az),[0,a(Jx),0]],bC8=[0,a(c),IR,10,IR,30,[0,a(z),[0,a(t),[0,a(d),0]]]],bDe=[0,a(c),bJ,3,bJ,22,[0,a($),[0,a(G),[0,a(t),[0,a(d),0]]]]],bDf=[0,a(az),[0,a("accession_propri\xc3\xa9t\xc3\xa9.charges_mensuelles_pr\xc3\xaat"),0]],bDa=[0,a(c),wQ,10,wQ,33,[0,a(z),[0,a(t),[0,a(d),0]]]],bDi=[0,a(c),bJ,3,bJ,22,[0,a($),[0,a(G),[0,a(t),[0,a(d),0]]]]],bDj=[0,a(az),[0,a(Eq),0]],bDg=[0,a(c),Kh,10,Kh,21,[0,a(z),[0,a(t),[0,a(d),0]]]],bDk=[0,a(az),[0,a(mj),[0,a(S),0]]],bDl=[0,a(az),[0,a(mj),[0,a(S),0]]],bDq=[0,a(c),c8,3,c8,17,[0,a($),[0,a(G),[0,a(t),[0,a(d),0]]]]],bDr=[0,a(az),[0,a(Jf),0]],bDm=[0,a(c),wT,10,wT,19,[0,a(G),[0,a(t),[0,a(d),0]]]],bDu=[0,a(c),c8,3,c8,17,[0,a($),[0,a(G),[0,a(t),[0,a(d),0]]]]],bDv=[0,a(az),[0,a(Mu),0]],bDs=[0,a(c),zP,10,zP,25,[0,a(G),[0,a(t),[0,a(d),0]]]],bDy=[0,a(c),c8,3,c8,17,[0,a($),[0,a(G),[0,a(t),[0,a(d),0]]]]],bDz=[0,a(az),[0,a(Ch),0]],bDw=[0,a(c),BM,10,BM,37,[0,a(G),[0,a(t),[0,a(d),0]]]],bDC=[0,a(c),c8,3,c8,17,[0,a($),[0,a(G),[0,a(t),[0,a(d),0]]]]],bDD=[0,a(az),[0,a(Gf),0]],bDA=[0,a(c),Hj,10,Hj,35,[0,a(G),[0,a(t),[0,a(d),0]]]],bDG=[0,a(c),c8,3,c8,17,[0,a($),[0,a(G),[0,a(t),[0,a(d),0]]]]],bDH=[0,a(az),[0,a(wU),0]],bDE=[0,a(c),B9,10,B9,40,[0,a(G),[0,a(t),[0,a(d),0]]]],bDK=[0,a(c),c8,3,c8,17,[0,a($),[0,a(G),[0,a(t),[0,a(d),0]]]]],bDL=[0,a(az),[0,a(FF),0]],bDI=[0,a(c),B6,10,B6,14,[0,a(G),[0,a(t),[0,a(d),0]]]],bDO=[0,a(c),c8,3,c8,17,[0,a($),[0,a(G),[0,a(t),[0,a(d),0]]]]],bDP=[0,a(az),[0,a(EP),0]],bDM=[0,a(c),B3,10,B3,23,[0,a(G),[0,a(t),[0,a(d),0]]]],bDU=[0,a(c),c8,3,c8,17,[0,a($),[0,a(G),[0,a(t),[0,a(d),0]]]]],bDV=[0,a(az),[0,a("logement_foyer.cat\xc3\xa9gorie_\xc3\xa9quivalence_loyer_d842_16"),0]],bDQ=[0,a(c),Ew,10,Ew,45,[0,a(G),[0,a(t),[0,a(d),0]]]],bDW=[0,a(az),[0,a(nL),[0,a(Y),0]]],bDX=[0,a(az),[0,a(nL),[0,a(Y),0]]],bD2=[0,a(c),bC,3,bC,10,[0,a($),[0,a(G),[0,a(t),[0,a(d),0]]]]],bD3=[0,a(az),[0,a(Aw),0]],bDY=[0,a(c),z5,10,z5,25,[0,a(N),[0,a(t),[0,a(d),0]]]],bD6=[0,a(c),bC,3,bC,10,[0,a($),[0,a(G),[0,a(t),[0,a(d),0]]]]],bD7=[0,a(az),[0,a(Bm),0]],bD4=[0,a(c),LV,10,LV,37,[0,a(N),[0,a(t),[0,a(d),0]]]],bD_=[0,a(c),bC,3,bC,10,[0,a($),[0,a(G),[0,a(t),[0,a(d),0]]]]],bD$=[0,a(az),[0,a(AE),0]],bD8=[0,a(c),Dh,10,Dh,55,[0,a(N),[0,a(t),[0,a(d),0]]]],bEc=[0,a(c),bC,3,bC,10,[0,a($),[0,a(G),[0,a(t),[0,a(d),0]]]]],bEd=[0,a(az),[0,a(IH),0]],bEa=[0,a(c),AV,10,AV,23,[0,a(N),[0,a(t),[0,a(d),0]]]],bEg=[0,a(c),bC,3,bC,10,[0,a($),[0,a(G),[0,a(t),[0,a(d),0]]]]],bEh=[0,a(az),[0,a(xO),0]],bEe=[0,a(c),Da,10,Da,35,[0,a(N),[0,a(t),[0,a(d),0]]]],bEk=[0,a(c),bC,3,bC,10,[0,a($),[0,a(G),[0,a(t),[0,a(d),0]]]]],bEl=[0,a(az),[0,a(E2),0]],bEi=[0,a(c),AK,10,AK,40,[0,a(N),[0,a(t),[0,a(d),0]]]],bEo=[0,a(c),bC,3,bC,10,[0,a($),[0,a(G),[0,a(t),[0,a(d),0]]]]],bEp=[0,a(az),[0,a(yW),0]],bEm=[0,a(c),w3,10,w3,14,[0,a(N),[0,a(t),[0,a(d),0]]]],bEs=[0,a(c),bC,3,bC,10,[0,a($),[0,a(G),[0,a(t),[0,a(d),0]]]]],bEt=[0,a(az),[0,a(AX),0]],bEq=[0,a(c),Iw,10,Iw,30,[0,a(N),[0,a(t),[0,a(d),0]]]],bEw=[0,a(c),bC,3,bC,10,[0,a($),[0,a(G),[0,a(t),[0,a(d),0]]]]],bEx=[0,a(az),[0,a(K1),0]],bEu=[0,a(c),JR,10,JR,66,[0,a(N),[0,a(t),[0,a(d),0]]]],bEA=[0,a(c),bC,3,bC,10,[0,a($),[0,a(G),[0,a(t),[0,a(d),0]]]]],bEB=[0,a(az),[0,a(Ld),0]],bEy=[0,a(c),Fn,10,Fn,19,[0,a(N),[0,a(t),[0,a(d),0]]]],bEE=[0,a(c),bC,3,bC,10,[0,a($),[0,a(G),[0,a(t),[0,a(d),0]]]]],bEF=[0,a(az),[0,a(wS),0]],bEC=[0,a(c),Lo,10,Lo,20,[0,a(N),[0,a(t),[0,a(d),0]]]],bEK=[0,a(c),bC,3,bC,10,[0,a($),[0,a(G),[0,a(t),[0,a(d),0]]]]],bEL=[0,a(az),[0,a(F9),0]],bEG=[0,a(c),Df,10,Df,36,[0,a(N),[0,a(t),[0,a(d),0]]]],bEO=[0,a(c),bC,3,bC,10,[0,a($),[0,a(G),[0,a(t),[0,a(d),0]]]]],bEP=[0,a(az),[0,a("locatif.logement_meubl\xc3\xa9_d842_2"),0]],bEM=[0,a(c),GR,10,GR,32,[0,a(N),[0,a(t),[0,a(d),0]]]],bEU=[0,a(c),bC,3,bC,10,[0,a($),[0,a(G),[0,a(t),[0,a(d),0]]]]],bEV=[0,a(az),[0,a("locatif.changement_logement_d842_4"),0]],bEQ=[0,a(c),sa,10,sa,36,[0,a(N),[0,a(t),[0,a(d),0]]]],bEW=[0,a(az),[0,a(mr),[0,a(cb),0]]],bEX=[0,a(az),[0,a(mr),[0,a(cb),0]]],bFb=[0,a(az),[0,a(a7),0]],bFe=[0,a(c),pu,10,pu,29,[0,a($),[0,a(G),[0,a(t),[0,a(d),0]]]]],bFc=[0,a(c),pu,10,pu,29,[0,a($),[0,a(G),[0,a(t),[0,a(d),0]]]]],bFf=[0,a(az),[0,a(fS),0]],bFi=[0,a(C),1603,5,1605,15,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bFh=[0,a(C),1599,5,1601,15,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bFg=[0,a(C),Bt,5,1597,15,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bBZ=[0,a(c),Mt,14,Mt,25,[0,a(aF),[0,a(j),[0,a(d),0]]]],bBY=[0,0],bBT=[0,a(aT),1148,5,1151,28,[0,a("Article L841-4"),[0,a(bG),[0,a(db),[0,a(w),[0,a(am),[0,a(v),0]]]]]]],bBS=[0,0],bBU=[0,a(c),ib,10,ib,16,[0,a(aF),[0,a(j),[0,a(d),0]]]],bBR=[0,a(aT),h5,14,h5,25,[0,a(he),[0,a(bG),[0,a(db),[0,a(w),[0,a(am),[0,a(v),0]]]]]]],bBM=[0,0],bBN=[0,0],bBO=[1,0],bBP=[2,0],bBQ=[0,0],bBC=a(p),bBD=[0,a(aT),j8,5,bJ,29,[0,a(h8),[0,a(bG),[0,a(db),[0,a(w),[0,a(am),[0,a(v),0]]]]]]],bBE=[0,a(c),ce,11,ce,52,[0,a(aF),[0,a(j),[0,a(d),0]]]],bBx=a(x),bBv=a(x),bBw=a(p),bBy=[0,a(aT),tj,5,sI,12,[0,a(h8),[0,a(bG),[0,a(db),[0,a(w),[0,a(am),[0,a(v),0]]]]]]],bBz=[0,a(c),ce,11,ce,52,[0,a(aF),[0,a(j),[0,a(d),0]]]],bBp=[0,a(aW),[0,a(fB),[0,a(P),0]]],bBq=[0,a(aW),[0,a(fB),0]],bBr=[0,a(aW),[0,a(fB),[0,a(O),0]]],bBs=[0,a(aW),[0,a(fB),0]],bBt=a(x),bBn=a(x),bBo=a(p),bBu=[0,a(aT),jY,5,jZ,72,[0,a(h8),[0,a(bG),[0,a(db),[0,a(w),[0,a(am),[0,a(v),0]]]]]]],bBA=[0,a(c),ce,11,ce,52,[0,a(aF),[0,a(j),[0,a(d),0]]]],bBB=[0,a(c),ce,11,ce,52,[0,a(aF),[0,a(j),[0,a(d),0]]]],bBF=[0,a(c),ce,11,ce,52,[0,a(aF),[0,a(j),[0,a(d),0]]]],bBe=[2,0],bBk=[1,0],bBl=[0,0],bBf=[0,a(cG),[0,a(dG),[0,a(P),0]]],bBg=[0,a(cG),[0,a(dG),0]],bBh=[0,a(cG),[0,a(dG),[0,a(O),0]]],bBi=[0,a(cG),[0,a(dG),0]],bBj=a(x),bBc=a(p),bBd=a(p),bBm=[0,a(aT),rZ,5,dR,29,[0,a(h8),[0,a(bG),[0,a(db),[0,a(w),[0,a(am),[0,a(v),0]]]]]]],bBG=[0,a(c),ce,11,ce,52,[0,a(aF),[0,a(j),[0,a(d),0]]]],bA5=[2,0],bA$=[1,0],bBa=[0,0],bA6=[0,a(cG),[0,a(dG),[0,a(P),0]]],bA7=[0,a(cG),[0,a(dG),0]],bA8=[0,a(cG),[0,a(dG),[0,a(O),0]]],bA9=[0,a(cG),[0,a(dG),0]],bA_=a(x),bA3=a(x),bA4=a(p),bBb=[0,a(aT),jO,5,sc,11,[0,a(h8),[0,a(bG),[0,a(db),[0,a(w),[0,a(am),[0,a(v),0]]]]]]],bBH=[0,a(c),ce,11,ce,52,[0,a(aF),[0,a(j),[0,a(d),0]]]],bAY=[0,0],bAZ=[1,0],bA0=[3,0],bA1=[4,0],bA2=[0,a(aT),km,5,kx,52,[0,a(h8),[0,a(bG),[0,a(db),[0,a(w),[0,a(am),[0,a(v),0]]]]]]],bBI=[0,a(c),ce,11,ce,52,[0,a(aF),[0,a(j),[0,a(d),0]]]],bAX=[0,a(c),ce,11,ce,52,[0,a(aF),[0,a(j),[0,a(d),0]]]],bAT=[0,a(aT),ts,14,ts,25,[0,a(bG),[0,a(db),[0,a(w),[0,a(am),[0,a(v),0]]]]]],bAS=[0,0],bAR=[2,0],bAN=[0,a(c),GW,14,GW,56,[0,a(aF),[0,a(j),[0,a(d),0]]]],bAJ=[0,a(c),JZ,14,JZ,63,[0,a(aF),[0,a(j),[0,a(d),0]]]],bAB=[0,a(C),4418,5,4426,28,[0,a(sp),[0,a(aJ),[0,a(aP),[0,a(aM),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bAC=[0,a(c),cW,11,cW,29,[0,a(aF),[0,a(j),[0,a(d),0]]]],bAA=[0,a(C),4399,5,4406,28,[0,a(sp),[0,a(aJ),[0,a(aP),[0,a(aM),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bAD=[0,a(c),cW,11,cW,29,[0,a(aF),[0,a(j),[0,a(d),0]]]],bAz=[0,a(C),4380,5,4389,28,[0,a(sp),[0,a(aJ),[0,a(aP),[0,a(aM),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bAE=[0,a(c),cW,11,cW,29,[0,a(aF),[0,a(j),[0,a(d),0]]]],bAF=[0,a(c),cW,11,cW,29,[0,a(aF),[0,a(j),[0,a(d),0]]]],bAy=[0,a(c),cW,11,cW,29,[0,a(aF),[0,a(j),[0,a(d),0]]]],bAt=[0,a(aT),Jb,5,Jb,73,[0,a("Article L841-3"),[0,a(bG),[0,a(db),[0,a(w),[0,a(am),[0,a(v),0]]]]]]],bAu=[0,a(c),gj,11,gj,50,[0,a(aF),[0,a(j),[0,a(d),0]]]],bAs=[0,a(c),gj,11,gj,50,[0,a(aF),[0,a(j),[0,a(d),0]]]],bAl=[0,a(C),Jr,9,Jr,55,[0,a(KN),[0,a(aV),[0,a(aP),[0,a(aM),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bAm=[0,a(c),cV,3,cV,22,[0,a(aF),[0,a(j),[0,a(d),0]]]],bAk=[0,a(c),cV,3,cV,22,[0,a(aF),[0,a(j),[0,a(d),0]]]],bAn=[0,a(c),cV,3,cV,22,[0,a(aF),[0,a(j),[0,a(d),0]]]],bAo=[0,a(b2),[0,a("\xc3\xa9ligibilit\xc3\xa9_commune.condition_logement_surface"),0]],bAg=[0,a(C),FR,9,FR,68,[0,a(KN),[0,a(aV),[0,a(aP),[0,a(aM),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bAh=[0,a(c),cV,3,cV,22,[0,a(aF),[0,a(j),[0,a(d),0]]]],bAf=[0,a(c),cV,3,cV,22,[0,a(aF),[0,a(j),[0,a(d),0]]]],bAi=[0,a(c),cV,3,cV,22,[0,a(aF),[0,a(j),[0,a(d),0]]]],bAj=[0,a(b2),[0,a("\xc3\xa9ligibilit\xc3\xa9_commune.condition_logement_r\xc3\xa9sidence_principale"),0]],bAc=[0,a(c),AO,14,AO,47,[0,a(aF),[0,a(j),[0,a(d),0]]]],bz_=[0,a(c),md,14,md,43,[0,a(aF),[0,a(j),[0,a(d),0]]]],bz6=[0,a(c),oT,14,oT,40,[0,a(aF),[0,a(j),[0,a(d),0]]]],bz0=[0,a(c),yJ,14,yJ,46,[0,a(aF),[0,a(j),[0,a(d),0]]]],bzZ=[6,0],bzV=[0,a(c),pC,14,pC,56,[0,a(aF),[0,a(j),[0,a(d),0]]]],bzU=[1,0],bzQ=[0,a(c),FG,14,FG,50,[0,a(aF),[0,a(j),[0,a(d),0]]]],bzM=[0,a(C),Cy,14,Cy,28,[0,a("Article D841-1"),[0,a("Chapitre 1 : Champ d'application"),[0,a(aM),[0,a(w),[0,a(D),[0,a(v),0]]]]]]],bzN=[0,a(c),m2,11,m2,25,[0,a(aF),[0,a(j),[0,a(d),0]]]],bzL=[0,a(c),m2,11,m2,25,[0,a(aF),[0,a(j),[0,a(d),0]]]],bzO=[0,a(b2),[0,a("dur\xc3\xa9e_l841_1_3"),0]],bzR=[0,a(c),iX,3,iX,25,[0,a(aF),[0,a(j),[0,a(d),0]]]],bzS=[0,a(b2),[0,a(Gm),0]],bzP=[0,a(bO),46,10,46,23,[0,a(bQ),0]],bzW=[0,a(c),iX,3,iX,25,[0,a(aF),[0,a(j),[0,a(d),0]]]],bzX=[0,a(b2),[0,a(I5),0]],bzT=[0,a(bO),47,10,47,29,[0,a(bQ),0]],bz1=[0,a(c),iX,3,iX,25,[0,a(aF),[0,a(j),[0,a(d),0]]]],bz2=[0,a(b2),[0,a(Hx),0]],bzY=[0,a(bO),48,10,48,19,[0,a(bQ),0]],bz3=[0,a(b2),[0,a(nD),[0,a(cG),0]]],bz4=[0,a(b2),[0,a(nD),[0,a(cG),0]]],bz7=[0,a(c),cV,3,cV,22,[0,a(aF),[0,a(j),[0,a(d),0]]]],bz8=[0,a(b2),[0,a(w9),0]],bz5=[0,a(c),gt,10,gt,16,[0,a(Z),[0,a(j),[0,a(d),0]]]],bz$=[0,a(c),cV,3,cV,22,[0,a(aF),[0,a(j),[0,a(d),0]]]],bAa=[0,a(b2),[0,a(I4),0]],bz9=[0,a(c),h9,10,h9,19,[0,a(Z),[0,a(j),[0,a(d),0]]]],bAd=[0,a(c),cV,3,cV,22,[0,a(aF),[0,a(j),[0,a(d),0]]]],bAe=[0,a(b2),[0,a(Mr),0]],bAb=[0,a(c),hm,17,hm,30,[0,a(Z),[0,a(j),[0,a(d),0]]]],bAp=[0,a(b2),[0,a(px),[0,a(aW),0]]],bAq=[0,a(b2),[0,a(px),[0,a(aW),0]]],bAv=[0,a(c),gj,11,gj,50,[0,a(aF),[0,a(j),[0,a(d),0]]]],bAr=[0,a(c),gj,11,gj,50,[0,a(aF),[0,a(j),[0,a(d),0]]]],bAw=[0,a(b2),[0,a("\xc3\xa9ligibilit\xc3\xa9_allocation_logement_sociale"),0]],bAG=[0,a(c),cW,11,cW,29,[0,a(aF),[0,a(j),[0,a(d),0]]]],bAx=[0,a(c),cW,11,cW,29,[0,a(aF),[0,a(j),[0,a(d),0]]]],bAH=[0,a(b2),[0,a("condition_logement"),0]],bAK=[0,a(c),gH,10,gH,59,[0,a(aF),[0,a(j),[0,a(d),0]]]],bAI=[0,a(c),gH,10,gH,59,[0,a(aF),[0,a(j),[0,a(d),0]]]],bAL=[0,a(b2),[0,a(kw),0]],bAO=[0,a(c),oZ,10,oZ,52,[0,a(aF),[0,a(j),[0,a(d),0]]]],bAM=[0,a(c),oZ,10,oZ,52,[0,a(aF),[0,a(j),[0,a(d),0]]]],bAP=[0,a(b2),[0,a(tu),0]],bAU=[0,a(c),i0,10,i0,31,[0,a(aF),[0,a(j),[0,a(d),0]]]],bAQ=[0,a(c),i0,10,i0,31,[0,a(aF),[0,a(j),[0,a(d),0]]]],bAV=[0,a(b2),[0,a("\xc3\xa9ligibilit\xc3\xa9_dispositions_communes"),0]],bBJ=[0,a(c),ce,11,ce,52,[0,a(aF),[0,a(j),[0,a(d),0]]]],bAW=[0,a(c),ce,11,ce,52,[0,a(aF),[0,a(j),[0,a(d),0]]]],bBK=[0,a(b2),[0,a("\xc3\xa9ligibilit\xc3\xa9_allocation_logement_familiale"),0]],bBV=[0,a(c),ib,10,ib,16,[0,a(aF),[0,a(j),[0,a(d),0]]]],bBL=[0,a(c),ib,10,ib,16,[0,a(aF),[0,a(j),[0,a(d),0]]]],bBW=[0,a(b2),[0,a("\xc3\xa9ligibilit\xc3\xa9_l841_2"),0]],bB0=[0,a(c),pd,10,pd,33,[0,a(aF),[0,a(j),[0,a(d),0]]]],bBX=[0,a(c),pd,10,pd,33,[0,a(aF),[0,a(j),[0,a(d),0]]]],bB1=[0,a(b2),[0,a("\xc3\xa9ligibilit\xc3\xa9_avec_condition_logement"),0]],bzH=[0,a(aT),fO,5,586,36,[0,a(bG),[0,a(av),[0,a(w),[0,a(am),[0,a(v),0]]]]]],bzI=[0,a(c),gb,10,gb,21,[0,a(a8),[0,a(j),[0,a(d),0]]]],bzG=[0,a(c),gb,10,gb,21,[0,a(a8),[0,a(j),[0,a(d),0]]]],bzC=[0,a(c),KV,14,KV,56,[0,a(a8),[0,a(j),[0,a(d),0]]]],bzy=[0,a(c),yY,14,yY,63,[0,a(a8),[0,a(j),[0,a(d),0]]]],bzr=[0,a(aT),661,5,kp,30,[0,a(ke),[0,a(bG),[0,a(av),[0,a(w),[0,a(am),[0,a(v),0]]]]]]],bzs=[0,a(c),cd,11,cd,38,[0,a(a8),[0,a(j),[0,a(d),0]]]],bzq=[0,a(aT),jU,5,tz,30,[0,a(ke),[0,a(bG),[0,a(av),[0,a(w),[0,a(am),[0,a(v),0]]]]]]],bzt=[0,a(c),cd,11,cd,38,[0,a(a8),[0,a(j),[0,a(d),0]]]],bzp=[0,a(aT),hq,5,641,30,[0,a(ke),[0,a(bG),[0,a(av),[0,a(w),[0,a(am),[0,a(v),0]]]]]]],bzu=[0,a(c),cd,11,cd,38,[0,a(a8),[0,a(j),[0,a(d),0]]]],bzk=[0,a(C),3758,5,sQ,30,[0,a("Article R832-21"),[0,a("Sous-Section 1 : Conditions d'assimilation des logements-foyers aux logements \xc3\xa0 usage locatif"),[0,a(aV),[0,a(aI),[0,a(av),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]]],bzl=[0,a(c),cd,11,cd,38,[0,a(a8),[0,a(j),[0,a(d),0]]]],bzg=[0,a(cf),[0,a(kn),[0,a(P),0]]],bzh=[0,a(cf),[0,a(kn),0]],bzi=[0,a(cf),[0,a(kn),[0,a(O),0]]],bzj=[0,a(cf),[0,a(kn),0]],bzf=[0,a(aT),hr,5,kD,30,[0,a(ke),[0,a(bG),[0,a(av),[0,a(w),[0,a(am),[0,a(v),0]]]]]]],bzm=[0,a(c),cd,11,cd,38,[0,a(a8),[0,a(j),[0,a(d),0]]]],bzb=[0,a(cf),[0,a(kc),[0,a(P),0]]],bzc=[0,a(cf),[0,a(kc),0]],bzd=[0,a(cf),[0,a(kc),[0,a(O),0]]],bze=[0,a(cf),[0,a(kc),0]],bza=[0,a(aT),fI,5,616,30,[0,a(ke),[0,a(bG),[0,a(av),[0,a(w),[0,a(am),[0,a(v),0]]]]]]],bzn=[0,a(c),cd,11,cd,38,[0,a(a8),[0,a(j),[0,a(d),0]]]],bzo=[0,a(c),cd,11,cd,38,[0,a(a8),[0,a(j),[0,a(d),0]]]],by$=[0,a(c),cd,11,cd,38,[0,a(a8),[0,a(j),[0,a(d),0]]]],by5=[0,a(c),sJ,14,sJ,47,[0,a(a8),[0,a(j),[0,a(d),0]]]],by1=[0,a(c),JC,14,JC,43,[0,a(a8),[0,a(j),[0,a(d),0]]]],byX=[0,a(c),mY,14,mY,40,[0,a(a8),[0,a(j),[0,a(d),0]]]],byQ=[0,a(aT),jV,5,769,30,[0,a(rC),[0,a(bG),[0,a(av),[0,a(w),[0,a(am),[0,a(v),0]]]]]]],byR=[0,a(c),ej,11,ej,34,[0,a(a8),[0,a(j),[0,a(d),0]]]],byP=[0,a(aT),737,5,742,30,[0,a(rC),[0,a(bG),[0,a(av),[0,a(w),[0,a(am),[0,a(v),0]]]]]]],byS=[0,a(c),ej,11,ej,34,[0,a(a8),[0,a(j),[0,a(d),0]]]],byO=[0,a(aT),nS,31,nS,54,[0,a(rC),[0,a(bG),[0,a(av),[0,a(w),[0,a(am),[0,a(v),0]]]]]]],byT=[0,a(c),ej,11,ej,34,[0,a(a8),[0,a(j),[0,a(d),0]]]],byN=[0,a(c),ej,11,ej,34,[0,a(a8),[0,a(j),[0,a(d),0]]]],byJ=[0,a(c),i2,11,i2,41,[0,a(a8),[0,a(j),[0,a(d),0]]]],byK=[0,a(c),i2,11,i2,41,[0,a(a8),[0,a(j),[0,a(d),0]]]],byI=[0,a(c),i2,11,i2,41,[0,a(a8),[0,a(j),[0,a(d),0]]]],byC=[0,a(C),3085,5,3088,46,[0,a("Article R832-7"),[0,a(aJ),[0,a(aI),[0,a(av),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],byD=[0,a(c),eb,11,eb,41,[0,a(a8),[0,a(j),[0,a(d),0]]]],byB=[0,a(C),3050,5,3052,47,[0,a("Article R832-5"),[0,a(aJ),[0,a(aI),[0,a(av),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],byE=[0,a(c),eb,11,eb,41,[0,a(a8),[0,a(j),[0,a(d),0]]]],byF=[0,a(c),eb,11,eb,41,[0,a(a8),[0,a(j),[0,a(d),0]]]],byA=[0,a(c),eb,11,eb,41,[0,a(a8),[0,a(j),[0,a(d),0]]]],byG=[0,a(c),eb,11,eb,41,[0,a(a8),[0,a(j),[0,a(d),0]]]],byz=[0,a(c),eb,11,eb,41,[0,a(a8),[0,a(j),[0,a(d),0]]]],byH=[0,a(cf),[0,a(kc),0]],byL=[0,a(cf),[0,a(kn),0]],byU=[0,a(c),ej,11,ej,34,[0,a(a8),[0,a(j),[0,a(d),0]]]],byM=[0,a(c),ej,11,ej,34,[0,a(a8),[0,a(j),[0,a(d),0]]]],byV=[0,a(cf),[0,a("condition_logement_pr\xc3\xaat"),0]],byY=[0,a(c),im,3,im,22,[0,a(a8),[0,a(j),[0,a(d),0]]]],byZ=[0,a(cf),[0,a(w9),0]],byW=[0,a(c),gt,10,gt,16,[0,a(Z),[0,a(j),[0,a(d),0]]]],by2=[0,a(c),im,3,im,22,[0,a(a8),[0,a(j),[0,a(d),0]]]],by3=[0,a(cf),[0,a(I4),0]],by0=[0,a(c),h9,10,h9,19,[0,a(Z),[0,a(j),[0,a(d),0]]]],by6=[0,a(c),im,3,im,22,[0,a(a8),[0,a(j),[0,a(d),0]]]],by7=[0,a(cf),[0,a(Mr),0]],by4=[0,a(c),hm,17,hm,30,[0,a(Z),[0,a(j),[0,a(d),0]]]],by8=[0,a(cf),[0,a(px),[0,a(aW),0]]],by9=[0,a(cf),[0,a(px),[0,a(aW),0]]],bzv=[0,a(c),cd,11,cd,38,[0,a(a8),[0,a(j),[0,a(d),0]]]],by_=[0,a(c),cd,11,cd,38,[0,a(a8),[0,a(j),[0,a(d),0]]]],bzw=[0,a(cf),[0,a("condition_logement_bailleur"),0]],bzz=[0,a(c),nF,10,nF,59,[0,a(a8),[0,a(j),[0,a(d),0]]]],bzx=[0,a(c),nF,10,nF,59,[0,a(a8),[0,a(j),[0,a(d),0]]]],bzA=[0,a(cf),[0,a(kw),0]],bzD=[0,a(c),l_,10,l_,52,[0,a(a8),[0,a(j),[0,a(d),0]]]],bzB=[0,a(c),l_,10,l_,52,[0,a(a8),[0,a(j),[0,a(d),0]]]],bzE=[0,a(cf),[0,a(tu),0]],bzJ=[0,a(c),gb,10,gb,21,[0,a(a8),[0,a(j),[0,a(d),0]]]],bzF=[0,a(c),gb,10,gb,21,[0,a(a8),[0,a(j),[0,a(d),0]]]],bzK=[0,a(cf),[0,a(o_),0]],byw=[0,a(C),xc,14,xc,40,[0,a("Article D823-22"),[0,a(lY),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],byr=[0,a(aT),556,5,kC,43,[0,a("Article L823-8"),[0,a(aa),[0,a(Q),[0,a(w),[0,a(am),[0,a(v),0]]]]]]],bys=[0,a(c),gp,11,gp,31,[0,a(bN),[0,a(j),[0,a(d),0]]]],byq=[0,a(c),gp,11,gp,31,[0,a(bN),[0,a(j),[0,a(d),0]]]],bym=[0,a(V),BT,14,BT,29,[0,a("Article 45"),[0,a("Chapitre VIII : Prime de d\xc3\xa9m\xc3\xa9nagement"),[0,a(R),0]]]],byj=a(x),byf=a(x),byd=a(ak),bye=a(p),byg=a(su),byh=a(ak),byi=a(p),byl=a(p),byk=a("2.4"),bx_=[0,a(C),2136,6,2144,77,[0,a(rJ),[0,a(lY),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bx$=[0,a(c),ga,11,ga,41,[0,a(bN),[0,a(j),[0,a(d),0]]]],bx9=[0,a(c),ga,11,ga,41,[0,a(bN),[0,a(j),[0,a(d),0]]]],bx3=[0,a(c),IY,14,IY,43,[0,a(bN),[0,a(j),[0,a(d),0]]]],bxZ=[0,a(c),w7,14,w7,39,[0,a(bN),[0,a(j),[0,a(d),0]]]],bxV=[0,a(c),L7,14,L7,36,[0,a(bN),[0,a(j),[0,a(d),0]]]],bxP=[0,a(c),Gq,14,Gq,65,[0,a(bN),[0,a(j),[0,a(d),0]]]],bxJ=a(x),bxH=a(ak),bxI=a(p),bxK=[0,a(C),2127,5,2132,71,[0,a(rJ),[0,a(lY),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bxL=[0,a(c),gL,11,gL,32,[0,a(bN),[0,a(j),[0,a(d),0]]]],bxG=[0,a(c),gL,11,gL,32,[0,a(bN),[0,a(j),[0,a(d),0]]]],bxC=[0,a(C),zm,14,zm,47,[0,a(rJ),[0,a(lY),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bxD=[0,a(c),j4,11,j4,44,[0,a(bN),[0,a(j),[0,a(d),0]]]],bxB=[0,a(c),j4,11,j4,44,[0,a(bN),[0,a(j),[0,a(d),0]]]],bxE=[0,a(dD),[0,a("d\xc3\xa9lai_apr\xc3\xa8s_emm\xc3\xa9nagement_l823_8_2"),0]],bxM=[0,a(c),gL,11,gL,32,[0,a(bN),[0,a(j),[0,a(d),0]]]],bxF=[0,a(c),gL,11,gL,32,[0,a(bN),[0,a(j),[0,a(d),0]]]],bxN=[0,a(dD),[0,a("condition_rang_enfant"),0]],bxQ=[0,a(c),Ge,3,Ge,40,[0,a(bN),[0,a(j),[0,a(d),0]]]],bxR=[0,a(dD),[0,a(KT),0]],bxO=[0,a(d9),5,10,5,23,[0,a(b7),0]],bxS=[0,a(dD),[0,a(of),[0,a(gP),0]]],bxT=[0,a(dD),[0,a(of),[0,a(gP),0]]],bxW=[0,a(c),h2,3,h2,18,[0,a(bN),[0,a(j),[0,a(d),0]]]],bxX=[0,a(dD),[0,a("\xc3\xa9ligibilit\xc3\xa9_apl.m\xc3\xa9nage"),0]],bxU=[0,a(c),gt,10,gt,16,[0,a(Z),[0,a(j),[0,a(d),0]]]],bx0=[0,a(c),h2,3,h2,18,[0,a(bN),[0,a(j),[0,a(d),0]]]],bx1=[0,a(dD),[0,a("\xc3\xa9ligibilit\xc3\xa9_apl.demandeur"),0]],bxY=[0,a(c),h9,10,h9,19,[0,a(Z),[0,a(j),[0,a(d),0]]]],bx4=[0,a(c),h2,3,h2,18,[0,a(bN),[0,a(j),[0,a(d),0]]]],bx5=[0,a(dD),[0,a("\xc3\xa9ligibilit\xc3\xa9_apl.date_courante"),0]],bx2=[0,a(c),hm,17,hm,30,[0,a(Z),[0,a(j),[0,a(d),0]]]],bx6=[0,a(dD),[0,a(IT),[0,a(aW),0]]],bx7=[0,a(dD),[0,a(IT),[0,a(aW),0]]],bya=[0,a(c),ga,11,ga,41,[0,a(bN),[0,a(j),[0,a(d),0]]]],bx8=[0,a(c),ga,11,ga,41,[0,a(bN),[0,a(j),[0,a(d),0]]]],byb=[0,a(dD),[0,a("condition_p\xc3\xa9riode_d\xc3\xa9m\xc3\xa9nagement"),0]],byn=[0,a(c),lZ,11,lZ,26,[0,a(bN),[0,a(j),[0,a(d),0]]]],byc=[0,a(c),lZ,11,lZ,26,[0,a(bN),[0,a(j),[0,a(d),0]]]],byo=[0,a(dD),[0,a("plafond_d823_22"),0]],byt=[0,a(c),gp,11,gp,31,[0,a(bN),[0,a(j),[0,a(d),0]]]],byp=[0,a(c),gp,11,gp,31,[0,a(bN),[0,a(j),[0,a(d),0]]]],byu=[0,a(dD),[0,a(A9),0]],byx=[0,a(c),pw,10,pw,36,[0,a(bN),[0,a(j),[0,a(d),0]]]],byv=[0,a(c),pw,10,pw,36,[0,a(bN),[0,a(j),[0,a(d),0]]]],byy=[0,a(dD),[0,a("montant_prime_d\xc3\xa9m\xc3\xa9nagement"),0]],bxu=[0,a(C),yQ,14,yQ,33,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bxq=[0,a(C),El,14,El,36,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bxe=[0,a(aj),[0,a(bD),[0,a(P),0]]],bxf=[0,a(aj),[0,a(bD),0]],bxg=[0,a(aj),[0,a(bD),[0,a(O),0]]],bxh=[0,a(aj),[0,a(bD),0]],bxi=[0,a(U),[0,a(bD),[0,a(P),0]]],bxj=[0,a(U),[0,a(bD),0]],bxk=[0,a(U),[0,a(bD),[0,a(O),0]]],bxl=[0,a(U),[0,a(bD),0]],bxm=[0,a(_),[0,a(bD),[0,a(P),0]]],bxn=[0,a(_),[0,a(bD),0]],bxo=[0,a(_),[0,a(bD),[0,a(O),0]]],bxp=[0,a(_),[0,a(bD),0]],bxr=[0,a(c),oi,10,oi,32,[0,a($),[0,a(o),[0,a(j),[0,a(d),0]]]]],bxd=[0,a(c),oi,10,oi,32,[0,a($),[0,a(o),[0,a(j),[0,a(d),0]]]]],bw_=[0,a(C),zy,14,zy,48,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bw8=a(p),bw9=a(p),bw4=[0,a(C),xU,14,xU,32,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bw0=[0,a(C),yc,14,yc,31,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bwW=[0,a(C),Jd,5,Jd,69,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bwS=[0,a(C),HK,14,HK,42,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bwO=[0,a(C),Jj,14,Jj,26,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bwK=[0,a(C),LM,14,LM,52,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bwG=[0,a(C),z$,14,z$,47,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bwC=[0,a(C),An,14,An,35,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bwy=[0,a(C),DB,14,DB,67,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bwu=[0,a(C),Ha,14,Ha,49,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bwq=[0,a(C),xn,14,xn,37,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bwo=a(p),bwp=a(p),bwi=[0,a(C),wR,14,wR,38,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bwg=a(p),bwh=a(p),bwc=[0,a(C),Ap,14,Ap,42,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bv_=[0,a(C),JK,14,JK,33,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bv6=[0,a(C),JY,14,JY,59,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bv2=[0,a(C),zf,14,zf,54,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bvY=[0,a(C),H8,14,H8,56,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bvU=[0,a(C),Ec,14,Ec,44,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bvO=[0,a(C),F6,14,F6,47,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bvK=[0,a(C),zb,14,zb,53,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bvI=[0,0],bvJ=[0,0],bvE=[0,a(C),FY,14,FY,43,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bvC=[0,0],bvD=[0,0],bvy=[0,a(C),J_,14,J_,38,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bvu=[0,a(C),xa,14,xa,57,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bvq=[0,a(C),LC,14,LC,45,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bvm=[0,a(C),D_,14,D_,54,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bvi=[0,a(C),FV,14,FV,73,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bve=[0,a(C),BK,14,BK,53,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bva=[0,a(C),Ev,14,Ev,55,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bu_=[2,0],bu$=[2,0],bu6=[0,a(C),Hb,14,Hb,64,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bu2=[0,a(C),yi,14,yi,59,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],buY=[0,a(C),HC,14,HC,61,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],buU=[0,a(C),Mh,14,Mh,55,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],buS=a(p),buT=a(p),buO=[0,a(V),71,14,71,44,[0,a(dA),[0,a(b9),[0,a(R),0]]]],buI=[0,0],buJ=[1,0],buK=[1,0],buL=[1,0],buM=[0,0],buN=[1,0],buE=[0,a(C),BJ,14,BJ,31,[0,a(th),[0,a(dT),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]]],buB=a(dU),buC=a(rR),buD=a(sS),bux=[0,a(C),HA,14,HA,34,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bus=[0,0],but=[2,0],buu=[1,0],buv=[0,0],buw=[1,0],buy=[0,a(c),od,11,od,31,[0,a($),[0,a(o),[0,a(j),[0,a(d),0]]]]],bur=[0,a(c),od,11,od,31,[0,a($),[0,a(o),[0,a(j),[0,a(d),0]]]]],buz=[0,a(aA),[0,a(GI),0]],buF=[0,a(c),jV,10,jV,22,[0,a($),[0,a(o),[0,a(j),[0,a(d),0]]]]],buA=[0,a(c),jV,10,jV,22,[0,a($),[0,a(o),[0,a(j),[0,a(d),0]]]]],buG=[0,a(aA),[0,a(ye),0]],buP=[0,a(c),n4,11,n4,41,[0,a($),[0,a(o),[0,a(j),[0,a(d),0]]]]],buH=[0,a(c),n4,11,n4,41,[0,a($),[0,a(o),[0,a(j),[0,a(d),0]]]]],buQ=[0,a(aA),[0,a(zG),0]],buV=[0,a(c),bH,3,bH,22,[0,a($),[0,a(o),[0,a(j),[0,a(d),0]]]]],buW=[0,a(aA),[0,a(Dw),0]],buR=[0,a(c),DK,10,DK,31,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],buZ=[0,a(c),bH,3,bH,22,[0,a($),[0,a(o),[0,a(j),[0,a(d),0]]]]],bu0=[0,a(aA),[0,a("accession_propri\xc3\xa9t\xc3\xa9.ressources_m\xc3\xa9nage_arrondies"),0]],buX=[0,a(c),LQ,10,LQ,37,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],bu3=[0,a(c),bH,3,bH,22,[0,a($),[0,a(o),[0,a(j),[0,a(d),0]]]]],bu4=[0,a(aA),[0,a(CJ),0]],bu1=[0,a(c),zu,10,zu,35,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],bu7=[0,a(c),bH,3,bH,22,[0,a($),[0,a(o),[0,a(j),[0,a(d),0]]]]],bu8=[0,a(aA),[0,a(IK),0]],bu5=[0,a(c),Mq,10,Mq,40,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],bvb=[0,a(c),bH,3,bH,22,[0,a($),[0,a(o),[0,a(j),[0,a(d),0]]]]],bvc=[0,a(aA),[0,a(KE),0]],bu9=[0,a(c),DF,10,DF,31,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],bvf=[0,a(c),bH,3,bH,22,[0,a($),[0,a(o),[0,a(j),[0,a(d),0]]]]],bvg=[0,a(aA),[0,a(D9),0]],bvd=[0,a(c),Gs,10,Gs,29,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],bvj=[0,a(c),bH,3,bH,22,[0,a($),[0,a(o),[0,a(j),[0,a(d),0]]]]],bvk=[0,a(aA),[0,a(KR),0]],bvh=[0,a(c),tz,10,tz,49,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],bvn=[0,a(c),bH,3,bH,22,[0,a($),[0,a(o),[0,a(j),[0,a(d),0]]]]],bvo=[0,a(aA),[0,a(Jx),0]],bvl=[0,a(c),DZ,10,DZ,30,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],bvr=[0,a(c),bH,3,bH,22,[0,a($),[0,a(o),[0,a(j),[0,a(d),0]]]]],bvs=[0,a(aA),[0,a(Eq),0]],bvp=[0,a(c),Ka,10,Ka,21,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],bvv=[0,a(c),bH,3,bH,22,[0,a($),[0,a(o),[0,a(j),[0,a(d),0]]]]],bvw=[0,a(aA),[0,a(LK),0]],bvt=[0,a(c),De,10,De,33,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],bvz=[0,a(c),bH,3,bH,22,[0,a($),[0,a(o),[0,a(j),[0,a(d),0]]]]],bvA=[0,a(aA),[0,a(Ce),0]],bvx=[0,a(c),Eh,10,Eh,14,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],bvF=[0,a(c),bH,3,bH,22,[0,a($),[0,a(o),[0,a(j),[0,a(d),0]]]]],bvG=[0,a(aA),[0,a("accession_propri\xc3\xa9t\xc3\xa9.type_pr\xc3\xaat"),0]],bvB=[0,a(c),Gg,10,Gg,19,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],bvL=[0,a(c),bH,3,bH,22,[0,a($),[0,a(o),[0,a(j),[0,a(d),0]]]]],bvM=[0,a(aA),[0,a("accession_propri\xc3\xa9t\xc3\xa9.anciennet\xc3\xa9_logement"),0]],bvH=[0,a(c),Eu,10,Eu,29,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],bvP=[0,a(c),bH,3,bH,22,[0,a($),[0,a(o),[0,a(j),[0,a(d),0]]]]],bvQ=[0,a(aA),[0,a(xJ),0]],bvN=[0,a(c),z8,10,z8,23,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],bvR=[0,a(aA),[0,a(mj),[0,a(U),0]]],bvS=[0,a(aA),[0,a(mj),[0,a(U),0]]],bvV=[0,a(c),dz,3,dz,17,[0,a($),[0,a(o),[0,a(j),[0,a(d),0]]]]],bvW=[0,a(aA),[0,a(Mu),0]],bvT=[0,a(c),iG,10,iG,25,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],bvZ=[0,a(c),dz,3,dz,17,[0,a($),[0,a(o),[0,a(j),[0,a(d),0]]]]],bv0=[0,a(aA),[0,a(Ch),0]],bvX=[0,a(c),ix,10,ix,37,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],bv3=[0,a(c),dz,3,dz,17,[0,a($),[0,a(o),[0,a(j),[0,a(d),0]]]]],bv4=[0,a(aA),[0,a(Gf),0]],bv1=[0,a(c),hq,10,hq,35,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],bv7=[0,a(c),dz,3,dz,17,[0,a($),[0,a(o),[0,a(j),[0,a(d),0]]]]],bv8=[0,a(aA),[0,a(wU),0]],bv5=[0,a(c),i5,10,i5,40,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],bv$=[0,a(c),dz,3,dz,17,[0,a($),[0,a(o),[0,a(j),[0,a(d),0]]]]],bwa=[0,a(aA),[0,a(FF),0]],bv9=[0,a(c),iD,10,iD,14,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],bwd=[0,a(c),dz,3,dz,17,[0,a($),[0,a(o),[0,a(j),[0,a(d),0]]]]],bwe=[0,a(aA),[0,a(EP),0]],bwb=[0,a(c),iF,10,iF,23,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],bwj=[0,a(c),dz,3,dz,17,[0,a($),[0,a(o),[0,a(j),[0,a(d),0]]]]],bwk=[0,a(aA),[0,a(Jf),0]],bwf=[0,a(c),iv,10,iv,19,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],bwl=[0,a(aA),[0,a(nL),[0,a(_),0]]],bwm=[0,a(aA),[0,a(nL),[0,a(_),0]]],bwr=[0,a(c),b1,3,b1,10,[0,a($),[0,a(o),[0,a(j),[0,a(d),0]]]]],bws=[0,a(aA),[0,a(Aw),0]],bwn=[0,a(c),mC,10,mC,25,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],bwv=[0,a(c),b1,3,b1,10,[0,a($),[0,a(o),[0,a(j),[0,a(d),0]]]]],bww=[0,a(aA),[0,a(Bm),0]],bwt=[0,a(c),kC,10,kC,37,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],bwz=[0,a(c),b1,3,b1,10,[0,a($),[0,a(o),[0,a(j),[0,a(d),0]]]]],bwA=[0,a(aA),[0,a(AE),0]],bwx=[0,a(c),nr,10,nr,55,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],bwD=[0,a(c),b1,3,b1,10,[0,a($),[0,a(o),[0,a(j),[0,a(d),0]]]]],bwE=[0,a(aA),[0,a(IH),0]],bwB=[0,a(c),l8,10,l8,23,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],bwH=[0,a(c),b1,3,b1,10,[0,a($),[0,a(o),[0,a(j),[0,a(d),0]]]]],bwI=[0,a(aA),[0,a(xO),0]],bwF=[0,a(c),mH,10,mH,35,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],bwL=[0,a(c),b1,3,b1,10,[0,a($),[0,a(o),[0,a(j),[0,a(d),0]]]]],bwM=[0,a(aA),[0,a(E2),0]],bwJ=[0,a(c),pE,10,pE,40,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],bwP=[0,a(c),b1,3,b1,10,[0,a($),[0,a(o),[0,a(j),[0,a(d),0]]]]],bwQ=[0,a(aA),[0,a(yW),0]],bwN=[0,a(c),oV,10,oV,14,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],bwT=[0,a(c),b1,3,b1,10,[0,a($),[0,a(o),[0,a(j),[0,a(d),0]]]]],bwU=[0,a(aA),[0,a(AX),0]],bwR=[0,a(c),o7,10,o7,30,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],bwX=[0,a(c),b1,3,b1,10,[0,a($),[0,a(o),[0,a(j),[0,a(d),0]]]]],bwY=[0,a(aA),[0,a(K1),0]],bwV=[0,a(c),pt,10,pt,66,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],bw1=[0,a(c),b1,3,b1,10,[0,a($),[0,a(o),[0,a(j),[0,a(d),0]]]]],bw2=[0,a(aA),[0,a(Ld),0]],bwZ=[0,a(c),oU,10,oU,19,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],bw5=[0,a(c),b1,3,b1,10,[0,a($),[0,a(o),[0,a(j),[0,a(d),0]]]]],bw6=[0,a(aA),[0,a(wS),0]],bw3=[0,a(c),oc,10,oc,20,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],bw$=[0,a(c),b1,3,b1,10,[0,a($),[0,a(o),[0,a(j),[0,a(d),0]]]]],bxa=[0,a(aA),[0,a(F9),0]],bw7=[0,a(c),pz,10,pz,36,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],bxb=[0,a(aA),[0,a(mr),[0,a(aj),0]]],bxc=[0,a(aA),[0,a(mr),[0,a(aj),0]]],bxs=[0,a(aA),[0,a(a7),0]],bxv=[0,a(c),pr,10,pr,29,[0,a($),[0,a(o),[0,a(j),[0,a(d),0]]]]],bxt=[0,a(c),pr,10,pr,29,[0,a($),[0,a(o),[0,a(j),[0,a(d),0]]]]],bxw=[0,a(aA),[0,a(fS),0]],bxz=[0,a(C),1469,5,1471,15,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bxy=[0,a(C),DT,5,1467,15,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bxx=[0,a(C),iM,5,1463,15,[0,a(ao),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],buo=[0,a(C),B8,14,B8,36,[0,a(dn),[0,a(aJ),[0,a(aP),[0,a(aM),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],buf=[0,a(S),[0,a(a4),[0,a(P),0]]],bug=[0,a(S),[0,a(a4),0]],buh=[0,a(S),[0,a(a4),[0,a(O),0]]],bui=[0,a(S),[0,a(a4),0]],buj=a(p),buk=[0,a(S),[0,a(a4),[0,a(P),0]]],bul=[0,a(S),[0,a(a4),0]],bum=[0,a(S),[0,a(a4),[0,a(O),0]]],bun=[0,a(S),[0,a(a4),0]],bup=[0,a(c),mo,10,mo,25,[0,a(z),[0,a(t),[0,a(d),0]]]],bue=[0,a(c),mo,10,mo,25,[0,a(z),[0,a(t),[0,a(d),0]]]],bub=[0,a(C),wL,14,wL,36,[0,a(dn),[0,a(aJ),[0,a(aP),[0,a(aM),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],btv=a(p),btw=[0,a(S),[0,a(bn),[0,a(P),0]]],btx=[0,a(S),[0,a(bn),0]],bty=[0,a(S),[0,a(bn),[0,a(O),0]]],btz=[0,a(S),[0,a(bn),0]],btA=[0,a(af),[0,a(al),[0,a(P),0]]],btB=[0,a(af),[0,a(al),0]],btC=[0,a(af),[0,a(al),[0,a(O),0]]],btD=[0,a(af),[0,a(al),0]],btE=a(e1),btF=[0,a(S),[0,a(bn),[0,a(P),0]]],btG=[0,a(S),[0,a(bn),0]],btH=[0,a(S),[0,a(bn),[0,a(O),0]]],btI=[0,a(S),[0,a(bn),0]],btJ=[0,a(af),[0,a(al),[0,a(P),0]]],btK=[0,a(af),[0,a(al),0]],btL=[0,a(af),[0,a(al),[0,a(O),0]]],btM=[0,a(af),[0,a(al),0]],btN=[0,a(S),[0,a(bn),[0,a(P),0]]],btO=[0,a(S),[0,a(bn),0]],btP=[0,a(S),[0,a(bn),[0,a(O),0]]],btQ=[0,a(S),[0,a(bn),0]],btR=[0,a(S),[0,a(bn),[0,a(P),0]]],btS=[0,a(S),[0,a(bn),0]],btT=[0,a(S),[0,a(bn),[0,a(O),0]]],btU=[0,a(S),[0,a(bn),0]],btV=[0,a(af),[0,a(al),[0,a(P),0]]],btW=[0,a(af),[0,a(al),0]],btX=[0,a(af),[0,a(al),[0,a(O),0]]],btY=[0,a(af),[0,a(al),0]],btZ=a(e1),bt0=[0,a(S),[0,a(bn),[0,a(P),0]]],bt1=[0,a(S),[0,a(bn),0]],bt2=[0,a(S),[0,a(bn),[0,a(O),0]]],bt3=[0,a(S),[0,a(bn),0]],bt4=[0,a(af),[0,a(al),[0,a(P),0]]],bt5=[0,a(af),[0,a(al),0]],bt6=[0,a(af),[0,a(al),[0,a(O),0]]],bt7=[0,a(af),[0,a(al),0]],bt8=[0,a(S),[0,a(bn),[0,a(P),0]]],bt9=[0,a(S),[0,a(bn),0]],bt_=[0,a(S),[0,a(bn),[0,a(O),0]]],bt$=[0,a(S),[0,a(bn),0]],bua=a(p),buc=[0,a(c),m3,10,m3,40,[0,a(z),[0,a(t),[0,a(d),0]]]],btu=[0,a(c),m3,10,m3,40,[0,a(z),[0,a(t),[0,a(d),0]]]],btr=[0,a(C),Gx,14,Gx,36,[0,a(dn),[0,a(aJ),[0,a(aP),[0,a(aM),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bs3=a(p),bs4=[0,a(S),[0,a(ag),[0,a(P),0]]],bs5=[0,a(S),[0,a(ag),0]],bs6=[0,a(S),[0,a(ag),[0,a(O),0]]],bs7=[0,a(S),[0,a(ag),0]],bs8=[0,a(S),[0,a(cS),[0,a(P),0]]],bs9=[0,a(S),[0,a(cS),0]],bs_=[0,a(S),[0,a(cS),[0,a(O),0]]],bs$=[0,a(S),[0,a(cS),0]],bta=[0,a(S),[0,a(ag),[0,a(P),0]]],btb=[0,a(S),[0,a(ag),0]],btc=[0,a(S),[0,a(ag),[0,a(O),0]]],btd=[0,a(S),[0,a(ag),0]],bte=a(p),btf=[0,a(S),[0,a(ag),[0,a(P),0]]],btg=[0,a(S),[0,a(ag),0]],bth=[0,a(S),[0,a(ag),[0,a(O),0]]],bti=[0,a(S),[0,a(ag),0]],btj=[0,a(S),[0,a(cS),[0,a(P),0]]],btk=[0,a(S),[0,a(cS),0]],btl=[0,a(S),[0,a(cS),[0,a(O),0]]],btm=[0,a(S),[0,a(cS),0]],btn=[0,a(S),[0,a(ag),[0,a(P),0]]],bto=[0,a(S),[0,a(ag),0]],btp=[0,a(S),[0,a(ag),[0,a(O),0]]],btq=[0,a(S),[0,a(ag),0]],bts=[0,a(c),pa,10,pa,32,[0,a(z),[0,a(t),[0,a(d),0]]]],bs2=[0,a(c),pa,10,pa,32,[0,a(z),[0,a(t),[0,a(d),0]]]],bsZ=[0,a(C),zg,14,zg,33,[0,a(dn),[0,a(aJ),[0,a(aP),[0,a(aM),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bsV=[0,a(C),xR,14,xR,47,[0,a(nE),[0,a(aJ),[0,a(aP),[0,a(aM),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bsM=[0,a(S),[0,a(cT),[0,a(P),0]]],bsN=[0,a(S),[0,a(cT),0]],bsO=[0,a(S),[0,a(cT),[0,a(O),0]]],bsP=[0,a(S),[0,a(cT),0]],bsQ=[0,a(S),[0,a(cT),[0,a(P),0]]],bsR=[0,a(S),[0,a(cT),0]],bsS=[0,a(S),[0,a(cT),[0,a(O),0]]],bsT=[0,a(S),[0,a(cT),0]],bsU=a(p),bsW=[0,a(c),mi,11,mi,44,[0,a(z),[0,a(t),[0,a(d),0]]]],bsL=[0,a(c),mi,11,mi,44,[0,a(z),[0,a(t),[0,a(d),0]]]],bsI=[0,a(C),BW,14,BW,41,[0,a(dn),[0,a(aJ),[0,a(aP),[0,a(aM),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bsE=[0,a(C),Fg,14,Fg,33,[0,a(dn),[0,a(aJ),[0,a(aP),[0,a(aM),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bsA=[0,a(C),CO,14,CO,33,[0,a(dn),[0,a(aJ),[0,a(aP),[0,a(aM),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bsv=[0,a(C),4731,7,4734,45,[0,a(nE),[0,a(aJ),[0,a(aP),[0,a(aM),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bsw=[0,a(c),iV,11,iV,47,[0,a(z),[0,a(t),[0,a(d),0]]]],bsu=[0,a(C),L0,14,L0,50,[0,a(nE),[0,a(aJ),[0,a(aP),[0,a(aM),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bso=[0,a(C),Ji,14,Ji,62,[0,a(dn),[0,a(aJ),[0,a(aP),[0,a(aM),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bsp=[0,a(c),cR,3,cR,28,[0,a(z),[0,a(t),[0,a(d),0]]]],bsq=[0,a(S),[0,a("calcul_apl_logement_foyer.n_nombre_parts_d832_25"),0]],bsl=[0,a(C),AR,14,AR,61,[0,a(dn),[0,a(aJ),[0,a(aP),[0,a(aM),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bsm=[0,a(c),cR,3,cR,28,[0,a(z),[0,a(t),[0,a(d),0]]]],bsn=[0,a(S),[0,a(K9),0]],bsi=[0,a(c),AA,14,AA,49,[0,a(z),[0,a(t),[0,a(d),0]]]],bsh=a(p),bsd=[0,a(c),Kl,14,Kl,53,[0,a(z),[0,a(t),[0,a(d),0]]]],br$=[0,a(c),rZ,14,rZ,44,[0,a(z),[0,a(t),[0,a(d),0]]]],br7=[0,a(c),Ep,14,Ep,70,[0,a(z),[0,a(t),[0,a(d),0]]]],br3=[0,a(c),Iz,14,Iz,65,[0,a(z),[0,a(t),[0,a(d),0]]]],brZ=[0,a(c),ya,14,ya,67,[0,a(z),[0,a(t),[0,a(d),0]]]],brV=[0,a(c),D6,14,D6,55,[0,a(z),[0,a(t),[0,a(d),0]]]],brT=[0,[0,[0,0],1,1,1,1]],brU=[1,0],brN=[0,a(C),Bz,14,Bz,70,[0,a(dn),[0,a(aJ),[0,a(aP),[0,a(aM),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],brJ=[0,a(C),JJ,14,JJ,69,[0,a(dn),[0,a(aJ),[0,a(aP),[0,a(aM),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],brF=[0,a(C),Jo,14,Jo,75,[0,a(dn),[0,a(aJ),[0,a(aP),[0,a(aM),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],brA=[0,a(C),FI,5,FI,44,[0,a(Jp),[0,a(aJ),[0,a(aP),[0,a(aM),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],brk=[0,a(S),[0,a(co),[0,a(P),0]]],brl=[0,a(S),[0,a(co),0]],brm=[0,a(S),[0,a(co),[0,a(O),0]]],brn=[0,a(S),[0,a(co),0]],bro=[0,a(S),[0,a(co),[0,a(P),0]]],brp=[0,a(S),[0,a(co),0]],brq=[0,a(S),[0,a(co),[0,a(O),0]]],brr=[0,a(S),[0,a(co),0]],brs=[0,a(S),[0,a(co),[0,a(P),0]]],brt=[0,a(S),[0,a(co),0]],bru=[0,a(S),[0,a(co),[0,a(O),0]]],brv=[0,a(S),[0,a(co),0]],brw=[0,a(S),[0,a(co),[0,a(P),0]]],brx=[0,a(S),[0,a(co),0]],bry=[0,a(S),[0,a(co),[0,a(O),0]]],brz=[0,a(S),[0,a(co),0]],brB=[0,a(c),ik,11,ik,36,[0,a(z),[0,a(t),[0,a(d),0]]]],brj=[0,a(C),Bu,14,Bu,39,[0,a(Jp),[0,a(aJ),[0,a(aP),[0,a(aM),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],brf=[0,a(S),[0,a(co),[0,a(P),0]]],brg=[0,a(S),[0,a(co),0]],brh=[0,a(S),[0,a(co),[0,a(O),0]]],bri=[0,a(S),[0,a(co),0]],bra=[0,a(C),G8,5,G8,28,[0,a(oo),[0,a(aJ),[0,a(aP),[0,a(aM),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],brb=[0,a(c),i6,10,i6,15,[0,a(z),[0,a(t),[0,a(d),0]]]],bq$=[0,a(C),LT,14,LT,41,[0,a(oo),[0,a(aJ),[0,a(aP),[0,a(aM),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bq8=a(dU),bq9=a(rR),bq_=a(sS),bq3=[0,a(V),ED,24,ED,56,[0,a(Di),[0,a(bs),[0,a(R),0]]]],bqU=a(fF),bqV=[0,a(S),[0,a(dO),[0,a(P),0]]],bqW=[0,a(S),[0,a(dO),0]],bqX=[0,a(S),[0,a(dO),[0,a(O),0]]],bqY=[0,a(S),[0,a(dO),0]],bqZ=[0,a(S),[0,a(dO),[0,a(P),0]]],bq0=[0,a(S),[0,a(dO),0]],bq1=[0,a(S),[0,a(dO),[0,a(O),0]]],bq2=[0,a(S),[0,a(dO),0]],bq4=[0,a(c),ir,10,ir,26,[0,a(z),[0,a(t),[0,a(d),0]]]],bqT=[0,a(V),yD,14,yD,46,[0,a(b_),[0,a(bs),[0,a(R),0]]]],bqP=[0,a(S),[0,a(dO),[0,a(P),0]]],bqQ=[0,a(S),[0,a(dO),0]],bqR=[0,a(S),[0,a(dO),[0,a(O),0]]],bqS=[0,a(S),[0,a(dO),0]],bq5=[0,a(c),ir,10,ir,26,[0,a(z),[0,a(t),[0,a(d),0]]]],bqO=[0,a(c),ir,10,ir,26,[0,a(z),[0,a(t),[0,a(d),0]]]],bqL=[0,a(C),Do,15,Do,37,[0,a(nE),[0,a(aJ),[0,a(aP),[0,a(aM),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bqM=[0,a(c),km,11,km,33,[0,a(z),[0,a(t),[0,a(d),0]]]],bqK=[0,a(c),km,11,km,33,[0,a(z),[0,a(t),[0,a(d),0]]]],bqG=[0,a(C),4756,6,4762,6,[0,a(oo),[0,a(aJ),[0,a(aP),[0,a(aM),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bqH=[0,a(c),gD,11,gD,42,[0,a(z),[0,a(t),[0,a(d),0]]]],bqE=[0,a(C),4774,5,4775,59,[0,a(oo),[0,a(aJ),[0,a(aP),[0,a(aM),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],bqF=[0,a(c),gD,11,gD,42,[0,a(z),[0,a(t),[0,a(d),0]]]],bqz=[0,a(V),KB,5,KB,64,[0,a(b_),[0,a(bs),[0,a(R),0]]]],bpP=a(p),bpQ=a("158700"),bpR=a("191300"),bpS=a(x),bpT=a("205500"),bpU=a(ab),bpV=a("211300"),bpW=a(ak),bpX=a("217100"),bpY=a(an),bpZ=a("222900"),bp0=a(T),bp1=a(If),bp2=a(T),bp3=a("19800"),bp4=a(If),bp5=a(p),bp6=a("139300"),bp7=a("170600"),bp8=a(x),bp9=a("184700"),bp_=a(ab),bp$=a("191200"),bqa=a(ak),bqb=a(zT),bqc=a(an),bqd=a("204200"),bqe=a(T),bqf=a(F2),bqg=a(T),bqh=a(sq),bqi=a(F2),bqj=a(p),bqk=a("130600"),bql=a("158400"),bqm=a(x),bqn=a("172600"),bqo=a(ab),bqp=a(C2),bqq=a(ak),bqr=a("187000"),bqs=a(an),bqt=a(yH),bqu=a(T),bqv=a(ta),bqw=a(T),bqx=a("18200"),bqy=a(ta),bqA=[0,a(c),aY,10,aY,14,[0,a(z),[0,a(t),[0,a(d),0]]]],bpN=[0,a(V),Bj,5,Bj,64,[0,a(b_),[0,a(bs),[0,a(R),0]]]],bo3=a(p),bo4=a("160400"),bo5=a("193400"),bo6=a(x),bo7=a("207800"),bo8=a(ab),bo9=a("213700"),bo_=a(ak),bo$=a("219600"),bpa=a(an),bpb=a(Hn),bpc=a(T),bpd=a(nc),bpe=a(T),bpf=a("20000"),bpg=a(nc),bph=a(p),bpi=a(CS),bpj=a(C4),bpk=a(x),bpl=a("186700"),bpm=a(ab),bpn=a("193300"),bpo=a(ak),bpp=a(sL),bpq=a(an),bpr=a("206500"),bps=a(T),bpt=a(Gh),bpu=a(T),bpv=a(zV),bpw=a(Gh),bpx=a(p),bpy=a(Bh),bpz=a(Hz),bpA=a(x),bpB=a("174500"),bpC=a(ab),bpD=a(GJ),bpE=a(ak),bpF=a("189100"),bpG=a(an),bpH=a(yH),bpI=a(T),bpJ=a(E0),bpK=a(T),bpL=a("18400"),bpM=a(E0),bpO=[0,a(c),aY,10,aY,14,[0,a(z),[0,a(t),[0,a(d),0]]]],bo1=[0,a(V),FD,5,FD,64,[0,a(b_),[0,a(bs),[0,a(R),0]]]],bof=a(p),bog=a("163300"),boh=a("196900"),boi=a(x),boj=a("211600"),bok=a(ab),bol=a(F3),bom=a(ak),bon=a("223600"),boo=a(an),bop=a("229600"),boq=a(T),bor=a(Bw),bos=a(T),bot=a("20400"),bou=a(Bw),bov=a(p),bow=a("143300"),box=a("175600"),boy=a(x),boz=a("190100"),boA=a(ab),boB=a("196600"),boC=a(ak),boD=a("203500"),boE=a(an),boF=a("210200"),boG=a(T),boH=a(Ly),boI=a(T),boJ=a("19600"),boK=a(Ly),boL=a(p),boM=a("134400"),boN=a(GO),boO=a(x),boP=a("177700"),boQ=a(ab),boR=a("185100"),boS=a(ak),boT=a(xS),boU=a(an),boV=a(sL),boW=a(T),boX=a(Md),boY=a(T),boZ=a("18700"),bo0=a(Md),bo2=[0,a(c),aY,10,aY,14,[0,a(z),[0,a(t),[0,a(d),0]]]],bod=[0,a(V),GA,5,GA,64,[0,a(b_),[0,a(bs),[0,a(R),0]]]],bnt=a(p),bnu=a("167200"),bnv=a("201600"),bnw=a(x),bnx=a("216700"),bny=a(ab),bnz=a("222800"),bnA=a(ak),bnB=a("229000"),bnC=a(an),bnD=a("235100"),bnE=a(T),bnF=a(L9),bnG=a(T),bnH=a(Fp),bnI=a(L9),bnJ=a(p),bnK=a("146700"),bnL=a(C2),bnM=a(x),bnN=a("194700"),bnO=a(ab),bnP=a("201500"),bnQ=a(ak),bnR=a("208400"),bnS=a(an),bnT=a("215200"),bnU=a(T),bnV=a(nc),bnW=a(T),bnX=a(Bs),bnY=a(nc),bnZ=a(p),bn0=a("137600"),bn1=a("166900"),bn2=a(x),bn3=a("182000"),bn4=a(ab),bn5=a("189500"),bn6=a(ak),bn7=a("197100"),bn8=a(an),bn9=a(Cx),bn_=a(T),bn$=a(I0),boa=a(T),bob=a(sq),boc=a(I0),boe=[0,a(c),aY,10,aY,14,[0,a(z),[0,a(t),[0,a(d),0]]]],bnr=[0,a(V),FK,5,FK,64,[0,a(b_),[0,a(bs),[0,a(R),0]]]],bmH=a(p),bmI=a("167400"),bmJ=a("201800"),bmK=a(x),bmL=a("216900"),bmM=a(ab),bmN=a("223000"),bmO=a(ak),bmP=a("229200"),bmQ=a(an),bmR=a("235300"),bmS=a(T),bmT=a(Ir),bmU=a(T),bmV=a(Fp),bmW=a(Ir),bmX=a(p),bmY=a("146800"),bmZ=a("180000"),bm0=a(x),bm1=a("194900"),bm2=a(ab),bm3=a(LO),bm4=a(ak),bm5=a(ta),bm6=a(an),bm7=a("215400"),bm8=a(T),bm9=a(J2),bm_=a(T),bm$=a(Bs),bna=a(J2),bnb=a(p),bnc=a("137700"),bnd=a("167100"),bne=a(x),bnf=a("182200"),bng=a(ab),bnh=a("189700"),bni=a(ak),bnj=a("197300"),bnk=a(an),bnl=a("204900"),bnm=a(T),bnn=a(C0),bno=a(T),bnp=a(sq),bnq=a(C0),bns=[0,a(c),aY,10,aY,14,[0,a(z),[0,a(t),[0,a(d),0]]]],bmF=[0,a(V),oO,5,oO,64,[0,a(b_),[0,a(bs),[0,a(R),0]]]],blV=a(p),blW=a("169100"),blX=a("203800"),blY=a(x),blZ=a("219100"),bl0=a(ab),bl1=a("225200"),bl2=a(ak),bl3=a("231500"),bl4=a(an),bl5=a("237700"),bl6=a(T),bl7=a(kf),bl8=a(T),bl9=a("21100"),bl_=a(kf),bl$=a(p),bma=a("148300"),bmb=a(GJ),bmc=a(x),bmd=a("196800"),bme=a(ab),bmf=a("203700"),bmg=a(ak),bmh=a("210700"),bmi=a(an),bmj=a(F3),bmk=a(T),bml=a(Gk),bmm=a(T),bmn=a("20300"),bmo=a(Gk),bmp=a(p),bmq=a("139100"),bmr=a("168800"),bms=a(x),bmt=a(tc),bmu=a(ab),bmv=a("191600"),bmw=a(ak),bmx=a("199300"),bmy=a(an),bmz=a("206900"),bmA=a(T),bmB=a(AY),bmC=a(T),bmD=a(zV),bmE=a(AY),bmG=[0,a(c),aY,10,aY,14,[0,a(z),[0,a(t),[0,a(d),0]]]],blT=[0,a(V),Ai,5,Ai,64,[0,a(b_),[0,a(bs),[0,a(R),0]]]],bk9=a(p),bk_=a("171100"),bk$=a("206200"),bla=a(x),blb=a("221700"),blc=a(ab),bld=a("227900"),ble=a(ak),blf=a("234300"),blg=a(an),blh=a("240600"),bli=a(T),blj=a(H7),blk=a(T),bll=a("21400"),blm=a(H7),bln=a(p),blo=a("150100"),blp=a(tc),blq=a(x),blr=a("199200"),bls=a(ab),blt=a("206100"),blu=a(ak),blv=a("213200"),blw=a(an),blx=a("220200"),bly=a(T),blz=a(zH),blA=a(T),blB=a("20500"),blC=a(zH),blD=a(p),blE=a(CS),blF=a("170800"),blG=a(x),blH=a("186200"),blI=a(ab),blJ=a("193900"),blK=a(ak),blL=a(LO),blM=a(an),blN=a("209400"),blO=a(T),blP=a(IO),blQ=a(T),blR=a("19500"),blS=a(IO),blU=[0,a(c),aY,10,aY,14,[0,a(z),[0,a(t),[0,a(d),0]]]],bk7=[0,a(V),z_,5,z_,64,[0,a(b_),[0,a(bs),[0,a(R),0]]]],bkl=a(p),bkm=a("26084"),bkn=a("31435"),bko=a(x),bkp=a("33798"),bkq=a(ab),bkr=a("34743"),bks=a(ak),bkt=a("35719"),bku=a(an),bkv=a("36679"),bkw=a(T),bkx=a(HI),bky=a(T),bkz=a("3262"),bkA=a(HI),bkB=a(p),bkC=a("22883"),bkD=a("28051"),bkE=a(x),bkF=a("30368"),bkG=a(ab),bkH=a("31420"),bkI=a(ak),bkJ=a("32502"),bkK=a(an),bkL=a("33569"),bkM=a(T),bkN=a(Ed),bkO=a(T),bkP=a("3125"),bkQ=a(Ed),bkR=a(p),bkS=a("21465"),bkT=a("26038"),bkU=a(x),bkV=a("28386"),bkW=a(ab),bkX=a("29560"),bkY=a(ak),bkZ=a("30749"),bk0=a(an),bk1=a("31923"),bk2=a(T),bk3=a(DU),bk4=a(T),bk5=a("2973"),bk6=a(DU),bk8=[0,a(c),aY,10,aY,14,[0,a(z),[0,a(t),[0,a(d),0]]]],bkj=[0,a(V),JE,5,JE,64,[0,a(b_),[0,a(bs),[0,a(R),0]]]],bjz=a(p),bjA=a("26397"),bjB=a("31812"),bjC=a(x),bjD=a("34204"),bjE=a(ab),bjF=a("35160"),bjG=a(ak),bjH=a("36148"),bjI=a(an),bjJ=a("37119"),bjK=a(T),bjL=a(HU),bjM=a(T),bjN=a("3301"),bjO=a(HU),bjP=a(p),bjQ=a("23158"),bjR=a("28388"),bjS=a(x),bjT=a("30732"),bjU=a(ab),bjV=a(rT),bjW=a(ak),bjX=a("32892"),bjY=a(an),bjZ=a("33972"),bj0=a(T),bj1=a(DM),bj2=a(T),bj3=a("3163"),bj4=a(DM),bj5=a(p),bj6=a("21723"),bj7=a("26350"),bj8=a(x),bj9=a("28727"),bj_=a(ab),bj$=a("29915"),bka=a(ak),bkb=a("31118"),bkc=a(an),bkd=a("32306"),bke=a(T),bkf=a(Gw),bkg=a(T),bkh=a("3009"),bki=a(Gw),bkk=[0,a(c),aY,10,aY,14,[0,a(z),[0,a(t),[0,a(d),0]]]],bjx=[0,a(V),HS,5,HS,64,[0,a(b_),[0,a(bs),[0,a(R),0]]]],biN=a(p),biO=a(Mw),biP=a("32194"),biQ=a(x),biR=a("34614"),biS=a(ab),biT=a("35582"),biU=a(ak),biV=a("36582"),biW=a(an),biX=a("37564"),biY=a(T),biZ=a(xZ),bi0=a(T),bi1=a("3341"),bi2=a(xZ),bi3=a(p),bi4=a("23436"),bi5=a("28729"),bi6=a(x),bi7=a("31101"),bi8=a(ab),bi9=a("32179"),bi_=a(ak),bi$=a("33287"),bja=a(an),bjb=a("34380"),bjc=a(T),bjd=a(AW),bje=a(T),bjf=a("3201"),bjg=a(AW),bjh=a(p),bji=a("21984"),bjj=a("26666"),bjk=a(x),bjl=a("29072"),bjm=a(ab),bjn=a("30274"),bjo=a(ak),bjp=a("31491"),bjq=a(an),bjr=a("32694"),bjs=a(T),bjt=a(BB),bju=a(T),bjv=a("3045"),bjw=a(BB),bjy=[0,a(c),aY,10,aY,14,[0,a(z),[0,a(t),[0,a(d),0]]]],biL=[0,a(V),Eb,5,Eb,64,[0,a(b_),[0,a(bs),[0,a(R),0]]]],bh1=a(p),bh2=a("27195"),bh3=a("32773"),bh4=a(x),bh5=a("35237"),bh6=a(ab),bh7=a("36222"),bh8=a(ak),bh9=a("37240"),bh_=a(an),bh$=a("38240"),bia=a(T),bib=a(Jk),bic=a(T),bid=a("3401"),bie=a(Jk),bif=a(p),big=a("23858"),bih=a("29246"),bii=a(x),bij=a("31661"),bik=a(ab),bil=a("32758"),bim=a(ak),bin=a("33886"),bio=a(an),bip=a("34999"),biq=a(T),bir=a(HV),bis=a(T),bit=a("3259"),biu=a(HV),biv=a(p),biw=a("22380"),bix=a("27146"),biy=a(x),biz=a("29595"),biA=a(ab),biB=a("30819"),biC=a(ak),biD=a("32058"),biE=a(an),biF=a("33282"),biG=a(T),biH=a(AM),biI=a(T),biJ=a("3100"),biK=a(AM),biM=[0,a(c),aY,10,aY,14,[0,a(z),[0,a(t),[0,a(d),0]]]],bhZ=[0,a(V),H0,5,H0,64,[0,a(b_),[0,a(bs),[0,a(R),0]]]],bhd=a(p),bhe=a("27956"),bhf=a("33691"),bhg=a(x),bhh=a("36224"),bhi=a(ab),bhj=a("37236"),bhk=a(ak),bhl=a("38283"),bhm=a(an),bhn=a("39311"),bho=a(T),bhp=a(zp),bhq=a(T),bhr=a("3496"),bhs=a(zp),bht=a(p),bhu=a("24526"),bhv=a("30065"),bhw=a(x),bhx=a("32548"),bhy=a(ab),bhz=a("33675"),bhA=a(ak),bhB=a(L5),bhC=a(an),bhD=a("35979"),bhE=a(T),bhF=a(IJ),bhG=a(T),bhH=a("3350"),bhI=a(IJ),bhJ=a(p),bhK=a("23007"),bhL=a("27906"),bhM=a(x),bhN=a("30424"),bhO=a(ab),bhP=a("31682"),bhQ=a(ak),bhR=a(Ht),bhS=a(an),bhT=a("34214"),bhU=a(T),bhV=a(Lg),bhW=a(T),bhX=a("3187"),bhY=a(Lg),bh0=[0,a(c),aY,10,aY,14,[0,a(z),[0,a(t),[0,a(d),0]]]],bhb=[0,a(V),Go,5,Go,64,[0,a(b_),[0,a(bs),[0,a(R),0]]]],bgr=a(p),bgs=a("28728"),bgt=a("34621"),bgu=a(x),bgv=a("37224"),bgw=a(ab),bgx=a("38264"),bgy=a(ak),bgz=a(y$),bgA=a(an),bgB=a("40396"),bgC=a(T),bgD=a(GS),bgE=a(T),bgF=a("3592"),bgG=a(GS),bgH=a(p),bgI=a("25203"),bgJ=a("30895"),bgK=a(x),bgL=a("33446"),bgM=a(ab),bgN=a("34604"),bgO=a(ak),bgP=a("35796"),bgQ=a(an),bgR=a("36972"),bgS=a(T),bgT=a(D8),bgU=a(T),bgV=a("3442"),bgW=a(D8),bgX=a(p),bgY=a("23642"),bgZ=a("28676"),bg0=a(x),bg1=a(yr),bg2=a(ab),bg3=a("32556"),bg4=a(ak),bg5=a("33866"),bg6=a(an),bg7=a("35158"),bg8=a(T),bg9=a(FQ),bg_=a(T),bg$=a("3275"),bha=a(FQ),bhc=[0,a(c),aY,10,aY,14,[0,a(z),[0,a(t),[0,a(d),0]]]],bgp=[0,a(V),Ma,5,Ma,64,[0,a(b_),[0,a(bs),[0,a(R),0]]]],bfF=a(p),bfG=a("29575"),bfH=a("35642"),bfI=a(x),bfJ=a("38322"),bfK=a(ab),bfL=a("39393"),bfM=a(ak),bfN=a("40501"),bfO=a(an),bfP=a("41588"),bfQ=a(T),bfR=a(KH),bfS=a(T),bfT=a("3698"),bfU=a(KH),bfV=a(p),bfW=a("25946"),bfX=a("31806"),bfY=a(x),bfZ=a("34433"),bf0=a(ab),bf1=a("35625"),bf2=a(ak),bf3=a("36852"),bf4=a(an),bf5=a("38063"),bf6=a(T),bf7=a(Ix),bf8=a(T),bf9=a("3544"),bf_=a(Ix),bf$=a(p),bga=a("24339"),bgb=a("29522"),bgc=a(x),bgd=a("32186"),bge=a(ab),bgf=a("33516"),bgg=a(ak),bgh=a(L5),bgi=a(an),bgj=a("36195"),bgk=a(T),bgl=a(Dv),bgm=a(T),bgn=a("3372"),bgo=a(Dv),bgq=[0,a(c),aY,10,aY,14,[0,a(z),[0,a(t),[0,a(d),0]]]],bfD=[0,a(V),sQ,5,sQ,64,[0,a(b_),[0,a(bs),[0,a(R),0]]]],beT=a(p),beU=a("29670"),beV=a("35757"),beW=a(x),beX=a("38445"),beY=a(ab),beZ=a("39519"),be0=a(ak),be1=a("40601"),be2=a(an),be3=a("41721"),be4=a(T),be5=a(CL),be6=a(T),be7=a("3710"),be8=a(CL),be9=a(p),be_=a("26029"),be$=a("31908"),bfa=a(x),bfb=a("34643"),bfc=a(ab),bfd=a("35739"),bfe=a(ak),bff=a("36970"),bfg=a(an),bfh=a("38185"),bfi=a(T),bfj=a(I1),bfk=a(T),bfl=a("3555"),bfm=a(I1),bfn=a(p),bfo=a("24417"),bfp=a("29616"),bfq=a(x),bfr=a("32289"),bfs=a(ab),bft=a(HW),bfu=a(ak),bfv=a("34977"),bfw=a(an),bfx=a("36311"),bfy=a(T),bfz=a(Il),bfA=a(T),bfB=a("3383"),bfC=a(Il),bfE=[0,a(c),aY,10,aY,14,[0,a(z),[0,a(t),[0,a(d),0]]]],beR=[0,a(V),FJ,5,FJ,64,[0,a(b_),[0,a(bs),[0,a(R),0]]]],bd7=a(p),bd8=a("29996"),bd9=a("36149"),bd_=a(x),bd$=a("38868"),bea=a(ab),beb=a("39954"),bec=a(ak),bed=a("41078"),bee=a(an),bef=a("42180"),beg=a(T),beh=a(Bk),bei=a(T),bej=a("3751"),bek=a(Bk),bel=a(p),bem=a("26315"),ben=a("32259"),beo=a(x),bep=a("34923"),beq=a(ab),ber=a("36132"),bes=a(ak),bet=a("37373"),beu=a(an),bev=a("38605"),bew=a(T),bex=a(KQ),bey=a(T),bez=a("3594"),beA=a(KQ),beB=a(p),beC=a("24686"),beD=a("29942"),beE=a(x),beF=a("32644"),beG=a(ab),beH=a("33993"),beI=a(ak),beJ=a("35362"),beK=a(an),beL=a("36710"),beM=a(T),beN=a(AC),beO=a(T),beP=a("3420"),beQ=a(AC),beS=[0,a(c),aY,10,aY,14,[0,a(z),[0,a(t),[0,a(d),0]]]],bd5=[0,a(V),I2,5,I2,64,[0,a(b_),[0,a(bs),[0,a(R),0]]]],bdj=a(p),bdk=a("30296"),bdl=a("36510"),bdm=a(x),bdn=a("39257"),bdo=a(ab),bdp=a("40354"),bdq=a(ak),bdr=a("41489"),bds=a(an),bdt=a("42602"),bdu=a(T),bdv=a(FA),bdw=a(T),bdx=a("3789"),bdy=a(FA),bdz=a(p),bdA=a("26578"),bdB=a("32582"),bdC=a(x),bdD=a("35272"),bdE=a(ab),bdF=a("36493"),bdG=a(ak),bdH=a("37751"),bdI=a(an),bdJ=a("38991"),bdK=a(T),bdL=a(GK),bdM=a(T),bdN=a("3630"),bdO=a(GK),bdP=a(p),bdQ=a("24933"),bdR=a("30241"),bdS=a(x),bdT=a("32970"),bdU=a(ab),bdV=a("34333"),bdW=a(ak),bdX=a("35716"),bdY=a(an),bdZ=a("37077"),bd0=a(T),bd1=a(wX),bd2=a(T),bd3=a("3454"),bd4=a(wX),bd6=[0,a(c),aY,10,aY,14,[0,a(z),[0,a(t),[0,a(d),0]]]],bdh=[0,a(V),Ja,5,Ja,64,[0,a(b_),[0,a(bs),[0,a(R),0]]]],bcx=a(p),bcy=a("30947"),bcz=a("37295"),bcA=a(x),bcB=a("40101"),bcC=a(ab),bcD=a("41222"),bcE=a(ak),bcF=a("42381"),bcG=a(an),bcH=a("43518"),bcI=a(T),bcJ=a(Kd),bcK=a(T),bcL=a("3870"),bcM=a(Kd),bcN=a(p),bcO=a("27149"),bcP=a("33283"),bcQ=a(x),bcR=a("36030"),bcS=a(ab),bcT=a("37278"),bcU=a(ak),bcV=a("38563"),bcW=a(an),bcX=a("39829"),bcY=a(T),bcZ=a("42649"),bc0=a(T),bc1=a("3708"),bc2=a("42659"),bc3=a(p),bc4=a("25469"),bc5=a("30891"),bc6=a(x),bc7=a("33679"),bc8=a(ab),bc9=a("35071"),bc_=a(ak),bc$=a("36484"),bda=a(an),bdb=a("37874"),bdc=a(T),bdd=a(Ct),bde=a(T),bdf=a("3528"),bdg=a(Ct),bdi=[0,a(c),aY,10,aY,14,[0,a(z),[0,a(t),[0,a(d),0]]]],bcv=[0,a(V),x_,5,x_,64,[0,a(b_),[0,a(bs),[0,a(R),0]]]],bbL=a(p),bbM=a("31123"),bbN=a("37508"),bbO=a(x),bbP=a("40330"),bbQ=a(ab),bbR=a("41457"),bbS=a(ak),bbT=a("42623"),bbU=a(an),bbV=a("43766"),bbW=a(T),bbX=a(EY),bbY=a(T),bbZ=a("3892"),bb0=a(EY),bb1=a(p),bb2=a("27304"),bb3=a("33473"),bb4=a(x),bb5=a("36235"),bb6=a(ab),bb7=a("37490"),bb8=a(ak),bb9=a("38783"),bb_=a(an),bb$=a("40056"),bca=a(T),bcb=a(BV),bcc=a(T),bcd=a("3729"),bce=a(BV),bcf=a(p),bcg=a("25614"),bch=a("31067"),bci=a(x),bcj=a("33871"),bck=a(ab),bcl=a("35271"),bcm=a(ak),bcn=a("36692"),bco=a(an),bcp=a("38090"),bcq=a(T),bcr=a(zU),bcs=a(T),bct=a("3548"),bcu=a(zU),bcw=[0,a(c),aY,10,aY,14,[0,a(z),[0,a(t),[0,a(d),0]]]],bbJ=[0,a(V),wP,5,wP,64,[0,a(b_),[0,a(bs),[0,a(R),0]]]],baZ=a(p),ba0=a("31148"),ba1=a("37538"),ba2=a(x),ba3=a("40362"),ba4=a(ab),ba5=a("41490"),ba6=a(ak),ba7=a("42657"),ba8=a(an),ba9=a("43801"),ba_=a(T),ba$=a(yp),bba=a(T),bbb=a("3895"),bbc=a(yp),bbd=a(p),bbe=a("27326"),bbf=a(Ez),bbg=a(x),bbh=a("36264"),bbi=a(ab),bbj=a("37520"),bbk=a(ak),bbl=a("38814"),bbm=a(an),bbn=a("40088"),bbo=a(T),bbp=a(Mc),bbq=a(T),bbr=a("3732"),bbs=a(Mc),bbt=a(p),bbu=a("25634"),bbv=a("31092"),bbw=a(x),bbx=a("33898"),bby=a(ab),bbz=a("35299"),bbA=a(ak),bbB=a("36721"),bbC=a(an),bbD=a("38120"),bbE=a(T),bbF=a(Ik),bbG=a(T),bbH=a("3551"),bbI=a(Ik),bbK=[0,a(c),aY,10,aY,14,[0,a(z),[0,a(t),[0,a(d),0]]]],baX=[0,a(V),Bg,5,Bg,64,[0,a(b_),[0,a(bs),[0,a(R),0]]]],bab=a(p),bac=a("31382"),bad=a("37820"),bae=a(x),baf=a("40665"),bag=a(ab),bah=a("41801"),bai=a(ak),baj=a("42977"),bak=a(an),bal=a("44130"),bam=a(T),ban=a(Ag),bao=a(T),bap=a("3924"),baq=a(Ag),bar=a(p),bas=a("27531"),bat=a("33751"),bau=a(x),bav=a("36536"),baw=a(ab),bax=a("37801"),bay=a(ak),baz=a("39105"),baA=a(an),baB=a("40389"),baC=a(T),baD=a(F8),baE=a(T),baF=a("3760"),baG=a(F8),baH=a(p),baI=a("25826"),baJ=a("31325"),baK=a(x),baL=a("34152"),baM=a(ab),baN=a("35564"),baO=a(ak),baP=a("36996"),baQ=a(an),baR=a("38406"),baS=a(T),baT=a(zY),baU=a(T),baV=a("3578"),baW=a(zY),baY=[0,a(c),aY,10,aY,14,[0,a(z),[0,a(t),[0,a(d),0]]]],a$$=[0,a(V),C_,5,C_,33,[0,a(b_),[0,a(bs),[0,a(R),0]]]],a$p=a(p),a$q=a("31476"),a$r=a("37933"),a$s=a(x),a$t=a("40787"),a$u=a(ab),a$v=a("41927"),a$w=a(ak),a$x=a("43106"),a$y=a(an),a$z=a("44262"),a$A=a(T),a$B=a(xL),a$C=a(T),a$D=a("3936"),a$E=a(xL),a$F=a(p),a$G=a("27614"),a$H=a("33853"),a$I=a(x),a$J=a("36646"),a$K=a(ab),a$L=a("37915"),a$M=a(ak),a$N=a("39222"),a$O=a(an),a$P=a("40510"),a$Q=a(T),a$R=a(DY),a$S=a(T),a$T=a("3771"),a$U=a(DY),a$V=a(p),a$W=a("25904"),a$X=a("31419"),a$Y=a(x),a$Z=a("34255"),a$0=a(ab),a$1=a("35670"),a$2=a(ak),a$3=a("37107"),a$4=a(an),a$5=a("38521"),a$6=a(T),a$7=a(Mm),a$8=a(T),a$9=a("3588"),a$_=a(Mm),baa=[0,a(c),aY,10,aY,14,[0,a(z),[0,a(t),[0,a(d),0]]]],bqB=[0,a(c),aY,10,aY,14,[0,a(z),[0,a(t),[0,a(d),0]]]],a$o=[0,a(c),aY,10,aY,14,[0,a(z),[0,a(t),[0,a(d),0]]]],a$l=[0,a(C),DL,14,DL,36,[0,a(dn),[0,a(aJ),[0,a(aP),[0,a(aM),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],a$j=a(p),a$k=a(p),a$m=[0,a(c),jO,10,jO,32,[0,a(z),[0,a(t),[0,a(d),0]]]],a$i=[0,a(c),jO,10,jO,32,[0,a(z),[0,a(t),[0,a(d),0]]]],a$e=[0,a(V),zL,5,zL,16,[0,a(Di),[0,a(bs),[0,a(R),0]]]],a$b=a(hk),a$c=a(ry),a$d=a(fz),a$f=[0,a(c),ie,11,ie,38,[0,a(z),[0,a(t),[0,a(d),0]]]],a$a=[0,a(V),I9,14,I9,41,[0,a("Article 34"),[0,a(bs),[0,a(R),0]]]],a_8=a(p),a_9=a(fz),a__=a(hk),a_$=a(fz),a_2=[0,a(c),EJ,14,EJ,50,[0,a(z),[0,a(t),[0,a(d),0]]]],a_W=[0,a(C),H3,14,H3,64,[0,a(dn),[0,a(aJ),[0,a(aP),[0,a(aM),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],a_S=[0,a(C),FX,14,FX,59,[0,a(dn),[0,a(aJ),[0,a(aP),[0,a(aM),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],a_O=[0,a(V),Fa,14,Fa,33,[0,a(Cs),[0,a(bs),[0,a(R),0]]]],a_N=a(AI),a_J=[0,a(V),B4,14,B4,33,[0,a(J5),[0,a(bs),[0,a(R),0]]]],a_I=a(sn),a_E=[0,a(V),z7,14,z7,41,[0,a(Cs),[0,a(bs),[0,a(R),0]]]],a_D=a("390000"),a_z=[0,a(V),LU,14,LU,41,[0,a(J5),[0,a(bs),[0,a(R),0]]]],a_y=a(sA),a_u=[0,a(V),LX,14,LX,41,[0,a("Article 36"),[0,a(bs),[0,a(R),0]]]],a_t=a(iI),a_p=[0,a(f$),s3,14,s3,36,[0,a(Kk),[0,a(zJ),0]]],a_n=a(Fe),a_o=a(eP),a_j=[0,a(V),yV,14,yV,40,[0,a("Article 35"),[0,a(bs),[0,a(R),0]]]],a_i=a(jX),a_k=[0,a(c),o8,11,o8,37,[0,a(z),[0,a(t),[0,a(d),0]]]],a_h=[0,a(c),o8,11,o8,37,[0,a(z),[0,a(t),[0,a(d),0]]]],a_l=[0,a(S),[0,a("montant_forfaitaire_d842_6"),0]],a_q=[0,a(c),lX,11,lX,33,[0,a(z),[0,a(t),[0,a(d),0]]]],a_m=[0,a(c),lX,11,lX,33,[0,a(z),[0,a(t),[0,a(d),0]]]],a_r=[0,a(S),[0,a(Ej),0]],a_v=[0,a(c),nI,11,nI,38,[0,a(z),[0,a(t),[0,a(d),0]]]],a_s=[0,a(c),nI,11,nI,38,[0,a(z),[0,a(t),[0,a(d),0]]]],a_w=[0,a(S),[0,a("montant_minimal_aide_d842_6"),0]],a_A=[0,a(c),nY,11,nY,38,[0,a(z),[0,a(t),[0,a(d),0]]]],a_x=[0,a(c),nY,11,nY,38,[0,a(z),[0,a(t),[0,a(d),0]]]],a_B=[0,a(S),[0,a("montant_forfaitaire_d842_11"),0]],a_F=[0,a(c),kx,11,kx,38,[0,a(z),[0,a(t),[0,a(d),0]]]],a_C=[0,a(c),kx,11,kx,38,[0,a(z),[0,a(t),[0,a(d),0]]]],a_G=[0,a(S),[0,a("montant_forfaitaire_d842_12"),0]],a_K=[0,a(c),l2,11,l2,30,[0,a(z),[0,a(t),[0,a(d),0]]]],a_H=[0,a(c),l2,11,l2,30,[0,a(z),[0,a(t),[0,a(d),0]]]],a_L=[0,a(S),[0,a("coefficient_d842_11"),0]],a_P=[0,a(c),mF,11,mF,30,[0,a(z),[0,a(t),[0,a(d),0]]]],a_M=[0,a(c),mF,11,mF,30,[0,a(z),[0,a(t),[0,a(d),0]]]],a_Q=[0,a(S),[0,a("coefficient_d842_12"),0]],a_T=[0,a(c),pL,3,pL,22,[0,a(z),[0,a(t),[0,a(d),0]]]],a_U=[0,a(S),[0,a(my),0]],a_R=[0,a(c),pD,10,pD,35,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],a_X=[0,a(c),pL,3,pL,22,[0,a(z),[0,a(t),[0,a(d),0]]]],a_Y=[0,a(S),[0,a(o5),0]],a_V=[0,a(c),ml,10,ml,40,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],a_Z=[0,a(S),[0,a(gS),[0,a(ks),0]]],a_0=[0,a(S),[0,a(gS),[0,a(ks),0]]],a_3=[0,a(c),z1,3,z1,25,[0,a(z),[0,a(t),[0,a(d),0]]]],a_4=[0,a(S),[0,a(j7),0]],a_1=[0,a(c),eC,10,eC,23,[0,a(dQ),[0,a(j),[0,a(d),0]]]],a_5=[0,a(S),[0,a(eW),[0,a(af),0]]],a_6=[0,a(S),[0,a(eW),[0,a(af),0]]],a$g=[0,a(c),ie,11,ie,38,[0,a(z),[0,a(t),[0,a(d),0]]]],a_7=[0,a(c),ie,11,ie,38,[0,a(z),[0,a(t),[0,a(d),0]]]],a$h=[0,a(S),[0,a(E4),0]],a$n=[0,a(S),[0,a(ag),0]],bqC=[0,a(S),[0,a(dO),0]],bqI=[0,a(c),gD,11,gD,42,[0,a(z),[0,a(t),[0,a(d),0]]]],bqD=[0,a(c),gD,11,gD,42,[0,a(z),[0,a(t),[0,a(d),0]]]],bqJ=[0,a(S),[0,a("seuil_minimal_ressources_m\xc3\xa9nage"),0]],bqN=[0,a(S),[0,a(cT),0]],bq6=[0,a(S),[0,a(co),0]],brc=[0,a(c),i6,10,i6,15,[0,a(z),[0,a(t),[0,a(d),0]]]],bq7=[0,a(c),i6,10,i6,15,[0,a(z),[0,a(t),[0,a(d),0]]]],brd=[0,a(S),[0,a(Kf),0]],brC=[0,a(c),ik,11,ik,36,[0,a(z),[0,a(t),[0,a(d),0]]]],bre=[0,a(c),ik,11,ik,36,[0,a(z),[0,a(t),[0,a(d),0]]]],brD=[0,a(S),[0,a("plafond_mensualit\xc3\xa9_d842_6"),0]],brG=[0,a(c),iJ,3,iJ,36,[0,a(z),[0,a(t),[0,a(d),0]]]],brH=[0,a(S),[0,a(ob),0]],brE=[0,a(c),fI,10,fI,37,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],brK=[0,a(c),iJ,3,iJ,36,[0,a(z),[0,a(t),[0,a(d),0]]]],brL=[0,a(S),[0,a(nk),0]],brI=[0,a(c),gy,10,gy,31,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],brO=[0,a(c),iJ,3,iJ,36,[0,a(z),[0,a(t),[0,a(d),0]]]],brP=[0,a(S),[0,a(n8),0]],brM=[0,a(c),go,10,go,32,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],brQ=[0,a(S),[0,a(gB),[0,a(ei),0]]],brR=[0,a(S),[0,a(gB),[0,a(ei),0]]],brW=[0,a(c),cR,3,cR,28,[0,a(z),[0,a(t),[0,a(d),0]]]],brX=[0,a(S),[0,a(JW),0]],brS=[0,a(c),iG,10,iG,25,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],br0=[0,a(c),cR,3,cR,28,[0,a(z),[0,a(t),[0,a(d),0]]]],br1=[0,a(S),[0,a(Fi),0]],brY=[0,a(c),ix,10,ix,37,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],br4=[0,a(c),cR,3,cR,28,[0,a(z),[0,a(t),[0,a(d),0]]]],br5=[0,a(S),[0,a(Ef),0]],br2=[0,a(c),hq,10,hq,35,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],br8=[0,a(c),cR,3,cR,28,[0,a(z),[0,a(t),[0,a(d),0]]]],br9=[0,a(S),[0,a(B0),0]],br6=[0,a(c),i5,10,i5,40,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],bsa=[0,a(c),cR,3,cR,28,[0,a(z),[0,a(t),[0,a(d),0]]]],bsb=[0,a(S),[0,a(J9),0]],br_=[0,a(c),iD,10,iD,14,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],bse=[0,a(c),cR,3,cR,28,[0,a(z),[0,a(t),[0,a(d),0]]]],bsf=[0,a(S),[0,a(D2),0]],bsc=[0,a(c),iF,10,iF,23,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],bsj=[0,a(c),cR,3,cR,28,[0,a(z),[0,a(t),[0,a(d),0]]]],bsk=[0,a(S),[0,a(xB),0]],bsg=[0,a(c),iv,10,iv,19,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],bsr=[0,a(S),[0,a(oN),[0,a(_),0]]],bss=[0,a(S),[0,a(oN),[0,a(_),0]]],bsx=[0,a(c),iV,11,iV,47,[0,a(z),[0,a(t),[0,a(d),0]]]],bst=[0,a(c),iV,11,iV,47,[0,a(z),[0,a(t),[0,a(d),0]]]],bsy=[0,a(S),[0,a("seuil_minimal_d\xc3\xa9pense_nette_minimale"),0]],bsB=[0,a(c),mc,11,mc,30,[0,a(z),[0,a(t),[0,a(d),0]]]],bsz=[0,a(c),mc,11,mc,30,[0,a(z),[0,a(t),[0,a(d),0]]]],bsC=[0,a(S),[0,a(L4),0]],bsF=[0,a(c),nT,11,nT,30,[0,a(z),[0,a(t),[0,a(d),0]]]],bsD=[0,a(c),nT,11,nT,30,[0,a(z),[0,a(t),[0,a(d),0]]]],bsG=[0,a(S),[0,a(zv),0]],bsJ=[0,a(c),mB,11,mB,38,[0,a(z),[0,a(t),[0,a(d),0]]]],bsH=[0,a(c),mB,11,mB,38,[0,a(z),[0,a(t),[0,a(d),0]]]],bsK=[0,a(S),[0,a(zi),0]],bsX=[0,a(S),[0,a(cS),0]],bs0=[0,a(c),nd,10,nd,29,[0,a(z),[0,a(t),[0,a(d),0]]]],bsY=[0,a(c),nd,10,nd,29,[0,a(z),[0,a(t),[0,a(d),0]]]],bs1=[0,a(S),[0,a(fS),0]],btt=[0,a(S),[0,a(bn),0]],bud=[0,a(S),[0,a(a4),0]],buq=[0,a(S),[0,a(bD),0]],a_e=[0,a(C),Ei,14,Ei,36,[0,a(c7),[0,a(aV),[0,a(aP),[0,a(aM),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],a97=[0,a(Y),[0,a(a4),[0,a(P),0]]],a98=[0,a(Y),[0,a(a4),0]],a99=[0,a(Y),[0,a(a4),[0,a(O),0]]],a9_=[0,a(Y),[0,a(a4),0]],a9$=a(p),a_a=[0,a(Y),[0,a(a4),[0,a(P),0]]],a_b=[0,a(Y),[0,a(a4),0]],a_c=[0,a(Y),[0,a(a4),[0,a(O),0]]],a_d=[0,a(Y),[0,a(a4),0]],a_f=[0,a(c),ms,10,ms,25,[0,a(G),[0,a(t),[0,a(d),0]]]],a96=[0,a(c),ms,10,ms,25,[0,a(G),[0,a(t),[0,a(d),0]]]],a93=[0,a(C),Jc,14,Jc,36,[0,a(c7),[0,a(aV),[0,a(aP),[0,a(aM),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],a9l=a(p),a9m=[0,a(Y),[0,a(bT),[0,a(P),0]]],a9n=[0,a(Y),[0,a(bT),0]],a9o=[0,a(Y),[0,a(bT),[0,a(O),0]]],a9p=[0,a(Y),[0,a(bT),0]],a9q=[0,a(af),[0,a(al),[0,a(P),0]]],a9r=[0,a(af),[0,a(al),0]],a9s=[0,a(af),[0,a(al),[0,a(O),0]]],a9t=[0,a(af),[0,a(al),0]],a9u=a(e1),a9v=[0,a(Y),[0,a(bT),[0,a(P),0]]],a9w=[0,a(Y),[0,a(bT),0]],a9x=[0,a(Y),[0,a(bT),[0,a(O),0]]],a9y=[0,a(Y),[0,a(bT),0]],a9z=[0,a(af),[0,a(al),[0,a(P),0]]],a9A=[0,a(af),[0,a(al),0]],a9B=[0,a(af),[0,a(al),[0,a(O),0]]],a9C=[0,a(af),[0,a(al),0]],a9D=[0,a(Y),[0,a(bT),[0,a(P),0]]],a9E=[0,a(Y),[0,a(bT),0]],a9F=[0,a(Y),[0,a(bT),[0,a(O),0]]],a9G=[0,a(Y),[0,a(bT),0]],a9H=[0,a(Y),[0,a(bT),[0,a(P),0]]],a9I=[0,a(Y),[0,a(bT),0]],a9J=[0,a(Y),[0,a(bT),[0,a(O),0]]],a9K=[0,a(Y),[0,a(bT),0]],a9L=[0,a(af),[0,a(al),[0,a(P),0]]],a9M=[0,a(af),[0,a(al),0]],a9N=[0,a(af),[0,a(al),[0,a(O),0]]],a9O=[0,a(af),[0,a(al),0]],a9P=a(e1),a9Q=[0,a(Y),[0,a(bT),[0,a(P),0]]],a9R=[0,a(Y),[0,a(bT),0]],a9S=[0,a(Y),[0,a(bT),[0,a(O),0]]],a9T=[0,a(Y),[0,a(bT),0]],a9U=[0,a(af),[0,a(al),[0,a(P),0]]],a9V=[0,a(af),[0,a(al),0]],a9W=[0,a(af),[0,a(al),[0,a(O),0]]],a9X=[0,a(af),[0,a(al),0]],a9Y=[0,a(Y),[0,a(bT),[0,a(P),0]]],a9Z=[0,a(Y),[0,a(bT),0]],a90=[0,a(Y),[0,a(bT),[0,a(O),0]]],a91=[0,a(Y),[0,a(bT),0]],a92=a(p),a94=[0,a(c),nV,10,nV,40,[0,a(G),[0,a(t),[0,a(d),0]]]],a9k=[0,a(c),nV,10,nV,40,[0,a(G),[0,a(t),[0,a(d),0]]]],a9h=[0,a(C),yw,14,yw,36,[0,a(c7),[0,a(aV),[0,a(aP),[0,a(aM),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],a8$=[0,a(Y),[0,a(bn),[0,a(P),0]]],a9a=[0,a(Y),[0,a(bn),0]],a9b=[0,a(Y),[0,a(bn),[0,a(O),0]]],a9c=[0,a(Y),[0,a(bn),0]],a9d=[0,a(Y),[0,a(bn),[0,a(P),0]]],a9e=[0,a(Y),[0,a(bn),0]],a9f=[0,a(Y),[0,a(bn),[0,a(O),0]]],a9g=[0,a(Y),[0,a(bn),0]],a9i=[0,a(c),ov,10,ov,19,[0,a(G),[0,a(t),[0,a(d),0]]]],a8_=[0,a(c),ov,10,ov,19,[0,a(G),[0,a(t),[0,a(d),0]]]],a87=[0,a(C),DI,14,DI,36,[0,a(c7),[0,a(aV),[0,a(aP),[0,a(aM),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],a8H=a(p),a8I=[0,a(Y),[0,a(ag),[0,a(P),0]]],a8J=[0,a(Y),[0,a(ag),0]],a8K=[0,a(Y),[0,a(ag),[0,a(O),0]]],a8L=[0,a(Y),[0,a(ag),0]],a8M=[0,a(Y),[0,a(cS),[0,a(P),0]]],a8N=[0,a(Y),[0,a(cS),0]],a8O=[0,a(Y),[0,a(cS),[0,a(O),0]]],a8P=[0,a(Y),[0,a(cS),0]],a8Q=[0,a(Y),[0,a(ag),[0,a(P),0]]],a8R=[0,a(Y),[0,a(ag),0]],a8S=[0,a(Y),[0,a(ag),[0,a(O),0]]],a8T=[0,a(Y),[0,a(ag),0]],a8U=a(p),a8V=[0,a(Y),[0,a(ag),[0,a(P),0]]],a8W=[0,a(Y),[0,a(ag),0]],a8X=[0,a(Y),[0,a(ag),[0,a(O),0]]],a8Y=[0,a(Y),[0,a(ag),0]],a8Z=[0,a(Y),[0,a(cS),[0,a(P),0]]],a80=[0,a(Y),[0,a(cS),0]],a81=[0,a(Y),[0,a(cS),[0,a(O),0]]],a82=[0,a(Y),[0,a(cS),0]],a83=[0,a(Y),[0,a(ag),[0,a(P),0]]],a84=[0,a(Y),[0,a(ag),0]],a85=[0,a(Y),[0,a(ag),[0,a(O),0]]],a86=[0,a(Y),[0,a(ag),0]],a88=[0,a(c),jZ,10,jZ,32,[0,a(G),[0,a(t),[0,a(d),0]]]],a8G=[0,a(c),jZ,10,jZ,32,[0,a(G),[0,a(t),[0,a(d),0]]]],a8D=[0,a(C),K6,14,K6,33,[0,a(c7),[0,a(aV),[0,a(aP),[0,a(aM),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],a8z=[0,a(C),y5,14,y5,47,[0,a(Ck),[0,a(aV),[0,a(aP),[0,a(aM),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],a8q=[0,a(Y),[0,a(cT),[0,a(P),0]]],a8r=[0,a(Y),[0,a(cT),0]],a8s=[0,a(Y),[0,a(cT),[0,a(O),0]]],a8t=[0,a(Y),[0,a(cT),0]],a8u=[0,a(Y),[0,a(cT),[0,a(P),0]]],a8v=[0,a(Y),[0,a(cT),0]],a8w=[0,a(Y),[0,a(cT),[0,a(O),0]]],a8x=[0,a(Y),[0,a(cT),0]],a8y=a(p),a8A=[0,a(c),nl,11,nl,44,[0,a(G),[0,a(t),[0,a(d),0]]]],a8p=[0,a(c),nl,11,nl,44,[0,a(G),[0,a(t),[0,a(d),0]]]],a8m=[0,a(C),wW,14,wW,27,[0,a(c7),[0,a(aV),[0,a(aP),[0,a(aM),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],a8i=[0,a(C),EF,14,EF,36,[0,a(Ck),[0,a(aV),[0,a(aP),[0,a(aM),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],a8j=[0,a(c),lV,11,lV,33,[0,a(G),[0,a(t),[0,a(d),0]]]],a8h=[0,a(c),lV,11,lV,33,[0,a(G),[0,a(t),[0,a(d),0]]]],a8e=[0,a(C),AQ,14,AQ,41,[0,a(c7),[0,a(aV),[0,a(aP),[0,a(aM),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],a7_=[0,a(C),zs,14,zs,70,[0,a(c7),[0,a(aV),[0,a(aP),[0,a(aM),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],a76=[0,a(C),y0,14,y0,69,[0,a(c7),[0,a(aV),[0,a(aP),[0,a(aM),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],a72=[0,a(C),K7,14,K7,75,[0,a(c7),[0,a(aV),[0,a(aP),[0,a(aM),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],a7Y=[0,a(C),DC,14,DC,36,[0,a(c7),[0,a(aV),[0,a(aP),[0,a(aM),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],a7W=a(p),a7X=a(p),a7Z=[0,a(c),jY,10,jY,32,[0,a(G),[0,a(t),[0,a(d),0]]]],a7V=[0,a(c),jY,10,jY,32,[0,a(G),[0,a(t),[0,a(d),0]]]],a7R=[0,a(V),GD,6,GD,74,[0,a(nW),[0,a(gJ),[0,a(R),0]]]],a7P=a("8414"),a7Q=a("13100"),a7S=[0,a(c),dR,10,dR,27,[0,a(G),[0,a(t),[0,a(d),0]]]],a7N=[0,a(V),4342,6,4343,38,[0,a(nW),[0,a(gJ),[0,a(R),0]]]],a7L=a("20640"),a7M=a("32073"),a7O=[0,a(c),dR,10,dR,27,[0,a(G),[0,a(t),[0,a(d),0]]]],a7I=[0,a(V),4360,6,4361,24,[0,a(nW),[0,a(gJ),[0,a(R),0]]]],a7G=a(C9),a7H=a(H4),a7J=[0,a(c),dR,10,dR,27,[0,a(G),[0,a(t),[0,a(d),0]]]],a7F=[0,a(V),4324,6,4325,41,[0,a(nW),[0,a(gJ),[0,a(R),0]]]],a7D=a(C9),a7E=a(H4),a7K=[0,a(c),dR,10,dR,27,[0,a(G),[0,a(t),[0,a(d),0]]]],a7z=[0,a(V),GC,14,GC,41,[0,a("Article 40"),[0,a(gJ),[0,a(R),0]]]],a7v=a(p),a7w=a(fz),a7x=a(hk),a7y=a(fz),a7p=[0,a(C),Iq,14,Iq,61,[0,a(c7),[0,a(aV),[0,a(aP),[0,a(aM),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],a7q=[0,a(c),c9,3,c9,28,[0,a(G),[0,a(t),[0,a(d),0]]]],a7r=[0,a(Y),[0,a(K9),0]],a7m=[0,a(c),JA,14,JA,49,[0,a(G),[0,a(t),[0,a(d),0]]]],a7i=[0,a(c),x8,14,x8,53,[0,a(G),[0,a(t),[0,a(d),0]]]],a7e=[0,a(c),tj,14,tj,44,[0,a(G),[0,a(t),[0,a(d),0]]]],a7a=[0,a(c),yF,14,yF,70,[0,a(G),[0,a(t),[0,a(d),0]]]],a68=[0,a(c),KO,14,KO,65,[0,a(G),[0,a(t),[0,a(d),0]]]],a64=[0,a(c),Ms,14,Ms,67,[0,a(G),[0,a(t),[0,a(d),0]]]],a60=[0,a(c),y4,14,y4,55,[0,a(G),[0,a(t),[0,a(d),0]]]],a6U=[0,a(c),AH,14,AH,50,[0,a(G),[0,a(t),[0,a(d),0]]]],a6O=[0,a(C),ys,14,ys,64,[0,a(c7),[0,a(aV),[0,a(aP),[0,a(aM),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],a6K=[0,a(C),HR,14,HR,59,[0,a(c7),[0,a(aV),[0,a(aP),[0,a(aM),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],a6G=[0,a(C),xA,14,xA,55,[0,a(c7),[0,a(aV),[0,a(aP),[0,a(aM),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],a6C=[0,a(V),AG,14,AG,51,[0,a("Article 44"),[0,a(gJ),[0,a(R),0]]]],a6B=a(sA),a6x=[0,a(V),mv,14,mv,41,[0,a("Article 41"),[0,a(gJ),[0,a(R),0]]]],a6w=a(jX),a6s=[0,a(V),Hy,14,Hy,42,[0,a("Article 42"),[0,a(gJ),[0,a(R),0]]]],a6r=a(iI),a6t=[0,a(c),og,11,og,39,[0,a(G),[0,a(t),[0,a(d),0]]]],a6q=[0,a(c),og,11,og,39,[0,a(G),[0,a(t),[0,a(d),0]]]],a6u=[0,a(Y),[0,a("montant_minimal_aide_d842_15"),0]],a6y=[0,a(c),oC,11,oC,38,[0,a(G),[0,a(t),[0,a(d),0]]]],a6v=[0,a(c),oC,11,oC,38,[0,a(G),[0,a(t),[0,a(d),0]]]],a6z=[0,a(Y),[0,a("montant_forfaitaire_d842_15"),0]],a6D=[0,a(c),oL,11,oL,48,[0,a(G),[0,a(t),[0,a(d),0]]]],a6A=[0,a(c),oL,11,oL,48,[0,a(G),[0,a(t),[0,a(d),0]]]],a6E=[0,a(Y),[0,a("montant_minimal_d\xc3\xa9pense_nette_d842_17"),0]],a6H=[0,a(c),iP,3,iP,22,[0,a(G),[0,a(t),[0,a(d),0]]]],a6I=[0,a(Y),[0,a(Je),0]],a6F=[0,a(c),nX,10,nX,31,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],a6L=[0,a(c),iP,3,iP,22,[0,a(G),[0,a(t),[0,a(d),0]]]],a6M=[0,a(Y),[0,a(my),0]],a6J=[0,a(c),mO,10,mO,35,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],a6P=[0,a(c),iP,3,iP,22,[0,a(G),[0,a(t),[0,a(d),0]]]],a6Q=[0,a(Y),[0,a(o5),0]],a6N=[0,a(c),n5,10,n5,40,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],a6R=[0,a(Y),[0,a(gS),[0,a(j5),0]]],a6S=[0,a(Y),[0,a(gS),[0,a(j5),0]]],a6V=[0,a(c),sB,3,sB,25,[0,a(G),[0,a(t),[0,a(d),0]]]],a6W=[0,a(Y),[0,a(j7),0]],a6T=[0,a(c),eC,10,eC,23,[0,a(dQ),[0,a(j),[0,a(d),0]]]],a6X=[0,a(Y),[0,a(eW),[0,a(af),0]]],a6Y=[0,a(Y),[0,a(eW),[0,a(af),0]]],a61=[0,a(c),c9,3,c9,28,[0,a(G),[0,a(t),[0,a(d),0]]]],a62=[0,a(Y),[0,a(JW),0]],a6Z=[0,a(c),iG,10,iG,25,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],a65=[0,a(c),c9,3,c9,28,[0,a(G),[0,a(t),[0,a(d),0]]]],a66=[0,a(Y),[0,a(Fi),0]],a63=[0,a(c),ix,10,ix,37,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],a69=[0,a(c),c9,3,c9,28,[0,a(G),[0,a(t),[0,a(d),0]]]],a6_=[0,a(Y),[0,a(Ef),0]],a67=[0,a(c),hq,10,hq,35,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],a7b=[0,a(c),c9,3,c9,28,[0,a(G),[0,a(t),[0,a(d),0]]]],a7c=[0,a(Y),[0,a(B0),0]],a6$=[0,a(c),i5,10,i5,40,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],a7f=[0,a(c),c9,3,c9,28,[0,a(G),[0,a(t),[0,a(d),0]]]],a7g=[0,a(Y),[0,a(J9),0]],a7d=[0,a(c),iD,10,iD,14,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],a7j=[0,a(c),c9,3,c9,28,[0,a(G),[0,a(t),[0,a(d),0]]]],a7k=[0,a(Y),[0,a(D2),0]],a7h=[0,a(c),iF,10,iF,23,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],a7n=[0,a(c),c9,3,c9,28,[0,a(G),[0,a(t),[0,a(d),0]]]],a7o=[0,a(Y),[0,a(xB),0]],a7l=[0,a(c),iv,10,iv,19,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],a7s=[0,a(Y),[0,a(oN),[0,a(_),0]]],a7t=[0,a(Y),[0,a(oN),[0,a(_),0]]],a7A=[0,a(c),pA,10,pA,37,[0,a(G),[0,a(t),[0,a(d),0]]]],a7u=[0,a(c),pA,10,pA,37,[0,a(G),[0,a(t),[0,a(d),0]]]],a7B=[0,a(Y),[0,a(E4),0]],a7T=[0,a(c),dR,10,dR,27,[0,a(G),[0,a(t),[0,a(d),0]]]],a7C=[0,a(c),dR,10,dR,27,[0,a(G),[0,a(t),[0,a(d),0]]]],a7U=[0,a(Y),[0,a("\xc3\xa9quivalence_loyer"),0]],a70=[0,a(Y),[0,a(ag),0]],a73=[0,a(c),iN,3,iN,36,[0,a(G),[0,a(t),[0,a(d),0]]]],a74=[0,a(Y),[0,a(ob),0]],a71=[0,a(c),fI,10,fI,37,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],a77=[0,a(c),iN,3,iN,36,[0,a(G),[0,a(t),[0,a(d),0]]]],a78=[0,a(Y),[0,a(nk),0]],a75=[0,a(c),gy,10,gy,31,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],a7$=[0,a(c),iN,3,iN,36,[0,a(G),[0,a(t),[0,a(d),0]]]],a8a=[0,a(Y),[0,a(n8),0]],a79=[0,a(c),go,10,go,32,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],a8b=[0,a(Y),[0,a(gB),[0,a(ei),0]]],a8c=[0,a(Y),[0,a(gB),[0,a(ei),0]]],a8f=[0,a(c),oQ,10,oQ,37,[0,a(G),[0,a(t),[0,a(d),0]]]],a8d=[0,a(c),oQ,10,oQ,37,[0,a(G),[0,a(t),[0,a(d),0]]]],a8g=[0,a(Y),[0,a(zi),0]],a8k=[0,a(Y),[0,a(cT),0]],a8n=[0,a(c),nn,10,nn,23,[0,a(G),[0,a(t),[0,a(d),0]]]],a8l=[0,a(c),nn,10,nn,23,[0,a(G),[0,a(t),[0,a(d),0]]]],a8o=[0,a(Y),[0,a("loyer_minimal"),0]],a8B=[0,a(Y),[0,a(cS),0]],a8E=[0,a(c),n2,10,n2,29,[0,a(G),[0,a(t),[0,a(d),0]]]],a8C=[0,a(c),n2,10,n2,29,[0,a(G),[0,a(t),[0,a(d),0]]]],a8F=[0,a(Y),[0,a(fS),0]],a89=[0,a(Y),[0,a(bn),0]],a9j=[0,a(Y),[0,a(bT),0]],a95=[0,a(Y),[0,a(a4),0]],a_g=[0,a(Y),[0,a(bD),0]],a6m=[0,a(C),JT,24,JT,43,[0,a(LW),[0,a(tC),[0,a(aP),[0,a(aM),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],a6l=a(p),a6n=[0,a(c),hV,10,hV,29,[0,a(N),[0,a(t),[0,a(d),0]]]],a6k=[0,a(c),sv,14,sv,33,[0,a(N),[0,a(t),[0,a(d),0]]]],a6f=[0,a(C),EX,24,EX,46,[0,a(LW),[0,a(tC),[0,a(aP),[0,a(aM),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],a6g=[0,a(c),h0,10,h0,32,[0,a(N),[0,a(t),[0,a(d),0]]]],a6e=[0,a(c),s0,14,s0,36,[0,a(N),[0,a(t),[0,a(d),0]]]],a6a=[0,a(aj),[0,a(bD),[0,a(P),0]]],a6b=[0,a(aj),[0,a(bD),0]],a6c=[0,a(aj),[0,a(bD),[0,a(O),0]]],a6d=[0,a(aj),[0,a(bD),0]],a6h=[0,a(c),h0,10,h0,32,[0,a(N),[0,a(t),[0,a(d),0]]]],a5$=[0,a(c),h0,10,h0,32,[0,a(N),[0,a(t),[0,a(d),0]]]],a56=[0,a(c),x9,14,x9,59,[0,a(N),[0,a(t),[0,a(d),0]]]],a52=[0,a(c),yo,14,yo,43,[0,a(N),[0,a(t),[0,a(d),0]]]],a5Y=[0,a(c),zo,14,zo,42,[0,a(N),[0,a(t),[0,a(d),0]]]],a5U=[0,a(c),834,5,835,63,[0,a(N),[0,a(t),[0,a(d),0]]]],a5Q=[0,a(c),s1,14,s1,53,[0,a(N),[0,a(t),[0,a(d),0]]]],a5M=[0,a(c),Jh,14,Jh,37,[0,a(N),[0,a(t),[0,a(d),0]]]],a5I=[0,a(c),rP,14,rP,63,[0,a(N),[0,a(t),[0,a(d),0]]]],a5E=[0,a(c),EV,14,EV,58,[0,a(N),[0,a(t),[0,a(d),0]]]],a5A=[0,a(c),kr,14,kr,46,[0,a(N),[0,a(t),[0,a(d),0]]]],a5w=[0,a(c),wY,14,wY,78,[0,a(N),[0,a(t),[0,a(d),0]]]],a5s=[0,a(c),sG,14,sG,60,[0,a(N),[0,a(t),[0,a(d),0]]]],a5n=[0,a(C),mv,5,mv,27,[0,a("Article D842-2"),[0,a(tC),[0,a(aP),[0,a(aM),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],a5l=a(pm),a5m=a(kA),a5o=[0,a(c),bM,3,bM,21,[0,a(N),[0,a(t),[0,a(d),0]]]],a5k=[0,a(c),zq,14,zq,48,[0,a(N),[0,a(t),[0,a(d),0]]]],a5p=[0,a(c),bM,3,bM,21,[0,a(N),[0,a(t),[0,a(d),0]]]],a5q=[0,a(cb),[0,a("calcul_apl_locatif.loyer_principal"),0]],a5j=[0,a(c),mC,10,mC,25,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],a5t=[0,a(c),bM,3,bM,21,[0,a(N),[0,a(t),[0,a(d),0]]]],a5u=[0,a(cb),[0,a("calcul_apl_locatif.ressources_m\xc3\xa9nage_arrondies"),0]],a5r=[0,a(c),kC,10,kC,37,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],a5x=[0,a(c),bM,3,bM,21,[0,a(N),[0,a(t),[0,a(d),0]]]],a5y=[0,a(cb),[0,a("calcul_apl_locatif.b\xc3\xa9n\xc3\xa9ficiaire_aide_adulte_ou_enfant_handicap\xc3\xa9s"),0]],a5v=[0,a(c),nr,10,nr,55,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],a5B=[0,a(c),bM,3,bM,21,[0,a(N),[0,a(t),[0,a(d),0]]]],a5C=[0,a(cb),[0,a("calcul_apl_locatif.date_courante"),0]],a5z=[0,a(c),l8,10,l8,23,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],a5F=[0,a(c),bM,3,bM,21,[0,a(N),[0,a(t),[0,a(d),0]]]],a5G=[0,a(cb),[0,a("calcul_apl_locatif.nombre_personnes_\xc3\xa0_charge"),0]],a5D=[0,a(c),mH,10,mH,35,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],a5J=[0,a(c),bM,3,bM,21,[0,a(N),[0,a(t),[0,a(d),0]]]],a5K=[0,a(cb),[0,a("calcul_apl_locatif.situation_familiale_calcul_apl"),0]],a5H=[0,a(c),pE,10,pE,40,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],a5N=[0,a(c),bM,3,bM,21,[0,a(N),[0,a(t),[0,a(d),0]]]],a5O=[0,a(cb),[0,a("calcul_apl_locatif.zone"),0]],a5L=[0,a(c),oV,10,oV,14,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],a5R=[0,a(c),bM,3,bM,21,[0,a(N),[0,a(t),[0,a(d),0]]]],a5S=[0,a(cb),[0,a("calcul_apl_locatif.logement_est_chambre"),0]],a5P=[0,a(c),o7,10,o7,30,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],a5V=[0,a(c),bM,3,bM,21,[0,a(N),[0,a(t),[0,a(d),0]]]],a5W=[0,a(cb),[0,a("calcul_apl_locatif.\xc3\xa2g\xc3\xa9es_ou_handicap_adultes_h\xc3\xa9berg\xc3\xa9es_on\xc3\xa9reux_particuliers"),0]],a5T=[0,a(c),pt,10,pt,66,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],a5Z=[0,a(c),bM,3,bM,21,[0,a(N),[0,a(t),[0,a(d),0]]]],a50=[0,a(cb),[0,a("calcul_apl_locatif.type_aide"),0]],a5X=[0,a(c),oU,10,oU,19,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],a53=[0,a(c),bM,3,bM,21,[0,a(N),[0,a(t),[0,a(d),0]]]],a54=[0,a(cb),[0,a("calcul_apl_locatif.colocation"),0]],a51=[0,a(c),oc,10,oc,20,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],a57=[0,a(c),bM,3,bM,21,[0,a(N),[0,a(t),[0,a(d),0]]]],a58=[0,a(cb),[0,a("calcul_apl_locatif.r\xc3\xa9duction_loyer_solidarit\xc3\xa9"),0]],a55=[0,a(c),pz,10,pz,36,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],a59=[0,a(cb),[0,a(D0),[0,a(aj),0]]],a5_=[0,a(cb),[0,a(D0),[0,a(aj),0]]],a6i=[0,a(cb),[0,a(a7),0]],a6o=[0,a(c),hV,10,hV,29,[0,a(N),[0,a(t),[0,a(d),0]]]],a6j=[0,a(c),hV,10,hV,29,[0,a(N),[0,a(t),[0,a(d),0]]]],a6p=[0,a(cb),[0,a(fS),0]],a5d=[0,a(l$),58,5,60,60,[0,a(hf),[0,a(ho),[0,a(eE),[0,a(aE),[0,a(am),[0,a(ai),0]]]]]]],a5e=[0,a(bO),41,10,41,22,[0,a(bQ),0]],a5c=[0,a(l$),47,5,48,78,[0,a(hf),[0,a(ho),[0,a(eE),[0,a(aE),[0,a(am),[0,a(ai),0]]]]]]],a5f=[0,a(bO),41,10,41,22,[0,a(bQ),0]],a5g=[0,a(bO),41,10,41,22,[0,a(bQ),0]],a5b=[0,a(bO),41,10,41,22,[0,a(bQ),0]],a5h=[0,a(bO),41,10,41,22,[0,a(bQ),0]],a5a=[0,a(bO),41,10,41,22,[0,a(bQ),0]],a48=[0,a(l$),66,5,69,85,[0,a(hf),[0,a(ho),[0,a(eE),[0,a(aE),[0,a(am),[0,a(ai),0]]]]]]],a49=[0,a(bO),42,10,42,29,[0,a(bQ),0]],a47=[0,a(bO),42,10,42,29,[0,a(bQ),0]],a4_=[0,a(bO),42,10,42,29,[0,a(bQ),0]],a46=[0,a(bO),42,10,42,29,[0,a(bQ),0]],a42=[0,a(sR),62,18,62,41,[0,a(yy),[0,a(ff),[0,a(hs),[0,a(ea),[0,a(dk),[0,a(ai),0]]]]]]],a40=a(pB),a41=a(o4),a43=[0,a(bO),43,11,43,27,[0,a(bQ),0]],a4Z=[0,a(sR),31,14,31,30,[0,a(nP),[0,a(m0),[0,a(eE),[0,a(aE),[0,a(dk),[0,a(ai),0]]]]]]],a4X=a(pB),a4Y=a(o4),a4M=[0,0],a4O=[1,0],a4P=[2,0],a4Q=[3,0],a4R=[4,0],a4S=[5,0],a4N=[0,a(l$),pj,5,dV,30,[0,a(Kb),[0,a(Hg),[0,a(kl),[0,a(ea),[0,a(am),[0,a(ai),0]]]]]]],a4T=[0,a(bO),45,10,45,33,[0,a(bQ),0]],a4L=[0,a(bO),45,10,45,33,[0,a(bQ),0]],a4F=[0,a(bO),52,14,52,28,[0,a(bQ),0]],a4B=[0,a(bO),53,14,53,32,[0,a(bQ),0]],a4x=[0,a(sR),21,14,21,26,[0,a(nP),[0,a(m0),[0,a(eE),[0,a(aE),[0,a(dk),[0,a(ai),0]]]]]]],a4w=a(xM),a4y=[0,a(bO),44,10,44,22,[0,a(bQ),0]],a4v=[0,a(bO),44,10,44,22,[0,a(bQ),0]],a4z=[0,a(cG),[0,a(HF),0]],a4C=[0,a(bO),49,3,49,7,[0,a(bQ),0]],a4D=[0,a(cG),[0,a(LL),0]],a4A=[0,a(b3),9,10,9,23,[0,a(B),[0,a(aZ),0]]],a4G=[0,a(bO),49,3,49,7,[0,a(bQ),0]],a4H=[0,a(cG),[0,a(KK),0]],a4E=[0,a(b3),10,10,10,19,[0,a(B),[0,a(aZ),0]]],a4I=[0,a(cG),[0,a(gz),[0,a(is),0]]],a4J=[0,a(cG),[0,a(gz),[0,a(is),0]]],a4U=[0,a(bO),45,10,45,33,[0,a(bQ),0]],a4K=[0,a(bO),45,10,45,33,[0,a(bQ),0]],a4V=[0,a(cG),[0,a(w0),0]],a44=[0,a(bO),43,11,43,27,[0,a(bQ),0]],a4W=[0,a(bO),43,11,43,27,[0,a(bQ),0]],a45=[0,a(cG),[0,a(Am),0]],a4$=[0,a(cG),[0,a(id),0]],a5i=[0,a(cG),[0,a(dG),0]],a4q=[0,a(C),mY,14,mY,32,[0,a(yA),[0,a(oP),[0,a(eD),[0,a(bk),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]]],a4o=a(cY),a4p=a(p),a4j=[0,a(C),IL,6,ts,35,[0,a("Article R822-20"),[0,a("Sous-section 3 : Montant forfaitaire de ressources applicable aux \xc3\xa9tudiants"),[0,a(eD),[0,a(bk),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]]],a4k=[0,a(c),h$,10,h$,37,[0,a(cc),[0,a(j),[0,a(d),0]]]],a4i=[0,a(C),ku,14,ku,41,[0,a(lU),[0,a(lW),[0,a(eD),[0,a(bk),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]]],a4e=[0,a(C),oT,14,oT,32,[0,a("Article R822-8"),[0,a(oP),[0,a(eD),[0,a(bk),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]]],a4d=a(p),a39=[0,a(C),LR,14,LR,65,[0,a(yA),[0,a(oP),[0,a(eD),[0,a(bk),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]]],a35=[0,a(C),J1,14,J1,33,[0,a("Article R822-10"),[0,a(oP),[0,a(eD),[0,a(bk),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]]],a3R=a(p),a3S=a(p),a3T=a(ab),a3U=a(Av),a3V=a(Dt),a3W=a(p),a3X=a(p),a3Y=a(p),a3Z=a(p),a30=a(p),a31=a(ab),a32=a(Av),a33=a(Dt),a34=a(p),a3N=[0,a(C),ia,14,ia,62,[0,a(lU),[0,a(lW),[0,a(eD),[0,a(bk),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]]],a3M=a(p),a3I=[0,a(c),hX,51,hX,57,[0,a(cc),[0,a(j),[0,a(d),0]]]],a3E=[0,a(V),11,14,11,41,[0,a("Article 3"),[0,a(GF),[0,a(R),0]]]],a3D=a("9500"),a3z=[0,a(V),21,14,21,41,[0,a("Article 4"),[0,a(GF),[0,a(R),0]]]],a3y=a("258900"),a3u=[0,a(c),yB,46,yB,52,[0,a(cc),[0,a(j),[0,a(d),0]]]],a3v=[0,a(c),mq,10,mq,15,[0,a(cc),[0,a(j),[0,a(d),0]]]],a3t=[0,a(c),mq,10,mq,15,[0,a(cc),[0,a(j),[0,a(d),0]]]],a3w=[0,a(d$),[0,a(Kf),0]],a3A=[0,a(c),o3,11,o3,38,[0,a(cc),[0,a(j),[0,a(d),0]]]],a3x=[0,a(c),o3,11,o3,38,[0,a(cc),[0,a(j),[0,a(d),0]]]],a3B=[0,a(d$),[0,a("montant_forfaitaire_r_822_8"),0]],a3F=[0,a(c),pc,11,pc,38,[0,a(cc),[0,a(j),[0,a(d),0]]]],a3C=[0,a(c),pc,11,pc,38,[0,a(cc),[0,a(j),[0,a(d),0]]]],a3G=[0,a(d$),[0,a("montant_forfaitaire_r_822_7"),0]],a3J=[0,a(c),hX,11,hX,42,[0,a(cc),[0,a(j),[0,a(d),0]]]],a3H=[0,a(c),hX,11,hX,42,[0,a(cc),[0,a(j),[0,a(d),0]]]],a3K=[0,a(d$),[0,a("ressources_forfaitaires_r822_20"),0]],a3O=[0,a(c),mU,11,mU,59,[0,a(cc),[0,a(j),[0,a(d),0]]]],a3L=[0,a(c),mU,11,mU,59,[0,a(cc),[0,a(j),[0,a(d),0]]]],a3P=[0,a(d$),[0,a("ressources_personnes_vivant_habituellement_foyer"),0]],a36=[0,a(c),m1,11,m1,30,[0,a(cc),[0,a(j),[0,a(d),0]]]],a3Q=[0,a(c),m1,11,m1,30,[0,a(cc),[0,a(j),[0,a(d),0]]]],a37=[0,a(d$),[0,a("abattement_r_822_10"),0]],a3_=[0,a(c),sd,3,sd,40,[0,a(cc),[0,a(j),[0,a(d),0]]]],a3$=[0,a(d$),[0,a(KT),0]],a38=[0,a(d9),5,10,5,23,[0,a(b7),0]],a4a=[0,a(d$),[0,a(of),[0,a(gP),0]]],a4b=[0,a(d$),[0,a(of),[0,a(gP),0]]],a4f=[0,a(c),op,11,op,29,[0,a(cc),[0,a(j),[0,a(d),0]]]],a4c=[0,a(c),op,11,op,29,[0,a(cc),[0,a(j),[0,a(d),0]]]],a4g=[0,a(d$),[0,a("abattement_r_822_8"),0]],a4l=[0,a(c),h$,10,h$,37,[0,a(cc),[0,a(j),[0,a(d),0]]]],a4h=[0,a(c),h$,10,h$,37,[0,a(cc),[0,a(j),[0,a(d),0]]]],a4m=[0,a(d$),[0,a("ressources_prises_en_compte"),0]],a4r=[0,a(c),lQ,11,lQ,29,[0,a(cc),[0,a(j),[0,a(d),0]]]],a4n=[0,a(c),lQ,11,lQ,29,[0,a(cc),[0,a(j),[0,a(d),0]]]],a4s=[0,a(d$),[0,a("abattement_r_822_7"),0]],a4t=[0,a(C),iw,13,ne,74,[0,a(lU),[0,a(lW),[0,a(eD),[0,a(bk),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]]],a4u=[0,a(C),iw,13,ne,74,[0,a(lU),[0,a(lW),[0,a(eD),[0,a(bk),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]]],a3j=[0,a(c),yT,14,yT,56,[0,a(Z),[0,a(j),[0,a(d),0]]]],a3f=[0,a(c),rv,14,rv,63,[0,a(Z),[0,a(j),[0,a(d),0]]]],a3d=a(cw),a3e=a(cw),a2$=[0,a(C),Bp,14,Bp,49,[0,a(ko),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],a27=[0,a(aW),[0,a(kG),[0,a(P),0]]],a28=[0,a(aW),[0,a(kG),0]],a29=[0,a(aW),[0,a(kG),[0,a(O),0]]],a2_=[0,a(aW),[0,a(kG),0]],a21=a(CG),a20=[0,a(C),1213,4,1219,49,[0,a(ko),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],a22=[0,a(c),dW,11,dW,44,[0,a(Z),[0,a(j),[0,a(d),0]]]],a2V=[0,a(aW),[0,a(fB),[0,a(P),0]]],a2W=[0,a(aW),[0,a(fB),0]],a2X=[0,a(aW),[0,a(fB),[0,a(O),0]]],a2Y=[0,a(aW),[0,a(fB),0]],a2Z=[0,a(C),yS,5,yS,44,[0,a(ko),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],a23=[0,a(c),dW,11,dW,44,[0,a(Z),[0,a(j),[0,a(d),0]]]],a2S=a("21"),a2T=[0,a(C),AD,5,1152,44,[0,a(ko),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],a2U=[0,a(c),dW,11,dW,44,[0,a(Z),[0,a(j),[0,a(d),0]]]],a2R=[0,a(c),dW,11,dW,44,[0,a(Z),[0,a(j),[0,a(d),0]]]],a24=[0,a(c),dW,11,dW,44,[0,a(Z),[0,a(j),[0,a(d),0]]]],a2Q=[0,a(c),dW,11,dW,44,[0,a(Z),[0,a(j),[0,a(d),0]]]],a2L=[0,0],a2M=a(CG),a2K=[0,a(C),j_,5,ti,10,[0,a(ko),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],a2N=[0,a(c),fM,10,fM,28,[0,a(Z),[0,a(j),[0,a(d),0]]]],a2J=[0,a(c),fM,10,fM,28,[0,a(Z),[0,a(j),[0,a(d),0]]]],a2O=[0,a(c),fM,10,fM,28,[0,a(Z),[0,a(j),[0,a(d),0]]]],a2I=[0,a(c),fM,10,fM,28,[0,a(Z),[0,a(j),[0,a(d),0]]]],a2E=[0,a(c),rU,5,hh,25,[0,a(Z),[0,a(j),[0,a(d),0]]]],a2F=[0,a(c),gI,10,gI,21,[0,a(Z),[0,a(j),[0,a(d),0]]]],a2D=[0,a(c),gI,10,gI,21,[0,a(Z),[0,a(j),[0,a(d),0]]]],a2z=[0,a(dX),pN,14,pN,31,[0,a("Article L351-8"),[0,a("Section 5 : Taux et montant de la pension"),[0,a("Chapitre 1er : Ouverture du droit, liquidation et calcul des pensions de retraite"),[0,a("Titre V : Assurance vieillesse - Assurance veuvage"),[0,a("Livre III : Dispositions relatives aux assurances sociales et \xc3\xa0 diverses cat\xc3\xa9gories de personnes rattach\xc3\xa9es au r\xc3\xa9gime g\xc3\xa9n\xc3\xa9rale"),[0,a(am),[0,a(ai),0]]]]]]]],a2t=[0,a(aT),72,5,74,56,[0,a(bk),[0,a(Q),[0,a(w),[0,a(am),[0,a(v),0]]]]]],a2u=[0,a(c),eT,11,eT,31,[0,a(Z),[0,a(j),[0,a(d),0]]]],a2s=[0,a(aT),65,5,68,31,[0,a(bk),[0,a(Q),[0,a(w),[0,a(am),[0,a(v),0]]]]]],a2v=[0,a(c),eT,11,eT,31,[0,a(Z),[0,a(j),[0,a(d),0]]]],a2r=[0,a(c),eT,11,eT,31,[0,a(Z),[0,a(j),[0,a(d),0]]]],a2k=[0,a(aT),mA,18,mA,75,[0,a(mb),[0,a(bk),[0,a(Q),[0,a(w),[0,a(am),[0,a(v),0]]]]]]],a2j=a(p),a2l=[0,a(c),fa,11,fa,36,[0,a(Z),[0,a(j),[0,a(d),0]]]],a2g=[4,0],a2h=[5,0],a2i=[0,a(aT),rx,18,r$,45,[0,a(mb),[0,a(bk),[0,a(Q),[0,a(w),[0,a(am),[0,a(v),0]]]]]]],a2f=a(p),a2m=[0,a(c),fa,11,fa,36,[0,a(Z),[0,a(j),[0,a(d),0]]]],a2e=[0,a(C),I7,5,I7,59,[0,a(LB),[0,a(Dm),[0,a(eD),[0,a(bk),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]]],a2n=[0,a(c),fa,11,fa,36,[0,a(Z),[0,a(j),[0,a(d),0]]]],a2d=[0,a(aT),zR,33,zR,58,[0,a(mb),[0,a(bk),[0,a(Q),[0,a(w),[0,a(am),[0,a(v),0]]]]]]],a2c=a(p),a1_=[0,a(dX),eX,14,eX,32,[0,a(sV),[0,a(rH),[0,a(gk),[0,a(gu),[0,a(gR),[0,a(gC),[0,a(nu),[0,a(am),[0,a(ai),0]]]]]]]]]],a11=a(J$),a12=a("8"),a13=a(J$),a14=[0,a(C),1057,5,1064,65,[0,a(rz),[0,a(tb),[0,a(bk),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],a15=[0,a(c),ev,12,ev,38,[0,a(Z),[0,a(j),[0,a(d),0]]]],a10=[0,a(c),ev,12,ev,38,[0,a(Z),[0,a(j),[0,a(d),0]]]],a16=[0,a(c),ev,12,ev,38,[0,a(Z),[0,a(j),[0,a(d),0]]]],a1T=a(cw),a1S=a(cw),a1R=[0,a(aT),171,5,j2,66,[0,a(ha),[0,a(bk),[0,a(Q),[0,a(w),[0,a(am),[0,a(v),0]]]]]]],a1U=[0,a(c),ek,11,ek,45,[0,a(Z),[0,a(j),[0,a(d),0]]]],a1Q=[0,a(aT),rM,5,s_,30,[0,a(ha),[0,a(bk),[0,a(Q),[0,a(w),[0,a(am),[0,a(v),0]]]]]]],a1V=[0,a(c),ek,11,ek,45,[0,a(Z),[0,a(j),[0,a(d),0]]]],a1P=[0,a(aT),eX,5,131,33,[0,a(EE),[0,a(bk),[0,a(Q),[0,a(w),[0,a(am),[0,a(v),0]]]]]]],a1W=[0,a(c),ek,11,ek,45,[0,a(Z),[0,a(j),[0,a(d),0]]]],a1O=[0,a(c),ek,11,ek,45,[0,a(Z),[0,a(j),[0,a(d),0]]]],a1J=[0,a(aT),H5,18,H5,55,[0,a("Article L822-10"),[0,a(bk),[0,a(Q),[0,a(w),[0,a(am),[0,a(v),0]]]]]]],a1K=[0,a(c),gr,11,gr,62,[0,a(Z),[0,a(j),[0,a(d),0]]]],a1I=[0,a(c),gr,11,gr,62,[0,a(Z),[0,a(j),[0,a(d),0]]]],a1D=[0,a(dX),dW,5,s2,35,[0,a(se),[0,a(r6),[0,a(tr),[0,a(rI),[0,a(r1),[0,a(bd),[0,a(ai),0]]]]]]]],a1C=a("999840"),a1E=[0,a(c),dc,11,dc,41,[0,a(Z),[0,a(j),[0,a(d),0]]]],a1A=[0,a(dX),xf,5,j$,35,[0,a(se),[0,a(r6),[0,a(tr),[0,a(rI),[0,a(r1),[0,a(bd),[0,a(ai),0]]]]]]]],a1z=a("1041840"),a1B=[0,a(c),dc,11,dc,41,[0,a(Z),[0,a(j),[0,a(d),0]]]],a1x=[0,a(dX),kd,5,jP,35,[0,a(se),[0,a(r6),[0,a(tr),[0,a(rI),[0,a(r1),[0,a(bd),[0,a(ai),0]]]]]]]],a1w=a("1083840"),a1y=[0,a(c),dc,11,dc,41,[0,a(Z),[0,a(j),[0,a(d),0]]]],a1u=[0,a(f$),33,5,34,34,[0,a(IX),[0,a('Circulaire de la CNAV 2022-3 du 11/01/2022 "Revalorisation \xc3\xa0 compter du 1er janvier 2022"'),0]]],a1t=a("1100144"),a1v=[0,a(c),dc,11,dc,41,[0,a(Z),[0,a(j),[0,a(d),0]]]],a1r=[0,a(f$),70,5,71,34,[0,a(IX),[0,a('Circulaire de la CNAV 2021-1 du 11/01/2021 "Revalorisation \xc3\xa0 compter du 1er janvier 2021"'),0]]],a1q=a("1088175"),a1s=[0,a(c),dc,11,dc,41,[0,a(Z),[0,a(j),[0,a(d),0]]]],a1l=[0,a(aT),dV,5,iH,78,[0,a(EE),[0,a(bk),[0,a(Q),[0,a(w),[0,a(am),[0,a(v),0]]]]]]],a1m=[0,a(c),gK,11,gK,32,[0,a(Z),[0,a(j),[0,a(d),0]]]],a1k=[0,a(c),gK,11,gK,32,[0,a(Z),[0,a(j),[0,a(d),0]]]],a1g=[0,a(aT),Ff,14,Ff,40,[0,a(mb),[0,a(bk),[0,a(Q),[0,a(w),[0,a(am),[0,a(v),0]]]]]]],a1a=[0,a(dX),e8,14,e8,61,[0,a(sV),[0,a(rH),[0,a(gk),[0,a(gu),[0,a(gR),[0,a(gC),[0,a(nu),[0,a(am),[0,a(ai),0]]]]]]]]]],a06=[0,a(aT),46,5,46,41,[0,a("Article L821-2"),[0,a(Ab),[0,a(LE),[0,a(za),[0,a(Q),[0,a(w),[0,a(am),[0,a(v),0]]]]]]]]],a07=[0,a(c),fb,12,fb,51,[0,a(Z),[0,a(j),[0,a(d),0]]]],a05=[0,a(c),fb,12,fb,51,[0,a(Z),[0,a(j),[0,a(d),0]]]],a08=[0,a(c),fb,12,fb,51,[0,a(Z),[0,a(j),[0,a(d),0]]]],a0Z=a("30"),a0Y=[0,a(aT),203,5,207,39,[0,a(CX),[0,a(bk),[0,a(Q),[0,a(w),[0,a(am),[0,a(v),0]]]]]]],a00=[0,a(c),e2,11,e2,44,[0,a(Z),[0,a(j),[0,a(d),0]]]],a0X=[0,a(aT),sz,5,198,34,[0,a(CX),[0,a(bk),[0,a(Q),[0,a(w),[0,a(am),[0,a(v),0]]]]]]],a01=[0,a(c),e2,11,e2,44,[0,a(Z),[0,a(j),[0,a(d),0]]]],a0W=[0,a(c),e2,11,e2,44,[0,a(Z),[0,a(j),[0,a(d),0]]]],a0S=[0,a(C),J4,14,J4,69,[0,a(rz),[0,a(tb),[0,a(bk),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],a0L=a(rA),a0M=a(rA),a0N=a(hb),a0O=a(hb),a0P=a(hb),a0Q=a(rA),a0R=a(hb),a0G=[0,a(aT),dc,18,dc,67,[0,a("Article L822-8"),[0,a(bk),[0,a(Q),[0,a(w),[0,a(am),[0,a(v),0]]]]]]],a0H=[0,a(c),gv,11,gv,41,[0,a(Z),[0,a(j),[0,a(d),0]]]],a0F=[0,a(c),gv,11,gv,41,[0,a(Z),[0,a(j),[0,a(d),0]]]],a0A=[0,a(aT),EI,18,EI,61,[0,a("Article L822-9"),[0,a(bk),[0,a(Q),[0,a(w),[0,a(am),[0,a(v),0]]]]]]],a0B=[0,a(c),gi,11,gi,58,[0,a(Z),[0,a(j),[0,a(d),0]]]],a0z=[0,a(c),gi,11,gi,58,[0,a(Z),[0,a(j),[0,a(d),0]]]],a0v=[0,a(C),mT,14,mT,39,[0,a(rz),[0,a(tb),[0,a(bk),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],a0p=a(x),a0q=a(ab),a0r=a(ab),a0s=a(ab),a0t=a(x),a0u=a(ab),a0l=[0,a(aT),gU,14,gU,43,[0,a(ha),[0,a(bk),[0,a(Q),[0,a(w),[0,a(am),[0,a(v),0]]]]]]],a0h=[0,a(C),sc,14,sc,37,[0,a(LB),[0,a(Dm),[0,a(eD),[0,a(bk),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]]],a0g=a("3000000"),a0c=[0,a(C),bo,14,bo,41,[0,a(Ek),[0,a(I_),[0,a(bk),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],a0b=a(CV),aZ9=[0,a(C),ed,14,ed,42,[0,a(Ek),[0,a(I_),[0,a(bk),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],aZ8=a(CV),aZ4=[0,a(c),iO,11,iO,48,[0,a(Z),[0,a(j),[0,a(d),0]]]],aZ0=[0,a(c),hW,11,hW,25,[0,a(Z),[0,a(j),[0,a(d),0]]]],aZ1=[0,a(c),hW,11,hW,25,[0,a(Z),[0,a(j),[0,a(d),0]]]],aZZ=[0,a(c),hW,11,hW,25,[0,a(Z),[0,a(j),[0,a(d),0]]]],aZ2=[0,a(aW),[0,a("condition_pr\xc3\xaat"),0]],aZ5=[0,a(c),iO,11,iO,48,[0,a(Z),[0,a(j),[0,a(d),0]]]],aZ3=[0,a(c),iO,11,iO,48,[0,a(Z),[0,a(j),[0,a(d),0]]]],aZ6=[0,a(aW),[0,a("condition_peuplement_logement_l822_10"),0]],aZ_=[0,a(c),iS,11,iS,39,[0,a(Z),[0,a(j),[0,a(d),0]]]],aZ7=[0,a(c),iS,11,iS,39,[0,a(Z),[0,a(j),[0,a(d),0]]]],aZ$=[0,a(aW),[0,a("seuil_l822_3_parts_propri\xc3\xa9t\xc3\xa9"),0]],a0d=[0,a(c),kd,11,kd,38,[0,a(Z),[0,a(j),[0,a(d),0]]]],a0a=[0,a(c),kd,11,kd,38,[0,a(Z),[0,a(j),[0,a(d),0]]]],a0e=[0,a(aW),[0,a("seuil_l822_3_parts_usufruit"),0]],a0i=[0,a(c),jP,11,jP,34,[0,a(Z),[0,a(j),[0,a(d),0]]]],a0f=[0,a(c),jP,11,jP,34,[0,a(Z),[0,a(j),[0,a(d),0]]]],a0j=[0,a(aW),[0,a("seuil_l822_5_patrimoine"),0]],a0m=[0,a(c),pe,11,pe,40,[0,a(Z),[0,a(j),[0,a(d),0]]]],a0k=[0,a(c),pe,11,pe,40,[0,a(Z),[0,a(j),[0,a(d),0]]]],a0n=[0,a(aW),[0,a("usufruit_ou_propri\xc3\xa9t\xc3\xa9_famille"),0]],a0w=[0,a(c),mZ,11,mZ,36,[0,a(Z),[0,a(j),[0,a(d),0]]]],a0o=[0,a(c),mZ,11,mZ,36,[0,a(Z),[0,a(j),[0,a(d),0]]]],a0x=[0,a(aW),[0,a("nombre_personnes_logement"),0]],a0C=[0,a(c),gi,11,gi,58,[0,a(Z),[0,a(j),[0,a(d),0]]]],a0y=[0,a(c),gi,11,gi,58,[0,a(Z),[0,a(j),[0,a(d),0]]]],a0D=[0,a(aW),[0,a("condition_non_ouverture_l822_9_decence_logement"),0]],a0I=[0,a(c),gv,11,gv,41,[0,a(Z),[0,a(j),[0,a(d),0]]]],a0E=[0,a(c),gv,11,gv,41,[0,a(Z),[0,a(j),[0,a(d),0]]]],a0J=[0,a(aW),[0,a("condition_non_ouverture_l822_8"),0]],a0T=[0,a(c),m_,11,m_,66,[0,a(Z),[0,a(j),[0,a(d),0]]]],a0K=[0,a(c),m_,11,m_,66,[0,a(Z),[0,a(j),[0,a(d),0]]]],a0U=[0,a(aW),[0,a("condition_logement_surface_minimale_sans_seuil_m_carr\xc3\xa9s"),0]],a02=[0,a(c),e2,11,e2,44,[0,a(Z),[0,a(j),[0,a(d),0]]]],a0V=[0,a(c),e2,11,e2,44,[0,a(Z),[0,a(j),[0,a(d),0]]]],a03=[0,a(aW),[0,a("condition_logement_location_tiers"),0]],a09=[0,a(c),fb,12,fb,51,[0,a(Z),[0,a(j),[0,a(d),0]]]],a04=[0,a(c),fb,12,fb,51,[0,a(Z),[0,a(j),[0,a(d),0]]]],a0_=[0,a(aW),[0,a("condition_logement_r\xc3\xa9sidence_principale"),0]],a1b=[0,a(c),LH,3,LH,28,[0,a(Z),[0,a(j),[0,a(d),0]]]],a1c=[0,a(aW),[0,a("ouverture_droits_retraite.date_naissance_assur\xc3\xa9"),0]],a0$=[0,a(c),mT,10,mT,31,[0,a(fy),[0,a(t),[0,a(d),0]]]],a1d=[0,a(aW),[0,a(Ci),[0,a(te),0]]],a1e=[0,a(aW),[0,a(Ci),[0,a(te),0]]],a1h=[0,a(c),j$,11,j$,37,[0,a(Z),[0,a(j),[0,a(d),0]]]],a1f=[0,a(c),j$,11,j$,37,[0,a(Z),[0,a(j),[0,a(d),0]]]],a1i=[0,a(aW),[0,a("patrimoine_total_demandeur"),0]],a1n=[0,a(c),gK,11,gK,32,[0,a(Z),[0,a(j),[0,a(d),0]]]],a1j=[0,a(c),gK,11,gK,32,[0,a(Z),[0,a(j),[0,a(d),0]]]],a1o=[0,a(aW),[0,a("condition_nationalit\xc3\xa9"),0]],a1F=[0,a(c),dc,11,dc,41,[0,a(Z),[0,a(j),[0,a(d),0]]]],a1p=[0,a(c),dc,11,dc,41,[0,a(Z),[0,a(j),[0,a(d),0]]]],a1G=[0,a(aW),[0,a("plafond_individuel_l815_9_s\xc3\xa9cu"),0]],a1L=[0,a(c),gr,11,gr,62,[0,a(Z),[0,a(j),[0,a(d),0]]]],a1H=[0,a(c),gr,11,gr,62,[0,a(Z),[0,a(j),[0,a(d),0]]]],a1M=[0,a(aW),[0,a("condition_non_ouverture_l822_10_peuplement_logement"),0]],a1X=[0,a(c),ek,11,ek,45,[0,a(Z),[0,a(j),[0,a(d),0]]]],a1N=[0,a(c),ek,11,ek,45,[0,a(Z),[0,a(j),[0,a(d),0]]]],a1Y=[0,a(aW),[0,a("condition_logement_mode_occupation"),0]],a17=[0,a(c),ev,12,ev,38,[0,a(Z),[0,a(j),[0,a(d),0]]]],a1Z=[0,a(c),ev,12,ev,38,[0,a(Z),[0,a(j),[0,a(d),0]]]],a18=[0,a(aW),[0,a("condition_logement_surface"),0]],a1$=[0,a(c),oD,11,oD,29,[0,a(Z),[0,a(j),[0,a(d),0]]]],a19=[0,a(c),oD,11,oD,29,[0,a(Z),[0,a(j),[0,a(d),0]]]],a2a=[0,a(aW),[0,a("\xc3\xa2ge_l161_17_2_s\xc3\xa9cu"),0]],a2o=[0,a(c),fa,11,fa,36,[0,a(Z),[0,a(j),[0,a(d),0]]]],a2b=[0,a(c),fa,11,fa,36,[0,a(Z),[0,a(j),[0,a(d),0]]]],a2p=[0,a(aW),[0,a("patrimoine_pris_en_compte"),0]],a2w=[0,a(c),eT,11,eT,31,[0,a(Z),[0,a(j),[0,a(d),0]]]],a2q=[0,a(c),eT,11,eT,31,[0,a(Z),[0,a(j),[0,a(d),0]]]],a2x=[0,a(aW),[0,a(A9),0]],a2A=[0,a(c),mW,11,mW,28,[0,a(Z),[0,a(j),[0,a(d),0]]]],a2y=[0,a(c),mW,11,mW,28,[0,a(Z),[0,a(j),[0,a(d),0]]]],a2B=[0,a(aW),[0,a("\xc3\xa2ge_l351_8_1_s\xc3\xa9cu"),0]],a2G=[0,a(c),gI,10,gI,21,[0,a(Z),[0,a(j),[0,a(d),0]]]],a2C=[0,a(c),gI,10,gI,21,[0,a(Z),[0,a(j),[0,a(d),0]]]],a2H=[0,a(aW),[0,a(o_),0]],a2P=[0,a(aW),[0,a(fB),0]],a25=[0,a(aW),[0,a(kG),0]],a3a=[0,a(c),na,11,na,46,[0,a(Z),[0,a(j),[0,a(d),0]]]],a26=[0,a(c),na,11,na,46,[0,a(Z),[0,a(j),[0,a(d),0]]]],a3b=[0,a(aW),[0,a("personnes_\xc3\xa0_charge_prises_en_compte"),0]],a3g=[0,a(c),ot,10,ot,59,[0,a(Z),[0,a(j),[0,a(d),0]]]],a3c=[0,a(c),ot,10,ot,59,[0,a(Z),[0,a(j),[0,a(d),0]]]],a3h=[0,a(aW),[0,a(kw),0]],a3k=[0,a(c),ou,10,ou,52,[0,a(Z),[0,a(j),[0,a(d),0]]]],a3i=[0,a(c),ou,10,ou,52,[0,a(Z),[0,a(j),[0,a(d),0]]]],a3l=[0,a(aW),[0,a(tu),0]],a3n=a(su),a3m=[0,a(aT),hY,13,hY,48,[0,a(ha),[0,a(bk),[0,a(Q),[0,a(w),[0,a(am),[0,a(v),0]]]]]]],a3r=[0,a(aT),hY,13,hY,48,[0,a(ha),[0,a(bk),[0,a(Q),[0,a(w),[0,a(am),[0,a(v),0]]]]]]],a3p=a(su),a3o=[0,a(aT),hn,13,hn,49,[0,a(ha),[0,a(bk),[0,a(Q),[0,a(w),[0,a(am),[0,a(v),0]]]]]]],a3q=[0,a(aT),hn,13,hn,49,[0,a(ha),[0,a(bk),[0,a(Q),[0,a(w),[0,a(am),[0,a(v),0]]]]]]],aZW=[0,a(C),K$,14,K$,36,[0,a(ic),[0,a(aJ),[0,a(aI),[0,a(av),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],aZN=[0,a(U),[0,a(a4),[0,a(P),0]]],aZO=[0,a(U),[0,a(a4),0]],aZP=[0,a(U),[0,a(a4),[0,a(O),0]]],aZQ=[0,a(U),[0,a(a4),0]],aZR=a(p),aZS=[0,a(U),[0,a(a4),[0,a(P),0]]],aZT=[0,a(U),[0,a(a4),0]],aZU=[0,a(U),[0,a(a4),[0,a(O),0]]],aZV=[0,a(U),[0,a(a4),0]],aZX=[0,a(c),o$,10,o$,25,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aZM=[0,a(c),o$,10,o$,25,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aZJ=[0,a(C),zM,14,zM,33,[0,a(ic),[0,a(aJ),[0,a(aI),[0,a(av),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],aZH=a(p),aZI=a(p),aZD=[0,a(C),Dk,14,Dk,36,[0,a(ic),[0,a(aJ),[0,a(aI),[0,a(av),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],aYX=a(p),aYY=[0,a(U),[0,a(aR),[0,a(P),0]]],aYZ=[0,a(U),[0,a(aR),0]],aY0=[0,a(U),[0,a(aR),[0,a(O),0]]],aY1=[0,a(U),[0,a(aR),0]],aY2=[0,a(af),[0,a(al),[0,a(P),0]]],aY3=[0,a(af),[0,a(al),0]],aY4=[0,a(af),[0,a(al),[0,a(O),0]]],aY5=[0,a(af),[0,a(al),0]],aY6=a(e1),aY7=[0,a(U),[0,a(aR),[0,a(P),0]]],aY8=[0,a(U),[0,a(aR),0]],aY9=[0,a(U),[0,a(aR),[0,a(O),0]]],aY_=[0,a(U),[0,a(aR),0]],aY$=[0,a(af),[0,a(al),[0,a(P),0]]],aZa=[0,a(af),[0,a(al),0]],aZb=[0,a(af),[0,a(al),[0,a(O),0]]],aZc=[0,a(af),[0,a(al),0]],aZd=[0,a(U),[0,a(aR),[0,a(P),0]]],aZe=[0,a(U),[0,a(aR),0]],aZf=[0,a(U),[0,a(aR),[0,a(O),0]]],aZg=[0,a(U),[0,a(aR),0]],aZh=[0,a(U),[0,a(aR),[0,a(P),0]]],aZi=[0,a(U),[0,a(aR),0]],aZj=[0,a(U),[0,a(aR),[0,a(O),0]]],aZk=[0,a(U),[0,a(aR),0]],aZl=[0,a(af),[0,a(al),[0,a(P),0]]],aZm=[0,a(af),[0,a(al),0]],aZn=[0,a(af),[0,a(al),[0,a(O),0]]],aZo=[0,a(af),[0,a(al),0]],aZp=a(e1),aZq=[0,a(U),[0,a(aR),[0,a(P),0]]],aZr=[0,a(U),[0,a(aR),0]],aZs=[0,a(U),[0,a(aR),[0,a(O),0]]],aZt=[0,a(U),[0,a(aR),0]],aZu=[0,a(af),[0,a(al),[0,a(P),0]]],aZv=[0,a(af),[0,a(al),0]],aZw=[0,a(af),[0,a(al),[0,a(O),0]]],aZx=[0,a(af),[0,a(al),0]],aZy=[0,a(U),[0,a(aR),[0,a(P),0]]],aZz=[0,a(U),[0,a(aR),0]],aZA=[0,a(U),[0,a(aR),[0,a(O),0]]],aZB=[0,a(U),[0,a(aR),0]],aZC=a(p),aZE=[0,a(c),os,10,os,40,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aYW=[0,a(c),os,10,os,40,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aYT=[0,a(C),GP,14,GP,49,[0,a(hd),[0,a(aJ),[0,a(aI),[0,a(av),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],aYR=a(ip),aYS=a(ip),aYN=[0,a(C),CU,14,CU,33,[0,a(ic),[0,a(aJ),[0,a(aI),[0,a(av),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],aYJ=[0,a(C),LG,14,LG,36,[0,a(ic),[0,a(aJ),[0,a(aI),[0,a(av),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],aYj=a(p),aYk=[0,a(U),[0,a(ag),[0,a(P),0]]],aYl=[0,a(U),[0,a(ag),0]],aYm=[0,a(U),[0,a(ag),[0,a(O),0]]],aYn=[0,a(U),[0,a(ag),0]],aYo=[0,a(U),[0,a(fR),[0,a(P),0]]],aYp=[0,a(U),[0,a(fR),0]],aYq=[0,a(U),[0,a(fR),[0,a(O),0]]],aYr=[0,a(U),[0,a(fR),0]],aYs=[0,a(U),[0,a(ag),[0,a(P),0]]],aYt=[0,a(U),[0,a(ag),0]],aYu=[0,a(U),[0,a(ag),[0,a(O),0]]],aYv=[0,a(U),[0,a(ag),0]],aYw=[0,a(U),[0,a(ag),[0,a(P),0]]],aYx=[0,a(U),[0,a(ag),0]],aYy=[0,a(U),[0,a(ag),[0,a(O),0]]],aYz=[0,a(U),[0,a(ag),0]],aYA=[0,a(U),[0,a(fR),[0,a(P),0]]],aYB=[0,a(U),[0,a(fR),0]],aYC=[0,a(U),[0,a(fR),[0,a(O),0]]],aYD=[0,a(U),[0,a(fR),0]],aYE=[0,a(U),[0,a(ag),[0,a(P),0]]],aYF=[0,a(U),[0,a(ag),0]],aYG=[0,a(U),[0,a(ag),[0,a(O),0]]],aYH=[0,a(U),[0,a(ag),0]],aYI=a(p),aYK=[0,a(c),pI,10,pI,20,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aYi=[0,a(c),pI,10,pI,20,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aYf=[0,a(C),BO,14,BO,49,[0,a(hd),[0,a(aJ),[0,a(aI),[0,a(av),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],aYc=a(dU),aYd=a(dU),aYe=a(lT),aX9=[0,a(C),3496,5,3508,77,[0,a(kh),[0,a(aJ),[0,a(aI),[0,a(av),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],aX7=a(cY),aX8=a(cw),aX_=[0,a(c),gN,10,gN,29,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aX5=[0,a(C),BU,5,BU,75,[0,a(kh),[0,a(aJ),[0,a(aI),[0,a(av),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],aX6=[0,a(c),gN,10,gN,29,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aXZ=[0,a(cn),gH,14,gH,42,[0,a(pn),[0,a(R),[0,a(cy),[0,a(cp),0]]]]],aXY=a(fF),aX0=[0,a(c),gx,10,gx,25,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aXX=[0,a(V),A8,14,A8,42,[0,a(pn),[0,a(aK),[0,a(R),0]]]],aXW=a(fF),aX1=[0,a(c),gx,10,gx,25,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aXS=[0,a(C),Mg,14,Mg,55,[0,a(r_),[0,a(aJ),[0,a(aI),[0,a(av),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],aXJ=[0,a(U),[0,a(fN),[0,a(P),0]]],aXK=[0,a(U),[0,a(fN),0]],aXL=[0,a(U),[0,a(fN),[0,a(O),0]]],aXM=[0,a(U),[0,a(fN),0]],aXN=[0,a(U),[0,a(fN),[0,a(P),0]]],aXO=[0,a(U),[0,a(fN),0]],aXP=[0,a(U),[0,a(fN),[0,a(O),0]]],aXQ=[0,a(U),[0,a(fN),0]],aXR=a(p),aXT=[0,a(c),nU,11,nU,52,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aXI=[0,a(c),nU,11,nU,52,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aXF=[0,a(C),Eg,14,Eg,49,[0,a(hd),[0,a(aJ),[0,a(aI),[0,a(av),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],aXE=a(ip),aXy=[0,a(C),D7,14,D7,70,[0,a(kh),[0,a(aJ),[0,a(aI),[0,a(av),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],aXu=[0,a(C),EW,14,EW,69,[0,a(kh),[0,a(aJ),[0,a(aI),[0,a(av),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],aXq=[0,a(C),xb,14,xb,75,[0,a(kh),[0,a(aJ),[0,a(aI),[0,a(av),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],aXl=[0,a(C),C$,5,C$,44,[0,a(Bd),[0,a(aJ),[0,a(aI),[0,a(av),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],aW7=[0,a(U),[0,a(cl),[0,a(P),0]]],aW8=[0,a(U),[0,a(cl),0]],aW9=[0,a(U),[0,a(cl),[0,a(O),0]]],aW_=[0,a(U),[0,a(cl),0]],aW$=[0,a(U),[0,a(cl),[0,a(P),0]]],aXa=[0,a(U),[0,a(cl),0]],aXb=[0,a(U),[0,a(cl),[0,a(O),0]]],aXc=[0,a(U),[0,a(cl),0]],aXd=[0,a(U),[0,a(cl),[0,a(P),0]]],aXe=[0,a(U),[0,a(cl),0]],aXf=[0,a(U),[0,a(cl),[0,a(O),0]]],aXg=[0,a(U),[0,a(cl),0]],aXh=[0,a(U),[0,a(cl),[0,a(P),0]]],aXi=[0,a(U),[0,a(cl),0]],aXj=[0,a(U),[0,a(cl),[0,a(O),0]]],aXk=[0,a(U),[0,a(cl),0]],aXm=[0,a(c),iL,10,iL,14,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aW6=[0,a(C),KA,14,KA,42,[0,a(Bd),[0,a(aJ),[0,a(aI),[0,a(av),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],aW2=[0,a(U),[0,a(cl),[0,a(P),0]]],aW3=[0,a(U),[0,a(cl),0]],aW4=[0,a(U),[0,a(cl),[0,a(O),0]]],aW5=[0,a(U),[0,a(cl),0]],aWX=[0,a(C),F0,5,F0,41,[0,a(r_),[0,a(aJ),[0,a(aI),[0,a(av),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],aWY=[0,a(c),iy,11,iy,41,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aWW=[0,a(C),G2,14,G2,44,[0,a(r_),[0,a(aJ),[0,a(aI),[0,a(av),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],aWZ=[0,a(c),iy,11,iy,41,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aWV=[0,a(c),iy,11,iy,41,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aWS=[0,a(C),w8,14,w8,36,[0,a(hd),[0,a(aJ),[0,a(aI),[0,a(av),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],aWN=[0,a(V),621,5,624,33,[0,a(pJ),[0,a(aK),[0,a(R),0]]]],aWv=a(p),aWw=a(Gl),aWx=a(Fs),aWy=a(x),aWz=a(EK),aWA=a(Hr),aWB=a(p),aWC=a(AJ),aWD=a(sk),aWE=a(x),aWF=a(rF),aWG=a(sY),aWH=a(p),aWI=a(HL),aWJ=a(tx),aWK=a(x),aWL=a("35600"),aWM=a(kf),aWO=[0,a(c),ah,11,ah,46,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aWt=[0,a(V),665,5,kv,33,[0,a(pJ),[0,a(aK),[0,a(R),0]]]],aWb=a(p),aWc=a(Hd),aWd=a(tf),aWe=a(x),aWf=a("37400"),aWg=a(JM),aWh=a(p),aWi=a("146900"),aWj=a(Hz),aWk=a(x),aWl=a(sj),aWm=a("210600"),aWn=a(p),aWo=a(CY),aWp=a("167600"),aWq=a(x),aWr=a("27900"),aWs=a("195500"),aWu=[0,a(c),ah,11,ah,46,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aV$=[0,a(V),ky,5,jW,33,[0,a(pJ),[0,a(aK),[0,a(R),0]]]],aVT=a(p),aVU=a(tc),aVV=a("220000"),aVW=a(x),aVX=a("38000"),aVY=a("260000"),aVZ=a(p),aV0=a("164200"),aV1=a(zT),aV2=a(x),aV3=a(Ez),aV4=a("231200"),aV5=a(p),aV6=a("153200"),aV7=a("183700"),aV8=a(x),aV9=a(sj),aV_=a("214200"),aWa=[0,a(c),ah,11,ah,46,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aVR=[0,a(V),rD,5,755,33,[0,a(pJ),[0,a(aK),[0,a(R),0]]]],aVz=a(p),aVA=a("148100"),aVB=a("178700"),aVC=a(x),aVD=a("30600"),aVE=a("209300"),aVF=a(p),aVG=a(Bh),aVH=a("158900"),aVI=a(x),aVJ=a("26900"),aVK=a(zd),aVL=a(p),aVM=a("123300"),aVN=a("147900"),aVO=a(x),aVP=a("24600"),aVQ=a(C4),aVS=[0,a(c),ah,11,ah,46,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aVx=[0,a(V),804,5,sa,36,[0,a(bb),[0,a(aK),[0,a(R),0]]]],aVf=a(p),aVg=a(Gl),aVh=a(Fs),aVi=a(x),aVj=a(EK),aVk=a(Hr),aVl=a(p),aVm=a(AJ),aVn=a(sk),aVo=a(x),aVp=a(rF),aVq=a(sY),aVr=a(p),aVs=a(HL),aVt=a(tx),aVu=a(x),aVv=a(zk),aVw=a(kf),aVy=[0,a(c),ah,11,ah,46,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aVd=[0,a(V),848,5,IL,36,[0,a(bb),[0,a(aK),[0,a(R),0]]]],aUX=a(p),aUY=a(Hd),aUZ=a(tf),aU0=a(x),aU1=a("34700"),aU2=a(JM),aU3=a(p),aU4=a("149600"),aU5=a(sk),aU6=a(x),aU7=a(rF),aU8=a(sY),aU9=a(p),aU_=a(CY),aU$=a(tx),aVa=a(x),aVb=a(zk),aVc=a(kf),aVe=[0,a(c),ah,11,ah,46,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aUV=[0,a(V),895,5,901,36,[0,a(bb),[0,a(aK),[0,a(R),0]]]],aUP=a(p),aUQ=a("86900"),aUR=a("97100"),aUS=a(x),aUT=a("10200"),aUU=a("107300"),aUW=[0,a(c),ah,11,ah,46,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aUN=[0,a(V),927,5,930,36,[0,a(bb),[0,a(aK),[0,a(R),0]]]],aUv=a(p),aUw=a("198100"),aUx=a("239000"),aUy=a(x),aUz=a("40900"),aUA=a("279900"),aUB=a(p),aUC=a("176800"),aUD=a("212800"),aUE=a(x),aUF=a("36000"),aUG=a("248800"),aUH=a(p),aUI=a("165000"),aUJ=a("197900"),aUK=a(x),aUL=a("32900"),aUM=a("230800"),aUO=[0,a(c),ah,11,ah,46,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aUt=[0,a(V),sB,5,974,36,[0,a(bb),[0,a(aK),[0,a(R),0]]]],aUb=a(p),aUc=a("159500"),aUd=a(xS),aUe=a(x),aUf=a("33000"),aUg=a(Hn),aUh=a(p),aUi=a("142200"),aUj=a("171200"),aUk=a(x),aUl=a("29000"),aUm=a("200200"),aUn=a(p),aUo=a("132800"),aUp=a("159300"),aUq=a(x),aUr=a("26500"),aUs=a(zd),aUu=[0,a(c),ah,11,ah,46,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aT$=[0,a(V),1016,5,1019,36,[0,a(bb),[0,a(aK),[0,a(R),0]]]],aTT=a(p),aTU=a("200100"),aTV=a("141400"),aTW=a(x),aTX=a("41300"),aTY=a("282700"),aTZ=a(p),aT0=a("178600"),aT1=a("215000"),aT2=a(x),aT3=a("36400"),aT4=a("251400"),aT5=a(p),aT6=a("166700"),aT7=a(sL),aT8=a(x),aT9=a("33200"),aT_=a("233100"),aUa=[0,a(c),ah,11,ah,46,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aTR=[0,a(V),1060,5,1063,36,[0,a(bb),[0,a(aK),[0,a(R),0]]]],aTz=a(p),aTA=a("161100"),aTB=a("194400"),aTC=a(x),aTD=a("33300"),aTE=a("227700"),aTF=a(p),aTG=a("143600"),aTH=a("172900"),aTI=a(x),aTJ=a("29300"),aTK=a("202200"),aTL=a(p),aTM=a("134100"),aTN=a("160900"),aTO=a(x),aTP=a("26800"),aTQ=a("187700"),aTS=[0,a(c),ah,11,ah,46,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aTx=[0,a(V),sU,5,tE,36,[0,a(bb),[0,a(aK),[0,a(R),0]]]],aTf=a(p),aTg=a(tf),aTh=a("244300"),aTi=a(x),aTj=a("41800"),aTk=a("286100"),aTl=a(p),aTm=a("180700"),aTn=a("217500"),aTo=a(x),aTp=a("36800"),aTq=a("254300"),aTr=a(p),aTs=a("168700"),aTt=a("202300"),aTu=a(x),aTv=a("33600"),aTw=a("235900"),aTy=[0,a(c),ah,11,ah,46,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aTd=[0,a(V),AD,5,1153,36,[0,a(bb),[0,a(aK),[0,a(R),0]]]],aSX=a(p),aSY=a("30871"),aSZ=a("37243"),aS0=a(x),aS1=a("6372"),aS2=a("43615"),aS3=a(p),aS4=a("27548"),aS5=a("33148"),aS6=a(x),aS7=a("5610"),aS8=a("38768"),aS9=a(p),aS_=a("25718"),aS$=a("30840"),aTa=a(x),aTb=a("5122"),aTc=a("35962"),aTe=[0,a(c),ah,11,ah,46,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aSV=[0,a(V),sy,5,1199,36,[0,a(bb),[0,a(aK),[0,a(R),0]]]],aSD=a(p),aSE=a(GO),aSF=a("196700"),aSG=a(x),aSH=a("33700"),aSI=a("230400"),aSJ=a(p),aSK=a("145300"),aSL=a("175000"),aSM=a(x),aSN=a("29700"),aSO=a(Cx),aSP=a(p),aSQ=a("135700"),aSR=a("162800"),aSS=a(x),aST=a("27100"),aSU=a("189900"),aSW=[0,a(c),ah,11,ah,46,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aSB=[0,a(V),1239,5,1242,36,[0,a(bb),[0,a(aK),[0,a(R),0]]]],aSj=a(p),aSk=a("24849"),aSl=a("29987"),aSm=a(x),aSn=a("5138"),aSo=a("35125"),aSp=a(p),aSq=a("22151"),aSr=a("26679"),aSs=a(x),aSt=a("4528"),aSu=a("31207"),aSv=a(p),aSw=a("20687"),aSx=a("24818"),aSy=a(x),aSz=a("4131"),aSA=a("28949"),aSC=[0,a(c),ah,11,ah,46,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aSh=[0,a(V),1284,5,1287,36,[0,a(bb),[0,a(aK),[0,a(R),0]]]],aR1=a(p),aR2=a("31241"),aR3=a("37689"),aR4=a(x),aR5=a("6448"),aR6=a("44137"),aR7=a(p),aR8=a("27879"),aR9=a("33556"),aR_=a(x),aR$=a("5677"),aSa=a("39233"),aSb=a(p),aSc=a("26027"),aSd=a("31210"),aSe=a(x),aSf=a("5183"),aSg=a("36393"),aSi=[0,a(c),ah,11,ah,46,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aRZ=[0,a(V),1328,5,1331,36,[0,a(bb),[0,a(aK),[0,a(R),0]]]],aRH=a(p),aRI=a("25147"),aRJ=a("30347"),aRK=a(x),aRL=a("5200"),aRM=a("35547"),aRN=a(p),aRO=a("22417"),aRP=a("26999"),aRQ=a(x),aRR=a("4582"),aRS=a("31581"),aRT=a(p),aRU=a("20935"),aRV=a(JN),aRW=a(x),aRX=a("4181"),aRY=a("29297"),aR0=[0,a(c),ah,11,ah,46,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aRF=[0,a(V),1373,5,1376,36,[0,a(bb),[0,a(aK),[0,a(R),0]]]],aRn=a(p),aRo=a("31616"),aRp=a("38141"),aRq=a(x),aRr=a("6525"),aRs=a("44666"),aRt=a(p),aRu=a("28214"),aRv=a("33959"),aRw=a(x),aRx=a("5745"),aRy=a("39704"),aRz=a(p),aRA=a("26339"),aRB=a("31584"),aRC=a(x),aRD=a("5245"),aRE=a("36829"),aRG=[0,a(c),ah,11,ah,46,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aRl=[0,a(V),1417,5,1420,36,[0,a(bb),[0,a(aK),[0,a(R),0]]]],aQ5=a(p),aQ6=a("25449"),aQ7=a("30711"),aQ8=a(x),aQ9=a("5262"),aQ_=a("35973"),aQ$=a(p),aRa=a("22686"),aRb=a("27323"),aRc=a(x),aRd=a("4637"),aRe=a("31960"),aRf=a(p),aRg=a("21186"),aRh=a("25417"),aRi=a(x),aRj=a("4231"),aRk=a("26948"),aRm=[0,a(c),ah,11,ah,46,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aQ3=[0,a(V),1462,5,DT,36,[0,a(bb),[0,a(aK),[0,a(R),0]]]],aQL=a(p),aQM=a("32185"),aQN=a("38827"),aQO=a(x),aQP=a("6642"),aQQ=a("45469"),aQR=a(p),aQS=a("28722"),aQT=a(G0),aQU=a(x),aQV=a("5848"),aQW=a("40418"),aQX=a(p),aQY=a("26813"),aQZ=a("32152"),aQ0=a(x),aQ1=a("5339"),aQ2=a("37491"),aQ4=[0,a(c),ah,11,ah,46,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aQJ=[0,a(V),1506,5,1509,36,[0,a(bb),[0,a(aK),[0,a(R),0]]]],aQr=a(p),aQs=a("25907"),aQt=a(yr),aQu=a(x),aQv=a("5357"),aQw=a("36621"),aQx=a(p),aQy=a("23094"),aQz=a("27814"),aQA=a(x),aQB=a("4720"),aQC=a("32534"),aQD=a(p),aQE=a("21567"),aQF=a("25874"),aQG=a(x),aQH=a("4307"),aQI=a("30881"),aQK=[0,a(c),ah,11,ah,46,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aQp=[0,a(V),1551,5,1554,36,[0,a(bb),[0,a(aK),[0,a(R),0]]]],aP9=a(p),aP_=a(GT),aP$=a("39914"),aQa=a(x),aQb=a("6828"),aQc=a("46742"),aQd=a(p),aQe=a("29526"),aQf=a("35538"),aQg=a(x),aQh=a("6012"),aQi=a("41550"),aQj=a(p),aQk=a("27564"),aQl=a("33052"),aQm=a(x),aQn=a("5488"),aQo=a("38541"),aQq=[0,a(c),ah,11,ah,46,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aP7=[0,a(V),Bt,5,1598,36,[0,a(bb),[0,a(aK),[0,a(R),0]]]],aPP=a(p),aPQ=a("26632"),aPR=a("32139"),aPS=a(x),aPT=a("5507"),aPU=a("37646"),aPV=a(p),aPW=a("23741"),aPX=a("28593"),aPY=a(x),aPZ=a("4852"),aP0=a("33445"),aP1=a(p),aP2=a("22171"),aP3=a("36598"),aP4=a(x),aP5=a("4428"),aP6=a("31026"),aP8=[0,a(c),ah,11,ah,46,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aPN=[0,a(V),1640,5,1643,36,[0,a(bb),[0,a(aK),[0,a(R),0]]]],aPv=a(p),aPw=a("33999"),aPx=a("41016"),aPy=a(x),aPz=a("7016"),aPA=a("48032"),aPB=a(p),aPC=a("30341"),aPD=a("36519"),aPE=a(x),aPF=a("6178"),aPG=a("42697"),aPH=a(p),aPI=a("28325"),aPJ=a("33964"),aPK=a(x),aPL=a("5639"),aPM=a("39605"),aPO=[0,a(c),ah,11,ah,46,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aPt=[0,a(V),1684,5,1687,36,[0,a(bb),[0,a(aK),[0,a(R),0]]]],aPb=a(p),aPc=a("27367"),aPd=a(GT),aPe=a(x),aPf=a("5659"),aPg=a("38685"),aPh=a(p),aPi=a("24396"),aPj=a("29382"),aPk=a(x),aPl=a(JF),aPm=a("34368"),aPn=a(p),aPo=a("22783"),aPp=a("27332"),aPq=a(x),aPr=a("4550"),aPs=a("31882"),aPu=[0,a(c),ah,11,ah,46,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aO$=[0,a(V),sx,5,1732,36,[0,a(bb),[0,a(aK),[0,a(R),0]]]],aOT=a(p),aOU=a("35002"),aOV=a("42226"),aOW=a(x),aOX=a("7223"),aOY=a("49449"),aOZ=a(p),aO0=a("31236"),aO1=a("37596"),aO2=a(x),aO3=a("6360"),aO4=a("43957"),aO5=a(p),aO6=a("29161"),aO7=a("34966"),aO8=a(x),aO9=a("5805"),aO_=a("40773"),aPa=[0,a(c),ah,11,ah,46,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aOR=[0,a(V),1773,5,1776,36,[0,a(bb),[0,a(aK),[0,a(R),0]]]],aOz=a(p),aOA=a("28174"),aOB=a("34000"),aOC=a(x),aOD=a("5826"),aOE=a("39826"),aOF=a(p),aOG=a(JN),aOH=a("30249"),aOI=a(x),aOJ=a("5133"),aOK=a("35382"),aOL=a(p),aOM=a("23455"),aON=a("28138"),aOO=a(x),aOP=a("4684"),aOQ=a("32823"),aOS=[0,a(c),ah,11,ah,46,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aOx=[0,a(V),1818,5,1821,36,[0,a(bb),[0,a(aK),[0,a(R),0]]]],aOf=a(p),aOg=a("35114"),aOh=a("42361"),aOi=a(x),aOj=a("7246"),aOk=a("49607"),aOl=a(p),aOm=a("31336"),aOn=a("37716"),aOo=a(x),aOp=a("6380"),aOq=a("44098"),aOr=a(p),aOs=a("29254"),aOt=a("35078"),aOu=a(x),aOv=a("5824"),aOw=a("40903"),aOy=[0,a(c),ah,11,ah,46,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aOd=[0,a(V),r2,5,1865,36,[0,a(bb),[0,a(aK),[0,a(R),0]]]],aNX=a(p),aNY=a("28264"),aNZ=a("34109"),aN0=a(x),aN1=a("5845"),aN2=a("39953"),aN3=a(p),aN4=a("25196"),aN5=a("30346"),aN6=a(x),aN7=a("5149"),aN8=a("35495"),aN9=a(p),aN_=a("23530"),aN$=a("28228"),aOa=a(x),aOb=a("4699"),aOc=a("32928"),aOe=[0,a(c),ah,11,ah,46,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aNV=[0,a(V),1907,5,1910,36,[0,a(bb),[0,a(aK),[0,a(R),0]]]],aND=a(p),aNE=a("35500"),aNF=a("42827"),aNG=a(x),aNH=a("7326"),aNI=a("50153"),aNJ=a(p),aNK=a("31681"),aNL=a("38131"),aNM=a(x),aNN=a("6450"),aNO=a("44583"),aNP=a(p),aNQ=a("29576"),aNR=a("35464"),aNS=a(x),aNT=a("5888"),aNU=a("41353"),aNW=[0,a(c),ah,11,ah,46,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aNB=[0,a(V),iU,5,1954,36,[0,a(bb),[0,a(aK),[0,a(R),0]]]],aNj=a(p),aNk=a("28575"),aNl=a("34484"),aNm=a(x),aNn=a("5909"),aNo=a("40392"),aNp=a(p),aNq=a("25473"),aNr=a("30680"),aNs=a(x),aNt=a("5206"),aNu=a("35885"),aNv=a(p),aNw=a("23789"),aNx=a("28539"),aNy=a(x),aNz=a("4751"),aNA=a("33290"),aNC=[0,a(c),ah,11,ah,46,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aNh=[0,a(V),1996,5,j3,36,[0,a(bb),[0,a(aK),[0,a(R),0]]]],aM1=a(p),aM2=a("35855"),aM3=a("43255"),aM4=a(x),aM5=a("7399"),aM6=a("50655"),aM7=a(p),aM8=a("31998"),aM9=a("38512"),aM_=a(x),aM$=a("6515"),aNa=a("45029"),aNb=a(p),aNc=a("29872"),aNd=a("35819"),aNe=a(x),aNf=a("5947"),aNg=a("41767"),aNi=[0,a(c),ah,11,ah,46,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aMZ=[0,a(V),2071,5,2074,36,[0,a(bb),[0,a(aK),[0,a(R),0]]]],aMH=a(p),aMI=a("28861"),aMJ=a(Ll),aMK=a(x),aML=a("5968"),aMM=a("40796"),aMN=a(p),aMO=a("25728"),aMP=a("30987"),aMQ=a(x),aMR=a("5258"),aMS=a("36244"),aMT=a(p),aMU=a("24027"),aMV=a("28824"),aMW=a(x),aMX=a("4799"),aMY=a(HW),aM0=[0,a(c),ah,11,ah,46,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aMF=[0,a(V),2118,5,2121,36,[0,a(bb),[0,a(aK),[0,a(R),0]]]],aMn=a(p),aMo=a("36626"),aMp=a("44185"),aMq=a(x),aMr=a("7558"),aMs=a("51744"),aMt=a(p),aMu=a("32686"),aMv=a(y$),aMw=a(x),aMx=a("6655"),aMy=a("45997"),aMz=a(p),aMA=a("30514"),aMB=a("36589"),aMC=a(x),aMD=a("6075"),aME=a("42665"),aMG=[0,a(c),ah,11,ah,46,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aMl=[0,a(V),2162,5,2165,36,[0,a(bb),[0,a(aK),[0,a(R),0]]]],aL5=a(p),aL6=a("29482"),aL7=a("35578"),aL8=a(x),aL9=a("6096"),aL_=a("41673"),aL$=a(p),aMa=a("26281"),aMb=a("31653"),aMc=a(x),aMd=a("5371"),aMe=a("37023"),aMf=a(p),aMg=a("24544"),aMh=a("29444"),aMi=a(x),aMj=a("4902"),aMk=a("34346"),aMm=[0,a(c),ah,11,ah,46,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aL3=[0,a(V),2207,5,2210,36,[0,a(bb),[0,a(aK),[0,a(R),0]]]],aLL=a(p),aLM=a("36835"),aLN=a("44437"),aLO=a(x),aLP=a("7601"),aLQ=a("52039"),aLR=a(p),aLS=a("32872"),aLT=a("39564"),aLU=a(x),aLV=a("6693"),aLW=a("46259"),aLX=a(p),aLY=a("30688"),aLZ=a("36798"),aL0=a(x),aL1=a("6110"),aL2=a("42908"),aL4=[0,a(c),ah,11,ah,46,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aLJ=[0,a(V),2251,5,2254,36,[0,a(bb),[0,a(aK),[0,a(R),0]]]],aLr=a(p),aLs=a("29650"),aLt=a("35781"),aLu=a(x),aLv=a("6131"),aLw=a("41911"),aLx=a(p),aLy=a("26431"),aLz=a("31833"),aLA=a(x),aLB=a("5402"),aLC=a("37234"),aLD=a(p),aLE=a("24684"),aLF=a("29612"),aLG=a(x),aLH=a("4930"),aLI=a("34542"),aLK=[0,a(c),ah,11,ah,46,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aLp=[0,a(V),2296,5,2299,36,[0,a(bb),[0,a(aK),[0,a(R),0]]]],aK9=a(p),aK_=a("36864"),aK$=a("44473"),aLa=a(x),aLb=a("7607"),aLc=a("52081"),aLd=a(p),aLe=a("32898"),aLf=a("39596"),aLg=a(x),aLh=a("6698"),aLi=a("46296"),aLj=a(p),aLk=a("30713"),aLl=a("36827"),aLm=a(x),aLn=a("6115"),aLo=a("42942"),aLq=[0,a(c),ah,11,ah,46,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aK7=[0,a(V),2340,5,2343,36,[0,a(bb),[0,a(aK),[0,a(R),0]]]],aKP=a(p),aKQ=a("29674"),aKR=a("35810"),aKS=a(x),aKT=a("6136"),aKU=a("41945"),aKV=a(p),aKW=a("26452"),aKX=a("31858"),aKY=a(x),aKZ=a("5406"),aK0=a("37264"),aK1=a(p),aK2=a("24704"),aK3=a("29636"),aK4=a(x),aK5=a("4934"),aK6=a(G0),aK8=[0,a(c),ah,11,ah,46,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aKN=[0,a(V),2385,5,2388,36,[0,a(bb),[0,a(aK),[0,a(R),0]]]],aKv=a(p),aKw=a("37140"),aKx=a("44807"),aKy=a(x),aKz=a("7664"),aKA=a("52472"),aKB=a(p),aKC=a("33145"),aKD=a("39893"),aKE=a(x),aKF=a("6748"),aKG=a("46643"),aKH=a(p),aKI=a("30943"),aKJ=a("37103"),aKK=a(x),aKL=a("6161"),aKM=a("43264"),aKO=[0,a(c),ah,11,ah,46,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aKt=[0,a(V),2429,5,2432,36,[0,a(bb),[0,a(aK),[0,a(R),0]]]],aKb=a(p),aKc=a("29897"),aKd=a("36079"),aKe=a(x),aKf=a("6182"),aKg=a("42260"),aKh=a(p),aKi=a("26650"),aKj=a("32097"),aKk=a(x),aKl=a("5447"),aKm=a("37543"),aKn=a(p),aKo=a("24889"),aKp=a("29858"),aKq=a(x),aKr=a("4971"),aKs=a(Ll),aKu=[0,a(c),ah,11,ah,46,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aJ$=[0,a(V),2474,5,2476,36,[0,a(bb),[0,a(aK),[0,a(R),0]]]],aJT=a(p),aJU=a("37252"),aJV=a("44941"),aJW=a(x),aJX=a("7687"),aJY=a("52629"),aJZ=a(p),aJ0=a("33244"),aJ1=a("40013"),aJ2=a(x),aJ3=a("6768"),aJ4=a("46783"),aJ5=a(p),aJ6=a("31036"),aJ7=a("37215"),aJ8=a(x),aJ9=a("6179"),aJ_=a("43394"),aKa=[0,a(c),ah,11,ah,46,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aJR=[0,a(V),2517,5,2519,36,[0,a(bb),[0,a(aK),[0,a(R),0]]]],aJz=a(p),aJA=a("29986"),aJB=a("36187"),aJC=a(x),aJD=a("6201"),aJE=a("42386"),aJF=a(p),aJG=a("26730"),aJH=a("32193"),aJI=a(x),aJJ=a("5463"),aJK=a("37656"),aJL=a(p),aJM=a("24964"),aJN=a("29948"),aJO=a(x),aJP=a(JF),aJQ=a("34934"),aJS=[0,a(c),ah,11,ah,46,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aWP=[0,a(c),ah,11,ah,46,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aJy=[0,a(c),ah,11,ah,46,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aJu=[0,a(C),Bc,5,Bc,28,[0,a(CN),[0,a(aJ),[0,a(aI),[0,a(av),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],aJv=[0,a(c),hr,11,hr,41,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aJt=[0,a(C),BL,14,BL,44,[0,a(CN),[0,a(aJ),[0,a(aI),[0,a(av),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],aJp=[0,a(C),Au,14,Au,36,[0,a(ic),[0,a(aJ),[0,a(aI),[0,a(av),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],aJn=a(p),aJo=a(p),aJq=[0,a(c),ph,10,ph,32,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aJm=[0,a(c),ph,10,ph,32,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aJh=[0,a(V),LP,7,LP,18,[0,a(pn),[0,a(aK),[0,a(R),0]]]],aJe=a(hk),aJf=a(ry),aJg=a(fz),aJi=[0,a(c),c_,11,c_,46,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aJc=[0,a(cn),Me,7,Me,18,[0,a(pn),[0,a(R),[0,a(cy),[0,a(cp),0]]]]],aI$=a(nB),aJa=a(BH),aJb=a(mg),aJd=[0,a(c),c_,11,c_,46,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aJj=[0,a(c),c_,11,c_,46,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aI8=[0,a(V),HB,29,HB,64,[0,a(s7),[0,a(aK),[0,a(R),0]]]],aI6=a(hk),aI7=a(fz),aI9=[0,a(c),c_,11,c_,46,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aI4=[0,a(cn),cW,29,cW,64,[0,a(s7),[0,a(R),[0,a(cy),[0,a(cp),0]]]]],aI2=a(nB),aI3=a(mg),aI5=[0,a(c),c_,11,c_,46,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aI_=[0,a(c),c_,11,c_,46,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aIW=[0,a(c),CC,14,CC,50,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aIS=[0,a(V),BZ,14,BZ,50,[0,a("Article 25"),[0,a(aK),[0,a(R),0]]]],aIN=a(F4),aIO=a(sn),aIP=a("0.0172"),aIQ=a(F4),aIR=a(sn),aIH=[0,a(C),oO,14,oO,64,[0,a(hd),[0,a(aJ),[0,a(aI),[0,a(av),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],aID=[0,a(C),x4,14,x4,59,[0,a(hd),[0,a(aJ),[0,a(aI),[0,a(av),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],aIz=[0,a(f$),no,14,no,36,[0,a(Kk),[0,a(zJ),0]]],aIx=a(Fe),aIy=a(eP),aIt=[0,a(V),Ex,14,Ex,47,[0,a(ty),[0,a(aK),[0,a(R),0]]]],aIs=a("0.416"),aIo=[0,a(V),J0,14,J0,47,[0,a(ty),[0,a(aK),[0,a(R),0]]]],aIn=a(w2),aIj=[0,a(V),zB,14,zB,47,[0,a(ty),[0,a(aK),[0,a(R),0]]]],aIi=a("560085"),aIe=[0,a(V),xD,14,xD,48,[0,a("Article 26"),[0,a(aK),[0,a(R),0]]]],aId=a(AI),aH$=[0,a(V),Ey,15,Ey,49,[0,a("Article 22"),[0,a(aK),[0,a(R),0]]]],aH_=a("2211133"),aH6=[0,a(V),Hu,14,Hu,42,[0,a("Article 21"),[0,a(aK),[0,a(R),0]]]],aH5=a(iI),aH1=[0,a(V),Kz,14,Kz,41,[0,a("Article 20"),[0,a(aK),[0,a(R),0]]]],aH0=a(jX),aH2=[0,a(c),mJ,11,mJ,38,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aHZ=[0,a(c),mJ,11,mJ,38,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aH3=[0,a(U),[0,a("montant_forfaitaire_d832_10"),0]],aH7=[0,a(c),kD,11,kD,39,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aH4=[0,a(c),kD,11,kD,39,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aH8=[0,a(U),[0,a("montant_minimal_aide_d832_10"),0]],aIa=[0,a(c),ps,11,ps,45,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aH9=[0,a(c),ps,11,ps,45,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aIb=[0,a(U),[0,a("coefficient_multiplicateur_d832_11"),0]],aIf=[0,a(c),mQ,11,mQ,45,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aIc=[0,a(c),mQ,11,mQ,45,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aIg=[0,a(U),[0,a("coefficient_multiplicateur_d832_18"),0]],aIk=[0,a(c),or,11,or,44,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aIh=[0,a(c),or,11,or,44,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aIl=[0,a(U),[0,a("montant_limite_tranches_d832_15_1"),0]],aIp=[0,a(c),nv,11,nv,44,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aIm=[0,a(c),nv,11,nv,44,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aIq=[0,a(U),[0,a("taux_tranche_inf\xc3\xa9rieure_d832_15_1"),0]],aIu=[0,a(c),m$,11,m$,44,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aIr=[0,a(c),m$,11,m$,44,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aIv=[0,a(U),[0,a("taux_tranche_sup\xc3\xa9rieure_d832_15_1"),0]],aIA=[0,a(c),n1,11,n1,33,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aIw=[0,a(c),n1,11,n1,33,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aIB=[0,a(U),[0,a(Ej),0]],aIE=[0,a(c),oF,3,oF,22,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aIF=[0,a(U),[0,a(my),0]],aIC=[0,a(c),pD,10,pD,35,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aII=[0,a(c),oF,3,oF,22,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aIJ=[0,a(U),[0,a(o5),0]],aIG=[0,a(c),ml,10,ml,40,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aIK=[0,a(U),[0,a(gS),[0,a(ks),0]]],aIL=[0,a(U),[0,a(gS),[0,a(ks),0]]],aIT=[0,a(c),l6,11,l6,47,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aIM=[0,a(c),l6,11,l6,47,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aIU=[0,a(U),[0,a("coefficient_multiplicateur_d832_17_3"),0]],aIX=[0,a(c),nS,3,nS,25,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aIY=[0,a(U),[0,a(j7),0]],aIV=[0,a(c),eC,10,eC,23,[0,a(dQ),[0,a(j),[0,a(d),0]]]],aIZ=[0,a(U),[0,a(eW),[0,a(af),0]]],aI0=[0,a(U),[0,a(eW),[0,a(af),0]]],aJk=[0,a(c),c_,11,c_,46,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aI1=[0,a(c),c_,11,c_,46,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aJl=[0,a(U),[0,a("montant_forfaitaire_charges_d832_10"),0]],aJr=[0,a(U),[0,a(ag),0]],aJw=[0,a(c),hr,11,hr,41,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aJs=[0,a(c),hr,11,hr,41,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aJx=[0,a(U),[0,a("ressources_m\xc3\xa9nage_avec_d832_18"),0]],aWQ=[0,a(U),[0,a(cl),0]],aWT=[0,a(c),ky,11,ky,33,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aWR=[0,a(c),ky,11,ky,33,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aWU=[0,a(U),[0,a(xp),0]],aW0=[0,a(U),[0,a(fN),0]],aXn=[0,a(c),iL,10,iL,14,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aW1=[0,a(c),iL,10,iL,14,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aXo=[0,a(U),[0,a("plafond_mensualit\xc3\xa9_d832_10_3_base"),0]],aXr=[0,a(c),i4,3,i4,36,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aXs=[0,a(U),[0,a(ob),0]],aXp=[0,a(c),fI,10,fI,37,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],aXv=[0,a(c),i4,3,i4,36,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aXw=[0,a(U),[0,a(nk),0]],aXt=[0,a(c),gy,10,gy,31,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],aXz=[0,a(c),i4,3,i4,36,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aXA=[0,a(U),[0,a(n8),0]],aXx=[0,a(c),go,10,go,32,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],aXB=[0,a(U),[0,a(gB),[0,a(ei),0]]],aXC=[0,a(U),[0,a(gB),[0,a(ei),0]]],aXG=[0,a(c),jW,10,jW,17,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aXD=[0,a(c),jW,10,jW,17,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aXH=[0,a(U),[0,a("coefficient_prise_en_charge_d832_10_formule"),0]],aXU=[0,a(U),[0,a(fR),0]],aX2=[0,a(c),gx,10,gx,25,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aXV=[0,a(c),gx,10,gx,25,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aX3=[0,a(U),[0,a("plafond_mensualit\xc3\xa9_d832_10_3_copropri\xc3\xa9taires"),0]],aX$=[0,a(c),gN,10,gN,29,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aX4=[0,a(c),gN,10,gN,29,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aYa=[0,a(U),[0,a(zv),0]],aYg=[0,a(c),oE,10,oE,17,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aYb=[0,a(c),oE,10,oE,17,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aYh=[0,a(U),[0,a("coefficient_prise_en_charge_d832_10_arrondi"),0]],aYL=[0,a(U),[0,a(aR),0]],aYO=[0,a(c),oa,10,oa,29,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aYM=[0,a(c),oa,10,oa,29,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aYP=[0,a(U),[0,a(L4),0]],aYU=[0,a(c),m9,10,m9,15,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aYQ=[0,a(c),m9,10,m9,15,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aYV=[0,a(U),[0,a("coefficient_prise_en_charge_d832_10_seuil"),0]],aZF=[0,a(U),[0,a(a4),0]],aZK=[0,a(c),o9,10,o9,29,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aZG=[0,a(c),o9,10,o9,29,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],aZL=[0,a(U),[0,a(fS),0]],aZY=[0,a(U),[0,a(bD),0]],aHW=[0,a(C),GN,14,GN,36,[0,a(eR),[0,a(bF),[0,a(aV),[0,a(aI),[0,a(av),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]]],aHN=[0,a(_),[0,a(a4),[0,a(P),0]]],aHO=[0,a(_),[0,a(a4),0]],aHP=[0,a(_),[0,a(a4),[0,a(O),0]]],aHQ=[0,a(_),[0,a(a4),0]],aHR=a(p),aHS=[0,a(_),[0,a(a4),[0,a(P),0]]],aHT=[0,a(_),[0,a(a4),0]],aHU=[0,a(_),[0,a(a4),[0,a(O),0]]],aHV=[0,a(_),[0,a(a4),0]],aHX=[0,a(c),kp,10,kp,25,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],aHM=[0,a(c),kp,10,kp,25,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],aHJ=[0,a(C),Kr,14,Kr,33,[0,a(eR),[0,a(bF),[0,a(aV),[0,a(aI),[0,a(av),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]]],aHH=a(p),aHI=a(p),aHD=[0,a(C),z4,14,z4,36,[0,a(eR),[0,a(bF),[0,a(aV),[0,a(aI),[0,a(av),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]]],aGX=a(p),aGY=[0,a(_),[0,a(aR),[0,a(P),0]]],aGZ=[0,a(_),[0,a(aR),0]],aG0=[0,a(_),[0,a(aR),[0,a(O),0]]],aG1=[0,a(_),[0,a(aR),0]],aG2=[0,a(af),[0,a(al),[0,a(P),0]]],aG3=[0,a(af),[0,a(al),0]],aG4=[0,a(af),[0,a(al),[0,a(O),0]]],aG5=[0,a(af),[0,a(al),0]],aG6=a(e1),aG7=[0,a(_),[0,a(aR),[0,a(P),0]]],aG8=[0,a(_),[0,a(aR),0]],aG9=[0,a(_),[0,a(aR),[0,a(O),0]]],aG_=[0,a(_),[0,a(aR),0]],aG$=[0,a(af),[0,a(al),[0,a(P),0]]],aHa=[0,a(af),[0,a(al),0]],aHb=[0,a(af),[0,a(al),[0,a(O),0]]],aHc=[0,a(af),[0,a(al),0]],aHd=[0,a(_),[0,a(aR),[0,a(P),0]]],aHe=[0,a(_),[0,a(aR),0]],aHf=[0,a(_),[0,a(aR),[0,a(O),0]]],aHg=[0,a(_),[0,a(aR),0]],aHh=[0,a(_),[0,a(aR),[0,a(P),0]]],aHi=[0,a(_),[0,a(aR),0]],aHj=[0,a(_),[0,a(aR),[0,a(O),0]]],aHk=[0,a(_),[0,a(aR),0]],aHl=[0,a(af),[0,a(al),[0,a(P),0]]],aHm=[0,a(af),[0,a(al),0]],aHn=[0,a(af),[0,a(al),[0,a(O),0]]],aHo=[0,a(af),[0,a(al),0]],aHp=a(e1),aHq=[0,a(_),[0,a(aR),[0,a(P),0]]],aHr=[0,a(_),[0,a(aR),0]],aHs=[0,a(_),[0,a(aR),[0,a(O),0]]],aHt=[0,a(_),[0,a(aR),0]],aHu=[0,a(af),[0,a(al),[0,a(P),0]]],aHv=[0,a(af),[0,a(al),0]],aHw=[0,a(af),[0,a(al),[0,a(O),0]]],aHx=[0,a(af),[0,a(al),0]],aHy=[0,a(_),[0,a(aR),[0,a(P),0]]],aHz=[0,a(_),[0,a(aR),0]],aHA=[0,a(_),[0,a(aR),[0,a(O),0]]],aHB=[0,a(_),[0,a(aR),0]],aHC=a(p),aHE=[0,a(c),pf,10,pf,40,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],aGW=[0,a(c),pf,10,pf,40,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],aGS=[0,a(C),Hh,5,Hh,26,[0,a(dS),[0,a(bF),[0,a(aV),[0,a(aI),[0,a(av),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]]],aGQ=a(nw),aGR=a(nw),aGT=[0,a(c),iz,10,iz,15,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],aGP=[0,a(C),Gj,14,Gj,49,[0,a(dS),[0,a(bF),[0,a(aV),[0,a(aI),[0,a(av),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]]],aGN=a(ip),aGO=a(ip),aGJ=[0,a(C),AP,14,AP,36,[0,a(eR),[0,a(bF),[0,a(aV),[0,a(aI),[0,a(av),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]]],aGj=a(p),aGk=[0,a(_),[0,a(ag),[0,a(P),0]]],aGl=[0,a(_),[0,a(ag),0]],aGm=[0,a(_),[0,a(ag),[0,a(O),0]]],aGn=[0,a(_),[0,a(ag),0]],aGo=[0,a(_),[0,a(fL),[0,a(P),0]]],aGp=[0,a(_),[0,a(fL),0]],aGq=[0,a(_),[0,a(fL),[0,a(O),0]]],aGr=[0,a(_),[0,a(fL),0]],aGs=[0,a(_),[0,a(ag),[0,a(P),0]]],aGt=[0,a(_),[0,a(ag),0]],aGu=[0,a(_),[0,a(ag),[0,a(O),0]]],aGv=[0,a(_),[0,a(ag),0]],aGw=[0,a(_),[0,a(ag),[0,a(P),0]]],aGx=[0,a(_),[0,a(ag),0]],aGy=[0,a(_),[0,a(ag),[0,a(O),0]]],aGz=[0,a(_),[0,a(ag),0]],aGA=[0,a(_),[0,a(fL),[0,a(P),0]]],aGB=[0,a(_),[0,a(fL),0]],aGC=[0,a(_),[0,a(fL),[0,a(O),0]]],aGD=[0,a(_),[0,a(fL),0]],aGE=[0,a(_),[0,a(ag),[0,a(P),0]]],aGF=[0,a(_),[0,a(ag),0]],aGG=[0,a(_),[0,a(ag),[0,a(O),0]]],aGH=[0,a(_),[0,a(ag),0]],aGI=a(p),aGK=[0,a(c),o1,10,o1,20,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],aGi=[0,a(c),o1,10,o1,20,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],aGe=[0,a(C),xt,5,xt,26,[0,a(dS),[0,a(bF),[0,a(aV),[0,a(aI),[0,a(av),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]]],aGb=a(dU),aGc=a(dU),aGd=a(lT),aGf=[0,a(c),iE,10,iE,17,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],aGa=[0,a(C),Al,14,Al,49,[0,a(dS),[0,a(bF),[0,a(aV),[0,a(aI),[0,a(av),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]]],aF9=a(dU),aF_=a(dU),aF$=a(lT),aF5=[0,a(C),FN,14,FN,40,[0,a(eR),[0,a(bF),[0,a(aV),[0,a(aI),[0,a(av),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]]],aF1=[0,a(C),FW,14,FW,55,[0,a(Hp),[0,a(bF),[0,a(aV),[0,a(aI),[0,a(av),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]]],aFS=[0,a(_),[0,a(fC),[0,a(P),0]]],aFT=[0,a(_),[0,a(fC),0]],aFU=[0,a(_),[0,a(fC),[0,a(O),0]]],aFV=[0,a(_),[0,a(fC),0]],aFW=[0,a(_),[0,a(fC),[0,a(P),0]]],aFX=[0,a(_),[0,a(fC),0]],aFY=[0,a(_),[0,a(fC),[0,a(O),0]]],aFZ=[0,a(_),[0,a(fC),0]],aF0=a(p),aF2=[0,a(c),nH,11,nH,52,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],aFR=[0,a(c),nH,11,nH,52,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],aFN=[0,a(C),HY,5,HY,26,[0,a(dS),[0,a(bF),[0,a(aV),[0,a(aI),[0,a(av),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]]],aFM=a(nw),aFO=[0,a(c),iW,10,iW,17,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],aFL=[0,a(C),BP,14,BP,49,[0,a(dS),[0,a(bF),[0,a(aV),[0,a(aI),[0,a(av),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]]],aFK=a(ip),aFE=[0,a(C),A3,14,A3,70,[0,a(eR),[0,a(bF),[0,a(aV),[0,a(aI),[0,a(av),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]]],aFA=[0,a(C),Gz,14,Gz,69,[0,a(eR),[0,a(bF),[0,a(aV),[0,a(aI),[0,a(av),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]]],aFw=[0,a(C),z9,14,z9,75,[0,a(eR),[0,a(bF),[0,a(aV),[0,a(aI),[0,a(av),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]]],aFs=[0,a(C),Bx,14,Bx,44,[0,a(Hp),[0,a(bF),[0,a(aV),[0,a(aI),[0,a(av),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]]],aFt=[0,a(c),mx,11,mx,41,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],aFr=[0,a(c),mx,11,mx,41,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],aFn=[0,a(C),JB,14,JB,36,[0,a(dS),[0,a(bF),[0,a(aV),[0,a(aI),[0,a(av),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]]],aFo=[0,a(c),iu,19,iu,41,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],aFj=[0,a(C),G$,14,G$,40,[0,a(eR),[0,a(bF),[0,a(aV),[0,a(aI),[0,a(av),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]]],aFf=[0,a(V),Js,14,Js,48,[0,a(xu),[0,a(fA),[0,a(R),0]]]],aFd=a("2142091"),aFe=a("1339340"),aE$=[0,a(V),ID,14,ID,41,[0,a("Article 32"),[0,a(fA),[0,a(R),0]]]],aE9=a(sA),aE_=a("2668"),aE3=[0,a(C),Kw,14,Kw,64,[0,a(dS),[0,a(bF),[0,a(aV),[0,a(aI),[0,a(av),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]]],aEZ=[0,a(C),IW,14,IW,59,[0,a(dS),[0,a(bF),[0,a(aV),[0,a(aI),[0,a(av),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]]],aEV=[0,a(C),Mj,14,Mj,55,[0,a(dS),[0,a(bF),[0,a(aV),[0,a(aI),[0,a(av),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]]],aER=[0,a(C),xd,14,xd,36,[0,a(eR),[0,a(bF),[0,a(aV),[0,a(aI),[0,a(av),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]]],aEP=a(p),aEQ=a(p),aES=[0,a(c),kv,10,kv,32,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],aEO=[0,a(c),kv,10,kv,32,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],aEK=[0,a(V),Kq,14,Kq,48,[0,a(Mn),[0,a(fA),[0,a(R),0]]]],aEa=a(p),aEb=a("44630"),aEc=a("52321"),aEd=a(x),aEe=a("55788"),aEf=a(ab),aEg=a("59704"),aEh=a(ak),aEi=a("63635"),aEj=a(an),aEk=a("7119"),aEl=a("68637"),aEm=a(p),aEn=a("40814"),aEo=a("47632"),aEp=a(x),aEq=a("50787"),aEr=a(ab),aEs=a("54365"),aEt=a(ak),aEu=a("57929"),aEv=a(an),aEw=a("6434"),aEx=a("61727"),aEy=a(p),aEz=a("38740"),aEA=a("45057"),aEB=a(x),aEC=a("47802"),aED=a(ab),aEE=a("50957"),aEF=a(ak),aEG=a("54110"),aEH=a(an),aEI=a("5971"),aEJ=a("57657"),aEL=[0,a(c),gF,10,gF,44,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],aD_=[0,a(cn),yb,14,yb,48,[0,a(Mn),[0,a(R),[0,a(cy),[0,a(cp),0]]]]],aDA=a(p),aDB=a("44443"),aDC=a("52101"),aDD=a(x),aDE=a("55555"),aDF=a(ab),aDG=a("59454"),aDH=a(ak),aDI=a("63369"),aDJ=a(an),aDK=a("7089"),aDL=a("68350"),aDM=a(p),aDN=a("40643"),aDO=a("47433"),aDP=a(x),aDQ=a("50575"),aDR=a(ab),aDS=a("54138"),aDT=a(ak),aDU=a("57687"),aDV=a(an),aDW=a("6407"),aDX=a("61469"),aDY=a(p),aDZ=a("38578"),aD0=a("44869"),aD1=a(x),aD2=a("47602"),aD3=a(ab),aD4=a("50744"),aD5=a(ak),aD6=a("53884"),aD7=a(an),aD8=a("5946"),aD9=a("57416"),aD$=[0,a(c),gF,10,gF,44,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],aDu=[0,a(c),Dp,14,Dp,50,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],aDp=[0,a(C),yZ,14,yZ,35,[0,a(dS),[0,a(bF),[0,a(aV),[0,a(aI),[0,a(av),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]]],aDq=[0,a(c),ih,12,ih,33,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],aDl=[0,a(V),zF,14,zF,42,[0,a("Article 29"),[0,a(fA),[0,a(R),0]]]],aDk=a(iI),aDg=[0,a(V),y7,14,y7,41,[0,a("Article 28"),[0,a(fA),[0,a(R),0]]]],aDf=a(jX),aDb=[0,a(V),Gd,14,Gd,35,[0,a(xu),[0,a(fA),[0,a(R),0]]]],aDa=a("121726"),aDc=[0,a(c),nM,10,nM,31,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],aC$=[0,a(c),nM,10,nM,31,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],aDd=[0,a(_),[0,a("coefficient_r_d832_25"),0]],aDh=[0,a(c),nh,11,nh,38,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],aDe=[0,a(c),nh,11,nh,38,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],aDi=[0,a(_),[0,a("montant_forfaitaire_d832_24"),0]],aDm=[0,a(c),m7,11,m7,39,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],aDj=[0,a(c),m7,11,m7,39,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],aDn=[0,a(_),[0,a("montant_minimal_aide_d823_24"),0]],aDr=[0,a(c),ih,12,ih,33,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],aDo=[0,a(c),ih,12,ih,33,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],aDs=[0,a(_),[0,a("condition_2_du_832_25"),0]],aDv=[0,a(c),Cq,3,Cq,25,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],aDw=[0,a(_),[0,a(j7),0]],aDt=[0,a(c),eC,10,eC,23,[0,a(dQ),[0,a(j),[0,a(d),0]]]],aDx=[0,a(_),[0,a(eW),[0,a(af),0]]],aDy=[0,a(_),[0,a(eW),[0,a(af),0]]],aEM=[0,a(c),gF,10,gF,44,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],aDz=[0,a(c),gF,10,gF,44,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],aEN=[0,a(_),[0,a("plafond_\xc3\xa9quivalence_loyer_\xc3\xa9ligible"),0]],aET=[0,a(_),[0,a(ag),0]],aEW=[0,a(c),iq,3,iq,22,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],aEX=[0,a(_),[0,a(Je),0]],aEU=[0,a(c),nX,10,nX,31,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],aE0=[0,a(c),iq,3,iq,22,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],aE1=[0,a(_),[0,a(my),0]],aEY=[0,a(c),mO,10,mO,35,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],aE4=[0,a(c),iq,3,iq,22,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],aE5=[0,a(_),[0,a(o5),0]],aE2=[0,a(c),n5,10,n5,40,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],aE6=[0,a(_),[0,a(gS),[0,a(j5),0]]],aE7=[0,a(_),[0,a(gS),[0,a(j5),0]]],aFa=[0,a(c),pv,11,pv,38,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],aE8=[0,a(c),pv,11,pv,38,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],aFb=[0,a(_),[0,a("montant_forfaitaire_d832_27"),0]],aFg=[0,a(c),n3,10,n3,44,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],aFc=[0,a(c),n3,10,n3,44,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],aFh=[0,a(_),[0,a("coefficient_multiplicateur_d832_25"),0]],aFk=[0,a(c),oB,10,oB,36,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],aFi=[0,a(c),oB,10,oB,36,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],aFl=[0,a(_),[0,a("\xc3\xa9quivalence_loyer_\xc3\xa9ligible"),0]],aFp=[0,a(c),iu,19,iu,41,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],aFm=[0,a(c),iu,19,iu,41,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],aFq=[0,a(_),[0,a(KW),0]],aFu=[0,a(_),[0,a(fC),0]],aFx=[0,a(c),ij,3,ij,36,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],aFy=[0,a(_),[0,a(ob),0]],aFv=[0,a(c),fI,10,fI,37,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],aFB=[0,a(c),ij,3,ij,36,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],aFC=[0,a(_),[0,a(nk),0]],aFz=[0,a(c),gy,10,gy,31,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],aFF=[0,a(c),ij,3,ij,36,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],aFG=[0,a(_),[0,a(n8),0]],aFD=[0,a(c),go,10,go,32,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],aFH=[0,a(_),[0,a(gB),[0,a(ei),0]]],aFI=[0,a(_),[0,a(gB),[0,a(ei),0]]],aFP=[0,a(c),iW,10,iW,17,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],aFJ=[0,a(c),iW,10,iW,17,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],aFQ=[0,a(_),[0,a("coefficient_prise_en_charge_d832_25_formule"),0]],aF3=[0,a(_),[0,a(fL),0]],aF6=[0,a(c),nZ,10,nZ,36,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],aF4=[0,a(c),nZ,10,nZ,36,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],aF7=[0,a(_),[0,a("\xc3\xa9quivalence_loyer_minimale"),0]],aGg=[0,a(c),iE,10,iE,17,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],aF8=[0,a(c),iE,10,iE,17,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],aGh=[0,a(_),[0,a("coefficient_prise_en_charge_d832_25_arrondi"),0]],aGL=[0,a(_),[0,a(aR),0]],aGU=[0,a(c),iz,10,iz,15,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],aGM=[0,a(c),iz,10,iz,15,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],aGV=[0,a(_),[0,a("coefficient_prise_en_charge_d832_25_seuil"),0]],aHF=[0,a(_),[0,a(a4),0]],aHK=[0,a(c),o0,10,o0,29,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],aHG=[0,a(c),o0,10,o0,29,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],aHL=[0,a(_),[0,a(fS),0]],aHY=[0,a(_),[0,a(bD),0]],aC1=[0,a(C),r2,14,r2,33,[0,a(e9),[0,a(dT),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]]],aCZ=a(p),aC0=a(p),aCV=[0,a(C),gl,14,gl,39,[0,a(th),[0,a(dT),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]]],aCR=[0,a(C),GG,14,GG,36,[0,a(e9),[0,a(dT),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]]],aCI=[0,a(aj),[0,a(fH),[0,a(P),0]]],aCJ=[0,a(aj),[0,a(fH),0]],aCK=[0,a(aj),[0,a(fH),[0,a(O),0]]],aCL=[0,a(aj),[0,a(fH),0]],aCM=a(p),aCN=[0,a(aj),[0,a(fH),[0,a(P),0]]],aCO=[0,a(aj),[0,a(fH),0]],aCP=[0,a(aj),[0,a(fH),[0,a(O),0]]],aCQ=[0,a(aj),[0,a(fH),0]],aCS=[0,a(c),l1,10,l1,25,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],aCH=[0,a(c),l1,10,l1,25,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],aCE=[0,a(C),yE,14,yE,42,[0,a(th),[0,a(dT),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]]],aCA=[0,a(aT),kr,14,kr,36,[0,a(rL),[0,a(bG),[0,a(av),[0,a(w),[0,a(am),[0,a(v),0]]]]]]],aCq=a(p),aCr=[0,a(aj),[0,a(a4),[0,a(P),0]]],aCs=[0,a(aj),[0,a(a4),0]],aCt=[0,a(aj),[0,a(a4),[0,a(O),0]]],aCu=[0,a(aj),[0,a(a4),0]],aCv=[0,a(aj),[0,a(a4),[0,a(P),0]]],aCw=[0,a(aj),[0,a(a4),0]],aCx=[0,a(aj),[0,a(a4),[0,a(O),0]]],aCy=[0,a(aj),[0,a(a4),0]],aCz=a(p),aCB=[0,a(c),ol,10,ol,36,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],aCp=[0,a(c),ol,10,ol,36,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],aCk=[0,a(cn),CI,14,CI,33,[0,a(d7),[0,a(R),[0,a(cy),[0,a(cp),0]]]]],aCi=a(l5),aCj=a(l5),aCl=[0,a(c),eY,10,eY,17,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],aCh=[0,a(V),h_,14,h_,33,[0,a(d7),[0,a(b9),[0,a(R),0]]]],aCf=a(l5),aCg=a(l5),aCm=[0,a(c),eY,10,eY,17,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],aCb=[0,a(C),iU,14,iU,36,[0,a(e9),[0,a(dT),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]]],aBv=a(p),aBw=[0,a(aj),[0,a(ag),[0,a(P),0]]],aBx=[0,a(aj),[0,a(ag),0]],aBy=[0,a(aj),[0,a(ag),[0,a(O),0]]],aBz=[0,a(aj),[0,a(ag),0]],aBA=[0,a(af),[0,a(al),[0,a(P),0]]],aBB=[0,a(af),[0,a(al),0]],aBC=[0,a(af),[0,a(al),[0,a(O),0]]],aBD=[0,a(af),[0,a(al),0]],aBE=a(e1),aBF=[0,a(aj),[0,a(ag),[0,a(P),0]]],aBG=[0,a(aj),[0,a(ag),0]],aBH=[0,a(aj),[0,a(ag),[0,a(O),0]]],aBI=[0,a(aj),[0,a(ag),0]],aBJ=[0,a(af),[0,a(al),[0,a(P),0]]],aBK=[0,a(af),[0,a(al),0]],aBL=[0,a(af),[0,a(al),[0,a(O),0]]],aBM=[0,a(af),[0,a(al),0]],aBN=[0,a(aj),[0,a(ag),[0,a(P),0]]],aBO=[0,a(aj),[0,a(ag),0]],aBP=[0,a(aj),[0,a(ag),[0,a(O),0]]],aBQ=[0,a(aj),[0,a(ag),0]],aBR=[0,a(aj),[0,a(ag),[0,a(P),0]]],aBS=[0,a(aj),[0,a(ag),0]],aBT=[0,a(aj),[0,a(ag),[0,a(O),0]]],aBU=[0,a(aj),[0,a(ag),0]],aBV=[0,a(af),[0,a(al),[0,a(P),0]]],aBW=[0,a(af),[0,a(al),0]],aBX=[0,a(af),[0,a(al),[0,a(O),0]]],aBY=[0,a(af),[0,a(al),0]],aBZ=a(e1),aB0=[0,a(aj),[0,a(ag),[0,a(P),0]]],aB1=[0,a(aj),[0,a(ag),0]],aB2=[0,a(aj),[0,a(ag),[0,a(O),0]]],aB3=[0,a(aj),[0,a(ag),0]],aB4=[0,a(af),[0,a(al),[0,a(P),0]]],aB5=[0,a(af),[0,a(al),0]],aB6=[0,a(af),[0,a(al),[0,a(O),0]]],aB7=[0,a(af),[0,a(al),0]],aB8=[0,a(aj),[0,a(ag),[0,a(P),0]]],aB9=[0,a(aj),[0,a(ag),0]],aB_=[0,a(aj),[0,a(ag),[0,a(O),0]]],aB$=[0,a(aj),[0,a(ag),0]],aCa=a(p),aCc=[0,a(c),nf,10,nf,40,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],aBu=[0,a(c),nf,10,nf,40,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],aBp=[0,a(cn),nz,14,nz,33,[0,a(d7),[0,a(R),[0,a(cy),[0,a(cp),0]]]]],aBd=a(nO),aBe=a(cw),aBf=a(nO),aBg=a(fF),aBh=a(hU),aBi=a(hU),aBj=a(fF),aBk=a(fF),aBl=a(Ds),aBm=a(xF),aBn=a(hU),aBo=a(cw),aBq=[0,a(c),gA,10,gA,17,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],aBc=[0,a(V),n7,14,n7,33,[0,a(d7),[0,a(b9),[0,a(R),0]]]],aA2=a(nO),aA3=a(cw),aA4=a(nO),aA5=a(fF),aA6=a(hU),aA7=a(hU),aA8=a(fF),aA9=a(fF),aA_=a(Ds),aA$=a(xF),aBa=a(hU),aBb=a(cw),aBr=[0,a(c),gA,10,gA,17,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],aAY=[0,a(C),G1,14,G1,36,[0,a(e9),[0,a(dT),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]]],aAO=a(p),aAP=[0,a(aj),[0,a(fK),[0,a(P),0]]],aAQ=[0,a(aj),[0,a(fK),0]],aAR=[0,a(aj),[0,a(fK),[0,a(O),0]]],aAS=[0,a(aj),[0,a(fK),0]],aAT=[0,a(aj),[0,a(fK),[0,a(P),0]]],aAU=[0,a(aj),[0,a(fK),0]],aAV=[0,a(aj),[0,a(fK),[0,a(O),0]]],aAW=[0,a(aj),[0,a(fK),0]],aAX=a(p),aAZ=[0,a(c),mN,10,mN,32,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],aAN=[0,a(c),mN,10,mN,32,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],aAI=[0,a(cn),dC,14,dC,28,[0,a(d7),[0,a(R),[0,a(cy),[0,a(cp),0]]]]],aAG=a(dU),aAH=a(dU),aAJ=[0,a(c),e7,11,e7,25,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],aAF=[0,a(V),cd,14,cd,28,[0,a(d7),[0,a(b9),[0,a(R),0]]]],aAD=a(dU),aAE=a(dU),aAK=[0,a(c),e7,11,e7,25,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],aAy=[0,a(V),xH,14,xH,36,[0,a(Ee),[0,a(b9),[0,a(R),0]]]],aAu=a(Ki),aAv=a(mX),aAw=a(mX),aAx=a(Ki),aAz=[0,a(c),ge,10,ge,32,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],aAs=[0,a(cn),j2,14,j2,36,[0,a(Ee),[0,a(R),[0,a(cy),[0,a(cp),0]]]]],aAo=a(Le),aAp=a(mX),aAq=a(mX),aAr=a(Le),aAt=[0,a(c),ge,10,ge,32,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],aAj=[0,a(C),DX,5,DX,50,[0,a(e9),[0,a(dT),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]]],aAk=[0,a(c),i1,10,i1,17,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],aAi=[0,a(C),IZ,14,IZ,36,[0,a(e9),[0,a(dT),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]]],aAh=a(p),aAl=[0,a(c),i1,10,i1,17,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],aAg=[0,a(c),i1,10,i1,17,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],aAd=[0,a(C),HE,14,HE,28,[0,a(e9),[0,a(dT),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]]],az$=[0,a(V),tv,14,tv,42,[0,a(JG),[0,a(b9),[0,a(R),0]]]],az8=a("3.4"),az9=a(h6),az_=a(h6),az4=[0,a(V),on,14,on,41,[0,a(JG),[0,a(b9),[0,a(R),0]]]],az1=a("4."),az2=a(zE),az3=a(zE),azV=[0,a(V),e7,29,e7,64,[0,a(gq),[0,a(b9),[0,a(R),0]]]],azS=a(hk),azT=a(ry),azU=a(fz),azW=[0,a(c),da,10,da,45,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],azQ=[0,a(cn),mI,29,mI,64,[0,a(gq),[0,a(R),[0,a(cy),[0,a(cp),0]]]]],azN=a(nB),azO=a(BH),azP=a(mg),azR=[0,a(c),da,10,da,45,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],azX=[0,a(c),da,10,da,45,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],azK=[0,a(V),Lf,29,Lf,64,[0,a(Lx),[0,a(b9),[0,a(R),0]]]],azI=a(hk),azJ=a(fz),azL=[0,a(c),da,10,da,45,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],azG=[0,a(cn),pN,29,pN,64,[0,a(Lx),[0,a(R),[0,a(cy),[0,a(cp),0]]]]],azE=a(nB),azF=a(mg),azH=[0,a(c),da,10,da,45,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],azM=[0,a(c),da,10,da,45,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],azx=a(p),azy=[0,a(V),sd,5,535,34,[0,a(gq),[0,a(b9),[0,a(R),0]]]],azu=a(KP),azv=a(G4),azw=a(xY),azz=[0,a(c),a3,10,a3,33,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],azr=a(p),azs=[0,a(V),543,5,eC,34,[0,a(gq),[0,a(b9),[0,a(R),0]]]],azo=a("26962"),azp=a("23848"),azq=a("22136"),azt=[0,a(c),a3,10,a3,33,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],azl=a(x),azm=[0,a(V),Ga,5,Ga,35,[0,a(gq),[0,a(b9),[0,a(R),0]]]],azc=a(x),azd=a("4421"),aze=a("30473"),azf=a(x),azg=a("3906"),azh=a("26835"),azi=a(x),azj=a("3557"),azk=a("24821"),azn=[0,a(c),a3,10,a3,33,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],ay$=a(p),aza=[0,a(cn),350,5,fM,34,[0,a(gq),[0,a(R),[0,a(cy),[0,a(cp),0]]]]],ay8=a(Cm),ay9=a(xv),ay_=a(Kt),azb=[0,a(c),a3,10,a3,33,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],ay5=a(p),ay6=[0,a(cn),hh,5,360,34,[0,a(gq),[0,a(R),[0,a(cy),[0,a(cp),0]]]]],ay2=a("26849"),ay3=a("23748"),ay4=a("22044"),ay7=[0,a(c),a3,10,a3,33,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],ayZ=a(x),ay0=[0,a(cn),z0,5,z0,35,[0,a(gq),[0,a(R),[0,a(cy),[0,a(cp),0]]]]],ayQ=a(x),ayR=a("4403"),ayS=a("30345"),ayT=a(x),ayU=a("3890"),ayV=a("26723"),ayW=a(x),ayX=a("3542"),ayY=a("24717"),ay1=[0,a(c),a3,10,a3,33,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],azA=[0,a(c),a3,10,a3,33,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],ayM=[0,a(V),KS,5,KS,61,[0,a(oJ),[0,a(b9),[0,a(R),0]]]],ayJ=a(KP),ayK=a(G4),ayL=a(xY),ayN=[0,a(c),a3,10,a3,33,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],ayH=[0,a(cn),cH,5,cH,61,[0,a(oJ),[0,a(R),[0,a(cy),[0,a(cp),0]]]]],ayE=a(Cm),ayF=a(xv),ayG=a(Kt),ayI=[0,a(c),a3,10,a3,33,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],ayO=[0,a(c),a3,10,a3,33,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],ayB=[0,a(V),hY,14,hY,37,[0,a(oJ),[0,a(b9),[0,a(R),0]]]],ayy=a("26826"),ayz=a("23380"),ayA=a("21913"),ayC=[0,a(c),a3,10,a3,33,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],ayw=[0,a(cn),ee,14,ee,37,[0,a(oJ),[0,a(R),[0,a(cy),[0,a(cp),0]]]]],ayt=a(Mw),ayu=a("23282"),ayv=a("21821"),ayx=[0,a(c),a3,10,a3,33,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],ayD=[0,a(c),a3,10,a3,33,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],ayP=[0,a(c),a3,10,a3,33,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],ayp=a(p),ayq=[0,a(V),97,5,98,34,[0,a(dA),[0,a(b9),[0,a(R),0]]]],aym=a("29807"),ayn=a(LF),ayo=a("24348"),ayr=[0,a(c),a3,10,a3,33,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],ayj=a(p),ayk=[0,a(V),bc,5,dV,34,[0,a(dA),[0,a(b9),[0,a(R),0]]]],ayg=a("35949"),ayh=a(rT),ayi=a("29515"),ayl=[0,a(c),a3,10,a3,33,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],ayd=a(x),aye=[0,a(V),bt,5,bt,35,[0,a(dA),[0,a(b9),[0,a(R),0]]]],ax6=a(x),ax7=a("5895"),ax8=a("40630"),ax9=a(x),ax_=a(BX),ax$=a(Ln),aya=a(x),ayb=a("4743"),ayc=a("33094"),ayf=[0,a(c),a3,10,a3,33,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],ax3=a(p),ax4=[0,a(cn),37,5,38,34,[0,a(dA),[0,a(R),[0,a(cy),[0,a(cp),0]]]]],ax0=a("29682"),ax1=a("25859"),ax2=a("24246"),ax5=[0,a(c),a3,10,a3,33,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],axX=a(p),axY=[0,a(cn),47,5,48,34,[0,a(dA),[0,a(R),[0,a(cy),[0,a(cp),0]]]]],axU=a("35799"),axV=a(Ba),axW=a("29392"),axZ=[0,a(c),a3,10,a3,33,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],axR=a(x),axS=[0,a(cn),57,5,57,35,[0,a(dA),[0,a(R),[0,a(cy),[0,a(cp),0]]]]],axI=a(x),axJ=a("5870"),axK=a("40460"),axL=a(x),axM=a(FT),axN=a(IE),axO=a(x),axP=a("4723"),axQ=a(Ht),axT=[0,a(c),a3,10,a3,33,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],ays=[0,a(c),a3,10,a3,33,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],axE=[0,a(V),nz,14,nz,42,[0,a("Article 12"),[0,a(b9),[0,a(R),0]]]],axB=a(p),axC=a(iI),axD=a(iI),axw=[0,a(V),i0,14,i0,29,[0,a(d7),[0,a(b9),[0,a(R),0]]]],axq=a(p),axr=a(LF),axs=a(rT),axt=a(x),axu=a(BX),axv=a(Ln),axx=[0,a(c),gG,11,gG,26,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],axo=[0,a(cn),EL,14,EL,29,[0,a(d7),[0,a(R),[0,a(cy),[0,a(cp),0]]]]],axi=a(p),axj=a("25869"),axk=a(Ba),axl=a(x),axm=a(FT),axn=a(IE),axp=[0,a(c),gG,11,gG,26,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],axd=[0,a(V),xQ,14,xQ,44,[0,a(yK),[0,a(b9),[0,a(R),0]]]],awX=a(p),awY=a("468300"),awZ=a("670900"),aw0=a(x),aw1=a("800200"),aw2=a(ab),aw3=a("819200"),aw4=a(ak),aw5=a("849500"),aw6=a(an),aw7=a("881100"),aw8=a(T),aw9=a("912400"),aw_=a(gQ),aw$=a(A1),axa=a(gQ),axb=a("31100"),axc=a(A1),axe=[0,a(c),fO,11,fO,41,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],awV=[0,a(cn),eY,14,eY,44,[0,a(yK),[0,a(R),[0,a("Articles valables du 1er janvier 2020 au 1er janvier 2022"),[0,a(cp),0]]]]],awD=a(p),awE=a("458800"),awF=a("657200"),awG=a(x),awH=a("783900"),awI=a(ab),awJ=a("801500"),awK=a(ak),awL=a("832200"),awM=a(an),awN=a("863100"),awO=a(T),awP=a("893800"),awQ=a(gQ),awR=a(E9),awS=a(gQ),awT=a(sj),awU=a(E9),awW=[0,a(c),fO,11,fO,41,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],awx=[0,a(cn),Gy,14,Gy,40,[0,a(d7),[0,a(R),[0,a(cy),[0,a(cp),0]]]]],awf=a(p),awg=a(IM),awh=a(AF),awi=a(x),awj=a(Fh),awk=a(ab),awl=a(HO),awm=a(ak),awn=a(K5),awo=a(an),awp=a(E8),awq=a(T),awr=a(H9),aws=a(gQ),awt=a(mf),awu=a(gQ),awv=a(Ad),aww=a(mf),awy=[0,a(c),gm,10,gm,36,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],awe=[0,a(V),rU,14,rU,40,[0,a(d7),[0,a(b9),[0,a(R),0]]]],avY=a(p),avZ=a(IM),av0=a(AF),av1=a(x),av2=a(Fh),av3=a(ab),av4=a(HO),av5=a(ak),av6=a(K5),av7=a(an),av8=a(E8),av9=a(T),av_=a(H9),av$=a(gQ),awa=a(mf),awb=a(gQ),awc=a(Ad),awd=a(mf),awz=[0,a(c),gm,10,gm,36,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],avS=[0,a(c),CM,14,CM,50,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],avO=[0,a(V),r$,14,r$,41,[0,a("Article 11"),[0,a(b9),[0,a(R),0]]]],avN=a(jX),avJ=[0,a(C),x0,14,x0,29,[0,a(e9),[0,a(dT),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]]],avI=a(Gv),avK=[0,a(c),nj,11,nj,26,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],avH=[0,a(c),nj,11,nj,26,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],avL=[0,a(aj),[0,a("fraction_l832_3"),0]],avP=[0,a(c),l3,11,l3,38,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],avM=[0,a(c),l3,11,l3,38,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],avQ=[0,a(aj),[0,a("montant_forfaitaire_d823_16"),0]],avT=[0,a(c),K0,3,K0,25,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],avU=[0,a(aj),[0,a(j7),0]],avR=[0,a(c),eC,10,eC,23,[0,a(dQ),[0,a(j),[0,a(d),0]]]],avV=[0,a(aj),[0,a(eW),[0,a(af),0]]],avW=[0,a(aj),[0,a(eW),[0,a(af),0]]],awA=[0,a(c),gm,10,gm,36,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],avX=[0,a(c),gm,10,gm,36,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],awB=[0,a(aj),[0,a("taux_composition_familiale"),0]],axf=[0,a(c),fO,11,fO,41,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],awC=[0,a(c),fO,11,fO,41,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],axg=[0,a(aj),[0,a("abattement_forfaitaire_d823_17"),0]],axy=[0,a(c),gG,11,gG,26,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],axh=[0,a(c),gG,11,gG,26,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],axz=[0,a(aj),[0,a("loyer_r\xc3\xa9f\xc3\xa9rence"),0]],axF=[0,a(c),ow,11,ow,39,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],axA=[0,a(c),ow,11,ow,39,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],axG=[0,a(aj),[0,a("montant_minimal_aide_d823_16"),0]],azB=[0,a(c),a3,10,a3,33,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],axH=[0,a(c),a3,10,a3,33,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],azC=[0,a(aj),[0,a("plafond_loyer_d823_16_2"),0]],azY=[0,a(c),da,10,da,45,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],azD=[0,a(c),da,10,da,45,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],azZ=[0,a(aj),[0,a("montant_forfaitaire_charges_d823_16"),0]],az5=[0,a(c),nt,11,nt,38,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],az0=[0,a(c),nt,11,nt,38,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],az6=[0,a(aj),[0,a("plafond_suppression_d823_16"),0]],aAa=[0,a(c),mV,11,mV,39,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],az7=[0,a(c),mV,11,mV,39,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],aAb=[0,a(aj),[0,a("plafond_d\xc3\xa9gressivit\xc3\xa9_d823_16"),0]],aAe=[0,a(c),mL,11,mL,25,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],aAc=[0,a(c),mL,11,mL,25,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],aAf=[0,a(aj),[0,a("loyer_\xc3\xa9ligible"),0]],aAm=[0,a(aj),[0,a(fK),0]],aAA=[0,a(c),ge,10,ge,32,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],aAn=[0,a(c),ge,10,ge,32,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],aAB=[0,a(aj),[0,a("participation_minimale"),0]],aAL=[0,a(c),e7,11,e7,25,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],aAC=[0,a(c),e7,11,e7,25,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],aAM=[0,a(aj),[0,a("rapport_loyers"),0]],aA0=[0,a(aj),[0,a(ag),0]],aBs=[0,a(c),gA,10,gA,17,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],aA1=[0,a(c),gA,10,gA,17,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],aBt=[0,a(aj),[0,a("taux_loyer_\xc3\xa9ligible_formule"),0]],aCd=[0,a(aj),[0,a(a4),0]],aCn=[0,a(c),eY,10,eY,17,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],aCe=[0,a(c),eY,10,eY,17,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],aCo=[0,a(aj),[0,a("taux_loyer_\xc3\xa9ligible_arrondi"),0]],aCC=[0,a(aj),[0,a(fH),0]],aCF=[0,a(c),mu,11,mu,39,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],aCD=[0,a(c),mu,11,mu,39,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],aCG=[0,a(aj),[0,a("taux_prise_compte_ressources"),0]],aCT=[0,a(aj),[0,a(bD),0]],aCW=[0,a(c),oh,10,oh,35,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],aCU=[0,a(c),oh,10,oh,35,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],aCX=[0,a(aj),[0,a("participation_personnelle"),0]],aC2=[0,a(c),m5,10,m5,29,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],aCY=[0,a(c),m5,10,m5,29,[0,a(N),[0,a(o),[0,a(j),[0,a(d),0]]]]],aC3=[0,a(aj),[0,a(fS),0]],aC5=a(h6),aC4=[0,a(C),mk,13,mk,76,[0,a(e9),[0,a(dT),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]]],aC_=[0,a(C),mk,13,mk,76,[0,a(e9),[0,a(dT),[0,a(ad),[0,a(aa),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]]],aC7=a(nw),aC8=a(Gv),aC6=[0,a(aT),nx,13,nx,63,[0,a(rL),[0,a(bG),[0,a(av),[0,a(w),[0,a(am),[0,a(v),0]]]]]]],aC9=[0,a(aT),nx,13,nx,63,[0,a(rL),[0,a(bG),[0,a(av),[0,a(w),[0,a(am),[0,a(v),0]]]]]]],avv=[6,0],avx=[0,0],avy=[1,0],avz=[2,0],avA=[3,0],avB=[4,0],avC=[5,0],avD=[7,0],avw=[0,a(b3),29,5,38,6,[0,a(cQ),[0,a(lS),[0,a(aZ),0]]]],avu=a(xW),avE=[0,a(b3),11,10,11,22,[0,a(B),[0,a(aZ),0]]],avr=[8,0],avs=[0,a(b3),47,5,49,6,[0,a(cQ),[0,a(lS),[0,a(aZ),0]]]],avq=a(GH),avt=[0,a(b3),11,10,11,22,[0,a(B),[0,a(aZ),0]]],avg=[6,0],avi=[0,0],avj=[1,0],avk=[2,0],avl=[3,0],avm=[4,0],avn=[5,0],avo=[7,0],avh=[0,a(b3),68,5,77,6,[0,a(cQ),[0,a(oR),[0,a(aZ),0]]]],avf=a(IG),avp=[0,a(b3),11,10,11,22,[0,a(B),[0,a(aZ),0]]],avc=[8,0],avd=[0,a(b3),86,5,88,6,[0,a(cQ),[0,a(oR),[0,a(aZ),0]]]],avb=a(EU),ave=[0,a(b3),11,10,11,22,[0,a(B),[0,a(aZ),0]]],au3=[6,0],au5=[0,0],au6=[1,0],au7=[2,0],au8=[3,0],au9=[4,0],au_=[5,0],au$=[7,0],au4=[0,a(b3),bc,5,hp,6,[0,a(cQ),[0,a(nQ),[0,a(aZ),0]]]],au2=a(Bi),ava=[0,a(b3),11,10,11,22,[0,a(B),[0,a(aZ),0]]],auZ=[8,0],au0=[0,a(b3),eX,5,cu,6,[0,a(cQ),[0,a(nQ),[0,a(aZ),0]]]],auY=a(Li),au1=[0,a(b3),11,10,11,22,[0,a(B),[0,a(aZ),0]]],auO=[6,0],auQ=[0,0],auR=[1,0],auS=[2,0],auT=[3,0],auU=[4,0],auV=[5,0],auW=[7,0],auP=[0,a(b3),gU,5,FS,6,[0,a(cQ),[0,a(oq),[0,a(aZ),0]]]],auN=a(By),auX=[0,a(b3),11,10,11,22,[0,a(B),[0,a(aZ),0]]],auK=[8,0],auL=[0,a(b3),sH,5,j6,6,[0,a(cQ),[0,a(oq),[0,a(aZ),0]]]],auJ=a(x5),auM=[0,a(b3),11,10,11,22,[0,a(B),[0,a(aZ),0]]],auz=[6,0],auB=[0,0],auC=[1,0],auD=[2,0],auE=[3,0],auF=[4,0],auG=[5,0],auH=[7,0],auA=[0,a(b3),mt,5,m6,6,[0,a(mD),[0,a(me),[0,a(aZ),0]]]],auy=a(HZ),auI=[0,a(b3),11,10,11,22,[0,a(B),[0,a(aZ),0]]],auv=[8,0],auw=[0,a(b3),l9,5,zj,6,[0,a(mD),[0,a(me),[0,a(aZ),0]]]],auu=a(DH),aux=[0,a(b3),11,10,11,22,[0,a(B),[0,a(aZ),0]]],avF=[0,a(b3),11,10,11,22,[0,a(B),[0,a(aZ),0]]],aut=[0,a(b3),11,10,11,22,[0,a(B),[0,a(aZ),0]]],avG=[0,a(is),[0,a(Ic),0]],aup=[0,a(d9),28,5,29,34,[0,a(B2),[0,a(b7),0]]],auo=a(yG),auq=[0,a(d9),6,10,6,17,[0,a(b7),0]],aum=[0,a(d9),48,5,49,34,[0,a(AL),[0,a(b7),0]]],aul=a(yn),aun=[0,a(d9),6,10,6,17,[0,a(b7),0]],auj=[0,a(d9),64,5,65,34,[0,a(JI),[0,a(b7),0]]],aui=a(Jz),auk=[0,a(d9),6,10,6,17,[0,a(b7),0]],aug=[0,a(d9),82,5,83,34,[0,a(x2),[0,a(b7),0]]],auf=a(Jt),auh=[0,a(d9),6,10,6,17,[0,a(b7),0]],aur=[0,a(d9),6,10,6,17,[0,a(b7),0]],aue=[0,a(d9),6,10,6,17,[0,a(b7),0]],aus=[0,a(gP),[0,a(al),0]],at$=[0,a(C),w5,14,w5,28,[0,a(kI),[0,a(ey),[0,a(eB),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],at_=a(p),aua=[0,a(c),gT,10,gT,24,[0,a(cz),[0,a(t),[0,a(d),0]]]],at9=[0,a(C),HX,14,HX,28,[0,a(kB),[0,a(ey),[0,a(eB),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],at8=a(p),aub=[0,a(c),gT,10,gT,24,[0,a(cz),[0,a(t),[0,a(d),0]]]],at2=[0,a(C),Dn,20,Dn,51,[0,a(kB),[0,a(ey),[0,a(eB),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],atZ=a(p),at0=a(p),at1=a(kA),at3=[0,a(c),el,11,el,43,[0,a(cz),[0,a(t),[0,a(d),0]]]],atY=[0,a(C),Et,20,Et,55,[0,a(kB),[0,a(ey),[0,a(eB),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],atV=a(p),atW=a(p),atX=a(kA),at4=[0,a(c),el,11,el,43,[0,a(cz),[0,a(t),[0,a(d),0]]]],atS=[0,a(C),Dz,7,Dz,51,[0,a(kI),[0,a(ey),[0,a(eB),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],atO=a(J8),atP=a(eP),atQ=a(kA),atR=a(p),atT=[0,a(c),el,11,el,43,[0,a(cz),[0,a(t),[0,a(d),0]]]],atN=[0,a(C),IV,7,IV,42,[0,a(kI),[0,a(ey),[0,a(eB),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],atJ=a(J8),atK=a(eP),atL=a(kA),atM=a(p),atU=[0,a(c),el,11,el,43,[0,a(cz),[0,a(t),[0,a(d),0]]]],atE=[0,a(C),xo,14,xo,36,[0,a(kB),[0,a(ey),[0,a(eB),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],atF=[0,a(c),gw,11,gw,33,[0,a(cz),[0,a(t),[0,a(d),0]]]],atC=[0,a(C),AN,14,AN,36,[0,a(kI),[0,a(ey),[0,a(eB),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],atB=a(cY),atD=[0,a(c),gw,11,gw,33,[0,a(cz),[0,a(t),[0,a(d),0]]]],atv=[0,a(C),JS,14,JS,36,[0,a(kI),[0,a(ey),[0,a(eB),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],atw=[0,a(c),gg,11,gg,33,[0,a(cz),[0,a(t),[0,a(d),0]]]],atu=[0,a(C),KC,14,KC,36,[0,a(kB),[0,a(ey),[0,a(eB),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],atx=[0,a(c),gg,11,gg,33,[0,a(cz),[0,a(t),[0,a(d),0]]]],atq=[0,a(C),DQ,14,DQ,36,[0,a("Article R824-3"),[0,a(ey),[0,a(eB),[0,a(Q),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],atl=[0,0],atm=[1,0],atn=[1,0],ato=[0,0],atp=[0,0],atr=[0,a(c),h5,11,h5,33,[0,a(cz),[0,a(t),[0,a(d),0]]]],atk=[0,a(c),h5,11,h5,33,[0,a(cz),[0,a(t),[0,a(d),0]]]],ats=[0,a(kz),[0,a("mode_occupation_impay\xc3\xa9"),0]],aty=[0,a(c),gg,11,gg,33,[0,a(cz),[0,a(t),[0,a(d),0]]]],att=[0,a(c),gg,11,gg,33,[0,a(cz),[0,a(t),[0,a(d),0]]]],atz=[0,a(kz),[0,a("d\xc3\xa9pense_logement_brute"),0]],atG=[0,a(c),gw,11,gw,33,[0,a(cz),[0,a(t),[0,a(d),0]]]],atA=[0,a(c),gw,11,gw,33,[0,a(cz),[0,a(t),[0,a(d),0]]]],atH=[0,a(kz),[0,a("d\xc3\xa9pense_logement_nette"),0]],at5=[0,a(c),el,11,el,43,[0,a(cz),[0,a(t),[0,a(d),0]]]],atI=[0,a(c),el,11,el,43,[0,a(cz),[0,a(t),[0,a(d),0]]]],at6=[0,a(kz),[0,a("seuil_impay\xc3\xa9_d\xc3\xa9pense_de_logement"),0]],auc=[0,a(c),gT,10,gT,24,[0,a(cz),[0,a(t),[0,a(d),0]]]],at7=[0,a(c),gT,10,gT,24,[0,a(cz),[0,a(t),[0,a(d),0]]]],aud=[0,a(kz),[0,a("montant_impay\xc3\xa9"),0]],atf=[0,a(dX),o6,5,o6,43,[0,a(sV),[0,a(rH),[0,a(gk),[0,a(gu),[0,a(gR),[0,a(gC),[0,a(nu),[0,a(am),[0,a(ai),0]]]]]]]]]],atg=[0,a(c),c6,10,c6,29,[0,a(fy),[0,a(t),[0,a(d),0]]]],atd=[0,a(dX),dC,5,dC,42,[0,a(j9),[0,a(kt),[0,a(gk),[0,a(gu),[0,a(gR),[0,a(gC),[0,a(kg),[0,a(bd),[0,a(ai),0]]]]]]]]]],ate=[0,a(c),c6,10,c6,29,[0,a(fy),[0,a(t),[0,a(d),0]]]],atb=[0,a(dX),rx,5,rE,43,[0,a(j9),[0,a(kt),[0,a(gk),[0,a(gu),[0,a(gR),[0,a(gC),[0,a(kg),[0,a(bd),[0,a(ai),0]]]]]]]]]],atc=[0,a(c),c6,10,c6,29,[0,a(fy),[0,a(t),[0,a(d),0]]]],as_=a("1952"),as$=[0,a(dX),yk,5,yk,48,[0,a(j9),[0,a(kt),[0,a(gk),[0,a(gu),[0,a(gR),[0,a(gC),[0,a(kg),[0,a(bd),[0,a(ai),0]]]]]]]]]],ata=[0,a(c),c6,10,c6,29,[0,a(fy),[0,a(t),[0,a(d),0]]]],as7=a("1953"),as8=[0,a(dX),mA,5,mA,48,[0,a(j9),[0,a(kt),[0,a(gk),[0,a(gu),[0,a(gR),[0,a(gC),[0,a(kg),[0,a(bd),[0,a(ai),0]]]]]]]]]],as9=[0,a(c),c6,10,c6,29,[0,a(fy),[0,a(t),[0,a(d),0]]]],as4=a("1954"),as5=[0,a(dX),Kv,5,Kv,48,[0,a(j9),[0,a(kt),[0,a(gk),[0,a(gu),[0,a(gR),[0,a(gC),[0,a(kg),[0,a(bd),[0,a(ai),0]]]]]]]]]],as6=[0,a(c),c6,10,c6,29,[0,a(fy),[0,a(t),[0,a(d),0]]]],ath=[0,a(c),c6,10,c6,29,[0,a(fy),[0,a(t),[0,a(d),0]]]],as3=[0,a(c),c6,10,c6,29,[0,a(fy),[0,a(t),[0,a(d),0]]]],ati=[0,a(te),[0,a("\xc3\xa2ge_ouverture_droit"),0]],as0=[0,a(C),EH,14,EH,36,[0,a(hd),[0,a(aJ),[0,a(aI),[0,a(av),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]],asM=a(p),asN=a(Dd),asO=a(xC),asP=a(x),asQ=a(h6),asR=a(ab),asS=a(pm),asT=a(ak),asU=a(rB),asV=a(an),asW=a(iB),asX=a(an),asY=a(jR),asZ=a(iB),as1=[0,a(c),jU,10,jU,32,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],asL=[0,a(c),jU,10,jU,32,[0,a(z),[0,a(o),[0,a(j),[0,a(d),0]]]]],as2=[0,a(ks),[0,a(xp),0]],asH=[0,a(C),Mk,5,Mk,26,[0,a(dS),[0,a(bF),[0,a(aV),[0,a(aI),[0,a(av),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]]],ast=a(p),asu=a("1.2"),asv=a("1.5"),asw=a(x),asx=a(h6),asy=a(ab),asz=a(pm),asA=a(ak),asB=a(rB),asC=a(an),asD=a(iB),asE=a(an),asF=a(jR),asG=a(iB),asI=[0,a(c),ii,10,ii,32,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],ass=[0,a(C),Dx,14,Dx,36,[0,a(dS),[0,a(bF),[0,a(aV),[0,a(aI),[0,a(av),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]]],ase=a(p),asf=a(Dd),asg=a(xC),ash=a(x),asi=a(h6),asj=a(ab),ask=a(pm),asl=a(ak),asm=a(rB),asn=a(an),aso=a(iB),asp=a(an),asq=a(jR),asr=a(iB),asJ=[0,a(c),ii,10,ii,32,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],asd=[0,a(c),ii,10,ii,32,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],asK=[0,a(j5),[0,a(KW),0]],ar$=[0,a(C),wI,5,wI,26,[0,a(s5),[0,a(bF),[0,a(aV),[0,a(aI),[0,a(av),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]]],ar_=a(cw),ar8=a(cY),ar9=a(cw),asa=[0,a(c),iZ,10,iZ,17,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],ar7=[0,a(C),y6,14,y6,21,[0,a(s5),[0,a(bF),[0,a(aV),[0,a(aI),[0,a(av),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]]],ar6=a(cw),ar4=a(cY),ar5=a(cw),ar0=[0,a(C),Hs,14,Hs,50,[0,a(s5),[0,a(bF),[0,a(aV),[0,a(aI),[0,a(av),[0,a(w),[0,a(D),[0,a(v),0]]]]]]]]],arZ=[1,0],arU=[0,a(V),Hq,5,Hq,26,[0,a(ss),[0,a(fA),[0,a(R),0]]]],arF=a("0.328"),arG=a(GU),arH=[1,0],arI=a(xs),arJ=a(CZ),arK=a(GU),arL=a(w2),arM=a(zD),arN=a(CZ),arO=a("0.024"),arP=a(xI),arQ=a(zD),arR=a(cw),arS=a(p),arT=a(xI),arV=[0,a(c),hZ,11,hZ,35,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],arE=[0,a(V),KM,14,KM,38,[0,a(ss),[0,a(fA),[0,a(R),0]]]],arm=a("0.48"),arn=a(Gu),aro=[1,0],arp=a(tB),arq=a(HG),arr=a(Gu),ars=a("0.264"),art=a(ze),aru=a(HG),arv=a("0.216"),arw=a(K8),arx=a(ze),ary=a("0.104"),arz=a(G_),arA=a(K8),arB=a(Ca),arC=a(p),arD=a(G_),ari=[0,a(V),BG,14,BG,41,[0,a(ss),[0,a(fA),[0,a(R),0]]]],arg=a("7632"),arh=a("4557"),arj=[0,a(c),mh,11,mh,38,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],arf=[0,a(c),mh,11,mh,38,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],ark=[0,a(ei),[0,a("montant_forfaitaire_d832_26"),0]],arW=[0,a(c),hZ,11,hZ,35,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],arl=[0,a(c),hZ,11,hZ,35,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],arX=[0,a(ei),[0,a("tranches_revenus_d832_26"),0]],ar1=[0,a(c),pk,11,pk,47,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],arY=[0,a(c),pk,11,pk,47,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],ar2=[0,a(ei),[0,a("tranches_revenus_d832_26_multipli\xc3\xa9es"),0]],asb=[0,a(c),iZ,10,iZ,17,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],ar3=[0,a(c),iZ,10,iZ,17,[0,a(G),[0,a(o),[0,a(j),[0,a(d),0]]]]],asc=[0,a(ei),[0,a(al),0]],arb=[0,a(f$),cA,5,cA,35,[0,a(d7),[0,a(sZ),[0,a(tD),0]]]],arc=[0,a(c),oH,10,oH,17,[0,a(dQ),[0,a(j),[0,a(d),0]]]],ara=[0,a(c),oH,10,oH,17,[0,a(dQ),[0,a(j),[0,a(d),0]]]],aq9=[0,a(f$),pq,39,pq,69,[0,a(s7),[0,a(sZ),[0,a(tD),0]]]],aq8=a(lT),aq3=[0,a(dX),37,9,37,20,[0,a("Article L136-1-3"),[0,a("Section 1 : De la contribution sociale sur les revenus d'activit\xc3\xa9 et sur les revenus de remplacement"),[0,a("Chapitre 6 : Contribution sociale g\xc3\xa9n\xc3\xa9ralis\xc3\xa9e"),[0,a(nu),[0,a(am),[0,a(ai),0]]]]]]],aq4=[0,a(c),gn,11,gn,22,[0,a(dQ),[0,a(j),[0,a(d),0]]]],aq2=[0,a(c),gn,11,gn,22,[0,a(dQ),[0,a(j),[0,a(d),0]]]],aq5=[0,a(c),gn,11,gn,22,[0,a(dQ),[0,a(j),[0,a(d),0]]]],aq1=[0,a(c),gn,11,gn,22,[0,a(dQ),[0,a(j),[0,a(d),0]]]],aq6=[0,a(af),[0,a("exon\xc3\xa9r\xc3\xa9_csg"),0]],aq_=[0,a(c),oY,11,oY,20,[0,a(dQ),[0,a(j),[0,a(d),0]]]],aq7=[0,a(c),oY,11,oY,20,[0,a(dQ),[0,a(j),[0,a(d),0]]]],aq$=[0,a(af),[0,a("taux_crds"),0]],ard=[0,a(af),[0,a(al),0]],are=[0,a(f$),cX,13,cX,24,[0,a(d7),[0,a(sZ),[0,a(tD),0]]]],aqR=a("date_naissance_troisi\xc3\xa8me_enfant_ou_dernier_si_plus"),aqS=a("enfant_\xc3\xa0_na\xc3\xaetre_apr\xc3\xa8s_quatri\xc3\xa8me_mois_grossesse"),aqT=a("nombre_enfants_\xc3\xa0_na\xc3\xaetre_apr\xc3\xa8s_troisi\xc3\xa8me_mois_grossesse"),aqU=a("condition_rattach\xc3\xa9_foyer_fiscal_parent_ifi"),aqV=a("situation_familiale"),aqW=a("nombre_autres_occupants_logement"),aqX=a("personnes_\xc3\xa0_charge"),aqY=a("logement"),aqZ=a("prestations_re\xc3\xa7ues"),aq0=[0,a("M\xc3\xa9nage"),0],aqF=a("zone"),aqG=a("situ\xc3\xa9_commune_d\xc3\xa9s\xc3\xa9quilibre_l831_2"),aqH=a("est_ancien_l831_2"),aqI=a("surface_m_carr\xc3\xa9s"),aqJ=a("logement_decent_l89_462"),aqK=a("usufruit"),aqL=a("lou\xc3\xa9_ou_sous_lou\xc3\xa9_\xc3\xa0_des_tiers"),aqM=a("propri\xc3\xa9taire"),aqN=a("mode_occupation"),aqO=a("est_ehpad_ou_maison_autonomie_l313_12_asf"),aqP=a("r\xc3\xa9sidence_principale"),aqQ=[0,a("Logement"),0],aqz=a(HH),aqB=a("R\xc3\xa9sidentLogementFoyer"),aqC=a("AccessionPropri\xc3\xa9t\xc3\xa9LocalUsageExclusifHabitation"),aqD=a(CF),aqE=a(yL),aqA=[0,a("ModeOccupation"),0],aqv=a(Fc),aqx=a(Cu),aqy=a("InfosAccessionPropri\xc3\xa9t\xc3\xa9"),aqw=[0,a("InformationsCalculAPL"),0],aqp=a("construit_application_loi_1957_12_III"),aqq=a("remplit_conditions_r832_21"),aqr=a("location"),aqs=a("date_conventionnement"),aqt=a("type"),aqu=[0,a(yN),0],aqg=a("changement_logement_d842_4"),aqh=a("logement_meubl\xc3\xa9_d842_2"),aqi=a("r\xc3\xa9duction_loyer_solidarit\xc3\xa9"),aqj=a("\xc3\xa2g\xc3\xa9es_ou_handicap_adultes_h\xc3\xa9berg\xc3\xa9es_on\xc3\xa9reux_particuliers"),aqk=a("colocation"),aql=a("logement_est_chambre"),aqm=a("b\xc3\xa9n\xc3\xa9ficiaire_aide_adulte_ou_enfant_handicap\xc3\xa9s"),aqn=a("loyer_principal"),aqo=[0,a("InformationsCalculAPLLocatif"),0],aqd=a(C5),aqf=a(Cn),aqe=[0,a("Personne\xc3\x80Charge"),0],ap3=a("anciennet\xc3\xa9_logement"),ap4=a(JD),ap5=a("situation_r822_11_13_17"),ap6=a("copropri\xc3\xa9t\xc3\xa9"),ap7=a("local_habit\xc3\xa9_premi\xc3\xa8re_fois_b\xc3\xa9n\xc3\xa9ficiaire"),ap8=a("type_travaux_logement_r842_5"),ap9=a("type_travaux_logement_d832_15"),ap_=a("date_entr\xc3\xa9e_logement"),ap$=a("date_signature_pr\xc3\xaat"),aqa=a("charges_mensuelles_pr\xc3\xaat"),aqb=a("mensualit\xc3\xa9_principale"),aqc=[0,a("InformationsCalculAPLAccessionPropri\xc3\xa9t\xc3\xa9"),0],ap1=a("pr\xc3\xaat"),ap2=[0,a("Propri\xc3\xa9taire"),0],apZ=a("bailleur"),ap0=[0,a(EA),0],apW=a(AT),apY=a(HT),apX=[0,a("ChangementLogementD842_4"),0],apO=a("personne_h\xc3\xa9berg\xc3\xa9e_centre_soin_l_L162_22_3_s\xc3\xa9curit\xc3\xa9_sociale"),apP=a("patrimoine"),apQ=a("nationalit\xc3\xa9"),apR=a("contrat_de_travail"),apS=a(I6),apT=a("age_demandeur"),apU=a("satisfait_conditions_l512_2_code_s\xc3\xa9curit\xc3\xa9_sociale"),apV=[0,a(rw),0],apL=a(kJ),apN=a(pK),apM=[0,a("Lou\xc3\xa9OuSousLou\xc3\xa9\xc3\x80DesTiers"),0],apB=a("situation_garde_altern\xc3\xa9e"),apC=a(sX),apD=a(sm),apE=a(r8),apF=a(rS),apG=a(sM),apH=a(rQ),apI=a(rG),apJ=a(s6),apK=[0,a(C5),0],aps=a(rG),apt=a(rQ),apu=a(sm),apv=a(sX),apw=a(sM),apx=a(rS),apy=a(r8),apz=a(s6),apA=[0,a("EnfantPrestationsFamiliales"),0],app=a("cat\xc3\xa9gorie_\xc3\xa9quivalence_loyer_d842_16"),apq=a("redevance"),apr=[0,a("InformationsCalculAPLLogementFoyer"),0],apm=a(K2),apo=a(zK),apn=[0,a("DateNaissanceTroisi\xc3\xa8meOuDernierPlusEnfant"),0],ape=a("titulaire_allocation_personne_\xc3\xa2g\xc3\xa9e"),apf=a("b\xc3\xa9n\xc3\xa9ficiaire_l161_19_l351_8_l643_3_s\xc3\xa9cu"),apg=a("incapacit\xc3\xa9_80_pourcent_ou_restriction_emploi"),aph=a("parent\xc3\xa9"),api=a("ascendant_descendant_collat\xc3\xa9ral_deuxi\xc3\xa8me_troisi\xc3\xa8me_degr\xc3\xa9"),apj=a("ressources"),apk=a(I6),apl=[0,a(Cn),0],apa=a(ES),apb=a(E1),apc=a(DO),apd=[0,a("TrancheRevenuD\xc3\xa9cimal"),0],ao7=a(ES),ao8=a(E1),ao9=a(DO),ao_=[0,a("TrancheRevenu"),0],ao3=a(It),ao5=a(Cw),ao4=[0,a("NeufOuAncien"),0],aoZ=a("titulaire_pr\xc3\xaat"),ao0=a("date_signature"),ao1=a(JD),ao2=[0,a("Pr\xc3\xaat"),0],aoT=a("acquisition_aides_\xc3\xa9tat_pr\xc3\xaat_titre_II_ou_livre_III"),aoU=a("construit_am\xc3\xa9lior\xc3\xa9_conditions_l831_1_4"),aoV=a("respecte_convention_titre_II"),aoW=a("respecte_convention_titre_V"),aoX=a("type_bailleur"),aoY=[0,a(xe),0],aoQ=a("ancienne_allocation_logement"),aoR=a("ancien_loyer_principal"),aoS=[0,a("InfosChangementLogementD842_4"),0],aoN=a("ne_produisant_pas_revenu_p\xc3\xa9riode_r822_3_3_r822_4"),aoO=a("produisant_revenu_p\xc3\xa9riode_r822_3_3_r822_4"),aoP=[0,a("Patrimoine"),0],aoK=a("conforme_article_l442_1"),aoL=a("age_personne_sous_location"),aoM=[0,a("PersonneSousLocation"),0],aoB=a(ni),aoD=a(X),aoE=a(rO),aoF=a(oX),aoG=a(CW),aoH=a(iR),aoI=a(BE),aoJ=a(Hw),aoC=[0,a(Er),0],aow=a(j1),aoy=a(jT),aoz=a(JL),aox=[0,a(Ke),0],aoq=a(A2),aos=a(C7),aot=a(hc),aou=a(D$),aov=a(zn),aor=[0,a("PriseEnChargeEnfant"),0],aog=a(n6),aoi=a(nq),aoj=a(l0),aok=a(KF),aol=a(zr),aom=a(pM),aon=a(Kg),aoo=a(mG),aop=a(nC),aoh=[0,a(Jw),0],aod=a(Lz),aof=a(Ar),aoe=[0,a("SituationFamilialeCalculAPL"),0],an_=a("\xc3\x89tudiantLog\xc3\xa9EnChambre"),aoa=a("\xc3\x89tudiantLog\xc3\xa9EnChambreR\xc3\xa9habilit\xc3\xa9e"),aob=a("Personnes\xc3\x82g\xc3\xa9esSelon3DeD842_16"),aoc=a(Lw),an$=[0,a("Cat\xc3\xa9gorie\xc3\x89quivalenceLoyerAllocationLogementFoyer"),0],an5=a("LogementPersonnes\xc3\x82g\xc3\xa9esOuHandicap\xc3\xa9es"),an7=a("R\xc3\xa9sidenceSociale"),an8=a("FoyerJeunesTrvailleursOuMigrantsConventionn\xc3\xa9L353_2Avant1995"),an9=a(h7),an6=[0,a("TypeLogementFoyer"),0],an1=a(hc),an3=a("R\xc3\xa9sidenceAltern\xc3\xa9eAllocataireUnique"),an4=a("R\xc3\xa9sidenceAltern\xc3\xa9eAllocationsPartag\xc3\xa9e"),an2=[0,a(Gt),0],anU=a("C\xc3\xa9libataire"),anW=a("Mari\xc3\xa9s"),anX=a("Pacs\xc3\xa9s"),anY=a(zt),anZ=a("C\xc3\xa9libataireS\xc3\xa9par\xc3\xa9DeFait"),an0=a("ConcubinageDontS\xc3\xa9par\xc3\xa9DeFait"),anV=[0,a("SituationFamiliale"),0],anQ=a("AidePersonnalis\xc3\xa9eLogement"),anS=a(pG),anT=a(mE),anR=[0,a("TypeAidesPersonnelleLogement"),0],anM=a("Pas\xc3\x89ligible"),anO=a(pG),anP=a(mE),anN=[0,a(b2),0],anJ=a("Impay\xc3\xa9Loyer"),anL=a("Impay\xc3\xa9Pr\xc3\xaat"),anK=[0,a("ModeOccupationImpay\xc3\xa9"),0],anE=a("TotalAnnuel\xc3\x89ch\xc3\xa9ances"),anG=a("Mensualit\xc3\xa9"),anH=a(LZ),anF=[0,a("D\xc3\xa9penseLogement"),0],anA=a(EA),anC=a("AccessionPropri\xc3\xa9t\xc3\xa9"),anD=a(yN),anB=[0,a("Cat\xc3\xa9gorieCalculAPL"),0],anw=a(zI),any=a(Fz),anz=a(Ho),anx=[0,a("ZoneDHabitation"),0],ant=a("Fran\xc3\xa7aise"),anv=a("\xc3\x89trang\xc3\xa8re"),anu=[0,a("Nationalit\xc3\xa9"),0],anp=a(G7),anr=a("AvantPremierJourMoisCivilTroisi\xc3\xa8meMoisDeGrossesse"),ans=a("Apr\xc3\xa8sPremierJourMoisCivilTroisi\xc3\xa8meMoisDeGrossesse"),anq=[0,a("DateDeNaissanceOuMoisDeGrossesse"),0],anl=a(Bb),ann=a(IU),ano=a("Collat\xc3\xa9ralDeuxi\xc3\xa8meTroisi\xc3\xa8meDegr\xc3\xa9"),anm=[0,a("Parent\xc3\xa9"),0],ani=a("PasDeGardeAltern\xc3\xa9e"),ank=a("GardeAltern\xc3\xa9eCoefficientPriseEnCharge"),anj=[0,a("SituationGardeAltern\xc3\xa9e"),0],anf=a("DemandeurOuConjointOuParentOuViaPartsSoci\xc3\xa9t\xc3\xa9s"),anh=a(h7),ang=[0,a("ParentOuAutre"),0],anc=a(CT),ane=a(Mb),and=[0,a("TypeContratTravail"),0],am7=a(X),am9=a(rO),am_=a(Kc),am$=a(iR),ana=a("AllocationSoutienEnfantHandicap\xc3\xa9"),anb=a("AllocationAdulteHandicap\xc3\xa9"),am8=[0,a("PrestationRe\xc3\xa7ue"),0],am3=a(K_),am5=a(Fw),am4=[0,a("LimiteTrancheD\xc3\xa9cimal"),0],am0=a(K_),am2=a(Fw),am1=[0,a("LimiteTranche"),0],amX=a(pK),amZ=a(kJ),amY=[0,a("Am\xc3\xa9lior\xc3\xa9ParOccupant"),0],amS=a("ObjectifD\xc3\xa9cenceLogement"),amU=a("Pr\xc3\xa9vuDansListeR321_15"),amV=a(JP),amW=a(np),amT=[0,a("TypeTravauxLogementR842_5"),0],amO=a(yd),amQ=a("TravauxSurLogementD\xc3\xa9j\xc3\xa0AcquisD832_15_2"),amR=a(np),amP=[0,a("TypeTravauxLogementD832_15"),0],amL=a(rw),amN=a(yx),amM=[0,a("TitulairePr\xc3\xaat"),0],amF=a(Bq),amH=a(yt),amI=a(Ie),amJ=a(Aj),amK=a(h7),amG=[0,a("TypePr\xc3\xaat"),0],amC=a(Cr),amE=a("BailleurPriv\xc3\xa9"),amD=[0,a("TypeBailleur"),0],bM_=a(ac),bMK=a("The function 'n_nombre_parts_d832_25_in' translation isn't yet supported..."),bML=a("The function 'condition_2_du_832_25_in' translation isn't yet supported..."),bMI=a("The function 'condition_logement_surface_in' translation isn't yet supported..."),bMJ=a("The function 'condition_logement_residence_principale_in' translation isn't yet supported..."),bMC=a("AccessionProprieteLocalUsageExclusifHabitation"),bMD=a(HH),bME=a(yL),bMF=a("ResidentLogementFoyer"),bMG=a(CF),bMH=[0,[11,a(be),[2,0,[11,a("' kind for the enumeration 'ModeOccupation.t'"),0]]],a("Unexpected '%s' kind for the enumeration 'ModeOccupation.t'")],bMy=a("InfosAccessionPropriete"),bMz=a(Fc),bMA=a(Cu),bMB=[0,[11,a(be),[2,0,[11,a("' kind for the enumeration 'InformationsCalculAPL.t'"),0]]],a("Unexpected '%s' kind for the enumeration 'InformationsCalculAPL.t'")],bMv=a("AutrePersonneACharge"),bMw=a("EnfantACharge"),bMx=[0,[11,a(be),[2,0,[11,a("' kind for the enumeration 'PersonneACharge.t'"),0]]],a("Unexpected '%s' kind for the enumeration 'PersonneACharge.t'")],bMr=a(AT),bMs=a(HT),bMu=[1,0],bMt=[0,[11,a(be),[2,0,[11,a("' kind for the enumeration 'ChangementLogementD8424.t'"),0]]],a("Unexpected '%s' kind for the enumeration 'ChangementLogementD8424.t'")],bMn=a(kJ),bMo=a(pK),bMq=[0,0],bMp=[0,[11,a(be),[2,0,[11,a("' kind for the enumeration 'LoueOuSousLoueADesTiers.t'"),0]]],a("Unexpected '%s' kind for the enumeration 'LoueOuSousLoueADesTiers.t'")],bMj=a(K2),bMk=a(zK),bMm=[0,0],bMl=[0,[11,a(be),[2,0,[11,a("' kind for the enumeration 'DateNaissanceTroisiemeOuDernierPlusEnfant.t'"),0]]],a("Unexpected '%s' kind for the enumeration 'DateNaissanceTroisiemeOuDernierPlusEnfant.t'")],bMf=a(Cw),bMg=a(It),bMi=[0,0],bMh=[0,[11,a(be),[2,0,[11,a("' kind for the enumeration 'NeufOuAncien.t'"),0]]],a("Unexpected '%s' kind for the enumeration 'NeufOuAncien.t'")],bL0=a(xg),bL1=a(y1),bL2=a(oX),bL3=a(DE),bL4=a(iR),bL5=a(X),bL6=a(ru),bL7=a(ni),bL9=[0,0],bL_=[2,0],bL$=[1,0],bMa=[5,0],bMb=[6,0],bMc=[3,0],bMd=[7,0],bMe=[4,0],bL8=[0,[11,a(be),[2,0,[11,a(C8),0]]],a(Es)],bLT=a(tt),bLU=a(j1),bLV=a(jT),bLX=[1,0],bLY=[0,0],bLZ=[2,0],bLW=[0,[11,a(be),[2,0,[11,a(yO),0]]],a(FU)],bLI=a(hc),bLJ=a(rW),bLK=a(sF),bLL=a(s4),bLM=a(rK),bLO=[4,0],bLP=[3,0],bLQ=[0,0],bLR=[1,0],bLS=[2,0],bLN=[0,[11,a(be),[2,0,[11,a("' kind for the enumeration 'PriseEnChargeEnfant.t'"),0]]],a("Unexpected '%s' kind for the enumeration 'PriseEnChargeEnfant.t'")],bLp=a(n6),bLq=a(nq),bLr=a(FP),bLs=a(l0),bLt=a(nC),bLu=a(D5),bLv=a(yf),bLw=a(pM),bLx=a(mG),bLz=[7,0],bLA=[5,0],bLB=[4,0],bLC=[6,0],bLD=[8,0],bLE=[2,0],bLF=[3,0],bLG=[1,0],bLH=[0,0],bLy=[0,[11,a(be),[2,0,[11,a(BC),0]]],a(xX)],bLk=a(Ar),bLl=a(Lz),bLn=[0,0],bLo=[1,0],bLm=[0,[11,a(be),[2,0,[11,a("' kind for the enumeration 'SituationFamilialeCalculAPL.t'"),0]]],a("Unexpected '%s' kind for the enumeration 'SituationFamilialeCalculAPL.t'")],bLb=a(Lw),bLc=a("EtudiantLogeEnChambre"),bLd=a("EtudiantLogeEnChambreRehabilitee"),bLe=a("PersonnesAgeesSelon3DeD842_16"),bLg=[2,0],bLh=[1,0],bLi=[0,0],bLj=[3,0],bLf=[0,[11,a(be),[2,0,[11,a("' kind for the enumeration 'CategorieEquivalenceLoyerAllocationLogementFoyer.t'"),0]]],a("Unexpected '%s' kind for the enumeration 'CategorieEquivalenceLoyerAllocationLogementFoyer.t'")],bK4=a(h7),bK5=a("FoyerJeunesTrvailleursOuMigrantsConventionneL353_2Avant1995"),bK6=a("LogementPersonnesAgeesOuHandicapees"),bK7=a("ResidenceSociale"),bK9=[1,0],bK_=[0,0],bK$=[2,0],bLa=[3,0],bK8=[0,[11,a(be),[2,0,[11,a("' kind for the enumeration 'TypeLogementFoyer.t'"),0]]],a("Unexpected '%s' kind for the enumeration 'TypeLogementFoyer.t'")],bKX=a(hc),bKY=a("ResidenceAlterneeAllocataireUnique"),bKZ=a("ResidenceAlterneeAllocationsPartagee"),bK1=[2,0],bK2=[1,0],bK3=[0,0],bK0=[0,[11,a(be),[2,0,[11,a(Cb),0]]],a(A_)],bKL=a("Celibataire"),bKM=a("CelibataireSepareDeFait"),bKN=a("ConcubinageDontSepareDeFait"),bKO=a(zt),bKP=a("Maries"),bKQ=a("Pacses"),bKS=[2,0],bKT=[3,0],bKU=[5,0],bKV=[4,0],bKW=[0,0],bKR=[0,[11,a(be),[2,0,[11,a("' kind for the enumeration 'SituationFamiliale.t'"),0]]],a("Unexpected '%s' kind for the enumeration 'SituationFamiliale.t'")],bKE=a("AidePersonnaliseeLogement"),bKF=a(pG),bKG=a(mE),bKI=[2,0],bKJ=[1,0],bKK=[0,0],bKH=[0,[11,a(be),[2,0,[11,a("' kind for the enumeration 'TypeAidesPersonnelleLogement.t'"),0]]],a("Unexpected '%s' kind for the enumeration 'TypeAidesPersonnelleLogement.t'")],bKA=a(LZ),bKB=a("Mensualite"),bKC=a("TotalAnnuelEcheances"),bKD=[0,[11,a(be),[2,0,[11,a("' kind for the enumeration 'DepenseLogement.t'"),0]]],a("Unexpected '%s' kind for the enumeration 'DepenseLogement.t'")],bKt=a(xe),bKu=a("Beneficiaire"),bKv=a("EtablissementHabilite"),bKx=[2,0],bKy=[1,0],bKz=[0,0],bKw=[0,[11,a(be),[2,0,[11,a("' kind for the enumeration 'VersementA.t'"),0]]],a("Unexpected '%s' kind for the enumeration 'VersementA.t'")],bKp=a(kJ),bKq=a("OuiAvecLoyerOuCharges"),bKs=[1,0],bKr=[0,[11,a(be),[2,0,[11,a("' kind for the enumeration 'PaiementLogementDistinctProfessionnel.t'"),0]]],a("Unexpected '%s' kind for the enumeration 'PaiementLogementDistinctProfessionnel.t'")],bKi=a(zI),bKj=a(Fz),bKk=a(Ho),bKm=[2,0],bKn=[1,0],bKo=[0,0],bKl=[0,[11,a(be),[2,0,[11,a("' kind for the enumeration 'ZoneDHabitation.t'"),0]]],a("Unexpected '%s' kind for the enumeration 'ZoneDHabitation.t'")],bKd=a("Etrangere"),bKe=a("Francaise"),bKg=[0,0],bKh=[1,0],bKf=[0,[11,a(be),[2,0,[11,a("' kind for the enumeration 'Nationalite.t'"),0]]],a("Unexpected '%s' kind for the enumeration 'Nationalite.t'")],bJ9=a("ApresPremierJourMoisCivilTroisiemeMoisDeGrossesse"),bJ_=a("AvantPremierJourMoisCivilTroisiemeMoisDeGrossesse"),bJ$=a(G7),bKb=[1,0],bKc=[2,0],bKa=[0,[11,a(be),[2,0,[11,a("' kind for the enumeration 'DateDeNaissanceOuMoisDeGrossesse.t'"),0]]],a("Unexpected '%s' kind for the enumeration 'DateDeNaissanceOuMoisDeGrossesse.t'")],bJ2=a(Bb),bJ3=a("CollateralDeuxiemeTroisiemeDegre"),bJ4=a(IU),bJ6=[1,0],bJ7=[2,0],bJ8=[0,0],bJ5=[0,[11,a(be),[2,0,[11,a("' kind for the enumeration 'Parente.t'"),0]]],a("Unexpected '%s' kind for the enumeration 'Parente.t'")],bJY=a("GardeAlterneeCoefficientPriseEnCharge"),bJZ=a("PasDeGardeAlternee"),bJ1=[0,0],bJ0=[0,[11,a(be),[2,0,[11,a("' kind for the enumeration 'SituationGardeAlternee.t'"),0]]],a("Unexpected '%s' kind for the enumeration 'SituationGardeAlternee.t'")],bJU=a(h7),bJV=a("DemandeurOuConjointOuParentOuViaPartsSocietes"),bJX=[1,0],bJW=[0,[11,a(be),[2,0,[11,a("' kind for the enumeration 'ParentOuAutre.t'"),0]]],a("Unexpected '%s' kind for the enumeration 'ParentOuAutre.t'")],bJP=a(Mb),bJQ=a(CT),bJS=[0,0],bJT=[1,0],bJR=[0,[11,a(be),[2,0,[11,a("' kind for the enumeration 'TypeContratTravail.t'"),0]]],a("Unexpected '%s' kind for the enumeration 'TypeContratTravail.t'")],bJC=a("AllocationAdulteHandicape"),bJD=a(Kc),bJE=a("AllocationSoutienEnfantHandicape"),bJF=a(iR),bJG=a(X),bJH=a(ru),bJJ=[1,0],bJK=[0,0],bJL=[3,0],bJM=[4,0],bJN=[2,0],bJO=[5,0],bJI=[0,[11,a(be),[2,0,[11,a("' kind for the enumeration 'PrestationRecue.t'"),0]]],a("Unexpected '%s' kind for the enumeration 'PrestationRecue.t'")],bJx=a(kJ),bJy=a(pK),bJA=[0,0],bJB=[1,0],bJz=[0,[11,a(be),[2,0,[11,a("' kind for the enumeration 'AmelioreParOccupant.t'"),0]]],a("Unexpected '%s' kind for the enumeration 'AmelioreParOccupant.t'")],bJo=a(JP),bJp=a("ObjectifDecenceLogement"),bJq=a(np),bJr=a("PrevuDansListeR321_15"),bJt=[1,0],bJu=[3,0],bJv=[0,0],bJw=[2,0],bJs=[0,[11,a(be),[2,0,[11,a("' kind for the enumeration 'TypeTravauxLogementR8425.t'"),0]]],a("Unexpected '%s' kind for the enumeration 'TypeTravauxLogementR8425.t'")],bJh=a(np),bJi=a(yd),bJj=a("TravauxSurLogementDejaAcquisD832_15_2"),bJl=[1,0],bJm=[0,0],bJn=[2,0],bJk=[0,[11,a(be),[2,0,[11,a("' kind for the enumeration 'TypeTravauxLogementD83215.t'"),0]]],a("Unexpected '%s' kind for the enumeration 'TypeTravauxLogementD83215.t'")],bJc=a(rw),bJd=a(yx),bJf=[1,0],bJg=[0,0],bJe=[0,[11,a(be),[2,0,[11,a("' kind for the enumeration 'TitulairePret.t'"),0]]],a("Unexpected '%s' kind for the enumeration 'TitulairePret.t'")],bI3=a(h7),bI4=a(Bq),bI5=a(Ie),bI6=a(yt),bI7=a(Aj),bI9=[3,0],bI_=[1,0],bI$=[2,0],bJa=[0,0],bJb=[4,0],bI8=[0,[11,a(be),[2,0,[11,a("' kind for the enumeration 'TypePret.t'"),0]]],a("Unexpected '%s' kind for the enumeration 'TypePret.t'")],bIY=a("BailleurPrive"),bIZ=a(Cr),bI1=[0,0],bI2=[1,0],bI0=[0,[11,a(be),[2,0,[11,a("' kind for the enumeration 'TypeBailleur.t'"),0]]],a("Unexpected '%s' kind for the enumeration 'TypeBailleur.t'")],bIW=[0,a(LY),a(zW),a(Ls),a(IP),a(yl),a(nK),a(gz),a(AZ),a(zC),a(Fd),a(CK),a(He),a(A6),a(Hm),a(D4),a(Km),a(Jg),a(HQ),a(EC),a(Jy),a(E5),a(Gi),a(IQ),a(wV)],bIX=[0,a(gz),a(IP),a(Km),a(Jg),a(HQ),a(yl),a(E5),a(Ls),a(Fd),a(AZ),a(EC),a(A6),a(CK),a(Hm),a(IQ),a(zW),a(He),a(Jy),a(wV),a(Gi),a(zC),a(LY),a(D4),a(nK)],bNx=a("AidesLogementLib"),bNz=a(ac);function +bY(a){if(typeof a==="number")return 0;else switch(a[0]){case -0:return[0,aj(a[1])];case -1:return[1,aj(a[1])];case -2:return[2,aj(a[1])];case -3:return[3,aj(a[1])];case -4:return[4,aj(a[1])];case -5:return[5,aj(a[1])];case -6:return[6,aj(a[1])];case -7:return[7,aj(a[1])];case +0:return[0,bY(a[1])];case +1:return[1,bY(a[1])];case +2:return[2,bY(a[1])];case +3:return[3,bY(a[1])];case +4:return[4,bY(a[1])];case +5:return[5,bY(a[1])];case +6:return[6,bY(a[1])];case +7:return[7,bY(a[1])];case 8:var -c=a[1];return[8,c,aj(a[2])];case +c=a[1];return[8,c,bY(a[2])];case 9:var -b=a[1];return[9,b,b,aj(a[3])];case -10:return[10,aj(a[1])];case -11:return[11,aj(a[1])];case -12:return[12,aj(a[1])];case -13:return[13,aj(a[1])];default:return[14,aj(a[1])]}}function -aQ(a,b){if(typeof +b=a[1];return[9,b,b,bY(a[3])];case +10:return[10,bY(a[1])];case +11:return[11,bY(a[1])];case +12:return[12,bY(a[1])];case +13:return[13,bY(a[1])];default:return[14,bY(a[1])]}}function +c3(a,b){if(typeof a==="number")return b;else switch(a[0]){case -0:return[0,aQ(a[1],b)];case -1:return[1,aQ(a[1],b)];case -2:return[2,aQ(a[1],b)];case -3:return[3,aQ(a[1],b)];case -4:return[4,aQ(a[1],b)];case -5:return[5,aQ(a[1],b)];case -6:return[6,aQ(a[1],b)];case -7:return[7,aQ(a[1],b)];case +0:return[0,c3(a[1],b)];case +1:return[1,c3(a[1],b)];case +2:return[2,c3(a[1],b)];case +3:return[3,c3(a[1],b)];case +4:return[4,c3(a[1],b)];case +5:return[5,c3(a[1],b)];case +6:return[6,c3(a[1],b)];case +7:return[7,c3(a[1],b)];case 8:var -c=a[1];return[8,c,aQ(a[2],b)];case +c=a[1];return[8,c,c3(a[2],b)];case 9:var -d=a[2],e=a[1];return[9,e,d,aQ(a[3],b)];case -10:return[10,aQ(a[1],b)];case -11:return[11,aQ(a[1],b)];case -12:return[12,aQ(a[1],b)];case -13:return[13,aQ(a[1],b)];default:return[14,aQ(a[1],b)]}}function -ac(a,b){if(typeof +d=a[2],e=a[1];return[9,e,d,c3(a[3],b)];case +10:return[10,c3(a[1],b)];case +11:return[11,c3(a[1],b)];case +12:return[12,c3(a[1],b)];case +13:return[13,c3(a[1],b)];default:return[14,c3(a[1],b)]}}function +bL(a,b){if(typeof a==="number")return b;else switch(a[0]){case -0:return[0,ac(a[1],b)];case -1:return[1,ac(a[1],b)];case +0:return[0,bL(a[1],b)];case +1:return[1,bL(a[1],b)];case 2:var -c=a[1];return[2,c,ac(a[2],b)];case +c=a[1];return[2,c,bL(a[2],b)];case 3:var -d=a[1];return[3,d,ac(a[2],b)];case +d=a[1];return[3,d,bL(a[2],b)];case 4:var -e=a[3],f=a[2],g=a[1];return[4,g,f,e,ac(a[4],b)];case +e=a[3],f=a[2],g=a[1];return[4,g,f,e,bL(a[4],b)];case 5:var -h=a[3],i=a[2],j=a[1];return[5,j,i,h,ac(a[4],b)];case +h=a[3],i=a[2],j=a[1];return[5,j,i,h,bL(a[4],b)];case 6:var -k=a[3],l=a[2],m=a[1];return[6,m,l,k,ac(a[4],b)];case +k=a[3],l=a[2],m=a[1];return[6,m,l,k,bL(a[4],b)];case 7:var -n=a[3],o=a[2],p=a[1];return[7,p,o,n,ac(a[4],b)];case +n=a[3],o=a[2],p=a[1];return[7,p,o,n,bL(a[4],b)];case 8:var -q=a[3],r=a[2],s=a[1];return[8,s,r,q,ac(a[4],b)];case +q=a[3],r=a[2],s=a[1];return[8,s,r,q,bL(a[4],b)];case 9:var -t=a[1];return[9,t,ac(a[2],b)];case -10:return[10,ac(a[1],b)];case +t=a[1];return[9,t,bL(a[2],b)];case +10:return[10,bL(a[1],b)];case 11:var -u=a[1];return[11,u,ac(a[2],b)];case +u=a[1];return[11,u,bL(a[2],b)];case 12:var -v=a[1];return[12,v,ac(a[2],b)];case +v=a[1];return[12,v,bL(a[2],b)];case 13:var -w=a[2],x=a[1];return[13,x,w,ac(a[3],b)];case +w=a[2],x=a[1];return[13,x,w,bL(a[3],b)];case 14:var -y=a[2],z=a[1];return[14,z,y,ac(a[3],b)];case -15:return[15,ac(a[1],b)];case -16:return[16,ac(a[1],b)];case +y=a[2],z=a[1];return[14,z,y,bL(a[3],b)];case +15:return[15,bL(a[1],b)];case +16:return[16,bL(a[1],b)];case 17:var -A=a[1];return[17,A,ac(a[2],b)];case +A=a[1];return[17,A,bL(a[2],b)];case 18:var -B=a[1];return[18,B,ac(a[2],b)];case -19:return[19,ac(a[1],b)];case +B=a[1];return[18,B,bL(a[2],b)];case +19:return[19,bL(a[1],b)];case 20:var -C=a[2],D=a[1];return[20,D,C,ac(a[3],b)];case +C=a[2],D=a[1];return[20,D,C,bL(a[3],b)];case 21:var -E=a[1];return[21,E,ac(a[2],b)];case -22:return[22,ac(a[1],b)];case +E=a[1];return[21,E,bL(a[2],b)];case +22:return[22,bL(a[1],b)];case 23:var -F=a[1];return[23,F,ac(a[2],b)];default:var -G=a[2],H=a[1];return[24,H,G,ac(a[3],b)]}}function -gz(a,c,b){return a[1]===c?(a[1]=b,1):0}function -aB(a){throw[0,cm,a]}function -$(a){throw[0,cQ,a]}var -eM=[Q,pd,aO(0)];function -eN(b,a){return oP(b,a)?b:a}function -cR(a){return 0<=a?a:-a|0}var -pe=h9,cn=dx,pg=dH(pf),pi=dH(ph),pk=dH(pj);function -L(d,c){var -a=w(d),e=w(c),b=am(a+e|0);bC(d,0,b,0,a);bC(c,0,b,a,e);return aA(b)}function -pl(a){return a?pm:pn}Oq(0);var -pq=oU(1),bF=oU(2);function -pr(b){function +F=a[1];return[23,F,bL(a[2],b)];default:var +G=a[2],H=a[1];return[24,H,G,bL(a[3],b)]}}function +p6(a,c,b){return a[1]===c?(a[1]=b,1):0}function +aB(a){throw[0,fT,a]}function +bA(a){throw[0,g0,a]}var +kY=[bl,Nb,cK(0)];function +t5(b,a){return MQ(b,a)?b:a}function +fl(a){return 0<=a?a:-a|0}var +t6=i9(Nd),t7=i9(Ne),Nc=sl,fU=h1,Ng=i9(Nf);function +bf(d,c){var +a=ay(d),e=ay(c),b=bR(a+e|0);eF(d,0,b,0,a);eF(c,0,b,a,e);return cB(b)}function +Nh(a){return a?Ni:Nj}bOm(0);var +Nm=MU(1),eI=MU(2);function +Nn(b){function a(b){var a=b;for(;;){if(a){var -c=a[2],d=a[1];try{c3(d)}catch(a){a=p(a);if(a[1]!==iN)throw a;var +c=a[2],d=a[1];try{hv(d)}catch(a){a=m(a);if(a[1]!==t3)throw a;var e=a}var -a=c;continue}return 0}}return a(Or(0))}function -dN(b,a){return iD(b,a,0,w(a))}function -iQ(a){dN(bF,a);oV(bF,10);return c3(bF)}var -gB=[0,pr];function -pt(d){for(;;){var -a=gB[1],e=[0,1],c=1-gz(gB,a,function(a,c){return function(e){if(gz(a,1,0))b(d,0);return b(c,0)}}(e,a));if(c)continue;return c}}function -gC(a){return b(gB[1],0)}iG(a(kC),gC);function -co(a){if(0<=a&&!(dz>>0){if(!(25>>0))c=1}else +a=c;continue}return 0}}return a(bOn(0))}function +jd(b,a){return tR(b,a,0,ay(a))}function +t8(a){jd(eI,a);MV(eI,10);return hv(eI)}var +p9=[0,Nn];function +Np(c){for(;;){var +a=p9[1],d=[0,1],b=1-p6(p9,a,function(a,b){return function(d){if(p6(a,1,0))k(c,0);return k(b,0)}}(d,a));if(b)continue;return b}}function +p_(a){return k(p9[1],0)}tU(a(wM),p_);function +p$(b,c,g){var +a=k(c,0);if(a){var +d=a[2],e=a[1],f=function(a){return p$(b,d,a)};return[0,k(b,e),f]}return 0}function +t9(d,c){var +b=c;for(;;){var +a=k(b,0);if(a){var +e=a[2];k(d,a[1]);var +b=e;continue}return 0}}function +fV(a){if(0<=a&&!(iA>>0){if(!(25>>0))c=1}else if(23!==b)c=1;return c?a+32|0:a}function -iR(a){var -b=a-224|0,c=0;if(30>>0){if(!(25>>0))c=1}else -if(23!==b)c=1;return c?a+ij|0:a}var -iS=OE(0),dO=(4*iS|0)-1|0;function -pB(a){return 25>>0?a:a+ij|0}function -cp(c){var +t_(a){var +b=a-224|0,c=0;if(30>>0){if(!(25>>0))c=1}else +if(23!==b)c=1;return c?a+r3|0:a}var +qb=bOA(0),fW=(4*qb|0)-1|0;function +Nx(a){return 25>>0?a:a+r3|0}function +fX(c){var b=0,a=c;for(;;){if(a){var b=b+1|0,a=a[2];continue}return b}}function -iT(a){return a?a[2]:aB(pD)}function -eO(d,c){if(0<=c){var +t$(a){return a?a[1]:aB(Ny)}function +ua(a){return a?a[2]:aB(Nz)}function +kZ(d,c){if(0<=c){var a=d,b=c;for(;;){if(a){var e=a[2],f=a[1];if(0===b)return f;var -a=e,b=b-1|0;continue}return aB(pE)}}return $(pF)}function -bG(d){var +a=e,b=b-1|0;continue}return aB(NA)}}return bA(NB)}function +eJ(d){var a=d,b=0;for(;;){if(a){var c=[0,a[1],b],a=a[2],b=c;continue}return b}}function -dP(c,a){if(a){var -d=a[2],e=b(c,a[1]);return[0,e,dP(c,d)]}return 0}function -iU(d,c){var -a=c;for(;;){if(a){var -e=a[2];b(d,a[1]);var -a=e;continue}return 0}}function -iV(f){var -g=0;return function(h){var -c=g,a=h;for(;;){if(a){var -d=a[2],e=a[1];if(b(f,e)){var -c=[0,e,c],a=d;continue}var -a=d;continue}return bG(c)}}}function -bH(a,c){var -b=am(a);NZ(b,0,a,c);return b}function -iW(a){var -b=be(a),c=am(b);cL(a,0,c,0,b);return c}function -eP(a){return aA(iW(a))}function -iX(c,b,a){if(0<=b&&0<=a&&!((be(c)-a|0)>>0))e=1}else +f=0;if(1>>0))e=1}else if(65<=d)e=1}else{var -f=0;if(32!==d)if(43<=d)switch(d+ok|0){case +f=0;if(32!==d)if(43<=d)switch(d+AB|0){case 5:if(a<(c+2|0)&&1>>0){if(33>>0)p=1}else +n=ep(k,j)+r3|0,p=0;if(59>>0){if(33>>0)p=1}else if(2===n)p=1;if(!p){var j=j+1|0;continue}var -e=bD(k),a=[0,0],r=be(e)-1|0,x=0;if(!(r<0)){var -i=x;for(;;){var -f=eD(e,i),g=0;if(32<=f){var +e=eG(k),a=[0,0],r=dJ(e)-1|0,w=0;if(!(r<0)){var +i=w;for(;;){var +f=kM(e,i),g=0;if(32<=f){var l=f-34|0,q=0;if(58>>0){if(93<=l)q=1}else if(56>>0){g=1;q=1}if(!q){var m=1;g=2}}else @@ -2209,931 +2226,1157 @@ if(8<=f)g=1;switch(g){case m=4;break;case 1:var m=2;break}a[1]=a[1]+m|0;var -A=i+1|0;if(r!==i){var -i=A;continue}break}}if(a[1]===be(e))var -t=iW(e);else{var -b=am(a[1]);a[1]=0;var -s=be(e)-1|0,y=0;if(!(s<0)){var -h=y;for(;;){var -c=eD(e,h),d=0;if(35<=c)if(92===c)d=2;else -if(bz<=c)d=1;else +z=i+1|0;if(r!==i){var +i=z;continue}break}}if(a[1]===dJ(e))var +t=ud(e);else{var +b=bR(a[1]);a[1]=0;var +s=dJ(e)-1|0,x=0;if(!(s<0)){var +h=x;for(;;){var +c=kM(e,h),d=0;if(35<=c)if(92===c)d=2;else +if(cu<=c)d=1;else d=3;else if(32<=c)if(34<=c)d=2;else d=3;else if(14<=c)d=1;else switch(c){case -8:ao(b,a[1],92);a[1]++;ao(b,a[1],98);break;case -9:ao(b,a[1],92);a[1]++;ao(b,a[1],cE);break;case -10:ao(b,a[1],92);a[1]++;ao(b,a[1],ey);break;case -13:ao(b,a[1],92);a[1]++;ao(b,a[1],114);break;default:d=1}switch(d){case -1:ao(b,a[1],92);a[1]++;ao(b,a[1],48+(c/bc|0)|0);a[1]++;ao(b,a[1],48+((c/10|0)%10|0)|0);a[1]++;ao(b,a[1],48+(c%10|0)|0);break;case -2:ao(b,a[1],92);a[1]++;ao(b,a[1],c);break;case -3:ao(b,a[1],c);break}a[1]++;var -z=h+1|0;if(s!==h){var -h=z;continue}break}}var +8:b$(b,a[1],92);a[1]++;b$(b,a[1],98);break;case +9:b$(b,a[1],92);a[1]++;b$(b,a[1],hp);break;case +10:b$(b,a[1],92);a[1]++;b$(b,a[1],iH);break;case +13:b$(b,a[1],92);a[1]++;b$(b,a[1],114);break;default:d=1}switch(d){case +1:b$(b,a[1],92);a[1]++;b$(b,a[1],48+(c/cA|0)|0);a[1]++;b$(b,a[1],48+((c/10|0)%10|0)|0);a[1]++;b$(b,a[1],48+(c%10|0)|0);break;case +2:b$(b,a[1],92);a[1]++;b$(b,a[1],c);break;case +3:b$(b,a[1],c);break}a[1]++;var +y=h+1|0;if(s!==h){var +h=y;continue}break}}var t=b}var -o=aA(t)}var -u=w(o),v=bH(u+2|0,34);bC(o,0,v,1,u);return aA(v)}}function -i8(d,f){var -g=cR(f),e=rC[1];switch(d[2]){case +o=cB(t)}var +u=ay(o),v=eK(u+2|0,34);eF(o,0,v,1,u);return cB(v)}}function +uo(d,f){var +g=fl(f),e=Pz[1];switch(d[2]){case 0:var -b=lZ;break;case +b=Cj;break;case 1:var -b=br;break;case +b=eg;break;case 2:var b=69;break;case 3:var -b=h2;break;case +b=pj;break;case 4:var b=71;break;case 5:var b=e;break;case 6:var -b=ej;break;case +b=cX;break;case 7:var b=72;break;default:var b=70}var -c=i4(16);da(c,37);switch(d[1]){case +c=uk(16);hF(c,37);switch(d[1]){case 0:break;case -1:da(c,43);break;default:da(c,32)}if(8<=d[2])da(c,35);da(c,46);aJ(c,a(l+g));da(c,b);return i6(c)}function -eT(m,a){if(13<=m){var -g=[0,0],h=w(a)-1|0,n=0;if(!(h<0)){var -c=n;for(;;){if(!(9>>0))g[1]++;var +1:hF(c,43);break;default:hF(c,32)}if(8<=d[2])hF(c,35);hF(c,46);cN(c,a(ac+g));hF(c,b);return um(c)}function +k2(m,a){if(13<=m){var +g=[0,0],h=ay(a)-1|0,n=0;if(!(h<0)){var +c=n;for(;;){if(!(9>>0))g[1]++;var q=c+1|0;if(h!==c){var c=q;continue}break}}var -i=g[1],j=am(w(a)+((i-1|0)/3|0)|0),k=[0,0],d=function(a){bv(j,k[1],a);k[1]++;return 0},e=[0,((i-1|0)%3|0)+1|0],l=w(a)-1|0,o=0;if(!(l<0)){var +i=g[1],j=bR(ay(a)+((i-1|0)/3|0)|0),k=[0,0],d=function(a){c1(j,k[1],a);k[1]++;return 0},e=[0,((i-1|0)%3|0)+1|0],l=ay(a)-1|0,o=0;if(!(l<0)){var b=o;for(;;){var -f=bx(a,b);if(9>>0)d(f);else{if(0===e[1]){d(95);e[1]=3}e[1]+=-1;d(f)}var +f=ep(a,b);if(9>>0)d(f);else{if(0===e[1]){d(95);e[1]=3}e[1]+=-1;d(f)}var p=b+1|0;if(l!==b){var -b=p;continue}break}}return aA(j)}return a}function -rD(b,c){switch(b){case +b=p;continue}break}}return cB(j)}return a}function +PA(b,c){switch(b){case 1:var -a=qP;break;case +a=OM;break;case 2:var -a=qQ;break;case +a=ON;break;case 4:var -a=qS;break;case +a=OP;break;case 5:var -a=qT;break;case +a=OQ;break;case 6:var -a=qU;break;case +a=OR;break;case 7:var -a=qV;break;case +a=OS;break;case 8:var -a=qW;break;case +a=OT;break;case 9:var -a=qX;break;case +a=OU;break;case 10:var -a=qY;break;case +a=OV;break;case 11:var -a=qZ;break;case +a=OW;break;case 0:case 13:var -a=qO;break;case +a=OL;break;case 3:case 14:var -a=qR;break;default:var -a=q0}return eT(b,gj(a,c))}function -rE(b,c){switch(b){case +a=OO;break;default:var +a=OX}return k2(b,pR(a,c))}function +PB(b,c){switch(b){case 1:var -a=rd;break;case +a=Pa;break;case 2:var -a=re;break;case +a=Pb;break;case 4:var -a=rg;break;case +a=Pd;break;case 5:var -a=rh;break;case +a=Pe;break;case 6:var -a=ri;break;case +a=Pf;break;case 7:var -a=rj;break;case +a=Pg;break;case 8:var -a=rk;break;case +a=Ph;break;case 9:var -a=rl;break;case +a=Pi;break;case 10:var -a=rm;break;case +a=Pj;break;case 11:var -a=rn;break;case +a=Pk;break;case 0:case 13:var -a=rc;break;case +a=O$;break;case 3:case 14:var -a=rf;break;default:var -a=ro}return eT(b,gj(a,c))}function -rF(b,c){switch(b){case +a=Pc;break;default:var +a=Pl}return k2(b,pR(a,c))}function +PC(b,c){switch(b){case 1:var -a=rq;break;case +a=Pn;break;case 2:var -a=rr;break;case +a=Po;break;case 4:var -a=rt;break;case +a=Pq;break;case 5:var -a=ru;break;case +a=Pr;break;case 6:var -a=rv;break;case +a=Ps;break;case 7:var -a=rw;break;case +a=Pt;break;case 8:var -a=rx;break;case +a=Pu;break;case 9:var -a=ry;break;case +a=Pv;break;case 10:var -a=rz;break;case +a=Pw;break;case 11:var -a=rA;break;case +a=Px;break;case 0:case 13:var -a=rp;break;case +a=Pm;break;case 3:case 14:var -a=rs;break;default:var -a=rB}return eT(b,gj(a,c))}function -rG(b,c){switch(b){case +a=Pp;break;default:var +a=Py}return k2(b,pR(a,c))}function +PD(b,c){switch(b){case 1:var -a=q2;break;case +a=OZ;break;case 2:var -a=q3;break;case +a=O0;break;case 4:var -a=q5;break;case +a=O2;break;case 5:var -a=q6;break;case +a=O3;break;case 6:var -a=q7;break;case +a=O4;break;case 7:var -a=q8;break;case +a=O5;break;case 8:var -a=q9;break;case +a=O6;break;case 9:var -a=q_;break;case +a=O7;break;case 10:var -a=q$;break;case +a=O8;break;case 11:var -a=ra;break;case +a=O9;break;case 0:case 13:var -a=q1;break;case +a=OY;break;case 3:case 14:var -a=q4;break;default:var -a=rb}return eT(b,N$(a,c))}function -b5(b,e,a){function +a=O1;break;default:var +a=O_}return k2(b,bN9(a,c))}function +fn(b,e,a){function f(d){switch(b[1]){case 0:var c=45;break;case 1:var c=43;break;default:var -c=32}return N8(a,e,c)}function +c=32}return bN6(a,e,c)}function j(c){var -b=io(a);return 3===b?a<0.?rI:rJ:4<=b?rK:c}switch(b[2]){case +b=pO(a);return 3===b?a<0.?PF:PG:4<=b?PH:c}switch(b[2]){case 5:var -d=it(i8(b,e),a),c=0,k=w(d);for(;;){if(c===k)var +d=tJ(uo(b,e),a),c=0,k=ay(d);for(;;){if(c===k)var i=0;else{var -g=B(d,c)+ld|0,h=0;if(23>>0){if(55===g)h=1}else +g=aL(d,c)+Jv|0,h=0;if(23>>0){if(55===g)h=1}else if(21>>0)h=1;if(!h){var c=c+1|0;continue}var i=1}var -l=i?d:L(d,rH);return j(l)}case +l=i?d:bf(d,PE);return j(l)}case 6:return f(0);case -7:return aA(gE(pB,bD(f(0))));case -8:return j(f(0));default:return it(i8(b,e),a)}}function -ee(e,z,y,x){var -c=z,a=y,d=x;for(;;)if(typeof -d==="number")return b(c,a);else -switch(d[0]){case +7:return cB(qd(Nx,eG(f(0))));case +8:return j(f(0));default:return tJ(uo(b,e),a)}}function +jM(d,x,w,v){var +b=x,a=w,c=v;for(;;)if(typeof +c==="number")return k(b,a);else +switch(c[0]){case 0:var -A=d[1];return function(b){return M(c,[5,a,b],A)};case +y=c[1];return function(c){return bg(b,[5,a,c],y)};case 1:var -B=d[1];return function(b){var -e=0;if(40<=b)if(92===b)var -d=pv;else -if(bz<=b)e=1;else +z=c[1];return function(c){var +e=0;if(40<=c)if(92===c)var +d=Nr;else +if(cu<=c)e=1;else e=2;else -if(32<=b)if(39<=b)var -d=pw;else +if(32<=c)if(39<=c)var +d=Ns;else e=2;else -if(14<=b)e=1;else -switch(b){case +if(14<=c)e=1;else +switch(c){case 8:var -d=px;break;case +d=Nt;break;case 9:var -d=py;break;case +d=Nu;break;case 10:var -d=pz;break;case +d=Nv;break;case 13:var -d=pA;break;default:e=1}switch(e){case +d=Nw;break;default:e=1}switch(e){case 1:var -f=am(4);ao(f,0,92);ao(f,1,48+(b/bc|0)|0);ao(f,2,48+((b/10|0)%10|0)|0);ao(f,3,48+(b%10|0)|0);var -d=aA(f);break;case +f=bR(4);b$(f,0,92);b$(f,1,48+(c/cA|0)|0);b$(f,2,48+((c/10|0)%10|0)|0);b$(f,3,48+(c%10|0)|0);var +d=cB(f);break;case 2:var -g=am(1);ao(g,0,b);var -d=aA(g);break}var -h=w(d),i=bH(h+2|0,39);bC(d,0,i,1,h);return M(c,[4,a,aA(i)],B)};case +g=bR(1);b$(g,0,c);var +d=cB(g);break}var +h=ay(d),i=eK(h+2|0,39);eF(d,0,i,1,h);return bg(b,[4,a,cB(i)],z)};case 2:var -C=d[2],D=d[1];return gL(c,a,C,D,function(a){return a});case -3:return gL(c,a,d[2],d[1],qN);case -4:return eU(c,a,d[4],d[2],d[3],rD,d[1]);case -5:return eU(c,a,d[4],d[2],d[3],rE,d[1]);case -6:return eU(c,a,d[4],d[2],d[3],rF,d[1]);case -7:return eU(c,a,d[4],d[2],d[3],rG,d[1]);case +A=c[2],B=c[1];return ql(b,a,A,B,function(a){return a});case +3:return ql(b,a,c[2],c[1],OK);case +4:return k3(b,a,c[4],c[2],c[3],PA,c[1]);case +5:return k3(b,a,c[4],c[2],c[3],PB,c[1]);case +6:return k3(b,a,c[4],c[2],c[3],PC,c[1]);case +7:return k3(b,a,c[4],c[2],c[3],PD,c[1]);case 8:var -h=d[4],i=d[3],k=d[2],g=d[1];if(typeof -k==="number"){if(typeof -i==="number")return i?function(d,b){return M(c,[4,a,b5(g,d,b)],h)}:function(b){return M(c,[4,a,b5(g,gJ(g),b)],h)};var -W=i[1];return function(b){return M(c,[4,a,b5(g,W,b)],h)}}else{if(0===k[0]){var -n=k[2],o=k[1];if(typeof -i==="number")return i?function(d,b){return M(c,[4,a,a8(o,n,b5(g,d,b))],h)}:function(b){return M(c,[4,a,a8(o,n,b5(g,gJ(g),b))],h)};var -Y=i[1];return function(b){return M(c,[4,a,a8(o,n,b5(g,Y,b))],h)}}var -p=k[1];if(typeof -i==="number")return i?function(e,d,b){return M(c,[4,a,a8(p,e,b5(g,d,b))],h)}:function(d,b){return M(c,[4,a,a8(p,d,b5(g,gJ(g),b))],h)};var -_=i[1];return function(d,b){return M(c,[4,a,a8(p,d,b5(g,_,b))],h)}}case -9:return gL(c,a,d[2],d[1],pl);case +g=c[4],h=c[3],i=c[2],f=c[1];if(typeof +i==="number"){if(typeof +h==="number")return h?function(d,c){return bg(b,[4,a,fn(f,d,c)],g)}:function(c){return bg(b,[4,a,fn(f,qj(f),c)],g)};var +S=h[1];return function(c){return bg(b,[4,a,fn(f,S,c)],g)}}else{if(0===i[0]){var +m=i[2],n=i[1];if(typeof +h==="number")return h?function(d,c){return bg(b,[4,a,dt(n,m,fn(f,d,c))],g)}:function(c){return bg(b,[4,a,dt(n,m,fn(f,qj(f),c))],g)};var +T=h[1];return function(c){return bg(b,[4,a,dt(n,m,fn(f,T,c))],g)}}var +o=i[1];if(typeof +h==="number")return h?function(e,d,c){return bg(b,[4,a,dt(o,e,fn(f,d,c))],g)}:function(d,c){return bg(b,[4,a,dt(o,d,fn(f,qj(f),c))],g)};var +U=h[1];return function(d,c){return bg(b,[4,a,dt(o,d,fn(f,U,c))],g)}}case +9:return ql(b,a,c[2],c[1],Nh);case 10:var -a=[7,a],d=d[1];continue;case +a=[7,a],c=c[1];continue;case 11:var -a=[2,a,d[1]],d=d[2];continue;case +a=[2,a,c[1]],c=c[2];continue;case 12:var -a=[3,a,d[1]],d=d[2];continue;case +a=[3,a,c[1]],c=c[2];continue;case 13:var -E=d[3],F=d[2],q=i4(16);gK(q,F);var -v=i6(q);return function(b){return M(c,[4,a,v],E)};case +C=c[3],D=c[2],p=uk(16);qk(p,D);var +u=um(p);return function(c){return bg(b,[4,a,u],C)};case 14:var -G=d[3],I=d[2];return function(d){var -e=d[1],b=Z(e,aj(ar(I)));if(typeof -b[2]==="number")return M(c,a,ac(b[1],G));throw aD};case +E=c[3],F=c[2];return function(d){var +e=d[1],c=bB(e,bY(ch(F)));if(typeof +c[2]==="number")return bg(b,a,bL(c[1],E));throw cC};case 15:var -J=d[1];return function(d,b){return M(c,[6,a,function(a){return j(d,a,b)}],J)};case +G=c[1];return function(d,c){return bg(b,[6,a,function(a){return W(d,a,c)}],G)};case 16:var -K=d[1];return function(b){return M(c,[6,a,b],K)};case +H=c[1];return function(c){return bg(b,[6,a,c],H)};case 17:var -a=[0,a,d[1]],d=d[2];continue;case +a=[0,a,c[1]],c=c[2];continue;case 18:var -m=d[1];if(0===m[0]){var -L=d[2],N=m[1][1],O=0,c=function(b,c,d){return function(a){return M(c,[1,b,[0,a]],d)}}(a,c,L),a=O,d=N;continue}var -P=d[2],Q=m[1][1],R=0,c=function(b,c,d){return function(a){return M(c,[1,b,[1,a]],d)}}(a,c,P),a=R,d=Q;continue;case -19:throw[0,H,rM];case +l=c[1];if(0===l[0]){var +I=c[2],J=l[1][1],K=0,b=function(b,c,d){return function(a){return bg(c,[1,b,[0,a]],d)}}(a,b,I),a=K,c=J;continue}var +L=c[2],M=l[1][1],N=0,b=function(b,c,d){return function(a){return bg(c,[1,b,[1,a]],d)}}(a,b,L),a=N,c=M;continue;case +19:throw[0,a1,PJ];case 20:var -S=d[3],T=[8,a,rN];return function(a){return M(c,T,S)};case +O=c[3],P=[8,a,PK];return function(a){return bg(b,P,O)};case 21:var -U=d[2];return function(b){return M(c,[4,a,gj(rO,b)],U)};case +Q=c[2];return function(c){return bg(b,[4,a,pR(PL,c)],Q)};case 22:var -V=d[1];return function(b){return M(c,[5,a,b],V)};case +R=c[1];return function(c){return bg(b,[5,a,c],R)};case 23:var -f=d[2],l=d[1];if(typeof -l==="number")switch(l){case -0:return e<50?X(e+1|0,c,a,f):ai(X,[0,c,a,f]);case -1:return e<50?X(e+1|0,c,a,f):ai(X,[0,c,a,f]);case -2:throw[0,H,rP];default:return e<50?X(e+1|0,c,a,f):ai(X,[0,c,a,f])}else -switch(l[0]){case -0:return e<50?X(e+1|0,c,a,f):ai(X,[0,c,a,f]);case -1:return e<50?X(e+1|0,c,a,f):ai(X,[0,c,a,f]);case -2:return e<50?X(e+1|0,c,a,f):ai(X,[0,c,a,f]);case -3:return e<50?X(e+1|0,c,a,f):ai(X,[0,c,a,f]);case -4:return e<50?X(e+1|0,c,a,f):ai(X,[0,c,a,f]);case -5:return e<50?X(e+1|0,c,a,f):ai(X,[0,c,a,f]);case -6:return e<50?X(e+1|0,c,a,f):ai(X,[0,c,a,f]);case -7:return e<50?X(e+1|0,c,a,f):ai(X,[0,c,a,f]);case -8:return e<50?X(e+1|0,c,a,f):ai(X,[0,c,a,f]);case +e=c[2],j=c[1];if(typeof +j==="number")switch(j){case +0:return d<50?by(d+1|0,b,a,e):bX(by,[0,b,a,e]);case +1:return d<50?by(d+1|0,b,a,e):bX(by,[0,b,a,e]);case +2:throw[0,a1,PM];default:return d<50?by(d+1|0,b,a,e):bX(by,[0,b,a,e])}else +switch(j[0]){case +0:return d<50?by(d+1|0,b,a,e):bX(by,[0,b,a,e]);case +1:return d<50?by(d+1|0,b,a,e):bX(by,[0,b,a,e]);case +2:return d<50?by(d+1|0,b,a,e):bX(by,[0,b,a,e]);case +3:return d<50?by(d+1|0,b,a,e):bX(by,[0,b,a,e]);case +4:return d<50?by(d+1|0,b,a,e):bX(by,[0,b,a,e]);case +5:return d<50?by(d+1|0,b,a,e):bX(by,[0,b,a,e]);case +6:return d<50?by(d+1|0,b,a,e):bX(by,[0,b,a,e]);case +7:return d<50?by(d+1|0,b,a,e):bX(by,[0,b,a,e]);case +8:return d<50?by(d+1|0,b,a,e):bX(by,[0,b,a,e]);case 9:var -u=l[2];return e<50?hz(e+1|0,c,a,u,f):ai(hz,[0,c,a,u,f]);case -10:return e<50?X(e+1|0,c,a,f):ai(X,[0,c,a,f]);default:return e<50?X(e+1|0,c,a,f):ai(X,[0,c,a,f])}default:var -r=d[3],s=d[1],t=b(d[2],0);return e<50?hy(e+1|0,c,a,r,s,t):ai(hy,[0,c,a,r,s,t])}}function -hz(e,d,c,a,b){if(typeof -a==="number")return e<50?X(e+1|0,d,c,b):ai(X,[0,d,c,b]);else +t=j[2];return d<50?rr(d+1|0,b,a,t,e):bX(rr,[0,b,a,t,e]);case +10:return d<50?by(d+1|0,b,a,e):bX(by,[0,b,a,e]);default:return d<50?by(d+1|0,b,a,e):bX(by,[0,b,a,e])}default:var +q=c[3],r=c[1],s=k(c[2],0);return d<50?rq(d+1|0,b,a,q,r,s):bX(rq,[0,b,a,q,r,s])}}function +rr(e,d,c,a,b){if(typeof +a==="number")return e<50?by(e+1|0,d,c,b):bX(by,[0,d,c,b]);else switch(a[0]){case 0:var -f=a[1];return function(a){return bf(d,c,f,b)};case +f=a[1];return function(a){return dK(d,c,f,b)};case 1:var -g=a[1];return function(a){return bf(d,c,g,b)};case +g=a[1];return function(a){return dK(d,c,g,b)};case 2:var -h=a[1];return function(a){return bf(d,c,h,b)};case +h=a[1];return function(a){return dK(d,c,h,b)};case 3:var -i=a[1];return function(a){return bf(d,c,i,b)};case +i=a[1];return function(a){return dK(d,c,i,b)};case 4:var -j=a[1];return function(a){return bf(d,c,j,b)};case +j=a[1];return function(a){return dK(d,c,j,b)};case 5:var -k=a[1];return function(a){return bf(d,c,k,b)};case +k=a[1];return function(a){return dK(d,c,k,b)};case 6:var -l=a[1];return function(a){return bf(d,c,l,b)};case +l=a[1];return function(a){return dK(d,c,l,b)};case 7:var -m=a[1];return function(a){return bf(d,c,m,b)};case +m=a[1];return function(a){return dK(d,c,m,b)};case 8:var -n=a[2];return function(a){return bf(d,c,n,b)};case +n=a[2];return function(a){return dK(d,c,n,b)};case 9:var -o=a[3],p=a[2],q=au(ar(a[1]),p);return function(a){return bf(d,c,aQ(q,o),b)};case +o=a[3],p=a[2],q=cr(ch(a[1]),p);return function(a){return dK(d,c,c3(q,o),b)};case 10:var -r=a[1];return function(e,a){return bf(d,c,r,b)};case +r=a[1];return function(e,a){return dK(d,c,r,b)};case 11:var -s=a[1];return function(a){return bf(d,c,s,b)};case +s=a[1];return function(a){return dK(d,c,s,b)};case 12:var -t=a[1];return function(a){return bf(d,c,t,b)};case -13:throw[0,H,rQ];default:throw[0,H,rR]}}function -X(d,b,e,a){var -c=[8,e,rS];return d<50?ee(d+1|0,b,c,a):ai(ee,[0,b,c,a])}function -hy(h,c,f,a,e,d){if(e){var -i=e[1];return function(e){return rL(c,f,a,i,b(d,e))}}var -g=[4,f,d];return h<50?ee(h+1|0,c,g,a):ai(ee,[0,c,g,a])}function -M(a,b,c){return c6(ee(0,a,b,c))}function -bf(a,b,c,d){return c6(hz(0,a,b,c,d))}function -rL(a,b,c,d,e){return c6(hy(0,a,b,c,d,e))}function -gL(f,e,d,a,c){if(typeof -a==="number")return function(a){return M(f,[4,e,b(c,a)],d)};else{if(0===a[0]){var -g=a[2],h=a[1];return function(a){return M(f,[4,e,a8(h,g,b(c,a))],d)}}var -i=a[1];return function(g,a){return M(f,[4,e,a8(i,g,b(c,a))],d)}}}function -eU(f,e,d,g,c,b,a){if(typeof +t=a[1];return function(a){return dK(d,c,t,b)};case +13:throw[0,a1,PN];default:throw[0,a1,PO]}}function +by(d,b,e,a){var +c=[8,e,PP];return d<50?jM(d+1|0,b,c,a):bX(jM,[0,b,c,a])}function +rq(g,b,e,a,d,c){if(d){var +h=d[1];return function(d){return PI(b,e,a,h,k(c,d))}}var +f=[4,e,c];return g<50?jM(g+1|0,b,f,a):bX(jM,[0,b,f,a])}function +bg(a,b,c){return hy(jM(0,a,b,c))}function +dK(a,b,c,d){return hy(rr(0,a,b,c,d))}function +PI(a,b,c,d,e){return hy(rq(0,a,b,c,d,e))}function +ql(e,d,c,a,b){if(typeof +a==="number")return function(a){return bg(e,[4,d,k(b,a)],c)};else{if(0===a[0]){var +f=a[2],g=a[1];return function(a){return bg(e,[4,d,dt(g,f,k(b,a))],c)}}var +h=a[1];return function(f,a){return bg(e,[4,d,dt(h,f,k(b,a))],c)}}}function +k3(f,e,d,g,c,b,a){if(typeof g==="number"){if(typeof -c==="number")return c?function(g,c){return M(f,[4,e,db(g,j(b,a,c))],d)}:function(c){return M(f,[4,e,j(b,a,c)],d)};var -l=c[1];return function(c){return M(f,[4,e,db(l,j(b,a,c))],d)}}else{if(0===g[0]){var +c==="number")return c?function(g,c){return bg(f,[4,e,hG(g,W(b,a,c))],d)}:function(c){return bg(f,[4,e,W(b,a,c)],d)};var +k=c[1];return function(c){return bg(f,[4,e,hG(k,W(b,a,c))],d)}}else{if(0===g[0]){var h=g[2],i=g[1];if(typeof -c==="number")return c?function(g,c){return M(f,[4,e,a8(i,h,db(g,j(b,a,c)))],d)}:function(c){return M(f,[4,e,a8(i,h,j(b,a,c))],d)};var -m=c[1];return function(c){return M(f,[4,e,a8(i,h,db(m,j(b,a,c)))],d)}}var -k=g[1];if(typeof -c==="number")return c?function(h,g,c){return M(f,[4,e,a8(k,h,db(g,j(b,a,c)))],d)}:function(g,c){return M(f,[4,e,a8(k,g,j(b,a,c))],d)};var -n=c[1];return function(g,c){return M(f,[4,e,a8(k,g,db(n,j(b,a,c)))],d)}}}function -b6(c,f){var -a=f;for(;;)if(typeof +c==="number")return c?function(g,c){return bg(f,[4,e,dt(i,h,hG(g,W(b,a,c)))],d)}:function(c){return bg(f,[4,e,dt(i,h,W(b,a,c))],d)};var +l=c[1];return function(c){return bg(f,[4,e,dt(i,h,hG(l,W(b,a,c)))],d)}}var +j=g[1];if(typeof +c==="number")return c?function(h,g,c){return bg(f,[4,e,dt(j,h,hG(g,W(b,a,c)))],d)}:function(g,c){return bg(f,[4,e,dt(j,g,W(b,a,c))],d)};var +m=c[1];return function(g,c){return bg(f,[4,e,dt(j,g,hG(m,W(b,a,c)))],d)}}}function +fo(b,e){var +a=e;for(;;)if(typeof a==="number")return 0;else switch(a[0]){case 0:var -g=a[1],h=i7(a[2]);b6(c,g);return dN(c,h);case +f=a[1],g=un(a[2]);fo(b,f);return jd(b,g);case 1:var -d=a[2],e=a[1];if(0===d[0]){var -i=d[1];b6(c,e);dN(c,rT);var -a=i;continue}var -j=d[1];b6(c,e);dN(c,rU);var -a=j;continue;case +c=a[2],d=a[1];if(0===c[0]){var +h=c[1];fo(b,d);jd(b,PQ);var +a=h;continue}var +i=c[1];fo(b,d);jd(b,PR);var +a=i;continue;case 6:var -m=a[2];b6(c,a[1]);return b(m,c);case -7:b6(c,a[1]);return c3(c);case +m=a[2];fo(b,a[1]);return k(m,b);case +7:fo(b,a[1]);return hv(b);case 8:var -n=a[2];b6(c,a[1]);return $(n);case +n=a[2];fo(b,a[1]);return bA(n);case 2:case 4:var -k=a[2];b6(c,a[1]);return dN(c,k);default:var -l=a[2];b6(c,a[1]);return oV(c,l)}}function -b7(c,f){var -a=f;for(;;)if(typeof +j=a[2];fo(b,a[1]);return jd(b,j);default:var +l=a[2];fo(b,a[1]);return MV(b,l)}}function +fp(b,e){var +a=e;for(;;)if(typeof a==="number")return 0;else switch(a[0]){case 0:var -g=a[1],h=i7(a[2]);b7(c,g);return aI(c,h);case +f=a[1],g=un(a[2]);fp(b,f);return jm(b,g);case 1:var -d=a[2],e=a[1];if(0===d[0]){var -i=d[1];b7(c,e);aI(c,rV);var -a=i;continue}var -j=d[1];b7(c,e);aI(c,rW);var -a=j;continue;case +c=a[2],d=a[1];if(0===c[0]){var +h=c[1];fp(b,d);jm(b,PS);var +a=h;continue}var +i=c[1];fp(b,d);jm(b,PT);var +a=i;continue;case 6:var -m=a[2];b7(c,a[1]);return aI(c,b(m,0));case +m=a[2];fp(b,a[1]);return jm(b,k(m,0));case 7:var a=a[1];continue;case 8:var -n=a[2];b7(c,a[1]);return $(n);case +n=a[2];fp(b,a[1]);return bA(n);case 2:case 4:var -k=a[2];b7(c,a[1]);return aI(c,k);default:var -l=a[2];b7(c,a[1]);return V(c,l)}}function -rX(a){if(cP(a,rY))return rZ;var -e=w(a);function +j=a[2];fp(b,a[1]);return jm(b,j);default:var +l=a[2];fp(b,a[1]);return uj(b,l)}}function +PU(a){if(gZ(a,PV))return PW;var +d=ay(a);function +f(d){var +c=PX[1],b=hD(dC);return k(bg(function(a){fp(b,a);return aB(hE(b))},0,c),a)}function g(e){var -d=r0[1],c=cT(bW);return b(M(function(a){b7(c,a);return aB(cU(c))},0,d),a)}function -h(d){var -b=d;for(;;){if(b===e)return b;var -c=B(a,b);if(9!==c&&32!==c)return b;var +b=e;for(;;){if(b===d)return b;var +c=aL(a,b);if(9!==c&&32!==c)return b;var b=b+1|0;continue}}function -n(d,c){var -b=c;for(;;){if(b===e)return b;if(25>>0)return b;var +o(e,c){var +b=c;for(;;){if(b===d)return b;if(25>>0)return b;var b=b+1|0;continue}}function -o(g,f){var -b=f;for(;;){if(b===e)return b;var -c=B(a,b),d=0;if(48<=c){if(!(58<=c))d=1}else -if(45===c)d=1;if(d){var +p(g,f){var +b=f;for(;;){if(b===d)return b;var +c=aL(a,b),e=0;if(48<=c){if(!(58<=c))e=1}else +if(45===c)e=1;if(e){var b=b+1|0;continue}return b}}var -f=h(0),k=n(f,f),c=bk(a,f,k-f|0),d=h(k),i=o(d,d);if(d===i)var -j=0;else +e=g(0),j=o(e,e),b=d1(a,e,j-e|0),c=g(j),h=p(c,c);if(c===h)var +i=0;else try{var -q=oS(bk(a,d,i-d|0)),j=q}catch(a){a=p(a);if(a[1]!==cm)throw a;var -j=g(0)}if(h(i)!==e)g(0);var -m=0;if(K(c,r1)&&K(c,r2))var -l=K(c,r3)?K(c,r4)?K(c,r5)?K(c,r6)?g(0):1:2:3:0;else -m=1;if(m)var -l=4;return[0,j,l]}function -i9(d,c){var -a=c[1],b=0;return M(function(a){b6(d,a);return 0},b,a)}function -dY(a){return i9(bF,a)}function -av(b){var -a=b[1];return M(function(b){var -a=cT(64);b7(a,b);return cU(a)},0,a)}var -gM=[0,0];function -gO(i,h){var -a=i[1+h];if(1-(typeof -a==="number"?1:0)){if(bj(a)===fO)return b(av(r7),a);if(bj(a)===nJ){var -d=it(pp,a),c=0,g=w(d);for(;;){if(g<=c)return L(d,po);var -e=B(d,c),f=0;if(48<=e){if(!(58<=e))f=1}else -if(45===e)f=1;if(f){var -c=c+1|0;continue}return d}}return r8}return b(av(r9),a)}function -i_(b,a){if(b.length-1<=a)return r_;var -c=i_(b,a+1|0),d=gO(b,a);return j(av(r$),d,c)}function -eV(a){function -p(f){var -c=f;for(;;){if(c){var -g=c[2],h=c[1];try{var -e=0,d=b(h,a);e=1}catch(a){}if(e&&d)return[0,d[1]];var -c=g;continue}return 0}}var -h=p(gM[1]);if(h)return h[1];if(a===gA)return se;if(a===iM)return sf;if(a[1]===iL){var -d=a[2],i=d[3],q=d[2],r=d[1];return fs(av(gN),r,q,i,i+5|0,sg)}if(a[1]===H){var -e=a[2],k=e[3],s=e[2],t=e[1];return fs(av(gN),t,s,k,k+6|0,sh)}if(a[1]===iP){var -f=a[2],l=f[3],u=f[2],v=f[1];return fs(av(gN),v,u,l,l+6|0,si)}if(0===bj(a)){var -g=a.length-1,w=a[1][1];if(2>>0)var -m=i_(a,2),n=gO(a,1),c=j(av(sa),n,m);else -switch(g){case +q=kS(d1(a,c,h-c|0)),i=q}catch(a){a=m(a);if(a[1]!==fT)throw a;var +i=f(0)}if(g(h)!==d)f(0);var +n=0;if(M(b,PY)&&M(b,PZ))var +l=M(b,P0)?M(b,P1)?M(b,P2)?M(b,P3)?f(0):1:2:3:0;else +n=1;if(n)var +l=4;return[0,i,l]}function +up(d,c){var +a=c[1],b=0;return bg(function(a){fo(d,a);return 0},b,a)}function +jo(a){return up(eI,a)}function +aG(b){var +a=b[1];return bg(function(b){var +a=hD(64);fp(a,b);return hE(a)},0,a)}var +qm=[0,0];function +qo(h,g){var +a=h[1+g];if(1-(typeof +a==="number"?1:0)){if(d0(a)===ma)return k(aG(P4),a);if(d0(a)===on){var +c=tJ(Nl,a),b=0,f=ay(c);for(;;){if(f<=b)return bf(c,Nk);var +d=aL(c,b),e=0;if(48<=d){if(!(58<=d))e=1}else +if(45===d)e=1;if(e){var +b=b+1|0;continue}return c}}return P5}return k(aG(P6),a)}function +uq(b,a){if(b.length-1<=a)return P7;var +c=uq(b,a+1|0),d=qo(b,a);return W(aG(P8),d,c)}function +k4(a){function +o(e){var +b=e;for(;;){if(b){var +f=b[2],g=b[1];try{var +d=0,c=k(g,a);d=1}catch(a){}if(d&&c)return[0,c[1]];var +b=f;continue}return 0}}var +g=o(qm[1]);if(g)return g[1];if(a===p7)return Qb;if(a===t2)return Qc;if(a[1]===t1){var +c=a[2],h=c[3],p=c[2],q=c[1];return lP(aG(qn),q,p,h,h+5|0,Qd)}if(a[1]===a1){var +d=a[2],i=d[3],r=d[2],s=d[1];return lP(aG(qn),s,r,i,i+6|0,Qe)}if(a[1]===t4){var +e=a[2],j=e[3],t=e[2],u=e[1];return lP(aG(qn),u,t,j,j+6|0,Qf)}if(0===d0(a)){var +f=a.length-1,v=a[1][1];if(2>>0)var +l=uq(a,2),m=qo(a,1),b=W(aG(P9),m,l);else +switch(f){case 0:var -c=sb;break;case +b=P_;break;case 1:var -c=sc;break;default:var -o=gO(a,1),c=b(av(sd),o)}return L(w,c)}return a[1]}function -gP(t,s){var -e=NX(s),g=e.length-1-1|0,p=0;if(!(g<0)){var -c=p;for(;;){var -a=ab(e,c)[1+c],f=function(a){return function(b){return b?0===a?sj:sk:0===a?sl:sm}}(c);if(0===a[0])var -h=a[5],i=a[4],j=a[3],k=a[6]?sn:sp,l=a[2],m=a[7],n=f(a[1]),d=[0,NQ(av(so),n,m,l,k,j,i,h)];else +b=P$;break;default:var +n=qo(a,1),b=k(aG(Qa),n)}return bf(v,b)}return a[1]}function +qp(t,s){var +d=bNU(s),f=d.length-1-1|0,p=0;if(!(f<0)){var +b=p;for(;;){var +a=aX(d,b)[1+b],e=function(a){return function(b){return b?0===a?Qg:Qh:0===a?Qi:Qj}}(b);if(0===a[0])var +g=a[5],h=a[4],i=a[3],j=a[6]?Qk:Qm,l=a[2],m=a[7],n=e(a[1]),c=[0,bNL(aG(Ql),n,m,l,j,i,h,g)];else if(a[1])var -d=0;else +c=0;else var -o=f(0),d=[0,b(av(sq),o)];if(d){var -q=d[1];b(i9(t,sr),q)}var -r=c+1|0;if(g!==c){var -c=r;continue}break}}return 0}function -eW(c){for(;;){var -a=gM[1],b=1-gz(gM,a,[0,c,a]);if(b)continue;return b}}var -st=ss.slice();function -su(e,d){var -f=eV(e);b(dY(sv),f);gP(bF,d);var -a=Op(0);if(a<0){var -c=cR(a);iQ(ab(st,c)[1+c])}return c3(bF)}var -sw=[0];iG(a(mZ),function(e,i){try{try{var -c=i?sw:oN(0);try{gC(0)}catch(a){}try{var -a=su(e,c),d=a}catch(a){a=p(a);var -g=eV(e);b(dY(sy),g);gP(bF,c);var -h=eV(a);b(dY(sz),h);gP(bF,oN(0));var -d=c3(bF)}var -f=d}catch(a){a=p(a);if(a!==gA)throw a;var -f=iQ(sx)}return f}catch(a){return 0}});var -sB=[Q,sA,aO(0)];eW(function(a){return a[1]===sB?[0,L(sC,eV(a[2]))]:0});try{var -NO=o2(NN),ja=NO}catch(a){a=p(a);if(a!==aC)throw a;try{var -NM=o2(NL),i$=NM}catch(a){a=p(a);if(a!==aC)throw a;var -i$=sE}var -ja=i$}var -sF=i1(ja,82),eX=[R,function(y){var -n=OF(0),c=[0,ck(55,0),0],i=0===n.length-1?[0,0]:n,j=i.length-1,b=0;for(;;){ab(c[1],b)[1+b]=b;var -x=b+1|0;if(54!==b){var -b=x;continue}var -g=[0,sD],k=54+eN(55,j)|0,s=0;if(!(k<0)){var -d=s;for(;;){var -e=d%55|0,m=Ot(d,j),t=ab(i,m)[1+m],h=L(g[1],a(l+t));g[1]=Oo(h,0,w(h));var -f=g[1],o=B(f,3)<<24,p=B(f,2)<<16,q=B(f,1)<<8,r=((B(f,0)+q|0)+p|0)+o|0,u=(ab(c[1],e)[1+e]^r)&h5;ab(c[1],e)[1+e]=u;var -v=d+1|0;if(k!==d){var -d=v;continue}break}}c[2]=0;return c}}];function -sG(h,k){var -l=h?h[1]:sF,b=16;for(;;){if(!(k<=b)&&!(iS<(b*2|0))){var +o=e(0),c=[0,k(aG(Qn),o)];if(c){var +q=c[1];k(up(t,Qo),q)}var +r=b+1|0;if(f!==b){var +b=r;continue}break}}return 0}function +k5(c){for(;;){var +a=qm[1],b=1-p6(qm,a,[0,c,a]);if(b)continue;return b}}var +Qq=Qp.slice();function +Qr(d,c){var +e=k4(d);k(jo(Qs),e);qp(eI,c);var +a=bOl(0);if(a<0){var +b=fl(a);t8(aX(Qq,b)[1+b])}return hv(eI)}var +Qt=[0];tU(a(Dj),function(d,h){try{try{var +b=h?Qt:MO(0);try{p_(0)}catch(a){}try{var +a=Qr(d,b),c=a}catch(a){a=m(a);var +f=k4(d);k(jo(Qv),f);qp(eI,b);var +g=k4(a);k(jo(Qw),g);qp(eI,MO(0));var +c=hv(eI)}var +e=c}catch(a){a=m(a);if(a!==p7)throw a;var +e=t8(Qu)}return e}catch(a){return 0}});var +Qy=[bl,Qx,cK(0)];k5(function(a){return a[1]===Qy?[0,bf(Qz,k4(a[2]))]:0});function +k6(a){var +b=a.length-1<4?1:0,c=b||(a[4]<0?1:0);return c}function +fq(a){a[4]=-a[4]|0;return 0}try{var +bNI=M2(bNH),us=bNI}catch(a){a=m(a);if(a!==b5)throw a;try{var +bNG=M2(bNF),ur=bNG}catch(a){a=m(a);if(a!==b5)throw a;var +ur=QB}var +us=ur}var +QC=qe(us,82),k7=[bu,function(w){var +m=bOB(0),c=[0,dY(55,0),0],i=0===m.length-1?[0,0]:m,j=i.length-1,b=0;for(;;){aX(c[1],b)[1+b]=b;var +v=b+1|0;if(54!==b){var +b=v;continue}var +g=[0,QA],k=54+jf(55,j)|0,r=0;if(!(k<0)){var +d=r;for(;;){var +e=d%55|0,l=bOp(d,j),s=aX(i,l)[1+l],h=bf(g[1],a(ac+s));g[1]=bOk(h,0,ay(h));var +f=g[1],n=aL(f,3)<<24,o=aL(f,2)<<16,p=aL(f,1)<<8,q=((aL(f,0)+p|0)+o|0)+n|0,t=(aX(c[1],e)[1+e]^q)&tw;aX(c[1],e)[1+e]=t;var +u=d+1|0;if(k!==d){var +d=u;continue}break}}c[2]=0;return c}}];function +ut(h,k){var +l=h?h[1]:QC,b=16;for(;;){if(!(k<=b)&&!(qb<(b*2|0))){var b=b*2|0;continue}if(l){var -i=bj(eX),a=bg===i?eX[1]:R===i?b4(eX):eX;a[2]=(a[2]+1|0)%55|0;var -c=a[2],d=ab(a[1],c)[1+c],e=(a[2]+24|0)%55|0,f=(ab(a[1],e)[1+e]+(d^(d>>>25|0)&31)|0)&h5,g=a[2];ab(a[1],g)[1+g]=f;var +i=d0(k7),a=dP===i?k7[1]:bu===i?fm(k7):k7;a[2]=(a[2]+1|0)%55|0;var +c=a[2],d=aX(a[1],c)[1+c],e=(a[2]+24|0)%55|0,f=(aX(a[1],e)[1+e]+(d^(d>>>25|0)&31)|0)&tw,g=a[2];aX(a[1],g)[1+g]=f;var j=f}else var -j=0;return[0,0,ck(b,0),j,b]}}function -bI(a){return N2(10,bc,0,a)}var -gQ=[Q,sH,aO(0)],eY=0,jb=-1;function -dZ(a,b){a[13]=a[13]+b[3]|0;return i3(b,a[28])}var -jc=1000000010;function -gR(b,a){return P(b[17],a,0,w(a))}function -eZ(a){return b(a[19],0)}function -jd(a,c,b){a[9]=a[9]-c|0;gR(a,b);a[11]=0;return 0}function -e0(c,a){var -b=K(a,sI);return b?jd(c,w(a),a):b}function -cV(a,c,f){var -g=c[3],h=c[2];e0(a,c[1]);eZ(a);a[11]=1;var -d=(a[6]-f|0)+h|0,e=a[8],i=Ol(e,d)?e:d;a[10]=i;a[9]=a[6]-a[10]|0;b(a[21],a[10]);return e0(a,g)}function -je(b,a){return cV(b,sJ,a)}function -dc(a,c){var -d=c[2],e=c[3];e0(a,c[1]);a[9]=a[9]-d|0;b(a[20],d);return e0(a,e)}function -sK(a,j,c){if(typeof -c==="number")switch(c){case +j=0;return[0,0,dY(b,0),j,b]}}function +uu(a){var +c=0>>0))je(a,q)}else -eZ(a)}var -T=a[9]-S|0,U=1===I?1:a[9]>>0))uA(a,q)}else +k9(a)}var +S=a[9]-R|0,T=1===H?1:a[9]>>3|0,co(cM(b,a>>>3|0)|1<<(a&7)))}function -e6(b){var -a=g0(0);d0(a,b);return a}function -e7(c){var -b=am(32),a=0;for(;;){bv(b,a,co(cM(c,a)^dz));var +b=f;Rk[1]++;if(W(lc[28],e,c[4])){qz(c,e+1|0);aX(c[2],e)[1+e]=b}else +c[6]=[0,[0,e,b],c[6]];d[1]++;continue}return 0}}var +uX=[bl,Ro,cK(0)];qx(Rr,[0,uX,0,Rq,Rp]);k5(function(b){if(b[1]===uX){var +c=b[2],e=b[4],f=b[3];if(typeof +c==="number"){var +d=c;if(34<=d)switch(d){case +34:var +a=R1;break;case +35:var +a=R2;break;case +36:var +a=R3;break;case +37:var +a=R4;break;case +38:var +a=R5;break;case +39:var +a=R6;break;case +40:var +a=R7;break;case +41:var +a=R8;break;case +42:var +a=R9;break;case +43:var +a=R_;break;case +44:var +a=R$;break;case +45:var +a=Sa;break;case +46:var +a=Sb;break;case +47:var +a=Sc;break;case +48:var +a=Sd;break;case +49:var +a=Se;break;case +50:var +a=Sf;break;case +51:var +a=Sg;break;case +52:var +a=Sh;break;case +53:var +a=Si;break;case +54:var +a=Sj;break;case +55:var +a=Sk;break;case +56:var +a=Sl;break;case +57:var +a=Sm;break;case +58:var +a=Sn;break;case +59:var +a=So;break;case +60:var +a=Sp;break;case +61:var +a=Sq;break;case +62:var +a=Sr;break;case +63:var +a=Ss;break;case +64:var +a=St;break;case +65:var +a=Su;break;case +66:var +a=Sv;break;default:var +a=Sw}else +switch(d){case +0:var +a=Rs;break;case +1:var +a=Ru;break;case +2:var +a=Rv;break;case +3:var +a=Rw;break;case +4:var +a=Rx;break;case +5:var +a=Ry;break;case +6:var +a=Rz;break;case +7:var +a=RA;break;case +8:var +a=RB;break;case +9:var +a=RC;break;case +10:var +a=RD;break;case +11:var +a=RE;break;case +12:var +a=RF;break;case +13:var +a=RG;break;case +14:var +a=RH;break;case +15:var +a=RI;break;case +16:var +a=RJ;break;case +17:var +a=RK;break;case +18:var +a=RL;break;case +19:var +a=RM;break;case +20:var +a=RN;break;case +21:var +a=RO;break;case +22:var +a=RP;break;case +23:var +a=RQ;break;case +24:var +a=RR;break;case +25:var +a=RS;break;case +26:var +a=RT;break;case +27:var +a=RU;break;case +28:var +a=RV;break;case +29:var +a=RW;break;case +30:var +a=RX;break;case +31:var +a=RY;break;case +32:var +a=RZ;break;default:var +a=R0}}else +var +g=c[1],a=k(aG(Sx),g);return[0,bj(aG(Rt),a,f,e)]}return 0});p5(Sy);p5(Sz);try{p5(bNE)}catch(a){a=m(a);if(a[1]!==fT)throw a}try{p5(bND)}catch(a){a=m(a);if(a[1]!==fT)throw a}ut(0,7);function +SA(b,a){return d1(b,0,a)}function +SB(b,a){return d1(b,a,ay(b)-a|0)}var +fs=eK(32,iA);function +qB(a){return eK(32,0)}function +jq(b,a){return c1(b,a>>>3|0,fV(gX(b,a>>>3|0)|1<<(a&7)))}function +lk(b){var +a=qB(0);jq(a,b);return a}function +ll(c){var +b=bR(32),a=0;for(;;){c1(b,a,fV(gX(c,a)^iA));var d=a+1|0;if(31!==a){var a=d;continue}return b}}function -g1(d,c){var -b=am(32),a=0;for(;;){var -e=cM(c,a);bv(b,a,co(cM(d,a)|e));var +qC(d,c){var +b=bR(32),a=0;for(;;){var +e=gX(c,a);c1(b,a,fV(gX(d,a)|e));var f=a+1|0;if(31!==a){var a=f;continue}return b}}function -uu(c,b){try{var +SC(c,b){try{var a=0;for(;;){var -e=cM(b,a);if(0!==(cM(c,a)&e))throw eM;var +e=gX(b,a);if(0!==(gX(c,a)&e))throw kY;var f=a+1|0;if(31!==a){var a=f;continue}var -d=1;return d}}catch(a){a=p(a);if(a===eM)return 0;throw a}}function -jB(f,e){var +d=1;return d}}catch(a){a=m(a);if(a===kY)return 0;throw a}}function +uY(e,d){var a=0;for(;;){var -d=cM(e,a);if(0!==d){var -c=0;for(;;){if(0!==(d&1<>>0)if(9<=r)var -j=[0,[9,k+fA|0],g+1|0];else +j=[0,[9,k+mR|0],g+1|0];else l=1;else if(r)l=2;else{var -I=A[1];A[1]++;var -t=C(g+1|0),o=t[2],y=0,J=t[1];if((o+1|0)>>0)){if(q){var +q=aL(b,d)-42|0;if(!(1>>0)){if(q){var c=[6,c],d=d+1|0;continue}var c=[5,c],d=d+1|0;continue}if(21===q){var c=[7,c],d=d+1|0;continue}}var -z=0;if(typeof -c!=="number"&&0===c[0]){V(h[1],c[1]);z=1}if(!z){jG(h);h[2]=[0,c,h[2]]}var -a=d;continue a}}}jG(h);return[0,[3,bG(h[2])],a]}}function -C(g){var -d=D(g),c=d[1],a=d[2];for(;;){if((a+2|0)<=e&&92===B(b,a)&&hW===B(b,a+1|0)){var -f=D(a+2|0),c=[4,c,f[1]],a=f[2];continue}return[0,c,a]}}var -F=C(0),O=F[1],G=F[2]===e?O:aB(uS),f=[0,ck(32,0)],c=[0,0],l=[0,e_[1]],m=[0,0],h=[0,1],n=[0,0],r=0;function +C=0;if(typeof +c!=="number"&&0===c[0]){uj(h[1],c[1]);C=1}if(!C){u3(h);h[2]=[0,c,h[2]]}var +a=d;continue a}}}u3(h);return[0,[3,eJ(h[2])],a]}}function +z(g){var +d=A(g),c=d[1],a=d[2];for(;;){if((a+2|0)<=e&&92===aL(b,a)&&ku===aL(b,a+1|0)){var +f=A(a+2|0),c=[4,c,f[1]],a=f[2];continue}return[0,c,a]}}var +C=z(0),K=C[1],D=C[2]===e?K:aB(S0),f=[0,dY(32,0)],c=[0,0],k=[0,lo[1]],l=[0,0],h=[0,1],n=[0,0],q=0;function a(g,e){if(f[1].length-1<=c[1]){var a=[0,f[1].length-1];for(;;){if(a[1]<=c[1]){a[1]=a[1]*2|0;continue}var -b=ck(a[1],0);i2(f[1],0,b,0,f[1].length-1);f[1]=b;break}}var -h=jE(g,e),d=c[1];ab(f[1],d)[1+d]=h;c[1]++;return 0}function +b=dY(a[1],0);uh(f[1],0,b,0,f[1].length-1);f[1]=b;break}}var +h=u1(g,e),d=c[1];aX(f[1],d)[1+d]=h;c[1]++;return 0}function i(d){var -b=c[1];a(e8,0);return b}function -k(a,c,b){var -d=jE(c,g3(b,a));ab(f[1],a)[1+a]=d;return 0}function +b=c[1];a(lm,0);return b}function +j(a,c,b){var +d=u1(c,qE(b,a));aX(f[1],a)[1+a]=d;return 0}function g(b){try{var -a=j(e_[28],b,l[1]);return a}catch(a){a=p(a);if(a===aC){var -c=m[1];l[1]=P(e_[4],b,c,l[1]);m[1]++;return c}throw a}}function -t(b){if(g4(b)){var -a=n[1];if(64<=a)aB(uK);n[1]++;return a}return-1}function -o(b,a){return uu(b,a)}function +a=W(lo[28],b,k[1]);return a}catch(a){a=m(a);if(a===b5){var +c=l[1];k[1]=bj(lo[4],b,c,k[1]);l[1]++;return c}throw a}}function +s(b){if(qF(b)){var +a=n[1];if(64<=a)aB(SS);n[1]++;return a}return-1}function +o(b,a){return SC(b,a)}function d(b){if(typeof b==="number")switch(b){case -0:return a(ux,0);case -1:return a(uy,0);default:return a(uz,0)}else +0:return a(SF,0);case +1:return a(SG,0);default:return a(SH,0)}else switch(b[0]){case -0:return a(e8,b[1]);case +0:return a(lm,b[1]);case 1:var -e=b[1],m=w(e);if(0===m)return 0;if(1===m)return a(e8,B(e,0));try{var -n=i0(e,0);d([1,us(e,n)]);a(e8,0);var -v=d([1,ut(e,n+1|0)]);return v}catch(b){b=p(b);if(b===aC)return a(uv,g(e));throw b}case +e=b[1],n=ay(e);if(0===n)return 0;if(1===n)return a(lm,aL(e,0));try{var +o=ug(e,0);d([1,SA(e,o)]);a(lm,0);var +v=d([1,SB(e,o+1|0)]);return v}catch(b){b=m(b);if(b===b5)return a(SD,g(e));throw b}case 2:var -o=b[1],x=b[2]?e7(o):o;return a(uw,g(eP(x)));case -3:return J(b[1]);case +p=b[1],w=b[2]?ll(p):p;return a(SE,g(k0(w)));case +3:return F(b[1]);case 4:var -y=b[2],z=b[1],A=i(0);d(z);var -C=i(0),D=c[1];d(y);var -E=c[1];k(A,e9,D);return k(C,g2,E);case +x=b[2],y=b[1],z=i(0);d(y);var +A=i(0),B=c[1];d(x);var +C=c[1];j(z,ln,B);return j(A,qD,C);case 5:var -q=b[1],f=t(q),r=i(0);if(0<=f)a(jC,f);d(q);if(0<=f)a(jD,f);a(g2,g3(r,c[1]));return k(r,e9,c[1]);case +q=b[1],f=s(q),r=i(0);if(0<=f)a(uZ,f);d(q);if(0<=f)a(u0,f);a(qD,qE(r,c[1]));return j(r,ln,c[1]);case 6:var -s=b[1],j=t(s),F=c[1];d(s);if(0<=j)a(jD,j);var -G=i(0);if(0<=j)a(jC,j);a(g2,g3(F,c[1]));return k(G,e9,c[1]);case +t=b[1],k=s(t),D=c[1];d(t);if(0<=k)a(u0,k);var +E=i(0);if(0<=k)a(uZ,k);a(qD,qE(D,c[1]));return j(E,ln,c[1]);case 7:var -H=b[1],I=i(0);d(H);return k(I,e9,c[1]);case +G=b[1],H=i(0);d(G);return j(H,ln,c[1]);case 8:var -l=b[1],K=b[2];a(uA,l);d(K);a(uB,l);h[1]=eN(h[1],l+1|0);return 0;default:var -u=b[1];a(uC,u);h[1]=eN(h[1],u+1|0);return 0}}function -J(p){var +l=b[1],I=b[2];a(SI,l);d(I);a(SJ,l);h[1]=jf(h[1],l+1|0);return 0;default:var +u=b[1];a(SK,u);h[1]=jf(h[1],u+1|0);return 0}}function +F(p){var b=p;for(;;){if(b){var c=b[1];if(typeof c!=="number")switch(c[0]){case @@ -3304,7 +3547,7 @@ e==="number")l=1;else switch(e[0]){case 0:case 2:var -i=b[2],s=d1(i);if(o(cr(e),s)){a(uF,g(g5(r,e)));var +i=b[2],s=jr(i);if(o(fZ(e),s)){a(SN,g(qG(q,e)));var b=i;continue}break;default:l=1}break;case 6:var f=c[1],m=0;if(typeof @@ -3312,7 +3555,7 @@ f==="number")m=1;else switch(f[0]){case 0:case 2:var -j=b[2],t=d1(j);if(o(cr(f),t)){a(uG,g(g5(r,f)));var +j=b[2],t=jr(j);if(o(fZ(f),t)){a(SO,g(qG(q,f)));var b=j;continue}break;default:m=1}break;case 7:var h=c[1],n=0;if(typeof @@ -3320,720 +3563,746 @@ h==="number")n=1;else switch(h[0]){case 0:case 2:var -k=b[2],u=d1(k);if(o(cr(h),u)){a(uE,g(g5(r,h)));var +k=b[2],u=jr(k);if(o(fZ(h),u)){a(SM,g(qG(q,h)));var b=k;continue}break;default:n=1}break}var -q=b[2];d(c);var -b=q;continue}return 0}}d(G);a(uD,0);var -u=cr(G);if(oH(u,b9))var -v=-1;else{var -s=bH(bW,0);jB(function(a){return bv(s,a,1)},u);var -v=g(eP(s))}var -x=ck(m[1],uL),K=l[1];function -L(b,a){ab(x,a)[1+a]=b;return 0}j(e_[12],L,K);var -q=c[1],y=f[1],I=0,M=n[1],N=h[1];if(0<=q&&!((y.length-1-q|0)<0)){var -z=NS(y,0,q);I=1}if(!I)var -z=$(pP);return[0,z,x,uM,N,M,v]},fa=[0,[0]],jH=function(d,c,b){var -a=O6(d,c,b);fa[1]=a;if(0===a.length-1)throw aC;return ab(a,0)[1]},jI=function(d){var -b=0;if(fa[1].length-1<=0)return $(uT);var -a=ab(fa[1],0)[1+b],c=ab(fa[1],1)[2];if(-1===a)throw aC;return bk(d,a,c-a|0)},g6=m,g7=oJ,fb=function(b,a){return Math.abs(b-a)<0.001?1:0},g8=function(b,a){return fb(b,a)?0:b>a===b?c:pa(b,a)}return pa(b,a)},kd=function(a){return typeof -a==="number"?a:O4(a)},b$=0,hj=1,yC=-1,ke=function(a){return c9(0,a,0,w(a))},yD=function(b,a){return c9(b,a,0,w(a))},hk=function(a){if(typeof +c=b<>a===b?c:M$(b,a)}return M$(b,a)},vA=function(a){return typeof +a==="number"?a:bO1(a)},fu=0,ly=1,WK=-1,vB=function(a){return hA(0,a,0,ay(a))},WL=function(b,a){return hA(b,a,0,ay(a))},qV=function(a){if(typeof a==="number")return a;var -e=iI(a);if(63>g;f=1}if(!f)var -c=O2(a,b);var -i=OR(a,dg(c,b)),d=gw(c),h=i?d:Og(d,yE);return iA(gm(h),b)}return gm(gw(a))},d_=function(a,b){if(a!==0&&b!==1){var -c=OT(a,b);if(c===1)return[0,a,b];var -d=kc(b,c);return[0,kc(a,c),d]}return[0,a,hj]},kf=function(b,a){var -c=by(a);if(0===c)return[0,by(b),b$];if(0>>0))switch(b){case +c=bOZ(a,b);var +i=bOM(a,f6(c,b)),d=p3(c),h=i?d:bOe(d,WM);return pW(pU(h),b)}return pU(p3(a))},hK=function(a,b){if(a!==0&&b!==1){var +c=bOP(a,b);if(c===1)return[0,a,b];var +d=vz(b,c);return[0,vz(a,c),d]}return[0,a,ly]},vC=function(b,a){var +c=dr(a);if(0===c)return[0,dr(b),fu];if(0>>0))switch(b){case 0:return 2;case -1:break;default:return 1}return 3}return a[1]===0?0:4},yF=function(a){var -b=a[2];return[0,df(a[1]),b]},hn=function(b,a){if(b[2]!==0&&a[2]!==0){var -c=bK(b[2],a[2]);return d_(bK(b[1],a[1]),c)}return[0,bi(by(b[1]),by(a[1])),b$]},ho=function(a){switch(a){case +1:break;default:return 1}return 3}return a[1]===0?0:4},qW=function(d,c){var +e=g4(d),b=g4(c),a=0;switch(e){case +1:var +j=b-1|0;if(!(2>>0))switch(j){case +0:a=2;break;case +1:break;default:a=1}break;case +2:if(1===b)a=1;else +if(b)switch(b-2|0){case +1:a=1;break;case +2:break;default:a=2}break;case +3:if(3!==b)return-1;a=2;break;default:a=1}var +k=0;switch(a){case +1:var +i=b-1|0;if(!(2>>0))switch(i){case +0:k=1;break;case +1:break;default:return 1}break;case +0:break;default:return 0}if(!k){var +f=0;if(!(4<=e))switch(e){case +0:break;case +2:f=1;break;default:f=2}var +h=0;switch(f){case +0:if(2!==b){if(g(d[2],c[2]))return eq(d[1],c[1]);var +l=c4(c[1],d[2]);return eq(c4(d[1],c[2]),l)}h=1;break;case +1:break;default:h=1}if(h)return 1}return-1},vF=function(a){var +b=a[2];return[0,g3(a[1]),b]},vG=function(c,a,b){if(a[2]===b[2]){var +d=a[2];return hK(W(c,a[1],b[1]),d)}var +e=c4(a[2],b[2]),f=c4(b[1],a[2]);return hK(W(c,c4(a[1],b[2]),f),e)},jA=function(b,a){if(b[2]!==0&&a[2]!==0){var +c=c4(b[2],a[2]);return hK(c4(b[1],a[1]),c)}return[0,dZ(dr(b[1]),dr(a[1])),fu]},qX=function(b,a){if(0<=dr(a[1]))return jA(b,[0,a[2],a[1]]);var +c=g3(a[1]);return jA(b,[0,g3(a[2]),c])},qY=function(a){switch(a){case 0:return 2;case 1:return 8;case -2:return 10;default:return 16}},hp=function(f,e,d,c){var -a=e;for(;;){if(d<=a)return 0;if(b(c,B(f,a)))return[0,a];var -a=a+1|0;continue}},yH=function(a){if(K(a,yI)){if(K(a,yJ)){if(!K(a,yK))return ki;if(K(a,yL)){if(K(a,yM))try{var -k=i0(a,47),aa=c9(0,a,k+1|0,(w(a)-k|0)-1|0),ab=kf(c9(0,a,0,k),aa);return ab}catch(k){k=p(k);if(k===aC){var -i=w(a),y=0;if(i<1)var -s=[0,0,y];else{var -R=B(a,0)+ok|0,U=0;if(!(2>>0)){var -V=0;switch(R){case +2:return 10;default:return 16}},qZ=function(e,d,c,b){var +a=d;for(;;){if(c<=a)return 0;if(k(b,aL(e,a)))return[0,a];var +a=a+1|0;continue}},q0=[0,-1],WP=function(a){if(M(a,WQ)){if(M(a,WR)){if(!M(a,WS))return lA;if(M(a,WT)){if(M(a,WU))try{var +k=ug(a,47),X=hA(0,a,k+1|0,(ay(a)-k|0)-1|0),Y=vC(hA(0,a,0,k),X);return Y}catch(k){k=m(k);if(k===b5){var +i=ay(a),x=0;if(i<1)var +s=[0,0,x];else{var +N=aL(a,0)+AB|0,Q=0;if(!(2>>0)){var +R=0;switch(N){case 0:var -T=[0,0,1];break;case -1:V=1;break;default:var -T=[0,1,1]}if(!V){var -S=T;U=1}}if(!U)var -S=[0,0,y];var -s=S}var +P=[0,0,1];break;case +1:R=1;break;default:var +P=[0,1,1]}if(!R){var +O=P;Q=1}}if(!Q)var +O=[0,0,x];var +s=O}var c=s[2];if(i<(c+2|0))var t=[0,2,c];else{var -_=B(a,c),g=B(a,c+1|0),r=0;if(48===_){var +W=aL(a,c),g=aL(a,c+1|0),r=0;if(48===W){var h=0;if(89<=g){if(98===g)h=2;else -if(eA===g)h=1;else -if(fx!==g){r=1;h=3}}else +if(kb===g)h=1;else +if(nR!==g){r=1;h=3}}else if(66===g)h=2;else if(79===g)h=1;else if(!(88<=g)){r=1;h=3}switch(h){case @@ -4046,493 +4315,577 @@ q=[0,0,c+2|0]}}else r=1;if(r)var q=[0,2,c];var t=q}var -d=t[2],b=t[1],W=2===b?function(a){if(69!==a&&br!==a)return 0;return 1}:3<=b?function(a){if(80!==a&&ez!==a)return 0;return 1}:function(a){return 0},z=hp(a,d,i,W);if(z)var -A=z[1],C=A+1|0,e=A,D=kd(c9(10,a,C,i-C|0));else +d=t[2],b=t[1],S=2===b?function(a){if(69!==a&&eg!==a)return 0;return 1}:3<=b?function(a){if(80!==a&&kK!==a)return 0;return 1}:function(a){return 0},y=qZ(a,d,i,S);if(y)var +z=y[1],A=z+1|0,e=z,B=vA(hA(10,a,A,i-A|0));else var -e=i,D=0;if(2<=b){var -E=hp(a,d,e,function(a){return 46===a?1:0});if(E){var -u=E[1];if(2===b)var -F=1;else{if(!(3<=b))throw[0,H,yO];var -F=4}var -I=u+1|0,J=e-1|0,G=0;if(J>>4|0));V(a,kk(e&15));c[1]=b+1|0;break}}var -j=b+1|0;if(g!==b){var -b=j;continue}break}}yV(d,c,a);return V(a,34)},kl=function(a,b){return aI(a,y4)},km=function(b,a){var -c=a?y5:y6;return aI(b,c)},hq=function(b,a){return 0===a?0:(hq(b,a/10|0),V(b,co(cR(a%10|0)+48|0)))},kn=function(b,a){return 0>>4|0));c1(h,g+5|0,vJ(e&15));c[1]=a+1|0;break}}var +l=a+1|0;if(i!==a){var +a=l;continue}break}}W7(d,c,b);return bZ(b,34)},vK=function(a,b){return et(a,Xe)},vL=function(b,a){var +c=a?Xf:Xg;return et(b,c)},Xh=t5(10,11),q4=function(c,b,a){if(0===a)return b;var +d=q4(c,b,a/10|0);c1(c,d,fV(fl(a%10|0)+48|0));return d+1|0},vM=function(a,b){q2(a,Xh);if(0>>1|0;WX[1]++;continue}}}(globalThis)); diff --git a/french_law/js/package.json b/french_law/js/package.json index 7c18c01e..66643966 100644 --- a/french_law/js/package.json +++ b/french_law/js/package.json @@ -10,7 +10,7 @@ }, "devDependencies": {}, "scripts": { - "test": "node allocations_familiales.js" + "test": "node examples.js" }, "repository": { "type": "git", diff --git a/french_law/ocaml/README.md b/french_law/ocaml/README.md index a6161cdf..1580ca42 100644 --- a/french_law/ocaml/README.md +++ b/french_law/ocaml/README.md @@ -39,7 +39,7 @@ Then, the `api.{ml, mli}` module provides a wrapper around the functions exported in `law_source`. These wrappers mostly convert back and forth between idiomatic OCaml types and the types expected by the Catala programs in OCaml. -`api.web.ml` is used for the JS library (see the [dedicated README](../js/README.md)). +`api_web.ml` is used for the JS library (see the [dedicated README](../js/README.md)). Finally, `bench.ml` provides a simple benchmarking executable that runs the computations of each algorithm a bunch of times with random inputs. You can run it diff --git a/french_law/ocaml/api.ml b/french_law/ocaml/api.ml index 2c50818c..86af6982 100644 --- a/french_law/ocaml/api.ml +++ b/french_law/ocaml/api.ml @@ -1,6 +1,7 @@ (* This file is part of the French law library, a collection of functions for computing French taxes and benefits derived from Catala programs. Copyright - (C) 2021 Inria, contributor: Denis Merigoux + (C) 2021 Inria, contributor: Denis Merigoux , Emile + Rolley Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of @@ -14,15 +15,15 @@ License for the specific language governing permissions and limitations under the License. *) +open Runtime_ocaml.Runtime module Allocations_familiales = Law_source.Allocations_familiales module AF = Allocations_familiales -open Runtime let compute_allocations_familiales - ~(current_date : Runtime.date) + ~(current_date : date) ~(children : AF.EnfantEntree.t array) ~(income : int) - ~(residence : AF.collectivite) + ~(residence : AF.Collectivite.t) ~(is_parent : bool) ~(fills_title_I : bool) ~(had_rights_open_before_2012 : bool) : float = diff --git a/french_law/ocaml/api.mli b/french_law/ocaml/api.mli index 13e40c53..38889883 100644 --- a/french_law/ocaml/api.mli +++ b/french_law/ocaml/api.mli @@ -14,13 +14,14 @@ License for the specific language governing permissions and limitations under the License. *) +open Runtime_ocaml.Runtime module Allocations_familiales = Law_source.Allocations_familiales val compute_allocations_familiales : - current_date:Runtime.date -> + current_date:date -> children:Allocations_familiales.EnfantEntree.t array -> income:int -> - residence:Allocations_familiales.collectivite -> + residence:Allocations_familiales.Collectivite.t -> is_parent:bool -> fills_title_I:bool -> had_rights_open_before_2012:bool -> diff --git a/french_law/ocaml/api_web.ml b/french_law/ocaml/api_web.ml index e4cee469..0809f59f 100644 --- a/french_law/ocaml/api_web.ml +++ b/french_law/ocaml/api_web.ml @@ -1,6 +1,7 @@ (* This file is part of the French law library, a collection of functions for computing French taxes and benefits derived from Catala programs. Copyright - (C) 2021 Inria, contributor: Denis Merigoux + (C) 2021 Inria, contributor: Denis Merigoux , Emile + Rolley Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of @@ -14,221 +15,37 @@ License for the specific language governing permissions and limitations under the License. *) -module Allocations_familiales = Law_source.Allocations_familiales -module AF = Allocations_familiales -open Runtime open Js_of_ocaml - -class type enfant_entree = - object - method id : int Js.readonly_prop - method remunerationMensuelle : int Js.readonly_prop - method dateNaissance : Js.date Js.t Js.readonly_prop - method gardeAlternee : bool Js.t Js.readonly_prop - method gardeAlterneePartageAllocation : bool Js.t Js.readonly_prop - - method priseEnCharge : Js.js_string Js.t Js.readonly_prop - (** Expects one of the five: - - - "Effective et permanente" - - "Garde alternée, allocataire unique" - - "Garde alternée, partage des allocations" - - "Confié aux service sociaux, allocation versée à la famille" - - "Confié aux service sociaux, allocation versée aux services sociaux" *) - - method aDejaOuvertDroitAuxAllocationsFamiliales : bool Js.t Js.readonly_prop - - method beneficieTitrePersonnelAidePersonnelleAuLogement : - bool Js.t Js.readonly_prop - end - -class type allocations_familiales_input = - object - method currentDate : Js.date Js.t Js.readonly_prop - method children : enfant_entree Js.t Js.js_array Js.t Js.readonly_prop - method income : int Js.readonly_prop - method residence : Js.js_string Js.t Js.readonly_prop - - method personneQuiAssumeLaChargeEffectivePermanenteEstParent : - bool Js.t Js.readonly_prop - - method - personneQuiAssumeLaChargeEffectivePermanenteRemplitConditionsTitreISecuriteSociale : - bool Js.t Js.readonly_prop - end - -class type source_position = - object - method fileName : Js.js_string Js.t Js.prop - method startLine : int Js.prop - method endLine : int Js.prop - method startColumn : int Js.prop - method endColumn : int Js.prop - method lawHeadings : Js.js_string Js.t Js.js_array Js.t Js.prop - end - -class type raw_event = - object - 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 loggedValueJson : Js.js_string Js.t Js.prop - end - -class type event = - object - method data : Js.js_string Js.t Js.prop - end +open Law_source +open Runtime_jsoo.Runtime +module AF = Allocations_familiales +module AF_web = Allocations_familiales_api_web +module AL = Aides_logement +module AL_web = Aides_logement_api_web let _ = Js.export_all (object%js - method resetLog : (unit -> unit) Js.callback = Js.wrap_callback reset_log - - method retrieveEvents : (unit -> event Js.t Js.js_array Js.t) Js.callback - = - Js.wrap_callback (fun () -> - Js.array - (Array.of_list - (retrieve_log () |> EventParser.parse_raw_events - |> List.map (fun event -> - object%js - val mutable data = - event |> Runtime.yojson_of_event - |> Yojson.Safe.to_string |> Js.string - end)))) - - method retrieveRawEvents - : (unit -> raw_event Js.t Js.js_array Js.t) Js.callback = - Js.wrap_callback (fun () -> - Js.array - (Array.of_list - (List.map - (fun evt -> - object%js - val mutable eventType = - Js.string - (match evt with - | BeginCall _ -> "Begin call" - | EndCall _ -> "End call" - | VariableDefinition _ -> "Variable definition" - | DecisionTaken _ -> "Decision taken") - - val mutable information = - Js.array - (Array.of_list - (match evt with - | BeginCall info - | EndCall info - | VariableDefinition (info, _) -> - List.map Js.string info - | DecisionTaken _ -> [])) - - val mutable loggedValueJson = - (match evt with - | VariableDefinition (_, v) -> v - | EndCall _ | BeginCall _ | DecisionTaken _ -> - Runtime.unembeddable ()) - |> Runtime.yojson_of_runtime_value - |> Yojson.Safe.to_string |> Js.string - - val mutable sourcePosition = - match evt with - | DecisionTaken pos -> - Js.def - (object%js - val mutable fileName = Js.string pos.filename - val mutable startLine = pos.start_line - val mutable endLine = pos.end_line - val mutable startColumn = pos.start_column - val mutable endColumn = pos.end_column - - val mutable lawHeadings = - Js.array - (Array.of_list - (List.map Js.string pos.law_headings)) - end) - | _ -> Js.undefined - end) - (retrieve_log ())))) + val eventsManager = event_manager method computeAllocationsFamiliales - : (allocations_familiales_input Js.t -> float) Js.callback = - Js.wrap_callback (fun input -> - let result = - AF.interface_allocations_familiales - { - AF.InterfaceAllocationsFamilialesIn - .i_personne_charge_effective_permanente_est_parent_in = - Js.to_bool - input##.personneQuiAssumeLaChargeEffectivePermanenteEstParent; - AF.InterfaceAllocationsFamilialesIn - .i_personne_charge_effective_permanente_remplit_titre_I_in = - Js.to_bool - input##.personneQuiAssumeLaChargeEffectivePermanenteRemplitConditionsTitreISecuriteSociale; - AF.InterfaceAllocationsFamilialesIn.i_date_courante_in = - date_of_numbers - input##.currentDate##getUTCFullYear - input##.currentDate##getUTCMonth - input##.currentDate##getUTCDate; - AF.InterfaceAllocationsFamilialesIn.i_enfants_in = - Array.map - (fun (child : enfant_entree Js.t) -> - { - AF.EnfantEntree - .d_a_deja_ouvert_droit_aux_allocations_familiales = - Js.to_bool - child##.aDejaOuvertDroitAuxAllocationsFamiliales; - AF.EnfantEntree.d_identifiant = - integer_of_int child##.id; - AF.EnfantEntree.d_date_de_naissance = - date_of_numbers - child##.dateNaissance##getUTCFullYear - child##.dateNaissance##getUTCMonth - child##.dateNaissance##getUTCDate; - AF.EnfantEntree.d_prise_en_charge = - (match Js.to_string child##.priseEnCharge with - | "Effective et permanente" -> - EffectiveEtPermanente () - | "Garde alternée, allocataire unique" -> - GardeAlterneeAllocataireUnique () - | "Garde alternée, partage des allocations" -> - GardeAlterneePartageAllocations () - | "Confié aux service sociaux, allocation versée \ - à la famille" -> - ServicesSociauxAllocationVerseeALaFamille () - | "Confié aux service sociaux, allocation versée \ - aux services sociaux" -> - ServicesSociauxAllocationVerseeAuxServicesSociaux - () - | _ -> failwith "Unknown prise en charge"); - AF.EnfantEntree.d_remuneration_mensuelle = - money_of_units_int child##.remunerationMensuelle; - AF.EnfantEntree - .d_beneficie_titre_personnel_aide_personnelle_logement = - Js.to_bool - child##.beneficieTitrePersonnelAidePersonnelleAuLogement; - }) - (Js.to_array input##.children); - AF.InterfaceAllocationsFamilialesIn.i_ressources_menage_in = - money_of_units_int input##.income; - AF.InterfaceAllocationsFamilialesIn.i_residence_in = - (match Js.to_string input##.residence with - | "Métropole" -> AF.Metropole () - | "Guyane" -> AF.Guyane () - | "Guadeloupe" -> AF.Guadeloupe () - | "Martinique" -> AF.Martinique () - | "La Réunion" -> AF.LaReunion () - | "Saint Barthélemy" -> AF.SaintBarthelemy () - | "Saint Pierre et Miquelon" -> AF.SaintPierreEtMiquelon () - | "Saint Martin" -> AF.SaintMartin () - | "Mayotte" -> AF.Mayotte () - | _ -> failwith "unknown collectivite!"); - AF.InterfaceAllocationsFamilialesIn - .i_avait_enfant_a_charge_avant_1er_janvier_2012_in = - Js.to_bool input##.avaitEnfantAChargeAvant1erJanvier2012; - } - in - money_to_float - result.AF.InterfaceAllocationsFamilialesOut.i_montant_verse_out) + : (AF_web.interface_allocations_familiales_in -> float) Js.callback = + Js.wrap_callback (fun interface_allocations_familiales_in -> + execute_or_throw_error (fun () -> + let result = + interface_allocations_familiales_in + |> AF_web.interface_allocations_familiales + in + result##.iMontantVerseOut)) + + method computeAidesAuLogement + : (AL_web.calculette_aides_au_logement_garde_alternee_in -> float) + Js.callback = + Js.wrap_callback (fun calculette_aides_au_logement_garde_alternee_in -> + execute_or_throw_error (fun () -> + let result = + calculette_aides_au_logement_garde_alternee_in + |> AL_web.calculette_aides_au_logement_garde_alternee + in + result##.aideFinaleOut)) end) diff --git a/french_law/ocaml/bench.ml b/french_law/ocaml/bench.ml index 223f7a6d..b2734d96 100644 --- a/french_law/ocaml/bench.ml +++ b/french_law/ocaml/bench.ml @@ -15,54 +15,58 @@ the License. *) module AF = Api.Allocations_familiales +module Runtime = Runtime_ocaml open Runtime let random_children (id : int) = - { - AF.EnfantEntree.d_identifiant = integer_of_int id; - d_remuneration_mensuelle = money_of_units_int (Random.int 2000); - d_date_de_naissance = - date_of_numbers - (2020 - Random.int 22) - (1 + Random.int 12) - (1 + Random.int 28); - d_prise_en_charge = - (match Random.int 5 with - | 0 -> AF.EffectiveEtPermanente () - | 1 -> AF.GardeAlterneePartageAllocations () - | 2 -> AF.GardeAlterneeAllocataireUnique () - | 3 -> AF.ServicesSociauxAllocationVerseeALaFamille () - | _ -> AF.ServicesSociauxAllocationVerseeAuxServicesSociaux ()); - d_a_deja_ouvert_droit_aux_allocations_familiales = Random.bool (); - d_beneficie_titre_personnel_aide_personnelle_logement = Random.bool (); - } + Runtime. + { + AF.EnfantEntree.d_identifiant = integer_of_int id; + d_remuneration_mensuelle = money_of_units_int (Random.int 2000); + d_date_de_naissance = + date_of_numbers + (2020 - Random.int 22) + (1 + Random.int 12) + (1 + Random.int 28); + d_prise_en_charge = + AF.PriseEnCharge.( + match Random.int 5 with + | 0 -> EffectiveEtPermanente () + | 1 -> GardeAlterneePartageAllocations () + | 2 -> GardeAlterneeAllocataireUnique () + | 3 -> ServicesSociauxAllocationVerseeALaFamille () + | _ -> ServicesSociauxAllocationVerseeAuxServicesSociaux ()); + d_a_deja_ouvert_droit_aux_allocations_familiales = Random.bool (); + d_beneficie_titre_personnel_aide_personnelle_logement = Random.bool (); + } -let format_residence (fmt : Format.formatter) (r : AF.collectivite) : unit = +let format_residence (fmt : Format.formatter) (r : AF.Collectivite.t) : unit = Format.fprintf fmt "%s" - (match r with - | AF.Metropole _ -> "Métropole" - | AF.Guyane _ -> "Guyane" - | AF.Guadeloupe _ -> "Guadeloupe" - | AF.Martinique _ -> "Martinique" - | AF.LaReunion _ -> "La Réunion" - | AF.SaintBarthelemy _ -> "Saint Barthélemy" - | AF.SaintPierreEtMiquelon _ -> "Saint Pierre et Miquelon" - | AF.SaintMartin _ -> "Saint Martin" - | AF.Mayotte _ -> "Mayotte") + AF.Collectivite.( + match r with + | Metropole _ -> "Métropole" + | Guyane _ -> "Guyane" + | Guadeloupe _ -> "Guadeloupe" + | Martinique _ -> "Martinique" + | LaReunion _ -> "La Réunion" + | SaintBarthelemy _ -> "Saint Barthélemy" + | SaintPierreEtMiquelon _ -> "Saint Pierre et Miquelon" + | SaintMartin _ -> "Saint Martin" + | Mayotte _ -> "Mayotte") -let format_prise_en_charge (fmt : Format.formatter) (g : AF.prise_en_charge) : +let format_prise_en_charge (fmt : Format.formatter) (g : AF.PriseEnCharge.t) : unit = Format.fprintf fmt "%s" - (match g with - | AF.EffectiveEtPermanente _ -> "Effective et permanente" - | AF.GardeAlterneePartageAllocations _ -> - "Garde alternée, allocations partagée" - | AF.GardeAlterneeAllocataireUnique _ -> - "Garde alternée, allocataire unique" - | AF.ServicesSociauxAllocationVerseeALaFamille _ -> - "Oui, allocations versée à la famille" - | AF.ServicesSociauxAllocationVerseeAuxServicesSociaux _ -> - "Oui, allocations versée aux services sociaux") + AF.PriseEnCharge.( + match g with + | EffectiveEtPermanente _ -> "Effective et permanente" + | GardeAlterneePartageAllocations _ -> + "Garde alternée, allocations partagée" + | GardeAlterneeAllocataireUnique _ -> "Garde alternée, allocataire unique" + | ServicesSociauxAllocationVerseeALaFamille _ -> + "Oui, allocations versée à la famille" + | ServicesSociauxAllocationVerseeAuxServicesSociaux _ -> + "Oui, allocations versée aux services sociaux") let num_successful = ref 0 let total_amount = ref 0. @@ -75,9 +79,9 @@ let run_test () = let residence = let x = Random.int 2 in match x with - | 0 -> AF.Metropole () - | 1 -> AF.Guadeloupe () - | _ -> AF.Mayotte () + | 0 -> AF.Collectivite.Metropole () + | 1 -> AF.Collectivite.Guadeloupe () + | _ -> AF.Collectivite.Mayotte () in try let amount = @@ -88,11 +92,11 @@ let run_test () = incr num_successful; total_amount := Float.add !total_amount amount with - | (NoValueProvided _ | ConflictError) as err -> + | (Runtime.NoValueProvided _ | Runtime.ConflictError _) as err -> Format.printf "%s\n%a\nincome: %d\ncurrent_date: %s\nresidence: %a\n" (match err with - | NoValueProvided _ -> "No value provided somewhere!" - | ConflictError -> "Conflict error!" + | Runtime.NoValueProvided _ -> "No value provided somewhere!" + | Runtime.ConflictError _ -> "Conflict error!" | _ -> failwith "impossible") (Format.pp_print_list (fun fmt child -> Format.fprintf fmt @@ -100,15 +104,16 @@ let run_test () = \ income: %.2f\n\ \ birth date: %s\n\ \ prise en charge: %a" - (integer_to_int child.AF.EnfantEntree.d_identifiant) - (money_to_float child.AF.EnfantEntree.d_remuneration_mensuelle) + (Runtime.integer_to_int child.AF.EnfantEntree.d_identifiant) + (Runtime.money_to_float + child.AF.EnfantEntree.d_remuneration_mensuelle) (Runtime.date_to_string child.AF.EnfantEntree.d_date_de_naissance) format_prise_en_charge child.AF.EnfantEntree.d_prise_en_charge)) (Array.to_list children) income (Runtime.date_to_string current_date) format_residence residence; exit (-1) - | AssertionFailed -> () + | Runtime.AssertionFailed _ -> () let bench = Random.init (int_of_float (Unix.time ())); diff --git a/french_law/ocaml/dune b/french_law/ocaml/dune index 9e2fde12..61490134 100644 --- a/french_law/ocaml/dune +++ b/french_law/ocaml/dune @@ -2,20 +2,26 @@ (name bench) (modes native) (modules bench) - (libraries catala.runtime french_law benchmark)) + (libraries catala.runtime_ocaml french_law benchmark)) (executable (name api_web) (modes byte js) - (modules api_web) + (modules + (:standard \ bench api)) (preprocess (pps js_of_ocaml-ppx)) - (libraries catala.runtime law_source js_of_ocaml yojson)) + (libraries + catala.runtime_ocaml + catala.runtime_jsoo + js_of_ocaml + yojson + law_source)) (library (name api) (public_name french_law) (synopsis "A collection of functions for computing French taxes and benefits derived from Catala programs") - (libraries catala.runtime law_source) + (libraries catala.runtime_ocaml law_source) (modules api)) diff --git a/french_law/ocaml/law_source/.ocamlformat-ignore b/french_law/ocaml/law_source/.ocamlformat-ignore new file mode 100644 index 00000000..72e8ffc0 --- /dev/null +++ b/french_law/ocaml/law_source/.ocamlformat-ignore @@ -0,0 +1 @@ +* diff --git a/french_law/ocaml/law_source/aides_logement.ml b/french_law/ocaml/law_source/aides_logement.ml new file mode 100644 index 00000000..4d902508 --- /dev/null +++ b/french_law/ocaml/law_source/aides_logement.ml @@ -0,0 +1,29241 @@ +(** This file has been generated by the Catala compiler, do not edit! *) + +open Runtime_ocaml.Runtime + +[@@@ocaml.warning "-4-26-27-32-41-42"] + +module TypeBailleur = struct + type t = + | BailleurSocial of unit + | BailleurPrive of unit + end +let embed_type_bailleur (x: TypeBailleur.t) : runtime_value = + Enum(["TypeBailleur"], + match x with + | BailleurSocial x -> ("BailleurSocial", embed_unit x) + | BailleurPrive x -> ("BailleurPrivé", embed_unit x)) + + +module TypePret = struct + + type t = + | D331_32 of unit + | D331_63_64 of unit + | D331_59_8 of unit + | D331_76_1 of unit + | Autre of unit + end +let embed_type_pret (x: TypePret.t) : runtime_value = + Enum(["TypePrêt"], + match x with + | D331_32 x -> ("D331_32", embed_unit x) + | D331_63_64 x -> ("D331_63_64", embed_unit x) + | D331_59_8 x -> ("D331_59_8", embed_unit x) + | D331_76_1 x -> ("D331_76_1", embed_unit x) + | Autre x -> ("Autre", embed_unit x)) + + +module TitulairePret = struct + + type t = + | Demandeur of unit + | VendeurQuandDemandeurAContratLocationAccession of unit + end +let embed_titulaire_pret (x: TitulairePret.t) : runtime_value = + Enum(["TitulairePrêt"], + match x with + | Demandeur x -> ("Demandeur", embed_unit x) + | VendeurQuandDemandeurAContratLocationAccession x -> + ("VendeurQuandDemandeurAContratLocationAccession", embed_unit x)) + + +module TypeTravauxLogementD83215 = struct + + type t = + | TravauxPourAcquisitionD832_15_1 of unit + | TravauxSurLogementDejaAcquisD832_15_2 of unit + | PasDeTravaux of unit + end +let embed_type_travaux_logement_d832_15 (x: TypeTravauxLogementD83215.t) + : runtime_value = + Enum(["TypeTravauxLogementD832_15"], + match x with + | TravauxPourAcquisitionD832_15_1 x -> + ("TravauxPourAcquisitionD832_15_1", embed_unit x) + | TravauxSurLogementDejaAcquisD832_15_2 x -> + ("TravauxSurLogementDéjàAcquisD832_15_2", embed_unit x) + | PasDeTravaux x -> ("PasDeTravaux", embed_unit x)) + + +module TypeTravauxLogementR8425 = struct + + type t = + | ObjectifDecenceLogement of unit + | PrevuDansListeR321_15 of unit + | AgrandirOuRendreHabitableD331_63 of unit + | PasDeTravaux of unit + end +let embed_type_travaux_logement_r842_5 (x: TypeTravauxLogementR8425.t) + : runtime_value = + Enum(["TypeTravauxLogementR842_5"], + match x with + | ObjectifDecenceLogement x -> ("ObjectifDécenceLogement", embed_unit x) + | PrevuDansListeR321_15 x -> ("PrévuDansListeR321_15", embed_unit x) + | AgrandirOuRendreHabitableD331_63 x -> + ("AgrandirOuRendreHabitableD331_63", embed_unit x) + | PasDeTravaux x -> ("PasDeTravaux", embed_unit x)) + + +module AmelioreParOccupant = struct + type t = + | Oui of unit + | Non of unit + end +let embed_ameliore_par_occupant (x: AmelioreParOccupant.t) : runtime_value = + Enum(["AmélioréParOccupant"], + match x with + | Oui x -> ("Oui", embed_unit x) + | Non x -> ("Non", embed_unit x)) + + +module LimiteTranche = struct + type t = + | Revenu of money + | Infini of unit + end +let embed_limite_tranche (x: LimiteTranche.t) : runtime_value = + Enum(["LimiteTranche"], + match x with + | Revenu x -> ("Revenu", embed_money x) + | Infini x -> ("Infini", embed_unit x)) + + +module LimiteTrancheDecimal = struct + type t = + | Revenu of decimal + | Infini of unit + end +let embed_limite_tranche_decimal (x: LimiteTrancheDecimal.t) + : runtime_value = + Enum(["LimiteTrancheDécimal"], + match x with + | Revenu x -> ("Revenu", embed_decimal x) + | Infini x -> ("Infini", embed_unit x)) + + +module PrestationRecue = struct + + type t = + | AllocationsFamiliales of unit + | ComplementFamilial of unit + | AllocationJeuneEnfant of unit + | AllocationSoutienFamilial of unit + | AllocationSoutienEnfantHandicape of unit + | AllocationAdulteHandicape of unit + end +let embed_prestation_recue (x: PrestationRecue.t) : runtime_value = + Enum(["PrestationReçue"], + match x with + | AllocationsFamiliales x -> ("AllocationsFamiliales", embed_unit x) + | ComplementFamilial x -> ("ComplémentFamilial", embed_unit x) + | AllocationJeuneEnfant x -> ("AllocationJeuneEnfant", embed_unit x) + | AllocationSoutienFamilial x -> + ("AllocationSoutienFamilial", embed_unit x) + | AllocationSoutienEnfantHandicape x -> + ("AllocationSoutienEnfantHandicapé", embed_unit x) + | AllocationAdulteHandicape x -> + ("AllocationAdulteHandicapé", embed_unit x)) + + +module TypeContratTravail = struct + type t = + | CDI of unit + | Autres of unit + end +let embed_type_contrat_travail (x: TypeContratTravail.t) : runtime_value = + Enum(["TypeContratTravail"], + match x with + | CDI x -> ("CDI", embed_unit x) + | Autres x -> ("Autres", embed_unit x)) + + +module ParentOuAutre = struct + + type t = + | DemandeurOuConjointOuParentOuViaPartsSocietes of decimal + | Autre of unit + end +let embed_parent_ou_autre (x: ParentOuAutre.t) : runtime_value = + Enum(["ParentOuAutre"], + match x with + | DemandeurOuConjointOuParentOuViaPartsSocietes x -> + ("DemandeurOuConjointOuParentOuViaPartsSociétés", embed_decimal x) + | Autre x -> ("Autre", embed_unit x)) + + +module SituationGardeAlternee = struct + + type t = + | PasDeGardeAlternee of unit + | GardeAlterneeCoefficientPriseEnCharge of decimal + end +let embed_situation_garde_alternee (x: SituationGardeAlternee.t) + : runtime_value = + Enum(["SituationGardeAlternée"], + match x with + | PasDeGardeAlternee x -> ("PasDeGardeAlternée", embed_unit x) + | GardeAlterneeCoefficientPriseEnCharge x -> + ("GardeAlternéeCoefficientPriseEnCharge", embed_decimal x)) + + +module Parente = struct + + type t = + | Ascendant of unit + | Descendant of unit + | CollateralDeuxiemeTroisiemeDegre of unit + end +let embed_parente (x: Parente.t) : runtime_value = + Enum(["Parenté"], + match x with + | Ascendant x -> ("Ascendant", embed_unit x) + | Descendant x -> ("Descendant", embed_unit x) + | CollateralDeuxiemeTroisiemeDegre x -> + ("CollatéralDeuxièmeTroisièmeDegré", embed_unit x)) + + +module DateDeNaissanceOuMoisDeGrossesse = struct + + type t = + | DateDeNaissance of date + | AvantPremierJourMoisCivilTroisiemeMoisDeGrossesse of unit + | ApresPremierJourMoisCivilTroisiemeMoisDeGrossesse of unit + end +let embed_date_de_naissance_ou_mois_de_grossesse + (x: DateDeNaissanceOuMoisDeGrossesse.t) : runtime_value = + Enum(["DateDeNaissanceOuMoisDeGrossesse"], + match x with + | DateDeNaissance x -> ("DateDeNaissance", embed_date x) + | AvantPremierJourMoisCivilTroisiemeMoisDeGrossesse x -> + ("AvantPremierJourMoisCivilTroisièmeMoisDeGrossesse", embed_unit x) + | ApresPremierJourMoisCivilTroisiemeMoisDeGrossesse x -> + ("AprèsPremierJourMoisCivilTroisièmeMoisDeGrossesse", embed_unit x)) + + +module Nationalite = struct + type t = + | Francaise of unit + | Etrangere of unit + end +let embed_nationalite (x: Nationalite.t) : runtime_value = + Enum(["Nationalité"], + match x with + | Francaise x -> ("Française", embed_unit x) + | Etrangere x -> ("Étrangère", embed_unit x)) + + +module ZoneDHabitation = struct + type t = + | Zone1 of unit + | Zone2 of unit + | Zone3 of unit + end +let embed_zone_d_habitation (x: ZoneDHabitation.t) : runtime_value = + Enum(["ZoneDHabitation"], + match x with + | Zone1 x -> ("Zone1", embed_unit x) + | Zone2 x -> ("Zone2", embed_unit x) + | Zone3 x -> ("Zone3", embed_unit x)) + + +module CategorieCalculAPL = struct + + type t = + | Location of unit + | AccessionPropriete of unit + | LogementFoyer of unit + end +let embed_categorie_calcul_a_p_l (x: CategorieCalculAPL.t) : runtime_value = + Enum(["CatégorieCalculAPL"], + match x with + | Location x -> ("Location", embed_unit x) + | AccessionPropriete x -> ("AccessionPropriété", embed_unit x) + | LogementFoyer x -> ("LogementFoyer", embed_unit x)) + + +module PaiementLogementDistinctProfessionnel = struct + type t = + | OuiAvecLoyerOuCharges of money + | Non of unit + end +let embed_paiement_logement_distinct_professionnel + (x: PaiementLogementDistinctProfessionnel.t) : runtime_value = + Enum(["PaiementLogementDistinctProfessionnel"], + match x with + | OuiAvecLoyerOuCharges x -> ("OuiAvecLoyerOuCharges", embed_money x) + | Non x -> ("Non", embed_unit x)) + + +module VersementA = struct + + type t = + | Bailleur of unit + | Beneficiaire of unit + | EtablissementHabilite of unit + end +let embed_versement_a (x: VersementA.t) : runtime_value = + Enum(["VersementÀ"], + match x with + | Bailleur x -> ("Bailleur", embed_unit x) + | Beneficiaire x -> ("Bénéficiaire", embed_unit x) + | EtablissementHabilite x -> ("ÉtablissementHabilité", embed_unit x)) + + +module DepenseLogement = struct + + type t = + | TotalAnnuelEcheances of money + | Mensualite of money + | Loyer of money + end +let embed_depense_logement (x: DepenseLogement.t) : runtime_value = + Enum(["DépenseLogement"], + match x with + | TotalAnnuelEcheances x -> ("TotalAnnuelÉchéances", embed_money x) + | Mensualite x -> ("Mensualité", embed_money x) + | Loyer x -> ("Loyer", embed_money x)) + + +module ModeOccupationImpaye = struct + type t = + | ImpayeLoyer of unit + | ImpayePret of unit + end +let embed_mode_occupation_impaye (x: ModeOccupationImpaye.t) + : runtime_value = + Enum(["ModeOccupationImpayé"], + match x with + | ImpayeLoyer x -> ("ImpayéLoyer", embed_unit x) + | ImpayePret x -> ("ImpayéPrêt", embed_unit x)) + + +module EligibiliteAllocationLogement = struct + + type t = + | PasEligible of unit + | AllocationLogementFamiliale of unit + | AllocationLogementSociale of unit + end +let embed_eligibilite_allocation_logement + (x: EligibiliteAllocationLogement.t) : runtime_value = + Enum(["ÉligibilitéAllocationLogement"], + match x with + | PasEligible x -> ("PasÉligible", embed_unit x) + | AllocationLogementFamiliale x -> + ("AllocationLogementFamiliale", embed_unit x) + | AllocationLogementSociale x -> + ("AllocationLogementSociale", embed_unit x)) + + +module TypeAidesPersonnelleLogement = struct + + type t = + | AidePersonnaliseeLogement of unit + | AllocationLogementFamiliale of unit + | AllocationLogementSociale of unit + end +let embed_type_aides_personnelle_logement (x: TypeAidesPersonnelleLogement.t) + : runtime_value = + Enum(["TypeAidesPersonnelleLogement"], + match x with + | AidePersonnaliseeLogement x -> + ("AidePersonnaliséeLogement", embed_unit x) + | AllocationLogementFamiliale x -> + ("AllocationLogementFamiliale", embed_unit x) + | AllocationLogementSociale x -> + ("AllocationLogementSociale", embed_unit x)) + + +module SituationFamiliale = struct + + type t = + | Celibataire of unit + | Maries of date + | Pacses of unit + | Concubins of unit + | CelibataireSepareDeFait of unit + | ConcubinageDontSepareDeFait of unit + end +let embed_situation_familiale (x: SituationFamiliale.t) : runtime_value = + Enum(["SituationFamiliale"], + match x with + | Celibataire x -> ("Célibataire", embed_unit x) + | Maries x -> ("Mariés", embed_date x) + | Pacses x -> ("Pacsés", embed_unit x) + | Concubins x -> ("Concubins", embed_unit x) + | CelibataireSepareDeFait x -> + ("CélibataireSéparéDeFait", embed_unit x) + | ConcubinageDontSepareDeFait x -> + ("ConcubinageDontSéparéDeFait", embed_unit x)) + + +module PriseEnCharge = struct + + type t = + | EffectiveEtPermanente of unit + | ResidenceAlterneeAllocataireUnique of unit + | ResidenceAlterneeAllocationsPartagee of unit + end +let embed_prise_en_charge (x: PriseEnCharge.t) : runtime_value = + Enum(["PriseEnCharge"], + match x with + | EffectiveEtPermanente x -> ("EffectiveEtPermanente", embed_unit x) + | ResidenceAlterneeAllocataireUnique x -> + ("RésidenceAlternéeAllocataireUnique", embed_unit x) + | ResidenceAlterneeAllocationsPartagee x -> + ("RésidenceAlternéeAllocationsPartagée", embed_unit x)) + + +module TypeLogementFoyer = struct + + type t = + | LogementPersonnesAgeesOuHandicapees of unit + | ResidenceSociale of unit + | FoyerJeunesTrvailleursOuMigrantsConventionneL353_2Avant1995 of unit + | Autre of unit + end +let embed_type_logement_foyer (x: TypeLogementFoyer.t) : runtime_value = + Enum(["TypeLogementFoyer"], + match x with + | LogementPersonnesAgeesOuHandicapees x -> + ("LogementPersonnesÂgéesOuHandicapées", embed_unit x) + | ResidenceSociale x -> ("RésidenceSociale", embed_unit x) + | FoyerJeunesTrvailleursOuMigrantsConventionneL353_2Avant1995 x -> + ("FoyerJeunesTrvailleursOuMigrantsConventionnéL353_2Avant1995", embed_unit x) + | Autre x -> ("Autre", embed_unit x)) + + +module CategorieEquivalenceLoyerAllocationLogementFoyer = struct + + type t = + | EtudiantLogeEnChambre of unit + | EtudiantLogeEnChambreRehabilitee of unit + | PersonnesAgeesSelon3DeD842_16 of unit + | AutresPersonnes of unit + end +let embed_categorie_equivalence_loyer_allocation_logement_foyer + (x: CategorieEquivalenceLoyerAllocationLogementFoyer.t) : runtime_value = + Enum(["CatégorieÉquivalenceLoyerAllocationLogementFoyer"], + match x with + | EtudiantLogeEnChambre x -> ("ÉtudiantLogéEnChambre", embed_unit x) + | EtudiantLogeEnChambreRehabilitee x -> + ("ÉtudiantLogéEnChambreRéhabilitée", embed_unit x) + | PersonnesAgeesSelon3DeD842_16 x -> + ("PersonnesÂgéesSelon3DeD842_16", embed_unit x) + | AutresPersonnes x -> ("AutresPersonnes", embed_unit x)) + + +module SituationFamilialeCalculAPL = struct + type t = + | PersonneSeule of unit + | Couple of unit + end +let embed_situation_familiale_calcul_a_p_l (x: SituationFamilialeCalculAPL.t) + : runtime_value = + Enum(["SituationFamilialeCalculAPL"], + match x with + | PersonneSeule x -> ("PersonneSeule", embed_unit x) + | Couple x -> ("Couple", embed_unit x)) + + +module Collectivite = struct + + type t = + | Guadeloupe of unit + | Guyane of unit + | Martinique of unit + | LaReunion of unit + | SaintBarthelemy of unit + | SaintMartin of unit + | Metropole of unit + | SaintPierreEtMiquelon of unit + | Mayotte of unit + end +let embed_collectivite (x: Collectivite.t) : runtime_value = + Enum(["Collectivité"], + match x with + | Guadeloupe x -> ("Guadeloupe", embed_unit x) + | Guyane x -> ("Guyane", embed_unit x) + | Martinique x -> ("Martinique", embed_unit x) + | LaReunion x -> ("LaRéunion", embed_unit x) + | SaintBarthelemy x -> ("SaintBarthélemy", embed_unit x) + | SaintMartin x -> ("SaintMartin", embed_unit x) + | Metropole x -> ("Métropole", embed_unit x) + | SaintPierreEtMiquelon x -> ("SaintPierreEtMiquelon", embed_unit x) + | Mayotte x -> ("Mayotte", embed_unit x)) + + +module PriseEnChargeEnfant = struct + + type t = + | GardeAlterneePartageAllocations of unit + | GardeAlterneeAllocataireUnique of unit + | EffectiveEtPermanente of unit + | ServicesSociauxAllocationVerseeALaFamille of unit + | ServicesSociauxAllocationVerseeAuxServicesSociaux of unit + end +let embed_prise_en_charge_enfant (x: PriseEnChargeEnfant.t) : runtime_value = + Enum(["PriseEnChargeEnfant"], + match x with + | GardeAlterneePartageAllocations x -> + ("GardeAlternéePartageAllocations", embed_unit x) + | GardeAlterneeAllocataireUnique x -> + ("GardeAlternéeAllocataireUnique", embed_unit x) + | EffectiveEtPermanente x -> ("EffectiveEtPermanente", embed_unit x) + | ServicesSociauxAllocationVerseeALaFamille x -> + ("ServicesSociauxAllocationVerséeÀLaFamille", embed_unit x) + | ServicesSociauxAllocationVerseeAuxServicesSociaux x -> + ("ServicesSociauxAllocationVerséeAuxServicesSociaux", embed_unit x)) + + +module SituationObligationScolaire = struct + type t = + | Avant of unit + | Pendant of unit + | Apres of unit + end +let embed_situation_obligation_scolaire (x: SituationObligationScolaire.t) + : runtime_value = + Enum(["SituationObligationScolaire"], + match x with + | Avant x -> ("Avant", embed_unit x) + | Pendant x -> ("Pendant", embed_unit x) + | Apres x -> ("Après", embed_unit x)) + + +module ElementPrestationsFamiliales = struct + + type t = + | PrestationAccueilJeuneEnfant of unit + | AllocationsFamiliales of unit + | ComplementFamilial of unit + | AllocationLogement of unit + | AllocationEducationEnfantHandicape of unit + | AllocationSoutienFamilial of unit + | AllocationRentreeScolaire of unit + | AllocationJournalierePresenceParentale of unit + end +let embed_element_prestations_familiales (x: ElementPrestationsFamiliales.t) + : runtime_value = + Enum(["ÉlémentPrestationsFamiliales"], + match x with + | PrestationAccueilJeuneEnfant x -> + ("PrestationAccueilJeuneEnfant", embed_unit x) + | AllocationsFamiliales x -> ("AllocationsFamiliales", embed_unit x) + | ComplementFamilial x -> ("ComplémentFamilial", embed_unit x) + | AllocationLogement x -> ("AllocationLogement", embed_unit x) + | AllocationEducationEnfantHandicape x -> + ("AllocationÉducationEnfantHandicapé", embed_unit x) + | AllocationSoutienFamilial x -> + ("AllocationSoutienFamilial", embed_unit x) + | AllocationRentreeScolaire x -> + ("AllocationRentréeScolaire", embed_unit x) + | AllocationJournalierePresenceParentale x -> + ("AllocationJournalièrePresenceParentale", embed_unit x)) + + +module PersonneSousLocation = struct + type t = { + age_personne_sous_location: integer; + conforme_article_l442_1: bool + } +end +let embed_personne_sous_location (x: PersonneSousLocation.t) : runtime_value = + Struct(["PersonneSousLocation"], + [("age_personne_sous_location", embed_integer + x.PersonneSousLocation.age_personne_sous_location); + ("conforme_article_l442_1", embed_bool + x.PersonneSousLocation.conforme_article_l442_1)]) + + +module Patrimoine = struct + type t = { + produisant_revenu_periode_r822_3_3_r822_4: money; + ne_produisant_pas_revenu_periode_r822_3_3_r822_4: money + } +end +let embed_patrimoine (x: Patrimoine.t) : runtime_value = + Struct(["Patrimoine"], + [("produisant_revenu_période_r822_3_3_r822_4", embed_money + x.Patrimoine.produisant_revenu_periode_r822_3_3_r822_4); + ("ne_produisant_pas_revenu_période_r822_3_3_r822_4", embed_money + x.Patrimoine.ne_produisant_pas_revenu_periode_r822_3_3_r822_4)]) + + +module PersonneVivantHabituellementAuFoyer = struct + type t = { + duree_residence_durant_periode_r_822_3_1_superieure_a_6_mois: bool; + ressources: money + } +end +let embed_personne_vivant_habituellement_au_foyer (x: PersonneVivantHabituellementAuFoyer.t) : runtime_value = + Struct(["PersonneVivantHabituellementAuFoyer"], + [("durée_résidence_durant_période_r_822_3_1_supérieure_à_6_mois", + embed_bool + x.PersonneVivantHabituellementAuFoyer.duree_residence_durant_periode_r_822_3_1_superieure_a_6_mois); + ("ressources", embed_money + x.PersonneVivantHabituellementAuFoyer.ressources)]) + + +module InfosChangementLogementD8424 = struct + type t = { + ancien_loyer_principal: money; + ancienne_allocation_logement: money + } +end +let embed_infos_changement_logement_d842_4 (x: InfosChangementLogementD8424.t) : runtime_value = + Struct(["InfosChangementLogementD842_4"], + [("ancien_loyer_principal", embed_money + x.InfosChangementLogementD8424.ancien_loyer_principal); + ("ancienne_allocation_logement", embed_money + x.InfosChangementLogementD8424.ancienne_allocation_logement)]) + + +module Bailleur = struct + type t = { + type_bailleur: TypeBailleur.t; + respecte_convention_titre_V: bool; + respecte_convention_titre_II: bool; + construit_ameliore_conditions_l831_1_4: bool; + acquisition_aides_etat_pret_titre_II_ou_livre_III: bool + } +end +let embed_bailleur (x: Bailleur.t) : runtime_value = Struct(["Bailleur"], + [("type_bailleur", embed_type_bailleur + x.Bailleur.type_bailleur); + ("respecte_convention_titre_V", embed_bool + x.Bailleur.respecte_convention_titre_V); + ("respecte_convention_titre_II", embed_bool + x.Bailleur.respecte_convention_titre_II); + ("construit_amélioré_conditions_l831_1_4", embed_bool + x.Bailleur.construit_ameliore_conditions_l831_1_4); + ("acquisition_aides_état_prêt_titre_II_ou_livre_III", embed_bool + x.Bailleur.acquisition_aides_etat_pret_titre_II_ou_livre_III)]) + + +module Pret = struct + type t = { + type_pret: TypePret.t; + date_signature: date; + titulaire_pret: TitulairePret.t + } +end +let embed_pret (x: Pret.t) : runtime_value = Struct(["Prêt"], + [("type_prêt", embed_type_pret x.Pret.type_pret); + ("date_signature", embed_date x.Pret.date_signature); + ("titulaire_prêt", embed_titulaire_pret x.Pret.titulaire_pret)]) + + +module NeufOuAncien = struct + type t = + | Neuf of unit + | Ancien of AmelioreParOccupant.t + end +let embed_neuf_ou_ancien (x: NeufOuAncien.t) : runtime_value = + Enum(["NeufOuAncien"], + match x with + | Neuf x -> ("Neuf", embed_unit x) + | Ancien x -> ("Ancien", embed_ameliore_par_occupant x)) + + +module TrancheRevenu = struct + type t = {haut: LimiteTranche.t; bas: money; taux: decimal} +end +let embed_tranche_revenu (x: TrancheRevenu.t) : runtime_value = + Struct(["TrancheRevenu"], + [("haut", embed_limite_tranche x.TrancheRevenu.haut); + ("bas", embed_money x.TrancheRevenu.bas); + ("taux", embed_decimal x.TrancheRevenu.taux)]) + + +module TrancheRevenuDecimal = struct + type t = {haut: LimiteTrancheDecimal.t; bas: decimal; taux: decimal} +end +let embed_tranche_revenu_decimal (x: TrancheRevenuDecimal.t) : runtime_value = + Struct(["TrancheRevenuDécimal"], + [("haut", embed_limite_tranche_decimal x.TrancheRevenuDecimal.haut); + ("bas", embed_decimal x.TrancheRevenuDecimal.bas); + ("taux", embed_decimal x.TrancheRevenuDecimal.taux)]) + + +module AutrePersonneACharge = struct + type t = { + date_naissance: date; + ressources: money; + ascendant_descendant_collateral_deuxieme_troisieme_degre: bool; + parente: Parente.t; + incapacite_80_pourcent_ou_restriction_emploi: bool; + beneficiaire_l161_19_l351_8_l643_3_secu: bool; + titulaire_allocation_personne_agee: bool + } +end +let embed_autre_personne_a_charge (x: AutrePersonneACharge.t) : runtime_value = + Struct(["AutrePersonneÀCharge"], + [("date_naissance", embed_date + x.AutrePersonneACharge.date_naissance); + ("ressources", embed_money + x.AutrePersonneACharge.ressources); + ("ascendant_descendant_collatéral_deuxième_troisième_degré", + embed_bool + x.AutrePersonneACharge.ascendant_descendant_collateral_deuxieme_troisieme_degre); + ("parenté", embed_parente + x.AutrePersonneACharge.parente); + ("incapacité_80_pourcent_ou_restriction_emploi", embed_bool + x.AutrePersonneACharge.incapacite_80_pourcent_ou_restriction_emploi); + ("bénéficiaire_l161_19_l351_8_l643_3_sécu", embed_bool + x.AutrePersonneACharge.beneficiaire_l161_19_l351_8_l643_3_secu); + ("titulaire_allocation_personne_âgée", embed_bool + x.AutrePersonneACharge.titulaire_allocation_personne_agee)]) + + +module DateNaissanceTroisiemeOuDernierPlusEnfant = struct + + type t = + | MoinsDeTroisEnfants of unit + | PlusDeTroisEnfants of DateDeNaissanceOuMoisDeGrossesse.t + end +let embed_date_naissance_troisieme_ou_dernier_plus_enfant + (x: DateNaissanceTroisiemeOuDernierPlusEnfant.t) : runtime_value = + Enum(["DateNaissanceTroisièmeOuDernierPlusEnfant"], + match x with + | MoinsDeTroisEnfants x -> ("MoinsDeTroisEnfants", embed_unit x) + | PlusDeTroisEnfants x -> + ("PlusDeTroisEnfants", embed_date_de_naissance_ou_mois_de_grossesse x)) + + +module InformationsCalculAPLLogementFoyer = struct + type t = { + redevance: money; + categorie_equivalence_loyer_d842_16: + CategorieEquivalenceLoyerAllocationLogementFoyer.t + } +end +let embed_informations_calcul_a_p_l_logement_foyer (x: InformationsCalculAPLLogementFoyer.t) : runtime_value = + Struct(["InformationsCalculAPLLogementFoyer"], + [("redevance", embed_money + x.InformationsCalculAPLLogementFoyer.redevance); + ("catégorie_équivalence_loyer_d842_16", + embed_categorie_equivalence_loyer_allocation_logement_foyer + x.InformationsCalculAPLLogementFoyer.categorie_equivalence_loyer_d842_16)]) + + +module EnfantPrestationsFamiliales = struct + type t = { + identifiant: integer; + obligation_scolaire: SituationObligationScolaire.t; + remuneration_mensuelle: money; + date_de_naissance: date; + age: integer; + prise_en_charge: PriseEnChargeEnfant.t; + a_deja_ouvert_droit_aux_allocations_familiales: bool; + beneficie_titre_personnel_aide_personnelle_logement: bool + } +end +let embed_enfant_prestations_familiales (x: EnfantPrestationsFamiliales.t) : runtime_value = + Struct(["EnfantPrestationsFamiliales"], + [("identifiant", embed_integer + x.EnfantPrestationsFamiliales.identifiant); + ("obligation_scolaire", embed_situation_obligation_scolaire + x.EnfantPrestationsFamiliales.obligation_scolaire); + ("rémuneration_mensuelle", embed_money + x.EnfantPrestationsFamiliales.remuneration_mensuelle); + ("date_de_naissance", embed_date + x.EnfantPrestationsFamiliales.date_de_naissance); + ("âge", embed_integer + x.EnfantPrestationsFamiliales.age); + ("prise_en_charge", embed_prise_en_charge_enfant + x.EnfantPrestationsFamiliales.prise_en_charge); + ("a_déjà_ouvert_droit_aux_allocations_familiales", embed_bool + x.EnfantPrestationsFamiliales.a_deja_ouvert_droit_aux_allocations_familiales); + ("bénéficie_titre_personnel_aide_personnelle_logement", embed_bool + x.EnfantPrestationsFamiliales.beneficie_titre_personnel_aide_personnelle_logement)]) + + +module EnfantACharge = struct + type t = { + identifiant: integer; + beneficie_titre_personnel_aide_personnelle_logement: bool; + a_deja_ouvert_droit_aux_allocations_familiales: bool; + date_de_naissance: date; + remuneration_mensuelle: money; + obligation_scolaire: SituationObligationScolaire.t; + prise_en_charge: PriseEnCharge.t; + age: integer; + situation_garde_alternee: SituationGardeAlternee.t + } +end +let embed_enfant_a_charge (x: EnfantACharge.t) : runtime_value = + Struct(["EnfantÀCharge"], + [("identifiant", embed_integer + x.EnfantACharge.identifiant); + ("bénéficie_titre_personnel_aide_personnelle_logement", embed_bool + x.EnfantACharge.beneficie_titre_personnel_aide_personnelle_logement); + ("a_déjà_ouvert_droit_aux_allocations_familiales", embed_bool + x.EnfantACharge.a_deja_ouvert_droit_aux_allocations_familiales); + ("date_de_naissance", embed_date + x.EnfantACharge.date_de_naissance); + ("rémuneration_mensuelle", embed_money + x.EnfantACharge.remuneration_mensuelle); + ("obligation_scolaire", embed_situation_obligation_scolaire + x.EnfantACharge.obligation_scolaire); + ("prise_en_charge", embed_prise_en_charge + x.EnfantACharge.prise_en_charge); + ("âge", embed_integer x.EnfantACharge.age); + ("situation_garde_alternée", embed_situation_garde_alternee + x.EnfantACharge.situation_garde_alternee)]) + + +module LoueOuSousLoueADesTiers = struct + type t = + | Non of unit + | Oui of PersonneSousLocation.t + end +let embed_loue_ou_sous_loue_a_des_tiers (x: LoueOuSousLoueADesTiers.t) + : runtime_value = + Enum(["LouéOuSousLouéÀDesTiers"], + match x with + | Non x -> ("Non", embed_unit x) + | Oui x -> ("Oui", embed_personne_sous_location x)) + + +module Demandeur = struct + type t = { + satisfait_conditions_l512_2_code_securite_sociale: bool; + age_demandeur: integer; + date_naissance: date; + contrat_de_travail: TypeContratTravail.t; + nationalite: Nationalite.t; + patrimoine: Patrimoine.t; + personne_hebergee_centre_soin_l_L162_22_3_securite_sociale: bool + } +end +let embed_demandeur (x: Demandeur.t) : runtime_value = Struct(["Demandeur"], + [("satisfait_conditions_l512_2_code_sécurité_sociale", embed_bool + x.Demandeur.satisfait_conditions_l512_2_code_securite_sociale); + ("age_demandeur", embed_integer + x.Demandeur.age_demandeur); + ("date_naissance", embed_date + x.Demandeur.date_naissance); + ("contrat_de_travail", embed_type_contrat_travail + x.Demandeur.contrat_de_travail); + ("nationalité", embed_nationalite + x.Demandeur.nationalite); + ("patrimoine", embed_patrimoine + x.Demandeur.patrimoine); + ("personne_hébergée_centre_soin_l_L162_22_3_sécurité_sociale", + embed_bool + x.Demandeur.personne_hebergee_centre_soin_l_L162_22_3_securite_sociale)]) + + +module ChangementLogementD8424 = struct + + type t = + | Changement of InfosChangementLogementD8424.t + | PasDeChangement of unit + end +let embed_changement_logement_d842_4 (x: ChangementLogementD8424.t) + : runtime_value = + Enum(["ChangementLogementD842_4"], + match x with + | Changement x -> + ("Changement", embed_infos_changement_logement_d842_4 x) + | PasDeChangement x -> ("PasDeChangement", embed_unit x)) + + +module Location = struct + type t = {bailleur: Bailleur.t} +end +let embed_location (x: Location.t) : runtime_value = Struct(["Location"], + [("bailleur", embed_bailleur x.Location.bailleur)]) + + +module Proprietaire = struct + type t = {pret: Pret.t} +end +let embed_proprietaire (x: Proprietaire.t) : runtime_value = + Struct(["Propriétaire"], [("prêt", embed_pret x.Proprietaire.pret)]) + + +module InformationsCalculAPLAccessionPropriete = struct + type t = { + mensualite_principale: money; + charges_mensuelles_pret: money; + date_signature_pret: date; + date_entree_logement: date; + type_travaux_logement_d832_15: TypeTravauxLogementD83215.t; + type_travaux_logement_r842_5: TypeTravauxLogementR8425.t; + local_habite_premiere_fois_beneficiaire: bool; + copropriete: bool; + situation_r822_11_13_17: bool; + type_pret: TypePret.t; + anciennete_logement: NeufOuAncien.t + } +end +let embed_informations_calcul_a_p_l_accession_propriete (x: InformationsCalculAPLAccessionPropriete.t) : runtime_value = + Struct(["InformationsCalculAPLAccessionPropriété"], + [("mensualité_principale", embed_money + x.InformationsCalculAPLAccessionPropriete.mensualite_principale); + ("charges_mensuelles_prêt", embed_money + x.InformationsCalculAPLAccessionPropriete.charges_mensuelles_pret); + ("date_signature_prêt", embed_date + x.InformationsCalculAPLAccessionPropriete.date_signature_pret); + ("date_entrée_logement", embed_date + x.InformationsCalculAPLAccessionPropriete.date_entree_logement); + ("type_travaux_logement_d832_15", embed_type_travaux_logement_d832_15 + x.InformationsCalculAPLAccessionPropriete.type_travaux_logement_d832_15); + ("type_travaux_logement_r842_5", embed_type_travaux_logement_r842_5 + x.InformationsCalculAPLAccessionPropriete.type_travaux_logement_r842_5); + ("local_habité_première_fois_bénéficiaire", embed_bool + x.InformationsCalculAPLAccessionPropriete.local_habite_premiere_fois_beneficiaire); + ("copropriété", embed_bool + x.InformationsCalculAPLAccessionPropriete.copropriete); + ("situation_r822_11_13_17", embed_bool + x.InformationsCalculAPLAccessionPropriete.situation_r822_11_13_17); + ("type_prêt", embed_type_pret + x.InformationsCalculAPLAccessionPropriete.type_pret); + ("ancienneté_logement", embed_neuf_ou_ancien + x.InformationsCalculAPLAccessionPropriete.anciennete_logement)]) + + +module PersonneACharge = struct + + type t = + | EnfantACharge of EnfantACharge.t + | AutrePersonneACharge of AutrePersonneACharge.t + end +let embed_personne_a_charge (x: PersonneACharge.t) : runtime_value = + Enum(["PersonneÀCharge"], + match x with + | EnfantACharge x -> ("EnfantÀCharge", embed_enfant_a_charge x) + | AutrePersonneACharge x -> + ("AutrePersonneÀCharge", embed_autre_personne_a_charge x)) + + +module InformationsCalculAPLLocatif = struct + type t = { + loyer_principal: money; + beneficiaire_aide_adulte_ou_enfant_handicapes: bool; + logement_est_chambre: bool; + colocation: bool; + agees_ou_handicap_adultes_hebergees_onereux_particuliers: bool; + reduction_loyer_solidarite: money; + logement_meuble_d842_2: bool; + changement_logement_d842_4: ChangementLogementD8424.t + } +end +let embed_informations_calcul_a_p_l_locatif (x: InformationsCalculAPLLocatif.t) : runtime_value = + Struct(["InformationsCalculAPLLocatif"], + [("loyer_principal", embed_money + x.InformationsCalculAPLLocatif.loyer_principal); + ("bénéficiaire_aide_adulte_ou_enfant_handicapés", embed_bool + x.InformationsCalculAPLLocatif.beneficiaire_aide_adulte_ou_enfant_handicapes); + ("logement_est_chambre", embed_bool + x.InformationsCalculAPLLocatif.logement_est_chambre); + ("colocation", embed_bool + x.InformationsCalculAPLLocatif.colocation); + ("âgées_ou_handicap_adultes_hébergées_onéreux_particuliers", + embed_bool + x.InformationsCalculAPLLocatif.agees_ou_handicap_adultes_hebergees_onereux_particuliers); + ("réduction_loyer_solidarité", embed_money + x.InformationsCalculAPLLocatif.reduction_loyer_solidarite); + ("logement_meublé_d842_2", embed_bool + x.InformationsCalculAPLLocatif.logement_meuble_d842_2); + ("changement_logement_d842_4", embed_changement_logement_d842_4 + x.InformationsCalculAPLLocatif.changement_logement_d842_4)]) + + +module LogementFoyer = struct + type t = { + type_user: TypeLogementFoyer.t; + date_conventionnement: date; + location: Location.t; + remplit_conditions_r832_21: bool; + construit_application_loi_1957_12_III: bool + } +end +let embed_logement_foyer (x: LogementFoyer.t) : runtime_value = + Struct(["LogementFoyer"], + [("type", embed_type_logement_foyer + x.LogementFoyer.type_user); + ("date_conventionnement", embed_date + x.LogementFoyer.date_conventionnement); + ("location", embed_location + x.LogementFoyer.location); + ("remplit_conditions_r832_21", embed_bool + x.LogementFoyer.remplit_conditions_r832_21); + ("construit_application_loi_1957_12_III", embed_bool + x.LogementFoyer.construit_application_loi_1957_12_III)]) + + +module InformationsCalculAPL = struct + + type t = + | InfosLocatif of InformationsCalculAPLLocatif.t + | InfosLogementFoyer of InformationsCalculAPLLogementFoyer.t + | InfosAccessionPropriete of InformationsCalculAPLAccessionPropriete.t + end +let embed_informations_calcul_a_p_l (x: InformationsCalculAPL.t) + : runtime_value = + Enum(["InformationsCalculAPL"], + match x with + | InfosLocatif x -> + ("InfosLocatif", embed_informations_calcul_a_p_l_locatif x) + | InfosLogementFoyer x -> + ("InfosLogementFoyer", embed_informations_calcul_a_p_l_logement_foyer x) + | InfosAccessionPropriete x -> + ("InfosAccessionPropriété", embed_informations_calcul_a_p_l_accession_propriete x)) + + +module ModeOccupation = struct + + type t = + | Locataire of Location.t + | ResidentLogementFoyer of LogementFoyer.t + | AccessionProprieteLocalUsageExclusifHabitation of Proprietaire.t + | SousLocataire of Location.t + | LocationAccession of Proprietaire.t + end +let embed_mode_occupation (x: ModeOccupation.t) : runtime_value = + Enum(["ModeOccupation"], + match x with + | Locataire x -> ("Locataire", embed_location x) + | ResidentLogementFoyer x -> + ("RésidentLogementFoyer", embed_logement_foyer x) + | AccessionProprieteLocalUsageExclusifHabitation x -> + ("AccessionPropriétéLocalUsageExclusifHabitation", embed_proprietaire x) + | SousLocataire x -> ("SousLocataire", embed_location x) + | LocationAccession x -> ("LocationAccession", embed_proprietaire x)) + + +module Logement = struct + type t = { + residence_principale: bool; + est_ehpad_ou_maison_autonomie_l313_12_asf: bool; + mode_occupation: ModeOccupation.t; + proprietaire: ParentOuAutre.t; + loue_ou_sous_loue_a_des_tiers: LoueOuSousLoueADesTiers.t; + usufruit: ParentOuAutre.t; + logement_decent_l89_462: bool; + surface_m_carres: integer; + est_ancien_l831_2: bool; + situe_commune_desequilibre_l831_2: bool; + zone: ZoneDHabitation.t + } +end +let embed_logement (x: Logement.t) : runtime_value = Struct(["Logement"], + [("résidence_principale", embed_bool + x.Logement.residence_principale); + ("est_ehpad_ou_maison_autonomie_l313_12_asf", embed_bool + x.Logement.est_ehpad_ou_maison_autonomie_l313_12_asf); + ("mode_occupation", embed_mode_occupation + x.Logement.mode_occupation); + ("propriétaire", embed_parent_ou_autre + x.Logement.proprietaire); + ("loué_ou_sous_loué_à_des_tiers", embed_loue_ou_sous_loue_a_des_tiers + x.Logement.loue_ou_sous_loue_a_des_tiers); + ("usufruit", embed_parent_ou_autre + x.Logement.usufruit); + ("logement_decent_l89_462", embed_bool + x.Logement.logement_decent_l89_462); + ("surface_m_carrés", embed_integer + x.Logement.surface_m_carres); + ("est_ancien_l831_2", embed_bool + x.Logement.est_ancien_l831_2); + ("situé_commune_déséquilibre_l831_2", embed_bool + x.Logement.situe_commune_desequilibre_l831_2); + ("zone", embed_zone_d_habitation x.Logement.zone)]) + + +module Menage = struct + type t = { + prestations_recues: PrestationRecue.t array; + logement: Logement.t; + personnes_a_charge: PersonneACharge.t array; + nombre_autres_occupants_logement: integer; + situation_familiale: SituationFamiliale.t; + condition_rattache_foyer_fiscal_parent_ifi: bool; + nombre_enfants_a_naitre_apres_troisieme_mois_grossesse: integer; + enfant_a_naitre_apres_quatrieme_mois_grossesse: bool; + date_naissance_troisieme_enfant_ou_dernier_si_plus: + DateNaissanceTroisiemeOuDernierPlusEnfant.t + } +end +let embed_menage (x: Menage.t) : runtime_value = Struct(["Ménage"], + [("prestations_reçues", embed_array (embed_prestation_recue) + x.Menage.prestations_recues); + ("logement", embed_logement x.Menage.logement); + ("personnes_à_charge", embed_array (embed_personne_a_charge) + x.Menage.personnes_a_charge); + ("nombre_autres_occupants_logement", embed_integer + x.Menage.nombre_autres_occupants_logement); + ("situation_familiale", embed_situation_familiale + x.Menage.situation_familiale); + ("condition_rattaché_foyer_fiscal_parent_ifi", embed_bool + x.Menage.condition_rattache_foyer_fiscal_parent_ifi); + ("nombre_enfants_à_naître_après_troisième_mois_grossesse", + embed_integer + x.Menage.nombre_enfants_a_naitre_apres_troisieme_mois_grossesse); + ("enfant_à_naître_après_quatrième_mois_grossesse", embed_bool + x.Menage.enfant_a_naitre_apres_quatrieme_mois_grossesse); + ("date_naissance_troisième_enfant_ou_dernier_si_plus", + embed_date_naissance_troisieme_ou_dernier_plus_enfant + x.Menage.date_naissance_troisieme_enfant_ou_dernier_si_plus)]) + + +module EligibiliteAidesPersonnelleLogementOut = struct + type t = { + date_courante_out: date; + eligibilite_out: bool; + nombre_personnes_a_charge_prises_en_compte_out: integer; + coefficents_enfants_garde_alternee_pris_en_compte_out: decimal array; + condition_2_r823_4_out: PersonneACharge.t -> bool + } +end +let embed_eligibilite_aides_personnelle_logement_out (x: EligibiliteAidesPersonnelleLogementOut.t) : runtime_value = + Struct(["ÉligibilitéAidesPersonnelleLogement_out"], + [("date_courante_out", embed_date + x.EligibiliteAidesPersonnelleLogementOut.date_courante_out); + ("éligibilité_out", embed_bool + x.EligibiliteAidesPersonnelleLogementOut.eligibilite_out); + ("nombre_personnes_à_charge_prises_en_compte_out", embed_integer + x.EligibiliteAidesPersonnelleLogementOut.nombre_personnes_a_charge_prises_en_compte_out); + ("coefficents_enfants_garde_alternée_pris_en_compte_out", + embed_array (embed_decimal) + x.EligibiliteAidesPersonnelleLogementOut.coefficents_enfants_garde_alternee_pris_en_compte_out); + ("condition_2_r823_4_out", unembeddable + x.EligibiliteAidesPersonnelleLogementOut.condition_2_r823_4_out)]) + + +module EligibiliteAidesPersonnelleLogementIn = struct + type t = { + menage_in: Menage.t; + demandeur_in: Demandeur.t; + date_courante_in: date; + condition_logement_residence_principale_in: unit -> bool; + condition_logement_surface_in: unit -> bool + } +end +let embed_eligibilite_aides_personnelle_logement_in (x: EligibiliteAidesPersonnelleLogementIn.t) : runtime_value = + Struct(["ÉligibilitéAidesPersonnelleLogement_in"], + [("ménage_in", embed_menage + x.EligibiliteAidesPersonnelleLogementIn.menage_in); + ("demandeur_in", embed_demandeur + x.EligibiliteAidesPersonnelleLogementIn.demandeur_in); + ("date_courante_in", embed_date + x.EligibiliteAidesPersonnelleLogementIn.date_courante_in); + ("condition_logement_résidence_principale_in", unembeddable + x.EligibiliteAidesPersonnelleLogementIn.condition_logement_residence_principale_in); + ("condition_logement_surface_in", unembeddable + x.EligibiliteAidesPersonnelleLogementIn.condition_logement_surface_in)]) + + +module EligibiliteAidePersonnaliseeLogementOut = struct + type t = { + date_courante_out: date; + eligibilite_out: bool; + nombre_personnes_a_charge_prises_en_compte_out: integer; + coefficents_enfants_garde_alternee_pris_en_compte_out: decimal array + } +end +let embed_eligibilite_aide_personnalisee_logement_out (x: EligibiliteAidePersonnaliseeLogementOut.t) : runtime_value = + Struct(["ÉligibilitéAidePersonnaliséeLogement_out"], + [("date_courante_out", embed_date + x.EligibiliteAidePersonnaliseeLogementOut.date_courante_out); + ("éligibilité_out", embed_bool + x.EligibiliteAidePersonnaliseeLogementOut.eligibilite_out); + ("nombre_personnes_à_charge_prises_en_compte_out", embed_integer + x.EligibiliteAidePersonnaliseeLogementOut.nombre_personnes_a_charge_prises_en_compte_out); + ("coefficents_enfants_garde_alternée_pris_en_compte_out", + embed_array (embed_decimal) + x.EligibiliteAidePersonnaliseeLogementOut.coefficents_enfants_garde_alternee_pris_en_compte_out)]) + + +module EligibiliteAidePersonnaliseeLogementIn = struct + type t = { + menage_in: Menage.t; + demandeur_in: Demandeur.t; + date_courante_in: date + } +end +let embed_eligibilite_aide_personnalisee_logement_in (x: EligibiliteAidePersonnaliseeLogementIn.t) : runtime_value = + Struct(["ÉligibilitéAidePersonnaliséeLogement_in"], + [("ménage_in", embed_menage + x.EligibiliteAidePersonnaliseeLogementIn.menage_in); + ("demandeur_in", embed_demandeur + x.EligibiliteAidePersonnaliseeLogementIn.demandeur_in); + ("date_courante_in", embed_date + x.EligibiliteAidePersonnaliseeLogementIn.date_courante_in)]) + + +module EligibiliteAllocationLogementOut = struct + type t = { + eligibilite_avec_condition_logement_out: EligibiliteAllocationLogement.t; + nombre_personnes_a_charge_prises_en_compte_out: integer; + coefficents_enfants_garde_alternee_pris_en_compte_out: decimal array + } +end +let embed_eligibilite_allocation_logement_out (x: EligibiliteAllocationLogementOut.t) : runtime_value = + Struct(["ÉligibilitéAllocationLogement_out"], + [("éligibilité_avec_condition_logement_out", + embed_eligibilite_allocation_logement + x.EligibiliteAllocationLogementOut.eligibilite_avec_condition_logement_out); + ("nombre_personnes_à_charge_prises_en_compte_out", embed_integer + x.EligibiliteAllocationLogementOut.nombre_personnes_a_charge_prises_en_compte_out); + ("coefficents_enfants_garde_alternée_pris_en_compte_out", + embed_array (embed_decimal) + x.EligibiliteAllocationLogementOut.coefficents_enfants_garde_alternee_pris_en_compte_out)]) + + +module EligibiliteAllocationLogementIn = struct + type t = { + date_courante_in: date; + menage_in: Menage.t; + demandeur_in: Demandeur.t; + beneficie_aide_personnalisee_logement_in: bool; + informations_calcul_in: InformationsCalculAPL.t + } +end +let embed_eligibilite_allocation_logement_in (x: EligibiliteAllocationLogementIn.t) : runtime_value = + Struct(["ÉligibilitéAllocationLogement_in"], + [("date_courante_in", embed_date + x.EligibiliteAllocationLogementIn.date_courante_in); + ("ménage_in", embed_menage + x.EligibiliteAllocationLogementIn.menage_in); + ("demandeur_in", embed_demandeur + x.EligibiliteAllocationLogementIn.demandeur_in); + ("bénéficie_aide_personnalisée_logement_in", embed_bool + x.EligibiliteAllocationLogementIn.beneficie_aide_personnalisee_logement_in); + ("informations_calcul_in", embed_informations_calcul_a_p_l + x.EligibiliteAllocationLogementIn.informations_calcul_in)]) + + +module EligibilitePrimeDeDemenagementOut = struct + type t = {montant_prime_demenagement_out: money} +end +let embed_eligibilite_prime_de_demenagement_out (x: EligibilitePrimeDeDemenagementOut.t) : runtime_value = + Struct(["ÉligibilitéPrimeDeDéménagement_out"], + [("montant_prime_déménagement_out", embed_money + x.EligibilitePrimeDeDemenagementOut.montant_prime_demenagement_out)]) + + +module EligibilitePrimeDeDemenagementIn = struct + type t = { + date_emmenagement_in: date; + menage_in: Menage.t; + demandeur_in: Demandeur.t; + date_courante_in: date; + depenses_justifiees_reellement_engagees_in: money + } +end +let embed_eligibilite_prime_de_demenagement_in (x: EligibilitePrimeDeDemenagementIn.t) : runtime_value = + Struct(["ÉligibilitéPrimeDeDéménagement_in"], + [("date_emménagement_in", embed_date + x.EligibilitePrimeDeDemenagementIn.date_emmenagement_in); + ("ménage_in", embed_menage + x.EligibilitePrimeDeDemenagementIn.menage_in); + ("demandeur_in", embed_demandeur + x.EligibilitePrimeDeDemenagementIn.demandeur_in); + ("date_courante_in", embed_date + x.EligibilitePrimeDeDemenagementIn.date_courante_in); + ("dépenses_justifiées_réellement_engagées_in", embed_money + x.EligibilitePrimeDeDemenagementIn.depenses_justifiees_reellement_engagees_in)]) + + +module RessourcesAidesPersonnelleLogementOut = struct + type t = {ressources_prises_en_compte_out: money} +end +let embed_ressources_aides_personnelle_logement_out (x: RessourcesAidesPersonnelleLogementOut.t) : runtime_value = + Struct(["RessourcesAidesPersonnelleLogement_out"], + [("ressources_prises_en_compte_out", embed_money + x.RessourcesAidesPersonnelleLogementOut.ressources_prises_en_compte_out)]) + + +module RessourcesAidesPersonnelleLogementIn = struct + type t = { + ressources_demandeur_in: money; + ressources_conjoint_in: money; + personnes_vivant_habituellement_foyer_in: + PersonneVivantHabituellementAuFoyer.t array; + demandeur_exerce_activite_remuneree_in: bool; + conjoint_exerce_activite_remuneree_in: bool; + personnes_a_charge_in: PersonneACharge.t array; + situation_familiale_in: SituationFamiliale.t; + mode_occupation_in: ModeOccupation.t; + condition_age_bourse_enseignement_superieur_in: bool; + demandeur_poursuit_des_etudes_in: bool; + date_demande_ou_reexamen_droit_in: date; + paiement_logement_distinct_professionnel_in: + PaiementLogementDistinctProfessionnel.t; + ressources_menage_arrondies_base_in: money + } +end +let embed_ressources_aides_personnelle_logement_in (x: RessourcesAidesPersonnelleLogementIn.t) : runtime_value = + Struct(["RessourcesAidesPersonnelleLogement_in"], + [("ressources_demandeur_in", embed_money + x.RessourcesAidesPersonnelleLogementIn.ressources_demandeur_in); + ("ressources_conjoint_in", embed_money + x.RessourcesAidesPersonnelleLogementIn.ressources_conjoint_in); + ("personnes_vivant_habituellement_foyer_in", + embed_array (embed_personne_vivant_habituellement_au_foyer) + x.RessourcesAidesPersonnelleLogementIn.personnes_vivant_habituellement_foyer_in); + ("demandeur_exerce_activité_rémunérée_in", embed_bool + x.RessourcesAidesPersonnelleLogementIn.demandeur_exerce_activite_remuneree_in); + ("conjoint_exerce_activité_rémunérée_in", embed_bool + x.RessourcesAidesPersonnelleLogementIn.conjoint_exerce_activite_remuneree_in); + ("personnes_à_charge_in", embed_array (embed_personne_a_charge) + x.RessourcesAidesPersonnelleLogementIn.personnes_a_charge_in); + ("situation_familiale_in", embed_situation_familiale + x.RessourcesAidesPersonnelleLogementIn.situation_familiale_in); + ("mode_occupation_in", embed_mode_occupation + x.RessourcesAidesPersonnelleLogementIn.mode_occupation_in); + ("condition_âge_bourse_enseignement_supérieur_in", embed_bool + x.RessourcesAidesPersonnelleLogementIn.condition_age_bourse_enseignement_superieur_in); + ("demandeur_poursuit_des_études_in", embed_bool + x.RessourcesAidesPersonnelleLogementIn.demandeur_poursuit_des_etudes_in); + ("date_demande_ou_reexamen_droit_in", embed_date + x.RessourcesAidesPersonnelleLogementIn.date_demande_ou_reexamen_droit_in); + ("paiement_logement_distinct_professionnel_in", + embed_paiement_logement_distinct_professionnel + x.RessourcesAidesPersonnelleLogementIn.paiement_logement_distinct_professionnel_in); + ("ressources_ménage_arrondies_base_in", embed_money + x.RessourcesAidesPersonnelleLogementIn.ressources_menage_arrondies_base_in)]) + + +module ContributionsSocialesAidesPersonnelleLogementOut = struct + type t = {montant_out: money -> money} +end +let embed_contributions_sociales_aides_personnelle_logement_out (x: ContributionsSocialesAidesPersonnelleLogementOut.t) : runtime_value = + Struct(["ContributionsSocialesAidesPersonnelleLogement_out"], + [("montant_out", unembeddable + x.ContributionsSocialesAidesPersonnelleLogementOut.montant_out)]) + + +module ContributionsSocialesAidesPersonnelleLogementIn = struct + type t = {date_courante_in: date} +end +let embed_contributions_sociales_aides_personnelle_logement_in (x: ContributionsSocialesAidesPersonnelleLogementIn.t) : runtime_value = + Struct(["ContributionsSocialesAidesPersonnelleLogement_in"], + [("date_courante_in", embed_date + x.ContributionsSocialesAidesPersonnelleLogementIn.date_courante_in)]) + + +module CalculAidePersonnaliseeLogementLocatifOut = struct + type t = { + montant_forfaitaire_charges_d823_16_out: money; + plafond_loyer_d823_16_2_out: money; + participation_minimale_out: money; + taux_composition_familiale_out: decimal; + participation_personnelle_out: money; + aide_finale_formule_out: money; + traitement_aide_finale_montant_minimal_out: money -> money + } +end +let embed_calcul_aide_personnalisee_logement_locatif_out (x: CalculAidePersonnaliseeLogementLocatifOut.t) : runtime_value = + Struct(["CalculAidePersonnaliséeLogementLocatif_out"], + [("montant_forfaitaire_charges_d823_16_out", embed_money + x.CalculAidePersonnaliseeLogementLocatifOut.montant_forfaitaire_charges_d823_16_out); + ("plafond_loyer_d823_16_2_out", embed_money + x.CalculAidePersonnaliseeLogementLocatifOut.plafond_loyer_d823_16_2_out); + ("participation_minimale_out", embed_money + x.CalculAidePersonnaliseeLogementLocatifOut.participation_minimale_out); + ("taux_composition_familiale_out", embed_decimal + x.CalculAidePersonnaliseeLogementLocatifOut.taux_composition_familiale_out); + ("participation_personnelle_out", embed_money + x.CalculAidePersonnaliseeLogementLocatifOut.participation_personnelle_out); + ("aide_finale_formule_out", embed_money + x.CalculAidePersonnaliseeLogementLocatifOut.aide_finale_formule_out); + ("traitement_aide_finale_montant_minimal_out", unembeddable + x.CalculAidePersonnaliseeLogementLocatifOut.traitement_aide_finale_montant_minimal_out)]) + + +module CalculAidePersonnaliseeLogementLocatifIn = struct + type t = { + loyer_principal_in: money; + ressources_menage_arrondies_in: money; + beneficiaire_aide_adulte_ou_enfant_handicapes_in: bool; + date_courante_in: date; + nombre_personnes_a_charge_in: integer; + situation_familiale_calcul_apl_in: SituationFamilialeCalculAPL.t; + zone_in: ZoneDHabitation.t; + logement_est_chambre_in: bool; + agees_ou_handicap_adultes_hebergees_onereux_particuliers_in: bool; + type_aide_in: TypeAidesPersonnelleLogement.t; + colocation_in: bool; + reduction_loyer_solidarite_in: money + } +end +let embed_calcul_aide_personnalisee_logement_locatif_in (x: CalculAidePersonnaliseeLogementLocatifIn.t) : runtime_value = + Struct(["CalculAidePersonnaliséeLogementLocatif_in"], + [("loyer_principal_in", embed_money + x.CalculAidePersonnaliseeLogementLocatifIn.loyer_principal_in); + ("ressources_ménage_arrondies_in", embed_money + x.CalculAidePersonnaliseeLogementLocatifIn.ressources_menage_arrondies_in); + ("bénéficiaire_aide_adulte_ou_enfant_handicapés_in", embed_bool + x.CalculAidePersonnaliseeLogementLocatifIn.beneficiaire_aide_adulte_ou_enfant_handicapes_in); + ("date_courante_in", embed_date + x.CalculAidePersonnaliseeLogementLocatifIn.date_courante_in); + ("nombre_personnes_à_charge_in", embed_integer + x.CalculAidePersonnaliseeLogementLocatifIn.nombre_personnes_a_charge_in); + ("situation_familiale_calcul_apl_in", + embed_situation_familiale_calcul_a_p_l + x.CalculAidePersonnaliseeLogementLocatifIn.situation_familiale_calcul_apl_in); + ("zone_in", embed_zone_d_habitation + x.CalculAidePersonnaliseeLogementLocatifIn.zone_in); + ("logement_est_chambre_in", embed_bool + x.CalculAidePersonnaliseeLogementLocatifIn.logement_est_chambre_in); + ("âgées_ou_handicap_adultes_hébergées_onéreux_particuliers_in", + embed_bool + x.CalculAidePersonnaliseeLogementLocatifIn.agees_ou_handicap_adultes_hebergees_onereux_particuliers_in); + ("type_aide_in", embed_type_aides_personnelle_logement + x.CalculAidePersonnaliseeLogementLocatifIn.type_aide_in); + ("colocation_in", embed_bool + x.CalculAidePersonnaliseeLogementLocatifIn.colocation_in); + ("réduction_loyer_solidarité_in", embed_money + x.CalculAidePersonnaliseeLogementLocatifIn.reduction_loyer_solidarite_in)]) + + +module CalculEquivalenceLoyerMinimaleOut = struct + type t = {montant_out: money} +end +let embed_calcul_equivalence_loyer_minimale_out (x: CalculEquivalenceLoyerMinimaleOut.t) : runtime_value = + Struct(["CalculÉquivalenceLoyerMinimale_out"], + [("montant_out", embed_money + x.CalculEquivalenceLoyerMinimaleOut.montant_out)]) + + +module CalculEquivalenceLoyerMinimaleIn = struct + type t = { + ressources_menage_arrondies_in: money; + condition_2_du_832_25_in: bool; + n_nombre_parts_d832_25_in: decimal + } +end +let embed_calcul_equivalence_loyer_minimale_in (x: CalculEquivalenceLoyerMinimaleIn.t) : runtime_value = + Struct(["CalculÉquivalenceLoyerMinimale_in"], + [("ressources_ménage_arrondies_in", embed_money + x.CalculEquivalenceLoyerMinimaleIn.ressources_menage_arrondies_in); + ("condition_2_du_832_25_in", embed_bool + x.CalculEquivalenceLoyerMinimaleIn.condition_2_du_832_25_in); + ("n_nombre_parts_d832_25_in", embed_decimal + x.CalculEquivalenceLoyerMinimaleIn.n_nombre_parts_d832_25_in)]) + + +module CalculNombrePartLogementFoyerOut = struct + type t = {n_nombre_parts_d832_25_out: decimal} +end +let embed_calcul_nombre_part_logement_foyer_out (x: CalculNombrePartLogementFoyerOut.t) : runtime_value = + Struct(["CalculNombrePartLogementFoyer_out"], + [("n_nombre_parts_d832_25_out", embed_decimal + x.CalculNombrePartLogementFoyerOut.n_nombre_parts_d832_25_out)]) + + +module CalculNombrePartLogementFoyerIn = struct + type t = { + condition_2_du_832_25_in: bool; + nombre_personnes_a_charge_in: integer; + situation_familiale_calcul_apl_in: SituationFamilialeCalculAPL.t + } +end +let embed_calcul_nombre_part_logement_foyer_in (x: CalculNombrePartLogementFoyerIn.t) : runtime_value = + Struct(["CalculNombrePartLogementFoyer_in"], + [("condition_2_du_832_25_in", embed_bool + x.CalculNombrePartLogementFoyerIn.condition_2_du_832_25_in); + ("nombre_personnes_à_charge_in", embed_integer + x.CalculNombrePartLogementFoyerIn.nombre_personnes_a_charge_in); + ("situation_familiale_calcul_apl_in", + embed_situation_familiale_calcul_a_p_l + x.CalculNombrePartLogementFoyerIn.situation_familiale_calcul_apl_in)]) + + +module CalculAidePersonnaliseeLogementFoyerOut = struct + type t = { + coefficient_multiplicateur_d832_25_out: money; + coefficient_r_d832_25_out: money; + n_nombre_parts_d832_25_out: decimal; + equivalence_loyer_eligible_out: money; + plafond_equivalence_loyer_eligible_out: money; + equivalence_loyer_minimale_out: money; + coefficient_prise_en_charge_d832_25_seuil_out: decimal; + aide_finale_formule_out: money; + traitement_aide_finale_montant_minimal_out: money -> money + } +end +let embed_calcul_aide_personnalisee_logement_foyer_out (x: CalculAidePersonnaliseeLogementFoyerOut.t) : runtime_value = + Struct(["CalculAidePersonnaliséeLogementFoyer_out"], + [("coefficient_multiplicateur_d832_25_out", embed_money + x.CalculAidePersonnaliseeLogementFoyerOut.coefficient_multiplicateur_d832_25_out); + ("coefficient_r_d832_25_out", embed_money + x.CalculAidePersonnaliseeLogementFoyerOut.coefficient_r_d832_25_out); + ("n_nombre_parts_d832_25_out", embed_decimal + x.CalculAidePersonnaliseeLogementFoyerOut.n_nombre_parts_d832_25_out); + ("équivalence_loyer_éligible_out", embed_money + x.CalculAidePersonnaliseeLogementFoyerOut.equivalence_loyer_eligible_out); + ("plafond_équivalence_loyer_éligible_out", embed_money + x.CalculAidePersonnaliseeLogementFoyerOut.plafond_equivalence_loyer_eligible_out); + ("équivalence_loyer_minimale_out", embed_money + x.CalculAidePersonnaliseeLogementFoyerOut.equivalence_loyer_minimale_out); + ("coefficient_prise_en_charge_d832_25_seuil_out", embed_decimal + x.CalculAidePersonnaliseeLogementFoyerOut.coefficient_prise_en_charge_d832_25_seuil_out); + ("aide_finale_formule_out", embed_money + x.CalculAidePersonnaliseeLogementFoyerOut.aide_finale_formule_out); + ("traitement_aide_finale_montant_minimal_out", unembeddable + x.CalculAidePersonnaliseeLogementFoyerOut.traitement_aide_finale_montant_minimal_out)]) + + +module CalculAidePersonnaliseeLogementFoyerIn = struct + type t = { + mode_occupation_in: ModeOccupation.t; + ressources_menage_arrondies_in: money; + nombre_personnes_a_charge_in: integer; + situation_familiale_calcul_apl_in: SituationFamilialeCalculAPL.t; + zone_in: ZoneDHabitation.t; + date_courante_in: date; + redevance_in: money; + condition_2_du_832_25_in: unit -> bool; + n_nombre_parts_d832_25_in: unit -> decimal + } +end +let embed_calcul_aide_personnalisee_logement_foyer_in (x: CalculAidePersonnaliseeLogementFoyerIn.t) : runtime_value = + Struct(["CalculAidePersonnaliséeLogementFoyer_in"], + [("mode_occupation_in", embed_mode_occupation + x.CalculAidePersonnaliseeLogementFoyerIn.mode_occupation_in); + ("ressources_ménage_arrondies_in", embed_money + x.CalculAidePersonnaliseeLogementFoyerIn.ressources_menage_arrondies_in); + ("nombre_personnes_à_charge_in", embed_integer + x.CalculAidePersonnaliseeLogementFoyerIn.nombre_personnes_a_charge_in); + ("situation_familiale_calcul_apl_in", + embed_situation_familiale_calcul_a_p_l + x.CalculAidePersonnaliseeLogementFoyerIn.situation_familiale_calcul_apl_in); + ("zone_in", embed_zone_d_habitation + x.CalculAidePersonnaliseeLogementFoyerIn.zone_in); + ("date_courante_in", embed_date + x.CalculAidePersonnaliseeLogementFoyerIn.date_courante_in); + ("redevance_in", embed_money + x.CalculAidePersonnaliseeLogementFoyerIn.redevance_in); + ("condition_2_du_832_25_in", unembeddable + x.CalculAidePersonnaliseeLogementFoyerIn.condition_2_du_832_25_in); + ("n_nombre_parts_d832_25_in", unembeddable + x.CalculAidePersonnaliseeLogementFoyerIn.n_nombre_parts_d832_25_in)]) + + +module CalculNombrePartsAccessionProprieteOut = struct + type t = {n_nombre_parts_d832_11_out: decimal} +end +let embed_calcul_nombre_parts_accession_propriete_out (x: CalculNombrePartsAccessionProprieteOut.t) : runtime_value = + Struct(["CalculNombrePartsAccessionPropriété_out"], + [("n_nombre_parts_d832_11_out", embed_decimal + x.CalculNombrePartsAccessionProprieteOut.n_nombre_parts_d832_11_out)]) + + +module CalculNombrePartsAccessionProprieteIn = struct + type t = { + nombre_personnes_a_charge_in: integer; + situation_familiale_calcul_apl_in: SituationFamilialeCalculAPL.t + } +end +let embed_calcul_nombre_parts_accession_propriete_in (x: CalculNombrePartsAccessionProprieteIn.t) : runtime_value = + Struct(["CalculNombrePartsAccessionPropriété_in"], + [("nombre_personnes_à_charge_in", embed_integer + x.CalculNombrePartsAccessionProprieteIn.nombre_personnes_a_charge_in); + ("situation_familiale_calcul_apl_in", + embed_situation_familiale_calcul_a_p_l + x.CalculNombrePartsAccessionProprieteIn.situation_familiale_calcul_apl_in)]) + + +module CalculAidePersonnaliseeLogementAccessionProprieteOut = struct + type t = { + mensualite_eligible_out: money; + mensualite_minimale_out: money; + coefficient_prise_en_charge_d832_10_seuil_out: decimal; + aide_finale_formule_out: money; + traitement_aide_finale_montant_minimal_out: money -> money + } +end +let embed_calcul_aide_personnalisee_logement_accession_propriete_out (x: CalculAidePersonnaliseeLogementAccessionProprieteOut.t) : runtime_value = + Struct(["CalculAidePersonnaliséeLogementAccessionPropriété_out"], + [("mensualité_éligible_out", embed_money + x.CalculAidePersonnaliseeLogementAccessionProprieteOut.mensualite_eligible_out); + ("mensualité_minimale_out", embed_money + x.CalculAidePersonnaliseeLogementAccessionProprieteOut.mensualite_minimale_out); + ("coefficient_prise_en_charge_d832_10_seuil_out", embed_decimal + x.CalculAidePersonnaliseeLogementAccessionProprieteOut.coefficient_prise_en_charge_d832_10_seuil_out); + ("aide_finale_formule_out", embed_money + x.CalculAidePersonnaliseeLogementAccessionProprieteOut.aide_finale_formule_out); + ("traitement_aide_finale_montant_minimal_out", unembeddable + x.CalculAidePersonnaliseeLogementAccessionProprieteOut.traitement_aide_finale_montant_minimal_out)]) + + +module CalculAidePersonnaliseeLogementAccessionProprieteIn = struct + type t = { + mensualite_principale_in: money; + ressources_menage_arrondies_in: money; + nombre_personnes_a_charge_in: integer; + situation_familiale_calcul_apl_in: SituationFamilialeCalculAPL.t; + type_travaux_logement_in: TypeTravauxLogementD83215.t; + date_signature_pret_in: date; + local_habite_premiere_fois_beneficiaire_in: bool; + date_entree_logement_in: date; + copropriete_in: bool; + situation_r822_11_13_17_in: bool; + zone_in: ZoneDHabitation.t; + type_pret_in: TypePret.t; + anciennete_logement_in: NeufOuAncien.t; + date_courante_in: date + } +end +let embed_calcul_aide_personnalisee_logement_accession_propriete_in (x: CalculAidePersonnaliseeLogementAccessionProprieteIn.t) : runtime_value = + Struct(["CalculAidePersonnaliséeLogementAccessionPropriété_in"], + [("mensualité_principale_in", embed_money + x.CalculAidePersonnaliseeLogementAccessionProprieteIn.mensualite_principale_in); + ("ressources_ménage_arrondies_in", embed_money + x.CalculAidePersonnaliseeLogementAccessionProprieteIn.ressources_menage_arrondies_in); + ("nombre_personnes_à_charge_in", embed_integer + x.CalculAidePersonnaliseeLogementAccessionProprieteIn.nombre_personnes_a_charge_in); + ("situation_familiale_calcul_apl_in", + embed_situation_familiale_calcul_a_p_l + x.CalculAidePersonnaliseeLogementAccessionProprieteIn.situation_familiale_calcul_apl_in); + ("type_travaux_logement_in", embed_type_travaux_logement_d832_15 + x.CalculAidePersonnaliseeLogementAccessionProprieteIn.type_travaux_logement_in); + ("date_signature_prêt_in", embed_date + x.CalculAidePersonnaliseeLogementAccessionProprieteIn.date_signature_pret_in); + ("local_habité_première_fois_bénéficiaire_in", embed_bool + x.CalculAidePersonnaliseeLogementAccessionProprieteIn.local_habite_premiere_fois_beneficiaire_in); + ("date_entrée_logement_in", embed_date + x.CalculAidePersonnaliseeLogementAccessionProprieteIn.date_entree_logement_in); + ("copropriété_in", embed_bool + x.CalculAidePersonnaliseeLogementAccessionProprieteIn.copropriete_in); + ("situation_r822_11_13_17_in", embed_bool + x.CalculAidePersonnaliseeLogementAccessionProprieteIn.situation_r822_11_13_17_in); + ("zone_in", embed_zone_d_habitation + x.CalculAidePersonnaliseeLogementAccessionProprieteIn.zone_in); + ("type_prêt_in", embed_type_pret + x.CalculAidePersonnaliseeLogementAccessionProprieteIn.type_pret_in); + ("ancienneté_logement_in", embed_neuf_ou_ancien + x.CalculAidePersonnaliseeLogementAccessionProprieteIn.anciennete_logement_in); + ("date_courante_in", embed_date + x.CalculAidePersonnaliseeLogementAccessionProprieteIn.date_courante_in)]) + + +module CalculAidePersonnaliseeLogementOut = struct + type t = { + aide_finale_formule_out: money; + traitement_aide_finale_out: money -> money + } +end +let embed_calcul_aide_personnalisee_logement_out (x: CalculAidePersonnaliseeLogementOut.t) : runtime_value = + Struct(["CalculAidePersonnaliséeLogement_out"], + [("aide_finale_formule_out", embed_money + x.CalculAidePersonnaliseeLogementOut.aide_finale_formule_out); + ("traitement_aide_finale_out", unembeddable + x.CalculAidePersonnaliseeLogementOut.traitement_aide_finale_out)]) + + +module CalculAidePersonnaliseeLogementIn = struct + type t = { + mode_occupation_in: ModeOccupation.t; + type_aide_in: TypeAidesPersonnelleLogement.t; + informations_calcul_in: InformationsCalculAPL.t; + ressources_menage_sans_arrondi_in: money; + situation_familiale_in: SituationFamiliale.t; + nombre_personnes_a_charge_in: integer; + zone_in: ZoneDHabitation.t; + date_courante_in: date + } +end +let embed_calcul_aide_personnalisee_logement_in (x: CalculAidePersonnaliseeLogementIn.t) : runtime_value = + Struct(["CalculAidePersonnaliséeLogement_in"], + [("mode_occupation_in", embed_mode_occupation + x.CalculAidePersonnaliseeLogementIn.mode_occupation_in); + ("type_aide_in", embed_type_aides_personnelle_logement + x.CalculAidePersonnaliseeLogementIn.type_aide_in); + ("informations_calcul_in", embed_informations_calcul_a_p_l + x.CalculAidePersonnaliseeLogementIn.informations_calcul_in); + ("ressources_ménage_sans_arrondi_in", embed_money + x.CalculAidePersonnaliseeLogementIn.ressources_menage_sans_arrondi_in); + ("situation_familiale_in", embed_situation_familiale + x.CalculAidePersonnaliseeLogementIn.situation_familiale_in); + ("nombre_personnes_à_charge_in", embed_integer + x.CalculAidePersonnaliseeLogementIn.nombre_personnes_a_charge_in); + ("zone_in", embed_zone_d_habitation + x.CalculAidePersonnaliseeLogementIn.zone_in); + ("date_courante_in", embed_date + x.CalculAidePersonnaliseeLogementIn.date_courante_in)]) + + +module CalculAllocationLogementLocatifOut = struct + type t = { + aide_finale_formule_out: money; + traitement_aide_finale_out: money -> money + } +end +let embed_calcul_allocation_logement_locatif_out (x: CalculAllocationLogementLocatifOut.t) : runtime_value = + Struct(["CalculAllocationLogementLocatif_out"], + [("aide_finale_formule_out", embed_money + x.CalculAllocationLogementLocatifOut.aide_finale_formule_out); + ("traitement_aide_finale_out", unembeddable + x.CalculAllocationLogementLocatifOut.traitement_aide_finale_out)]) + + +module CalculAllocationLogementLocatifIn = struct + type t = { + loyer_principal_in: money; + ressources_menage_arrondies_in: money; + beneficiaire_aide_adulte_ou_enfant_handicapes_in: bool; + date_courante_in: date; + nombre_personnes_a_charge_in: integer; + situation_familiale_calcul_apl_in: SituationFamilialeCalculAPL.t; + zone_in: ZoneDHabitation.t; + logement_est_chambre_in: bool; + agees_ou_handicap_adultes_hebergees_onereux_particuliers_in: bool; + type_aide_in: TypeAidesPersonnelleLogement.t; + colocation_in: bool; + reduction_loyer_solidarite_in: money; + logement_meuble_d842_2_in: bool; + changement_logement_d842_4_in: ChangementLogementD8424.t + } +end +let embed_calcul_allocation_logement_locatif_in (x: CalculAllocationLogementLocatifIn.t) : runtime_value = + Struct(["CalculAllocationLogementLocatif_in"], + [("loyer_principal_in", embed_money + x.CalculAllocationLogementLocatifIn.loyer_principal_in); + ("ressources_ménage_arrondies_in", embed_money + x.CalculAllocationLogementLocatifIn.ressources_menage_arrondies_in); + ("bénéficiaire_aide_adulte_ou_enfant_handicapés_in", embed_bool + x.CalculAllocationLogementLocatifIn.beneficiaire_aide_adulte_ou_enfant_handicapes_in); + ("date_courante_in", embed_date + x.CalculAllocationLogementLocatifIn.date_courante_in); + ("nombre_personnes_à_charge_in", embed_integer + x.CalculAllocationLogementLocatifIn.nombre_personnes_a_charge_in); + ("situation_familiale_calcul_apl_in", + embed_situation_familiale_calcul_a_p_l + x.CalculAllocationLogementLocatifIn.situation_familiale_calcul_apl_in); + ("zone_in", embed_zone_d_habitation + x.CalculAllocationLogementLocatifIn.zone_in); + ("logement_est_chambre_in", embed_bool + x.CalculAllocationLogementLocatifIn.logement_est_chambre_in); + ("âgées_ou_handicap_adultes_hébergées_onéreux_particuliers_in", + embed_bool + x.CalculAllocationLogementLocatifIn.agees_ou_handicap_adultes_hebergees_onereux_particuliers_in); + ("type_aide_in", embed_type_aides_personnelle_logement + x.CalculAllocationLogementLocatifIn.type_aide_in); + ("colocation_in", embed_bool + x.CalculAllocationLogementLocatifIn.colocation_in); + ("réduction_loyer_solidarité_in", embed_money + x.CalculAllocationLogementLocatifIn.reduction_loyer_solidarite_in); + ("logement_meublé_d842_2_in", embed_bool + x.CalculAllocationLogementLocatifIn.logement_meuble_d842_2_in); + ("changement_logement_d842_4_in", embed_changement_logement_d842_4 + x.CalculAllocationLogementLocatifIn.changement_logement_d842_4_in)]) + + +module CalculAllocationLogementAccessionProprieteOut = struct + type t = { + aide_finale_formule_out: money; + traitement_aide_finale_montant_minimal_out: money -> money + } +end +let embed_calcul_allocation_logement_accession_propriete_out (x: CalculAllocationLogementAccessionProprieteOut.t) : runtime_value = + Struct(["CalculAllocationLogementAccessionPropriété_out"], + [("aide_finale_formule_out", embed_money + x.CalculAllocationLogementAccessionProprieteOut.aide_finale_formule_out); + ("traitement_aide_finale_montant_minimal_out", unembeddable + x.CalculAllocationLogementAccessionProprieteOut.traitement_aide_finale_montant_minimal_out)]) + + +module CalculAllocationLogementAccessionProprieteIn = struct + type t = { + ressources_menage_arrondies_base_in: money; + nombre_personnes_a_charge_in: integer; + situation_familiale_calcul_apl_in: SituationFamilialeCalculAPL.t; + zone_in: ZoneDHabitation.t; + date_courante_in: date; + mensualite_principale_in: money; + situation_r822_11_13_17_in: bool; + date_signature_pret_in: date; + type_travaux_logement_in: TypeTravauxLogementR8425.t; + local_habite_premiere_fois_beneficiaire_in: bool; + date_entree_logement_in: date; + charges_mensuelles_pret_in: money; + copropriete_in: bool + } +end +let embed_calcul_allocation_logement_accession_propriete_in (x: CalculAllocationLogementAccessionProprieteIn.t) : runtime_value = + Struct(["CalculAllocationLogementAccessionPropriété_in"], + [("ressources_ménage_arrondies_base_in", embed_money + x.CalculAllocationLogementAccessionProprieteIn.ressources_menage_arrondies_base_in); + ("nombre_personnes_à_charge_in", embed_integer + x.CalculAllocationLogementAccessionProprieteIn.nombre_personnes_a_charge_in); + ("situation_familiale_calcul_apl_in", + embed_situation_familiale_calcul_a_p_l + x.CalculAllocationLogementAccessionProprieteIn.situation_familiale_calcul_apl_in); + ("zone_in", embed_zone_d_habitation + x.CalculAllocationLogementAccessionProprieteIn.zone_in); + ("date_courante_in", embed_date + x.CalculAllocationLogementAccessionProprieteIn.date_courante_in); + ("mensualité_principale_in", embed_money + x.CalculAllocationLogementAccessionProprieteIn.mensualite_principale_in); + ("situation_r822_11_13_17_in", embed_bool + x.CalculAllocationLogementAccessionProprieteIn.situation_r822_11_13_17_in); + ("date_signature_prêt_in", embed_date + x.CalculAllocationLogementAccessionProprieteIn.date_signature_pret_in); + ("type_travaux_logement_in", embed_type_travaux_logement_r842_5 + x.CalculAllocationLogementAccessionProprieteIn.type_travaux_logement_in); + ("local_habité_première_fois_bénéficiaire_in", embed_bool + x.CalculAllocationLogementAccessionProprieteIn.local_habite_premiere_fois_beneficiaire_in); + ("date_entrée_logement_in", embed_date + x.CalculAllocationLogementAccessionProprieteIn.date_entree_logement_in); + ("charges_mensuelles_prêt_in", embed_money + x.CalculAllocationLogementAccessionProprieteIn.charges_mensuelles_pret_in); + ("copropriété_in", embed_bool + x.CalculAllocationLogementAccessionProprieteIn.copropriete_in)]) + + +module CalculAllocationLogementFoyerOut = struct + type t = { + coefficient_prise_en_charge_out: decimal; + equivalence_loyer_out: money; + montant_forfaitaire_charges_out: money; + loyer_minimal_out: money; + aide_finale_formule_out: money; + traitement_aide_finale_montant_minimal_out: money -> money + } +end +let embed_calcul_allocation_logement_foyer_out (x: CalculAllocationLogementFoyerOut.t) : runtime_value = + Struct(["CalculAllocationLogementFoyer_out"], + [("coefficient_prise_en_charge_out", embed_decimal + x.CalculAllocationLogementFoyerOut.coefficient_prise_en_charge_out); + ("équivalence_loyer_out", embed_money + x.CalculAllocationLogementFoyerOut.equivalence_loyer_out); + ("montant_forfaitaire_charges_out", embed_money + x.CalculAllocationLogementFoyerOut.montant_forfaitaire_charges_out); + ("loyer_minimal_out", embed_money + x.CalculAllocationLogementFoyerOut.loyer_minimal_out); + ("aide_finale_formule_out", embed_money + x.CalculAllocationLogementFoyerOut.aide_finale_formule_out); + ("traitement_aide_finale_montant_minimal_out", unembeddable + x.CalculAllocationLogementFoyerOut.traitement_aide_finale_montant_minimal_out)]) + + +module CalculAllocationLogementFoyerIn = struct + type t = { + redevance_in: money; + mode_occupation_in: ModeOccupation.t; + ressources_menage_arrondies_in: money; + nombre_personnes_a_charge_in: integer; + situation_familiale_calcul_apl_in: SituationFamilialeCalculAPL.t; + zone_in: ZoneDHabitation.t; + date_courante_in: date; + categorie_equivalence_loyer_d842_16_in: + CategorieEquivalenceLoyerAllocationLogementFoyer.t + } +end +let embed_calcul_allocation_logement_foyer_in (x: CalculAllocationLogementFoyerIn.t) : runtime_value = + Struct(["CalculAllocationLogementFoyer_in"], + [("redevance_in", embed_money + x.CalculAllocationLogementFoyerIn.redevance_in); + ("mode_occupation_in", embed_mode_occupation + x.CalculAllocationLogementFoyerIn.mode_occupation_in); + ("ressources_ménage_arrondies_in", embed_money + x.CalculAllocationLogementFoyerIn.ressources_menage_arrondies_in); + ("nombre_personnes_à_charge_in", embed_integer + x.CalculAllocationLogementFoyerIn.nombre_personnes_a_charge_in); + ("situation_familiale_calcul_apl_in", + embed_situation_familiale_calcul_a_p_l + x.CalculAllocationLogementFoyerIn.situation_familiale_calcul_apl_in); + ("zone_in", embed_zone_d_habitation + x.CalculAllocationLogementFoyerIn.zone_in); + ("date_courante_in", embed_date + x.CalculAllocationLogementFoyerIn.date_courante_in); + ("catégorie_équivalence_loyer_d842_16_in", + embed_categorie_equivalence_loyer_allocation_logement_foyer + x.CalculAllocationLogementFoyerIn.categorie_equivalence_loyer_d842_16_in)]) + + +module CalculAllocationLogementOut = struct + type t = { + aide_finale_formule_out: money; + traitement_aide_finale_out: money -> money + } +end +let embed_calcul_allocation_logement_out (x: CalculAllocationLogementOut.t) : runtime_value = + Struct(["CalculAllocationLogement_out"], + [("aide_finale_formule_out", embed_money + x.CalculAllocationLogementOut.aide_finale_formule_out); + ("traitement_aide_finale_out", unembeddable + x.CalculAllocationLogementOut.traitement_aide_finale_out)]) + + +module CalculAllocationLogementIn = struct + type t = { + mode_occupation_in: ModeOccupation.t; + informations_calcul_in: InformationsCalculAPL.t; + ressources_menage_sans_arrondi_in: money; + situation_familiale_in: SituationFamiliale.t; + nombre_personnes_a_charge_in: integer; + zone_in: ZoneDHabitation.t; + date_courante_in: date; + type_aide_in: TypeAidesPersonnelleLogement.t + } +end +let embed_calcul_allocation_logement_in (x: CalculAllocationLogementIn.t) : runtime_value = + Struct(["CalculAllocationLogement_in"], + [("mode_occupation_in", embed_mode_occupation + x.CalculAllocationLogementIn.mode_occupation_in); + ("informations_calcul_in", embed_informations_calcul_a_p_l + x.CalculAllocationLogementIn.informations_calcul_in); + ("ressources_ménage_sans_arrondi_in", embed_money + x.CalculAllocationLogementIn.ressources_menage_sans_arrondi_in); + ("situation_familiale_in", embed_situation_familiale + x.CalculAllocationLogementIn.situation_familiale_in); + ("nombre_personnes_à_charge_in", embed_integer + x.CalculAllocationLogementIn.nombre_personnes_a_charge_in); + ("zone_in", embed_zone_d_habitation + x.CalculAllocationLogementIn.zone_in); + ("date_courante_in", embed_date + x.CalculAllocationLogementIn.date_courante_in); + ("type_aide_in", embed_type_aides_personnelle_logement + x.CalculAllocationLogementIn.type_aide_in)]) + + +module OuvertureDroitsRetraiteOut = struct + type t = {age_ouverture_droit_out: duration} +end +let embed_ouverture_droits_retraite_out (x: OuvertureDroitsRetraiteOut.t) : runtime_value = + Struct(["OuvertureDroitsRetraite_out"], + [("âge_ouverture_droit_out", embed_duration + x.OuvertureDroitsRetraiteOut.age_ouverture_droit_out)]) + + +module OuvertureDroitsRetraiteIn = struct + type t = {date_naissance_assure_in: date} +end +let embed_ouverture_droits_retraite_in (x: OuvertureDroitsRetraiteIn.t) : runtime_value = + Struct(["OuvertureDroitsRetraite_in"], + [("date_naissance_assuré_in", embed_date + x.OuvertureDroitsRetraiteIn.date_naissance_assure_in)]) + + +module ImpayeDepenseLogementOut = struct + type t = {montant_impaye_out: money} +end +let embed_impaye_depense_logement_out (x: ImpayeDepenseLogementOut.t) : runtime_value = + Struct(["ImpayéDépenseLogement_out"], + [("montant_impayé_out", embed_money + x.ImpayeDepenseLogementOut.montant_impaye_out)]) + + +module ImpayeDepenseLogementIn = struct + type t = { + mode_occupation_in: ModeOccupation.t; + aide_versee_in: VersementA.t; + montant_apl_in: money; + montant_charges_in: money; + depense_logement_in: DepenseLogement.t; + montant_dette_in: money + } +end +let embed_impaye_depense_logement_in (x: ImpayeDepenseLogementIn.t) : runtime_value = + Struct(["ImpayéDépenseLogement_in"], + [("mode_occupation_in", embed_mode_occupation + x.ImpayeDepenseLogementIn.mode_occupation_in); + ("aide_versée_in", embed_versement_a + x.ImpayeDepenseLogementIn.aide_versee_in); + ("montant_apl_in", embed_money + x.ImpayeDepenseLogementIn.montant_apl_in); + ("montant_charges_in", embed_money + x.ImpayeDepenseLogementIn.montant_charges_in); + ("dépense_logement_in", embed_depense_logement + x.ImpayeDepenseLogementIn.depense_logement_in); + ("montant_dette_in", embed_money + x.ImpayeDepenseLogementIn.montant_dette_in)]) + + +module CalculetteAidesAuLogementOut = struct + type t = { + eligibilite_out: bool; + aide_finale_formule_out: money; + traitement_aide_finale_out: money -> money; + coefficents_enfants_garde_alternee_pris_en_compte_out: decimal array + } +end +let embed_calculette_aides_au_logement_out (x: CalculetteAidesAuLogementOut.t) : runtime_value = + Struct(["CalculetteAidesAuLogement_out"], + [("éligibilité_out", embed_bool + x.CalculetteAidesAuLogementOut.eligibilite_out); + ("aide_finale_formule_out", embed_money + x.CalculetteAidesAuLogementOut.aide_finale_formule_out); + ("traitement_aide_finale_out", unembeddable + x.CalculetteAidesAuLogementOut.traitement_aide_finale_out); + ("coefficents_enfants_garde_alternée_pris_en_compte_out", + embed_array (embed_decimal) + x.CalculetteAidesAuLogementOut.coefficents_enfants_garde_alternee_pris_en_compte_out)]) + + +module CalculetteAidesAuLogementIn = struct + type t = { + menage_in: Menage.t; + demandeur_in: Demandeur.t; + informations_calcul_in: InformationsCalculAPL.t; + date_courante_in: date; + ressources_menage_prises_en_compte_in: money + } +end +let embed_calculette_aides_au_logement_in (x: CalculetteAidesAuLogementIn.t) : runtime_value = + Struct(["CalculetteAidesAuLogement_in"], + [("ménage_in", embed_menage + x.CalculetteAidesAuLogementIn.menage_in); + ("demandeur_in", embed_demandeur + x.CalculetteAidesAuLogementIn.demandeur_in); + ("informations_calcul_in", embed_informations_calcul_a_p_l + x.CalculetteAidesAuLogementIn.informations_calcul_in); + ("date_courante_in", embed_date + x.CalculetteAidesAuLogementIn.date_courante_in); + ("ressources_ménage_prises_en_compte_in", embed_money + x.CalculetteAidesAuLogementIn.ressources_menage_prises_en_compte_in)]) + + +module CalculetteAidesAuLogementGardeAlterneeOut = struct + type t = {eligibilite_out: bool; aide_finale_out: money} +end +let embed_calculette_aides_au_logement_garde_alternee_out (x: CalculetteAidesAuLogementGardeAlterneeOut.t) : runtime_value = + Struct(["CalculetteAidesAuLogementGardeAlternée_out"], + [("éligibilité_out", embed_bool + x.CalculetteAidesAuLogementGardeAlterneeOut.eligibilite_out); + ("aide_finale_out", embed_money + x.CalculetteAidesAuLogementGardeAlterneeOut.aide_finale_out)]) + + +module CalculetteAidesAuLogementGardeAlterneeIn = struct + type t = { + menage_in: Menage.t; + demandeur_in: Demandeur.t; + informations_calcul_in: InformationsCalculAPL.t; + date_courante_in: date; + ressources_menage_prises_en_compte_in: money + } +end +let embed_calculette_aides_au_logement_garde_alternee_in (x: CalculetteAidesAuLogementGardeAlterneeIn.t) : runtime_value = + Struct(["CalculetteAidesAuLogementGardeAlternée_in"], + [("ménage_in", embed_menage + x.CalculetteAidesAuLogementGardeAlterneeIn.menage_in); + ("demandeur_in", embed_demandeur + x.CalculetteAidesAuLogementGardeAlterneeIn.demandeur_in); + ("informations_calcul_in", embed_informations_calcul_a_p_l + x.CalculetteAidesAuLogementGardeAlterneeIn.informations_calcul_in); + ("date_courante_in", embed_date + x.CalculetteAidesAuLogementGardeAlterneeIn.date_courante_in); + ("ressources_ménage_prises_en_compte_in", embed_money + x.CalculetteAidesAuLogementGardeAlterneeIn.ressources_menage_prises_en_compte_in)]) + + +module BaseMensuelleAllocationsFamilialesOut = struct + type t = {montant_out: money} +end +let embed_base_mensuelle_allocations_familiales_out (x: BaseMensuelleAllocationsFamilialesOut.t) : runtime_value = + Struct(["BaseMensuelleAllocationsFamiliales_out"], + [("montant_out", embed_money + x.BaseMensuelleAllocationsFamilialesOut.montant_out)]) + + +module BaseMensuelleAllocationsFamilialesIn = struct + type t = {date_courante_in: date} +end +let embed_base_mensuelle_allocations_familiales_in (x: BaseMensuelleAllocationsFamilialesIn.t) : runtime_value = + Struct(["BaseMensuelleAllocationsFamiliales_in"], + [("date_courante_in", embed_date + x.BaseMensuelleAllocationsFamilialesIn.date_courante_in)]) + + +module SmicOut = struct + type t = {brut_horaire_out: money} +end +let embed_smic_out (x: SmicOut.t) : runtime_value = Struct(["Smic_out"], + [("brut_horaire_out", embed_money x.SmicOut.brut_horaire_out)]) + + +module SmicIn = struct + type t = {date_courante_in: date; residence_in: Collectivite.t} +end +let embed_smic_in (x: SmicIn.t) : runtime_value = Struct(["Smic_in"], + [("date_courante_in", embed_date + x.SmicIn.date_courante_in); + ("résidence_in", embed_collectivite x.SmicIn.residence_in)]) + + +module EligibilitePrestationsFamilialesOut = struct + type t = { + droit_ouvert_out: EnfantPrestationsFamiliales.t -> bool; + conditions_hors_age_out: EnfantPrestationsFamiliales.t -> bool; + age_l512_3_2_out: integer; + regime_outre_mer_l751_1_out: bool + } +end +let embed_eligibilite_prestations_familiales_out (x: EligibilitePrestationsFamilialesOut.t) : runtime_value = + Struct(["ÉligibilitéPrestationsFamiliales_out"], + [("droit_ouvert_out", unembeddable + x.EligibilitePrestationsFamilialesOut.droit_ouvert_out); + ("conditions_hors_âge_out", unembeddable + x.EligibilitePrestationsFamilialesOut.conditions_hors_age_out); + ("âge_l512_3_2_out", embed_integer + x.EligibilitePrestationsFamilialesOut.age_l512_3_2_out); + ("régime_outre_mer_l751_1_out", embed_bool + x.EligibilitePrestationsFamilialesOut.regime_outre_mer_l751_1_out)]) + + +module EligibilitePrestationsFamilialesIn = struct + type t = { + date_courante_in: date; + prestation_courante_in: ElementPrestationsFamiliales.t; + residence_in: Collectivite.t + } +end +let embed_eligibilite_prestations_familiales_in (x: EligibilitePrestationsFamilialesIn.t) : runtime_value = + Struct(["ÉligibilitéPrestationsFamiliales_in"], + [("date_courante_in", embed_date + x.EligibilitePrestationsFamilialesIn.date_courante_in); + ("prestation_courante_in", embed_element_prestations_familiales + x.EligibilitePrestationsFamilialesIn.prestation_courante_in); + ("résidence_in", embed_collectivite + x.EligibilitePrestationsFamilialesIn.residence_in)]) + + + + +let contributions_sociales_aides_personnelle_logement (contributions_sociales_aides_personnelle_logement_in: ContributionsSocialesAidesPersonnelleLogementIn.t) : ContributionsSocialesAidesPersonnelleLogementOut.t = + let date_courante_: date = contributions_sociales_aides_personnelle_logement_in.ContributionsSocialesAidesPersonnelleLogementIn.date_courante_in in + let exonere_csg_: bool = (log_variable_definition + ["ContributionsSocialesAidesPersonnelleLogement"; "exonéré_csg"] + (embed_bool) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=547; start_column=11; end_line=547; end_column=22; + law_headings=["Calcul des contributions sociales s'appliquant aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=547; start_column=11; + end_line=547; end_column=22; + law_headings=["Calcul des contributions sociales s'appliquant aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_sécurité_sociale.catala_fr"; + start_line=37; start_column=9; + end_line=37; end_column=20; + law_headings=["Article L136-1-3"; + "Section 1 : De la contribution sociale sur les revenus d'activité et sur les revenus de remplacement"; + "Chapitre 6 : Contribution sociale généralisée"; + "Titre III: Titre III : Dispositions communes relatives au financement"; + "Partie législative"; + "Code de la sécurité sociale"]} true)) + (fun (_: _) -> true))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=547; start_column=11; end_line=547; end_column=22; + law_headings=["Calcul des contributions sociales s'appliquant aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> false)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=547; start_column=11; end_line=547; end_column=22; + law_headings=["Calcul des contributions sociales s'appliquant aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let taux_crds_: decimal = (log_variable_definition + ["ContributionsSocialesAidesPersonnelleLogement"; "taux_crds"] + (embed_decimal) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=546; start_column=11; end_line=546; end_column=20; + law_headings=["Calcul des contributions sociales s'appliquant aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/autres_sources.catala_fr"; + start_line=138; start_column=39; end_line=138; end_column=69; + law_headings=["Article 19"; + "Chapitre II : Des contributions pour le remboursement de la dette sociale."; + "Ordonnance n° 96-50 du 24 janvier 1996 relative au remboursement de la dette sociale"]} + (date_courante_ >=@ (date_of_numbers (2020) (1) (1))))) + (fun (_: _) -> decimal_of_string "0.005")) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=546; start_column=11; end_line=546; end_column=20; + law_headings=["Calcul des contributions sociales s'appliquant aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let montant_: money -> money = (log_variable_definition + ["ContributionsSocialesAidesPersonnelleLogement"; "montant"] + (unembeddable) ( + try + (fun (param_: money) -> + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=549; start_column=10; end_line=549; end_column=17; + law_headings=["Calcul des contributions sociales s'appliquant aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/autres_sources.catala_fr"; + start_line=100; start_column=5; + end_line=100; end_column=35; + law_headings=["Article 14"; + "Chapitre II : Des contributions pour le remboursement de la dette sociale."; + "Ordonnance n° 96-50 du 24 janvier 1996 relative au remboursement de la dette sociale"]} + (date_courante_ >=@ (date_of_numbers (2018) (9) (1))))) + (fun (_: _) -> param_ *$ taux_crds_)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=549; start_column=10; end_line=549; end_column=17; + law_headings=["Calcul des contributions sociales s'appliquant aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]}))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=549; start_column=10; end_line=549; end_column=17; + law_headings=["Calcul des contributions sociales s'appliquant aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let _: unit = if (try exonere_csg_ with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/autres_sources.catala_fr"; + start_line=104; start_column=13; + end_line=104; end_column=24; + law_headings=["Article 14"; + "Chapitre II : Des contributions pour le remboursement de la dette sociale."; + "Ordonnance n° 96-50 du 24 janvier 1996 relative au remboursement de la dette sociale"]}))) + then () else + raise (AssertionFailed {filename = "examples/aides_logement/autres_sources.catala_fr"; + start_line=104; start_column=13; + end_line=104; end_column=24; + law_headings=["Article 14"; + "Chapitre II : Des contributions pour le remboursement de la dette sociale."; + "Ordonnance n° 96-50 du 24 janvier 1996 relative au remboursement de la dette sociale"]}) in + {ContributionsSocialesAidesPersonnelleLogementOut.montant_out = montant_} + +let calcul_equivalence_loyer_minimale (calcul_equivalence_loyer_minimale_in: CalculEquivalenceLoyerMinimaleIn.t) : CalculEquivalenceLoyerMinimaleOut.t = + let ressources_menage_arrondies_: money = calcul_equivalence_loyer_minimale_in.CalculEquivalenceLoyerMinimaleIn.ressources_menage_arrondies_in in + let condition_2_du_832_25_: bool = calcul_equivalence_loyer_minimale_in.CalculEquivalenceLoyerMinimaleIn.condition_2_du_832_25_in in + let n_nombre_parts_d832_25_: decimal = calcul_equivalence_loyer_minimale_in.CalculEquivalenceLoyerMinimaleIn.n_nombre_parts_d832_25_in in + let montant_forfaitaire_d832_26_: money = (log_variable_definition + ["CalculÉquivalenceLoyerMinimale"; "montant_forfaitaire_d832_26"] + (embed_money) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=620; start_column=11; end_line=620; end_column=38; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=2903; start_column=14; end_line=2903; end_column=41; + law_headings=["Article 31"; + "Chapitre V : Calcul de l'aide personnalisée au logement en secteur logement-foyer"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + true)) + (fun (_: _) -> + if condition_2_du_832_25_ then (money_of_cents_string "7632") + else (money_of_cents_string "4557"))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=620; start_column=11; end_line=620; end_column=38; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let tranches_revenus_d832_26_: TrancheRevenu.t array = (log_variable_definition + ["CalculÉquivalenceLoyerMinimale"; "tranches_revenus_d832_26"] + (embed_array (embed_tranche_revenu)) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=617; start_column=11; end_line=617; end_column=35; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=617; start_column=11; + end_line=617; end_column=35; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=2868; start_column=5; + end_line=2868; end_column=26; + law_headings=["Article 31"; + "Chapitre V : Calcul de l'aide personnalisée au logement en secteur logement-foyer"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + condition_2_du_832_25_)) + (fun (_: _) -> + [|{TrancheRevenu.haut = + (LimiteTranche.Revenu (money_of_cents_string + "142303")); + TrancheRevenu.bas = (money_of_cents_string "0"); + TrancheRevenu.taux = (decimal_of_string "0.")}; + {TrancheRevenu.haut = + (LimiteTranche.Revenu (money_of_cents_string + "204761")); + TrancheRevenu.bas = (money_of_cents_string "142303"); + TrancheRevenu.taux = (decimal_of_string "0.024")}; + {TrancheRevenu.haut = + (LimiteTranche.Revenu (money_of_cents_string + "262985")); + TrancheRevenu.bas = (money_of_cents_string "204761"); + TrancheRevenu.taux = (decimal_of_string "0.208")}; + {TrancheRevenu.haut = + (LimiteTranche.Revenu (money_of_cents_string + "409505")); + TrancheRevenu.bas = (money_of_cents_string "262985"); + TrancheRevenu.taux = (decimal_of_string "0.232")}; + {TrancheRevenu.haut = (LimiteTranche.Infini ()); + TrancheRevenu.bas = (money_of_cents_string "409505"); + TrancheRevenu.taux = (decimal_of_string "0.328")}|]))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=2829; start_column=14; end_line=2829; end_column=38; + law_headings=["Article 31"; + "Chapitre V : Calcul de l'aide personnalisée au logement en secteur logement-foyer"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + true)) + (fun (_: _) -> + [|{TrancheRevenu.haut = + (LimiteTranche.Revenu (money_of_cents_string "194810")); + TrancheRevenu.bas = (money_of_cents_string "0"); + TrancheRevenu.taux = (decimal_of_string "0.04")}; + {TrancheRevenu.haut = + (LimiteTranche.Revenu (money_of_cents_string "267871")); + TrancheRevenu.bas = (money_of_cents_string "194810"); + TrancheRevenu.taux = (decimal_of_string "0.104")}; + {TrancheRevenu.haut = + (LimiteTranche.Revenu (money_of_cents_string "389618")); + TrancheRevenu.bas = (money_of_cents_string "267871"); + TrancheRevenu.taux = (decimal_of_string "0.216")}; + {TrancheRevenu.haut = + (LimiteTranche.Revenu (money_of_cents_string "535744")); + TrancheRevenu.bas = (money_of_cents_string "389618"); + TrancheRevenu.taux = (decimal_of_string "0.264")}; + {TrancheRevenu.haut = + (LimiteTranche.Revenu (money_of_cents_string "633129")); + TrancheRevenu.bas = (money_of_cents_string "535744"); + TrancheRevenu.taux = (decimal_of_string "0.32")}; + {TrancheRevenu.haut = (LimiteTranche.Infini ()); + TrancheRevenu.bas = (money_of_cents_string "633129"); + TrancheRevenu.taux = (decimal_of_string "0.48")}|])) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=617; start_column=11; end_line=617; end_column=35; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let tranches_revenus_d832_26_multipliees_: TrancheRevenuDecimal.t array = (log_variable_definition + ["CalculÉquivalenceLoyerMinimale"; + "tranches_revenus_d832_26_multipliées"] + (embed_array (embed_tranche_revenu_decimal)) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=618; start_column=11; end_line=618; end_column=47; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=4107; start_column=14; end_line=4107; end_column=50; + law_headings=["Article D832-26"; + "Sous-Section 2 : Conditions d'octroi de l'aide personnalisée au logement aux personnes résidant dans un logement-foyer"; + "Section 3 : Logements-foyers"; + "Chapitre II : Modalités de liquidation et de versement de l'aide personnalisée au logement"; + "Titre III : Aide personnalisée au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + Array.map + (fun (tranche_: _) -> + {TrancheRevenuDecimal.haut = + (match (tranche_.TrancheRevenu.haut) + with + | LimiteTranche.Revenu tranche_haut_ -> + (LimiteTrancheDecimal.Revenu + ((decimal_of_money tranche_haut_) *& + n_nombre_parts_d832_25_)) + | LimiteTranche.Infini _ -> + (LimiteTrancheDecimal.Infini ())); + TrancheRevenuDecimal.bas = + ((decimal_of_money (tranche_.TrancheRevenu.bas)) *& + n_nombre_parts_d832_25_); + TrancheRevenuDecimal.taux = (tranche_.TrancheRevenu.taux)}) + tranches_revenus_d832_26_)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=618; start_column=11; end_line=618; end_column=47; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let montant_: money = (log_variable_definition + ["CalculÉquivalenceLoyerMinimale"; "montant"] (embed_money) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=622; start_column=10; end_line=622; end_column=17; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=622; start_column=10; + end_line=622; end_column=17; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=4158; start_column=5; + end_line=4158; end_column=26; + law_headings=["Article D832-26"; + "Sous-Section 2 : Conditions d'octroi de l'aide personnalisée au logement aux personnes résidant dans un logement-foyer"; + "Section 3 : Logements-foyers"; + "Chapitre II : Modalités de liquidation et de versement de l'aide personnalisée au logement"; + "Titre III : Aide personnalisée au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + condition_2_du_832_25_)) + (fun (_: _) -> + money_of_decimal + (((Array.fold_left + (fun (acc_: decimal) (tranche_: _) -> + acc_ +& + ( if + ((decimal_of_money + ressources_menage_arrondies_) <=& + (tranche_.TrancheRevenuDecimal.bas)) + then (decimal_of_string "0.") else + (match + (tranche_.TrancheRevenuDecimal.haut) + with + | LimiteTrancheDecimal.Revenu tranche_haut_ -> + ( if + ((decimal_of_money + ressources_menage_arrondies_) + >=& tranche_haut_) then + ((tranche_haut_ -& + (tranche_.TrancheRevenuDecimal.bas)) + *& + (tranche_.TrancheRevenuDecimal.taux)) + else + (((decimal_of_money + ressources_menage_arrondies_) + -& + (tranche_.TrancheRevenuDecimal.bas)) + *& + (tranche_.TrancheRevenuDecimal.taux))) + | LimiteTrancheDecimal.Infini _ -> + (((decimal_of_money + ressources_menage_arrondies_) -& + (tranche_.TrancheRevenuDecimal.bas)) + *& + (tranche_.TrancheRevenuDecimal.taux))))) + (decimal_of_string "0.") + tranches_revenus_d832_26_multipliees_) +& + (decimal_of_money montant_forfaitaire_d832_26_)) /& + (decimal_of_string "12."))))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=4120; start_column=14; end_line=4120; end_column=21; + law_headings=["Article D832-26"; + "Sous-Section 2 : Conditions d'octroi de l'aide personnalisée au logement aux personnes résidant dans un logement-foyer"; + "Section 3 : Logements-foyers"; + "Chapitre II : Modalités de liquidation et de versement de l'aide personnalisée au logement"; + "Titre III : Aide personnalisée au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + money_of_decimal + (((Array.fold_left + (fun (acc_: decimal) (tranche_: _) -> + acc_ +& + ( if + ((decimal_of_money ressources_menage_arrondies_) + <=& (tranche_.TrancheRevenuDecimal.bas)) then + (decimal_of_string "0.") else + (match (tranche_.TrancheRevenuDecimal.haut) + with + | LimiteTrancheDecimal.Revenu tranche_haut_ -> + ( if + ((decimal_of_money + ressources_menage_arrondies_) >=& + tranche_haut_) then + ((tranche_haut_ -& + (tranche_.TrancheRevenuDecimal.bas)) + *& (tranche_.TrancheRevenuDecimal.taux)) + else + (((decimal_of_money + ressources_menage_arrondies_) -& + (tranche_.TrancheRevenuDecimal.bas)) + *& (tranche_.TrancheRevenuDecimal.taux))) + | LimiteTrancheDecimal.Infini _ -> + (((decimal_of_money + ressources_menage_arrondies_) -& + (tranche_.TrancheRevenuDecimal.bas)) *& + (tranche_.TrancheRevenuDecimal.taux))))) + (decimal_of_string "0.") + tranches_revenus_d832_26_multipliees_) +& + ((decimal_of_money montant_forfaitaire_d832_26_) *& + n_nombre_parts_d832_25_)) /& (decimal_of_string "12.")))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=622; start_column=10; end_line=622; end_column=17; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + {CalculEquivalenceLoyerMinimaleOut.montant_out = montant_} + +let calcul_nombre_part_logement_foyer (calcul_nombre_part_logement_foyer_in: CalculNombrePartLogementFoyerIn.t) : CalculNombrePartLogementFoyerOut.t = + let condition_2_du_832_25_: bool = calcul_nombre_part_logement_foyer_in.CalculNombrePartLogementFoyerIn.condition_2_du_832_25_in in + let nombre_personnes_a_charge_: integer = calcul_nombre_part_logement_foyer_in.CalculNombrePartLogementFoyerIn.nombre_personnes_a_charge_in in + let situation_familiale_calcul_apl_: SituationFamilialeCalculAPL.t = calcul_nombre_part_logement_foyer_in.CalculNombrePartLogementFoyerIn.situation_familiale_calcul_apl_in in + let n_nombre_parts_d832_25_: decimal = (log_variable_definition + ["CalculNombrePartLogementFoyer"; "n_nombre_parts_d832_25"] + (embed_decimal) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=629; start_column=10; end_line=629; end_column=32; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=629; start_column=10; + end_line=629; end_column=32; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=4072; start_column=5; + end_line=4072; end_column=26; + law_headings=["Article D832-25"; + "Sous-Section 2 : Conditions d'octroi de l'aide personnalisée au logement aux personnes résidant dans un logement-foyer"; + "Section 3 : Logements-foyers"; + "Chapitre II : Modalités de liquidation et de versement de l'aide personnalisée au logement"; + "Titre III : Aide personnalisée au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + condition_2_du_832_25_)) + (fun (_: _) -> + if + (nombre_personnes_a_charge_ = (integer_of_string "0")) + then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (decimal_of_string "1.2") + | SituationFamilialeCalculAPL.Couple _ -> + (decimal_of_string "1.5")) else + ( if + (nombre_personnes_a_charge_ = (integer_of_string + "1")) then (decimal_of_string "2.5") else + ( if + (nombre_personnes_a_charge_ = (integer_of_string + "2")) then (decimal_of_string "3.") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "3")) then + (decimal_of_string "3.7") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "4")) then + (decimal_of_string "4.3") else + ((decimal_of_string "4.3") +& + ((decimal_of_string "0.5") *& + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "4")))))))))))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=3985; start_column=14; end_line=3985; end_column=36; + law_headings=["Article D832-25"; + "Sous-Section 2 : Conditions d'octroi de l'aide personnalisée au logement aux personnes résidant dans un logement-foyer"; + "Section 3 : Logements-foyers"; + "Chapitre II : Modalités de liquidation et de versement de l'aide personnalisée au logement"; + "Titre III : Aide personnalisée au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + if (nombre_personnes_a_charge_ = (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (decimal_of_string "1.4") + | SituationFamilialeCalculAPL.Couple _ -> + (decimal_of_string "1.8")) else + ( if (nombre_personnes_a_charge_ = (integer_of_string "1")) + then (decimal_of_string "2.5") else + ( if (nombre_personnes_a_charge_ = (integer_of_string "2")) + then (decimal_of_string "3.") else + ( if + (nombre_personnes_a_charge_ = (integer_of_string "3")) + then (decimal_of_string "3.7") else + ( if + (nombre_personnes_a_charge_ = (integer_of_string + "4")) then (decimal_of_string "4.3") else + ((decimal_of_string "4.3") +& + ((decimal_of_string "0.5") *& + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "4"))))))))))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=629; start_column=10; end_line=629; end_column=32; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + {CalculNombrePartLogementFoyerOut.n_nombre_parts_d832_25_out = + n_nombre_parts_d832_25_} + +let calcul_nombre_parts_accession_propriete (calcul_nombre_parts_accession_propriete_in: CalculNombrePartsAccessionProprieteIn.t) : CalculNombrePartsAccessionProprieteOut.t = + let nombre_personnes_a_charge_: integer = calcul_nombre_parts_accession_propriete_in.CalculNombrePartsAccessionProprieteIn.nombre_personnes_a_charge_in in + let situation_familiale_calcul_apl_: SituationFamilialeCalculAPL.t = calcul_nombre_parts_accession_propriete_in.CalculNombrePartsAccessionProprieteIn.situation_familiale_calcul_apl_in in + let n_nombre_parts_d832_11_: decimal = (log_variable_definition + ["CalculNombrePartsAccessionPropriété"; "n_nombre_parts_d832_11"] + (embed_decimal) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=684; start_column=10; end_line=684; end_column=32; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=3331; start_column=14; end_line=3331; end_column=36; + law_headings=["Article D832-11"; + "Section 2 : Accession à la propriété"; + "Chapitre II : Modalités de liquidation et de versement de l'aide personnalisée au logement"; + "Titre III : Aide personnalisée au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + if (nombre_personnes_a_charge_ = (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (decimal_of_string "1.4") + | SituationFamilialeCalculAPL.Couple _ -> + (decimal_of_string "1.8")) else + ( if (nombre_personnes_a_charge_ = (integer_of_string "1")) + then (decimal_of_string "2.5") else + ( if (nombre_personnes_a_charge_ = (integer_of_string "2")) + then (decimal_of_string "3.") else + ( if + (nombre_personnes_a_charge_ = (integer_of_string "3")) + then (decimal_of_string "3.7") else + ( if + (nombre_personnes_a_charge_ = (integer_of_string + "4")) then (decimal_of_string "4.3") else + ((decimal_of_string "4.3") +& + ((decimal_of_string "0.5") *& + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "4"))))))))))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=684; start_column=10; end_line=684; end_column=32; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + {CalculNombrePartsAccessionProprieteOut.n_nombre_parts_d832_11_out = + n_nombre_parts_d832_11_} + +let ouverture_droits_retraite (ouverture_droits_retraite_in: OuvertureDroitsRetraiteIn.t) : OuvertureDroitsRetraiteOut.t = + let date_naissance_assure_: date = ouverture_droits_retraite_in.OuvertureDroitsRetraiteIn.date_naissance_assure_in in + let age_ouverture_droit_: duration = (log_variable_definition + ["OuvertureDroitsRetraite"; "âge_ouverture_droit"] (embed_duration) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1033; start_column=10; end_line=1033; end_column=29; + law_headings=["Date d'ouverture des droits à la retraite"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1033; start_column=10; + end_line=1033; end_column=29; + law_headings=["Date d'ouverture des droits à la retraite"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_sécurité_sociale.catala_fr"; + start_line=119; start_column=5; + end_line=119; end_column=43; + law_headings=["Article L161-17-2"; + "Paragraphe 1 : Information et simplification des démarches des assurés."; + "Sous-section 4 : Assurance vieillesse"; + "Section 1 : Bénéficiaires"; + "Chapitre 1er : Dispositions relatives aux prestations"; + "Titre VI : Dispositions relatives aux prestations et aux soins - Contrôle médical - Tutelle aux prestations sociales"; + "Titre III: Titre III : Dispositions communes relatives au financement"; + "Partie législative"; + "Code de la sécurité sociale"]} + (date_naissance_assure_ >=@ + (date_of_numbers (1955) (1) (1))))) + (fun (_: _) -> duration_of_numbers (62) (0) (0))); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1033; start_column=10; + end_line=1033; end_column=29; + law_headings=["Date d'ouverture des droits à la retraite"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_sécurité_sociale.catala_fr"; + start_line=256; start_column=5; + end_line=256; end_column=42; + law_headings=["Article D161-2-1-9"; + "Paragraphe 2 : Ouverture du droit et liquidation."; + "Sous-section 4 : Assurance vieillesse"; + "Section 1 : Bénéficiaires"; + "Chapitre 1er : Dispositions relatives aux prestations"; + "Titre VI : Dispositions relatives aux prestations et aux soins - Contrôle médical - Tutelle aux prestations sociales"; + "Livre I : Généralités - Dispositions communes à tout ou partie des régimes de base"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"]} + (date_naissance_assure_ <@ + (date_of_numbers (1951) (7) (1))))) + (fun (_: _) -> duration_of_numbers (60) (0) (0))); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1033; start_column=10; + end_line=1033; end_column=29; + law_headings=["Date d'ouverture des droits à la retraite"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_sécurité_sociale.catala_fr"; + start_line=266; start_column=5; + end_line=267; end_column=43; + law_headings=["Article D161-2-1-9"; + "Paragraphe 2 : Ouverture du droit et liquidation."; + "Sous-section 4 : Assurance vieillesse"; + "Section 1 : Bénéficiaires"; + "Chapitre 1er : Dispositions relatives aux prestations"; + "Titre VI : Dispositions relatives aux prestations et aux soins - Contrôle médical - Tutelle aux prestations sociales"; + "Livre I : Généralités - Dispositions communes à tout ou partie des régimes de base"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"]} + ((date_naissance_assure_ >=@ + (date_of_numbers (1951) (7) (1))) && + (date_naissance_assure_ <=@ + (date_of_numbers (1951) (12) (31)))))) + (fun (_: _) -> + (duration_of_numbers (60) (0) (0)) +^ + (duration_of_numbers (0) (4) (0)))); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1033; start_column=10; + end_line=1033; end_column=29; + law_headings=["Date d'ouverture des droits à la retraite"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_sécurité_sociale.catala_fr"; + start_line=276; start_column=5; + end_line=276; end_column=48; + law_headings=["Article D161-2-1-9"; + "Paragraphe 2 : Ouverture du droit et liquidation."; + "Sous-section 4 : Assurance vieillesse"; + "Section 1 : Bénéficiaires"; + "Chapitre 1er : Dispositions relatives aux prestations"; + "Titre VI : Dispositions relatives aux prestations et aux soins - Contrôle médical - Tutelle aux prestations sociales"; + "Livre I : Généralités - Dispositions communes à tout ou partie des régimes de base"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"]} + ((year_of_date date_naissance_assure_) = + (integer_of_string "1952")))) + (fun (_: _) -> + (duration_of_numbers (60) (0) (0)) +^ + (duration_of_numbers (0) (9) (0)))); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1033; start_column=10; + end_line=1033; end_column=29; + law_headings=["Date d'ouverture des droits à la retraite"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_sécurité_sociale.catala_fr"; + start_line=285; start_column=5; + end_line=285; end_column=48; + law_headings=["Article D161-2-1-9"; + "Paragraphe 2 : Ouverture du droit et liquidation."; + "Sous-section 4 : Assurance vieillesse"; + "Section 1 : Bénéficiaires"; + "Chapitre 1er : Dispositions relatives aux prestations"; + "Titre VI : Dispositions relatives aux prestations et aux soins - Contrôle médical - Tutelle aux prestations sociales"; + "Livre I : Généralités - Dispositions communes à tout ou partie des régimes de base"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"]} + ((year_of_date date_naissance_assure_) = + (integer_of_string "1953")))) + (fun (_: _) -> + (duration_of_numbers (61) (0) (0)) +^ + (duration_of_numbers (0) (2) (0)))); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1033; start_column=10; + end_line=1033; end_column=29; + law_headings=["Date d'ouverture des droits à la retraite"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_sécurité_sociale.catala_fr"; + start_line=294; start_column=5; + end_line=294; end_column=48; + law_headings=["Article D161-2-1-9"; + "Paragraphe 2 : Ouverture du droit et liquidation."; + "Sous-section 4 : Assurance vieillesse"; + "Section 1 : Bénéficiaires"; + "Chapitre 1er : Dispositions relatives aux prestations"; + "Titre VI : Dispositions relatives aux prestations et aux soins - Contrôle médical - Tutelle aux prestations sociales"; + "Livre I : Généralités - Dispositions communes à tout ou partie des régimes de base"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"]} + ((year_of_date date_naissance_assure_) = + (integer_of_string "1954")))) + (fun (_: _) -> + (duration_of_numbers (61) (0) (0)) +^ + (duration_of_numbers (0) (7) (0))))|]) + (fun (_: _) -> false) (fun (_: _) -> raise EmptyError)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1033; start_column=10; end_line=1033; end_column=29; + law_headings=["Date d'ouverture des droits à la retraite"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})))) in + {OuvertureDroitsRetraiteOut.age_ouverture_droit_out = age_ouverture_droit_} + +let impaye_depense_logement (impaye_depense_logement_in: ImpayeDepenseLogementIn.t) : ImpayeDepenseLogementOut.t = + let mode_occupation_: ModeOccupation.t = impaye_depense_logement_in.ImpayeDepenseLogementIn.mode_occupation_in in + let aide_versee_: VersementA.t = impaye_depense_logement_in.ImpayeDepenseLogementIn.aide_versee_in in + let montant_apl_: money = impaye_depense_logement_in.ImpayeDepenseLogementIn.montant_apl_in in + let montant_charges_: money = impaye_depense_logement_in.ImpayeDepenseLogementIn.montant_charges_in in + let depense_logement_: DepenseLogement.t = impaye_depense_logement_in.ImpayeDepenseLogementIn.depense_logement_in in + let montant_dette_: money = impaye_depense_logement_in.ImpayeDepenseLogementIn.montant_dette_in in + let mode_occupation_impaye_: ModeOccupationImpaye.t = (log_variable_definition + ["ImpayéDépenseLogement"; "mode_occupation_impayé"] + (embed_mode_occupation_impaye) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1049; start_column=11; end_line=1049; end_column=33; + law_headings=["Quantification des impayés de dépense de logement"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=2410; start_column=14; end_line=2410; end_column=36; + law_headings=["Article R824-3"; + "Section 1 : Seuils de constitution d'un impayé"; + "Chapitre IV : Impayés de dépenses de logement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + match mode_occupation_ + with + | ModeOccupation.Locataire _ -> + (ModeOccupationImpaye.ImpayeLoyer ()) + | ModeOccupation.ResidentLogementFoyer _ -> + (ModeOccupationImpaye.ImpayePret ()) + | ModeOccupation.AccessionProprieteLocalUsageExclusifHabitation _ -> + (ModeOccupationImpaye.ImpayePret ()) + | ModeOccupation.SousLocataire _ -> + (ModeOccupationImpaye.ImpayeLoyer ()) + | ModeOccupation.LocationAccession _ -> + (ModeOccupationImpaye.ImpayeLoyer ()))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1049; start_column=11; end_line=1049; end_column=33; + law_headings=["Quantification des impayés de dépense de logement"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})))) in + let depense_logement_brute_: DepenseLogement.t = (log_variable_definition + ["ImpayéDépenseLogement"; "dépense_logement_brute"] + (embed_depense_logement) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1050; start_column=11; end_line=1050; end_column=33; + law_headings=["Quantification des impayés de dépense de logement"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1050; start_column=11; + end_line=1050; end_column=33; + law_headings=["Quantification des impayés de dépense de logement"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1050; start_column=11; + end_line=1050; end_column=33; + law_headings=["Quantification des impayés de dépense de logement"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=2378; start_column=14; + end_line=2378; end_column=36; + law_headings=["Article R824-2"; + "Section 1 : Seuils de constitution d'un impayé"; + "Chapitre IV : Impayés de dépenses de logement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + (match mode_occupation_impaye_ + with + | ModeOccupationImpaye.ImpayeLoyer _ -> false + | ModeOccupationImpaye.ImpayePret _ -> true))) + (fun (_: _) -> depense_logement_))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=2282; start_column=14; + end_line=2282; end_column=36; + law_headings=["Article R824-1"; + "Section 1 : Seuils de constitution d'un impayé"; + "Chapitre IV : Impayés de dépenses de logement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + (match mode_occupation_impaye_ + with + | ModeOccupationImpaye.ImpayeLoyer _ -> true + | ModeOccupationImpaye.ImpayePret _ -> false))) + (fun (_: _) -> depense_logement_))|]) (fun (_: _) -> false) + (fun (_: _) -> raise EmptyError)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1050; start_column=11; end_line=1050; end_column=33; + law_headings=["Quantification des impayés de dépense de logement"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})))) in + let depense_logement_nette_: DepenseLogement.t = (log_variable_definition + ["ImpayéDépenseLogement"; "dépense_logement_nette"] + (embed_depense_logement) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1051; start_column=11; end_line=1051; end_column=33; + law_headings=["Quantification des impayés de dépense de logement"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1051; start_column=11; + end_line=1051; end_column=33; + law_headings=["Quantification des impayés de dépense de logement"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=2291; start_column=14; + end_line=2291; end_column=36; + law_headings=["Article R824-1"; + "Section 1 : Seuils de constitution d'un impayé"; + "Chapitre IV : Impayés de dépenses de logement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + (match mode_occupation_impaye_ + with + | ModeOccupationImpaye.ImpayeLoyer _ -> true + | ModeOccupationImpaye.ImpayePret _ -> false))) + (fun (_: _) -> + match depense_logement_brute_ + with + | DepenseLogement.TotalAnnuelEcheances total_ -> + (DepenseLogement.TotalAnnuelEcheances total_) + | DepenseLogement.Mensualite mensualite_ -> + (DepenseLogement.Mensualite mensualite_) + | DepenseLogement.Loyer montant_loyer_ -> + (DepenseLogement.Loyer + (montant_loyer_ -$ montant_apl_)))); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1051; start_column=11; + end_line=1051; end_column=33; + law_headings=["Quantification des impayés de dépense de logement"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=2387; start_column=14; + end_line=2387; end_column=36; + law_headings=["Article R824-2"; + "Section 1 : Seuils de constitution d'un impayé"; + "Chapitre IV : Impayés de dépenses de logement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + (match mode_occupation_impaye_ + with + | ModeOccupationImpaye.ImpayeLoyer _ -> false + | ModeOccupationImpaye.ImpayePret _ -> true))) + (fun (_: _) -> + match depense_logement_ + with + | DepenseLogement.TotalAnnuelEcheances total_echeances_ -> + (DepenseLogement.TotalAnnuelEcheances + (total_echeances_ -$ + (montant_apl_ *$ (decimal_of_string "12.")))) + | DepenseLogement.Mensualite mensualite_ -> + (DepenseLogement.Mensualite + (mensualite_ -$ montant_apl_)) + | DepenseLogement.Loyer loyer_ -> + (DepenseLogement.Loyer loyer_)))|]) + (fun (_: _) -> false) (fun (_: _) -> raise EmptyError)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1051; start_column=11; end_line=1051; end_column=33; + law_headings=["Quantification des impayés de dépense de logement"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})))) in + let seuil_impaye_depense_de_logement_: money = (log_variable_definition + ["ImpayéDépenseLogement"; "seuil_impayé_dépense_de_logement"] + (embed_money) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1048; start_column=11; end_line=1048; end_column=43; + law_headings=["Quantification des impayés de dépense de logement"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1048; start_column=11; + end_line=1048; end_column=43; + law_headings=["Quantification des impayés de dépense de logement"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1048; start_column=11; + end_line=1048; end_column=43; + law_headings=["Quantification des impayés de dépense de logement"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=2268; start_column=20; + end_line=2268; end_column=51; + law_headings=["Article R824-1"; + "Section 1 : Seuils de constitution d'un impayé"; + "Chapitre IV : Impayés de dépenses de logement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + ((match mode_occupation_impaye_ + with + | ModeOccupationImpaye.ImpayeLoyer _ -> true + | ModeOccupationImpaye.ImpayePret _ -> false) + && + (match aide_versee_ + with + | VersementA.Bailleur _ -> true + | VersementA.Beneficiaire _ -> false + | VersementA.EtablissementHabilite _ -> false)))) + (fun (_: _) -> + match depense_logement_nette_ + with + | DepenseLogement.TotalAnnuelEcheances _ -> + (money_of_cents_string "0") + | DepenseLogement.Mensualite _ -> + (money_of_cents_string "0") + | DepenseLogement.Loyer loyer_net_ -> + ((loyer_net_ +$ montant_charges_) *$ + (decimal_of_string "2."))))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=2252; start_column=20; + end_line=2252; end_column=55; + law_headings=["Article R824-1"; + "Section 1 : Seuils de constitution d'un impayé"; + "Chapitre IV : Impayés de dépenses de logement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + ((match mode_occupation_impaye_ + with + | ModeOccupationImpaye.ImpayeLoyer _ -> true + | ModeOccupationImpaye.ImpayePret _ -> false) && + (match aide_versee_ + with + | VersementA.Bailleur _ -> false + | VersementA.Beneficiaire _ -> true + | VersementA.EtablissementHabilite _ -> false)))) + (fun (_: _) -> + match depense_logement_brute_ + with + | DepenseLogement.TotalAnnuelEcheances _ -> + (money_of_cents_string "0") + | DepenseLogement.Mensualite _ -> (money_of_cents_string + "0") + | DepenseLogement.Loyer loyer_brut_ -> + ((loyer_brut_ +$ montant_charges_) *$ + (decimal_of_string "2.")))); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1048; start_column=11; + end_line=1048; end_column=43; + law_headings=["Quantification des impayés de dépense de logement"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1048; start_column=11; + end_line=1048; end_column=43; + law_headings=["Quantification des impayés de dépense de logement"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=2362; start_column=7; + end_line=2362; end_column=51; + law_headings=["Article R824-2"; + "Section 1 : Seuils de constitution d'un impayé"; + "Chapitre IV : Impayés de dépenses de logement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + ((match mode_occupation_impaye_ + with + | ModeOccupationImpaye.ImpayeLoyer _ -> false + | ModeOccupationImpaye.ImpayePret _ -> true) && + (match aide_versee_ + with + | VersementA.Bailleur _ -> false + | VersementA.Beneficiaire _ -> false + | VersementA.EtablissementHabilite _ -> true)))) + (fun (_: _) -> + match depense_logement_nette_ + with + | DepenseLogement.TotalAnnuelEcheances echeance_pret_nette_ -> + (echeance_pret_nette_ *$ + ((decimal_of_string "1.") /& + (decimal_of_string "6."))) + | DepenseLogement.Mensualite mensualite_nette_ -> + (mensualite_nette_ *$ + (decimal_of_string "2.")) + | DepenseLogement.Loyer _ -> + (money_of_cents_string "0")))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=2334; start_column=7; + end_line=2334; end_column=42; + law_headings=["Article R824-2"; + "Section 1 : Seuils de constitution d'un impayé"; + "Chapitre IV : Impayés de dépenses de logement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + ((match mode_occupation_impaye_ + with + | ModeOccupationImpaye.ImpayeLoyer _ -> false + | ModeOccupationImpaye.ImpayePret _ -> true) && + (match aide_versee_ + with + | VersementA.Bailleur _ -> false + | VersementA.Beneficiaire _ -> true + | VersementA.EtablissementHabilite _ -> false)))) + (fun (_: _) -> + match depense_logement_brute_ + with + | DepenseLogement.TotalAnnuelEcheances echeance_pret_brute_ -> + (echeance_pret_brute_ *$ + ((decimal_of_string "1.") /& + (decimal_of_string "6."))) + | DepenseLogement.Mensualite mensualite_brute_ -> + (mensualite_brute_ *$ (decimal_of_string "2.")) + | DepenseLogement.Loyer _ -> (money_of_cents_string "0")))|]) + (fun (_: _) -> false) (fun (_: _) -> raise EmptyError)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1048; start_column=11; end_line=1048; end_column=43; + law_headings=["Quantification des impayés de dépense de logement"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})))) in + let montant_impaye_: money = (log_variable_definition + ["ImpayéDépenseLogement"; "montant_impayé"] (embed_money) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1053; start_column=10; end_line=1053; end_column=24; + law_headings=["Quantification des impayés de dépense de logement"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1053; start_column=10; + end_line=1053; end_column=24; + law_headings=["Quantification des impayés de dépense de logement"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1053; start_column=10; + end_line=1053; end_column=24; + law_headings=["Quantification des impayés de dépense de logement"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=2310; start_column=14; + end_line=2310; end_column=28; + law_headings=["Article R824-2"; + "Section 1 : Seuils de constitution d'un impayé"; + "Chapitre IV : Impayés de dépenses de logement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + (match mode_occupation_impaye_ + with + | ModeOccupationImpaye.ImpayeLoyer _ -> false + | ModeOccupationImpaye.ImpayePret _ -> true))) + (fun (_: _) -> + if + (montant_dette_ >=$ + seuil_impaye_depense_de_logement_) then + montant_dette_ else (money_of_cents_string "0")))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=2247; start_column=14; + end_line=2247; end_column=28; + law_headings=["Article R824-1"; + "Section 1 : Seuils de constitution d'un impayé"; + "Chapitre IV : Impayés de dépenses de logement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + (match mode_occupation_impaye_ + with + | ModeOccupationImpaye.ImpayeLoyer _ -> true + | ModeOccupationImpaye.ImpayePret _ -> false))) + (fun (_: _) -> + if + (montant_dette_ >=$ seuil_impaye_depense_de_logement_) + then montant_dette_ else (money_of_cents_string "0")))|]) + (fun (_: _) -> false) (fun (_: _) -> raise EmptyError)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1053; start_column=10; end_line=1053; end_column=24; + law_headings=["Quantification des impayés de dépense de logement"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})))) in + {ImpayeDepenseLogementOut.montant_impaye_out = montant_impaye_} + +let base_mensuelle_allocations_familiales (base_mensuelle_allocations_familiales_in: BaseMensuelleAllocationsFamilialesIn.t) : BaseMensuelleAllocationsFamilialesOut.t = + let date_courante_: date = base_mensuelle_allocations_familiales_in.BaseMensuelleAllocationsFamilialesIn.date_courante_in in + let montant_: money = (log_variable_definition + ["BaseMensuelleAllocationsFamiliales"; "montant"] (embed_money) ( + try + (handle_default + {filename = "examples/aides_logement/../base_mensuelle_allocations_familiales/bmaf.catala_fr"; + start_line=6; start_column=10; end_line=6; end_column=17; + law_headings=["Montant de la base mensuelle des allocations familiales"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/../base_mensuelle_allocations_familiales/bmaf.catala_fr"; + start_line=6; start_column=10; end_line=6; end_column=17; + law_headings=["Montant de la base mensuelle des allocations familiales"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/../base_mensuelle_allocations_familiales/bmaf.catala_fr"; + start_line=28; start_column=5; + end_line=29; end_column=34; + law_headings=["Instruction ministérielle N°DSS/SD2B/2019/65 du 25 mars 2019 relative à la revalorisation au 1er avril 2019 des prestations familiales servies en métropole"; + "Montant de la base mensuelle des allocations familiales"]} + ((date_courante_ >=@ (date_of_numbers (2019) (4) (1))) && + (date_courante_ <@ (date_of_numbers (2020) (4) (1)))))) + (fun (_: _) -> money_of_cents_string "41316")); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/../base_mensuelle_allocations_familiales/bmaf.catala_fr"; + start_line=6; start_column=10; end_line=6; end_column=17; + law_headings=["Montant de la base mensuelle des allocations familiales"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/../base_mensuelle_allocations_familiales/bmaf.catala_fr"; + start_line=48; start_column=5; + end_line=49; end_column=34; + law_headings=["Instruction interministérielle no DSS/SD2B/2020/33 du 18 février 2020 relative à la revalorisation au 1er avril 2020 des prestations familiales servies en métropole, en Guadeloupe, en Guyane, en Martinique, à La Réunion, à Saint-Barthélemy, à Saint-Martin et dans le département de Mayotte"; + "Montant de la base mensuelle des allocations familiales"]} + ((date_courante_ >=@ (date_of_numbers (2020) (4) (1))) && + (date_courante_ <@ (date_of_numbers (2021) (4) (1)))))) + (fun (_: _) -> money_of_cents_string "41440")); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/../base_mensuelle_allocations_familiales/bmaf.catala_fr"; + start_line=6; start_column=10; end_line=6; end_column=17; + law_headings=["Montant de la base mensuelle des allocations familiales"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/../base_mensuelle_allocations_familiales/bmaf.catala_fr"; + start_line=64; start_column=5; + end_line=65; end_column=34; + law_headings=["Instruction interministérielle n°DSS/2B/2021/65 du 19 mars 2021 relative à la revalorisation au 1er avril 2021 des prestations familiales servies en métropole, en Guadeloupe, en Guyane, en Martinique, à la Réunion, à Saint-Barthélemy, à Saint-Martin et dans le département de Mayotte"; + "Montant de la base mensuelle des allocations familiales"]} + ((date_courante_ >=@ (date_of_numbers (2021) (4) (1))) && + (date_courante_ <@ (date_of_numbers (2022) (4) (1)))))) + (fun (_: _) -> money_of_cents_string "41481")); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/../base_mensuelle_allocations_familiales/bmaf.catala_fr"; + start_line=6; start_column=10; end_line=6; end_column=17; + law_headings=["Montant de la base mensuelle des allocations familiales"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/../base_mensuelle_allocations_familiales/bmaf.catala_fr"; + start_line=82; start_column=5; + end_line=83; end_column=34; + law_headings=["Instruction interministérielle n°DSS/2B/2022/82 du 28 mars 2022 relative à la revalorisation au 1er avril 2022 des prestations familiales servies en métropole, en Guadeloupe, en Guyane, en Martinique, à la Réunion, à Saint-Barthélemy, à Saint-Martin et dans le département de Mayotte"; + "Montant de la base mensuelle des allocations familiales"]} + ((date_courante_ >=@ (date_of_numbers (2022) (4) (1))) && + (date_courante_ <@ (date_of_numbers (2023) (4) (1)))))) + (fun (_: _) -> money_of_cents_string "42228"))|]) + (fun (_: _) -> false) (fun (_: _) -> raise EmptyError)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/../base_mensuelle_allocations_familiales/bmaf.catala_fr"; + start_line=6; start_column=10; end_line=6; end_column=17; + law_headings=["Montant de la base mensuelle des allocations familiales"]})))) in + {BaseMensuelleAllocationsFamilialesOut.montant_out = montant_} + +let smic (smic_in: SmicIn.t) : SmicOut.t = + let date_courante_: date = smic_in.SmicIn.date_courante_in in + let residence_: Collectivite.t = smic_in.SmicIn.residence_in in + let brut_horaire_: money = (log_variable_definition + ["Smic"; "brut_horaire"] (embed_money) ( + try + (handle_default + {filename = "examples/aides_logement/../prestations_familiales/../smic/smic.catala_fr"; + start_line=11; start_column=10; end_line=11; end_column=22; + law_headings=["Prologue"; + "Montant du salaire minimum de croissance"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/../prestations_familiales/../smic/smic.catala_fr"; + start_line=11; start_column=10; + end_line=11; end_column=22; + law_headings=["Prologue"; + "Montant du salaire minimum de croissance"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/../prestations_familiales/../smic/smic.catala_fr"; + start_line=29; start_column=5; + end_line=38; end_column=6; + law_headings=["Article 1"; + "Décret n° 2018-1173 du 19 décembre 2018 portant relèvement du salaire minimum de croissance"; + "Montant du salaire minimum de croissance"]} + ((date_courante_ >=@ (date_of_numbers (2019) (1) (1))) && + ((date_courante_ <=@ + (date_of_numbers (2019) (12) (31))) && + ((residence_ = (Collectivite.Metropole ())) || + ((residence_ = (Collectivite.Guadeloupe ())) || + ((residence_ = (Collectivite.Guyane ())) || + ((residence_ = + (Collectivite.Martinique ())) || + ((residence_ = + (Collectivite.LaReunion ())) || + ((residence_ = + (Collectivite.SaintBarthelemy ())) + || + ((residence_ = + (Collectivite.SaintMartin ())) + || + (residence_ = + (Collectivite.SaintPierreEtMiquelon + ()))))))))))))) + (fun (_: _) -> money_of_cents_string "1003")); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/../prestations_familiales/../smic/smic.catala_fr"; + start_line=11; start_column=10; + end_line=11; end_column=22; + law_headings=["Prologue"; + "Montant du salaire minimum de croissance"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/../prestations_familiales/../smic/smic.catala_fr"; + start_line=47; start_column=5; + end_line=49; end_column=6; + law_headings=["Article 1"; + "Décret n° 2018-1173 du 19 décembre 2018 portant relèvement du salaire minimum de croissance"; + "Montant du salaire minimum de croissance"]} + ((date_courante_ >=@ (date_of_numbers (2019) (1) (1))) && + ((date_courante_ <=@ + (date_of_numbers (2019) (12) (31))) && + (residence_ = (Collectivite.Mayotte ())))))) + (fun (_: _) -> money_of_cents_string "757")); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/../prestations_familiales/../smic/smic.catala_fr"; + start_line=11; start_column=10; + end_line=11; end_column=22; + law_headings=["Prologue"; + "Montant du salaire minimum de croissance"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/../prestations_familiales/../smic/smic.catala_fr"; + start_line=68; start_column=5; + end_line=77; end_column=6; + law_headings=["Article 1"; + "Décret n° 2019-1387 du 18 décembre 2019 portant relèvement du salaire minimum de croissance"; + "Montant du salaire minimum de croissance"]} + ((date_courante_ >=@ (date_of_numbers (2020) (1) (1))) && + ((date_courante_ <=@ + (date_of_numbers (2020) (12) (31))) && + ((residence_ = (Collectivite.Metropole ())) || + ((residence_ = (Collectivite.Guadeloupe ())) || + ((residence_ = (Collectivite.Guyane ())) || + ((residence_ = + (Collectivite.Martinique ())) || + ((residence_ = + (Collectivite.LaReunion ())) || + ((residence_ = + (Collectivite.SaintBarthelemy ())) + || + ((residence_ = + (Collectivite.SaintMartin ())) + || + (residence_ = + (Collectivite.SaintPierreEtMiquelon + ()))))))))))))) + (fun (_: _) -> money_of_cents_string "1015")); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/../prestations_familiales/../smic/smic.catala_fr"; + start_line=11; start_column=10; + end_line=11; end_column=22; + law_headings=["Prologue"; + "Montant du salaire minimum de croissance"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/../prestations_familiales/../smic/smic.catala_fr"; + start_line=86; start_column=5; + end_line=88; end_column=6; + law_headings=["Article 1"; + "Décret n° 2019-1387 du 18 décembre 2019 portant relèvement du salaire minimum de croissance"; + "Montant du salaire minimum de croissance"]} + ((date_courante_ >=@ (date_of_numbers (2020) (1) (1))) && + ((date_courante_ <=@ + (date_of_numbers (2020) (12) (31))) && + (residence_ = (Collectivite.Mayotte ())))))) + (fun (_: _) -> money_of_cents_string "766")); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/../prestations_familiales/../smic/smic.catala_fr"; + start_line=11; start_column=10; + end_line=11; end_column=22; + law_headings=["Prologue"; + "Montant du salaire minimum de croissance"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/../prestations_familiales/../smic/smic.catala_fr"; + start_line=107; start_column=5; + end_line=116; end_column=6; + law_headings=["Article 1"; + "Décret n° 2020-1598 du 16 décembre 2020 portant relèvement du salaire minimum de croissance"; + "Montant du salaire minimum de croissance"]} + ((date_courante_ >=@ (date_of_numbers (2021) (1) (1))) && + ((date_courante_ <=@ + (date_of_numbers (2021) (12) (31))) && + ((residence_ = (Collectivite.Metropole ())) || + ((residence_ = (Collectivite.Guadeloupe ())) || + ((residence_ = (Collectivite.Guyane ())) || + ((residence_ = + (Collectivite.Martinique ())) || + ((residence_ = + (Collectivite.LaReunion ())) || + ((residence_ = + (Collectivite.SaintBarthelemy ())) + || + ((residence_ = + (Collectivite.SaintMartin ())) + || + (residence_ = + (Collectivite.SaintPierreEtMiquelon + ()))))))))))))) + (fun (_: _) -> money_of_cents_string "1025")); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/../prestations_familiales/../smic/smic.catala_fr"; + start_line=11; start_column=10; + end_line=11; end_column=22; + law_headings=["Prologue"; + "Montant du salaire minimum de croissance"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/../prestations_familiales/../smic/smic.catala_fr"; + start_line=125; start_column=5; + end_line=127; end_column=6; + law_headings=["Article 1"; + "Décret n° 2020-1598 du 16 décembre 2020 portant relèvement du salaire minimum de croissance"; + "Montant du salaire minimum de croissance"]} + ((date_courante_ >=@ (date_of_numbers (2021) (1) (1))) && + ((date_courante_ <=@ + (date_of_numbers (2021) (12) (31))) && + (residence_ = (Collectivite.Mayotte ())))))) + (fun (_: _) -> money_of_cents_string "774")); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/../prestations_familiales/../smic/smic.catala_fr"; + start_line=11; start_column=10; + end_line=11; end_column=22; + law_headings=["Prologue"; + "Montant du salaire minimum de croissance"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/../prestations_familiales/../smic/smic.catala_fr"; + start_line=146; start_column=5; + end_line=155; end_column=6; + law_headings=["Article 1"; + "Décret n° 2021-1741 du 22 décembre 2021 portant relèvement du salaire minimum de croissance"; + "Montant du salaire minimum de croissance"]} + ((date_courante_ >=@ (date_of_numbers (2022) (1) (1))) && + ((date_courante_ <=@ (date_of_numbers (2022) (4) (30))) + && + ((residence_ = (Collectivite.Metropole ())) || + ((residence_ = (Collectivite.Guadeloupe ())) || + ((residence_ = (Collectivite.Guyane ())) || + ((residence_ = + (Collectivite.Martinique ())) || + ((residence_ = + (Collectivite.LaReunion ())) || + ((residence_ = + (Collectivite.SaintBarthelemy ())) + || + ((residence_ = + (Collectivite.SaintMartin ())) + || + (residence_ = + (Collectivite.SaintPierreEtMiquelon + ()))))))))))))) + (fun (_: _) -> money_of_cents_string "1057")); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/../prestations_familiales/../smic/smic.catala_fr"; + start_line=11; start_column=10; + end_line=11; end_column=22; + law_headings=["Prologue"; + "Montant du salaire minimum de croissance"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/../prestations_familiales/../smic/smic.catala_fr"; + start_line=165; start_column=5; + end_line=167; end_column=6; + law_headings=["Article 1"; + "Décret n° 2021-1741 du 22 décembre 2021 portant relèvement du salaire minimum de croissance"; + "Montant du salaire minimum de croissance"]} + ((date_courante_ >=@ (date_of_numbers (2022) (1) (1))) && + ((date_courante_ <=@ (date_of_numbers (2022) (4) (30))) + && (residence_ = (Collectivite.Mayotte ())))))) + (fun (_: _) -> money_of_cents_string "798")); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/../prestations_familiales/../smic/smic.catala_fr"; + start_line=11; start_column=10; + end_line=11; end_column=22; + law_headings=["Prologue"; + "Montant du salaire minimum de croissance"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/../prestations_familiales/../smic/smic.catala_fr"; + start_line=186; start_column=5; + end_line=195; end_column=6; + law_headings=["Article 2"; + "Arrêté du 19 avril 2022 relatif au relèvement du salaire minimum de croissance"; + "Montant du salaire minimum de croissance"]} + ((date_courante_ >=@ (date_of_numbers (2022) (5) (1))) && + ((date_courante_ <=@ + (date_of_numbers (2022) (12) (31))) && + ((residence_ = (Collectivite.Metropole ())) || + ((residence_ = (Collectivite.Guadeloupe ())) || + ((residence_ = (Collectivite.Guyane ())) || + ((residence_ = + (Collectivite.Martinique ())) || + ((residence_ = + (Collectivite.LaReunion ())) || + ((residence_ = + (Collectivite.SaintBarthelemy ())) + || + ((residence_ = + (Collectivite.SaintMartin ())) + || + (residence_ = + (Collectivite.SaintPierreEtMiquelon + ()))))))))))))) + (fun (_: _) -> money_of_cents_string "1085")); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/../prestations_familiales/../smic/smic.catala_fr"; + start_line=11; start_column=10; + end_line=11; end_column=22; + law_headings=["Prologue"; + "Montant du salaire minimum de croissance"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/../prestations_familiales/../smic/smic.catala_fr"; + start_line=204; start_column=5; + end_line=206; end_column=6; + law_headings=["Article 2"; + "Arrêté du 19 avril 2022 relatif au relèvement du salaire minimum de croissance"; + "Montant du salaire minimum de croissance"]} + ((date_courante_ >=@ (date_of_numbers (2022) (5) (1))) && + ((date_courante_ <=@ + (date_of_numbers (2022) (12) (31))) && + (residence_ = (Collectivite.Mayotte ())))))) + (fun (_: _) -> money_of_cents_string "819"))|]) + (fun (_: _) -> false) (fun (_: _) -> raise EmptyError)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/../prestations_familiales/../smic/smic.catala_fr"; + start_line=11; start_column=10; end_line=11; end_column=22; + law_headings=["Prologue"; "Montant du salaire minimum de croissance"]})))) in + {SmicOut.brut_horaire_out = brut_horaire_} + +let calcul_aide_personnalisee_logement_locatif (calcul_aide_personnalisee_logement_locatif_in: CalculAidePersonnaliseeLogementLocatifIn.t) : CalculAidePersonnaliseeLogementLocatifOut.t = + let loyer_principal_: money = calcul_aide_personnalisee_logement_locatif_in.CalculAidePersonnaliseeLogementLocatifIn.loyer_principal_in in + let ressources_menage_arrondies_: money = calcul_aide_personnalisee_logement_locatif_in.CalculAidePersonnaliseeLogementLocatifIn.ressources_menage_arrondies_in in + let beneficiaire_aide_adulte_ou_enfant_handicapes_: bool = calcul_aide_personnalisee_logement_locatif_in.CalculAidePersonnaliseeLogementLocatifIn.beneficiaire_aide_adulte_ou_enfant_handicapes_in in + let date_courante_: date = calcul_aide_personnalisee_logement_locatif_in.CalculAidePersonnaliseeLogementLocatifIn.date_courante_in in + let nombre_personnes_a_charge_: integer = calcul_aide_personnalisee_logement_locatif_in.CalculAidePersonnaliseeLogementLocatifIn.nombre_personnes_a_charge_in in + let situation_familiale_calcul_apl_: SituationFamilialeCalculAPL.t = calcul_aide_personnalisee_logement_locatif_in.CalculAidePersonnaliseeLogementLocatifIn.situation_familiale_calcul_apl_in in + let zone_: ZoneDHabitation.t = calcul_aide_personnalisee_logement_locatif_in.CalculAidePersonnaliseeLogementLocatifIn.zone_in in + let logement_est_chambre_: bool = calcul_aide_personnalisee_logement_locatif_in.CalculAidePersonnaliseeLogementLocatifIn.logement_est_chambre_in in + let agees_ou_handicap_adultes_hebergees_onereux_particuliers_: bool = calcul_aide_personnalisee_logement_locatif_in.CalculAidePersonnaliseeLogementLocatifIn.agees_ou_handicap_adultes_hebergees_onereux_particuliers_in in + let type_aide_: TypeAidesPersonnelleLogement.t = calcul_aide_personnalisee_logement_locatif_in.CalculAidePersonnaliseeLogementLocatifIn.type_aide_in in + let colocation_: bool = calcul_aide_personnalisee_logement_locatif_in.CalculAidePersonnaliseeLogementLocatifIn.colocation_in in + let reduction_loyer_solidarite_: money = calcul_aide_personnalisee_logement_locatif_in.CalculAidePersonnaliseeLogementLocatifIn.reduction_loyer_solidarite_in in + let fraction_l832_3_: decimal = (log_variable_definition + ["CalculAidePersonnaliséeLogementLocatif"; "fraction_l832_3"] + (embed_decimal) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=579; start_column=11; end_line=579; end_column=26; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1975; start_column=14; end_line=1975; end_column=29; + law_headings=["Article D823-16"; + "Sous-section 2 : Calcul de l'aide en secteur locatif"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) (fun (_: _) -> decimal_of_string "0.98")) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=579; start_column=11; end_line=579; end_column=26; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let montant_forfaitaire_d823_16_: money = (log_variable_definition + ["CalculAidePersonnaliséeLogementLocatif"; + "montant_forfaitaire_d823_16"] (embed_money) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=582; start_column=11; end_line=582; end_column=38; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=268; start_column=14; end_line=268; end_column=41; + law_headings=["Article 11"; + "Chapitre III : Calcul des aides personnelles au logement en secteur locatif"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + true)) (fun (_: _) -> money_of_cents_string "500")) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=582; start_column=11; end_line=582; end_column=38; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let contributions_sociales_dot_date_courante_: date = + try ((log_variable_definition + ["CalculAidePersonnaliséeLogementLocatif"; + "contributions_sociales.date_courante"] (embed_date) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=593; start_column=3; end_line=593; end_column=25; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=606; start_column=14; end_line=606; end_column=50; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> date_courante_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=544; start_column=10; end_line=544; end_column=23; + law_headings=["Calcul des contributions sociales s'appliquant aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let result_: ContributionsSocialesAidesPersonnelleLogementOut.t = (log_end_call + ["CalculAidePersonnaliséeLogementLocatif"; "contributions_sociales"; + "ContributionsSocialesAidesPersonnelleLogement"] ((log_begin_call + ["CalculAidePersonnaliséeLogementLocatif"; "contributions_sociales"; + "ContributionsSocialesAidesPersonnelleLogement"] + contributions_sociales_aides_personnelle_logement) + {ContributionsSocialesAidesPersonnelleLogementIn.date_courante_in = + contributions_sociales_dot_date_courante_})) in + let contributions_sociales_dot_montant_: money -> money = result_.ContributionsSocialesAidesPersonnelleLogementOut.montant_out in + let taux_composition_familiale_: decimal = (log_variable_definition + ["CalculAidePersonnaliséeLogementLocatif"; "taux_composition_familiale"] + (embed_decimal) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=590; start_column=10; end_line=590; end_column=36; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=590; start_column=10; + end_line=590; end_column=36; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=590; start_column=10; + end_line=590; end_column=36; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/archives.catala_fr"; + start_line=222; start_column=14; + end_line=222; end_column=40; + law_headings=["Article 14"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"; + "Articles valables du 1er octobre 2020 au 1er octobre 2021"; + "Archives législatives et réglementaires"]} + ((date_courante_ >=@ + (date_of_numbers (2020) (10) (1))) && + (date_courante_ <@ + (date_of_numbers (2021) (10) (1)))))) + (fun (_: _) -> + if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (decimal_of_string "0.0283") + | SituationFamilialeCalculAPL.Couple _ -> + (decimal_of_string "0.0315")) else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "1")) then + (decimal_of_string "0.027") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "2")) then + (decimal_of_string "0.0238") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "3")) then + (decimal_of_string "0.0201") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "4")) then + (decimal_of_string "0.0185") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "5")) then + (decimal_of_string "0.0179") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "6")) + then + (decimal_of_string "0.0173") + else + ((decimal_of_string "0.0173") + -& + ((decimal_of_string "0.0006") + *& + (decimal_of_integer + (nombre_personnes_a_charge_ + -! + (integer_of_string + "6")))))))))))))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=357; start_column=14; + end_line=357; end_column=40; + law_headings=["Article 14"; + "Chapitre III : Calcul des aides personnelles au logement en secteur locatif"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + (date_courante_ >=@ (date_of_numbers (2021) (10) (1))))) + (fun (_: _) -> + if + (nombre_personnes_a_charge_ = (integer_of_string "0")) + then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (decimal_of_string "0.0283") + | SituationFamilialeCalculAPL.Couple _ -> + (decimal_of_string "0.0315")) else + ( if + (nombre_personnes_a_charge_ = (integer_of_string + "1")) then (decimal_of_string "0.027") else + ( if + (nombre_personnes_a_charge_ = (integer_of_string + "2")) then (decimal_of_string "0.0238") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "3")) then + (decimal_of_string "0.0201") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "4")) then + (decimal_of_string "0.0185") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "5")) then + (decimal_of_string "0.0179") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "6")) then + (decimal_of_string "0.0173") else + ((decimal_of_string "0.0173") -& + ((decimal_of_string "0.0006") *& + (decimal_of_integer + (nombre_personnes_a_charge_ + -! (integer_of_string + "6")))))))))))))|]) + (fun (_: _) -> false) (fun (_: _) -> raise EmptyError)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=590; start_column=10; end_line=590; end_column=36; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let abattement_forfaitaire_d823_17_: money = (log_variable_definition + ["CalculAidePersonnaliséeLogementLocatif"; + "abattement_forfaitaire_d823_17"] (embed_money) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=584; start_column=11; end_line=584; end_column=41; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=584; start_column=11; + end_line=584; end_column=41; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=474; start_column=14; + end_line=474; end_column=44; + law_headings=["Article 15"; + "Chapitre III : Calcul des aides personnelles au logement en secteur locatif"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + (date_courante_ >=@ (date_of_numbers (2022) (1) (1))))) + (fun (_: _) -> + if + (nombre_personnes_a_charge_ = (integer_of_string "0")) + then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "468300") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "670900")) else + ( if + (nombre_personnes_a_charge_ = (integer_of_string + "1")) then (money_of_cents_string "800200") else + ( if + (nombre_personnes_a_charge_ = (integer_of_string + "2")) then (money_of_cents_string "819200") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "3")) then + (money_of_cents_string "849500") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "4")) then + (money_of_cents_string "881100") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "5")) then + (money_of_cents_string "912400") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "6")) then + (money_of_cents_string "943900") else + ((money_of_cents_string "943900") +$ + ((money_of_cents_string "31100") + *$ + (decimal_of_integer + (nombre_personnes_a_charge_ + -! (integer_of_string + "6"))))))))))))); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=584; start_column=11; + end_line=584; end_column=41; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/archives.catala_fr"; + start_line=576; start_column=14; + end_line=576; end_column=44; + law_headings=["Article 15"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"; + "Articles valables du 1er janvier 2020 au 1er janvier 2022"; + "Archives législatives et réglementaires"]} + ((date_courante_ <@ (date_of_numbers (2022) (1) (1))) && + (date_courante_ >=@ (date_of_numbers (2020) (1) (1)))))) + (fun (_: _) -> + if + (nombre_personnes_a_charge_ = (integer_of_string "0")) + then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "458800") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "657200")) else + ( if + (nombre_personnes_a_charge_ = (integer_of_string + "1")) then (money_of_cents_string "783900") else + ( if + (nombre_personnes_a_charge_ = (integer_of_string + "2")) then (money_of_cents_string "801500") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "3")) then + (money_of_cents_string "832200") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "4")) then + (money_of_cents_string "863100") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "5")) then + (money_of_cents_string "893800") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "6")) then + (money_of_cents_string "924600") else + ((money_of_cents_string "924600") +$ + ((money_of_cents_string "30500") + *$ + (decimal_of_integer + (nombre_personnes_a_charge_ + -! (integer_of_string + "6")))))))))))))|]) + (fun (_: _) -> false) (fun (_: _) -> raise EmptyError)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=584; start_column=11; end_line=584; end_column=41; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let loyer_reference_: money = (log_variable_definition + ["CalculAidePersonnaliséeLogementLocatif"; "loyer_référence"] + (embed_money) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=578; start_column=11; end_line=578; end_column=26; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=578; start_column=11; + end_line=578; end_column=26; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=440; start_column=14; + end_line=440; end_column=29; + law_headings=["Article 14"; + "Chapitre III : Calcul des aides personnelles au logement en secteur locatif"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + (date_courante_ >=@ (date_of_numbers (2021) (10) (1))))) + (fun (_: _) -> + if + (nombre_personnes_a_charge_ = (integer_of_string "0")) + then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "25978") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "31797")) else + ((money_of_cents_string "35780") +$ + ((money_of_cents_string "5208") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1"))))))); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=578; start_column=11; + end_line=578; end_column=26; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/archives.catala_fr"; + start_line=305; start_column=14; + end_line=305; end_column=29; + law_headings=["Article 14"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"; + "Articles valables du 1er octobre 2020 au 1er octobre 2021"; + "Archives législatives et réglementaires"]} + ((date_courante_ >=@ (date_of_numbers (2020) (10) (1))) + && + (date_courante_ <@ (date_of_numbers (2021) (10) (1)))))) + (fun (_: _) -> + if + (nombre_personnes_a_charge_ = (integer_of_string "0")) + then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "25869") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "31664")) else + ((money_of_cents_string "35630") +$ + ((money_of_cents_string "5186") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))))|]) + (fun (_: _) -> false) (fun (_: _) -> raise EmptyError)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=578; start_column=11; end_line=578; end_column=26; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let montant_minimal_aide_d823_16_: money = (log_variable_definition + ["CalculAidePersonnaliséeLogementLocatif"; + "montant_minimal_aide_d823_16"] (embed_money) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=583; start_column=11; end_line=583; end_column=39; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=280; start_column=14; end_line=280; end_column=42; + law_headings=["Article 12"; + "Chapitre III : Calcul des aides personnelles au logement en secteur locatif"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + true)) + (fun (_: _) -> + match type_aide_ + with + | TypeAidesPersonnelleLogement.AidePersonnaliseeLogement _ -> + (money_of_cents_string "0") + | TypeAidesPersonnelleLogement.AllocationLogementFamiliale _ -> + (money_of_cents_string "1000") + | TypeAidesPersonnelleLogement.AllocationLogementSociale _ -> + (money_of_cents_string "1000"))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=583; start_column=11; end_line=583; end_column=39; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let plafond_loyer_d823_16_2_: money = (log_variable_definition + ["CalculAidePersonnaliséeLogementLocatif"; "plafond_loyer_d823_16_2"] + (embed_money) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=588; start_column=10; end_line=588; end_column=33; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=588; start_column=10; + end_line=588; end_column=33; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=588; start_column=10; + end_line=588; end_column=33; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=534; start_column=5; + end_line=535; end_column=34; + law_headings=["Article 16"; + "Chapitre III : Calcul des aides personnelles au logement en secteur locatif"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + (((date_courante_ >=@ + (date_of_numbers (2021) (10) (1))) && + colocation_) && + ((match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + true + | SituationFamilialeCalculAPL.Couple _ -> + false) && + (nombre_personnes_a_charge_ = + (integer_of_string "0")))))) + (fun (_: _) -> + match zone_ + with + | ZoneDHabitation.Zone1 _ -> + (money_of_cents_string "22355") + | ZoneDHabitation.Zone2 _ -> + (money_of_cents_string "19484") + | ZoneDHabitation.Zone3 _ -> + (money_of_cents_string "18261"))); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=588; start_column=10; + end_line=588; end_column=33; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=543; start_column=5; + end_line=544; end_column=34; + law_headings=["Article 16"; + "Chapitre III : Calcul des aides personnelles au logement en secteur locatif"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + (((date_courante_ >=@ + (date_of_numbers (2021) (10) (1))) && + colocation_) && + ((match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + false + | SituationFamilialeCalculAPL.Couple _ -> + true) && + (nombre_personnes_a_charge_ = + (integer_of_string "0")))))) + (fun (_: _) -> + match zone_ + with + | ZoneDHabitation.Zone1 _ -> + (money_of_cents_string "26962") + | ZoneDHabitation.Zone2 _ -> + (money_of_cents_string "23848") + | ZoneDHabitation.Zone3 _ -> + (money_of_cents_string "22136"))); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=588; start_column=10; + end_line=588; end_column=33; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=552; start_column=5; + end_line=552; end_column=35; + law_headings=["Article 16"; + "Chapitre III : Calcul des aides personnelles au logement en secteur locatif"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + (((date_courante_ >=@ + (date_of_numbers (2021) (10) (1))) && + colocation_) && + (nombre_personnes_a_charge_ >=! + (integer_of_string "1"))))) + (fun (_: _) -> + match zone_ + with + | ZoneDHabitation.Zone1 _ -> + ((money_of_cents_string "30473") +$ + ((money_of_cents_string "4421") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1"))))) + | ZoneDHabitation.Zone2 _ -> + ((money_of_cents_string "26835") +$ + ((money_of_cents_string "3906") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1"))))) + | ZoneDHabitation.Zone3 _ -> + ((money_of_cents_string "24821") +$ + ((money_of_cents_string "3557") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1"))))))); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=588; start_column=10; + end_line=588; end_column=33; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/archives.catala_fr"; + start_line=350; start_column=5; + end_line=351; end_column=34; + law_headings=["Article 16"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"; + "Articles valables du 1er octobre 2020 au 1er octobre 2021"; + "Archives législatives et réglementaires"]} + (((date_courante_ <@ + (date_of_numbers (2021) (10) (1))) && + ((date_courante_ >=@ + (date_of_numbers (2020) (10) (1))) && + colocation_)) && + ((match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + true + | SituationFamilialeCalculAPL.Couple _ -> + false) && + (nombre_personnes_a_charge_ = + (integer_of_string "0")))))) + (fun (_: _) -> + match zone_ + with + | ZoneDHabitation.Zone1 _ -> + (money_of_cents_string "22262") + | ZoneDHabitation.Zone2 _ -> + (money_of_cents_string "19402") + | ZoneDHabitation.Zone3 _ -> + (money_of_cents_string "18185"))); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=588; start_column=10; + end_line=588; end_column=33; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/archives.catala_fr"; + start_line=359; start_column=5; + end_line=360; end_column=34; + law_headings=["Article 16"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"; + "Articles valables du 1er octobre 2020 au 1er octobre 2021"; + "Archives législatives et réglementaires"]} + (((date_courante_ <@ + (date_of_numbers (2021) (10) (1))) && + ((date_courante_ >=@ + (date_of_numbers (2020) (10) (1))) && + colocation_)) && + ((match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + false + | SituationFamilialeCalculAPL.Couple _ -> + true) && + (nombre_personnes_a_charge_ = + (integer_of_string "0")))))) + (fun (_: _) -> + match zone_ + with + | ZoneDHabitation.Zone1 _ -> + (money_of_cents_string "26849") + | ZoneDHabitation.Zone2 _ -> + (money_of_cents_string "23748") + | ZoneDHabitation.Zone3 _ -> + (money_of_cents_string "22044"))); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=588; start_column=10; + end_line=588; end_column=33; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/archives.catala_fr"; + start_line=368; start_column=5; + end_line=368; end_column=35; + law_headings=["Article 16"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"; + "Articles valables du 1er octobre 2020 au 1er octobre 2021"; + "Archives législatives et réglementaires"]} + (((date_courante_ <@ + (date_of_numbers (2021) (10) (1))) && + ((date_courante_ >=@ + (date_of_numbers (2020) (10) (1))) && + colocation_)) && + (nombre_personnes_a_charge_ >=! + (integer_of_string "1"))))) + (fun (_: _) -> + match zone_ + with + | ZoneDHabitation.Zone1 _ -> + ((money_of_cents_string "30345") +$ + ((money_of_cents_string "4403") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1"))))) + | ZoneDHabitation.Zone2 _ -> + ((money_of_cents_string "26723") +$ + ((money_of_cents_string "3890") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1"))))) + | ZoneDHabitation.Zone3 _ -> + ((money_of_cents_string "24717") +$ + ((money_of_cents_string "3542") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))))|]) + (fun (_: _) -> false) (fun (_: _) -> raise EmptyError)); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=588; start_column=10; + end_line=588; end_column=33; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=588; start_column=10; + end_line=588; end_column=33; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=588; start_column=10; + end_line=588; end_column=33; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=189; start_column=5; + end_line=189; end_column=61; + law_headings=["Article 8"; + "Chapitre III : Calcul des aides personnelles au logement en secteur locatif"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + (((date_courante_ >=@ + (date_of_numbers (2021) (10) (1))) + && logement_est_chambre_) && + agees_ou_handicap_adultes_hebergees_onereux_particuliers_))) + (fun (_: _) -> + match zone_ + with + | ZoneDHabitation.Zone1 _ -> + (money_of_cents_string "22355") + | ZoneDHabitation.Zone2 _ -> + (money_of_cents_string "19484") + | ZoneDHabitation.Zone3 _ -> + (money_of_cents_string "18261"))); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=588; start_column=10; + end_line=588; end_column=33; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/archives.catala_fr"; + start_line=128; start_column=5; + end_line=128; end_column=61; + law_headings=["Article 8"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"; + "Articles valables du 1er octobre 2020 au 1er octobre 2021"; + "Archives législatives et réglementaires"]} + (((date_courante_ <@ + (date_of_numbers (2021) (10) (1))) + && + ((date_courante_ >=@ + (date_of_numbers (2020) (10) (1))) + && logement_est_chambre_)) && + agees_ou_handicap_adultes_hebergees_onereux_particuliers_))) + (fun (_: _) -> + match zone_ + with + | ZoneDHabitation.Zone1 _ -> + (money_of_cents_string "22262") + | ZoneDHabitation.Zone2 _ -> + (money_of_cents_string "19402") + | ZoneDHabitation.Zone3 _ -> + (money_of_cents_string "18185")))|]) + (fun (_: _) -> false) + (fun (_: _) -> raise EmptyError))|]) + (fun (_: _) -> true) + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=588; start_column=10; + end_line=588; end_column=33; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=588; start_column=10; + end_line=588; end_column=33; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=182; start_column=14; + end_line=182; end_column=37; + law_headings=["Article 8"; + "Chapitre III : Calcul des aides personnelles au logement en secteur locatif"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + ((date_courante_ >=@ + (date_of_numbers (2021) (10) (1))) && + logement_est_chambre_))) + (fun (_: _) -> + match zone_ + with + | ZoneDHabitation.Zone1 _ -> + (money_of_cents_string "26826") + | ZoneDHabitation.Zone2 _ -> + (money_of_cents_string "23380") + | ZoneDHabitation.Zone3 _ -> + (money_of_cents_string "21913"))); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=588; start_column=10; + end_line=588; end_column=33; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/archives.catala_fr"; + start_line=121; start_column=14; + end_line=121; end_column=37; + law_headings=["Article 8"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"; + "Articles valables du 1er octobre 2020 au 1er octobre 2021"; + "Archives législatives et réglementaires"]} + ((date_courante_ <@ + (date_of_numbers (2021) (10) (1))) && + ((date_courante_ >=@ + (date_of_numbers (2020) (10) (1))) && + logement_est_chambre_)))) + (fun (_: _) -> + match zone_ + with + | ZoneDHabitation.Zone1 _ -> + (money_of_cents_string "26714") + | ZoneDHabitation.Zone2 _ -> + (money_of_cents_string "23282") + | ZoneDHabitation.Zone3 _ -> + (money_of_cents_string "21821")))|]) + (fun (_: _) -> false) (fun (_: _) -> raise EmptyError)))|]) + (fun (_: _) -> true) + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=588; start_column=10; end_line=588; end_column=33; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=588; start_column=10; + end_line=588; end_column=33; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=97; start_column=5; + end_line=98; end_column=34; + law_headings=["Article 7"; + "Chapitre III : Calcul des aides personnelles au logement en secteur locatif"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + ((date_courante_ >=@ + (date_of_numbers (2021) (10) (1))) && + ((match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + true + | SituationFamilialeCalculAPL.Couple _ -> false) + && + (nombre_personnes_a_charge_ = + (integer_of_string "0")))))) + (fun (_: _) -> + match zone_ + with + | ZoneDHabitation.Zone1 _ -> (money_of_cents_string + "29807") + | ZoneDHabitation.Zone2 _ -> (money_of_cents_string + "25978") + | ZoneDHabitation.Zone3 _ -> (money_of_cents_string + "24348"))); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=588; start_column=10; + end_line=588; end_column=33; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=107; start_column=5; + end_line=108; end_column=34; + law_headings=["Article 7"; + "Chapitre III : Calcul des aides personnelles au logement en secteur locatif"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + ((date_courante_ >=@ + (date_of_numbers (2021) (10) (1))) && + ((match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + false + | SituationFamilialeCalculAPL.Couple _ -> true) + && + (nombre_personnes_a_charge_ = + (integer_of_string "0")))))) + (fun (_: _) -> + match zone_ + with + | ZoneDHabitation.Zone1 _ -> (money_of_cents_string + "35949") + | ZoneDHabitation.Zone2 _ -> (money_of_cents_string + "31797") + | ZoneDHabitation.Zone3 _ -> (money_of_cents_string + "29515"))); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=588; start_column=10; + end_line=588; end_column=33; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=117; start_column=5; + end_line=117; end_column=35; + law_headings=["Article 7"; + "Chapitre III : Calcul des aides personnelles au logement en secteur locatif"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + ((date_courante_ >=@ + (date_of_numbers (2021) (10) (1))) && + (nombre_personnes_a_charge_ >=! + (integer_of_string "1"))))) + (fun (_: _) -> + match zone_ + with + | ZoneDHabitation.Zone1 _ -> + ((money_of_cents_string "40630") +$ + ((money_of_cents_string "5895") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1"))))) + | ZoneDHabitation.Zone2 _ -> + ((money_of_cents_string "35780") +$ + ((money_of_cents_string "5208") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1"))))) + | ZoneDHabitation.Zone3 _ -> + ((money_of_cents_string "33094") +$ + ((money_of_cents_string "4743") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1"))))))); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=588; start_column=10; + end_line=588; end_column=33; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/archives.catala_fr"; + start_line=37; start_column=5; + end_line=38; end_column=34; + law_headings=["Article 7"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"; + "Articles valables du 1er octobre 2020 au 1er octobre 2021"; + "Archives législatives et réglementaires"]} + (((date_courante_ <@ + (date_of_numbers (2021) (10) (1))) && + (date_courante_ >=@ + (date_of_numbers (2020) (10) (1)))) && + ((match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + true + | SituationFamilialeCalculAPL.Couple _ -> false) + && + (nombre_personnes_a_charge_ = + (integer_of_string "0")))))) + (fun (_: _) -> + match zone_ + with + | ZoneDHabitation.Zone1 _ -> (money_of_cents_string + "29682") + | ZoneDHabitation.Zone2 _ -> (money_of_cents_string + "25859") + | ZoneDHabitation.Zone3 _ -> (money_of_cents_string + "24246"))); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=588; start_column=10; + end_line=588; end_column=33; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/archives.catala_fr"; + start_line=47; start_column=5; + end_line=48; end_column=34; + law_headings=["Article 7"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"; + "Articles valables du 1er octobre 2020 au 1er octobre 2021"; + "Archives législatives et réglementaires"]} + (((date_courante_ <@ + (date_of_numbers (2021) (10) (1))) && + (date_courante_ >=@ + (date_of_numbers (2020) (10) (1)))) && + ((match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + false + | SituationFamilialeCalculAPL.Couple _ -> true) + && + (nombre_personnes_a_charge_ = + (integer_of_string "0")))))) + (fun (_: _) -> + match zone_ + with + | ZoneDHabitation.Zone1 _ -> (money_of_cents_string + "35799") + | ZoneDHabitation.Zone2 _ -> (money_of_cents_string + "31664") + | ZoneDHabitation.Zone3 _ -> (money_of_cents_string + "29392"))); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=588; start_column=10; + end_line=588; end_column=33; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/archives.catala_fr"; + start_line=57; start_column=5; + end_line=57; end_column=35; + law_headings=["Article 7"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"; + "Articles valables du 1er octobre 2020 au 1er octobre 2021"; + "Archives législatives et réglementaires"]} + (((date_courante_ <@ + (date_of_numbers (2021) (10) (1))) && + (date_courante_ >=@ + (date_of_numbers (2020) (10) (1)))) && + (nombre_personnes_a_charge_ >=! + (integer_of_string "1"))))) + (fun (_: _) -> + match zone_ + with + | ZoneDHabitation.Zone1 _ -> + ((money_of_cents_string "40460") +$ + ((money_of_cents_string "5870") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1"))))) + | ZoneDHabitation.Zone2 _ -> + ((money_of_cents_string "35630") +$ + ((money_of_cents_string "5186") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1"))))) + | ZoneDHabitation.Zone3 _ -> + ((money_of_cents_string "32956") +$ + ((money_of_cents_string "4723") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))))|]) + (fun (_: _) -> false) (fun (_: _) -> raise EmptyError))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=588; start_column=10; end_line=588; end_column=33; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let montant_forfaitaire_charges_d823_16_: money = (log_variable_definition + ["CalculAidePersonnaliséeLogementLocatif"; + "montant_forfaitaire_charges_d823_16"] (embed_money) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=587; start_column=10; end_line=587; end_column=45; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=587; start_column=10; + end_line=587; end_column=45; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=587; start_column=10; + end_line=587; end_column=45; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=577; start_column=29; + end_line=577; end_column=64; + law_headings=["Article 16"; + "Chapitre III : Calcul des aides personnelles au logement en secteur locatif"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + ((date_courante_ >=@ + (date_of_numbers (2021) (10) (1))) && + colocation_))) + (fun (_: _) -> + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "2710") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "5422")) +$ + ((money_of_cents_string "1229") *$ + (decimal_of_integer + nombre_personnes_a_charge_)))); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=587; start_column=10; + end_line=587; end_column=45; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/archives.catala_fr"; + start_line=394; start_column=29; + end_line=394; end_column=64; + law_headings=["Article 16"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"; + "Articles valables du 1er octobre 2020 au 1er octobre 2021"; + "Archives législatives et réglementaires"]} + ((date_courante_ <@ + (date_of_numbers (2021) (10) (1))) && + ((date_courante_ >=@ + (date_of_numbers (2020) (10) (1))) && + colocation_)))) + (fun (_: _) -> + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "2699") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "5399")) +$ + ((money_of_cents_string "1224") *$ + (decimal_of_integer + nombre_personnes_a_charge_))))|]) + (fun (_: _) -> false) (fun (_: _) -> raise EmptyError))|]) + (fun (_: _) -> true) + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=587; start_column=10; end_line=587; end_column=45; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=587; start_column=10; + end_line=587; end_column=45; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=224; start_column=29; + end_line=224; end_column=64; + law_headings=["Article 9"; + "Chapitre III : Calcul des aides personnelles au logement en secteur locatif"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + (date_courante_ >=@ + (date_of_numbers (2021) (10) (1))))) + (fun (_: _) -> + (money_of_cents_string "5422") +$ + ((money_of_cents_string "1229") *$ + (decimal_of_integer nombre_personnes_a_charge_)))); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=587; start_column=10; + end_line=587; end_column=45; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/archives.catala_fr"; + start_line=163; start_column=29; + end_line=163; end_column=64; + law_headings=["Article 9"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"; + "Articles valables du 1er octobre 2020 au 1er octobre 2021"; + "Archives législatives et réglementaires"]} + ((date_courante_ <@ + (date_of_numbers (2021) (10) (1))) && + (date_courante_ >=@ + (date_of_numbers (2020) (10) (1)))))) + (fun (_: _) -> + (money_of_cents_string "5399") +$ + ((money_of_cents_string "1224") *$ + (decimal_of_integer nombre_personnes_a_charge_))))|]) + (fun (_: _) -> false) (fun (_: _) -> raise EmptyError))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=587; start_column=10; end_line=587; end_column=45; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let plafond_suppression_d823_16_: money = (log_variable_definition + ["CalculAidePersonnaliséeLogementLocatif"; + "plafond_suppression_d823_16"] (embed_money) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=581; start_column=11; end_line=581; end_column=38; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=253; start_column=14; end_line=253; end_column=41; + law_headings=["Article 10"; + "Chapitre III : Calcul des aides personnelles au logement en secteur locatif"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + true)) + (fun (_: _) -> + match zone_ + with + | ZoneDHabitation.Zone1 _ -> + (plafond_loyer_d823_16_2_ *$ (decimal_of_string "4.")) + | ZoneDHabitation.Zone2 _ -> + (plafond_loyer_d823_16_2_ *$ (decimal_of_string "3.1")) + | ZoneDHabitation.Zone3 _ -> + (plafond_loyer_d823_16_2_ *$ (decimal_of_string "3.1")))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=581; start_column=11; end_line=581; end_column=38; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let plafond_degressivite_d823_16_: money = (log_variable_definition + ["CalculAidePersonnaliséeLogementLocatif"; + "plafond_dégressivité_d823_16"] (embed_money) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=580; start_column=11; end_line=580; end_column=39; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=247; start_column=14; end_line=247; end_column=42; + law_headings=["Article 10"; + "Chapitre III : Calcul des aides personnelles au logement en secteur locatif"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + true)) + (fun (_: _) -> + match zone_ + with + | ZoneDHabitation.Zone1 _ -> + (plafond_loyer_d823_16_2_ *$ (decimal_of_string "3.4")) + | ZoneDHabitation.Zone2 _ -> + (plafond_loyer_d823_16_2_ *$ (decimal_of_string "2.5")) + | ZoneDHabitation.Zone3 _ -> + (plafond_loyer_d823_16_2_ *$ (decimal_of_string "2.5")))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=580; start_column=11; end_line=580; end_column=39; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let loyer_eligible_: money = (log_variable_definition + ["CalculAidePersonnaliséeLogementLocatif"; "loyer_éligible"] + (embed_money) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=573; start_column=11; end_line=573; end_column=25; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1880; start_column=14; end_line=1880; end_column=28; + law_headings=["Article D823-16"; + "Sous-section 2 : Calcul de l'aide en secteur locatif"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + if (loyer_principal_ >$ plafond_loyer_d823_16_2_) then + plafond_loyer_d823_16_2_ else loyer_principal_)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=573; start_column=11; end_line=573; end_column=25; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let traitement_aide_finale_diminue_: money -> money = (log_variable_definition + ["CalculAidePersonnaliséeLogementLocatif"; + "traitement_aide_finale_diminué"] (unembeddable) ( + try + (fun (param_: money) -> + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=599; start_column=10; end_line=599; end_column=17; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=599; start_column=10; + end_line=599; end_column=17; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1926; start_column=5; + end_line=1926; end_column=50; + law_headings=["Article D823-16"; + "Sous-section 2 : Calcul de l'aide en secteur locatif"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + beneficiaire_aide_adulte_ou_enfant_handicapes_)) + (fun (_: _) -> param_))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1914; start_column=14; + end_line=1914; end_column=36; + law_headings=["Article D823-16"; + "Sous-section 2 : Calcul de l'aide en secteur locatif"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + if (loyer_principal_ >$ plafond_suppression_d823_16_) then + (money_of_cents_string "0") else + ( if (loyer_principal_ >$ plafond_degressivite_d823_16_) + then + (param_ -$ + (param_ *$ + ((loyer_principal_ -$ + plafond_degressivite_d823_16_) /$ + (plafond_suppression_d823_16_ -$ + plafond_degressivite_d823_16_)))) else + param_))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=599; start_column=10; end_line=599; end_column=17; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]}))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=599; start_column=10; end_line=599; end_column=17; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let participation_minimale_: money = (log_variable_definition + ["CalculAidePersonnaliséeLogementLocatif"; "participation_minimale"] + (embed_money) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=589; start_column=10; end_line=589; end_column=32; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=589; start_column=10; + end_line=589; end_column=32; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=296; start_column=14; + end_line=296; end_column=36; + law_headings=["Article 13"; + "Chapitre III : Calcul des aides personnelles au logement en secteur locatif"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + (date_courante_ >=@ (date_of_numbers (2021) (10) (1))))) + (fun (_: _) -> + if + (((loyer_eligible_ +$ + montant_forfaitaire_charges_d823_16_) *$ + (decimal_of_string "0.085")) >=$ + (money_of_cents_string "3539")) then + ((loyer_eligible_ +$ + montant_forfaitaire_charges_d823_16_) *$ + (decimal_of_string "0.085")) else + (money_of_cents_string "3539"))); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=589; start_column=10; + end_line=589; end_column=32; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/archives.catala_fr"; + start_line=177; start_column=14; + end_line=177; end_column=36; + law_headings=["Article 13"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"; + "Articles valables du 1er octobre 2020 au 1er octobre 2021"; + "Archives législatives et réglementaires"]} + ((date_courante_ <@ (date_of_numbers (2021) (10) (1))) && + (date_courante_ >=@ (date_of_numbers (2020) (10) (1)))))) + (fun (_: _) -> + if + (((loyer_eligible_ +$ + montant_forfaitaire_charges_d823_16_) *$ + (decimal_of_string "0.085")) >=$ + (money_of_cents_string "3524")) then + ((loyer_eligible_ +$ + montant_forfaitaire_charges_d823_16_) *$ + (decimal_of_string "0.085")) else + (money_of_cents_string "3524")))|]) + (fun (_: _) -> false) (fun (_: _) -> raise EmptyError)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=589; start_column=10; end_line=589; end_column=32; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let rapport_loyers_: decimal = (log_variable_definition + ["CalculAidePersonnaliséeLogementLocatif"; "rapport_loyers"] + (embed_decimal) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=577; start_column=11; end_line=577; end_column=25; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=577; start_column=11; + end_line=577; end_column=25; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=577; start_column=11; + end_line=577; end_column=25; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/archives.catala_fr"; + start_line=256; start_column=14; + end_line=256; end_column=28; + law_headings=["Article 14"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"; + "Articles valables du 1er octobre 2020 au 1er octobre 2021"; + "Archives législatives et réglementaires"]} + ((date_courante_ >=@ + (date_of_numbers (2020) (10) (1))) && + (date_courante_ <@ + (date_of_numbers (2021) (10) (1)))))) + (fun (_: _) -> + (decimal_round + ((loyer_eligible_ /$ loyer_reference_) *& + (decimal_of_string "100."))) /& + (decimal_of_string "100.")))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=390; start_column=14; + end_line=390; end_column=28; + law_headings=["Article 14"; + "Chapitre III : Calcul des aides personnelles au logement en secteur locatif"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + (date_courante_ >=@ (date_of_numbers (2021) (10) (1))))) + (fun (_: _) -> + (decimal_round + ((loyer_eligible_ /$ loyer_reference_) *& + (decimal_of_string "100."))) /& + (decimal_of_string "100.")))|]) (fun (_: _) -> false) + (fun (_: _) -> raise EmptyError)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=577; start_column=11; end_line=577; end_column=25; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let traitement_aide_finale_minoration_forfaitaire_: money -> money = (log_variable_definition + ["CalculAidePersonnaliséeLogementLocatif"; + "traitement_aide_finale_minoration_forfaitaire"] (unembeddable) ( + try + (fun (param_: money) -> + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=600; start_column=10; end_line=600; end_column=32; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1936; start_column=14; + end_line=1936; end_column=36; + law_headings=["Article D823-16"; + "Sous-section 2 : Calcul de l'aide en secteur locatif"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + if + ((((log_end_call + ["CalculAidePersonnaliséeLogementLocatif"; + "traitement_aide_finale_diminué"] + ((log_variable_definition + ["CalculAidePersonnaliséeLogementLocatif"; + "traitement_aide_finale_diminué"; "output"] + (embed_money) ((log_begin_call + ["CalculAidePersonnaliséeLogementLocatif"; + "traitement_aide_finale_diminué"] + traitement_aide_finale_diminue_) + ((log_variable_definition + ["CalculAidePersonnaliséeLogementLocatif"; + "traitement_aide_finale_diminué"; "input"] + (embed_money) param_))))))) -$ + montant_forfaitaire_d823_16_) >=$ + (money_of_cents_string "0")) then + (((log_end_call + ["CalculAidePersonnaliséeLogementLocatif"; + "traitement_aide_finale_diminué"] + ((log_variable_definition + ["CalculAidePersonnaliséeLogementLocatif"; + "traitement_aide_finale_diminué"; "output"] + (embed_money) ((log_begin_call + ["CalculAidePersonnaliséeLogementLocatif"; + "traitement_aide_finale_diminué"] + traitement_aide_finale_diminue_) + ((log_variable_definition + ["CalculAidePersonnaliséeLogementLocatif"; + "traitement_aide_finale_diminué"; "input"] + (embed_money) param_))))))) -$ + montant_forfaitaire_d823_16_) else + (money_of_cents_string "0"))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=600; start_column=10; end_line=600; end_column=32; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]}))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=600; start_column=10; end_line=600; end_column=32; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let taux_loyer_eligible_formule_: decimal = (log_variable_definition + ["CalculAidePersonnaliséeLogementLocatif"; + "taux_loyer_éligible_formule"] (embed_decimal) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=575; start_column=10; end_line=575; end_column=17; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=575; start_column=10; + end_line=575; end_column=17; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=575; start_column=10; + end_line=575; end_column=17; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/archives.catala_fr"; + start_line=280; start_column=14; + end_line=280; end_column=33; + law_headings=["Article 14"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"; + "Articles valables du 1er octobre 2020 au 1er octobre 2021"; + "Archives législatives et réglementaires"]} + ((date_courante_ >=@ + (date_of_numbers (2020) (10) (1))) && + (date_courante_ <@ + (date_of_numbers (2021) (10) (1)))))) + (fun (_: _) -> + if + (rapport_loyers_ <& (decimal_of_string "0.45")) + then (decimal_of_string "0.") else + ( if + ((rapport_loyers_ >=& + (decimal_of_string "0.45")) && + (rapport_loyers_ <& + (decimal_of_string "0.75"))) then + ((decimal_of_string "0.0045") *& + (rapport_loyers_ -& + (decimal_of_string "0.0045"))) else + ( if + (rapport_loyers_ >=& + (decimal_of_string "0.75")) then + (((decimal_of_string "0.0045") *& + (decimal_of_string "0.3")) +& + ((decimal_of_string "0.0068") *& + (rapport_loyers_ -& + (decimal_of_string "0.75")))) + else (decimal_of_string "0.")))))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=416; start_column=14; + end_line=416; end_column=33; + law_headings=["Article 14"; + "Chapitre III : Calcul des aides personnelles au logement en secteur locatif"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + (date_courante_ >=@ (date_of_numbers (2021) (10) (1))))) + (fun (_: _) -> + if (rapport_loyers_ <& (decimal_of_string "0.45")) then + (decimal_of_string "0.") else + ( if + ((rapport_loyers_ >=& (decimal_of_string "0.45")) && + (rapport_loyers_ <& (decimal_of_string "0.75"))) + then + ((decimal_of_string "0.0045") *& + (rapport_loyers_ -& (decimal_of_string "0.0045"))) + else + ( if + (rapport_loyers_ >=& (decimal_of_string "0.75")) + then + (((decimal_of_string "0.0045") *& + (decimal_of_string "0.3")) +& + ((decimal_of_string "0.0068") *& + (rapport_loyers_ -& + (decimal_of_string "0.75")))) else + (decimal_of_string "0.")))))|]) + (fun (_: _) -> false) (fun (_: _) -> raise EmptyError)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=575; start_column=10; end_line=575; end_column=17; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let traitement_aide_finale_contributions_sociales_arrondi_: money -> money = (log_variable_definition + ["CalculAidePersonnaliséeLogementLocatif"; + "traitement_aide_finale_contributions_sociales_arrondi"] (unembeddable) + ( + try + (fun (param_: money) -> + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=601; start_column=10; end_line=601; end_column=40; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1951; start_column=14; + end_line=1951; end_column=36; + law_headings=["Article D823-16"; + "Sous-section 2 : Calcul de l'aide en secteur locatif"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + if + (((money_round + ((((log_end_call + ["CalculAidePersonnaliséeLogementLocatif"; + "traitement_aide_finale_minoration_forfaitaire"] + ((log_variable_definition + ["CalculAidePersonnaliséeLogementLocatif"; + "traitement_aide_finale_minoration_forfaitaire"; + "output"] (embed_money) ((log_begin_call + ["CalculAidePersonnaliséeLogementLocatif"; + "traitement_aide_finale_minoration_forfaitaire"] + traitement_aide_finale_minoration_forfaitaire_) + ((log_variable_definition + ["CalculAidePersonnaliséeLogementLocatif"; + "traitement_aide_finale_minoration_forfaitaire"; + "input"] (embed_money) param_))))))) -$ + ((log_end_call + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"] ((log_variable_definition + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"; "output"] (embed_money) + ((log_begin_call + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"] contributions_sociales_dot_montant_) + ((log_variable_definition + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"; "input"] (embed_money) + ((log_end_call + ["CalculAidePersonnaliséeLogementLocatif"; + "traitement_aide_finale_minoration_forfaitaire"] + ((log_variable_definition + ["CalculAidePersonnaliséeLogementLocatif"; + "traitement_aide_finale_minoration_forfaitaire"; + "output"] (embed_money) ((log_begin_call + ["CalculAidePersonnaliséeLogementLocatif"; + "traitement_aide_finale_minoration_forfaitaire"] + traitement_aide_finale_minoration_forfaitaire_) + ((log_variable_definition + ["CalculAidePersonnaliséeLogementLocatif"; + "traitement_aide_finale_minoration_forfaitaire"; + "input"] (embed_money) param_))))))))))))))) -$ + (money_of_cents_string "50"))) +$ ((log_end_call + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"] ((log_variable_definition + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"; "output"] (embed_money) ((log_begin_call + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"] contributions_sociales_dot_montant_) + ((log_variable_definition + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"; "input"] (embed_money) ((log_end_call + ["CalculAidePersonnaliséeLogementLocatif"; + "traitement_aide_finale_minoration_forfaitaire"] + ((log_variable_definition + ["CalculAidePersonnaliséeLogementLocatif"; + "traitement_aide_finale_minoration_forfaitaire"; + "output"] (embed_money) ((log_begin_call + ["CalculAidePersonnaliséeLogementLocatif"; + "traitement_aide_finale_minoration_forfaitaire"] + traitement_aide_finale_minoration_forfaitaire_) + ((log_variable_definition + ["CalculAidePersonnaliséeLogementLocatif"; + "traitement_aide_finale_minoration_forfaitaire"; + "input"] (embed_money) param_))))))))))))))) >=$ + (money_of_cents_string "0")) then + ((money_round + ((((log_end_call + ["CalculAidePersonnaliséeLogementLocatif"; + "traitement_aide_finale_minoration_forfaitaire"] + ((log_variable_definition + ["CalculAidePersonnaliséeLogementLocatif"; + "traitement_aide_finale_minoration_forfaitaire"; + "output"] (embed_money) ((log_begin_call + ["CalculAidePersonnaliséeLogementLocatif"; + "traitement_aide_finale_minoration_forfaitaire"] + traitement_aide_finale_minoration_forfaitaire_) + ((log_variable_definition + ["CalculAidePersonnaliséeLogementLocatif"; + "traitement_aide_finale_minoration_forfaitaire"; + "input"] (embed_money) param_))))))) -$ + ((log_end_call + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"] ((log_variable_definition + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"; "output"] (embed_money) + ((log_begin_call + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"] contributions_sociales_dot_montant_) + ((log_variable_definition + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"; "input"] (embed_money) ((log_end_call + ["CalculAidePersonnaliséeLogementLocatif"; + "traitement_aide_finale_minoration_forfaitaire"] + ((log_variable_definition + ["CalculAidePersonnaliséeLogementLocatif"; + "traitement_aide_finale_minoration_forfaitaire"; + "output"] (embed_money) ((log_begin_call + ["CalculAidePersonnaliséeLogementLocatif"; + "traitement_aide_finale_minoration_forfaitaire"] + traitement_aide_finale_minoration_forfaitaire_) + ((log_variable_definition + ["CalculAidePersonnaliséeLogementLocatif"; + "traitement_aide_finale_minoration_forfaitaire"; + "input"] (embed_money) param_))))))))))))))) -$ + (money_of_cents_string "50"))) +$ ((log_end_call + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"] ((log_variable_definition + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"; "output"] (embed_money) ((log_begin_call + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"] contributions_sociales_dot_montant_) + ((log_variable_definition + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"; "input"] (embed_money) ((log_end_call + ["CalculAidePersonnaliséeLogementLocatif"; + "traitement_aide_finale_minoration_forfaitaire"] + ((log_variable_definition + ["CalculAidePersonnaliséeLogementLocatif"; + "traitement_aide_finale_minoration_forfaitaire"; + "output"] (embed_money) ((log_begin_call + ["CalculAidePersonnaliséeLogementLocatif"; + "traitement_aide_finale_minoration_forfaitaire"] + traitement_aide_finale_minoration_forfaitaire_) + ((log_variable_definition + ["CalculAidePersonnaliséeLogementLocatif"; + "traitement_aide_finale_minoration_forfaitaire"; + "input"] (embed_money) param_))))))))))))))) else + (money_of_cents_string "0"))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=601; start_column=10; end_line=601; end_column=40; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]}))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=601; start_column=10; end_line=601; end_column=40; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let taux_loyer_eligible_arrondi_: decimal = (log_variable_definition + ["CalculAidePersonnaliséeLogementLocatif"; + "taux_loyer_éligible_arrondi"] (embed_decimal) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=576; start_column=10; end_line=576; end_column=17; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=576; start_column=10; + end_line=576; end_column=17; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=576; start_column=10; + end_line=576; end_column=17; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/archives.catala_fr"; + start_line=287; start_column=14; + end_line=287; end_column=33; + law_headings=["Article 14"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"; + "Articles valables du 1er octobre 2020 au 1er octobre 2021"; + "Archives législatives et réglementaires"]} + ((date_courante_ >=@ + (date_of_numbers (2020) (10) (1))) && + (date_courante_ <@ + (date_of_numbers (2021) (10) (1)))))) + (fun (_: _) -> + (decimal_round + (taux_loyer_eligible_formule_ *& + (decimal_of_string "100000."))) /& + (decimal_of_string "100000.")))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=423; start_column=14; + end_line=423; end_column=33; + law_headings=["Article 14"; + "Chapitre III : Calcul des aides personnelles au logement en secteur locatif"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + (date_courante_ >=@ (date_of_numbers (2021) (10) (1))))) + (fun (_: _) -> + (decimal_round + (taux_loyer_eligible_formule_ *& + (decimal_of_string "100000."))) /& + (decimal_of_string "100000.")))|]) + (fun (_: _) -> false) (fun (_: _) -> raise EmptyError)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=576; start_column=10; end_line=576; end_column=17; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let traitement_aide_finale_reduction_loyer_solidarite_: money -> money = (log_variable_definition + ["CalculAidePersonnaliséeLogementLocatif"; + "traitement_aide_finale_réduction_loyer_solidarité"] (unembeddable) ( + try + (fun (param_: money) -> + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=602; start_column=10; end_line=602; end_column=36; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_legislatif.catala_fr"; + start_line=823; start_column=14; + end_line=823; end_column=36; + law_headings=["Article L832-3"; + "Chapitre Ier : Champ d'application"; + "Titre III : Aide personnalisée au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie législative"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + if + ((((log_end_call + ["CalculAidePersonnaliséeLogementLocatif"; + "traitement_aide_finale_contributions_sociales_arrondi"] + ((log_variable_definition + ["CalculAidePersonnaliséeLogementLocatif"; + "traitement_aide_finale_contributions_sociales_arrondi"; + "output"] (embed_money) ((log_begin_call + ["CalculAidePersonnaliséeLogementLocatif"; + "traitement_aide_finale_contributions_sociales_arrondi"] + traitement_aide_finale_contributions_sociales_arrondi_) + ((log_variable_definition + ["CalculAidePersonnaliséeLogementLocatif"; + "traitement_aide_finale_contributions_sociales_arrondi"; + "input"] (embed_money) param_))))))) -$ + (reduction_loyer_solidarite_ *$ fraction_l832_3_)) >=$ + (money_of_cents_string "0")) then + (((log_end_call + ["CalculAidePersonnaliséeLogementLocatif"; + "traitement_aide_finale_contributions_sociales_arrondi"] + ((log_variable_definition + ["CalculAidePersonnaliséeLogementLocatif"; + "traitement_aide_finale_contributions_sociales_arrondi"; + "output"] (embed_money) ((log_begin_call + ["CalculAidePersonnaliséeLogementLocatif"; + "traitement_aide_finale_contributions_sociales_arrondi"] + traitement_aide_finale_contributions_sociales_arrondi_) + ((log_variable_definition + ["CalculAidePersonnaliséeLogementLocatif"; + "traitement_aide_finale_contributions_sociales_arrondi"; + "input"] (embed_money) param_))))))) -$ + (reduction_loyer_solidarite_ *$ fraction_l832_3_)) else + (money_of_cents_string "0"))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=602; start_column=10; end_line=602; end_column=36; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]}))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=602; start_column=10; end_line=602; end_column=36; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let taux_prise_compte_ressources_: decimal = (log_variable_definition + ["CalculAidePersonnaliséeLogementLocatif"; + "taux_prise_compte_ressources"] (embed_decimal) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=585; start_column=11; end_line=585; end_column=39; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=2032; start_column=14; end_line=2032; end_column=42; + law_headings=["Article D823-17"; + "Sous-section 2 : Calcul de l'aide en secteur locatif"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + taux_composition_familiale_ +& taux_loyer_eligible_arrondi_)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=585; start_column=11; end_line=585; end_column=39; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let traitement_aide_finale_montant_minimal_: money -> money = (log_variable_definition + ["CalculAidePersonnaliséeLogementLocatif"; + "traitement_aide_finale_montant_minimal"] (unembeddable) ( + try + (fun (param_: money) -> + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=603; start_column=10; end_line=603; end_column=25; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1984; start_column=14; + end_line=1984; end_column=36; + law_headings=["Article D823-16"; + "Sous-section 2 : Calcul de l'aide en secteur locatif"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + if + (((log_end_call + ["CalculAidePersonnaliséeLogementLocatif"; + "traitement_aide_finale_réduction_loyer_solidarité"] + ((log_variable_definition + ["CalculAidePersonnaliséeLogementLocatif"; + "traitement_aide_finale_réduction_loyer_solidarité"; + "output"] (embed_money) ((log_begin_call + ["CalculAidePersonnaliséeLogementLocatif"; + "traitement_aide_finale_réduction_loyer_solidarité"] + traitement_aide_finale_reduction_loyer_solidarite_) + ((log_variable_definition + ["CalculAidePersonnaliséeLogementLocatif"; + "traitement_aide_finale_réduction_loyer_solidarité"; + "input"] (embed_money) param_))))))) <$ + montant_minimal_aide_d823_16_) then + (money_of_cents_string "0") else + ((log_end_call + ["CalculAidePersonnaliséeLogementLocatif"; + "traitement_aide_finale_réduction_loyer_solidarité"] + ((log_variable_definition + ["CalculAidePersonnaliséeLogementLocatif"; + "traitement_aide_finale_réduction_loyer_solidarité"; + "output"] (embed_money) ((log_begin_call + ["CalculAidePersonnaliséeLogementLocatif"; + "traitement_aide_finale_réduction_loyer_solidarité"] + traitement_aide_finale_reduction_loyer_solidarite_) + ((log_variable_definition + ["CalculAidePersonnaliséeLogementLocatif"; + "traitement_aide_finale_réduction_loyer_solidarité"; + "input"] (embed_money) param_))))))))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=603; start_column=10; end_line=603; end_column=25; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]}))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=603; start_column=10; end_line=603; end_column=25; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let participation_personnelle_: money = (log_variable_definition + ["CalculAidePersonnaliséeLogementLocatif"; "participation_personnelle"] + (embed_money) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=591; start_column=10; end_line=591; end_column=35; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=2003; start_column=14; end_line=2003; end_column=39; + law_headings=["Article D823-17"; + "Sous-section 2 : Calcul de l'aide en secteur locatif"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + participation_minimale_ +$ + ((ressources_menage_arrondies_ -$ + abattement_forfaitaire_d823_17_) *$ + taux_prise_compte_ressources_))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=591; start_column=10; end_line=591; end_column=35; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let aide_finale_formule_: money = (log_variable_definition + ["CalculAidePersonnaliséeLogementLocatif"; "aide_finale_formule"] + (embed_money) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=596; start_column=10; end_line=596; end_column=29; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1862; start_column=14; end_line=1862; end_column=33; + law_headings=["Article D823-16"; + "Sous-section 2 : Calcul de l'aide en secteur locatif"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + if + (((loyer_eligible_ +$ montant_forfaitaire_charges_d823_16_) -$ + participation_personnelle_) <$ (money_of_cents_string "0")) + then (money_of_cents_string "0") else + ((loyer_eligible_ +$ montant_forfaitaire_charges_d823_16_) -$ + participation_personnelle_))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=596; start_column=10; end_line=596; end_column=29; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let _: unit = if ( + try + (plafond_degressivite_d823_16_ >=$ + (plafond_loyer_d823_16_2_ *$ (decimal_of_string "2.5"))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1929; start_column=13; + end_line=1929; end_column=76; + law_headings=["Article D823-16"; + "Sous-section 2 : Calcul de l'aide en secteur locatif"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]}))) + then () else + raise (AssertionFailed {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1929; start_column=13; + end_line=1929; end_column=76; + law_headings=["Article D823-16"; + "Sous-section 2 : Calcul de l'aide en secteur locatif"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]}) in + let _: unit = if ( + try + ((fraction_l832_3_ >=& (decimal_of_string "0.9")) && + (fraction_l832_3_ <=& (decimal_of_string "0.98"))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/code_construction_legislatif.catala_fr"; + start_line=833; start_column=13; + end_line=833; end_column=63; + law_headings=["Article L832-3"; + "Chapitre Ier : Champ d'application"; + "Titre III : Aide personnalisée au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie législative"; + "Code de la construction et de l'habitation"]}))) + then () else + raise (AssertionFailed {filename = "examples/aides_logement/code_construction_legislatif.catala_fr"; + start_line=833; start_column=13; + end_line=833; end_column=63; + law_headings=["Article L832-3"; + "Chapitre Ier : Champ d'application"; + "Titre III : Aide personnalisée au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie législative"; + "Code de la construction et de l'habitation"]}) in + {CalculAidePersonnaliseeLogementLocatifOut.montant_forfaitaire_charges_d823_16_out = + montant_forfaitaire_charges_d823_16_; + CalculAidePersonnaliseeLogementLocatifOut.plafond_loyer_d823_16_2_out = + plafond_loyer_d823_16_2_; + CalculAidePersonnaliseeLogementLocatifOut.participation_minimale_out = + participation_minimale_; + CalculAidePersonnaliseeLogementLocatifOut.taux_composition_familiale_out = + taux_composition_familiale_; + CalculAidePersonnaliseeLogementLocatifOut.participation_personnelle_out = + participation_personnelle_; + CalculAidePersonnaliseeLogementLocatifOut.aide_finale_formule_out = + aide_finale_formule_; + CalculAidePersonnaliseeLogementLocatifOut.traitement_aide_finale_montant_minimal_out = + traitement_aide_finale_montant_minimal_} + +let calcul_aide_personnalisee_logement_foyer (calcul_aide_personnalisee_logement_foyer_in: CalculAidePersonnaliseeLogementFoyerIn.t) : CalculAidePersonnaliseeLogementFoyerOut.t = + let mode_occupation_: ModeOccupation.t = calcul_aide_personnalisee_logement_foyer_in.CalculAidePersonnaliseeLogementFoyerIn.mode_occupation_in in + let ressources_menage_arrondies_: money = calcul_aide_personnalisee_logement_foyer_in.CalculAidePersonnaliseeLogementFoyerIn.ressources_menage_arrondies_in in + let nombre_personnes_a_charge_: integer = calcul_aide_personnalisee_logement_foyer_in.CalculAidePersonnaliseeLogementFoyerIn.nombre_personnes_a_charge_in in + let situation_familiale_calcul_apl_: SituationFamilialeCalculAPL.t = calcul_aide_personnalisee_logement_foyer_in.CalculAidePersonnaliseeLogementFoyerIn.situation_familiale_calcul_apl_in in + let zone_: ZoneDHabitation.t = calcul_aide_personnalisee_logement_foyer_in.CalculAidePersonnaliseeLogementFoyerIn.zone_in in + let date_courante_: date = calcul_aide_personnalisee_logement_foyer_in.CalculAidePersonnaliseeLogementFoyerIn.date_courante_in in + let redevance_: money = calcul_aide_personnalisee_logement_foyer_in.CalculAidePersonnaliseeLogementFoyerIn.redevance_in in + let condition_2_du_832_25_: unit -> bool = calcul_aide_personnalisee_logement_foyer_in.CalculAidePersonnaliseeLogementFoyerIn.condition_2_du_832_25_in in + let n_nombre_parts_d832_25_: unit -> decimal = calcul_aide_personnalisee_logement_foyer_in.CalculAidePersonnaliseeLogementFoyerIn.n_nombre_parts_d832_25_in in + let coefficient_r_d832_25_: money = (log_variable_definition + ["CalculAidePersonnaliséeLogementFoyer"; "coefficient_r_d832_25"] + (embed_money) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=643; start_column=10; end_line=643; end_column=31; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=2796; start_column=14; end_line=2796; end_column=35; + law_headings=["Article 30"; + "Chapitre V : Calcul de l'aide personnalisée au logement en secteur logement-foyer"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + true)) (fun (_: _) -> money_of_cents_string "121726")) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=643; start_column=10; end_line=643; end_column=31; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let montant_forfaitaire_d832_24_: money = (log_variable_definition + ["CalculAidePersonnaliséeLogementFoyer"; "montant_forfaitaire_d832_24"] + (embed_money) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=650; start_column=11; end_line=650; end_column=38; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=2771; start_column=14; end_line=2771; end_column=41; + law_headings=["Article 28"; + "Chapitre V : Calcul de l'aide personnalisée au logement en secteur logement-foyer"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + true)) (fun (_: _) -> money_of_cents_string "500")) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=650; start_column=11; end_line=650; end_column=38; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let montant_minimal_aide_d823_24_: money = (log_variable_definition + ["CalculAidePersonnaliséeLogementFoyer"; "montant_minimal_aide_d823_24"] + (embed_money) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=652; start_column=11; end_line=652; end_column=39; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=2782; start_column=14; end_line=2782; end_column=42; + law_headings=["Article 29"; + "Chapitre V : Calcul de l'aide personnalisée au logement en secteur logement-foyer"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + true)) (fun (_: _) -> money_of_cents_string "1000")) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=652; start_column=11; end_line=652; end_column=39; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let condition_2_du_832_25_: bool = (log_variable_definition + ["CalculAidePersonnaliséeLogementFoyer"; "condition_2_du_832_25"] + (embed_bool) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=640; start_column=12; end_line=640; end_column=33; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> condition_2_du_832_25_ ())|]) (fun (_: _) -> true) + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=640; start_column=12; end_line=640; end_column=33; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=3921; start_column=14; + end_line=3921; end_column=35; + law_headings=["Article D832-25"; + "Sous-Section 2 : Conditions d'octroi de l'aide personnalisée au logement aux personnes résidant dans un logement-foyer"; + "Section 3 : Logements-foyers"; + "Chapitre II : Modalités de liquidation et de versement de l'aide personnalisée au logement"; + "Titre III : Aide personnalisée au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + match mode_occupation_ + with + | ModeOccupation.Locataire _ -> false + | ModeOccupation.ResidentLogementFoyer logement_foyer_ -> + (match (logement_foyer_.LogementFoyer.type_user) + with + | TypeLogementFoyer.LogementPersonnesAgeesOuHandicapees _ -> + false + | TypeLogementFoyer.ResidenceSociale _ -> + ((logement_foyer_.LogementFoyer.date_conventionnement) + >=@ (date_of_numbers (1994) (12) (31))) + | TypeLogementFoyer.FoyerJeunesTrvailleursOuMigrantsConventionneL353_2Avant1995 _ -> + ((logement_foyer_.LogementFoyer.date_conventionnement) + >=@ (date_of_numbers (1990) (9) (30))) + | TypeLogementFoyer.Autre _ -> false) + | ModeOccupation.AccessionProprieteLocalUsageExclusifHabitation _ -> + false + | ModeOccupation.SousLocataire _ -> false + | ModeOccupation.LocationAccession _ -> false))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=640; start_column=12; end_line=640; end_column=33; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let contributions_sociales_dot_date_courante_: date = + try ((log_variable_definition + ["CalculAidePersonnaliséeLogementFoyer"; + "contributions_sociales.date_courante"] (embed_date) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=658; start_column=3; end_line=658; end_column=25; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=674; start_column=14; end_line=674; end_column=50; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> date_courante_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=544; start_column=10; end_line=544; end_column=23; + law_headings=["Calcul des contributions sociales s'appliquant aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let result_: ContributionsSocialesAidesPersonnelleLogementOut.t = (log_end_call + ["CalculAidePersonnaliséeLogementFoyer"; "contributions_sociales"; + "ContributionsSocialesAidesPersonnelleLogement"] ((log_begin_call + ["CalculAidePersonnaliséeLogementFoyer"; "contributions_sociales"; + "ContributionsSocialesAidesPersonnelleLogement"] + contributions_sociales_aides_personnelle_logement) + {ContributionsSocialesAidesPersonnelleLogementIn.date_courante_in = + contributions_sociales_dot_date_courante_})) in + let contributions_sociales_dot_montant_: money -> money = result_.ContributionsSocialesAidesPersonnelleLogementOut.montant_out in + let plafond_equivalence_loyer_eligible_: money = (log_variable_definition + ["CalculAidePersonnaliséeLogementFoyer"; + "plafond_équivalence_loyer_éligible"] (embed_money) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=646; start_column=10; end_line=646; end_column=44; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=646; start_column=10; + end_line=646; end_column=44; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=2717; start_column=14; + end_line=2717; end_column=48; + law_headings=["Article 27"; + "Chapitre V : Calcul de l'aide personnalisée au logement en secteur logement-foyer"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + (date_courante_ >=@ (date_of_numbers (2021) (10) (1))))) + (fun (_: _) -> + match zone_ + with + | ZoneDHabitation.Zone1 _ -> + ( if + (nombre_personnes_a_charge_ = (integer_of_string + "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "44630") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "52321")) else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "1")) then + (money_of_cents_string "55788") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "2")) then + (money_of_cents_string "59704") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "3")) then + (money_of_cents_string "63635") else + ((money_of_cents_string "68637") +$ + ((money_of_cents_string "7119") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "4"))))))))) + | ZoneDHabitation.Zone2 _ -> + ( if + (nombre_personnes_a_charge_ = (integer_of_string + "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "40814") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "47632")) else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "1")) then + (money_of_cents_string "50787") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "2")) then + (money_of_cents_string "54365") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "3")) then + (money_of_cents_string "57929") else + ((money_of_cents_string "61727") +$ + ((money_of_cents_string "6434") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "4"))))))))) + | ZoneDHabitation.Zone3 _ -> + ( if + (nombre_personnes_a_charge_ = (integer_of_string + "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "38740") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "45057")) else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "1")) then + (money_of_cents_string "47802") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "2")) then + (money_of_cents_string "50957") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "3")) then + (money_of_cents_string "54110") else + ((money_of_cents_string "57657") +$ + ((money_of_cents_string "5971") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "4"))))))))))); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=646; start_column=10; + end_line=646; end_column=44; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/archives.catala_fr"; + start_line=501; start_column=14; + end_line=501; end_column=48; + law_headings=["Article 27"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"; + "Articles valables du 1er octobre 2020 au 1er octobre 2021"; + "Archives législatives et réglementaires"]} + ((date_courante_ <@ (date_of_numbers (2021) (10) (1))) && + (date_courante_ >=@ (date_of_numbers (2020) (10) (1)))))) + (fun (_: _) -> + match zone_ + with + | ZoneDHabitation.Zone1 _ -> + ( if + (nombre_personnes_a_charge_ = (integer_of_string + "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "44443") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "52101")) else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "1")) then + (money_of_cents_string "55555") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "2")) then + (money_of_cents_string "59454") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "3")) then + (money_of_cents_string "63369") else + ((money_of_cents_string "68350") +$ + ((money_of_cents_string "7089") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "4"))))))))) + | ZoneDHabitation.Zone2 _ -> + ( if + (nombre_personnes_a_charge_ = (integer_of_string + "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "40643") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "47433")) else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "1")) then + (money_of_cents_string "50575") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "2")) then + (money_of_cents_string "54138") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "3")) then + (money_of_cents_string "57687") else + ((money_of_cents_string "61469") +$ + ((money_of_cents_string "6407") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "4"))))))))) + | ZoneDHabitation.Zone3 _ -> + ( if + (nombre_personnes_a_charge_ = (integer_of_string + "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "38578") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "44869")) else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "1")) then + (money_of_cents_string "47602") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "2")) then + (money_of_cents_string "50744") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "3")) then + (money_of_cents_string "53884") else + ((money_of_cents_string "57416") +$ + ((money_of_cents_string "5946") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "4")))))))))))|]) + (fun (_: _) -> false) (fun (_: _) -> raise EmptyError)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=646; start_column=10; end_line=646; end_column=44; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let traitement_aide_finale_minoration_forfaitaire_: money -> money = (log_variable_definition + ["CalculAidePersonnaliséeLogementFoyer"; + "traitement_aide_finale_minoration_forfaitaire"] (unembeddable) ( + try + (fun (param_: money) -> + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=668; start_column=10; end_line=668; end_column=32; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=3848; start_column=14; + end_line=3848; end_column=36; + law_headings=["Article D832-24"; + "Sous-Section 2 : Conditions d'octroi de l'aide personnalisée au logement aux personnes résidant dans un logement-foyer"; + "Section 3 : Logements-foyers"; + "Chapitre II : Modalités de liquidation et de versement de l'aide personnalisée au logement"; + "Titre III : Aide personnalisée au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + if + ((param_ -$ montant_forfaitaire_d832_24_) >=$ + (money_of_cents_string "0")) then + (param_ -$ montant_forfaitaire_d832_24_) else + (money_of_cents_string "0"))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=668; start_column=10; end_line=668; end_column=32; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]}))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=668; start_column=10; end_line=668; end_column=32; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let calcul_nombre_parts_dot_condition_2_du_832_25_: bool = + try ((log_variable_definition + ["CalculAidePersonnaliséeLogementFoyer"; + "calcul_nombre_parts.condition_2_du_832_25"] (embed_bool) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=655; start_column=3; end_line=655; end_column=22; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=4008; start_column=14; end_line=4008; end_column=55; + law_headings=["Article D832-25"; + "Sous-Section 2 : Conditions d'octroi de l'aide personnalisée au logement aux personnes résidant dans un logement-foyer"; + "Section 3 : Logements-foyers"; + "Chapitre II : Modalités de liquidation et de versement de l'aide personnalisée au logement"; + "Titre III : Aide personnalisée au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) (fun (_: _) -> condition_2_du_832_25_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=625; start_column=10; end_line=625; end_column=31; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let calcul_nombre_parts_dot_nombre_personnes_a_charge_: integer = + try ((log_variable_definition + ["CalculAidePersonnaliséeLogementFoyer"; + "calcul_nombre_parts.nombre_personnes_à_charge"] (embed_integer) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=655; start_column=3; end_line=655; end_column=22; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=4004; start_column=14; end_line=4004; end_column=59; + law_headings=["Article D832-25"; + "Sous-Section 2 : Conditions d'octroi de l'aide personnalisée au logement aux personnes résidant dans un logement-foyer"; + "Section 3 : Logements-foyers"; + "Chapitre II : Modalités de liquidation et de versement de l'aide personnalisée au logement"; + "Titre III : Aide personnalisée au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) (fun (_: _) -> nombre_personnes_a_charge_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=626; start_column=10; end_line=626; end_column=35; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let calcul_nombre_parts_dot_situation_familiale_calcul_apl_: SituationFamilialeCalculAPL.t = + try ((log_variable_definition + ["CalculAidePersonnaliséeLogementFoyer"; + "calcul_nombre_parts.situation_familiale_calcul_apl"] + (embed_situation_familiale_calcul_a_p_l) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=655; start_column=3; end_line=655; end_column=22; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=4006; start_column=14; end_line=4006; end_column=64; + law_headings=["Article D832-25"; + "Sous-Section 2 : Conditions d'octroi de l'aide personnalisée au logement aux personnes résidant dans un logement-foyer"; + "Section 3 : Logements-foyers"; + "Chapitre II : Modalités de liquidation et de versement de l'aide personnalisée au logement"; + "Titre III : Aide personnalisée au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) (fun (_: _) -> situation_familiale_calcul_apl_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=627; start_column=10; end_line=627; end_column=40; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let result_: CalculNombrePartLogementFoyerOut.t = (log_end_call + ["CalculAidePersonnaliséeLogementFoyer"; "calcul_nombre_parts"; + "CalculNombrePartLogementFoyer"] ((log_begin_call + ["CalculAidePersonnaliséeLogementFoyer"; "calcul_nombre_parts"; + "CalculNombrePartLogementFoyer"] calcul_nombre_part_logement_foyer) + {CalculNombrePartLogementFoyerIn.condition_2_du_832_25_in = + calcul_nombre_parts_dot_condition_2_du_832_25_; + CalculNombrePartLogementFoyerIn.nombre_personnes_a_charge_in = + calcul_nombre_parts_dot_nombre_personnes_a_charge_; + CalculNombrePartLogementFoyerIn.situation_familiale_calcul_apl_in = + calcul_nombre_parts_dot_situation_familiale_calcul_apl_})) in + let calcul_nombre_parts_dot_n_nombre_parts_d832_25_: decimal = result_.CalculNombrePartLogementFoyerOut.n_nombre_parts_d832_25_out in + let montant_forfaitaire_d832_27_: money = (log_variable_definition + ["CalculAidePersonnaliséeLogementFoyer"; "montant_forfaitaire_d832_27"] + (embed_money) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=651; start_column=11; end_line=651; end_column=38; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=2915; start_column=14; end_line=2915; end_column=41; + law_headings=["Article 32"; + "Chapitre V : Calcul de l'aide personnalisée au logement en secteur logement-foyer"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + true)) + (fun (_: _) -> + if condition_2_du_832_25_ then (money_of_cents_string "1500") + else (money_of_cents_string "2668"))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=651; start_column=11; end_line=651; end_column=38; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let coefficient_multiplicateur_d832_25_: money = (log_variable_definition + ["CalculAidePersonnaliséeLogementFoyer"; + "coefficient_multiplicateur_d832_25"] (embed_money) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=642; start_column=10; end_line=642; end_column=44; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=2806; start_column=14; end_line=2806; end_column=48; + law_headings=["Article 30"; + "Chapitre V : Calcul de l'aide personnalisée au logement en secteur logement-foyer"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + true)) + (fun (_: _) -> + if condition_2_du_832_25_ then (money_of_cents_string "2142091") + else (money_of_cents_string "1339340"))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=642; start_column=10; end_line=642; end_column=44; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let equivalence_loyer_eligible_: money = (log_variable_definition + ["CalculAidePersonnaliséeLogementFoyer"; "équivalence_loyer_éligible"] + (embed_money) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=645; start_column=10; end_line=645; end_column=36; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=3822; start_column=14; end_line=3822; end_column=40; + law_headings=["Article D832-24"; + "Sous-Section 2 : Conditions d'octroi de l'aide personnalisée au logement aux personnes résidant dans un logement-foyer"; + "Section 3 : Logements-foyers"; + "Chapitre II : Modalités de liquidation et de versement de l'aide personnalisée au logement"; + "Titre III : Aide personnalisée au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + if (redevance_ >=$ plafond_equivalence_loyer_eligible_) then + plafond_equivalence_loyer_eligible_ else redevance_)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=645; start_column=10; end_line=645; end_column=36; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let n_nombre_parts_d832_25_: decimal = (log_variable_definition + ["CalculAidePersonnaliséeLogementFoyer"; "n_nombre_parts_d832_25"] + (embed_decimal) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=644; start_column=19; end_line=644; end_column=41; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> n_nombre_parts_d832_25_ ())|]) + (fun (_: _) -> true) + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=644; start_column=19; end_line=644; end_column=41; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=4010; start_column=14; + end_line=4010; end_column=36; + law_headings=["Article D832-25"; + "Sous-Section 2 : Conditions d'octroi de l'aide personnalisée au logement aux personnes résidant dans un logement-foyer"; + "Section 3 : Logements-foyers"; + "Chapitre II : Modalités de liquidation et de versement de l'aide personnalisée au logement"; + "Titre III : Aide personnalisée au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> calcul_nombre_parts_dot_n_nombre_parts_d832_25_))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=644; start_column=19; end_line=644; end_column=41; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let depense_nette_minimale_d832_27_: money -> money = (log_variable_definition + ["CalculAidePersonnaliséeLogementFoyer"; + "dépense_nette_minimale_d832_27"] (unembeddable) ( + try + (fun (param_: money) -> + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=649; start_column=11; end_line=649; end_column=41; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=4206; start_column=14; + end_line=4206; end_column=44; + law_headings=["Article D832-27"; + "Sous-Section 2 : Conditions d'octroi de l'aide personnalisée au logement aux personnes résidant dans un logement-foyer"; + "Section 3 : Logements-foyers"; + "Chapitre II : Modalités de liquidation et de versement de l'aide personnalisée au logement"; + "Titre III : Aide personnalisée au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) (fun (_: _) -> equivalence_loyer_eligible_ -$ param_)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=649; start_column=11; end_line=649; end_column=41; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]}))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=649; start_column=11; end_line=649; end_column=41; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let calcul_equivalence_loyer_minimale_dot_ressources_menage_arrondies_: money = + try ((log_variable_definition + ["CalculAidePersonnaliséeLogementFoyer"; + "calcul_équivalence_loyer_minimale.ressources_ménage_arrondies"] + (embed_money) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=656; start_column=3; end_line=656; end_column=36; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=3838; start_column=14; end_line=3838; end_column=75; + law_headings=["Article D832-24"; + "Sous-Section 2 : Conditions d'octroi de l'aide personnalisée au logement aux personnes résidant dans un logement-foyer"; + "Section 3 : Logements-foyers"; + "Chapitre II : Modalités de liquidation et de versement de l'aide personnalisée au logement"; + "Titre III : Aide personnalisée au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) (fun (_: _) -> ressources_menage_arrondies_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=613; start_column=10; end_line=613; end_column=37; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let calcul_equivalence_loyer_minimale_dot_condition_2_du_832_25_: bool = + try ((log_variable_definition + ["CalculAidePersonnaliséeLogementFoyer"; + "calcul_équivalence_loyer_minimale.condition_2_du_832_25"] + (embed_bool) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=656; start_column=3; end_line=656; end_column=36; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=3836; start_column=14; end_line=3836; end_column=69; + law_headings=["Article D832-24"; + "Sous-Section 2 : Conditions d'octroi de l'aide personnalisée au logement aux personnes résidant dans un logement-foyer"; + "Section 3 : Logements-foyers"; + "Chapitre II : Modalités de liquidation et de versement de l'aide personnalisée au logement"; + "Titre III : Aide personnalisée au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) (fun (_: _) -> condition_2_du_832_25_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=614; start_column=10; end_line=614; end_column=31; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let calcul_equivalence_loyer_minimale_dot_n_nombre_parts_d832_25_: decimal = + try ((log_variable_definition + ["CalculAidePersonnaliséeLogementFoyer"; + "calcul_équivalence_loyer_minimale.n_nombre_parts_d832_25"] + (embed_decimal) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=656; start_column=3; end_line=656; end_column=36; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=3840; start_column=14; end_line=3840; end_column=70; + law_headings=["Article D832-24"; + "Sous-Section 2 : Conditions d'octroi de l'aide personnalisée au logement aux personnes résidant dans un logement-foyer"; + "Section 3 : Logements-foyers"; + "Chapitre II : Modalités de liquidation et de versement de l'aide personnalisée au logement"; + "Titre III : Aide personnalisée au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) (fun (_: _) -> n_nombre_parts_d832_25_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=615; start_column=10; end_line=615; end_column=32; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let result_: CalculEquivalenceLoyerMinimaleOut.t = (log_end_call + ["CalculAidePersonnaliséeLogementFoyer"; + "calcul_équivalence_loyer_minimale"; + "CalculÉquivalenceLoyerMinimale"] ((log_begin_call + ["CalculAidePersonnaliséeLogementFoyer"; + "calcul_équivalence_loyer_minimale"; + "CalculÉquivalenceLoyerMinimale"] calcul_equivalence_loyer_minimale) + {CalculEquivalenceLoyerMinimaleIn.ressources_menage_arrondies_in = + calcul_equivalence_loyer_minimale_dot_ressources_menage_arrondies_; + CalculEquivalenceLoyerMinimaleIn.condition_2_du_832_25_in = + calcul_equivalence_loyer_minimale_dot_condition_2_du_832_25_; + CalculEquivalenceLoyerMinimaleIn.n_nombre_parts_d832_25_in = + calcul_equivalence_loyer_minimale_dot_n_nombre_parts_d832_25_})) in + let calcul_equivalence_loyer_minimale_dot_montant_: money = result_.CalculEquivalenceLoyerMinimaleOut.montant_out in + let coefficient_prise_en_charge_d832_25_formule_: decimal = (log_variable_definition + ["CalculAidePersonnaliséeLogementFoyer"; + "coefficient_prise_en_charge_d832_25_formule"] (embed_decimal) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=662; start_column=10; end_line=662; end_column=17; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=662; start_column=10; + end_line=662; end_column=17; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=4022; start_column=5; + end_line=4022; end_column=26; + law_headings=["Article D832-25"; + "Sous-Section 2 : Conditions d'octroi de l'aide personnalisée au logement aux personnes résidant dans un logement-foyer"; + "Section 3 : Logements-foyers"; + "Chapitre II : Modalités de liquidation et de versement de l'aide personnalisée au logement"; + "Titre III : Aide personnalisée au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + condition_2_du_832_25_)) + (fun (_: _) -> + (decimal_of_string "0.9") -& + (ressources_menage_arrondies_ /$ + (coefficient_multiplicateur_d832_25_ *$ + n_nombre_parts_d832_25_))))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=3939; start_column=14; end_line=3939; end_column=49; + law_headings=["Article D832-25"; + "Sous-Section 2 : Conditions d'octroi de l'aide personnalisée au logement aux personnes résidant dans un logement-foyer"; + "Section 3 : Logements-foyers"; + "Chapitre II : Modalités de liquidation et de versement de l'aide personnalisée au logement"; + "Titre III : Aide personnalisée au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + (decimal_of_string "0.95") -& + ((ressources_menage_arrondies_ -$ + (coefficient_r_d832_25_ *$ n_nombre_parts_d832_25_)) /$ + (coefficient_multiplicateur_d832_25_ *$ + n_nombre_parts_d832_25_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=662; start_column=10; end_line=662; end_column=17; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let abattement_depense_nette_minimale_d832_27_: money -> money = (log_variable_definition + ["CalculAidePersonnaliséeLogementFoyer"; + "abattement_dépense_nette_minimale_d832_27"] (unembeddable) ( + try + (fun (param_: money) -> + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=647; start_column=11; end_line=647; end_column=52; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=4210; start_column=14; + end_line=4210; end_column=55; + law_headings=["Article D832-27"; + "Sous-Section 2 : Conditions d'octroi de l'aide personnalisée au logement aux personnes résidant dans un logement-foyer"; + "Section 3 : Logements-foyers"; + "Chapitre II : Modalités de liquidation et de versement de l'aide personnalisée au logement"; + "Titre III : Aide personnalisée au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + if + (((log_end_call + ["CalculAidePersonnaliséeLogementFoyer"; + "dépense_nette_minimale_d832_27"] + ((log_variable_definition + ["CalculAidePersonnaliséeLogementFoyer"; + "dépense_nette_minimale_d832_27"; "output"] + (embed_money) ((log_begin_call + ["CalculAidePersonnaliséeLogementFoyer"; + "dépense_nette_minimale_d832_27"] + depense_nette_minimale_d832_27_) + ((log_variable_definition + ["CalculAidePersonnaliséeLogementFoyer"; + "dépense_nette_minimale_d832_27"; "input"] + (embed_money) param_))))))) <=$ + montant_forfaitaire_d832_27_) then + (montant_forfaitaire_d832_27_ -$ ((log_end_call + ["CalculAidePersonnaliséeLogementFoyer"; + "dépense_nette_minimale_d832_27"] + ((log_variable_definition + ["CalculAidePersonnaliséeLogementFoyer"; + "dépense_nette_minimale_d832_27"; "output"] + (embed_money) ((log_begin_call + ["CalculAidePersonnaliséeLogementFoyer"; + "dépense_nette_minimale_d832_27"] + depense_nette_minimale_d832_27_) + ((log_variable_definition + ["CalculAidePersonnaliséeLogementFoyer"; + "dépense_nette_minimale_d832_27"; "input"] + (embed_money) param_)))))))) else + (money_of_cents_string "0"))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=647; start_column=11; end_line=647; end_column=52; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]}))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=647; start_column=11; end_line=647; end_column=52; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let equivalence_loyer_minimale_: money = (log_variable_definition + ["CalculAidePersonnaliséeLogementFoyer"; "équivalence_loyer_minimale"] + (embed_money) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=653; start_column=10; end_line=653; end_column=36; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=3834; start_column=14; end_line=3834; end_column=40; + law_headings=["Article D832-24"; + "Sous-Section 2 : Conditions d'octroi de l'aide personnalisée au logement aux personnes résidant dans un logement-foyer"; + "Section 3 : Logements-foyers"; + "Chapitre II : Modalités de liquidation et de versement de l'aide personnalisée au logement"; + "Titre III : Aide personnalisée au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> calcul_equivalence_loyer_minimale_dot_montant_)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=653; start_column=10; end_line=653; end_column=36; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let coefficient_prise_en_charge_d832_25_arrondi_: decimal = (log_variable_definition + ["CalculAidePersonnaliséeLogementFoyer"; + "coefficient_prise_en_charge_d832_25_arrondi"] (embed_decimal) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=663; start_column=10; end_line=663; end_column=17; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=663; start_column=10; + end_line=663; end_column=17; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=4039; start_column=5; + end_line=4039; end_column=26; + law_headings=["Article D832-25"; + "Sous-Section 2 : Conditions d'octroi de l'aide personnalisée au logement aux personnes résidant dans un logement-foyer"; + "Section 3 : Logements-foyers"; + "Chapitre II : Modalités de liquidation et de versement de l'aide personnalisée au logement"; + "Titre III : Aide personnalisée au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + condition_2_du_832_25_)) + (fun (_: _) -> + (decimal_round + ((coefficient_prise_en_charge_d832_25_formule_ -& + (decimal_of_string "0.005")) *& + (decimal_of_string "100."))) /& + (decimal_of_string "100.")))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=3955; start_column=14; end_line=3955; end_column=49; + law_headings=["Article D832-25"; + "Sous-Section 2 : Conditions d'octroi de l'aide personnalisée au logement aux personnes résidant dans un logement-foyer"; + "Section 3 : Logements-foyers"; + "Chapitre II : Modalités de liquidation et de versement de l'aide personnalisée au logement"; + "Titre III : Aide personnalisée au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + (decimal_round + ((coefficient_prise_en_charge_d832_25_formule_ -& + (decimal_of_string "0.005")) *& (decimal_of_string "100."))) + /& (decimal_of_string "100."))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=663; start_column=10; end_line=663; end_column=17; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let traitement_aide_finale_abattement_: money -> money = (log_variable_definition + ["CalculAidePersonnaliséeLogementFoyer"; + "traitement_aide_finale_abattement"] (unembeddable) ( + try + (fun (param_: money) -> + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=669; start_column=10; end_line=669; end_column=20; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=3862; start_column=14; + end_line=3862; end_column=36; + law_headings=["Article D832-24"; + "Sous-Section 2 : Conditions d'octroi de l'aide personnalisée au logement aux personnes résidant dans un logement-foyer"; + "Section 3 : Logements-foyers"; + "Chapitre II : Modalités de liquidation et de versement de l'aide personnalisée au logement"; + "Titre III : Aide personnalisée au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + if + ((((log_end_call + ["CalculAidePersonnaliséeLogementFoyer"; + "traitement_aide_finale_minoration_forfaitaire"] + ((log_variable_definition + ["CalculAidePersonnaliséeLogementFoyer"; + "traitement_aide_finale_minoration_forfaitaire"; + "output"] (embed_money) ((log_begin_call + ["CalculAidePersonnaliséeLogementFoyer"; + "traitement_aide_finale_minoration_forfaitaire"] + traitement_aide_finale_minoration_forfaitaire_) + ((log_variable_definition + ["CalculAidePersonnaliséeLogementFoyer"; + "traitement_aide_finale_minoration_forfaitaire"; + "input"] (embed_money) param_))))))) -$ + ((log_end_call + ["CalculAidePersonnaliséeLogementFoyer"; + "abattement_dépense_nette_minimale_d832_27"] + ((log_variable_definition + ["CalculAidePersonnaliséeLogementFoyer"; + "abattement_dépense_nette_minimale_d832_27"; + "output"] (embed_money) ((log_begin_call + ["CalculAidePersonnaliséeLogementFoyer"; + "abattement_dépense_nette_minimale_d832_27"] + abattement_depense_nette_minimale_d832_27_) + ((log_variable_definition + ["CalculAidePersonnaliséeLogementFoyer"; + "abattement_dépense_nette_minimale_d832_27"; + "input"] (embed_money) ((log_end_call + ["CalculAidePersonnaliséeLogementFoyer"; + "traitement_aide_finale_minoration_forfaitaire"] + ((log_variable_definition + ["CalculAidePersonnaliséeLogementFoyer"; + "traitement_aide_finale_minoration_forfaitaire"; + "output"] (embed_money) ((log_begin_call + ["CalculAidePersonnaliséeLogementFoyer"; + "traitement_aide_finale_minoration_forfaitaire"] + traitement_aide_finale_minoration_forfaitaire_) + ((log_variable_definition + ["CalculAidePersonnaliséeLogementFoyer"; + "traitement_aide_finale_minoration_forfaitaire"; + "input"] (embed_money) param_))))))))))))))) >=$ + (money_of_cents_string "0")) then + (((log_end_call + ["CalculAidePersonnaliséeLogementFoyer"; + "traitement_aide_finale_minoration_forfaitaire"] + ((log_variable_definition + ["CalculAidePersonnaliséeLogementFoyer"; + "traitement_aide_finale_minoration_forfaitaire"; + "output"] (embed_money) ((log_begin_call + ["CalculAidePersonnaliséeLogementFoyer"; + "traitement_aide_finale_minoration_forfaitaire"] + traitement_aide_finale_minoration_forfaitaire_) + ((log_variable_definition + ["CalculAidePersonnaliséeLogementFoyer"; + "traitement_aide_finale_minoration_forfaitaire"; + "input"] (embed_money) param_))))))) -$ + ((log_end_call + ["CalculAidePersonnaliséeLogementFoyer"; + "abattement_dépense_nette_minimale_d832_27"] + ((log_variable_definition + ["CalculAidePersonnaliséeLogementFoyer"; + "abattement_dépense_nette_minimale_d832_27"; + "output"] (embed_money) ((log_begin_call + ["CalculAidePersonnaliséeLogementFoyer"; + "abattement_dépense_nette_minimale_d832_27"] + abattement_depense_nette_minimale_d832_27_) + ((log_variable_definition + ["CalculAidePersonnaliséeLogementFoyer"; + "abattement_dépense_nette_minimale_d832_27"; + "input"] (embed_money) ((log_end_call + ["CalculAidePersonnaliséeLogementFoyer"; + "traitement_aide_finale_minoration_forfaitaire"] + ((log_variable_definition + ["CalculAidePersonnaliséeLogementFoyer"; + "traitement_aide_finale_minoration_forfaitaire"; + "output"] (embed_money) ((log_begin_call + ["CalculAidePersonnaliséeLogementFoyer"; + "traitement_aide_finale_minoration_forfaitaire"] + traitement_aide_finale_minoration_forfaitaire_) + ((log_variable_definition + ["CalculAidePersonnaliséeLogementFoyer"; + "traitement_aide_finale_minoration_forfaitaire"; + "input"] (embed_money) param_))))))))))))))) else + (money_of_cents_string "0"))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=669; start_column=10; end_line=669; end_column=20; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]}))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=669; start_column=10; end_line=669; end_column=20; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let coefficient_prise_en_charge_d832_25_seuil_: decimal = (log_variable_definition + ["CalculAidePersonnaliséeLogementFoyer"; + "coefficient_prise_en_charge_d832_25_seuil"] (embed_decimal) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=664; start_column=10; end_line=664; end_column=15; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=664; start_column=10; + end_line=664; end_column=15; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=4045; start_column=5; + end_line=4045; end_column=26; + law_headings=["Article D832-25"; + "Sous-Section 2 : Conditions d'octroi de l'aide personnalisée au logement aux personnes résidant dans un logement-foyer"; + "Section 3 : Logements-foyers"; + "Chapitre II : Modalités de liquidation et de versement de l'aide personnalisée au logement"; + "Titre III : Aide personnalisée au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + condition_2_du_832_25_)) + (fun (_: _) -> + if + (coefficient_prise_en_charge_d832_25_arrondi_ >=& + (decimal_of_string "0.9")) then + (decimal_of_string "0.9") else + coefficient_prise_en_charge_d832_25_arrondi_))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=3958; start_column=14; end_line=3958; end_column=49; + law_headings=["Article D832-25"; + "Sous-Section 2 : Conditions d'octroi de l'aide personnalisée au logement aux personnes résidant dans un logement-foyer"; + "Section 3 : Logements-foyers"; + "Chapitre II : Modalités de liquidation et de versement de l'aide personnalisée au logement"; + "Titre III : Aide personnalisée au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + if + (coefficient_prise_en_charge_d832_25_arrondi_ >=& + (decimal_of_string "0.95")) then (decimal_of_string "0.95") + else coefficient_prise_en_charge_d832_25_arrondi_)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=664; start_column=10; end_line=664; end_column=15; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let traitement_aide_finale_contributions_sociales_arrondi_: money -> money = (log_variable_definition + ["CalculAidePersonnaliséeLogementFoyer"; + "traitement_aide_finale_contributions_sociales_arrondi"] (unembeddable) + ( + try + (fun (param_: money) -> + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=670; start_column=10; end_line=670; end_column=40; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=3879; start_column=14; + end_line=3879; end_column=36; + law_headings=["Article D832-24"; + "Sous-Section 2 : Conditions d'octroi de l'aide personnalisée au logement aux personnes résidant dans un logement-foyer"; + "Section 3 : Logements-foyers"; + "Chapitre II : Modalités de liquidation et de versement de l'aide personnalisée au logement"; + "Titre III : Aide personnalisée au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + if + (((money_round + ((((log_end_call + ["CalculAidePersonnaliséeLogementFoyer"; + "traitement_aide_finale_abattement"] + ((log_variable_definition + ["CalculAidePersonnaliséeLogementFoyer"; + "traitement_aide_finale_abattement"; "output"] + (embed_money) ((log_begin_call + ["CalculAidePersonnaliséeLogementFoyer"; + "traitement_aide_finale_abattement"] + traitement_aide_finale_abattement_) + ((log_variable_definition + ["CalculAidePersonnaliséeLogementFoyer"; + "traitement_aide_finale_abattement"; "input"] + (embed_money) param_))))))) -$ ((log_end_call + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"] ((log_variable_definition + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"; "output"] (embed_money) + ((log_begin_call + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"] contributions_sociales_dot_montant_) + ((log_variable_definition + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"; "input"] (embed_money) + ((log_end_call + ["CalculAidePersonnaliséeLogementFoyer"; + "traitement_aide_finale_abattement"] + ((log_variable_definition + ["CalculAidePersonnaliséeLogementFoyer"; + "traitement_aide_finale_abattement"; "output"] + (embed_money) ((log_begin_call + ["CalculAidePersonnaliséeLogementFoyer"; + "traitement_aide_finale_abattement"] + traitement_aide_finale_abattement_) + ((log_variable_definition + ["CalculAidePersonnaliséeLogementFoyer"; + "traitement_aide_finale_abattement"; "input"] + (embed_money) param_))))))))))))))) -$ + (money_of_cents_string "50"))) +$ ((log_end_call + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"] ((log_variable_definition + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"; "output"] (embed_money) ((log_begin_call + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"] contributions_sociales_dot_montant_) + ((log_variable_definition + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"; "input"] (embed_money) ((log_end_call + ["CalculAidePersonnaliséeLogementFoyer"; + "traitement_aide_finale_abattement"] + ((log_variable_definition + ["CalculAidePersonnaliséeLogementFoyer"; + "traitement_aide_finale_abattement"; "output"] + (embed_money) ((log_begin_call + ["CalculAidePersonnaliséeLogementFoyer"; + "traitement_aide_finale_abattement"] + traitement_aide_finale_abattement_) + ((log_variable_definition + ["CalculAidePersonnaliséeLogementFoyer"; + "traitement_aide_finale_abattement"; "input"] + (embed_money) param_))))))))))))))) >=$ + (money_of_cents_string "0")) then + ((money_round + ((((log_end_call + ["CalculAidePersonnaliséeLogementFoyer"; + "traitement_aide_finale_abattement"] + ((log_variable_definition + ["CalculAidePersonnaliséeLogementFoyer"; + "traitement_aide_finale_abattement"; "output"] + (embed_money) ((log_begin_call + ["CalculAidePersonnaliséeLogementFoyer"; + "traitement_aide_finale_abattement"] + traitement_aide_finale_abattement_) + ((log_variable_definition + ["CalculAidePersonnaliséeLogementFoyer"; + "traitement_aide_finale_abattement"; "input"] + (embed_money) param_))))))) -$ ((log_end_call + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"] ((log_variable_definition + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"; "output"] (embed_money) + ((log_begin_call + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"] contributions_sociales_dot_montant_) + ((log_variable_definition + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"; "input"] (embed_money) ((log_end_call + ["CalculAidePersonnaliséeLogementFoyer"; + "traitement_aide_finale_abattement"] + ((log_variable_definition + ["CalculAidePersonnaliséeLogementFoyer"; + "traitement_aide_finale_abattement"; "output"] + (embed_money) ((log_begin_call + ["CalculAidePersonnaliséeLogementFoyer"; + "traitement_aide_finale_abattement"] + traitement_aide_finale_abattement_) + ((log_variable_definition + ["CalculAidePersonnaliséeLogementFoyer"; + "traitement_aide_finale_abattement"; "input"] + (embed_money) param_))))))))))))))) -$ + (money_of_cents_string "50"))) +$ ((log_end_call + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"] ((log_variable_definition + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"; "output"] (embed_money) ((log_begin_call + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"] contributions_sociales_dot_montant_) + ((log_variable_definition + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"; "input"] (embed_money) ((log_end_call + ["CalculAidePersonnaliséeLogementFoyer"; + "traitement_aide_finale_abattement"] + ((log_variable_definition + ["CalculAidePersonnaliséeLogementFoyer"; + "traitement_aide_finale_abattement"; "output"] + (embed_money) ((log_begin_call + ["CalculAidePersonnaliséeLogementFoyer"; + "traitement_aide_finale_abattement"] + traitement_aide_finale_abattement_) + ((log_variable_definition + ["CalculAidePersonnaliséeLogementFoyer"; + "traitement_aide_finale_abattement"; "input"] + (embed_money) param_))))))))))))))) else + (money_of_cents_string "0"))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=670; start_column=10; end_line=670; end_column=40; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]}))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=670; start_column=10; end_line=670; end_column=40; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let aide_finale_formule_: money = (log_variable_definition + ["CalculAidePersonnaliséeLogementFoyer"; "aide_finale_formule"] + (embed_money) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=666; start_column=10; end_line=666; end_column=29; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=3801; start_column=14; end_line=3801; end_column=33; + law_headings=["Article D832-24"; + "Sous-Section 2 : Conditions d'octroi de l'aide personnalisée au logement aux personnes résidant dans un logement-foyer"; + "Section 3 : Logements-foyers"; + "Chapitre II : Modalités de liquidation et de versement de l'aide personnalisée au logement"; + "Titre III : Aide personnalisée au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + if + (((equivalence_loyer_eligible_ -$ equivalence_loyer_minimale_) + *$ coefficient_prise_en_charge_d832_25_seuil_) <$ + (money_of_cents_string "0")) then + (money_of_cents_string "0") else + ((equivalence_loyer_eligible_ -$ equivalence_loyer_minimale_) + *$ coefficient_prise_en_charge_d832_25_seuil_))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=666; start_column=10; end_line=666; end_column=29; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let traitement_aide_finale_montant_minimal_: money -> money = (log_variable_definition + ["CalculAidePersonnaliséeLogementFoyer"; + "traitement_aide_finale_montant_minimal"] (unembeddable) ( + try + (fun (param_: money) -> + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=671; start_column=10; end_line=671; end_column=25; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=3904; start_column=14; + end_line=3904; end_column=36; + law_headings=["Article D832-24"; + "Sous-Section 2 : Conditions d'octroi de l'aide personnalisée au logement aux personnes résidant dans un logement-foyer"; + "Section 3 : Logements-foyers"; + "Chapitre II : Modalités de liquidation et de versement de l'aide personnalisée au logement"; + "Titre III : Aide personnalisée au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + if + (((log_end_call + ["CalculAidePersonnaliséeLogementFoyer"; + "traitement_aide_finale_contributions_sociales_arrondi"] + ((log_variable_definition + ["CalculAidePersonnaliséeLogementFoyer"; + "traitement_aide_finale_contributions_sociales_arrondi"; + "output"] (embed_money) ((log_begin_call + ["CalculAidePersonnaliséeLogementFoyer"; + "traitement_aide_finale_contributions_sociales_arrondi"] + traitement_aide_finale_contributions_sociales_arrondi_) + ((log_variable_definition + ["CalculAidePersonnaliséeLogementFoyer"; + "traitement_aide_finale_contributions_sociales_arrondi"; + "input"] (embed_money) param_))))))) <$ + montant_minimal_aide_d823_24_) then + (money_of_cents_string "0") else + ((log_end_call + ["CalculAidePersonnaliséeLogementFoyer"; + "traitement_aide_finale_contributions_sociales_arrondi"] + ((log_variable_definition + ["CalculAidePersonnaliséeLogementFoyer"; + "traitement_aide_finale_contributions_sociales_arrondi"; + "output"] (embed_money) ((log_begin_call + ["CalculAidePersonnaliséeLogementFoyer"; + "traitement_aide_finale_contributions_sociales_arrondi"] + traitement_aide_finale_contributions_sociales_arrondi_) + ((log_variable_definition + ["CalculAidePersonnaliséeLogementFoyer"; + "traitement_aide_finale_contributions_sociales_arrondi"; + "input"] (embed_money) param_))))))))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=671; start_column=10; end_line=671; end_column=25; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]}))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=671; start_column=10; end_line=671; end_column=25; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + {CalculAidePersonnaliseeLogementFoyerOut.coefficient_multiplicateur_d832_25_out = + coefficient_multiplicateur_d832_25_; + CalculAidePersonnaliseeLogementFoyerOut.coefficient_r_d832_25_out = + coefficient_r_d832_25_; + CalculAidePersonnaliseeLogementFoyerOut.n_nombre_parts_d832_25_out = + n_nombre_parts_d832_25_; + CalculAidePersonnaliseeLogementFoyerOut.equivalence_loyer_eligible_out = + equivalence_loyer_eligible_; + CalculAidePersonnaliseeLogementFoyerOut.plafond_equivalence_loyer_eligible_out = + plafond_equivalence_loyer_eligible_; + CalculAidePersonnaliseeLogementFoyerOut.equivalence_loyer_minimale_out = + equivalence_loyer_minimale_; + CalculAidePersonnaliseeLogementFoyerOut.coefficient_prise_en_charge_d832_25_seuil_out = + coefficient_prise_en_charge_d832_25_seuil_; + CalculAidePersonnaliseeLogementFoyerOut.aide_finale_formule_out = + aide_finale_formule_; + CalculAidePersonnaliseeLogementFoyerOut.traitement_aide_finale_montant_minimal_out = + traitement_aide_finale_montant_minimal_} + +let calcul_aide_personnalisee_logement_accession_propriete (calcul_aide_personnalisee_logement_accession_propriete_in: CalculAidePersonnaliseeLogementAccessionProprieteIn.t) : CalculAidePersonnaliseeLogementAccessionProprieteOut.t = + let mensualite_principale_: money = calcul_aide_personnalisee_logement_accession_propriete_in.CalculAidePersonnaliseeLogementAccessionProprieteIn.mensualite_principale_in in + let ressources_menage_arrondies_: money = calcul_aide_personnalisee_logement_accession_propriete_in.CalculAidePersonnaliseeLogementAccessionProprieteIn.ressources_menage_arrondies_in in + let nombre_personnes_a_charge_: integer = calcul_aide_personnalisee_logement_accession_propriete_in.CalculAidePersonnaliseeLogementAccessionProprieteIn.nombre_personnes_a_charge_in in + let situation_familiale_calcul_apl_: SituationFamilialeCalculAPL.t = calcul_aide_personnalisee_logement_accession_propriete_in.CalculAidePersonnaliseeLogementAccessionProprieteIn.situation_familiale_calcul_apl_in in + let type_travaux_logement_: TypeTravauxLogementD83215.t = calcul_aide_personnalisee_logement_accession_propriete_in.CalculAidePersonnaliseeLogementAccessionProprieteIn.type_travaux_logement_in in + let date_signature_pret_: date = calcul_aide_personnalisee_logement_accession_propriete_in.CalculAidePersonnaliseeLogementAccessionProprieteIn.date_signature_pret_in in + let local_habite_premiere_fois_beneficiaire_: bool = calcul_aide_personnalisee_logement_accession_propriete_in.CalculAidePersonnaliseeLogementAccessionProprieteIn.local_habite_premiere_fois_beneficiaire_in in + let date_entree_logement_: date = calcul_aide_personnalisee_logement_accession_propriete_in.CalculAidePersonnaliseeLogementAccessionProprieteIn.date_entree_logement_in in + let copropriete_: bool = calcul_aide_personnalisee_logement_accession_propriete_in.CalculAidePersonnaliseeLogementAccessionProprieteIn.copropriete_in in + let situation_r822_11_13_17_: bool = calcul_aide_personnalisee_logement_accession_propriete_in.CalculAidePersonnaliseeLogementAccessionProprieteIn.situation_r822_11_13_17_in in + let zone_: ZoneDHabitation.t = calcul_aide_personnalisee_logement_accession_propriete_in.CalculAidePersonnaliseeLogementAccessionProprieteIn.zone_in in + let type_pret_: TypePret.t = calcul_aide_personnalisee_logement_accession_propriete_in.CalculAidePersonnaliseeLogementAccessionProprieteIn.type_pret_in in + let anciennete_logement_: NeufOuAncien.t = calcul_aide_personnalisee_logement_accession_propriete_in.CalculAidePersonnaliseeLogementAccessionProprieteIn.anciennete_logement_in in + let date_courante_: date = calcul_aide_personnalisee_logement_accession_propriete_in.CalculAidePersonnaliseeLogementAccessionProprieteIn.date_courante_in in + let montant_forfaitaire_d832_10_: money = (log_variable_definition + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "montant_forfaitaire_d832_10"] (embed_money) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=720; start_column=11; end_line=720; end_column=38; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=2578; start_column=14; end_line=2578; end_column=41; + law_headings=["Article 20"; + "Chapitre IV : Calcul de l'aide personnalisée au logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + true)) (fun (_: _) -> money_of_cents_string "500")) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=720; start_column=11; end_line=720; end_column=38; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let montant_minimal_aide_d832_10_: money = (log_variable_definition + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "montant_minimal_aide_d832_10"] (embed_money) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=721; start_column=11; end_line=721; end_column=39; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=2589; start_column=14; end_line=2589; end_column=42; + law_headings=["Article 21"; + "Chapitre IV : Calcul de l'aide personnalisée au logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + true)) (fun (_: _) -> money_of_cents_string "1000")) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=721; start_column=11; end_line=721; end_column=39; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let coefficient_multiplicateur_d832_11_: money = (log_variable_definition + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "coefficient_multiplicateur_d832_11"] (embed_money) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=723; start_column=11; end_line=723; end_column=45; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=2598; start_column=15; end_line=2598; end_column=49; + law_headings=["Article 22"; + "Chapitre IV : Calcul de l'aide personnalisée au logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + true)) (fun (_: _) -> money_of_cents_string "2211133")) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=723; start_column=11; end_line=723; end_column=45; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let coefficient_multiplicateur_d832_18_: decimal = (log_variable_definition + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "coefficient_multiplicateur_d832_18"] (embed_decimal) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=724; start_column=11; end_line=724; end_column=45; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=2690; start_column=14; end_line=2690; end_column=48; + law_headings=["Article 26"; + "Chapitre IV : Calcul de l'aide personnalisée au logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + true)) (fun (_: _) -> decimal_of_string "16.25")) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=724; start_column=11; end_line=724; end_column=45; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let montant_limite_tranches_d832_15_1_: money = (log_variable_definition + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "montant_limite_tranches_d832_15_1"] (embed_money) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=725; start_column=11; end_line=725; end_column=44; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=2613; start_column=14; end_line=2613; end_column=47; + law_headings=["Article 23"; + "Chapitre IV : Calcul de l'aide personnalisée au logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + true)) (fun (_: _) -> money_of_cents_string "560085")) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=725; start_column=11; end_line=725; end_column=44; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let taux_tranche_inferieure_d832_15_1_: decimal = (log_variable_definition + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "taux_tranche_inférieure_d832_15_1"] (embed_decimal) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=726; start_column=11; end_line=726; end_column=44; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=2614; start_column=14; end_line=2614; end_column=47; + law_headings=["Article 23"; + "Chapitre IV : Calcul de l'aide personnalisée au logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + true)) (fun (_: _) -> decimal_of_string "0.208")) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=726; start_column=11; end_line=726; end_column=44; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let taux_tranche_superieure_d832_15_1_: decimal = (log_variable_definition + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "taux_tranche_supérieure_d832_15_1"] (embed_decimal) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=727; start_column=11; end_line=727; end_column=44; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=2615; start_column=14; end_line=2615; end_column=47; + law_headings=["Article 23"; + "Chapitre IV : Calcul de l'aide personnalisée au logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + true)) (fun (_: _) -> decimal_of_string "0.416")) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=727; start_column=11; end_line=727; end_column=44; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let taux_francs_vers_euros_: decimal = (log_variable_definition + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "taux_francs_vers_euros"] (embed_decimal) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=728; start_column=11; end_line=728; end_column=33; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/autres_sources.catala_fr"; + start_line=275; start_column=14; end_line=275; end_column=36; + law_headings=["Article premier"; + "Règlement (CE) n°2866/98 du conseil du 31 décembre 1998 concernant les taux de conversion entre l'euro et les monnaies des États membres adoptant l'euro"]} + true)) + (fun (_: _) -> + (decimal_of_string "1.") /& (decimal_of_string "6.55957"))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=728; start_column=11; end_line=728; end_column=33; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let calcul_nombre_parts_dot_nombre_personnes_a_charge_: integer = + try ((log_variable_definition + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "calcul_nombre_parts.nombre_personnes_à_charge"] (embed_integer) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=730; start_column=3; end_line=730; end_column=22; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=3352; start_column=14; end_line=3352; end_column=59; + law_headings=["Article D832-11"; + "Section 2 : Accession à la propriété"; + "Chapitre II : Modalités de liquidation et de versement de l'aide personnalisée au logement"; + "Titre III : Aide personnalisée au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) (fun (_: _) -> nombre_personnes_a_charge_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=681; start_column=10; end_line=681; end_column=35; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let calcul_nombre_parts_dot_situation_familiale_calcul_apl_: SituationFamilialeCalculAPL.t = + try ((log_variable_definition + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "calcul_nombre_parts.situation_familiale_calcul_apl"] + (embed_situation_familiale_calcul_a_p_l) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=730; start_column=3; end_line=730; end_column=22; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=3354; start_column=14; end_line=3354; end_column=64; + law_headings=["Article D832-11"; + "Section 2 : Accession à la propriété"; + "Chapitre II : Modalités de liquidation et de versement de l'aide personnalisée au logement"; + "Titre III : Aide personnalisée au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) (fun (_: _) -> situation_familiale_calcul_apl_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=682; start_column=10; end_line=682; end_column=40; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let result_: CalculNombrePartsAccessionProprieteOut.t = (log_end_call + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "calcul_nombre_parts"; "CalculNombrePartsAccessionPropriété"] + ((log_begin_call + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "calcul_nombre_parts"; "CalculNombrePartsAccessionPropriété"] + calcul_nombre_parts_accession_propriete) + {CalculNombrePartsAccessionProprieteIn.nombre_personnes_a_charge_in = + calcul_nombre_parts_dot_nombre_personnes_a_charge_; + CalculNombrePartsAccessionProprieteIn.situation_familiale_calcul_apl_in = + calcul_nombre_parts_dot_situation_familiale_calcul_apl_})) in + let calcul_nombre_parts_dot_n_nombre_parts_d832_11_: decimal = result_.CalculNombrePartsAccessionProprieteOut.n_nombre_parts_d832_11_out in + let coefficient_multiplicateur_d832_17_3_: decimal = (log_variable_definition + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "coefficient_multiplicateur_d832_17_3"] (embed_decimal) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=722; start_column=11; end_line=722; end_column=47; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=2672; start_column=14; end_line=2672; end_column=50; + law_headings=["Article 25"; + "Chapitre IV : Calcul de l'aide personnalisée au logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + true)) + (fun (_: _) -> + match anciennete_logement_ + with + | NeufOuAncien.Neuf _ -> + ( if + (date_signature_pret_ <=@ + (date_of_numbers (1998) (10) (1))) then + (decimal_of_string "0.0226") else + (decimal_of_string "0.0234")) + | NeufOuAncien.Ancien ameliore_par_occupant_ -> + (match ameliore_par_occupant_ + with + | AmelioreParOccupant.Oui _ -> (decimal_of_string "0.0172") + | AmelioreParOccupant.Non _ -> + ( if + (date_signature_pret_ <=@ + (date_of_numbers (1998) (10) (1))) then + (decimal_of_string "0.0226") else + (decimal_of_string "0.0234"))))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=722; start_column=11; end_line=722; end_column=47; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let contributions_sociales_dot_date_courante_: date = + try ((log_variable_definition + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "contributions_sociales.date_courante"] (embed_date) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=733; start_column=3; end_line=733; end_column=25; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=744; start_column=14; end_line=744; end_column=50; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> date_courante_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=544; start_column=10; end_line=544; end_column=23; + law_headings=["Calcul des contributions sociales s'appliquant aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let result_: ContributionsSocialesAidesPersonnelleLogementOut.t = (log_end_call + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "contributions_sociales"; + "ContributionsSocialesAidesPersonnelleLogement"] ((log_begin_call + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "contributions_sociales"; + "ContributionsSocialesAidesPersonnelleLogement"] + contributions_sociales_aides_personnelle_logement) + {ContributionsSocialesAidesPersonnelleLogementIn.date_courante_in = + contributions_sociales_dot_date_courante_})) in + let contributions_sociales_dot_montant_: money -> money = result_.ContributionsSocialesAidesPersonnelleLogementOut.montant_out in + let montant_forfaitaire_charges_d832_10_: money = (log_variable_definition + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "montant_forfaitaire_charges_d832_10"] (embed_money) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=719; start_column=11; end_line=719; end_column=46; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=719; start_column=11; + end_line=719; end_column=46; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=719; start_column=11; + end_line=719; end_column=46; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=2646; start_column=7; + end_line=2646; end_column=18; + law_headings=["Article 24"; + "Chapitre IV : Calcul de l'aide personnalisée au logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + ((date_courante_ >=@ + (date_of_numbers (2021) (10) (1))) && + copropriete_))) + (fun (_: _) -> + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "2710") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "5422")) +$ + ((money_of_cents_string "1229") *$ + (decimal_of_integer + nombre_personnes_a_charge_)))); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=719; start_column=11; + end_line=719; end_column=46; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/archives.catala_fr"; + start_line=464; start_column=7; + end_line=464; end_column=18; + law_headings=["Article 24"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"; + "Articles valables du 1er octobre 2020 au 1er octobre 2021"; + "Archives législatives et réglementaires"]} + (((date_courante_ <@ + (date_of_numbers (2021) (10) (1))) && + (date_courante_ >=@ + (date_of_numbers (2020) (10) (1)))) && + copropriete_))) + (fun (_: _) -> + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "2699") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "5399")) +$ + ((money_of_cents_string "1224") *$ + (decimal_of_integer + nombre_personnes_a_charge_))))|]) + (fun (_: _) -> false) (fun (_: _) -> raise EmptyError))|]) + (fun (_: _) -> true) + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=719; start_column=11; end_line=719; end_column=46; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=719; start_column=11; + end_line=719; end_column=46; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=2567; start_column=29; + end_line=2567; end_column=64; + law_headings=["Article 19"; + "Chapitre IV : Calcul de l'aide personnalisée au logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + (date_courante_ >=@ + (date_of_numbers (2021) (10) (1))))) + (fun (_: _) -> + (money_of_cents_string "5422") +$ + ((money_of_cents_string "1229") *$ + (decimal_of_integer nombre_personnes_a_charge_)))); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=719; start_column=11; + end_line=719; end_column=46; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/archives.catala_fr"; + start_line=429; start_column=29; + end_line=429; end_column=64; + law_headings=["Article 19"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"; + "Articles valables du 1er octobre 2020 au 1er octobre 2021"; + "Archives législatives et réglementaires"]} + ((date_courante_ <@ + (date_of_numbers (2021) (10) (1))) && + (date_courante_ >=@ + (date_of_numbers (2020) (10) (1)))))) + (fun (_: _) -> + (money_of_cents_string "5399") +$ + ((money_of_cents_string "1224") *$ + (decimal_of_integer nombre_personnes_a_charge_))))|]) + (fun (_: _) -> false) (fun (_: _) -> raise EmptyError))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=719; start_column=11; end_line=719; end_column=46; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let traitement_aide_finale_minoration_forfaitaire_: money -> money = (log_variable_definition + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "traitement_aide_finale_minoration_forfaitaire"] (unembeddable) ( + try + (fun (param_: money) -> + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=738; start_column=10; end_line=738; end_column=32; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=3194; start_column=14; + end_line=3194; end_column=36; + law_headings=["Article D832-10"; + "Section 2 : Accession à la propriété"; + "Chapitre II : Modalités de liquidation et de versement de l'aide personnalisée au logement"; + "Titre III : Aide personnalisée au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + if + ((param_ -$ montant_forfaitaire_d832_10_) >=$ + (money_of_cents_string "0")) then + (param_ -$ montant_forfaitaire_d832_10_) else + (money_of_cents_string "0"))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=738; start_column=10; end_line=738; end_column=32; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]}))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=738; start_column=10; end_line=738; end_column=32; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let ressources_menage_avec_d832_18_: money = (log_variable_definition + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "ressources_ménage_avec_d832_18"] (embed_money) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=718; start_column=11; end_line=718; end_column=41; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=718; start_column=11; + end_line=718; end_column=41; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=3660; start_column=5; + end_line=3660; end_column=28; + law_headings=["Article D832-18"; + "Section 2 : Accession à la propriété"; + "Chapitre II : Modalités de liquidation et de versement de l'aide personnalisée au logement"; + "Titre III : Aide personnalisée au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + situation_r822_11_13_17_)) + (fun (_: _) -> ressources_menage_arrondies_))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=3652; start_column=14; end_line=3652; end_column=44; + law_headings=["Article D832-18"; + "Section 2 : Accession à la propriété"; + "Chapitre II : Modalités de liquidation et de versement de l'aide personnalisée au logement"; + "Titre III : Aide personnalisée au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + if + (ressources_menage_arrondies_ <=$ + (mensualite_principale_ *$ + coefficient_multiplicateur_d832_18_)) then + (mensualite_principale_ *$ coefficient_multiplicateur_d832_18_) + else ressources_menage_arrondies_)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=718; start_column=11; end_line=718; end_column=41; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let calcul_plafond_mensualite_d832_10_3_: date -> money = (log_variable_definition + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "calcul_plafond_mensualité_d832_10_3"] (unembeddable) ( + try + (fun (param_: date) -> + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=709; start_column=11; end_line=709; end_column=46; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=709; start_column=11; + end_line=709; end_column=46; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=621; start_column=5; + end_line=624; end_column=33; + law_headings=["Article 17"; + "Chapitre IV : Calcul de l'aide personnalisée au logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + ((param_ >=@ (date_of_numbers (1992) (6) (30))) && + ((param_ <@ (date_of_numbers (1994) (11) (27))) + && + ((match anciennete_logement_ + with + | NeufOuAncien.Neuf _ -> true + | NeufOuAncien.Ancien _ -> false) && + (match type_pret_ + with + | TypePret.D331_32 _ -> true + | TypePret.D331_63_64 _ -> false + | TypePret.D331_59_8 _ -> false + | TypePret.D331_76_1 _ -> false + | TypePret.Autre _ -> false)))))) + (fun (_: _) -> + (match zone_ + with + | ZoneDHabitation.Zone1 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "208500") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "251500")) else + ((money_of_cents_string "294500") +$ + ((money_of_cents_string "43000") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone2 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "186000") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "223900")) else + ((money_of_cents_string "261800") +$ + ((money_of_cents_string "37900") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone3 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "173600") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "208200")) else + ((money_of_cents_string "242800") +$ + ((money_of_cents_string "35600") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1"))))))) *$ + taux_francs_vers_euros_)); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=709; start_column=11; + end_line=709; end_column=46; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=665; start_column=5; + end_line=668; end_column=33; + law_headings=["Article 17"; + "Chapitre IV : Calcul de l'aide personnalisée au logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + ((param_ >=@ (date_of_numbers (1992) (6) (30))) && + ((param_ <@ (date_of_numbers (1994) (11) (27))) + && + ((match anciennete_logement_ + with + | NeufOuAncien.Neuf _ -> false + | NeufOuAncien.Ancien _ -> true) && + (match type_pret_ + with + | TypePret.D331_32 _ -> true + | TypePret.D331_63_64 _ -> false + | TypePret.D331_59_8 _ -> false + | TypePret.D331_76_1 _ -> false + | TypePret.Autre _ -> false)))))) + (fun (_: _) -> + (match zone_ + with + | ZoneDHabitation.Zone1 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "167800") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "202500")) else + ((money_of_cents_string "237200") +$ + ((money_of_cents_string "37400") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone2 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "146900") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "180100")) else + ((money_of_cents_string "210600") +$ + ((money_of_cents_string "30500") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone3 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "139700") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "167600")) else + ((money_of_cents_string "195500") +$ + ((money_of_cents_string "27900") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1"))))))) *$ + taux_francs_vers_euros_)); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=709; start_column=11; + end_line=709; end_column=46; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=710; start_column=5; + end_line=712; end_column=33; + law_headings=["Article 17"; + "Chapitre IV : Calcul de l'aide personnalisée au logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + ((param_ >=@ (date_of_numbers (1994) (11) (27))) && + ((match anciennete_logement_ + with + | NeufOuAncien.Neuf _ -> true + | NeufOuAncien.Ancien _ -> false) && + (match type_pret_ + with + | TypePret.D331_32 _ -> true + | TypePret.D331_63_64 _ -> false + | TypePret.D331_59_8 _ -> false + | TypePret.D331_76_1 _ -> false + | TypePret.Autre _ -> false))))) + (fun (_: _) -> + (match zone_ + with + | ZoneDHabitation.Zone1 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "184000") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "220000")) else + ((money_of_cents_string "260000") +$ + ((money_of_cents_string "38000") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone2 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "164200") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "197700")) else + ((money_of_cents_string "231200") +$ + ((money_of_cents_string "33500") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone3 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "153200") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "183700")) else + ((money_of_cents_string "214200") +$ + ((money_of_cents_string "30500") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1"))))))) *$ + taux_francs_vers_euros_)); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=709; start_column=11; + end_line=709; end_column=46; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=753; start_column=5; + end_line=755; end_column=33; + law_headings=["Article 17"; + "Chapitre IV : Calcul de l'aide personnalisée au logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + ((param_ >=@ (date_of_numbers (1994) (11) (27))) && + ((match anciennete_logement_ + with + | NeufOuAncien.Neuf _ -> false + | NeufOuAncien.Ancien _ -> true) && + (match type_pret_ + with + | TypePret.D331_32 _ -> true + | TypePret.D331_63_64 _ -> false + | TypePret.D331_59_8 _ -> false + | TypePret.D331_76_1 _ -> false + | TypePret.Autre _ -> false))))) + (fun (_: _) -> + (match zone_ + with + | ZoneDHabitation.Zone1 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "148100") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "178700")) else + ((money_of_cents_string "209300") +$ + ((money_of_cents_string "30600") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone2 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "132000") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "158900")) else + ((money_of_cents_string "185800") +$ + ((money_of_cents_string "26900") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone3 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "123300") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "147900")) else + ((money_of_cents_string "172500") +$ + ((money_of_cents_string "24600") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1"))))))) *$ + taux_francs_vers_euros_)); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=709; start_column=11; + end_line=709; end_column=46; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=804; start_column=5; + end_line=807; end_column=36; + law_headings=["Article 18"; + "Chapitre IV : Calcul de l'aide personnalisée au logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + ((param_ >=@ (date_of_numbers (1992) (6) (30))) && + ((param_ <@ (date_of_numbers (1994) (11) (27))) + && + ((match anciennete_logement_ + with + | NeufOuAncien.Neuf _ -> true + | NeufOuAncien.Ancien _ -> false) && + (match type_pret_ + with + | TypePret.D331_32 _ -> false + | TypePret.D331_63_64 _ -> true + | TypePret.D331_59_8 _ -> false + | TypePret.D331_76_1 _ -> false + | TypePret.Autre _ -> false)))))) + (fun (_: _) -> + (match zone_ + with + | ZoneDHabitation.Zone1 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "208500") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "251500")) else + ((money_of_cents_string "294500") +$ + ((money_of_cents_string "43000") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone2 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "186000") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "223900")) else + ((money_of_cents_string "261800") +$ + ((money_of_cents_string "37900") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone3 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "173600") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "208200")) else + ((money_of_cents_string "242800") +$ + ((money_of_cents_string "34600") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1"))))))) *$ + taux_francs_vers_euros_)); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=709; start_column=11; + end_line=709; end_column=46; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=848; start_column=5; + end_line=854; end_column=36; + law_headings=["Article 18"; + "Chapitre IV : Calcul de l'aide personnalisée au logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + ((param_ >=@ (date_of_numbers (1992) (6) (30))) && + ((param_ <@ (date_of_numbers (1994) (11) (27))) + && + ((match anciennete_logement_ + with + | NeufOuAncien.Neuf _ -> false + | NeufOuAncien.Ancien ameliore_par_occupant_ -> + (match ameliore_par_occupant_ + with + | AmelioreParOccupant.Oui _ -> false + | AmelioreParOccupant.Non _ -> true)) + && + (match type_pret_ + with + | TypePret.D331_32 _ -> false + | TypePret.D331_63_64 _ -> true + | TypePret.D331_59_8 _ -> false + | TypePret.D331_76_1 _ -> false + | TypePret.Autre _ -> false)))))) + (fun (_: _) -> + (match zone_ + with + | ZoneDHabitation.Zone1 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "167800") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "202500")) else + ((money_of_cents_string "237200") +$ + ((money_of_cents_string "34700") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone2 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "149600") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "223900")) else + ((money_of_cents_string "261800") +$ + ((money_of_cents_string "37900") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone3 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "139700") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "208200")) else + ((money_of_cents_string "242800") +$ + ((money_of_cents_string "34600") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1"))))))) *$ + taux_francs_vers_euros_)); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=709; start_column=11; + end_line=709; end_column=46; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=895; start_column=5; + end_line=901; end_column=36; + law_headings=["Article 18"; + "Chapitre IV : Calcul de l'aide personnalisée au logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + ((param_ >=@ (date_of_numbers (1992) (6) (30))) && + ((param_ <@ (date_of_numbers (1994) (11) (27))) + && + ((match anciennete_logement_ + with + | NeufOuAncien.Neuf _ -> false + | NeufOuAncien.Ancien ameliore_par_occupant_ -> + (match ameliore_par_occupant_ + with + | AmelioreParOccupant.Oui _ -> true + | AmelioreParOccupant.Non _ -> false)) + && + (match type_pret_ + with + | TypePret.D331_32 _ -> false + | TypePret.D331_63_64 _ -> true + | TypePret.D331_59_8 _ -> false + | TypePret.D331_76_1 _ -> false + | TypePret.Autre _ -> false)))))) + (fun (_: _) -> + ( if + (nombre_personnes_a_charge_ = (integer_of_string + "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "86900") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "97100")) else + ((money_of_cents_string "107300") +$ + ((money_of_cents_string "10200") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) *$ + taux_francs_vers_euros_)); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=709; start_column=11; + end_line=709; end_column=46; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=927; start_column=5; + end_line=930; end_column=36; + law_headings=["Article 18"; + "Chapitre IV : Calcul de l'aide personnalisée au logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + ((param_ >=@ (date_of_numbers (1994) (11) (27))) && + ((param_ <@ (date_of_numbers (2000) (6) (30))) && + ((match anciennete_logement_ + with + | NeufOuAncien.Neuf _ -> true + | NeufOuAncien.Ancien _ -> false) && + (match type_pret_ + with + | TypePret.D331_32 _ -> false + | TypePret.D331_63_64 _ -> true + | TypePret.D331_59_8 _ -> false + | TypePret.D331_76_1 _ -> false + | TypePret.Autre _ -> false)))))) + (fun (_: _) -> + (match zone_ + with + | ZoneDHabitation.Zone1 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "198100") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "239000")) else + ((money_of_cents_string "279900") +$ + ((money_of_cents_string "40900") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone2 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "176800") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "212800")) else + ((money_of_cents_string "248800") +$ + ((money_of_cents_string "36000") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone3 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "165000") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "197900")) else + ((money_of_cents_string "230800") +$ + ((money_of_cents_string "32900") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1"))))))) *$ + taux_francs_vers_euros_)); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=709; start_column=11; + end_line=709; end_column=46; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=971; start_column=5; + end_line=974; end_column=36; + law_headings=["Article 18"; + "Chapitre IV : Calcul de l'aide personnalisée au logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + ((param_ >=@ (date_of_numbers (1994) (11) (27))) && + ((param_ <@ (date_of_numbers (2000) (6) (30))) && + ((match anciennete_logement_ + with + | NeufOuAncien.Neuf _ -> false + | NeufOuAncien.Ancien _ -> true) && + (match type_pret_ + with + | TypePret.D331_32 _ -> false + | TypePret.D331_63_64 _ -> true + | TypePret.D331_59_8 _ -> false + | TypePret.D331_76_1 _ -> false + | TypePret.Autre _ -> false)))))) + (fun (_: _) -> + (match zone_ + with + | ZoneDHabitation.Zone1 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "159500") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "192500")) else + ((money_of_cents_string "225500") +$ + ((money_of_cents_string "33000") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone2 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "142200") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "171200")) else + ((money_of_cents_string "200200") +$ + ((money_of_cents_string "29000") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone3 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "132800") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "159300")) else + ((money_of_cents_string "185800") +$ + ((money_of_cents_string "26500") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1"))))))) *$ + taux_francs_vers_euros_)); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=709; start_column=11; + end_line=709; end_column=46; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=1016; start_column=5; + end_line=1019; end_column=36; + law_headings=["Article 18"; + "Chapitre IV : Calcul de l'aide personnalisée au logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + ((param_ >=@ (date_of_numbers (2000) (6) (30))) && + ((param_ <=@ (date_of_numbers (2001) (6) (30))) + && + ((match anciennete_logement_ + with + | NeufOuAncien.Neuf _ -> true + | NeufOuAncien.Ancien _ -> false) && + (match type_pret_ + with + | TypePret.D331_32 _ -> false + | TypePret.D331_63_64 _ -> true + | TypePret.D331_59_8 _ -> false + | TypePret.D331_76_1 _ -> false + | TypePret.Autre _ -> false)))))) + (fun (_: _) -> + (match zone_ + with + | ZoneDHabitation.Zone1 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "200100") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "141400")) else + ((money_of_cents_string "282700") +$ + ((money_of_cents_string "41300") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone2 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "178600") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "215000")) else + ((money_of_cents_string "251400") +$ + ((money_of_cents_string "36400") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone3 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "166700") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "199900")) else + ((money_of_cents_string "233100") +$ + ((money_of_cents_string "33200") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1"))))))) *$ + taux_francs_vers_euros_)); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=709; start_column=11; + end_line=709; end_column=46; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=1060; start_column=5; + end_line=1063; end_column=36; + law_headings=["Article 18"; + "Chapitre IV : Calcul de l'aide personnalisée au logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + ((param_ >=@ (date_of_numbers (2000) (6) (30))) && + ((param_ <=@ (date_of_numbers (2001) (6) (30))) + && + ((match anciennete_logement_ + with + | NeufOuAncien.Neuf _ -> false + | NeufOuAncien.Ancien _ -> true) && + (match type_pret_ + with + | TypePret.D331_32 _ -> false + | TypePret.D331_63_64 _ -> true + | TypePret.D331_59_8 _ -> false + | TypePret.D331_76_1 _ -> false + | TypePret.Autre _ -> false)))))) + (fun (_: _) -> + (match zone_ + with + | ZoneDHabitation.Zone1 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "161100") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "194400")) else + ((money_of_cents_string "227700") +$ + ((money_of_cents_string "33300") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone2 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "143600") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "172900")) else + ((money_of_cents_string "202200") +$ + ((money_of_cents_string "29300") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone3 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "134100") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "160900")) else + ((money_of_cents_string "187700") +$ + ((money_of_cents_string "26800") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1"))))))) *$ + taux_francs_vers_euros_)); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=709; start_column=11; + end_line=709; end_column=46; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=1107; start_column=5; + end_line=1110; end_column=36; + law_headings=["Article 18"; + "Chapitre IV : Calcul de l'aide personnalisée au logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + ((param_ >=@ (date_of_numbers (2001) (7) (1))) && + ((param_ <@ (date_of_numbers (2001) (12) (31))) + && + ((match anciennete_logement_ + with + | NeufOuAncien.Neuf _ -> true + | NeufOuAncien.Ancien _ -> false) && + (match type_pret_ + with + | TypePret.D331_32 _ -> false + | TypePret.D331_63_64 _ -> true + | TypePret.D331_59_8 _ -> false + | TypePret.D331_76_1 _ -> false + | TypePret.Autre _ -> false)))))) + (fun (_: _) -> + (match zone_ + with + | ZoneDHabitation.Zone1 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "202500") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "244300")) else + ((money_of_cents_string "286100") +$ + ((money_of_cents_string "41800") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone2 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "180700") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "217500")) else + ((money_of_cents_string "254300") +$ + ((money_of_cents_string "36800") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone3 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "168700") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "202300")) else + ((money_of_cents_string "235900") +$ + ((money_of_cents_string "33600") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1"))))))) *$ + taux_francs_vers_euros_)); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=709; start_column=11; + end_line=709; end_column=46; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=1150; start_column=5; + end_line=1153; end_column=36; + law_headings=["Article 18"; + "Chapitre IV : Calcul de l'aide personnalisée au logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + ((param_ >=@ (date_of_numbers (2002) (1) (1))) && + ((param_ <@ (date_of_numbers (2002) (6) (30))) && + ((match anciennete_logement_ + with + | NeufOuAncien.Neuf _ -> true + | NeufOuAncien.Ancien _ -> false) && + (match type_pret_ + with + | TypePret.D331_32 _ -> false + | TypePret.D331_63_64 _ -> true + | TypePret.D331_59_8 _ -> false + | TypePret.D331_76_1 _ -> false + | TypePret.Autre _ -> false)))))) + (fun (_: _) -> + match zone_ + with + | ZoneDHabitation.Zone1 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "30871") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "37243")) else + ((money_of_cents_string "43615") +$ + ((money_of_cents_string "6372") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone2 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "27548") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "33148")) else + ((money_of_cents_string "38768") +$ + ((money_of_cents_string "5610") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone3 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "25718") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "30840")) else + ((money_of_cents_string "35962") +$ + ((money_of_cents_string "5122") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))))); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=709; start_column=11; + end_line=709; end_column=46; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=1196; start_column=5; + end_line=1199; end_column=36; + law_headings=["Article 18"; + "Chapitre IV : Calcul de l'aide personnalisée au logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + ((param_ >=@ (date_of_numbers (2001) (7) (1))) && + ((param_ <@ (date_of_numbers (2001) (12) (31))) + && + ((match anciennete_logement_ + with + | NeufOuAncien.Neuf _ -> false + | NeufOuAncien.Ancien _ -> true) && + (match type_pret_ + with + | TypePret.D331_32 _ -> false + | TypePret.D331_63_64 _ -> true + | TypePret.D331_59_8 _ -> false + | TypePret.D331_76_1 _ -> false + | TypePret.Autre _ -> false)))))) + (fun (_: _) -> + (match zone_ + with + | ZoneDHabitation.Zone1 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "163000") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "196700")) else + ((money_of_cents_string "230400") +$ + ((money_of_cents_string "33700") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone2 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "145300") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "175000")) else + ((money_of_cents_string "204700") +$ + ((money_of_cents_string "29700") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone3 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "135700") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "162800")) else + ((money_of_cents_string "189900") +$ + ((money_of_cents_string "27100") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1"))))))) *$ + taux_francs_vers_euros_)); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=709; start_column=11; + end_line=709; end_column=46; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=1239; start_column=5; + end_line=1242; end_column=36; + law_headings=["Article 18"; + "Chapitre IV : Calcul de l'aide personnalisée au logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + ((param_ >=@ (date_of_numbers (2002) (1) (1))) && + ((param_ <@ (date_of_numbers (2002) (6) (30))) && + ((match anciennete_logement_ + with + | NeufOuAncien.Neuf _ -> false + | NeufOuAncien.Ancien _ -> true) && + (match type_pret_ + with + | TypePret.D331_32 _ -> false + | TypePret.D331_63_64 _ -> true + | TypePret.D331_59_8 _ -> false + | TypePret.D331_76_1 _ -> false + | TypePret.Autre _ -> false)))))) + (fun (_: _) -> + match zone_ + with + | ZoneDHabitation.Zone1 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "24849") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "29987")) else + ((money_of_cents_string "35125") +$ + ((money_of_cents_string "5138") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone2 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "22151") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "26679")) else + ((money_of_cents_string "31207") +$ + ((money_of_cents_string "4528") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone3 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "20687") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "24818")) else + ((money_of_cents_string "28949") +$ + ((money_of_cents_string "4131") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))))); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=709; start_column=11; + end_line=709; end_column=46; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=1284; start_column=5; + end_line=1287; end_column=36; + law_headings=["Article 18"; + "Chapitre IV : Calcul de l'aide personnalisée au logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + ((param_ >=@ (date_of_numbers (2002) (6) (30))) && + ((param_ <@ (date_of_numbers (2003) (6) (30))) && + ((match anciennete_logement_ + with + | NeufOuAncien.Neuf _ -> true + | NeufOuAncien.Ancien _ -> false) && + (match type_pret_ + with + | TypePret.D331_32 _ -> false + | TypePret.D331_63_64 _ -> true + | TypePret.D331_59_8 _ -> false + | TypePret.D331_76_1 _ -> false + | TypePret.Autre _ -> false)))))) + (fun (_: _) -> + match zone_ + with + | ZoneDHabitation.Zone1 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "31241") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "37689")) else + ((money_of_cents_string "44137") +$ + ((money_of_cents_string "6448") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone2 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "27879") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "33556")) else + ((money_of_cents_string "39233") +$ + ((money_of_cents_string "5677") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone3 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "26027") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "31210")) else + ((money_of_cents_string "36393") +$ + ((money_of_cents_string "5183") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))))); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=709; start_column=11; + end_line=709; end_column=46; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=1328; start_column=5; + end_line=1331; end_column=36; + law_headings=["Article 18"; + "Chapitre IV : Calcul de l'aide personnalisée au logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + ((param_ >=@ (date_of_numbers (2002) (6) (30))) && + ((param_ <@ (date_of_numbers (2003) (6) (30))) && + ((match anciennete_logement_ + with + | NeufOuAncien.Neuf _ -> false + | NeufOuAncien.Ancien _ -> true) && + (match type_pret_ + with + | TypePret.D331_32 _ -> false + | TypePret.D331_63_64 _ -> true + | TypePret.D331_59_8 _ -> false + | TypePret.D331_76_1 _ -> false + | TypePret.Autre _ -> false)))))) + (fun (_: _) -> + match zone_ + with + | ZoneDHabitation.Zone1 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "25147") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "30347")) else + ((money_of_cents_string "35547") +$ + ((money_of_cents_string "5200") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone2 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "22417") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "26999")) else + ((money_of_cents_string "31581") +$ + ((money_of_cents_string "4582") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone3 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "20935") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "25116")) else + ((money_of_cents_string "29297") +$ + ((money_of_cents_string "4181") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))))); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=709; start_column=11; + end_line=709; end_column=46; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=1373; start_column=5; + end_line=1376; end_column=36; + law_headings=["Article 18"; + "Chapitre IV : Calcul de l'aide personnalisée au logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + ((param_ >=@ (date_of_numbers (2003) (6) (30))) && + ((param_ <@ (date_of_numbers (2005) (8) (31))) && + ((match anciennete_logement_ + with + | NeufOuAncien.Neuf _ -> true + | NeufOuAncien.Ancien _ -> false) && + (match type_pret_ + with + | TypePret.D331_32 _ -> false + | TypePret.D331_63_64 _ -> true + | TypePret.D331_59_8 _ -> false + | TypePret.D331_76_1 _ -> false + | TypePret.Autre _ -> false)))))) + (fun (_: _) -> + match zone_ + with + | ZoneDHabitation.Zone1 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "31616") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "38141")) else + ((money_of_cents_string "44666") +$ + ((money_of_cents_string "6525") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone2 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "28214") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "33959")) else + ((money_of_cents_string "39704") +$ + ((money_of_cents_string "5745") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone3 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "26339") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "31584")) else + ((money_of_cents_string "36829") +$ + ((money_of_cents_string "5245") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))))); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=709; start_column=11; + end_line=709; end_column=46; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=1417; start_column=5; + end_line=1420; end_column=36; + law_headings=["Article 18"; + "Chapitre IV : Calcul de l'aide personnalisée au logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + ((param_ >=@ (date_of_numbers (2003) (6) (30))) && + ((param_ <@ (date_of_numbers (2005) (8) (31))) && + ((match anciennete_logement_ + with + | NeufOuAncien.Neuf _ -> false + | NeufOuAncien.Ancien _ -> true) && + (match type_pret_ + with + | TypePret.D331_32 _ -> false + | TypePret.D331_63_64 _ -> true + | TypePret.D331_59_8 _ -> false + | TypePret.D331_76_1 _ -> false + | TypePret.Autre _ -> false)))))) + (fun (_: _) -> + match zone_ + with + | ZoneDHabitation.Zone1 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "25449") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "30711")) else + ((money_of_cents_string "35973") +$ + ((money_of_cents_string "5262") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone2 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "22686") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "27323")) else + ((money_of_cents_string "31960") +$ + ((money_of_cents_string "4637") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone3 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "21186") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "25417")) else + ((money_of_cents_string "26948") +$ + ((money_of_cents_string "4231") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))))); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=709; start_column=11; + end_line=709; end_column=46; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=1462; start_column=5; + end_line=1465; end_column=36; + law_headings=["Article 18"; + "Chapitre IV : Calcul de l'aide personnalisée au logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + ((param_ >=@ (date_of_numbers (2005) (8) (31))) && + ((param_ <@ (date_of_numbers (2006) (12) (31))) + && + ((match anciennete_logement_ + with + | NeufOuAncien.Neuf _ -> true + | NeufOuAncien.Ancien _ -> false) && + (match type_pret_ + with + | TypePret.D331_32 _ -> false + | TypePret.D331_63_64 _ -> true + | TypePret.D331_59_8 _ -> false + | TypePret.D331_76_1 _ -> false + | TypePret.Autre _ -> false)))))) + (fun (_: _) -> + match zone_ + with + | ZoneDHabitation.Zone1 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "32185") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "38827")) else + ((money_of_cents_string "45469") +$ + ((money_of_cents_string "6642") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone2 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "28722") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "34570")) else + ((money_of_cents_string "40418") +$ + ((money_of_cents_string "5848") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone3 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "26813") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "32152")) else + ((money_of_cents_string "37491") +$ + ((money_of_cents_string "5339") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))))); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=709; start_column=11; + end_line=709; end_column=46; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=1506; start_column=5; + end_line=1509; end_column=36; + law_headings=["Article 18"; + "Chapitre IV : Calcul de l'aide personnalisée au logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + ((param_ >=@ (date_of_numbers (2005) (8) (31))) && + ((param_ <@ (date_of_numbers (2006) (12) (31))) + && + ((match anciennete_logement_ + with + | NeufOuAncien.Neuf _ -> false + | NeufOuAncien.Ancien _ -> true) && + (match type_pret_ + with + | TypePret.D331_32 _ -> false + | TypePret.D331_63_64 _ -> true + | TypePret.D331_59_8 _ -> false + | TypePret.D331_76_1 _ -> false + | TypePret.Autre _ -> false)))))) + (fun (_: _) -> + match zone_ + with + | ZoneDHabitation.Zone1 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "25907") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "31264")) else + ((money_of_cents_string "36621") +$ + ((money_of_cents_string "5357") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone2 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "23094") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "27814")) else + ((money_of_cents_string "32534") +$ + ((money_of_cents_string "4720") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone3 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "21567") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "25874")) else + ((money_of_cents_string "30881") +$ + ((money_of_cents_string "4307") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))))); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=709; start_column=11; + end_line=709; end_column=46; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=1551; start_column=5; + end_line=1554; end_column=36; + law_headings=["Article 18"; + "Chapitre IV : Calcul de l'aide personnalisée au logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + ((param_ >=@ (date_of_numbers (2006) (12) (31))) && + ((param_ <@ (date_of_numbers (2007) (12) (31))) + && + ((match anciennete_logement_ + with + | NeufOuAncien.Neuf _ -> true + | NeufOuAncien.Ancien _ -> false) && + (match type_pret_ + with + | TypePret.D331_32 _ -> false + | TypePret.D331_63_64 _ -> true + | TypePret.D331_59_8 _ -> false + | TypePret.D331_76_1 _ -> false + | TypePret.Autre _ -> false)))))) + (fun (_: _) -> + match zone_ + with + | ZoneDHabitation.Zone1 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "33026") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "39914")) else + ((money_of_cents_string "46742") +$ + ((money_of_cents_string "6828") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone2 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "29526") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "35538")) else + ((money_of_cents_string "41550") +$ + ((money_of_cents_string "6012") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone3 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "27564") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "33052")) else + ((money_of_cents_string "38541") +$ + ((money_of_cents_string "5488") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))))); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=709; start_column=11; + end_line=709; end_column=46; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=1595; start_column=5; + end_line=1598; end_column=36; + law_headings=["Article 18"; + "Chapitre IV : Calcul de l'aide personnalisée au logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + ((param_ >=@ (date_of_numbers (2006) (12) (31))) && + ((param_ <@ (date_of_numbers (2007) (12) (31))) + && + ((match anciennete_logement_ + with + | NeufOuAncien.Neuf _ -> false + | NeufOuAncien.Ancien _ -> true) && + (match type_pret_ + with + | TypePret.D331_32 _ -> false + | TypePret.D331_63_64 _ -> true + | TypePret.D331_59_8 _ -> false + | TypePret.D331_76_1 _ -> false + | TypePret.Autre _ -> false)))))) + (fun (_: _) -> + match zone_ + with + | ZoneDHabitation.Zone1 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "26632") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "32139")) else + ((money_of_cents_string "37646") +$ + ((money_of_cents_string "5507") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone2 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "23741") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "28593")) else + ((money_of_cents_string "33445") +$ + ((money_of_cents_string "4852") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone3 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "22171") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "36598")) else + ((money_of_cents_string "31026") +$ + ((money_of_cents_string "4428") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))))); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=709; start_column=11; + end_line=709; end_column=46; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=1640; start_column=5; + end_line=1643; end_column=36; + law_headings=["Article 18"; + "Chapitre IV : Calcul de l'aide personnalisée au logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + ((param_ >=@ (date_of_numbers (2007) (12) (31))) && + ((param_ <@ (date_of_numbers (2008) (12) (31))) + && + ((match anciennete_logement_ + with + | NeufOuAncien.Neuf _ -> true + | NeufOuAncien.Ancien _ -> false) && + (match type_pret_ + with + | TypePret.D331_32 _ -> false + | TypePret.D331_63_64 _ -> true + | TypePret.D331_59_8 _ -> false + | TypePret.D331_76_1 _ -> false + | TypePret.Autre _ -> false)))))) + (fun (_: _) -> + match zone_ + with + | ZoneDHabitation.Zone1 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "33999") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "41016")) else + ((money_of_cents_string "48032") +$ + ((money_of_cents_string "7016") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone2 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "30341") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "36519")) else + ((money_of_cents_string "42697") +$ + ((money_of_cents_string "6178") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone3 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "28325") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "33964")) else + ((money_of_cents_string "39605") +$ + ((money_of_cents_string "5639") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))))); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=709; start_column=11; + end_line=709; end_column=46; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=1684; start_column=5; + end_line=1687; end_column=36; + law_headings=["Article 18"; + "Chapitre IV : Calcul de l'aide personnalisée au logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + ((param_ >=@ (date_of_numbers (2007) (12) (31))) && + ((param_ <@ (date_of_numbers (2008) (12) (31))) + && + ((match anciennete_logement_ + with + | NeufOuAncien.Neuf _ -> false + | NeufOuAncien.Ancien _ -> true) && + (match type_pret_ + with + | TypePret.D331_32 _ -> false + | TypePret.D331_63_64 _ -> true + | TypePret.D331_59_8 _ -> false + | TypePret.D331_76_1 _ -> false + | TypePret.Autre _ -> false)))))) + (fun (_: _) -> + match zone_ + with + | ZoneDHabitation.Zone1 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "27367") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "33026")) else + ((money_of_cents_string "38685") +$ + ((money_of_cents_string "5659") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone2 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "24396") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "29382")) else + ((money_of_cents_string "34368") +$ + ((money_of_cents_string "4986") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone3 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "22783") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "27332")) else + ((money_of_cents_string "31882") +$ + ((money_of_cents_string "4550") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))))); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=709; start_column=11; + end_line=709; end_column=46; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=1729; start_column=5; + end_line=1732; end_column=36; + law_headings=["Article 18"; + "Chapitre IV : Calcul de l'aide personnalisée au logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + ((param_ >=@ (date_of_numbers (2008) (12) (31))) && + ((param_ <@ (date_of_numbers (2009) (12) (31))) + && + ((match anciennete_logement_ + with + | NeufOuAncien.Neuf _ -> true + | NeufOuAncien.Ancien _ -> false) && + (match type_pret_ + with + | TypePret.D331_32 _ -> false + | TypePret.D331_63_64 _ -> true + | TypePret.D331_59_8 _ -> false + | TypePret.D331_76_1 _ -> false + | TypePret.Autre _ -> false)))))) + (fun (_: _) -> + match zone_ + with + | ZoneDHabitation.Zone1 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "35002") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "42226")) else + ((money_of_cents_string "49449") +$ + ((money_of_cents_string "7223") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone2 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "31236") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "37596")) else + ((money_of_cents_string "43957") +$ + ((money_of_cents_string "6360") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone3 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "29161") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "34966")) else + ((money_of_cents_string "40773") +$ + ((money_of_cents_string "5805") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))))); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=709; start_column=11; + end_line=709; end_column=46; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=1773; start_column=5; + end_line=1776; end_column=36; + law_headings=["Article 18"; + "Chapitre IV : Calcul de l'aide personnalisée au logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + ((param_ >=@ (date_of_numbers (2008) (12) (31))) && + ((param_ <@ (date_of_numbers (2009) (12) (31))) + && + ((match anciennete_logement_ + with + | NeufOuAncien.Neuf _ -> false + | NeufOuAncien.Ancien _ -> true) && + (match type_pret_ + with + | TypePret.D331_32 _ -> false + | TypePret.D331_63_64 _ -> true + | TypePret.D331_59_8 _ -> false + | TypePret.D331_76_1 _ -> false + | TypePret.Autre _ -> false)))))) + (fun (_: _) -> + match zone_ + with + | ZoneDHabitation.Zone1 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "28174") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "34000")) else + ((money_of_cents_string "39826") +$ + ((money_of_cents_string "5826") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone2 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "25116") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "30249")) else + ((money_of_cents_string "35382") +$ + ((money_of_cents_string "5133") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone3 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "23455") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "28138")) else + ((money_of_cents_string "32823") +$ + ((money_of_cents_string "4684") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))))); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=709; start_column=11; + end_line=709; end_column=46; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=1818; start_column=5; + end_line=1821; end_column=36; + law_headings=["Article 18"; + "Chapitre IV : Calcul de l'aide personnalisée au logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + ((param_ >=@ (date_of_numbers (2009) (12) (31))) && + ((param_ <@ (date_of_numbers (2010) (12) (31))) + && + ((match anciennete_logement_ + with + | NeufOuAncien.Neuf _ -> true + | NeufOuAncien.Ancien _ -> false) && + (match type_pret_ + with + | TypePret.D331_32 _ -> false + | TypePret.D331_63_64 _ -> true + | TypePret.D331_59_8 _ -> false + | TypePret.D331_76_1 _ -> false + | TypePret.Autre _ -> false)))))) + (fun (_: _) -> + match zone_ + with + | ZoneDHabitation.Zone1 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "35114") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "42361")) else + ((money_of_cents_string "49607") +$ + ((money_of_cents_string "7246") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone2 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "31336") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "37716")) else + ((money_of_cents_string "44098") +$ + ((money_of_cents_string "6380") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone3 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "29254") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "35078")) else + ((money_of_cents_string "40903") +$ + ((money_of_cents_string "5824") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))))); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=709; start_column=11; + end_line=709; end_column=46; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=1862; start_column=5; + end_line=1865; end_column=36; + law_headings=["Article 18"; + "Chapitre IV : Calcul de l'aide personnalisée au logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + ((param_ >=@ (date_of_numbers (2009) (12) (31))) && + ((param_ <@ (date_of_numbers (2010) (12) (31))) + && + ((match anciennete_logement_ + with + | NeufOuAncien.Neuf _ -> false + | NeufOuAncien.Ancien _ -> true) && + (match type_pret_ + with + | TypePret.D331_32 _ -> false + | TypePret.D331_63_64 _ -> true + | TypePret.D331_59_8 _ -> false + | TypePret.D331_76_1 _ -> false + | TypePret.Autre _ -> false)))))) + (fun (_: _) -> + match zone_ + with + | ZoneDHabitation.Zone1 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "28264") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "34109")) else + ((money_of_cents_string "39953") +$ + ((money_of_cents_string "5845") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone2 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "25196") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "30346")) else + ((money_of_cents_string "35495") +$ + ((money_of_cents_string "5149") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone3 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "23530") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "28228")) else + ((money_of_cents_string "32928") +$ + ((money_of_cents_string "4699") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))))); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=709; start_column=11; + end_line=709; end_column=46; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=1907; start_column=5; + end_line=1910; end_column=36; + law_headings=["Article 18"; + "Chapitre IV : Calcul de l'aide personnalisée au logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + ((param_ >=@ (date_of_numbers (2010) (12) (31))) && + ((param_ <@ (date_of_numbers (2011) (12) (31))) + && + ((match anciennete_logement_ + with + | NeufOuAncien.Neuf _ -> true + | NeufOuAncien.Ancien _ -> false) && + (match type_pret_ + with + | TypePret.D331_32 _ -> false + | TypePret.D331_63_64 _ -> true + | TypePret.D331_59_8 _ -> false + | TypePret.D331_76_1 _ -> false + | TypePret.Autre _ -> false)))))) + (fun (_: _) -> + match zone_ + with + | ZoneDHabitation.Zone1 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "35500") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "42827")) else + ((money_of_cents_string "50153") +$ + ((money_of_cents_string "7326") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone2 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "31681") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "38131")) else + ((money_of_cents_string "44583") +$ + ((money_of_cents_string "6450") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone3 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "29576") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "35464")) else + ((money_of_cents_string "41353") +$ + ((money_of_cents_string "5888") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))))); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=709; start_column=11; + end_line=709; end_column=46; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=1951; start_column=5; + end_line=1954; end_column=36; + law_headings=["Article 18"; + "Chapitre IV : Calcul de l'aide personnalisée au logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + ((param_ >=@ (date_of_numbers (2010) (12) (31))) && + ((param_ <@ (date_of_numbers (2011) (12) (31))) + && + ((match anciennete_logement_ + with + | NeufOuAncien.Neuf _ -> false + | NeufOuAncien.Ancien _ -> true) && + (match type_pret_ + with + | TypePret.D331_32 _ -> false + | TypePret.D331_63_64 _ -> true + | TypePret.D331_59_8 _ -> false + | TypePret.D331_76_1 _ -> false + | TypePret.Autre _ -> false)))))) + (fun (_: _) -> + match zone_ + with + | ZoneDHabitation.Zone1 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "28575") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "34484")) else + ((money_of_cents_string "40392") +$ + ((money_of_cents_string "5909") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone2 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "25473") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "30680")) else + ((money_of_cents_string "35885") +$ + ((money_of_cents_string "5206") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone3 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "23789") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "28539")) else + ((money_of_cents_string "33290") +$ + ((money_of_cents_string "4751") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))))); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=709; start_column=11; + end_line=709; end_column=46; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=1996; start_column=5; + end_line=1999; end_column=36; + law_headings=["Article 18"; + "Chapitre IV : Calcul de l'aide personnalisée au logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + ((param_ >=@ (date_of_numbers (2011) (12) (31))) && + ((param_ <@ (date_of_numbers (2012) (12) (31))) + && + ((match anciennete_logement_ + with + | NeufOuAncien.Neuf _ -> true + | NeufOuAncien.Ancien _ -> false) && + (match type_pret_ + with + | TypePret.D331_32 _ -> false + | TypePret.D331_63_64 _ -> true + | TypePret.D331_59_8 _ -> false + | TypePret.D331_76_1 _ -> false + | TypePret.Autre _ -> false)))))) + (fun (_: _) -> + match zone_ + with + | ZoneDHabitation.Zone1 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "35855") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "43255")) else + ((money_of_cents_string "50655") +$ + ((money_of_cents_string "7399") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone2 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "31998") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "38512")) else + ((money_of_cents_string "45029") +$ + ((money_of_cents_string "6515") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone3 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "29872") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "35819")) else + ((money_of_cents_string "41767") +$ + ((money_of_cents_string "5947") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))))); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=709; start_column=11; + end_line=709; end_column=46; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=2071; start_column=5; + end_line=2074; end_column=36; + law_headings=["Article 18"; + "Chapitre IV : Calcul de l'aide personnalisée au logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + ((param_ >=@ (date_of_numbers (2011) (12) (31))) && + ((param_ <@ (date_of_numbers (2012) (12) (31))) + && + ((match anciennete_logement_ + with + | NeufOuAncien.Neuf _ -> false + | NeufOuAncien.Ancien _ -> true) && + (match type_pret_ + with + | TypePret.D331_32 _ -> false + | TypePret.D331_63_64 _ -> true + | TypePret.D331_59_8 _ -> false + | TypePret.D331_76_1 _ -> false + | TypePret.Autre _ -> false)))))) + (fun (_: _) -> + match zone_ + with + | ZoneDHabitation.Zone1 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "28861") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "34829")) else + ((money_of_cents_string "40796") +$ + ((money_of_cents_string "5968") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone2 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "25728") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "30987")) else + ((money_of_cents_string "36244") +$ + ((money_of_cents_string "5258") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone3 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "24027") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "28824")) else + ((money_of_cents_string "33623") +$ + ((money_of_cents_string "4799") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))))); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=709; start_column=11; + end_line=709; end_column=46; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=2118; start_column=5; + end_line=2121; end_column=36; + law_headings=["Article 18"; + "Chapitre IV : Calcul de l'aide personnalisée au logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + ((param_ >=@ (date_of_numbers (2012) (12) (31))) && + ((param_ <@ (date_of_numbers (2014) (9) (30))) && + ((match anciennete_logement_ + with + | NeufOuAncien.Neuf _ -> true + | NeufOuAncien.Ancien _ -> false) && + (match type_pret_ + with + | TypePret.D331_32 _ -> false + | TypePret.D331_63_64 _ -> true + | TypePret.D331_59_8 _ -> false + | TypePret.D331_76_1 _ -> false + | TypePret.Autre _ -> false)))))) + (fun (_: _) -> + match zone_ + with + | ZoneDHabitation.Zone1 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "36626") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "44185")) else + ((money_of_cents_string "51744") +$ + ((money_of_cents_string "7558") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone2 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "32686") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "39340")) else + ((money_of_cents_string "45997") +$ + ((money_of_cents_string "6655") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone3 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "30514") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "36589")) else + ((money_of_cents_string "42665") +$ + ((money_of_cents_string "6075") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))))); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=709; start_column=11; + end_line=709; end_column=46; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=2162; start_column=5; + end_line=2165; end_column=36; + law_headings=["Article 18"; + "Chapitre IV : Calcul de l'aide personnalisée au logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + ((param_ >=@ (date_of_numbers (2012) (12) (31))) && + ((param_ <@ (date_of_numbers (2014) (9) (30))) && + ((match anciennete_logement_ + with + | NeufOuAncien.Neuf _ -> false + | NeufOuAncien.Ancien _ -> true) && + (match type_pret_ + with + | TypePret.D331_32 _ -> false + | TypePret.D331_63_64 _ -> true + | TypePret.D331_59_8 _ -> false + | TypePret.D331_76_1 _ -> false + | TypePret.Autre _ -> false)))))) + (fun (_: _) -> + match zone_ + with + | ZoneDHabitation.Zone1 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "29482") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "35578")) else + ((money_of_cents_string "41673") +$ + ((money_of_cents_string "6096") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone2 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "26281") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "31653")) else + ((money_of_cents_string "37023") +$ + ((money_of_cents_string "5371") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone3 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "24544") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "29444")) else + ((money_of_cents_string "34346") +$ + ((money_of_cents_string "4902") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))))); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=709; start_column=11; + end_line=709; end_column=46; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=2207; start_column=5; + end_line=2210; end_column=36; + law_headings=["Article 18"; + "Chapitre IV : Calcul de l'aide personnalisée au logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + ((param_ >=@ (date_of_numbers (2014) (9) (30))) && + ((param_ <@ (date_of_numbers (2015) (9) (30))) && + ((match anciennete_logement_ + with + | NeufOuAncien.Neuf _ -> true + | NeufOuAncien.Ancien _ -> false) && + (match type_pret_ + with + | TypePret.D331_32 _ -> false + | TypePret.D331_63_64 _ -> true + | TypePret.D331_59_8 _ -> false + | TypePret.D331_76_1 _ -> false + | TypePret.Autre _ -> false)))))) + (fun (_: _) -> + match zone_ + with + | ZoneDHabitation.Zone1 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "36835") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "44437")) else + ((money_of_cents_string "52039") +$ + ((money_of_cents_string "7601") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone2 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "32872") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "39564")) else + ((money_of_cents_string "46259") +$ + ((money_of_cents_string "6693") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone3 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "30688") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "36798")) else + ((money_of_cents_string "42908") +$ + ((money_of_cents_string "6110") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))))); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=709; start_column=11; + end_line=709; end_column=46; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=2251; start_column=5; + end_line=2254; end_column=36; + law_headings=["Article 18"; + "Chapitre IV : Calcul de l'aide personnalisée au logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + ((param_ >=@ (date_of_numbers (2014) (9) (30))) && + ((param_ <@ (date_of_numbers (2015) (9) (30))) && + ((match anciennete_logement_ + with + | NeufOuAncien.Neuf _ -> false + | NeufOuAncien.Ancien _ -> true) && + (match type_pret_ + with + | TypePret.D331_32 _ -> false + | TypePret.D331_63_64 _ -> true + | TypePret.D331_59_8 _ -> false + | TypePret.D331_76_1 _ -> false + | TypePret.Autre _ -> false)))))) + (fun (_: _) -> + match zone_ + with + | ZoneDHabitation.Zone1 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "29650") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "35781")) else + ((money_of_cents_string "41911") +$ + ((money_of_cents_string "6131") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone2 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "26431") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "31833")) else + ((money_of_cents_string "37234") +$ + ((money_of_cents_string "5402") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone3 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "24684") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "29612")) else + ((money_of_cents_string "34542") +$ + ((money_of_cents_string "4930") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))))); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=709; start_column=11; + end_line=709; end_column=46; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=2296; start_column=5; + end_line=2299; end_column=36; + law_headings=["Article 18"; + "Chapitre IV : Calcul de l'aide personnalisée au logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + ((param_ >=@ (date_of_numbers (2015) (9) (30))) && + ((param_ <@ (date_of_numbers (2017) (9) (30))) && + ((match anciennete_logement_ + with + | NeufOuAncien.Neuf _ -> true + | NeufOuAncien.Ancien _ -> false) && + (match type_pret_ + with + | TypePret.D331_32 _ -> false + | TypePret.D331_63_64 _ -> true + | TypePret.D331_59_8 _ -> false + | TypePret.D331_76_1 _ -> false + | TypePret.Autre _ -> false)))))) + (fun (_: _) -> + match zone_ + with + | ZoneDHabitation.Zone1 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "36864") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "44473")) else + ((money_of_cents_string "52081") +$ + ((money_of_cents_string "7607") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone2 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "32898") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "39596")) else + ((money_of_cents_string "46296") +$ + ((money_of_cents_string "6698") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone3 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "30713") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "36827")) else + ((money_of_cents_string "42942") +$ + ((money_of_cents_string "6115") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))))); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=709; start_column=11; + end_line=709; end_column=46; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=2340; start_column=5; + end_line=2343; end_column=36; + law_headings=["Article 18"; + "Chapitre IV : Calcul de l'aide personnalisée au logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + ((param_ >=@ (date_of_numbers (2015) (9) (30))) && + ((param_ <@ (date_of_numbers (2017) (9) (30))) && + ((match anciennete_logement_ + with + | NeufOuAncien.Neuf _ -> false + | NeufOuAncien.Ancien _ -> true) && + (match type_pret_ + with + | TypePret.D331_32 _ -> false + | TypePret.D331_63_64 _ -> true + | TypePret.D331_59_8 _ -> false + | TypePret.D331_76_1 _ -> false + | TypePret.Autre _ -> false)))))) + (fun (_: _) -> + match zone_ + with + | ZoneDHabitation.Zone1 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "29674") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "35810")) else + ((money_of_cents_string "41945") +$ + ((money_of_cents_string "6136") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone2 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "26452") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "31858")) else + ((money_of_cents_string "37264") +$ + ((money_of_cents_string "5406") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone3 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "24704") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "29636")) else + ((money_of_cents_string "34570") +$ + ((money_of_cents_string "4934") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))))); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=709; start_column=11; + end_line=709; end_column=46; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=2385; start_column=5; + end_line=2388; end_column=36; + law_headings=["Article 18"; + "Chapitre IV : Calcul de l'aide personnalisée au logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + ((param_ >=@ (date_of_numbers (2017) (9) (30))) && + ((param_ <@ (date_of_numbers (2019) (9) (30))) && + ((match anciennete_logement_ + with + | NeufOuAncien.Neuf _ -> true + | NeufOuAncien.Ancien _ -> false) && + (match type_pret_ + with + | TypePret.D331_32 _ -> false + | TypePret.D331_63_64 _ -> true + | TypePret.D331_59_8 _ -> false + | TypePret.D331_76_1 _ -> false + | TypePret.Autre _ -> false)))))) + (fun (_: _) -> + match zone_ + with + | ZoneDHabitation.Zone1 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "37140") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "44807")) else + ((money_of_cents_string "52472") +$ + ((money_of_cents_string "7664") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone2 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "33145") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "39893")) else + ((money_of_cents_string "46643") +$ + ((money_of_cents_string "6748") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone3 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "30943") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "37103")) else + ((money_of_cents_string "43264") +$ + ((money_of_cents_string "6161") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))))); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=709; start_column=11; + end_line=709; end_column=46; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=2429; start_column=5; + end_line=2432; end_column=36; + law_headings=["Article 18"; + "Chapitre IV : Calcul de l'aide personnalisée au logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + ((param_ >=@ (date_of_numbers (2017) (9) (30))) && + ((param_ <@ (date_of_numbers (2019) (9) (30))) && + ((match anciennete_logement_ + with + | NeufOuAncien.Neuf _ -> false + | NeufOuAncien.Ancien _ -> true) && + (match type_pret_ + with + | TypePret.D331_32 _ -> false + | TypePret.D331_63_64 _ -> true + | TypePret.D331_59_8 _ -> false + | TypePret.D331_76_1 _ -> false + | TypePret.Autre _ -> false)))))) + (fun (_: _) -> + match zone_ + with + | ZoneDHabitation.Zone1 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "29897") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "36079")) else + ((money_of_cents_string "42260") +$ + ((money_of_cents_string "6182") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone2 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "26650") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "32097")) else + ((money_of_cents_string "37543") +$ + ((money_of_cents_string "5447") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone3 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "24889") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "29858")) else + ((money_of_cents_string "34829") +$ + ((money_of_cents_string "4971") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))))); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=709; start_column=11; + end_line=709; end_column=46; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=2474; start_column=5; + end_line=2476; end_column=36; + law_headings=["Article 18"; + "Chapitre IV : Calcul de l'aide personnalisée au logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + ((param_ >=@ (date_of_numbers (2019) (9) (30))) && + ((match anciennete_logement_ + with + | NeufOuAncien.Neuf _ -> true + | NeufOuAncien.Ancien _ -> false) && + (match type_pret_ + with + | TypePret.D331_32 _ -> false + | TypePret.D331_63_64 _ -> true + | TypePret.D331_59_8 _ -> false + | TypePret.D331_76_1 _ -> false + | TypePret.Autre _ -> false))))) + (fun (_: _) -> + match zone_ + with + | ZoneDHabitation.Zone1 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "37252") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "44941")) else + ((money_of_cents_string "52629") +$ + ((money_of_cents_string "7687") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone2 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "33244") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "40013")) else + ((money_of_cents_string "46783") +$ + ((money_of_cents_string "6768") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone3 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "31036") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "37215")) else + ((money_of_cents_string "43394") +$ + ((money_of_cents_string "6179") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))))); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=709; start_column=11; + end_line=709; end_column=46; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=2517; start_column=5; + end_line=2519; end_column=36; + law_headings=["Article 18"; + "Chapitre IV : Calcul de l'aide personnalisée au logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + ((param_ >=@ (date_of_numbers (2019) (9) (30))) && + ((match anciennete_logement_ + with + | NeufOuAncien.Neuf _ -> false + | NeufOuAncien.Ancien _ -> true) && + (match type_pret_ + with + | TypePret.D331_32 _ -> false + | TypePret.D331_63_64 _ -> true + | TypePret.D331_59_8 _ -> false + | TypePret.D331_76_1 _ -> false + | TypePret.Autre _ -> false))))) + (fun (_: _) -> + match zone_ + with + | ZoneDHabitation.Zone1 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "29986") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "36187")) else + ((money_of_cents_string "42386") +$ + ((money_of_cents_string "6201") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone2 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "26730") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "32193")) else + ((money_of_cents_string "37656") +$ + ((money_of_cents_string "5463") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1")))))) + | ZoneDHabitation.Zone3 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "24964") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "29948")) else + ((money_of_cents_string "34934") +$ + ((money_of_cents_string "4986") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ -! + (integer_of_string "1"))))))))|]) + (fun (_: _) -> false) (fun (_: _) -> raise EmptyError)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=709; start_column=11; end_line=709; end_column=46; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]}))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=709; start_column=11; end_line=709; end_column=46; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let n_nombre_parts_d832_11_: decimal = (log_variable_definition + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "n_nombre_parts_d832_11"] (embed_decimal) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=710; start_column=11; end_line=710; end_column=33; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=3350; start_column=14; end_line=3350; end_column=36; + law_headings=["Article D832-11"; + "Section 2 : Accession à la propriété"; + "Chapitre II : Modalités de liquidation et de versement de l'aide personnalisée au logement"; + "Titre III : Aide personnalisée au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> calcul_nombre_parts_dot_n_nombre_parts_d832_11_)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=710; start_column=11; end_line=710; end_column=33; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let depense_nette_minimale_d832_10_: money -> money = (log_variable_definition + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "dépense_nette_minimale_d832_10"] (unembeddable) ( + try + (fun (param_: money) -> + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=715; start_column=11; end_line=715; end_column=41; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=715; start_column=11; + end_line=715; end_column=41; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=3599; start_column=5; + end_line=3599; end_column=41; + law_headings=["Article D832-17"; + "Section 2 : Accession à la propriété"; + "Chapitre II : Modalités de liquidation et de versement de l'aide personnalisée au logement"; + "Titre III : Aide personnalisée au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + (date_signature_pret_ >=@ + (date_of_numbers (1999) (6) (30))))) + (fun (_: _) -> + (mensualite_principale_ +$ + montant_forfaitaire_charges_d832_10_) -$ param_))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=3610; start_column=14; + end_line=3610; end_column=44; + law_headings=["Article D832-17"; + "Section 2 : Accession à la propriété"; + "Chapitre II : Modalités de liquidation et de versement de l'aide personnalisée au logement"; + "Titre III : Aide personnalisée au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) (fun (_: _) -> mensualite_principale_ -$ param_)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=715; start_column=11; end_line=715; end_column=41; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]}))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=715; start_column=11; end_line=715; end_column=41; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let plafond_mensualite_d832_10_3_base_: money = (log_variable_definition + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "plafond_mensualité_d832_10_3_base"] (embed_money) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=707; start_column=10; end_line=707; end_column=14; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=707; start_column=10; + end_line=707; end_column=14; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=3437; start_column=5; + end_line=3437; end_column=44; + law_headings=["Article D832-14"; + "Section 2 : Accession à la propriété"; + "Chapitre II : Modalités de liquidation et de versement de l'aide personnalisée au logement"; + "Titre III : Aide personnalisée au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + local_habite_premiere_fois_beneficiaire_)) + (fun (_: _) -> + if + (((log_end_call + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "calcul_plafond_mensualité_d832_10_3"] + ((log_variable_definition + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "calcul_plafond_mensualité_d832_10_3"; "output"] + (embed_money) ((log_begin_call + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "calcul_plafond_mensualité_d832_10_3"] + calcul_plafond_mensualite_d832_10_3_) + ((log_variable_definition + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "calcul_plafond_mensualité_d832_10_3"; "input"] + (embed_date) date_signature_pret_))))))) <$ + ((log_end_call + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "calcul_plafond_mensualité_d832_10_3"] + ((log_variable_definition + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "calcul_plafond_mensualité_d832_10_3"; "output"] + (embed_money) ((log_begin_call + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "calcul_plafond_mensualité_d832_10_3"] + calcul_plafond_mensualite_d832_10_3_) + ((log_variable_definition + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "calcul_plafond_mensualité_d832_10_3"; "input"] + (embed_date) date_entree_logement_)))))))) then + ((log_end_call + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "calcul_plafond_mensualité_d832_10_3"] + ((log_variable_definition + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "calcul_plafond_mensualité_d832_10_3"; "output"] + (embed_money) ((log_begin_call + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "calcul_plafond_mensualité_d832_10_3"] + calcul_plafond_mensualite_d832_10_3_) + ((log_variable_definition + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "calcul_plafond_mensualité_d832_10_3"; "input"] + (embed_date) date_entree_logement_))))))) else + ((log_end_call + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "calcul_plafond_mensualité_d832_10_3"] + ((log_variable_definition + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "calcul_plafond_mensualité_d832_10_3"; "output"] + (embed_money) ((log_begin_call + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "calcul_plafond_mensualité_d832_10_3"] + calcul_plafond_mensualite_d832_10_3_) + ((log_variable_definition + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "calcul_plafond_mensualité_d832_10_3"; "input"] + (embed_date) date_signature_pret_)))))))))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=3417; start_column=14; end_line=3417; end_column=42; + law_headings=["Article D832-14"; + "Section 2 : Accession à la propriété"; + "Chapitre II : Modalités de liquidation et de versement de l'aide personnalisée au logement"; + "Titre III : Aide personnalisée au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> (log_end_call + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "calcul_plafond_mensualité_d832_10_3"] + ((log_variable_definition + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "calcul_plafond_mensualité_d832_10_3"; "output"] (embed_money) + ((log_begin_call + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "calcul_plafond_mensualité_d832_10_3"] + calcul_plafond_mensualite_d832_10_3_) ((log_variable_definition + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "calcul_plafond_mensualité_d832_10_3"; "input"] (embed_date) + date_signature_pret_)))))))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=707; start_column=10; end_line=707; end_column=14; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let calcul_equivalence_loyer_minimale_dot_ressources_menage_arrondies_: money = + try ((log_variable_definition + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "calcul_équivalence_loyer_minimale.ressources_ménage_arrondies"] + (embed_money) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=731; start_column=3; end_line=731; end_column=36; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=3555; start_column=14; end_line=3555; end_column=75; + law_headings=["Article D832-15"; + "Section 2 : Accession à la propriété"; + "Chapitre II : Modalités de liquidation et de versement de l'aide personnalisée au logement"; + "Titre III : Aide personnalisée au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) (fun (_: _) -> ressources_menage_arrondies_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=613; start_column=10; end_line=613; end_column=37; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let calcul_equivalence_loyer_minimale_dot_condition_2_du_832_25_: bool = + try ((log_variable_definition + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "calcul_équivalence_loyer_minimale.condition_2_du_832_25"] + (embed_bool) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=731; start_column=3; end_line=731; end_column=36; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=3554; start_column=14; end_line=3554; end_column=69; + law_headings=["Article D832-15"; + "Section 2 : Accession à la propriété"; + "Chapitre II : Modalités de liquidation et de versement de l'aide personnalisée au logement"; + "Titre III : Aide personnalisée au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) (fun (_: _) -> false)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=614; start_column=10; end_line=614; end_column=31; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let calcul_equivalence_loyer_minimale_dot_n_nombre_parts_d832_25_: decimal = + try ((log_variable_definition + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "calcul_équivalence_loyer_minimale.n_nombre_parts_d832_25"] + (embed_decimal) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=731; start_column=3; end_line=731; end_column=36; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=3557; start_column=14; end_line=3557; end_column=70; + law_headings=["Article D832-15"; + "Section 2 : Accession à la propriété"; + "Chapitre II : Modalités de liquidation et de versement de l'aide personnalisée au logement"; + "Titre III : Aide personnalisée au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) (fun (_: _) -> n_nombre_parts_d832_11_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=615; start_column=10; end_line=615; end_column=32; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let result_: CalculEquivalenceLoyerMinimaleOut.t = (log_end_call + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "calcul_équivalence_loyer_minimale"; + "CalculÉquivalenceLoyerMinimale"] ((log_begin_call + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "calcul_équivalence_loyer_minimale"; + "CalculÉquivalenceLoyerMinimale"] calcul_equivalence_loyer_minimale) + {CalculEquivalenceLoyerMinimaleIn.ressources_menage_arrondies_in = + calcul_equivalence_loyer_minimale_dot_ressources_menage_arrondies_; + CalculEquivalenceLoyerMinimaleIn.condition_2_du_832_25_in = + calcul_equivalence_loyer_minimale_dot_condition_2_du_832_25_; + CalculEquivalenceLoyerMinimaleIn.n_nombre_parts_d832_25_in = + calcul_equivalence_loyer_minimale_dot_n_nombre_parts_d832_25_})) in + let calcul_equivalence_loyer_minimale_dot_montant_: money = result_.CalculEquivalenceLoyerMinimaleOut.montant_out in + let coefficient_prise_en_charge_d832_10_formule_: decimal = (log_variable_definition + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "coefficient_prise_en_charge_d832_10_formule"] (embed_decimal) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=712; start_column=10; end_line=712; end_column=17; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=3265; start_column=14; end_line=3265; end_column=49; + law_headings=["Article D832-11"; + "Section 2 : Accession à la propriété"; + "Chapitre II : Modalités de liquidation et de versement de l'aide personnalisée au logement"; + "Titre III : Aide personnalisée au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + (decimal_of_string "0.95") -& + (ressources_menage_arrondies_ /$ + (coefficient_multiplicateur_d832_11_ *$ + n_nombre_parts_d832_11_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=712; start_column=10; end_line=712; end_column=17; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let abattement_depense_nette_minimale_d832_10_: money -> money = (log_variable_definition + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "abattement_dépense_nette_minimale_d832_10"] (unembeddable) ( + try + (fun (param_: money) -> + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=716; start_column=11; end_line=716; end_column=52; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=3621; start_column=14; + end_line=3621; end_column=55; + law_headings=["Article D832-17"; + "Section 2 : Accession à la propriété"; + "Chapitre II : Modalités de liquidation et de versement de l'aide personnalisée au logement"; + "Titre III : Aide personnalisée au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + if + (((log_end_call + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "dépense_nette_minimale_d832_10"] + ((log_variable_definition + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "dépense_nette_minimale_d832_10"; "output"] + (embed_money) ((log_begin_call + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "dépense_nette_minimale_d832_10"] + depense_nette_minimale_d832_10_) + ((log_variable_definition + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "dépense_nette_minimale_d832_10"; "input"] + (embed_money) param_))))))) <=$ + (ressources_menage_avec_d832_18_ *$ + coefficient_multiplicateur_d832_17_3_)) then + ((ressources_menage_avec_d832_18_ *$ + coefficient_multiplicateur_d832_17_3_) -$ + ((log_end_call + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "dépense_nette_minimale_d832_10"] + ((log_variable_definition + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "dépense_nette_minimale_d832_10"; "output"] + (embed_money) ((log_begin_call + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "dépense_nette_minimale_d832_10"] + depense_nette_minimale_d832_10_) + ((log_variable_definition + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "dépense_nette_minimale_d832_10"; "input"] + (embed_money) param_)))))))) else + (money_of_cents_string "0"))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=716; start_column=11; end_line=716; end_column=52; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]}))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=716; start_column=11; end_line=716; end_column=52; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let plafond_mensualite_d832_10_3_coproprietaires_: money = (log_variable_definition + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "plafond_mensualité_d832_10_3_copropriétaires"] (embed_money) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=708; start_column=10; end_line=708; end_column=25; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=708; start_column=10; + end_line=708; end_column=25; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=708; start_column=10; + end_line=708; end_column=25; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/archives.catala_fr"; + start_line=444; start_column=14; + end_line=444; end_column=42; + law_headings=["Article 24"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"; + "Articles valables du 1er octobre 2020 au 1er octobre 2021"; + "Archives législatives et réglementaires"]} + ((date_courante_ <@ + (date_of_numbers (2021) (10) (1))) && + (date_courante_ >=@ + (date_of_numbers (2020) (10) (1)))))) + (fun (_: _) -> + if copropriete_ then + (plafond_mensualite_d832_10_3_base_ *$ + (decimal_of_string "0.75")) else + plafond_mensualite_d832_10_3_base_))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=2627; start_column=14; + end_line=2627; end_column=42; + law_headings=["Article 24"; + "Chapitre IV : Calcul de l'aide personnalisée au logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + (date_courante_ >=@ (date_of_numbers (2021) (10) (1))))) + (fun (_: _) -> + if copropriete_ then + (plafond_mensualite_d832_10_3_base_ *$ + (decimal_of_string "0.75")) else + plafond_mensualite_d832_10_3_base_))|]) + (fun (_: _) -> false) (fun (_: _) -> raise EmptyError)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=708; start_column=10; end_line=708; end_column=25; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let mensualite_minimale_: money = (log_variable_definition + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "mensualité_minimale"] (embed_money) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=705; start_column=10; end_line=705; end_column=29; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=705; start_column=10; + end_line=705; end_column=29; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=3496; start_column=5; + end_line=3508; end_column=77; + law_headings=["Article D832-15"; + "Section 2 : Accession à la propriété"; + "Chapitre II : Modalités de liquidation et de versement de l'aide personnalisée au logement"; + "Titre III : Aide personnalisée au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + ((match type_travaux_logement_ + with + | TypeTravauxLogementD83215.TravauxPourAcquisitionD832_15_1 _ -> + true + | TypeTravauxLogementD83215.TravauxSurLogementDejaAcquisD832_15_2 _ -> + false + | TypeTravauxLogementD83215.PasDeTravaux _ -> false) || + (match type_travaux_logement_ + with + | TypeTravauxLogementD83215.TravauxPourAcquisitionD832_15_1 _ -> + false + | TypeTravauxLogementD83215.TravauxSurLogementDejaAcquisD832_15_2 _ -> + false + | TypeTravauxLogementD83215.PasDeTravaux _ -> true)))) + (fun (_: _) -> + money_of_decimal + ((( if + ((decimal_of_money ressources_menage_arrondies_) + >=& + ((decimal_of_money + montant_limite_tranches_d832_15_1_) *& + n_nombre_parts_d832_11_)) then + (((decimal_of_money ressources_menage_arrondies_) + -& + ((decimal_of_money + montant_limite_tranches_d832_15_1_) *& + n_nombre_parts_d832_11_)) *& + taux_tranche_superieure_d832_15_1_) else + (decimal_of_string "0.")) +& + ( if + ((decimal_of_money ressources_menage_arrondies_) + <=& + ((decimal_of_money + montant_limite_tranches_d832_15_1_) *& + n_nombre_parts_d832_11_)) then + ((decimal_of_money ressources_menage_arrondies_) + *& taux_tranche_inferieure_d832_15_1_) else + (((decimal_of_money + montant_limite_tranches_d832_15_1_) *& + n_nombre_parts_d832_11_) *& + taux_tranche_inferieure_d832_15_1_))) /& + (decimal_of_string "12.")))); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=705; start_column=10; + end_line=705; end_column=29; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=3549; start_column=5; + end_line=3549; end_column=75; + law_headings=["Article D832-15"; + "Section 2 : Accession à la propriété"; + "Chapitre II : Modalités de liquidation et de versement de l'aide personnalisée au logement"; + "Titre III : Aide personnalisée au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + (match type_travaux_logement_ + with + | TypeTravauxLogementD83215.TravauxPourAcquisitionD832_15_1 _ -> + false + | TypeTravauxLogementD83215.TravauxSurLogementDejaAcquisD832_15_2 _ -> + true + | TypeTravauxLogementD83215.PasDeTravaux _ -> false))) + (fun (_: _) -> + calcul_equivalence_loyer_minimale_dot_montant_))|]) + (fun (_: _) -> false) (fun (_: _) -> raise EmptyError)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=705; start_column=10; end_line=705; end_column=29; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let coefficient_prise_en_charge_d832_10_arrondi_: decimal = (log_variable_definition + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "coefficient_prise_en_charge_d832_10_arrondi"] (embed_decimal) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=713; start_column=10; end_line=713; end_column=17; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=3281; start_column=14; end_line=3281; end_column=49; + law_headings=["Article D832-11"; + "Section 2 : Accession à la propriété"; + "Chapitre II : Modalités de liquidation et de versement de l'aide personnalisée au logement"; + "Titre III : Aide personnalisée au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + (decimal_round + ((coefficient_prise_en_charge_d832_10_formule_ -& + (decimal_of_string "0.005")) *& (decimal_of_string "100."))) + /& (decimal_of_string "100."))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=713; start_column=10; end_line=713; end_column=17; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let traitement_aide_finale_abattement_: money -> money = (log_variable_definition + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "traitement_aide_finale_abattement"] (unembeddable) ( + try + (fun (param_: money) -> + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=739; start_column=10; end_line=739; end_column=20; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=3208; start_column=14; + end_line=3208; end_column=36; + law_headings=["Article D832-10"; + "Section 2 : Accession à la propriété"; + "Chapitre II : Modalités de liquidation et de versement de l'aide personnalisée au logement"; + "Titre III : Aide personnalisée au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + if + ((((log_end_call + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "traitement_aide_finale_minoration_forfaitaire"] + ((log_variable_definition + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "traitement_aide_finale_minoration_forfaitaire"; + "output"] (embed_money) ((log_begin_call + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "traitement_aide_finale_minoration_forfaitaire"] + traitement_aide_finale_minoration_forfaitaire_) + ((log_variable_definition + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "traitement_aide_finale_minoration_forfaitaire"; + "input"] (embed_money) param_))))))) -$ + ((log_end_call + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "abattement_dépense_nette_minimale_d832_10"] + ((log_variable_definition + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "abattement_dépense_nette_minimale_d832_10"; + "output"] (embed_money) ((log_begin_call + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "abattement_dépense_nette_minimale_d832_10"] + abattement_depense_nette_minimale_d832_10_) + ((log_variable_definition + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "abattement_dépense_nette_minimale_d832_10"; + "input"] (embed_money) ((log_end_call + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "traitement_aide_finale_minoration_forfaitaire"] + ((log_variable_definition + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "traitement_aide_finale_minoration_forfaitaire"; + "output"] (embed_money) ((log_begin_call + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "traitement_aide_finale_minoration_forfaitaire"] + traitement_aide_finale_minoration_forfaitaire_) + ((log_variable_definition + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "traitement_aide_finale_minoration_forfaitaire"; + "input"] (embed_money) param_))))))))))))))) >=$ + (money_of_cents_string "0")) then + (((log_end_call + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "traitement_aide_finale_minoration_forfaitaire"] + ((log_variable_definition + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "traitement_aide_finale_minoration_forfaitaire"; + "output"] (embed_money) ((log_begin_call + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "traitement_aide_finale_minoration_forfaitaire"] + traitement_aide_finale_minoration_forfaitaire_) + ((log_variable_definition + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "traitement_aide_finale_minoration_forfaitaire"; + "input"] (embed_money) param_))))))) -$ + ((log_end_call + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "abattement_dépense_nette_minimale_d832_10"] + ((log_variable_definition + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "abattement_dépense_nette_minimale_d832_10"; + "output"] (embed_money) ((log_begin_call + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "abattement_dépense_nette_minimale_d832_10"] + abattement_depense_nette_minimale_d832_10_) + ((log_variable_definition + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "abattement_dépense_nette_minimale_d832_10"; + "input"] (embed_money) ((log_end_call + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "traitement_aide_finale_minoration_forfaitaire"] + ((log_variable_definition + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "traitement_aide_finale_minoration_forfaitaire"; + "output"] (embed_money) ((log_begin_call + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "traitement_aide_finale_minoration_forfaitaire"] + traitement_aide_finale_minoration_forfaitaire_) + ((log_variable_definition + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "traitement_aide_finale_minoration_forfaitaire"; + "input"] (embed_money) param_))))))))))))))) else + (money_of_cents_string "0"))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=739; start_column=10; end_line=739; end_column=20; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]}))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=739; start_column=10; end_line=739; end_column=20; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let mensualite_eligible_: money = (log_variable_definition + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "mensualité_éligible"] (embed_money) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=704; start_column=10; end_line=704; end_column=29; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=3169; start_column=14; end_line=3169; end_column=33; + law_headings=["Article D832-10"; + "Section 2 : Accession à la propriété"; + "Chapitre II : Modalités de liquidation et de versement de l'aide personnalisée au logement"; + "Titre III : Aide personnalisée au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + if + (mensualite_principale_ >$ + plafond_mensualite_d832_10_3_coproprietaires_) then + plafond_mensualite_d832_10_3_coproprietaires_ else + mensualite_principale_)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=704; start_column=10; end_line=704; end_column=29; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let coefficient_prise_en_charge_d832_10_seuil_: decimal = (log_variable_definition + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "coefficient_prise_en_charge_d832_10_seuil"] (embed_decimal) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=714; start_column=10; end_line=714; end_column=15; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=3284; start_column=14; end_line=3284; end_column=49; + law_headings=["Article D832-11"; + "Section 2 : Accession à la propriété"; + "Chapitre II : Modalités de liquidation et de versement de l'aide personnalisée au logement"; + "Titre III : Aide personnalisée au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + if + (coefficient_prise_en_charge_d832_10_arrondi_ >=& + (decimal_of_string "0.95")) then (decimal_of_string "0.95") + else coefficient_prise_en_charge_d832_10_arrondi_)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=714; start_column=10; end_line=714; end_column=15; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let traitement_aide_finale_contributions_sociales_arrondi_: money -> money = (log_variable_definition + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "traitement_aide_finale_contributions_sociales_arrondi"] (unembeddable) + ( + try + (fun (param_: money) -> + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=740; start_column=10; end_line=740; end_column=40; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=3225; start_column=14; + end_line=3225; end_column=36; + law_headings=["Article D832-10"; + "Section 2 : Accession à la propriété"; + "Chapitre II : Modalités de liquidation et de versement de l'aide personnalisée au logement"; + "Titre III : Aide personnalisée au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + if + (((money_round + ((((log_end_call + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "traitement_aide_finale_abattement"] + ((log_variable_definition + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "traitement_aide_finale_abattement"; "output"] + (embed_money) ((log_begin_call + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "traitement_aide_finale_abattement"] + traitement_aide_finale_abattement_) + ((log_variable_definition + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "traitement_aide_finale_abattement"; "input"] + (embed_money) param_))))))) -$ ((log_end_call + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"] ((log_variable_definition + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"; "output"] (embed_money) + ((log_begin_call + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"] contributions_sociales_dot_montant_) + ((log_variable_definition + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"; "input"] (embed_money) + ((log_end_call + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "traitement_aide_finale_abattement"] + ((log_variable_definition + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "traitement_aide_finale_abattement"; "output"] + (embed_money) ((log_begin_call + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "traitement_aide_finale_abattement"] + traitement_aide_finale_abattement_) + ((log_variable_definition + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "traitement_aide_finale_abattement"; "input"] + (embed_money) param_))))))))))))))) -$ + (money_of_cents_string "50"))) +$ ((log_end_call + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"] ((log_variable_definition + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"; "output"] (embed_money) ((log_begin_call + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"] contributions_sociales_dot_montant_) + ((log_variable_definition + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"; "input"] (embed_money) ((log_end_call + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "traitement_aide_finale_abattement"] + ((log_variable_definition + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "traitement_aide_finale_abattement"; "output"] + (embed_money) ((log_begin_call + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "traitement_aide_finale_abattement"] + traitement_aide_finale_abattement_) + ((log_variable_definition + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "traitement_aide_finale_abattement"; "input"] + (embed_money) param_))))))))))))))) >=$ + (money_of_cents_string "0")) then + ((money_round + ((((log_end_call + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "traitement_aide_finale_abattement"] + ((log_variable_definition + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "traitement_aide_finale_abattement"; "output"] + (embed_money) ((log_begin_call + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "traitement_aide_finale_abattement"] + traitement_aide_finale_abattement_) + ((log_variable_definition + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "traitement_aide_finale_abattement"; "input"] + (embed_money) param_))))))) -$ ((log_end_call + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"] ((log_variable_definition + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"; "output"] (embed_money) + ((log_begin_call + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"] contributions_sociales_dot_montant_) + ((log_variable_definition + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"; "input"] (embed_money) ((log_end_call + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "traitement_aide_finale_abattement"] + ((log_variable_definition + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "traitement_aide_finale_abattement"; "output"] + (embed_money) ((log_begin_call + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "traitement_aide_finale_abattement"] + traitement_aide_finale_abattement_) + ((log_variable_definition + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "traitement_aide_finale_abattement"; "input"] + (embed_money) param_))))))))))))))) -$ + (money_of_cents_string "50"))) +$ ((log_end_call + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"] ((log_variable_definition + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"; "output"] (embed_money) ((log_begin_call + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"] contributions_sociales_dot_montant_) + ((log_variable_definition + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"; "input"] (embed_money) ((log_end_call + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "traitement_aide_finale_abattement"] + ((log_variable_definition + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "traitement_aide_finale_abattement"; "output"] + (embed_money) ((log_begin_call + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "traitement_aide_finale_abattement"] + traitement_aide_finale_abattement_) + ((log_variable_definition + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "traitement_aide_finale_abattement"; "input"] + (embed_money) param_))))))))))))))) else + (money_of_cents_string "0"))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=740; start_column=10; end_line=740; end_column=40; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]}))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=740; start_column=10; end_line=740; end_column=40; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let aide_finale_formule_: money = (log_variable_definition + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "aide_finale_formule"] (embed_money) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=736; start_column=10; end_line=736; end_column=29; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=3149; start_column=14; end_line=3149; end_column=33; + law_headings=["Article D832-10"; + "Section 2 : Accession à la propriété"; + "Chapitre II : Modalités de liquidation et de versement de l'aide personnalisée au logement"; + "Titre III : Aide personnalisée au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + if + ((((mensualite_eligible_ +$ + montant_forfaitaire_charges_d832_10_) -$ + mensualite_minimale_) *$ + coefficient_prise_en_charge_d832_10_seuil_) <$ + (money_of_cents_string "0")) then + (money_of_cents_string "0") else + (((mensualite_eligible_ +$ montant_forfaitaire_charges_d832_10_) + -$ mensualite_minimale_) *$ + coefficient_prise_en_charge_d832_10_seuil_))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=736; start_column=10; end_line=736; end_column=29; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let traitement_aide_finale_montant_minimal_: money -> money = (log_variable_definition + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "traitement_aide_finale_montant_minimal"] (unembeddable) ( + try + (fun (param_: money) -> + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=741; start_column=10; end_line=741; end_column=25; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=3250; start_column=14; + end_line=3250; end_column=36; + law_headings=["Article D832-10"; + "Section 2 : Accession à la propriété"; + "Chapitre II : Modalités de liquidation et de versement de l'aide personnalisée au logement"; + "Titre III : Aide personnalisée au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + if + (((log_end_call + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "traitement_aide_finale_contributions_sociales_arrondi"] + ((log_variable_definition + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "traitement_aide_finale_contributions_sociales_arrondi"; + "output"] (embed_money) ((log_begin_call + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "traitement_aide_finale_contributions_sociales_arrondi"] + traitement_aide_finale_contributions_sociales_arrondi_) + ((log_variable_definition + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "traitement_aide_finale_contributions_sociales_arrondi"; + "input"] (embed_money) param_))))))) <$ + montant_minimal_aide_d832_10_) then + (money_of_cents_string "0") else + ((log_end_call + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "traitement_aide_finale_contributions_sociales_arrondi"] + ((log_variable_definition + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "traitement_aide_finale_contributions_sociales_arrondi"; + "output"] (embed_money) ((log_begin_call + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "traitement_aide_finale_contributions_sociales_arrondi"] + traitement_aide_finale_contributions_sociales_arrondi_) + ((log_variable_definition + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "traitement_aide_finale_contributions_sociales_arrondi"; + "input"] (embed_money) param_))))))))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=741; start_column=10; end_line=741; end_column=25; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]}))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=741; start_column=10; end_line=741; end_column=25; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + {CalculAidePersonnaliseeLogementAccessionProprieteOut.mensualite_eligible_out = + mensualite_eligible_; + CalculAidePersonnaliseeLogementAccessionProprieteOut.mensualite_minimale_out = + mensualite_minimale_; + CalculAidePersonnaliseeLogementAccessionProprieteOut.coefficient_prise_en_charge_d832_10_seuil_out = + coefficient_prise_en_charge_d832_10_seuil_; + CalculAidePersonnaliseeLogementAccessionProprieteOut.aide_finale_formule_out = + aide_finale_formule_; + CalculAidePersonnaliseeLogementAccessionProprieteOut.traitement_aide_finale_montant_minimal_out = + traitement_aide_finale_montant_minimal_} + +let eligibilite_aides_personnelle_logement (eligibilite_aides_personnelle_logement_in: EligibiliteAidesPersonnelleLogementIn.t) : EligibiliteAidesPersonnelleLogementOut.t = + let menage_: Menage.t = eligibilite_aides_personnelle_logement_in.EligibiliteAidesPersonnelleLogementIn.menage_in in + let demandeur_: Demandeur.t = eligibilite_aides_personnelle_logement_in.EligibiliteAidesPersonnelleLogementIn.demandeur_in in + let date_courante_: date = eligibilite_aides_personnelle_logement_in.EligibiliteAidesPersonnelleLogementIn.date_courante_in in + let condition_logement_residence_principale_: unit -> bool = eligibilite_aides_personnelle_logement_in.EligibiliteAidesPersonnelleLogementIn.condition_logement_residence_principale_in in + let condition_logement_surface_: unit -> bool = eligibilite_aides_personnelle_logement_in.EligibiliteAidesPersonnelleLogementIn.condition_logement_surface_in in + let condition_pret_: Pret.t -> bool = (log_variable_definition + ["ÉligibilitéAidesPersonnelleLogement"; "condition_prêt"] + (unembeddable) ( + try + (fun (param_: Pret.t) -> + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=316; start_column=11; end_line=316; end_column=25; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=316; start_column=11; + end_line=316; end_column=25; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> false)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=316; start_column=11; end_line=316; end_column=25; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]}))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=316; start_column=11; end_line=316; end_column=25; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let condition_peuplement_logement_l822_10_: bool = (log_variable_definition + ["ÉligibilitéAidesPersonnelleLogement"; + "condition_peuplement_logement_l822_10"] (embed_bool) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=327; start_column=11; end_line=327; end_column=48; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=327; start_column=11; end_line=327; end_column=48; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> false)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=327; start_column=11; end_line=327; end_column=48; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let seuil_l822_3_parts_propriete_: decimal = (log_variable_definition + ["ÉligibilitéAidesPersonnelleLogement"; + "seuil_l822_3_parts_propriété"] (embed_decimal) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=338; start_column=11; end_line=338; end_column=39; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=105; start_column=14; end_line=105; end_column=42; + law_headings=["Article R822-1"; + "Section 1 : Conditions relatives au bénéficiaire"; + "Chapitre II : Conditions générales d'attribution"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) (fun (_: _) -> decimal_of_string "0.1")) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=338; start_column=11; end_line=338; end_column=39; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let seuil_l822_3_parts_usufruit_: decimal = (log_variable_definition + ["ÉligibilitéAidesPersonnelleLogement"; "seuil_l822_3_parts_usufruit"] + (embed_decimal) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=339; start_column=11; end_line=339; end_column=38; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=106; start_column=14; end_line=106; end_column=41; + law_headings=["Article R822-1"; + "Section 1 : Conditions relatives au bénéficiaire"; + "Chapitre II : Conditions générales d'attribution"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) (fun (_: _) -> decimal_of_string "0.1")) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=339; start_column=11; end_line=339; end_column=38; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let seuil_l822_5_patrimoine_: money = (log_variable_definition + ["ÉligibilitéAidesPersonnelleLogement"; "seuil_l822_5_patrimoine"] + (embed_money) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=340; start_column=11; end_line=340; end_column=34; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=926; start_column=14; end_line=926; end_column=37; + law_headings=["Article R822-22"; + "Sous-section 4 : Prise en compte du patrimoine"; + "Section 2 : Conditions relatives aux ressources"; + "Chapitre II : Conditions générales d'attribution"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) (fun (_: _) -> money_of_cents_string "3000000")) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=340; start_column=11; end_line=340; end_column=34; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let usufruit_ou_propriete_famille_: bool = (log_variable_definition + ["ÉligibilitéAidesPersonnelleLogement"; + "usufruit_ou_propriété_famille"] (embed_bool) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=337; start_column=11; end_line=337; end_column=40; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_legislatif.catala_fr"; + start_line=146; start_column=14; end_line=146; end_column=43; + law_headings=["Article L822-3"; + "Chapitre II : Conditions générales d'attribution"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie législative"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + (match ((menage_.Menage.logement).Logement.proprietaire) + with + | ParentOuAutre.DemandeurOuConjointOuParentOuViaPartsSocietes parts_ -> + true + | ParentOuAutre.Autre _ -> false) || + (match ((menage_.Menage.logement).Logement.usufruit) + with + | ParentOuAutre.DemandeurOuConjointOuParentOuViaPartsSocietes parts_ -> + true + | ParentOuAutre.Autre _ -> false))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=337; start_column=11; end_line=337; end_column=40; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let nombre_personnes_logement_: integer = (log_variable_definition + ["ÉligibilitéAidesPersonnelleLogement"; "nombre_personnes_logement"] + (embed_integer) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=336; start_column=11; end_line=336; end_column=36; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1034; start_column=14; end_line=1034; end_column=39; + law_headings=["Article R822-25"; + "Section 3 : Conditions relatives au logement"; + "Chapitre II : Conditions générales d'attribution"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + ((match (menage_.Menage.situation_familiale) + with + | SituationFamiliale.Celibataire _ -> (integer_of_string "1") + | SituationFamiliale.Maries _ -> (integer_of_string "2") + | SituationFamiliale.Pacses _ -> (integer_of_string "2") + | SituationFamiliale.Concubins _ -> (integer_of_string "2") + | SituationFamiliale.CelibataireSepareDeFait _ -> + (integer_of_string "1") + | SituationFamiliale.ConcubinageDontSepareDeFait _ -> + (integer_of_string "2")) +! + (menage_.Menage.nombre_autres_occupants_logement)) +! + (array_length (menage_.Menage.personnes_a_charge)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=336; start_column=11; end_line=336; end_column=36; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let condition_non_ouverture_l822_9_decence_logement_: bool = (log_variable_definition + ["ÉligibilitéAidesPersonnelleLogement"; + "condition_non_ouverture_l822_9_decence_logement"] (embed_bool) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=325; start_column=11; end_line=325; end_column=58; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=325; start_column=11; + end_line=325; end_column=58; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_legislatif.catala_fr"; + start_line=358; start_column=18; + end_line=358; end_column=61; + law_headings=["Article L822-9"; + "Chapitre II : Conditions générales d'attribution"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie législative"; + "Code de la construction et de l'habitation"]} + (not + ((menage_.Menage.logement).Logement.logement_decent_l89_462)))) + (fun (_: _) -> true))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=325; start_column=11; end_line=325; end_column=58; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> false)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=325; start_column=11; end_line=325; end_column=58; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let condition_non_ouverture_l822_8_: bool = (log_variable_definition + ["ÉligibilitéAidesPersonnelleLogement"; + "condition_non_ouverture_l822_8"] (embed_bool) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=324; start_column=11; end_line=324; end_column=41; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=324; start_column=11; + end_line=324; end_column=41; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_legislatif.catala_fr"; + start_line=344; start_column=18; + end_line=344; end_column=67; + law_headings=["Article L822-8"; + "Chapitre II : Conditions générales d'attribution"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie législative"; + "Code de la construction et de l'habitation"]} + (menage_.Menage.condition_rattache_foyer_fiscal_parent_ifi))) + (fun (_: _) -> true))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=324; start_column=11; end_line=324; end_column=41; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> false)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=324; start_column=11; end_line=324; end_column=41; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let condition_logement_surface_minimale_sans_seuil_m_carres_: integer = (log_variable_definition + ["ÉligibilitéAidesPersonnelleLogement"; + "condition_logement_surface_minimale_sans_seuil_m_carrés"] + (embed_integer) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=321; start_column=11; end_line=321; end_column=66; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1045; start_column=14; end_line=1045; end_column=69; + law_headings=["Article R822-25"; + "Section 3 : Conditions relatives au logement"; + "Chapitre II : Conditions générales d'attribution"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + (match (menage_.Menage.situation_familiale) + with + | SituationFamiliale.Celibataire _ -> (integer_of_string "9") + | SituationFamiliale.Maries _ -> (integer_of_string "16") + | SituationFamiliale.Pacses _ -> (integer_of_string "16") + | SituationFamiliale.Concubins _ -> (integer_of_string "16") + | SituationFamiliale.CelibataireSepareDeFait _ -> + (integer_of_string "9") + | SituationFamiliale.ConcubinageDontSepareDeFait _ -> + (integer_of_string "16")) +! + (((menage_.Menage.nombre_autres_occupants_logement) +! + (array_length (menage_.Menage.personnes_a_charge))) *! + (integer_of_string "9")))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=321; start_column=11; end_line=321; end_column=66; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let condition_logement_location_tiers_: bool = (log_variable_definition + ["ÉligibilitéAidesPersonnelleLogement"; + "condition_logement_location_tiers"] (embed_bool) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=320; start_column=11; end_line=320; end_column=44; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=320; start_column=11; + end_line=320; end_column=44; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=320; start_column=11; + end_line=320; end_column=44; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_legislatif.catala_fr"; + start_line=203; start_column=5; + end_line=207; end_column=39; + law_headings=["Article L822-4"; + "Chapitre II : Conditions générales d'attribution"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie législative"; + "Code de la construction et de l'habitation"]} + (match + ((menage_.Menage.logement).Logement.loue_ou_sous_loue_a_des_tiers) + with + | LoueOuSousLoueADesTiers.Non _ -> true + | LoueOuSousLoueADesTiers.Oui personne_ -> + (((personne_.PersonneSousLocation.age_personne_sous_location) + <=! (integer_of_string "30")) || + (personne_.PersonneSousLocation.conforme_article_l442_1))))) + (fun (_: _) -> true))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_legislatif.catala_fr"; + start_line=197; start_column=5; + end_line=198; end_column=34; + law_headings=["Article L822-4"; + "Chapitre II : Conditions générales d'attribution"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie législative"; + "Code de la construction et de l'habitation"]} + (match + ((menage_.Menage.logement).Logement.loue_ou_sous_loue_a_des_tiers) + with + | LoueOuSousLoueADesTiers.Non _ -> true + | LoueOuSousLoueADesTiers.Oui _ -> false))) + (fun (_: _) -> false))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=320; start_column=11; end_line=320; end_column=44; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> false)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=320; start_column=11; end_line=320; end_column=44; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let condition_logement_residence_principale_: bool = (log_variable_definition + ["ÉligibilitéAidesPersonnelleLogement"; + "condition_logement_résidence_principale"] (embed_bool) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=318; start_column=12; end_line=318; end_column=51; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> condition_logement_residence_principale_ ())|]) + (fun (_: _) -> true) + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=318; start_column=12; end_line=318; end_column=51; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=318; start_column=12; + end_line=318; end_column=51; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_legislatif.catala_fr"; + start_line=46; start_column=5; + end_line=46; end_column=41; + law_headings=["Article L821-2"; + "Sous-section 1 : Aides personnelles au logement"; + "Section 2 : Règles de non-cumul"; + "Chapitre Ier : Principes généraux"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie législative"; + "Code de la construction et de l'habitation"]} + ((menage_.Menage.logement).Logement.residence_principale))) + (fun (_: _) -> true))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=318; start_column=12; + end_line=318; end_column=51; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> false))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=318; start_column=12; end_line=318; end_column=51; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let ouverture_droits_retraite_dot_date_naissance_assure_: date = + try ((log_variable_definition + ["ÉligibilitéAidesPersonnelleLogement"; + "ouverture_droits_retraite.date_naissance_assuré"] (embed_date) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=346; start_column=3; end_line=346; end_column=28; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_sécurité_sociale.catala_fr"; + start_line=123; start_column=14; end_line=123; end_column=61; + law_headings=["Article L161-17-2"; + "Paragraphe 1 : Information et simplification des démarches des assurés."; + "Sous-section 4 : Assurance vieillesse"; + "Section 1 : Bénéficiaires"; + "Chapitre 1er : Dispositions relatives aux prestations"; + "Titre VI : Dispositions relatives aux prestations et aux soins - Contrôle médical - Tutelle aux prestations sociales"; + "Titre III: Titre III : Dispositions communes relatives au financement"; + "Partie législative"; + "Code de la sécurité sociale"]} true)) + (fun (_: _) -> demandeur_.Demandeur.date_naissance)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1034; start_column=10; end_line=1034; end_column=31; + law_headings=["Date d'ouverture des droits à la retraite"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})) in + let result_: OuvertureDroitsRetraiteOut.t = (log_end_call + ["ÉligibilitéAidesPersonnelleLogement"; "ouverture_droits_retraite"; + "OuvertureDroitsRetraite"] ((log_begin_call + ["ÉligibilitéAidesPersonnelleLogement"; "ouverture_droits_retraite"; + "OuvertureDroitsRetraite"] ouverture_droits_retraite) + {OuvertureDroitsRetraiteIn.date_naissance_assure_in = + ouverture_droits_retraite_dot_date_naissance_assure_})) in + let ouverture_droits_retraite_dot_age_ouverture_droit_: duration = result_.OuvertureDroitsRetraiteOut.age_ouverture_droit_out in + let patrimoine_total_demandeur_: money = (log_variable_definition + ["ÉligibilitéAidesPersonnelleLogement"; "patrimoine_total_demandeur"] + (embed_money) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=335; start_column=11; end_line=335; end_column=37; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_legislatif.catala_fr"; + start_line=245; start_column=14; end_line=245; end_column=40; + law_headings=["Article L822-5"; + "Chapitre II : Conditions générales d'attribution"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie législative"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + ((demandeur_.Demandeur.patrimoine).Patrimoine.produisant_revenu_periode_r822_3_3_r822_4) + +$ + ((demandeur_.Demandeur.patrimoine).Patrimoine.ne_produisant_pas_revenu_periode_r822_3_3_r822_4))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=335; start_column=11; end_line=335; end_column=37; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let condition_nationalite_: bool = (log_variable_definition + ["ÉligibilitéAidesPersonnelleLogement"; "condition_nationalité"] + (embed_bool) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=317; start_column=11; end_line=317; end_column=32; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=317; start_column=11; + end_line=317; end_column=32; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_legislatif.catala_fr"; + start_line=108; start_column=5; + end_line=110; end_column=78; + law_headings=["Article L822-2"; + "Chapitre II : Conditions générales d'attribution"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie législative"; + "Code de la construction et de l'habitation"]} + (match (demandeur_.Demandeur.nationalite) + with + | Nationalite.Francaise _ -> true + | Nationalite.Etrangere _ -> + (demandeur_.Demandeur.satisfait_conditions_l512_2_code_securite_sociale)))) + (fun (_: _) -> true))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=317; start_column=11; end_line=317; end_column=32; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> false)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=317; start_column=11; end_line=317; end_column=32; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let plafond_individuel_l815_9_secu_: money = (log_variable_definition + ["ÉligibilitéAidesPersonnelleLogement"; + "plafond_individuel_l815_9_sécu"] (embed_money) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=344; start_column=11; end_line=344; end_column=41; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=344; start_column=11; + end_line=344; end_column=41; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_sécurité_sociale.catala_fr"; + start_line=329; start_column=5; + end_line=330; end_column=35; + law_headings=["Article D815-1"; + "Section 1 : Ouverture du droit et liquidation de l'allocation de solidarité aux personnes âgées"; + "Chapitre 5 : Allocation de solidarité aux personnes âgées"; + "Titre I : Allocations aux personnes âgées"; + "Livre VIII : Allocations aux personnes âgées - Allocation aux adultes handicapés - Aides à l'emploi pour la garde des jeunes enfants - Protection complémentaire en matière de santé"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"]} + ((date_courante_ >=@ (date_of_numbers (2018) (1) (4))) && + (date_courante_ <@ (date_of_numbers (2019) (1) (1)))))) + (fun (_: _) -> money_of_cents_string "999840")); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=344; start_column=11; + end_line=344; end_column=41; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_sécurité_sociale.catala_fr"; + start_line=334; start_column=5; + end_line=335; end_column=35; + law_headings=["Article D815-1"; + "Section 1 : Ouverture du droit et liquidation de l'allocation de solidarité aux personnes âgées"; + "Chapitre 5 : Allocation de solidarité aux personnes âgées"; + "Titre I : Allocations aux personnes âgées"; + "Livre VIII : Allocations aux personnes âgées - Allocation aux adultes handicapés - Aides à l'emploi pour la garde des jeunes enfants - Protection complémentaire en matière de santé"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"]} + ((date_courante_ >=@ (date_of_numbers (2019) (1) (1))) && + (date_courante_ <@ (date_of_numbers (2020) (1) (1)))))) + (fun (_: _) -> money_of_cents_string "1041840")); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=344; start_column=11; + end_line=344; end_column=41; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_sécurité_sociale.catala_fr"; + start_line=339; start_column=5; + end_line=340; end_column=35; + law_headings=["Article D815-1"; + "Section 1 : Ouverture du droit et liquidation de l'allocation de solidarité aux personnes âgées"; + "Chapitre 5 : Allocation de solidarité aux personnes âgées"; + "Titre I : Allocations aux personnes âgées"; + "Livre VIII : Allocations aux personnes âgées - Allocation aux adultes handicapés - Aides à l'emploi pour la garde des jeunes enfants - Protection complémentaire en matière de santé"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"]} + ((date_courante_ >=@ (date_of_numbers (2020) (1) (4))) && + (date_courante_ <@ (date_of_numbers (2021) (1) (1)))))) + (fun (_: _) -> money_of_cents_string "1083840")); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=344; start_column=11; + end_line=344; end_column=41; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/autres_sources.catala_fr"; + start_line=33; start_column=5; + end_line=34; end_column=34; + law_headings=["Allocation de solidarité aux personnes âgées"; + "Circulaire de la CNAV 2022-3 du 11/01/2022 \"Revalorisation à compter du 1er janvier 2022\""]} + ((date_courante_ >=@ (date_of_numbers (2022) (1) (1))) && + (date_courante_ <@ (date_of_numbers (2023) (1) (1)))))) + (fun (_: _) -> money_of_cents_string "1100144")); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=344; start_column=11; + end_line=344; end_column=41; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/autres_sources.catala_fr"; + start_line=70; start_column=5; + end_line=71; end_column=34; + law_headings=["Allocation de solidarité aux personnes âgées"; + "Circulaire de la CNAV 2021-1 du 11/01/2021 \"Revalorisation à compter du 1er janvier 2021\""]} + ((date_courante_ >=@ (date_of_numbers (2021) (1) (1))) && + (date_courante_ <@ (date_of_numbers (2022) (1) (1)))))) + (fun (_: _) -> money_of_cents_string "1088175"))|]) + (fun (_: _) -> false) (fun (_: _) -> raise EmptyError)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=344; start_column=11; end_line=344; end_column=41; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let condition_non_ouverture_l822_10_peuplement_logement_: bool = (log_variable_definition + ["ÉligibilitéAidesPersonnelleLogement"; + "condition_non_ouverture_l822_10_peuplement_logement"] (embed_bool) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=326; start_column=11; end_line=326; end_column=62; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=326; start_column=11; + end_line=326; end_column=62; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_legislatif.catala_fr"; + start_line=381; start_column=18; + end_line=381; end_column=55; + law_headings=["Article L822-10"; + "Chapitre II : Conditions générales d'attribution"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie législative"; + "Code de la construction et de l'habitation"]} + condition_peuplement_logement_l822_10_)) + (fun (_: _) -> true))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=326; start_column=11; end_line=326; end_column=62; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> false)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=326; start_column=11; end_line=326; end_column=62; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let condition_logement_mode_occupation_: bool = (log_variable_definition + ["ÉligibilitéAidesPersonnelleLogement"; + "condition_logement_mode_occupation"] (embed_bool) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=319; start_column=11; end_line=319; end_column=45; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=319; start_column=11; + end_line=319; end_column=45; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=319; start_column=11; + end_line=319; end_column=45; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=319; start_column=11; + end_line=319; end_column=45; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_legislatif.catala_fr"; + start_line=171; start_column=5; + end_line=177; end_column=66; + law_headings=["Article L822-3"; + "Chapitre II : Conditions générales d'attribution"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie législative"; + "Code de la construction et de l'habitation"]} + (usufruit_ou_propriete_famille_ && + (((match + ((menage_.Menage.logement).Logement.proprietaire) + with + | ParentOuAutre.DemandeurOuConjointOuParentOuViaPartsSocietes parts_ -> + parts_ + | ParentOuAutre.Autre _ -> + (decimal_of_string "0.")) <& + seuil_l822_3_parts_propriete_) && + ((match + ((menage_.Menage.logement).Logement.usufruit) + with + | ParentOuAutre.DemandeurOuConjointOuParentOuViaPartsSocietes parts_ -> + parts_ + | ParentOuAutre.Autre _ -> + (decimal_of_string "0.")) <& + seuil_l822_3_parts_usufruit_))))) + (fun (_: _) -> true))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_legislatif.catala_fr"; + start_line=156; start_column=5; + end_line=158; end_column=30; + law_headings=["Article L822-3"; + "Chapitre II : Conditions générales d'attribution"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie législative"; + "Code de la construction et de l'habitation"]} + (match + ((menage_.Menage.logement).Logement.mode_occupation) + with + | ModeOccupation.Locataire _ -> + usufruit_ou_propriete_famille_ + | ModeOccupation.ResidentLogementFoyer _ -> + false + | ModeOccupation.AccessionProprieteLocalUsageExclusifHabitation _ -> + false + | ModeOccupation.SousLocataire _ -> false + | ModeOccupation.LocationAccession _ -> false))) + (fun (_: _) -> false))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_legislatif.catala_fr"; + start_line=125; start_column=5; + end_line=131; end_column=33; + law_headings=["Article L822-2"; + "Chapitre II : Conditions générales d'attribution"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie législative"; + "Code de la construction et de l'habitation"]} + (match + ((menage_.Menage.logement).Logement.mode_occupation) + with + | ModeOccupation.Locataire _ -> true + | ModeOccupation.ResidentLogementFoyer _ -> true + | ModeOccupation.AccessionProprieteLocalUsageExclusifHabitation _ -> + ((menage_.Menage.logement).Logement.residence_principale) + | ModeOccupation.SousLocataire _ -> true + | ModeOccupation.LocationAccession _ -> true))) + (fun (_: _) -> true))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=319; start_column=11; end_line=319; end_column=45; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> false)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=319; start_column=11; end_line=319; end_column=45; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let condition_logement_surface_: bool = (log_variable_definition + ["ÉligibilitéAidesPersonnelleLogement"; "condition_logement_surface"] + (embed_bool) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=323; start_column=12; end_line=323; end_column=38; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> condition_logement_surface_ ())|]) + (fun (_: _) -> true) + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=323; start_column=12; end_line=323; end_column=38; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=323; start_column=12; + end_line=323; end_column=38; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1057; start_column=5; + end_line=1064; end_column=65; + law_headings=["Article R822-25"; + "Section 3 : Conditions relatives au logement"; + "Chapitre II : Conditions générales d'attribution"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + ( if + ((condition_logement_surface_minimale_sans_seuil_m_carres_ + >=! (integer_of_string "70")) && + (nombre_personnes_logement_ >=! + (integer_of_string "8"))) then + (((menage_.Menage.logement).Logement.surface_m_carres) + >=! (integer_of_string "70")) else + (((menage_.Menage.logement).Logement.surface_m_carres) + >=! + condition_logement_surface_minimale_sans_seuil_m_carres_)))) + (fun (_: _) -> true))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=323; start_column=12; + end_line=323; end_column=38; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> false))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=323; start_column=12; end_line=323; end_column=38; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let age_l161_17_2_secu_: duration = (log_variable_definition + ["ÉligibilitéAidesPersonnelleLogement"; "âge_l161_17_2_sécu"] + (embed_duration) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=343; start_column=11; end_line=343; end_column=29; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_sécurité_sociale.catala_fr"; + start_line=125; start_column=14; end_line=125; end_column=32; + law_headings=["Article L161-17-2"; + "Paragraphe 1 : Information et simplification des démarches des assurés."; + "Sous-section 4 : Assurance vieillesse"; + "Section 1 : Bénéficiaires"; + "Chapitre 1er : Dispositions relatives aux prestations"; + "Titre VI : Dispositions relatives aux prestations et aux soins - Contrôle médical - Tutelle aux prestations sociales"; + "Titre III: Titre III : Dispositions communes relatives au financement"; + "Partie législative"; + "Code de la sécurité sociale"]} true)) + (fun (_: _) -> ouverture_droits_retraite_dot_age_ouverture_droit_)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=343; start_column=11; end_line=343; end_column=29; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let patrimoine_pris_en_compte_: money = (log_variable_definition + ["ÉligibilitéAidesPersonnelleLogement"; "patrimoine_pris_en_compte"] + (embed_money) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=341; start_column=11; end_line=341; end_column=36; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=341; start_column=11; + end_line=341; end_column=36; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=341; start_column=11; + end_line=341; end_column=36; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=341; start_column=11; + end_line=341; end_column=36; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_legislatif.catala_fr"; + start_line=285; start_column=18; + end_line=285; end_column=75; + law_headings=["Article L822-5"; + "Chapitre II : Conditions générales d'attribution"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie législative"; + "Code de la construction et de l'habitation"]} + ((menage_.Menage.logement).Logement.est_ehpad_ou_maison_autonomie_l313_12_asf))) + (fun (_: _) -> money_of_cents_string "0"))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_legislatif.catala_fr"; + start_line=266; start_column=18; + end_line=268; end_column=45; + law_headings=["Article L822-5"; + "Chapitre II : Conditions générales d'attribution"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie législative"; + "Code de la construction et de l'habitation"]} + (Array.fold_left + (fun (acc_: bool) (prestation_: _) -> + acc_ || + ((prestation_ = + (PrestationRecue.AllocationSoutienEnfantHandicape + ())) || + (prestation_ = + (PrestationRecue.AllocationAdulteHandicape + ())))) false + (menage_.Menage.prestations_recues)))) + (fun (_: _) -> money_of_cents_string "0"))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=943; start_column=5; + end_line=943; end_column=59; + law_headings=["Article R822-22"; + "Sous-section 4 : Prise en compte du patrimoine"; + "Section 2 : Conditions relatives aux ressources"; + "Chapitre II : Conditions générales d'attribution"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + (patrimoine_total_demandeur_ >=$ seuil_l822_5_patrimoine_))) + (fun (_: _) -> + (demandeur_.Demandeur.patrimoine).Patrimoine.ne_produisant_pas_revenu_periode_r822_3_3_r822_4))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_legislatif.catala_fr"; + start_line=249; start_column=33; end_line=249; end_column=58; + law_headings=["Article L822-5"; + "Chapitre II : Conditions générales d'attribution"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie législative"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + if (patrimoine_total_demandeur_ >$ seuil_l822_5_patrimoine_) + then patrimoine_total_demandeur_ else + (money_of_cents_string "0"))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=341; start_column=11; end_line=341; end_column=36; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let eligibilite_logement_: bool = (log_variable_definition + ["ÉligibilitéAidesPersonnelleLogement"; "éligibilité_logement"] + (embed_bool) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=328; start_column=11; end_line=328; end_column=31; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=328; start_column=11; + end_line=328; end_column=31; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=328; start_column=11; + end_line=328; end_column=31; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_legislatif.catala_fr"; + start_line=72; start_column=5; + end_line=74; end_column=56; + law_headings=["Chapitre II : Conditions générales d'attribution"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie législative"; + "Code de la construction et de l'habitation"]} + (condition_non_ouverture_l822_8_ || + (condition_non_ouverture_l822_9_decence_logement_ + || + condition_non_ouverture_l822_10_peuplement_logement_)))) + (fun (_: _) -> false))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_legislatif.catala_fr"; + start_line=65; start_column=5; + end_line=68; end_column=31; + law_headings=["Chapitre II : Conditions générales d'attribution"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie législative"; + "Code de la construction et de l'habitation"]} + (condition_logement_residence_principale_ && + (condition_logement_mode_occupation_ && + (condition_logement_location_tiers_ && + condition_logement_surface_))))) + (fun (_: _) -> true))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=328; start_column=11; end_line=328; end_column=31; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> false)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=328; start_column=11; end_line=328; end_column=31; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let age_l351_8_1_secu_: duration = (log_variable_definition + ["ÉligibilitéAidesPersonnelleLogement"; "âge_l351_8_1_sécu"] + (embed_duration) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=342; start_column=11; end_line=342; end_column=28; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_sécurité_sociale.catala_fr"; + start_line=163; start_column=14; end_line=163; end_column=31; + law_headings=["Article L351-8"; + "Section 5 : Taux et montant de la pension"; + "Chapitre 1er : Ouverture du droit, liquidation et calcul des pensions de retraite"; + "Titre V : Assurance vieillesse - Assurance veuvage"; + "Livre III : Dispositions relatives aux assurances sociales et à diverses catégories de personnes rattachées au régime générale"; + "Partie législative"; + "Code de la sécurité sociale"]} true)) + (fun (_: _) -> + age_l161_17_2_secu_ +^ (duration_of_numbers (5) (0) (0)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=342; start_column=11; end_line=342; end_column=28; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let eligibilite_: bool = (log_variable_definition + ["ÉligibilitéAidesPersonnelleLogement"; "éligibilité"] (embed_bool) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=347; start_column=10; end_line=347; end_column=21; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=347; start_column=10; + end_line=347; end_column=21; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=357; start_column=5; + end_line=359; end_column=25; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + (condition_nationalite_ && + (condition_logement_mode_occupation_ && + eligibilite_logement_)))) (fun (_: _) -> true))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=347; start_column=10; end_line=347; end_column=21; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> false)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=347; start_column=10; end_line=347; end_column=21; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let condition_2_r823_4_: PersonneACharge.t -> bool = (log_variable_definition + ["ÉligibilitéAidesPersonnelleLogement"; "condition_2_r823_4"] + (unembeddable) ( + try + (fun (param_: PersonneACharge.t) -> + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=351; start_column=10; end_line=351; end_column=28; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=351; start_column=10; + end_line=351; end_column=28; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1173; start_column=5; + end_line=1189; end_column=10; + law_headings=["Article R823-4"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + (match param_ + with + | PersonneACharge.EnfantACharge enfant_ -> false + | PersonneACharge.AutrePersonneACharge parent_ -> + (((parent_.AutrePersonneACharge.parente) = + (Parente.Ascendant ())) && + (((parent_.AutrePersonneACharge.ressources) + <=$ + (plafond_individuel_l815_9_secu_ *$ + (decimal_of_string "1.25"))) && + (((((parent_.AutrePersonneACharge.date_naissance) + +@ age_l351_8_1_secu_) <=@ + date_courante_) || + ((parent_.AutrePersonneACharge.titulaire_allocation_personne_agee) + && + (((parent_.AutrePersonneACharge.date_naissance) + +@ + (duration_of_numbers (65) (0) (0))) + <=@ date_courante_))) || + ((((parent_.AutrePersonneACharge.date_naissance) + +@ age_l161_17_2_secu_) <=@ + date_courante_) && + (parent_.AutrePersonneACharge.beneficiaire_l161_19_l351_8_l643_3_secu)))))))) + (fun (_: _) -> true))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=351; start_column=10; + end_line=351; end_column=28; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> false)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=351; start_column=10; end_line=351; end_column=28; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]}))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=351; start_column=10; end_line=351; end_column=28; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let prise_en_compte_personne_a_charge_: PersonneACharge.t -> bool = (log_variable_definition + ["ÉligibilitéAidesPersonnelleLogement"; + "prise_en_compte_personne_à_charge"] (unembeddable) ( + try + (fun (param_: PersonneACharge.t) -> + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=329; start_column=11; end_line=329; end_column=44; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=329; start_column=11; + end_line=329; end_column=44; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=329; start_column=11; + end_line=329; end_column=44; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1213; start_column=4; + end_line=1219; end_column=49; + law_headings=["Article R823-4"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + (match param_ + with + | PersonneACharge.EnfantACharge enfant_ -> + false + | PersonneACharge.AutrePersonneACharge parent_ -> + ((parent_.AutrePersonneACharge.incapacite_80_pourcent_ou_restriction_emploi) + && + ((parent_.AutrePersonneACharge.ressources) + <=$ + (plafond_individuel_l815_9_secu_ + *$ (decimal_of_string "1.25"))))))) + (fun (_: _) -> true))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1194; start_column=5; + end_line=1194; end_column=44; + law_headings=["Article R823-4"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + ((log_end_call + ["ÉligibilitéAidesPersonnelleLogement"; + "condition_2_r823_4"] ((log_variable_definition + ["ÉligibilitéAidesPersonnelleLogement"; + "condition_2_r823_4"; "output"] (embed_bool) + ((log_begin_call + ["ÉligibilitéAidesPersonnelleLogement"; + "condition_2_r823_4"] condition_2_r823_4_) + ((log_variable_definition + ["ÉligibilitéAidesPersonnelleLogement"; + "condition_2_r823_4"; "input"] + (embed_personne_a_charge) param_))))))))) + (fun (_: _) -> true)); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=329; start_column=11; + end_line=329; end_column=44; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1150; start_column=5; + end_line=1152; end_column=44; + law_headings=["Article R823-4"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + (match param_ + with + | PersonneACharge.EnfantACharge enfant_ -> + ((enfant_.EnfantACharge.age) <=! + (integer_of_string "21")) + | PersonneACharge.AutrePersonneACharge parent_ -> + false))) (fun (_: _) -> true))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=329; start_column=11; + end_line=329; end_column=44; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> false)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=329; start_column=11; end_line=329; end_column=44; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]}))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=329; start_column=11; end_line=329; end_column=44; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let personnes_a_charge_prises_en_compte_: PersonneACharge.t array = (log_variable_definition + ["ÉligibilitéAidesPersonnelleLogement"; + "personnes_à_charge_prises_en_compte"] + (embed_array (embed_personne_a_charge)) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=331; start_column=11; end_line=331; end_column=46; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1138; start_column=14; end_line=1138; end_column=49; + law_headings=["Article R823-4"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + array_filter + (fun (personne_a_charge_: _) -> (log_end_call + ["ÉligibilitéAidesPersonnelleLogement"; + "prise_en_compte_personne_à_charge"] + ((log_variable_definition + ["ÉligibilitéAidesPersonnelleLogement"; + "prise_en_compte_personne_à_charge"; "output"] + (embed_bool) ((log_begin_call + ["ÉligibilitéAidesPersonnelleLogement"; + "prise_en_compte_personne_à_charge"] + prise_en_compte_personne_a_charge_) + ((log_variable_definition + ["ÉligibilitéAidesPersonnelleLogement"; + "prise_en_compte_personne_à_charge"; "input"] + (embed_personne_a_charge) personne_a_charge_))))))) + (menage_.Menage.personnes_a_charge))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=331; start_column=11; end_line=331; end_column=46; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let coefficents_enfants_garde_alternee_pris_en_compte_: decimal array = (log_variable_definition + ["ÉligibilitéAidesPersonnelleLogement"; + "coefficents_enfants_garde_alternée_pris_en_compte"] + (embed_array (embed_decimal)) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=349; start_column=10; end_line=349; end_column=59; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=363; start_column=14; end_line=363; end_column=63; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> + Array.map + (fun (personne_a_charge_: _) -> + match personne_a_charge_ + with + | PersonneACharge.EnfantACharge enfant_ -> + (match (enfant_.EnfantACharge.situation_garde_alternee) + with + | SituationGardeAlternee.PasDeGardeAlternee _ -> + (decimal_of_string "0.") + | SituationGardeAlternee.GardeAlterneeCoefficientPriseEnCharge coeff_ -> + coeff_) + | PersonneACharge.AutrePersonneACharge _ -> + (decimal_of_string "0.")) + (array_filter + (fun (personne_a_charge_: _) -> + match personne_a_charge_ + with + | PersonneACharge.EnfantACharge enfant_ -> + (match + (enfant_.EnfantACharge.situation_garde_alternee) + with + | SituationGardeAlternee.PasDeGardeAlternee _ -> + false + | SituationGardeAlternee.GardeAlterneeCoefficientPriseEnCharge _ -> + true) + | PersonneACharge.AutrePersonneACharge _ -> false) + personnes_a_charge_prises_en_compte_))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=349; start_column=10; end_line=349; end_column=59; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let nombre_personnes_a_charge_prises_en_compte_: integer = (log_variable_definition + ["ÉligibilitéAidesPersonnelleLogement"; + "nombre_personnes_à_charge_prises_en_compte"] (embed_integer) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=348; start_column=10; end_line=348; end_column=52; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=361; start_column=14; end_line=361; end_column=56; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> array_length personnes_a_charge_prises_en_compte_)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=348; start_column=10; end_line=348; end_column=52; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let _: unit = if ( + try + (seuil_l822_3_parts_usufruit_ <& + (decimal_of_string "0.2")) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/code_construction_legislatif.catala_fr"; + start_line=182; start_column=13; + end_line=182; end_column=48; + law_headings=["Article L822-3"; + "Chapitre II : Conditions générales d'attribution"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie législative"; + "Code de la construction et de l'habitation"]}))) + then () else + raise (AssertionFailed {filename = "examples/aides_logement/code_construction_legislatif.catala_fr"; + start_line=182; start_column=13; + end_line=182; end_column=48; + law_headings=["Article L822-3"; + "Chapitre II : Conditions générales d'attribution"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie législative"; + "Code de la construction et de l'habitation"]}) in + let _: unit = if ( + try + (seuil_l822_3_parts_propriete_ <& + (decimal_of_string "0.2")) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/code_construction_legislatif.catala_fr"; + start_line=181; start_column=13; + end_line=181; end_column=49; + law_headings=["Article L822-3"; + "Chapitre II : Conditions générales d'attribution"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie législative"; + "Code de la construction et de l'habitation"]}))) + then () else + raise (AssertionFailed {filename = "examples/aides_logement/code_construction_legislatif.catala_fr"; + start_line=181; start_column=13; + end_line=181; end_column=49; + law_headings=["Article L822-3"; + "Chapitre II : Conditions générales d'attribution"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie législative"; + "Code de la construction et de l'habitation"]}) in + {EligibiliteAidesPersonnelleLogementOut.date_courante_out = date_courante_; + EligibiliteAidesPersonnelleLogementOut.eligibilite_out = eligibilite_; + EligibiliteAidesPersonnelleLogementOut.nombre_personnes_a_charge_prises_en_compte_out = + nombre_personnes_a_charge_prises_en_compte_; + EligibiliteAidesPersonnelleLogementOut.coefficents_enfants_garde_alternee_pris_en_compte_out = + coefficents_enfants_garde_alternee_pris_en_compte_; + EligibiliteAidesPersonnelleLogementOut.condition_2_r823_4_out = + condition_2_r823_4_} + +let ressources_aides_personnelle_logement (ressources_aides_personnelle_logement_in: RessourcesAidesPersonnelleLogementIn.t) : RessourcesAidesPersonnelleLogementOut.t = + let ressources_demandeur_: money = ressources_aides_personnelle_logement_in.RessourcesAidesPersonnelleLogementIn.ressources_demandeur_in in + let ressources_conjoint_: money = ressources_aides_personnelle_logement_in.RessourcesAidesPersonnelleLogementIn.ressources_conjoint_in in + let personnes_vivant_habituellement_foyer_: PersonneVivantHabituellementAuFoyer.t + array = ressources_aides_personnelle_logement_in.RessourcesAidesPersonnelleLogementIn.personnes_vivant_habituellement_foyer_in in + let demandeur_exerce_activite_remuneree_: bool = ressources_aides_personnelle_logement_in.RessourcesAidesPersonnelleLogementIn.demandeur_exerce_activite_remuneree_in in + let conjoint_exerce_activite_remuneree_: bool = ressources_aides_personnelle_logement_in.RessourcesAidesPersonnelleLogementIn.conjoint_exerce_activite_remuneree_in in + let personnes_a_charge_: PersonneACharge.t array = ressources_aides_personnelle_logement_in.RessourcesAidesPersonnelleLogementIn.personnes_a_charge_in in + let situation_familiale_: SituationFamiliale.t = ressources_aides_personnelle_logement_in.RessourcesAidesPersonnelleLogementIn.situation_familiale_in in + let mode_occupation_: ModeOccupation.t = ressources_aides_personnelle_logement_in.RessourcesAidesPersonnelleLogementIn.mode_occupation_in in + let condition_age_bourse_enseignement_superieur_: bool = ressources_aides_personnelle_logement_in.RessourcesAidesPersonnelleLogementIn.condition_age_bourse_enseignement_superieur_in in + let demandeur_poursuit_des_etudes_: bool = ressources_aides_personnelle_logement_in.RessourcesAidesPersonnelleLogementIn.demandeur_poursuit_des_etudes_in in + let date_demande_ou_reexamen_droit_: date = ressources_aides_personnelle_logement_in.RessourcesAidesPersonnelleLogementIn.date_demande_ou_reexamen_droit_in in + let paiement_logement_distinct_professionnel_: PaiementLogementDistinctProfessionnel.t = ressources_aides_personnelle_logement_in.RessourcesAidesPersonnelleLogementIn.paiement_logement_distinct_professionnel_in in + let ressources_menage_arrondies_base_: money = ressources_aides_personnelle_logement_in.RessourcesAidesPersonnelleLogementIn.ressources_menage_arrondies_base_in in + let ressources_menage_arrondies_seuil_: money = (log_variable_definition + ["RessourcesAidesPersonnelleLogement"; + "ressources_ménage_arrondies_seuil"] (embed_money) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=524; start_column=10; end_line=524; end_column=15; + law_headings=["Prise en compte des ressources pour les aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=522; start_column=46; end_line=522; end_column=52; + law_headings=["Prise en compte des ressources pour les aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} false)) + (fun (_: _) -> raise EmptyError)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=524; start_column=10; end_line=524; end_column=15; + law_headings=["Prise en compte des ressources pour les aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let montant_forfaitaire_r_822_8_: money = (log_variable_definition + ["RessourcesAidesPersonnelleLogement"; "montant_forfaitaire_r_822_8"] + (embed_money) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=528; start_column=11; end_line=528; end_column=38; + law_headings=["Prise en compte des ressources pour les aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=21; start_column=14; end_line=21; end_column=41; + law_headings=["Article 4"; + "Chapitre II : Dispositions applicables aux ressources"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + true)) (fun (_: _) -> money_of_cents_string "258900")) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=528; start_column=11; end_line=528; end_column=38; + law_headings=["Prise en compte des ressources pour les aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let montant_forfaitaire_r_822_7_: money = (log_variable_definition + ["RessourcesAidesPersonnelleLogement"; "montant_forfaitaire_r_822_7"] + (embed_money) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=530; start_column=11; end_line=530; end_column=38; + law_headings=["Prise en compte des ressources pour les aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=11; start_column=14; end_line=11; end_column=41; + law_headings=["Article 3"; + "Chapitre II : Dispositions applicables aux ressources"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + true)) (fun (_: _) -> money_of_cents_string "9500")) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=530; start_column=11; end_line=530; end_column=38; + law_headings=["Prise en compte des ressources pour les aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let ressources_forfaitaires_r822_20_: money = (log_variable_definition + ["RessourcesAidesPersonnelleLogement"; "ressources_forfaitaires_r822_20"] + (embed_money) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=532; start_column=11; end_line=532; end_column=42; + law_headings=["Prise en compte des ressources pour les aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=532; start_column=51; end_line=532; end_column=57; + law_headings=["Prise en compte des ressources pour les aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} false)) + (fun (_: _) -> raise EmptyError)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=532; start_column=11; end_line=532; end_column=42; + law_headings=["Prise en compte des ressources pour les aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let ressources_personnes_vivant_habituellement_foyer_: money = (log_variable_definition + ["RessourcesAidesPersonnelleLogement"; + "ressources_personnes_vivant_habituellement_foyer"] (embed_money) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=526; start_column=11; end_line=526; end_column=59; + law_headings=["Prise en compte des ressources pour les aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=129; start_column=14; end_line=129; end_column=62; + law_headings=["Article R822-2"; + "Sous-section 1 : Modalités générales de l'appréciation des ressources"; + "Section 2 : Conditions relatives aux ressources"; + "Chapitre II : Conditions générales d'attribution"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + Array.fold_left + (fun (acc_: money) (personne_: _) -> + acc_ +$ + (personne_.PersonneVivantHabituellementAuFoyer.ressources)) + (money_of_cents_string "0") + personnes_vivant_habituellement_foyer_)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=526; start_column=11; end_line=526; end_column=59; + law_headings=["Prise en compte des ressources pour les aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let abattement_r_822_10_: money = (log_variable_definition + ["RessourcesAidesPersonnelleLogement"; "abattement_r_822_10"] + (embed_money) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=531; start_column=11; end_line=531; end_column=30; + law_headings=["Prise en compte des ressources pour les aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=519; start_column=14; end_line=519; end_column=33; + law_headings=["Article R822-10"; + "Sous-section 2 : Principes de neutralisation et d'abattement"; + "Section 2 : Conditions relatives aux ressources"; + "Chapitre II : Conditions générales d'attribution"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + match situation_familiale_ + with + | SituationFamiliale.Celibataire _ -> + ( if + ((array_length personnes_a_charge_) = (integer_of_string + "0")) then (money_of_cents_string "0") else + ( if + ((array_length personnes_a_charge_) <=! + (integer_of_string "2")) then + (money_of_cents_string "90100") else + (money_of_cents_string "135000"))) + | SituationFamiliale.Maries _ -> (money_of_cents_string "0") + | SituationFamiliale.Pacses _ -> (money_of_cents_string "0") + | SituationFamiliale.Concubins _ -> (money_of_cents_string "0") + | SituationFamiliale.CelibataireSepareDeFait _ -> + ( if + ((array_length personnes_a_charge_) = (integer_of_string + "0")) then (money_of_cents_string "0") else + ( if + ((array_length personnes_a_charge_) <=! + (integer_of_string "2")) then + (money_of_cents_string "90100") else + (money_of_cents_string "135000"))) + | SituationFamiliale.ConcubinageDontSepareDeFait _ -> + (money_of_cents_string "0"))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=531; start_column=11; end_line=531; end_column=30; + law_headings=["Prise en compte des ressources pour les aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let base_mensuelle_allocations_familiales_dot_date_courante_: date = + try ((log_variable_definition + ["RessourcesAidesPersonnelleLogement"; + "base_mensuelle_allocations_familiales.date_courante"] (embed_date) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=534; start_column=3; end_line=534; end_column=40; + law_headings=["Prise en compte des ressources pour les aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=413; start_column=14; end_line=413; end_column=65; + law_headings=["Article R822-7"; + "Sous-section 2 : Principes de neutralisation et d'abattement"; + "Section 2 : Conditions relatives aux ressources"; + "Chapitre II : Conditions générales d'attribution"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) (fun (_: _) -> date_demande_ou_reexamen_droit_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/../base_mensuelle_allocations_familiales/bmaf.catala_fr"; + start_line=5; start_column=10; end_line=5; end_column=23; + law_headings=["Montant de la base mensuelle des allocations familiales"]})) in + let result_: BaseMensuelleAllocationsFamilialesOut.t = (log_end_call + ["RessourcesAidesPersonnelleLogement"; + "base_mensuelle_allocations_familiales"; + "BaseMensuelleAllocationsFamiliales"] ((log_begin_call + ["RessourcesAidesPersonnelleLogement"; + "base_mensuelle_allocations_familiales"; + "BaseMensuelleAllocationsFamiliales"] + base_mensuelle_allocations_familiales) + {BaseMensuelleAllocationsFamilialesIn.date_courante_in = + base_mensuelle_allocations_familiales_dot_date_courante_})) in + let base_mensuelle_allocations_familiales_dot_montant_: money = result_.BaseMensuelleAllocationsFamilialesOut.montant_out in + let abattement_r_822_8_: money = (log_variable_definition + ["RessourcesAidesPersonnelleLogement"; "abattement_r_822_8"] + (embed_money) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=527; start_column=11; end_line=527; end_column=29; + law_headings=["Prise en compte des ressources pour les aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=457; start_column=14; end_line=457; end_column=32; + law_headings=["Article R822-8"; + "Sous-section 2 : Principes de neutralisation et d'abattement"; + "Section 2 : Conditions relatives aux ressources"; + "Chapitre II : Conditions générales d'attribution"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + match paiement_logement_distinct_professionnel_ + with + | PaiementLogementDistinctProfessionnel.OuiAvecLoyerOuCharges loyer_ou_charges_ -> + montant_forfaitaire_r_822_8_ + | PaiementLogementDistinctProfessionnel.Non _ -> + (money_of_cents_string "0"))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=527; start_column=11; end_line=527; end_column=29; + law_headings=["Prise en compte des ressources pour les aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let ressources_prises_en_compte_: money = (log_variable_definition + ["RessourcesAidesPersonnelleLogement"; "ressources_prises_en_compte"] + (embed_money) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=537; start_column=10; end_line=537; end_column=37; + law_headings=["Prise en compte des ressources pour les aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=537; start_column=10; + end_line=537; end_column=37; + law_headings=["Prise en compte des ressources pour les aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=854; start_column=6; + end_line=856; end_column=35; + law_headings=["Article R822-20"; + "Sous-section 3 : Montant forfaitaire de ressources applicable aux étudiants"; + "Section 2 : Conditions relatives aux ressources"; + "Chapitre II : Conditions générales d'attribution"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + ((match mode_occupation_ + with + | ModeOccupation.Locataire _ -> true + | ModeOccupation.ResidentLogementFoyer _ -> false + | ModeOccupation.AccessionProprieteLocalUsageExclusifHabitation _ -> + false + | ModeOccupation.SousLocataire _ -> false + | ModeOccupation.LocationAccession _ -> false) && + (condition_age_bourse_enseignement_superieur_ && + demandeur_poursuit_des_etudes_)))) + (fun (_: _) -> ressources_forfaitaires_r822_20_))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=124; start_column=14; end_line=124; end_column=41; + law_headings=["Article R822-2"; + "Sous-section 1 : Modalités générales de l'appréciation des ressources"; + "Section 2 : Conditions relatives aux ressources"; + "Chapitre II : Conditions générales d'attribution"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + (ressources_demandeur_ +$ ressources_conjoint_) +$ + ressources_personnes_vivant_habituellement_foyer_)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=537; start_column=10; end_line=537; end_column=37; + law_headings=["Prise en compte des ressources pour les aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let abattement_r_822_7_: money = (log_variable_definition + ["RessourcesAidesPersonnelleLogement"; "abattement_r_822_7"] + (embed_money) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=529; start_column=11; end_line=529; end_column=29; + law_headings=["Prise en compte des ressources pour les aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=404; start_column=14; end_line=404; end_column=32; + law_headings=["Article R822-7"; + "Sous-section 2 : Principes de neutralisation et d'abattement"; + "Section 2 : Conditions relatives aux ressources"; + "Chapitre II : Conditions générales d'attribution"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + if + (demandeur_exerce_activite_remuneree_ && + (conjoint_exerce_activite_remuneree_ && + ((ressources_conjoint_ +$ ressources_conjoint_) >=$ + (base_mensuelle_allocations_familiales_dot_montant_ *$ + (decimal_of_string "12."))))) then + montant_forfaitaire_r_822_7_ else (money_of_cents_string "0"))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=529; start_column=11; end_line=529; end_column=29; + law_headings=["Prise en compte des ressources pour les aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let _: unit = if ( + try + (Array.fold_left + (fun (acc_: bool) (personne_: _) -> + acc_ && + (personne_.PersonneVivantHabituellementAuFoyer.duree_residence_durant_periode_r_822_3_1_superieure_a_6_mois)) + true personnes_vivant_habituellement_foyer_) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=142; start_column=13; + end_line=143; end_column=74; + law_headings=["Article R822-2"; + "Sous-section 1 : Modalités générales de l'appréciation des ressources"; + "Section 2 : Conditions relatives aux ressources"; + "Chapitre II : Conditions générales d'attribution"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]}))) + then () else + raise (AssertionFailed {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=142; start_column=13; + end_line=143; end_column=74; + law_headings=["Article R822-2"; + "Sous-section 1 : Modalités générales de l'appréciation des ressources"; + "Section 2 : Conditions relatives aux ressources"; + "Chapitre II : Conditions générales d'attribution"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]}) in + {RessourcesAidesPersonnelleLogementOut.ressources_prises_en_compte_out = + ressources_prises_en_compte_} + +let eligibilite_prestations_familiales (eligibilite_prestations_familiales_in: EligibilitePrestationsFamilialesIn.t) : EligibilitePrestationsFamilialesOut.t = + let date_courante_: date = eligibilite_prestations_familiales_in.EligibilitePrestationsFamilialesIn.date_courante_in in + let prestation_courante_: ElementPrestationsFamiliales.t = eligibilite_prestations_familiales_in.EligibilitePrestationsFamilialesIn.prestation_courante_in in + let residence_: Collectivite.t = eligibilite_prestations_familiales_in.EligibilitePrestationsFamilialesIn.residence_in in + let age_l512_3_2_: integer = (log_variable_definition + ["ÉligibilitéPrestationsFamiliales"; "âge_l512_3_2"] (embed_integer) ( + try + (handle_default + {filename = "examples/aides_logement/../prestations_familiales/prologue.catala_fr"; + start_line=44; start_column=10; end_line=44; end_column=22; + law_headings=["Prologue : prestations familiales"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/../prestations_familiales/sécurité_sociale_R.catala_fr"; + start_line=21; start_column=14; end_line=21; end_column=26; + law_headings=["Article R512-2"; + "Chapitre 2 : Champ d'application."; + "Titre 1 : Champ d'application - Généralités"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets en Conseil d'Etat"; + "Code de la sécurité sociale"]} true)) + (fun (_: _) -> integer_of_string "20")) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/../prestations_familiales/prologue.catala_fr"; + start_line=44; start_column=10; end_line=44; end_column=22; + law_headings=["Prologue : prestations familiales"]})))) in + let smic_dot_date_courante_: date = + try ((log_variable_definition + ["ÉligibilitéPrestationsFamiliales"; "smic.date_courante"] + (embed_date) + (handle_default + {filename = "examples/aides_logement/../prestations_familiales/prologue.catala_fr"; + start_line=49; start_column=3; end_line=49; end_column=7; + law_headings=["Prologue : prestations familiales"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/../prestations_familiales/prologue.catala_fr"; + start_line=53; start_column=14; end_line=53; end_column=32; + law_headings=["Prologue : prestations familiales"]} true)) + (fun (_: _) -> date_courante_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/../prestations_familiales/../smic/smic.catala_fr"; + start_line=9; start_column=10; end_line=9; end_column=23; + law_headings=["Prologue"; "Montant du salaire minimum de croissance"]})) in + let smic_dot_residence_: Collectivite.t = + try ((log_variable_definition + ["ÉligibilitéPrestationsFamiliales"; "smic.résidence"] + (embed_collectivite) + (handle_default + {filename = "examples/aides_logement/../prestations_familiales/prologue.catala_fr"; + start_line=49; start_column=3; end_line=49; end_column=7; + law_headings=["Prologue : prestations familiales"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/../prestations_familiales/prologue.catala_fr"; + start_line=52; start_column=14; end_line=52; end_column=28; + law_headings=["Prologue : prestations familiales"]} true)) + (fun (_: _) -> residence_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/../prestations_familiales/../smic/smic.catala_fr"; + start_line=10; start_column=10; end_line=10; end_column=19; + law_headings=["Prologue"; "Montant du salaire minimum de croissance"]})) in + let result_: SmicOut.t = (log_end_call + ["ÉligibilitéPrestationsFamiliales"; "smic"; "Smic"] ((log_begin_call + ["ÉligibilitéPrestationsFamiliales"; "smic"; "Smic"] smic) + {SmicIn.date_courante_in = smic_dot_date_courante_; + SmicIn.residence_in = smic_dot_residence_})) in + let smic_dot_brut_horaire_: money = result_.SmicOut.brut_horaire_out in + let regime_outre_mer_l751_1_: bool = (log_variable_definition + ["ÉligibilitéPrestationsFamiliales"; "régime_outre_mer_l751_1"] + (embed_bool) ( + try + (handle_default + {filename = "examples/aides_logement/../prestations_familiales/prologue.catala_fr"; + start_line=45; start_column=10; end_line=45; end_column=33; + law_headings=["Prologue : prestations familiales"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/../prestations_familiales/prologue.catala_fr"; + start_line=45; start_column=10; + end_line=45; end_column=33; + law_headings=["Prologue : prestations familiales"]} ( + [||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/../prestations_familiales/sécurité_sociale_L.catala_fr"; + start_line=103; start_column=5; + end_line=108; end_column=30; + law_headings=["Article L751-1"; + "Chapitre 1er : Généralités"; + "Titre 5 : Dispositions particulières à la Guadeloupe, à la Guyane, à la Martinique, à La Réunion, à Saint-Barthélemy et à Saint-Martin"; + "Livre 7 : Régimes divers - Dispositions diverses"; + "Partie législative"; + "Code de la sécurité sociale"]} + ((residence_ = (Collectivite.Guadeloupe ())) || + ((residence_ = (Collectivite.Guyane ())) || + ((residence_ = (Collectivite.Martinique ())) || + ((residence_ = (Collectivite.LaReunion ())) || + ((residence_ = + (Collectivite.SaintBarthelemy ())) || + (residence_ = + (Collectivite.SaintMartin ()))))))))) + (fun (_: _) -> true))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/../prestations_familiales/prologue.catala_fr"; + start_line=45; start_column=10; end_line=45; end_column=33; + law_headings=["Prologue : prestations familiales"]} true)) + (fun (_: _) -> false)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/../prestations_familiales/prologue.catala_fr"; + start_line=45; start_column=10; end_line=45; end_column=33; + law_headings=["Prologue : prestations familiales"]})))) in + let plafond_l512_3_2_: money = (log_variable_definition + ["ÉligibilitéPrestationsFamiliales"; "plafond_l512_3_2"] (embed_money) + ( + try + (handle_default + {filename = "examples/aides_logement/../prestations_familiales/prologue.catala_fr"; + start_line=43; start_column=11; end_line=43; end_column=27; + law_headings=["Prologue : prestations familiales"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/../prestations_familiales/prologue.catala_fr"; + start_line=43; start_column=11; + end_line=43; end_column=27; + law_headings=["Prologue : prestations familiales"]} ( + [||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/../prestations_familiales/sécurité_sociale_R.catala_fr"; + start_line=62; start_column=18; + end_line=62; end_column=41; + law_headings=["Article R755-0-2"; + "Chapitre 5 : Prestations familiales et prestations assimilées"; + "Titre 5 : Départements d'outre-mer"; + "Livre 7 : Régimes divers - Dispositions diverses"; + "Partie réglementaire - Décrets en Conseil d'Etat"; + "Code de la sécurité sociale"]} + regime_outre_mer_l751_1_)) + (fun (_: _) -> + (smic_dot_brut_horaire_ *$ (decimal_of_string "0.55")) *$ + (decimal_of_string "169.")))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/../prestations_familiales/sécurité_sociale_R.catala_fr"; + start_line=31; start_column=14; end_line=31; end_column=30; + law_headings=["Article R512-2"; + "Chapitre 2 : Champ d'application."; + "Titre 1 : Champ d'application - Généralités"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets en Conseil d'Etat"; + "Code de la sécurité sociale"]} true)) + (fun (_: _) -> + (smic_dot_brut_horaire_ *$ (decimal_of_string "0.55")) *$ + (decimal_of_string "169."))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/../prestations_familiales/prologue.catala_fr"; + start_line=43; start_column=11; end_line=43; end_column=27; + law_headings=["Prologue : prestations familiales"]})))) in + let conditions_hors_age_: EnfantPrestationsFamiliales.t -> bool = (log_variable_definition + ["ÉligibilitéPrestationsFamiliales"; "conditions_hors_âge"] + (unembeddable) ( + try + (fun (param_: EnfantPrestationsFamiliales.t) -> + try + (handle_default + {filename = "examples/aides_logement/../prestations_familiales/prologue.catala_fr"; + start_line=42; start_column=10; end_line=42; end_column=29; + law_headings=["Prologue : prestations familiales"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/../prestations_familiales/prologue.catala_fr"; + start_line=42; start_column=10; + end_line=42; end_column=29; + law_headings=["Prologue : prestations familiales"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/../prestations_familiales/sécurité_sociale_L.catala_fr"; + start_line=66; start_column=5; + end_line=69; end_column=85; + law_headings=["Article L512-3"; + "Chapitre 2 : Champ d'application"; + "Titre 1 : Champ d'application - Généralités"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie législative"; + "Code de la sécurité sociale"]} + (((match + (param_.EnfantPrestationsFamiliales.obligation_scolaire) + with + | SituationObligationScolaire.Avant _ -> true + | SituationObligationScolaire.Pendant _ -> false + | SituationObligationScolaire.Apres _ -> false) + || + ((match + (param_.EnfantPrestationsFamiliales.obligation_scolaire) + with + | SituationObligationScolaire.Avant _ -> false + | SituationObligationScolaire.Pendant _ -> + true + | SituationObligationScolaire.Apres _ -> false) + || + (match + (param_.EnfantPrestationsFamiliales.obligation_scolaire) + with + | SituationObligationScolaire.Avant _ -> + false + | SituationObligationScolaire.Pendant _ -> + false + | SituationObligationScolaire.Apres _ -> + true))) && + ((param_.EnfantPrestationsFamiliales.remuneration_mensuelle) + <=$ plafond_l512_3_2_)))) (fun (_: _) -> true))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/../prestations_familiales/prologue.catala_fr"; + start_line=42; start_column=10; + end_line=42; end_column=29; + law_headings=["Prologue : prestations familiales"]} true)) + (fun (_: _) -> false)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/../prestations_familiales/prologue.catala_fr"; + start_line=42; start_column=10; end_line=42; end_column=29; + law_headings=["Prologue : prestations familiales"]}))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/../prestations_familiales/prologue.catala_fr"; + start_line=42; start_column=10; end_line=42; end_column=29; + law_headings=["Prologue : prestations familiales"]})))) in + let droit_ouvert_: EnfantPrestationsFamiliales.t -> bool = (log_variable_definition + ["ÉligibilitéPrestationsFamiliales"; "droit_ouvert"] (unembeddable) ( + try + (fun (param_: EnfantPrestationsFamiliales.t) -> + try + (handle_default + {filename = "examples/aides_logement/../prestations_familiales/prologue.catala_fr"; + start_line=41; start_column=10; end_line=41; end_column=22; + law_headings=["Prologue : prestations familiales"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/../prestations_familiales/prologue.catala_fr"; + start_line=41; start_column=10; + end_line=41; end_column=22; + law_headings=["Prologue : prestations familiales"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/../prestations_familiales/prologue.catala_fr"; + start_line=41; start_column=10; + end_line=41; end_column=22; + law_headings=["Prologue : prestations familiales"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/../prestations_familiales/prologue.catala_fr"; + start_line=41; start_column=10; + end_line=41; end_column=22; + law_headings=["Prologue : prestations familiales"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/../prestations_familiales/sécurité_sociale_L.catala_fr"; + start_line=58; start_column=5; + end_line=60; end_column=60; + law_headings=["Article L512-3"; + "Chapitre 2 : Champ d'application"; + "Titre 1 : Champ d'application - Généralités"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie législative"; + "Code de la sécurité sociale"]} + ((match + (param_.EnfantPrestationsFamiliales.obligation_scolaire) + with + | SituationObligationScolaire.Avant _ -> + false + | SituationObligationScolaire.Pendant _ -> + false + | SituationObligationScolaire.Apres _ -> + true) && + (((param_.EnfantPrestationsFamiliales.remuneration_mensuelle) + <=$ plafond_l512_3_2_) && + ((param_.EnfantPrestationsFamiliales.age) + true))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/../prestations_familiales/sécurité_sociale_L.catala_fr"; + start_line=47; start_column=5; + end_line=48; end_column=78; + law_headings=["Article L512-3"; + "Chapitre 2 : Champ d'application"; + "Titre 1 : Champ d'application - Généralités"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie législative"; + "Code de la sécurité sociale"]} + ((match + (param_.EnfantPrestationsFamiliales.obligation_scolaire) + with + | SituationObligationScolaire.Avant _ -> + true + | SituationObligationScolaire.Pendant _ -> + false + | SituationObligationScolaire.Apres _ -> + false) || + (match + (param_.EnfantPrestationsFamiliales.obligation_scolaire) + with + | SituationObligationScolaire.Avant _ -> + false + | SituationObligationScolaire.Pendant _ -> + true + | SituationObligationScolaire.Apres _ -> + false)))) (fun (_: _) -> true))|]) + (fun (_: _) -> false) (fun (_: _) -> raise EmptyError))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/../prestations_familiales/prologue.catala_fr"; + start_line=41; start_column=10; + end_line=41; end_column=22; + law_headings=["Prologue : prestations familiales"]} true)) + (fun (_: _) -> false)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/../prestations_familiales/prologue.catala_fr"; + start_line=41; start_column=10; end_line=41; end_column=22; + law_headings=["Prologue : prestations familiales"]}))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/../prestations_familiales/prologue.catala_fr"; + start_line=41; start_column=10; end_line=41; end_column=22; + law_headings=["Prologue : prestations familiales"]})))) in + {EligibilitePrestationsFamilialesOut.droit_ouvert_out = droit_ouvert_; + EligibilitePrestationsFamilialesOut.conditions_hors_age_out = + conditions_hors_age_; + EligibilitePrestationsFamilialesOut.age_l512_3_2_out = age_l512_3_2_; + EligibilitePrestationsFamilialesOut.regime_outre_mer_l751_1_out = + regime_outre_mer_l751_1_} + +let calcul_allocation_logement_locatif (calcul_allocation_logement_locatif_in: CalculAllocationLogementLocatifIn.t) : CalculAllocationLogementLocatifOut.t = + let loyer_principal_: money = calcul_allocation_logement_locatif_in.CalculAllocationLogementLocatifIn.loyer_principal_in in + let ressources_menage_arrondies_: money = calcul_allocation_logement_locatif_in.CalculAllocationLogementLocatifIn.ressources_menage_arrondies_in in + let beneficiaire_aide_adulte_ou_enfant_handicapes_: bool = calcul_allocation_logement_locatif_in.CalculAllocationLogementLocatifIn.beneficiaire_aide_adulte_ou_enfant_handicapes_in in + let date_courante_: date = calcul_allocation_logement_locatif_in.CalculAllocationLogementLocatifIn.date_courante_in in + let nombre_personnes_a_charge_: integer = calcul_allocation_logement_locatif_in.CalculAllocationLogementLocatifIn.nombre_personnes_a_charge_in in + let situation_familiale_calcul_apl_: SituationFamilialeCalculAPL.t = calcul_allocation_logement_locatif_in.CalculAllocationLogementLocatifIn.situation_familiale_calcul_apl_in in + let zone_: ZoneDHabitation.t = calcul_allocation_logement_locatif_in.CalculAllocationLogementLocatifIn.zone_in in + let logement_est_chambre_: bool = calcul_allocation_logement_locatif_in.CalculAllocationLogementLocatifIn.logement_est_chambre_in in + let agees_ou_handicap_adultes_hebergees_onereux_particuliers_: bool = calcul_allocation_logement_locatif_in.CalculAllocationLogementLocatifIn.agees_ou_handicap_adultes_hebergees_onereux_particuliers_in in + let type_aide_: TypeAidesPersonnelleLogement.t = calcul_allocation_logement_locatif_in.CalculAllocationLogementLocatifIn.type_aide_in in + let colocation_: bool = calcul_allocation_logement_locatif_in.CalculAllocationLogementLocatifIn.colocation_in in + let reduction_loyer_solidarite_: money = calcul_allocation_logement_locatif_in.CalculAllocationLogementLocatifIn.reduction_loyer_solidarite_in in + let logement_meuble_d842_2_: bool = calcul_allocation_logement_locatif_in.CalculAllocationLogementLocatifIn.logement_meuble_d842_2_in in + let changement_logement_d842_4_: ChangementLogementD8424.t = calcul_allocation_logement_locatif_in.CalculAllocationLogementLocatifIn.changement_logement_d842_4_in in + let calcul_apl_locatif_dot_loyer_principal_: money = + try ((log_variable_definition + ["CalculAllocationLogementLocatif"; + "calcul_apl_locatif.loyer_principal"] (embed_money) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=809; start_column=3; end_line=809; end_column=21; + law_headings=["Secteur locatif"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=809; start_column=3; + end_line=809; end_column=21; + law_headings=["Secteur locatif"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=4278; start_column=5; + end_line=4278; end_column=27; + law_headings=["Article D842-2"; + "Section 1 : Secteur locatif ordinaire"; + "Chapitre 2 : Modalités de liquidation et de versement des allocations de logement"; + "Titre IV : Allocations de Logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + logement_meuble_d842_2_)) + (fun (_: _) -> + loyer_principal_ *$ + ((decimal_of_string "2.") /& (decimal_of_string "3."))))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=816; start_column=14; end_line=816; end_column=48; + law_headings=["Secteur locatif"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> loyer_principal_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=558; start_column=10; end_line=558; end_column=25; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let calcul_apl_locatif_dot_ressources_menage_arrondies_: money = + try ((log_variable_definition + ["CalculAllocationLogementLocatif"; + "calcul_apl_locatif.ressources_ménage_arrondies"] (embed_money) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=809; start_column=3; end_line=809; end_column=21; + law_headings=["Secteur locatif"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=818; start_column=14; end_line=818; end_column=60; + law_headings=["Secteur locatif"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> ressources_menage_arrondies_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=559; start_column=10; end_line=559; end_column=37; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let calcul_apl_locatif_dot_beneficiaire_aide_adulte_ou_enfant_handicapes_: bool = + try ((log_variable_definition + ["CalculAllocationLogementLocatif"; + "calcul_apl_locatif.bénéficiaire_aide_adulte_ou_enfant_handicapés"] + (embed_bool) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=809; start_column=3; end_line=809; end_column=21; + law_headings=["Secteur locatif"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=820; start_column=14; end_line=820; end_column=78; + law_headings=["Secteur locatif"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> beneficiaire_aide_adulte_ou_enfant_handicapes_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=560; start_column=10; end_line=560; end_column=55; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let calcul_apl_locatif_dot_date_courante_: date = + try ((log_variable_definition + ["CalculAllocationLogementLocatif"; "calcul_apl_locatif.date_courante"] + (embed_date) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=809; start_column=3; end_line=809; end_column=21; + law_headings=["Secteur locatif"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=823; start_column=14; end_line=823; end_column=46; + law_headings=["Secteur locatif"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> date_courante_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=562; start_column=10; end_line=562; end_column=23; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let calcul_apl_locatif_dot_nombre_personnes_a_charge_: integer = + try ((log_variable_definition + ["CalculAllocationLogementLocatif"; + "calcul_apl_locatif.nombre_personnes_à_charge"] (embed_integer) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=809; start_column=3; end_line=809; end_column=21; + law_headings=["Secteur locatif"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=825; start_column=14; end_line=825; end_column=58; + law_headings=["Secteur locatif"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> nombre_personnes_a_charge_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=563; start_column=10; end_line=563; end_column=35; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let calcul_apl_locatif_dot_situation_familiale_calcul_apl_: SituationFamilialeCalculAPL.t = + try ((log_variable_definition + ["CalculAllocationLogementLocatif"; + "calcul_apl_locatif.situation_familiale_calcul_apl"] + (embed_situation_familiale_calcul_a_p_l) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=809; start_column=3; end_line=809; end_column=21; + law_headings=["Secteur locatif"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=827; start_column=14; end_line=827; end_column=63; + law_headings=["Secteur locatif"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> situation_familiale_calcul_apl_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=564; start_column=10; end_line=564; end_column=40; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let calcul_apl_locatif_dot_zone_: ZoneDHabitation.t = + try ((log_variable_definition + ["CalculAllocationLogementLocatif"; "calcul_apl_locatif.zone"] + (embed_zone_d_habitation) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=809; start_column=3; end_line=809; end_column=21; + law_headings=["Secteur locatif"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=829; start_column=14; end_line=829; end_column=37; + law_headings=["Secteur locatif"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> zone_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=565; start_column=10; end_line=565; end_column=14; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let calcul_apl_locatif_dot_logement_est_chambre_: bool = + try ((log_variable_definition + ["CalculAllocationLogementLocatif"; + "calcul_apl_locatif.logement_est_chambre"] (embed_bool) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=809; start_column=3; end_line=809; end_column=21; + law_headings=["Secteur locatif"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=831; start_column=14; end_line=831; end_column=53; + law_headings=["Secteur locatif"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> logement_est_chambre_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=566; start_column=10; end_line=566; end_column=30; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let calcul_apl_locatif_dot_agees_ou_handicap_adultes_hebergees_onereux_particuliers_: bool = + try ((log_variable_definition + ["CalculAllocationLogementLocatif"; + "calcul_apl_locatif.âgées_ou_handicap_adultes_hébergées_onéreux_particuliers"] + (embed_bool) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=809; start_column=3; end_line=809; end_column=21; + law_headings=["Secteur locatif"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=834; start_column=5; end_line=835; end_column=63; + law_headings=["Secteur locatif"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> + agees_ou_handicap_adultes_hebergees_onereux_particuliers_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=567; start_column=10; end_line=567; end_column=66; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let calcul_apl_locatif_dot_type_aide_: TypeAidesPersonnelleLogement.t = + try ((log_variable_definition + ["CalculAllocationLogementLocatif"; "calcul_apl_locatif.type_aide"] + (embed_type_aides_personnelle_logement) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=809; start_column=3; end_line=809; end_column=21; + law_headings=["Secteur locatif"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=838; start_column=14; end_line=838; end_column=42; + law_headings=["Secteur locatif"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> type_aide_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=569; start_column=10; end_line=569; end_column=19; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let calcul_apl_locatif_dot_colocation_: bool = + try ((log_variable_definition + ["CalculAllocationLogementLocatif"; "calcul_apl_locatif.colocation"] + (embed_bool) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=809; start_column=3; end_line=809; end_column=21; + law_headings=["Secteur locatif"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=840; start_column=14; end_line=840; end_column=43; + law_headings=["Secteur locatif"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> colocation_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=570; start_column=10; end_line=570; end_column=20; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let calcul_apl_locatif_dot_reduction_loyer_solidarite_: money = + try ((log_variable_definition + ["CalculAllocationLogementLocatif"; + "calcul_apl_locatif.réduction_loyer_solidarité"] (embed_money) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=809; start_column=3; end_line=809; end_column=21; + law_headings=["Secteur locatif"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=842; start_column=14; end_line=842; end_column=59; + law_headings=["Secteur locatif"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> reduction_loyer_solidarite_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=571; start_column=10; end_line=571; end_column=36; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let result_: CalculAidePersonnaliseeLogementLocatifOut.t = (log_end_call + ["CalculAllocationLogementLocatif"; "calcul_apl_locatif"; + "CalculAidePersonnaliséeLogementLocatif"] ((log_begin_call + ["CalculAllocationLogementLocatif"; "calcul_apl_locatif"; + "CalculAidePersonnaliséeLogementLocatif"] + calcul_aide_personnalisee_logement_locatif) + {CalculAidePersonnaliseeLogementLocatifIn.loyer_principal_in = + calcul_apl_locatif_dot_loyer_principal_; + CalculAidePersonnaliseeLogementLocatifIn.ressources_menage_arrondies_in = + calcul_apl_locatif_dot_ressources_menage_arrondies_; + CalculAidePersonnaliseeLogementLocatifIn.beneficiaire_aide_adulte_ou_enfant_handicapes_in = + calcul_apl_locatif_dot_beneficiaire_aide_adulte_ou_enfant_handicapes_; + CalculAidePersonnaliseeLogementLocatifIn.date_courante_in = + calcul_apl_locatif_dot_date_courante_; + CalculAidePersonnaliseeLogementLocatifIn.nombre_personnes_a_charge_in = + calcul_apl_locatif_dot_nombre_personnes_a_charge_; + CalculAidePersonnaliseeLogementLocatifIn.situation_familiale_calcul_apl_in = + calcul_apl_locatif_dot_situation_familiale_calcul_apl_; + CalculAidePersonnaliseeLogementLocatifIn.zone_in = + calcul_apl_locatif_dot_zone_; + CalculAidePersonnaliseeLogementLocatifIn.logement_est_chambre_in = + calcul_apl_locatif_dot_logement_est_chambre_; + CalculAidePersonnaliseeLogementLocatifIn.agees_ou_handicap_adultes_hebergees_onereux_particuliers_in = + calcul_apl_locatif_dot_agees_ou_handicap_adultes_hebergees_onereux_particuliers_; + CalculAidePersonnaliseeLogementLocatifIn.type_aide_in = + calcul_apl_locatif_dot_type_aide_; + CalculAidePersonnaliseeLogementLocatifIn.colocation_in = + calcul_apl_locatif_dot_colocation_; + CalculAidePersonnaliseeLogementLocatifIn.reduction_loyer_solidarite_in = + calcul_apl_locatif_dot_reduction_loyer_solidarite_})) in + let calcul_apl_locatif_dot_montant_forfaitaire_charges_d823_16_: money = result_.CalculAidePersonnaliseeLogementLocatifOut.montant_forfaitaire_charges_d823_16_out in + let calcul_apl_locatif_dot_plafond_loyer_d823_16_2_: money = result_.CalculAidePersonnaliseeLogementLocatifOut.plafond_loyer_d823_16_2_out in + let calcul_apl_locatif_dot_participation_minimale_: money = result_.CalculAidePersonnaliseeLogementLocatifOut.participation_minimale_out in + let calcul_apl_locatif_dot_taux_composition_familiale_: decimal = result_.CalculAidePersonnaliseeLogementLocatifOut.taux_composition_familiale_out in + let calcul_apl_locatif_dot_participation_personnelle_: money = result_.CalculAidePersonnaliseeLogementLocatifOut.participation_personnelle_out in + let calcul_apl_locatif_dot_aide_finale_formule_: money = result_.CalculAidePersonnaliseeLogementLocatifOut.aide_finale_formule_out in + let calcul_apl_locatif_dot_traitement_aide_finale_montant_minimal_: + money -> money = result_.CalculAidePersonnaliseeLogementLocatifOut.traitement_aide_finale_montant_minimal_out in + let traitement_aide_finale_: money -> money = (log_variable_definition + ["CalculAllocationLogementLocatif"; "traitement_aide_finale"] + (unembeddable) ( + try + (fun (param_: money) -> + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=813; start_column=10; end_line=813; end_column=32; + law_headings=["Secteur locatif"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=813; start_column=10; + end_line=813; end_column=32; + law_headings=["Secteur locatif"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=4346; start_column=24; + end_line=4346; end_column=46; + law_headings=["Article D842-4"; + "Section 1 : Secteur locatif ordinaire"; + "Chapitre 2 : Modalités de liquidation et de versement des allocations de logement"; + "Titre IV : Allocations de Logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + (match changement_logement_d842_4_ + with + | ChangementLogementD8424.Changement infos_ -> + (loyer_principal_ >=$ + (infos_.InfosChangementLogementD8424.ancien_loyer_principal)) + | ChangementLogementD8424.PasDeChangement _ -> + false))) (fun (_: _) -> param_))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=847; start_column=14; + end_line=847; end_column=36; + law_headings=["Secteur locatif"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> (log_end_call + ["CalculAidePersonnaliséeLogementLocatif"; + "traitement_aide_finale_montant_minimal"] + ((log_variable_definition + ["CalculAidePersonnaliséeLogementLocatif"; + "traitement_aide_finale_montant_minimal"; "output"] + (embed_money) ((log_begin_call + ["CalculAidePersonnaliséeLogementLocatif"; + "traitement_aide_finale_montant_minimal"] + calcul_apl_locatif_dot_traitement_aide_finale_montant_minimal_) + ((log_variable_definition + ["CalculAidePersonnaliséeLogementLocatif"; + "traitement_aide_finale_montant_minimal"; "input"] + (embed_money) param_)))))))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=813; start_column=10; end_line=813; end_column=32; + law_headings=["Secteur locatif"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]}))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=813; start_column=10; end_line=813; end_column=32; + law_headings=["Secteur locatif"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})))) in + let aide_finale_formule_: money = (log_variable_definition + ["CalculAllocationLogementLocatif"; "aide_finale_formule"] (embed_money) + ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=811; start_column=10; end_line=811; end_column=29; + law_headings=["Secteur locatif"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=811; start_column=10; + end_line=811; end_column=29; + law_headings=["Secteur locatif"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=4338; start_column=24; + end_line=4338; end_column=43; + law_headings=["Article D842-4"; + "Section 1 : Secteur locatif ordinaire"; + "Chapitre 2 : Modalités de liquidation et de versement des allocations de logement"; + "Titre IV : Allocations de Logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + (match changement_logement_d842_4_ + with + | ChangementLogementD8424.Changement infos_ -> + (loyer_principal_ >=$ + (infos_.InfosChangementLogementD8424.ancien_loyer_principal)) + | ChangementLogementD8424.PasDeChangement _ -> false))) + (fun (_: _) -> + match changement_logement_d842_4_ + with + | ChangementLogementD8424.Changement infos_ -> + (loyer_principal_ -$ + ((infos_.InfosChangementLogementD8424.ancien_loyer_principal) + -$ + (infos_.InfosChangementLogementD8424.ancienne_allocation_logement))) + | ChangementLogementD8424.PasDeChangement _ -> + (money_of_cents_string "0")))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=846; start_column=14; end_line=846; end_column=33; + law_headings=["Secteur locatif"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> calcul_apl_locatif_dot_aide_finale_formule_)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=811; start_column=10; end_line=811; end_column=29; + law_headings=["Secteur locatif"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})))) in + {CalculAllocationLogementLocatifOut.aide_finale_formule_out = + aide_finale_formule_; + CalculAllocationLogementLocatifOut.traitement_aide_finale_out = + traitement_aide_finale_} + +let calcul_allocation_logement_foyer (calcul_allocation_logement_foyer_in: CalculAllocationLogementFoyerIn.t) : CalculAllocationLogementFoyerOut.t = + let redevance_: money = calcul_allocation_logement_foyer_in.CalculAllocationLogementFoyerIn.redevance_in in + let mode_occupation_: ModeOccupation.t = calcul_allocation_logement_foyer_in.CalculAllocationLogementFoyerIn.mode_occupation_in in + let ressources_menage_arrondies_: money = calcul_allocation_logement_foyer_in.CalculAllocationLogementFoyerIn.ressources_menage_arrondies_in in + let nombre_personnes_a_charge_: integer = calcul_allocation_logement_foyer_in.CalculAllocationLogementFoyerIn.nombre_personnes_a_charge_in in + let situation_familiale_calcul_apl_: SituationFamilialeCalculAPL.t = calcul_allocation_logement_foyer_in.CalculAllocationLogementFoyerIn.situation_familiale_calcul_apl_in in + let zone_: ZoneDHabitation.t = calcul_allocation_logement_foyer_in.CalculAllocationLogementFoyerIn.zone_in in + let date_courante_: date = calcul_allocation_logement_foyer_in.CalculAllocationLogementFoyerIn.date_courante_in in + let categorie_equivalence_loyer_d842_16_: CategorieEquivalenceLoyerAllocationLogementFoyer.t = calcul_allocation_logement_foyer_in.CalculAllocationLogementFoyerIn.categorie_equivalence_loyer_d842_16_in in + let montant_minimal_aide_d842_15_: money = (log_variable_definition + ["CalculAllocationLogementFoyer"; "montant_minimal_aide_d842_15"] + (embed_money) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=960; start_column=11; end_line=960; end_column=39; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=4289; start_column=14; end_line=4289; end_column=42; + law_headings=["Article 42"; + "Chapitre VII : Calcul des allocations de logement en secteur logement-foyer"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + true)) (fun (_: _) -> money_of_cents_string "1000")) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=960; start_column=11; end_line=960; end_column=39; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})))) in + let montant_forfaitaire_d842_15_: money = (log_variable_definition + ["CalculAllocationLogementFoyer"; "montant_forfaitaire_d842_15"] + (embed_money) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=961; start_column=11; end_line=961; end_column=38; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=4278; start_column=14; end_line=4278; end_column=41; + law_headings=["Article 41"; + "Chapitre VII : Calcul des allocations de logement en secteur logement-foyer"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + true)) (fun (_: _) -> money_of_cents_string "500")) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=961; start_column=11; end_line=961; end_column=38; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})))) in + let montant_minimal_depense_nette_d842_17_: money = (log_variable_definition + ["CalculAllocationLogementFoyer"; + "montant_minimal_dépense_nette_d842_17"] (embed_money) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=962; start_column=11; end_line=962; end_column=48; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=4379; start_column=14; end_line=4379; end_column=51; + law_headings=["Article 44"; + "Chapitre VII : Calcul des allocations de logement en secteur logement-foyer"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + true)) (fun (_: _) -> money_of_cents_string "1500")) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=962; start_column=11; end_line=962; end_column=48; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})))) in + let calcul_nombre_parts_dot_condition_2_du_832_25_: bool = + try ((log_variable_definition + ["CalculAllocationLogementFoyer"; + "calcul_nombre_parts.condition_2_du_832_25"] (embed_bool) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=968; start_column=3; end_line=968; end_column=22; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=4899; start_column=14; end_line=4899; end_column=55; + law_headings=["Article D842-15"; + "Section 3 : Logements-foyers"; + "Chapitre 2 : Modalités de liquidation et de versement des allocations de logement"; + "Titre IV : Allocations de Logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) (fun (_: _) -> true)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=625; start_column=10; end_line=625; end_column=31; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let calcul_nombre_parts_dot_nombre_personnes_a_charge_: integer = + try ((log_variable_definition + ["CalculAllocationLogementFoyer"; + "calcul_nombre_parts.nombre_personnes_à_charge"] (embed_integer) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=968; start_column=3; end_line=968; end_column=22; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=4895; start_column=14; end_line=4895; end_column=59; + law_headings=["Article D842-15"; + "Section 3 : Logements-foyers"; + "Chapitre 2 : Modalités de liquidation et de versement des allocations de logement"; + "Titre IV : Allocations de Logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) (fun (_: _) -> nombre_personnes_a_charge_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=626; start_column=10; end_line=626; end_column=35; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let calcul_nombre_parts_dot_situation_familiale_calcul_apl_: SituationFamilialeCalculAPL.t = + try ((log_variable_definition + ["CalculAllocationLogementFoyer"; + "calcul_nombre_parts.situation_familiale_calcul_apl"] + (embed_situation_familiale_calcul_a_p_l) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=968; start_column=3; end_line=968; end_column=22; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=4897; start_column=14; end_line=4897; end_column=64; + law_headings=["Article D842-15"; + "Section 3 : Logements-foyers"; + "Chapitre 2 : Modalités de liquidation et de versement des allocations de logement"; + "Titre IV : Allocations de Logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) (fun (_: _) -> situation_familiale_calcul_apl_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=627; start_column=10; end_line=627; end_column=40; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let result_: CalculNombrePartLogementFoyerOut.t = (log_end_call + ["CalculAllocationLogementFoyer"; "calcul_nombre_parts"; + "CalculNombrePartLogementFoyer"] ((log_begin_call + ["CalculAllocationLogementFoyer"; "calcul_nombre_parts"; + "CalculNombrePartLogementFoyer"] calcul_nombre_part_logement_foyer) + {CalculNombrePartLogementFoyerIn.condition_2_du_832_25_in = + calcul_nombre_parts_dot_condition_2_du_832_25_; + CalculNombrePartLogementFoyerIn.nombre_personnes_a_charge_in = + calcul_nombre_parts_dot_nombre_personnes_a_charge_; + CalculNombrePartLogementFoyerIn.situation_familiale_calcul_apl_in = + calcul_nombre_parts_dot_situation_familiale_calcul_apl_})) in + let calcul_nombre_parts_dot_n_nombre_parts_d832_25_: decimal = result_.CalculNombrePartLogementFoyerOut.n_nombre_parts_d832_25_out in + let contributions_sociales_dot_date_courante_: date = + try ((log_variable_definition + ["CalculAllocationLogementFoyer"; + "contributions_sociales.date_courante"] (embed_date) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=971; start_column=3; end_line=971; end_column=25; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=999; start_column=14; end_line=999; end_column=50; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> date_courante_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=544; start_column=10; end_line=544; end_column=23; + law_headings=["Calcul des contributions sociales s'appliquant aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let result_: ContributionsSocialesAidesPersonnelleLogementOut.t = (log_end_call + ["CalculAllocationLogementFoyer"; "contributions_sociales"; + "ContributionsSocialesAidesPersonnelleLogement"] ((log_begin_call + ["CalculAllocationLogementFoyer"; "contributions_sociales"; + "ContributionsSocialesAidesPersonnelleLogement"] + contributions_sociales_aides_personnelle_logement) + {ContributionsSocialesAidesPersonnelleLogementIn.date_courante_in = + contributions_sociales_dot_date_courante_})) in + let contributions_sociales_dot_montant_: money -> money = result_.ContributionsSocialesAidesPersonnelleLogementOut.montant_out in + let calcul_apl_logement_foyer_dot_mode_occupation_: ModeOccupation.t = + try ((log_variable_definition + ["CalculAllocationLogementFoyer"; + "calcul_apl_logement_foyer.mode_occupation"] (embed_mode_occupation) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=969; start_column=3; end_line=969; end_column=28; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=985; start_column=14; end_line=985; end_column=55; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> mode_occupation_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=632; start_column=10; end_line=632; end_column=25; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let calcul_apl_logement_foyer_dot_ressources_menage_arrondies_: money = + try ((log_variable_definition + ["CalculAllocationLogementFoyer"; + "calcul_apl_logement_foyer.ressources_ménage_arrondies"] + (embed_money) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=969; start_column=3; end_line=969; end_column=28; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=989; start_column=14; end_line=989; end_column=67; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> ressources_menage_arrondies_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=633; start_column=10; end_line=633; end_column=37; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let calcul_apl_logement_foyer_dot_nombre_personnes_a_charge_: integer = + try ((log_variable_definition + ["CalculAllocationLogementFoyer"; + "calcul_apl_logement_foyer.nombre_personnes_à_charge"] + (embed_integer) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=969; start_column=3; end_line=969; end_column=28; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=991; start_column=14; end_line=991; end_column=65; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> nombre_personnes_a_charge_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=634; start_column=10; end_line=634; end_column=35; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let calcul_apl_logement_foyer_dot_situation_familiale_calcul_apl_: SituationFamilialeCalculAPL.t = + try ((log_variable_definition + ["CalculAllocationLogementFoyer"; + "calcul_apl_logement_foyer.situation_familiale_calcul_apl"] + (embed_situation_familiale_calcul_a_p_l) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=969; start_column=3; end_line=969; end_column=28; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=993; start_column=14; end_line=993; end_column=70; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> situation_familiale_calcul_apl_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=635; start_column=10; end_line=635; end_column=40; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let calcul_apl_logement_foyer_dot_zone_: ZoneDHabitation.t = + try ((log_variable_definition + ["CalculAllocationLogementFoyer"; "calcul_apl_logement_foyer.zone"] + (embed_zone_d_habitation) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=969; start_column=3; end_line=969; end_column=28; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=995; start_column=14; end_line=995; end_column=44; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> zone_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=636; start_column=10; end_line=636; end_column=14; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let calcul_apl_logement_foyer_dot_date_courante_: date = + try ((log_variable_definition + ["CalculAllocationLogementFoyer"; + "calcul_apl_logement_foyer.date_courante"] (embed_date) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=969; start_column=3; end_line=969; end_column=28; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=997; start_column=14; end_line=997; end_column=53; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> date_courante_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=637; start_column=10; end_line=637; end_column=23; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let calcul_apl_logement_foyer_dot_redevance_: money = + try ((log_variable_definition + ["CalculAllocationLogementFoyer"; + "calcul_apl_logement_foyer.redevance"] (embed_money) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=969; start_column=3; end_line=969; end_column=28; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=987; start_column=14; end_line=987; end_column=49; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> redevance_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=638; start_column=10; end_line=638; end_column=19; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let calcul_apl_logement_foyer_dot_condition_2_du_832_25_: unit -> bool = + fun (_: unit) -> (log_variable_definition + ["CalculAllocationLogementFoyer"; + "calcul_apl_logement_foyer.condition_2_du_832_25"] (embed_bool) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=969; start_column=3; end_line=969; end_column=28; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=4862; start_column=14; end_line=4862; end_column=61; + law_headings=["Article D842-15"; + "Section 3 : Logements-foyers"; + "Chapitre 2 : Modalités de liquidation et de versement des allocations de logement"; + "Titre IV : Allocations de Logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) (fun (_: _) -> true))) in + let calcul_apl_logement_foyer_dot_n_nombre_parts_d832_25_: unit -> decimal = + fun (_: unit) -> (log_variable_definition + ["CalculAllocationLogementFoyer"; + "calcul_apl_logement_foyer.n_nombre_parts_d832_25"] (embed_decimal) + (raise EmptyError)) in + let result_: CalculAidePersonnaliseeLogementFoyerOut.t = (log_end_call + ["CalculAllocationLogementFoyer"; "calcul_apl_logement_foyer"; + "CalculAidePersonnaliséeLogementFoyer"] ((log_begin_call + ["CalculAllocationLogementFoyer"; "calcul_apl_logement_foyer"; + "CalculAidePersonnaliséeLogementFoyer"] + calcul_aide_personnalisee_logement_foyer) + {CalculAidePersonnaliseeLogementFoyerIn.mode_occupation_in = + calcul_apl_logement_foyer_dot_mode_occupation_; + CalculAidePersonnaliseeLogementFoyerIn.ressources_menage_arrondies_in = + calcul_apl_logement_foyer_dot_ressources_menage_arrondies_; + CalculAidePersonnaliseeLogementFoyerIn.nombre_personnes_a_charge_in = + calcul_apl_logement_foyer_dot_nombre_personnes_a_charge_; + CalculAidePersonnaliseeLogementFoyerIn.situation_familiale_calcul_apl_in = + calcul_apl_logement_foyer_dot_situation_familiale_calcul_apl_; + CalculAidePersonnaliseeLogementFoyerIn.zone_in = + calcul_apl_logement_foyer_dot_zone_; + CalculAidePersonnaliseeLogementFoyerIn.date_courante_in = + calcul_apl_logement_foyer_dot_date_courante_; + CalculAidePersonnaliseeLogementFoyerIn.redevance_in = + calcul_apl_logement_foyer_dot_redevance_; + CalculAidePersonnaliseeLogementFoyerIn.condition_2_du_832_25_in = + calcul_apl_logement_foyer_dot_condition_2_du_832_25_; + CalculAidePersonnaliseeLogementFoyerIn.n_nombre_parts_d832_25_in = + calcul_apl_logement_foyer_dot_n_nombre_parts_d832_25_})) in + let calcul_apl_logement_foyer_dot_coefficient_multiplicateur_d832_25_: money = result_.CalculAidePersonnaliseeLogementFoyerOut.coefficient_multiplicateur_d832_25_out in + let calcul_apl_logement_foyer_dot_coefficient_r_d832_25_: money = result_.CalculAidePersonnaliseeLogementFoyerOut.coefficient_r_d832_25_out in + let calcul_apl_logement_foyer_dot_n_nombre_parts_d832_25_: decimal = result_.CalculAidePersonnaliseeLogementFoyerOut.n_nombre_parts_d832_25_out in + let calcul_apl_logement_foyer_dot_equivalence_loyer_eligible_: money = result_.CalculAidePersonnaliseeLogementFoyerOut.equivalence_loyer_eligible_out in + let calcul_apl_logement_foyer_dot_plafond_equivalence_loyer_eligible_: money = result_.CalculAidePersonnaliseeLogementFoyerOut.plafond_equivalence_loyer_eligible_out in + let calcul_apl_logement_foyer_dot_equivalence_loyer_minimale_: money = result_.CalculAidePersonnaliseeLogementFoyerOut.equivalence_loyer_minimale_out in + let calcul_apl_logement_foyer_dot_coefficient_prise_en_charge_d832_25_seuil_: decimal = result_.CalculAidePersonnaliseeLogementFoyerOut.coefficient_prise_en_charge_d832_25_seuil_out in + let calcul_apl_logement_foyer_dot_aide_finale_formule_: money = result_.CalculAidePersonnaliseeLogementFoyerOut.aide_finale_formule_out in + let calcul_apl_logement_foyer_dot_traitement_aide_finale_montant_minimal_: + money -> money = result_.CalculAidePersonnaliseeLogementFoyerOut.traitement_aide_finale_montant_minimal_out in + let montant_forfaitaire_charges_: money = (log_variable_definition + ["CalculAllocationLogementFoyer"; "montant_forfaitaire_charges"] + (embed_money) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=965; start_column=10; end_line=965; end_column=37; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=4265; start_column=14; end_line=4265; end_column=41; + law_headings=["Article 40"; + "Chapitre VII : Calcul des allocations de logement en secteur logement-foyer"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + (date_courante_ >=@ (date_of_numbers (2021) (10) (1))))) + (fun (_: _) -> + if (nombre_personnes_a_charge_ = (integer_of_string "0")) then + (money_of_cents_string "5422") else + ((money_of_cents_string "5422") +$ + ((money_of_cents_string "1229") *$ + (decimal_of_integer nombre_personnes_a_charge_))))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=965; start_column=10; end_line=965; end_column=37; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})))) in + let equivalence_loyer_: money = (log_variable_definition + ["CalculAllocationLogementFoyer"; "équivalence_loyer"] (embed_money) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=964; start_column=10; end_line=964; end_column=27; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=964; start_column=10; + end_line=964; end_column=27; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=4307; start_column=6; + end_line=4307; end_column=74; + law_headings=["Article 43"; + "Chapitre VII : Calcul des allocations de logement en secteur logement-foyer"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + ((date_courante_ >=@ (date_of_numbers (2021) (10) (1))) + && + (match categorie_equivalence_loyer_d842_16_ + with + | CategorieEquivalenceLoyerAllocationLogementFoyer.EtudiantLogeEnChambre _ -> + true + | CategorieEquivalenceLoyerAllocationLogementFoyer.EtudiantLogeEnChambreRehabilitee _ -> + false + | CategorieEquivalenceLoyerAllocationLogementFoyer.PersonnesAgeesSelon3DeD842_16 _ -> + false + | CategorieEquivalenceLoyerAllocationLogementFoyer.AutresPersonnes _ -> + false)))) + (fun (_: _) -> + match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "8414") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "13100"))); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=964; start_column=10; + end_line=964; end_column=27; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=4342; start_column=6; + end_line=4343; end_column=38; + law_headings=["Article 43"; + "Chapitre VII : Calcul des allocations de logement en secteur logement-foyer"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + ((date_courante_ >=@ (date_of_numbers (2021) (10) (1))) + && + (match categorie_equivalence_loyer_d842_16_ + with + | CategorieEquivalenceLoyerAllocationLogementFoyer.EtudiantLogeEnChambre _ -> + false + | CategorieEquivalenceLoyerAllocationLogementFoyer.EtudiantLogeEnChambreRehabilitee _ -> + false + | CategorieEquivalenceLoyerAllocationLogementFoyer.PersonnesAgeesSelon3DeD842_16 _ -> + true + | CategorieEquivalenceLoyerAllocationLogementFoyer.AutresPersonnes _ -> + false)))) + (fun (_: _) -> + match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "20640") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "32073"))); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=964; start_column=10; + end_line=964; end_column=27; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=964; start_column=10; + end_line=964; end_column=27; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=4360; start_column=6; + end_line=4361; end_column=24; + law_headings=["Article 43"; + "Chapitre VII : Calcul des allocations de logement en secteur logement-foyer"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + ((date_courante_ >=@ + (date_of_numbers (2021) (10) (1))) && + (match categorie_equivalence_loyer_d842_16_ + with + | CategorieEquivalenceLoyerAllocationLogementFoyer.EtudiantLogeEnChambre _ -> + false + | CategorieEquivalenceLoyerAllocationLogementFoyer.EtudiantLogeEnChambreRehabilitee _ -> + false + | CategorieEquivalenceLoyerAllocationLogementFoyer.PersonnesAgeesSelon3DeD842_16 _ -> + false + | CategorieEquivalenceLoyerAllocationLogementFoyer.AutresPersonnes _ -> + true)))) + (fun (_: _) -> + match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "17012") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "26440")))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=4324; start_column=6; + end_line=4325; end_column=41; + law_headings=["Article 43"; + "Chapitre VII : Calcul des allocations de logement en secteur logement-foyer"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + ((date_courante_ >=@ (date_of_numbers (2021) (10) (1))) + && + (match categorie_equivalence_loyer_d842_16_ + with + | CategorieEquivalenceLoyerAllocationLogementFoyer.EtudiantLogeEnChambre _ -> + false + | CategorieEquivalenceLoyerAllocationLogementFoyer.EtudiantLogeEnChambreRehabilitee _ -> + true + | CategorieEquivalenceLoyerAllocationLogementFoyer.PersonnesAgeesSelon3DeD842_16 _ -> + false + | CategorieEquivalenceLoyerAllocationLogementFoyer.AutresPersonnes _ -> + false)))) + (fun (_: _) -> + match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "17012") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "26440")))|]) + (fun (_: _) -> false) (fun (_: _) -> raise EmptyError)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=964; start_column=10; end_line=964; end_column=27; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})))) in + let traitement_aide_finale_minoration_forfaitaire_: money -> money = (log_variable_definition + ["CalculAllocationLogementFoyer"; + "traitement_aide_finale_minoration_forfaitaire"] (unembeddable) ( + try + (fun (param_: money) -> + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=978; start_column=10; end_line=978; end_column=32; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=4911; start_column=14; + end_line=4911; end_column=36; + law_headings=["Article D842-15"; + "Section 3 : Logements-foyers"; + "Chapitre 2 : Modalités de liquidation et de versement des allocations de logement"; + "Titre IV : Allocations de Logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + if + ((param_ -$ montant_forfaitaire_d842_15_) <$ + (money_of_cents_string "0")) then + (money_of_cents_string "0") else + (param_ -$ montant_forfaitaire_d842_15_))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=978; start_column=10; end_line=978; end_column=32; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]}))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=978; start_column=10; end_line=978; end_column=32; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})))) in + let calcul_equivalence_loyer_minimale_dot_ressources_menage_arrondies_: money = + try ((log_variable_definition + ["CalculAllocationLogementFoyer"; + "calcul_équivalence_loyer_minimale.ressources_ménage_arrondies"] + (embed_money) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=973; start_column=3; end_line=973; end_column=36; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=4892; start_column=14; end_line=4892; end_column=75; + law_headings=["Article D842-15"; + "Section 3 : Logements-foyers"; + "Chapitre 2 : Modalités de liquidation et de versement des allocations de logement"; + "Titre IV : Allocations de Logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) (fun (_: _) -> ressources_menage_arrondies_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=613; start_column=10; end_line=613; end_column=37; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let calcul_equivalence_loyer_minimale_dot_condition_2_du_832_25_: bool = + try ((log_variable_definition + ["CalculAllocationLogementFoyer"; + "calcul_équivalence_loyer_minimale.condition_2_du_832_25"] + (embed_bool) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=973; start_column=3; end_line=973; end_column=36; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=4891; start_column=14; end_line=4891; end_column=69; + law_headings=["Article D842-15"; + "Section 3 : Logements-foyers"; + "Chapitre 2 : Modalités de liquidation et de versement des allocations de logement"; + "Titre IV : Allocations de Logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) (fun (_: _) -> true)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=614; start_column=10; end_line=614; end_column=31; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let calcul_equivalence_loyer_minimale_dot_n_nombre_parts_d832_25_: decimal = + try ((log_variable_definition + ["CalculAllocationLogementFoyer"; + "calcul_équivalence_loyer_minimale.n_nombre_parts_d832_25"] + (embed_decimal) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=973; start_column=3; end_line=973; end_column=36; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=4901; start_column=14; end_line=4901; end_column=70; + law_headings=["Article D842-15"; + "Section 3 : Logements-foyers"; + "Chapitre 2 : Modalités de liquidation et de versement des allocations de logement"; + "Titre IV : Allocations de Logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> calcul_nombre_parts_dot_n_nombre_parts_d832_25_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=615; start_column=10; end_line=615; end_column=32; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let result_: CalculEquivalenceLoyerMinimaleOut.t = (log_end_call + ["CalculAllocationLogementFoyer"; "calcul_équivalence_loyer_minimale"; + "CalculÉquivalenceLoyerMinimale"] ((log_begin_call + ["CalculAllocationLogementFoyer"; "calcul_équivalence_loyer_minimale"; + "CalculÉquivalenceLoyerMinimale"] calcul_equivalence_loyer_minimale) + {CalculEquivalenceLoyerMinimaleIn.ressources_menage_arrondies_in = + calcul_equivalence_loyer_minimale_dot_ressources_menage_arrondies_; + CalculEquivalenceLoyerMinimaleIn.condition_2_du_832_25_in = + calcul_equivalence_loyer_minimale_dot_condition_2_du_832_25_; + CalculEquivalenceLoyerMinimaleIn.n_nombre_parts_d832_25_in = + calcul_equivalence_loyer_minimale_dot_n_nombre_parts_d832_25_})) in + let calcul_equivalence_loyer_minimale_dot_montant_: money = result_.CalculEquivalenceLoyerMinimaleOut.montant_out in + let coefficient_prise_en_charge_: decimal = (log_variable_definition + ["CalculAllocationLogementFoyer"; "coefficient_prise_en_charge"] + (embed_decimal) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=963; start_column=10; end_line=963; end_column=37; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=4865; start_column=14; end_line=4865; end_column=41; + law_headings=["Article D842-15"; + "Section 3 : Logements-foyers"; + "Chapitre 2 : Modalités de liquidation et de versement des allocations de logement"; + "Titre IV : Allocations de Logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + calcul_apl_logement_foyer_dot_coefficient_prise_en_charge_d832_25_seuil_)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=963; start_column=10; end_line=963; end_column=37; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})))) in + let depense_nette_minimale_: money -> money = (log_variable_definition + ["CalculAllocationLogementFoyer"; "dépense_nette_minimale"] + (unembeddable) ( + try + (fun (param_: money) -> + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=958; start_column=11; end_line=958; end_column=33; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=5025; start_column=14; + end_line=5025; end_column=36; + law_headings=["Article D842-17"; + "Section 3 : Logements-foyers"; + "Chapitre 2 : Modalités de liquidation et de versement des allocations de logement"; + "Titre IV : Allocations de Logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + (equivalence_loyer_ +$ montant_forfaitaire_charges_) -$ + param_)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=958; start_column=11; end_line=958; end_column=33; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]}))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=958; start_column=11; end_line=958; end_column=33; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})))) in + let loyer_minimal_: money = (log_variable_definition + ["CalculAllocationLogementFoyer"; "loyer_minimal"] (embed_money) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=966; start_column=10; end_line=966; end_column=23; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=4903; start_column=14; end_line=4903; end_column=27; + law_headings=["Article D842-15"; + "Section 3 : Logements-foyers"; + "Chapitre 2 : Modalités de liquidation et de versement des allocations de logement"; + "Titre IV : Allocations de Logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> calcul_equivalence_loyer_minimale_dot_montant_)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=966; start_column=10; end_line=966; end_column=23; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})))) in + let abattement_depense_nette_minimale_: money -> money = (log_variable_definition + ["CalculAllocationLogementFoyer"; "abattement_dépense_nette_minimale"] + (unembeddable) ( + try + (fun (param_: money) -> + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=959; start_column=11; end_line=959; end_column=44; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=5034; start_column=14; + end_line=5034; end_column=47; + law_headings=["Article D842-17"; + "Section 3 : Logements-foyers"; + "Chapitre 2 : Modalités de liquidation et de versement des allocations de logement"; + "Titre IV : Allocations de Logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + if + (((log_end_call + ["CalculAllocationLogementFoyer"; + "dépense_nette_minimale"] ((log_variable_definition + ["CalculAllocationLogementFoyer"; + "dépense_nette_minimale"; "output"] (embed_money) + ((log_begin_call + ["CalculAllocationLogementFoyer"; + "dépense_nette_minimale"] depense_nette_minimale_) + ((log_variable_definition + ["CalculAllocationLogementFoyer"; + "dépense_nette_minimale"; "input"] (embed_money) + param_))))))) <$ montant_minimal_depense_nette_d842_17_) + then + (montant_minimal_depense_nette_d842_17_ -$ ((log_end_call + ["CalculAllocationLogementFoyer"; + "dépense_nette_minimale"] ((log_variable_definition + ["CalculAllocationLogementFoyer"; + "dépense_nette_minimale"; "output"] (embed_money) + ((log_begin_call + ["CalculAllocationLogementFoyer"; + "dépense_nette_minimale"] depense_nette_minimale_) + ((log_variable_definition + ["CalculAllocationLogementFoyer"; + "dépense_nette_minimale"; "input"] (embed_money) + param_)))))))) else (money_of_cents_string "0"))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=959; start_column=11; end_line=959; end_column=44; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]}))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=959; start_column=11; end_line=959; end_column=44; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})))) in + let aide_finale_formule_: money = (log_variable_definition + ["CalculAllocationLogementFoyer"; "aide_finale_formule"] (embed_money) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=976; start_column=10; end_line=976; end_column=29; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=4844; start_column=14; end_line=4844; end_column=33; + law_headings=["Article D842-15"; + "Section 3 : Logements-foyers"; + "Chapitre 2 : Modalités de liquidation et de versement des allocations de logement"; + "Titre IV : Allocations de Logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + ((equivalence_loyer_ +$ montant_forfaitaire_charges_) -$ + loyer_minimal_) *$ coefficient_prise_en_charge_)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=976; start_column=10; end_line=976; end_column=29; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})))) in + let traitement_aide_finale_depense_nette_minimale_: money -> money = (log_variable_definition + ["CalculAllocationLogementFoyer"; + "traitement_aide_finale_dépense_nette_minimale"] (unembeddable) ( + try + (fun (param_: money) -> + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=979; start_column=10; end_line=979; end_column=32; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=4924; start_column=14; + end_line=4924; end_column=36; + law_headings=["Article D842-15"; + "Section 3 : Logements-foyers"; + "Chapitre 2 : Modalités de liquidation et de versement des allocations de logement"; + "Titre IV : Allocations de Logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + if + ((((log_end_call + ["CalculAllocationLogementFoyer"; + "traitement_aide_finale_minoration_forfaitaire"] + ((log_variable_definition + ["CalculAllocationLogementFoyer"; + "traitement_aide_finale_minoration_forfaitaire"; + "output"] (embed_money) ((log_begin_call + ["CalculAllocationLogementFoyer"; + "traitement_aide_finale_minoration_forfaitaire"] + traitement_aide_finale_minoration_forfaitaire_) + ((log_variable_definition + ["CalculAllocationLogementFoyer"; + "traitement_aide_finale_minoration_forfaitaire"; + "input"] (embed_money) param_))))))) -$ + ((log_end_call + ["CalculAllocationLogementFoyer"; + "abattement_dépense_nette_minimale"] + ((log_variable_definition + ["CalculAllocationLogementFoyer"; + "abattement_dépense_nette_minimale"; "output"] + (embed_money) ((log_begin_call + ["CalculAllocationLogementFoyer"; + "abattement_dépense_nette_minimale"] + abattement_depense_nette_minimale_) + ((log_variable_definition + ["CalculAllocationLogementFoyer"; + "abattement_dépense_nette_minimale"; "input"] + (embed_money) ((log_end_call + ["CalculAllocationLogementFoyer"; + "traitement_aide_finale_minoration_forfaitaire"] + ((log_variable_definition + ["CalculAllocationLogementFoyer"; + "traitement_aide_finale_minoration_forfaitaire"; + "output"] (embed_money) ((log_begin_call + ["CalculAllocationLogementFoyer"; + "traitement_aide_finale_minoration_forfaitaire"] + traitement_aide_finale_minoration_forfaitaire_) + ((log_variable_definition + ["CalculAllocationLogementFoyer"; + "traitement_aide_finale_minoration_forfaitaire"; + "input"] (embed_money) param_))))))))))))))) <$ + (money_of_cents_string "0")) then + (money_of_cents_string "0") else + (((log_end_call + ["CalculAllocationLogementFoyer"; + "traitement_aide_finale_minoration_forfaitaire"] + ((log_variable_definition + ["CalculAllocationLogementFoyer"; + "traitement_aide_finale_minoration_forfaitaire"; + "output"] (embed_money) ((log_begin_call + ["CalculAllocationLogementFoyer"; + "traitement_aide_finale_minoration_forfaitaire"] + traitement_aide_finale_minoration_forfaitaire_) + ((log_variable_definition + ["CalculAllocationLogementFoyer"; + "traitement_aide_finale_minoration_forfaitaire"; + "input"] (embed_money) param_))))))) -$ + ((log_end_call + ["CalculAllocationLogementFoyer"; + "abattement_dépense_nette_minimale"] + ((log_variable_definition + ["CalculAllocationLogementFoyer"; + "abattement_dépense_nette_minimale"; "output"] + (embed_money) ((log_begin_call + ["CalculAllocationLogementFoyer"; + "abattement_dépense_nette_minimale"] + abattement_depense_nette_minimale_) + ((log_variable_definition + ["CalculAllocationLogementFoyer"; + "abattement_dépense_nette_minimale"; "input"] + (embed_money) ((log_end_call + ["CalculAllocationLogementFoyer"; + "traitement_aide_finale_minoration_forfaitaire"] + ((log_variable_definition + ["CalculAllocationLogementFoyer"; + "traitement_aide_finale_minoration_forfaitaire"; + "output"] (embed_money) ((log_begin_call + ["CalculAllocationLogementFoyer"; + "traitement_aide_finale_minoration_forfaitaire"] + traitement_aide_finale_minoration_forfaitaire_) + ((log_variable_definition + ["CalculAllocationLogementFoyer"; + "traitement_aide_finale_minoration_forfaitaire"; + "input"] (embed_money) param_))))))))))))))))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=979; start_column=10; end_line=979; end_column=32; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]}))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=979; start_column=10; end_line=979; end_column=32; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})))) in + let traitement_aide_finale_redevance_: money -> money = (log_variable_definition + ["CalculAllocationLogementFoyer"; "traitement_aide_finale_redevance"] + (unembeddable) ( + try + (fun (param_: money) -> + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=980; start_column=10; end_line=980; end_column=19; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=4947; start_column=14; + end_line=4947; end_column=36; + law_headings=["Article D842-15"; + "Section 3 : Logements-foyers"; + "Chapitre 2 : Modalités de liquidation et de versement des allocations de logement"; + "Titre IV : Allocations de Logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + if + (((log_end_call + ["CalculAllocationLogementFoyer"; + "traitement_aide_finale_dépense_nette_minimale"] + ((log_variable_definition + ["CalculAllocationLogementFoyer"; + "traitement_aide_finale_dépense_nette_minimale"; + "output"] (embed_money) ((log_begin_call + ["CalculAllocationLogementFoyer"; + "traitement_aide_finale_dépense_nette_minimale"] + traitement_aide_finale_depense_nette_minimale_) + ((log_variable_definition + ["CalculAllocationLogementFoyer"; + "traitement_aide_finale_dépense_nette_minimale"; + "input"] (embed_money) param_))))))) >$ redevance_) + then redevance_ else + ((log_end_call + ["CalculAllocationLogementFoyer"; + "traitement_aide_finale_dépense_nette_minimale"] + ((log_variable_definition + ["CalculAllocationLogementFoyer"; + "traitement_aide_finale_dépense_nette_minimale"; + "output"] (embed_money) ((log_begin_call + ["CalculAllocationLogementFoyer"; + "traitement_aide_finale_dépense_nette_minimale"] + traitement_aide_finale_depense_nette_minimale_) + ((log_variable_definition + ["CalculAllocationLogementFoyer"; + "traitement_aide_finale_dépense_nette_minimale"; + "input"] (embed_money) param_))))))))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=980; start_column=10; end_line=980; end_column=19; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]}))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=980; start_column=10; end_line=980; end_column=19; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})))) in + let traitement_aide_finale_contributions_sociales_arrondi_: money -> money = (log_variable_definition + ["CalculAllocationLogementFoyer"; + "traitement_aide_finale_contributions_sociales_arrondi"] (unembeddable) + ( + try + (fun (param_: money) -> + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=981; start_column=10; end_line=981; end_column=40; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=4959; start_column=14; + end_line=4959; end_column=36; + law_headings=["Article D842-15"; + "Section 3 : Logements-foyers"; + "Chapitre 2 : Modalités de liquidation et de versement des allocations de logement"; + "Titre IV : Allocations de Logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + if + (((money_round + ((((log_end_call + ["CalculAllocationLogementFoyer"; + "traitement_aide_finale_redevance"] + ((log_variable_definition + ["CalculAllocationLogementFoyer"; + "traitement_aide_finale_redevance"; "output"] + (embed_money) ((log_begin_call + ["CalculAllocationLogementFoyer"; + "traitement_aide_finale_redevance"] + traitement_aide_finale_redevance_) + ((log_variable_definition + ["CalculAllocationLogementFoyer"; + "traitement_aide_finale_redevance"; "input"] + (embed_money) param_))))))) -$ ((log_end_call + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"] ((log_variable_definition + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"; "output"] (embed_money) + ((log_begin_call + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"] contributions_sociales_dot_montant_) + ((log_variable_definition + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"; "input"] (embed_money) + ((log_end_call + ["CalculAllocationLogementFoyer"; + "traitement_aide_finale_redevance"] + ((log_variable_definition + ["CalculAllocationLogementFoyer"; + "traitement_aide_finale_redevance"; "output"] + (embed_money) ((log_begin_call + ["CalculAllocationLogementFoyer"; + "traitement_aide_finale_redevance"] + traitement_aide_finale_redevance_) + ((log_variable_definition + ["CalculAllocationLogementFoyer"; + "traitement_aide_finale_redevance"; "input"] + (embed_money) param_))))))))))))))) -$ + (money_of_cents_string "50"))) +$ ((log_end_call + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"] ((log_variable_definition + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"; "output"] (embed_money) ((log_begin_call + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"] contributions_sociales_dot_montant_) + ((log_variable_definition + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"; "input"] (embed_money) ((log_end_call + ["CalculAllocationLogementFoyer"; + "traitement_aide_finale_redevance"] + ((log_variable_definition + ["CalculAllocationLogementFoyer"; + "traitement_aide_finale_redevance"; "output"] + (embed_money) ((log_begin_call + ["CalculAllocationLogementFoyer"; + "traitement_aide_finale_redevance"] + traitement_aide_finale_redevance_) + ((log_variable_definition + ["CalculAllocationLogementFoyer"; + "traitement_aide_finale_redevance"; "input"] + (embed_money) param_))))))))))))))) >=$ + (money_of_cents_string "0")) then + ((money_round + ((((log_end_call + ["CalculAllocationLogementFoyer"; + "traitement_aide_finale_redevance"] + ((log_variable_definition + ["CalculAllocationLogementFoyer"; + "traitement_aide_finale_redevance"; "output"] + (embed_money) ((log_begin_call + ["CalculAllocationLogementFoyer"; + "traitement_aide_finale_redevance"] + traitement_aide_finale_redevance_) + ((log_variable_definition + ["CalculAllocationLogementFoyer"; + "traitement_aide_finale_redevance"; "input"] + (embed_money) param_))))))) -$ ((log_end_call + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"] ((log_variable_definition + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"; "output"] (embed_money) + ((log_begin_call + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"] contributions_sociales_dot_montant_) + ((log_variable_definition + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"; "input"] (embed_money) ((log_end_call + ["CalculAllocationLogementFoyer"; + "traitement_aide_finale_redevance"] + ((log_variable_definition + ["CalculAllocationLogementFoyer"; + "traitement_aide_finale_redevance"; "output"] + (embed_money) ((log_begin_call + ["CalculAllocationLogementFoyer"; + "traitement_aide_finale_redevance"] + traitement_aide_finale_redevance_) + ((log_variable_definition + ["CalculAllocationLogementFoyer"; + "traitement_aide_finale_redevance"; "input"] + (embed_money) param_))))))))))))))) -$ + (money_of_cents_string "50"))) +$ ((log_end_call + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"] ((log_variable_definition + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"; "output"] (embed_money) ((log_begin_call + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"] contributions_sociales_dot_montant_) + ((log_variable_definition + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"; "input"] (embed_money) ((log_end_call + ["CalculAllocationLogementFoyer"; + "traitement_aide_finale_redevance"] + ((log_variable_definition + ["CalculAllocationLogementFoyer"; + "traitement_aide_finale_redevance"; "output"] + (embed_money) ((log_begin_call + ["CalculAllocationLogementFoyer"; + "traitement_aide_finale_redevance"] + traitement_aide_finale_redevance_) + ((log_variable_definition + ["CalculAllocationLogementFoyer"; + "traitement_aide_finale_redevance"; "input"] + (embed_money) param_))))))))))))))) else + (money_of_cents_string "0"))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=981; start_column=10; end_line=981; end_column=40; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]}))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=981; start_column=10; end_line=981; end_column=40; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})))) in + let traitement_aide_finale_montant_minimal_: money -> money = (log_variable_definition + ["CalculAllocationLogementFoyer"; + "traitement_aide_finale_montant_minimal"] (unembeddable) ( + try + (fun (param_: money) -> + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=982; start_column=10; end_line=982; end_column=25; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=4983; start_column=14; + end_line=4983; end_column=36; + law_headings=["Article D842-15"; + "Section 3 : Logements-foyers"; + "Chapitre 2 : Modalités de liquidation et de versement des allocations de logement"; + "Titre IV : Allocations de Logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + if + (((log_end_call + ["CalculAllocationLogementFoyer"; + "traitement_aide_finale_contributions_sociales_arrondi"] + ((log_variable_definition + ["CalculAllocationLogementFoyer"; + "traitement_aide_finale_contributions_sociales_arrondi"; + "output"] (embed_money) ((log_begin_call + ["CalculAllocationLogementFoyer"; + "traitement_aide_finale_contributions_sociales_arrondi"] + traitement_aide_finale_contributions_sociales_arrondi_) + ((log_variable_definition + ["CalculAllocationLogementFoyer"; + "traitement_aide_finale_contributions_sociales_arrondi"; + "input"] (embed_money) param_))))))) <$ + montant_minimal_aide_d842_15_) then + (money_of_cents_string "0") else + ((log_end_call + ["CalculAllocationLogementFoyer"; + "traitement_aide_finale_contributions_sociales_arrondi"] + ((log_variable_definition + ["CalculAllocationLogementFoyer"; + "traitement_aide_finale_contributions_sociales_arrondi"; + "output"] (embed_money) ((log_begin_call + ["CalculAllocationLogementFoyer"; + "traitement_aide_finale_contributions_sociales_arrondi"] + traitement_aide_finale_contributions_sociales_arrondi_) + ((log_variable_definition + ["CalculAllocationLogementFoyer"; + "traitement_aide_finale_contributions_sociales_arrondi"; + "input"] (embed_money) param_))))))))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=982; start_column=10; end_line=982; end_column=25; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]}))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=982; start_column=10; end_line=982; end_column=25; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})))) in + {CalculAllocationLogementFoyerOut.coefficient_prise_en_charge_out = + coefficient_prise_en_charge_; + CalculAllocationLogementFoyerOut.equivalence_loyer_out = + equivalence_loyer_; + CalculAllocationLogementFoyerOut.montant_forfaitaire_charges_out = + montant_forfaitaire_charges_; + CalculAllocationLogementFoyerOut.loyer_minimal_out = loyer_minimal_; + CalculAllocationLogementFoyerOut.aide_finale_formule_out = + aide_finale_formule_; + CalculAllocationLogementFoyerOut.traitement_aide_finale_montant_minimal_out = + traitement_aide_finale_montant_minimal_} + +let calcul_allocation_logement_accession_propriete (calcul_allocation_logement_accession_propriete_in: CalculAllocationLogementAccessionProprieteIn.t) : CalculAllocationLogementAccessionProprieteOut.t = + let ressources_menage_arrondies_base_: money = calcul_allocation_logement_accession_propriete_in.CalculAllocationLogementAccessionProprieteIn.ressources_menage_arrondies_base_in in + let nombre_personnes_a_charge_: integer = calcul_allocation_logement_accession_propriete_in.CalculAllocationLogementAccessionProprieteIn.nombre_personnes_a_charge_in in + let situation_familiale_calcul_apl_: SituationFamilialeCalculAPL.t = calcul_allocation_logement_accession_propriete_in.CalculAllocationLogementAccessionProprieteIn.situation_familiale_calcul_apl_in in + let zone_: ZoneDHabitation.t = calcul_allocation_logement_accession_propriete_in.CalculAllocationLogementAccessionProprieteIn.zone_in in + let date_courante_: date = calcul_allocation_logement_accession_propriete_in.CalculAllocationLogementAccessionProprieteIn.date_courante_in in + let mensualite_principale_: money = calcul_allocation_logement_accession_propriete_in.CalculAllocationLogementAccessionProprieteIn.mensualite_principale_in in + let situation_r822_11_13_17_: bool = calcul_allocation_logement_accession_propriete_in.CalculAllocationLogementAccessionProprieteIn.situation_r822_11_13_17_in in + let date_signature_pret_: date = calcul_allocation_logement_accession_propriete_in.CalculAllocationLogementAccessionProprieteIn.date_signature_pret_in in + let type_travaux_logement_: TypeTravauxLogementR8425.t = calcul_allocation_logement_accession_propriete_in.CalculAllocationLogementAccessionProprieteIn.type_travaux_logement_in in + let local_habite_premiere_fois_beneficiaire_: bool = calcul_allocation_logement_accession_propriete_in.CalculAllocationLogementAccessionProprieteIn.local_habite_premiere_fois_beneficiaire_in in + let date_entree_logement_: date = calcul_allocation_logement_accession_propriete_in.CalculAllocationLogementAccessionProprieteIn.date_entree_logement_in in + let charges_mensuelles_pret_: money = calcul_allocation_logement_accession_propriete_in.CalculAllocationLogementAccessionProprieteIn.charges_mensuelles_pret_in in + let copropriete_: bool = calcul_allocation_logement_accession_propriete_in.CalculAllocationLogementAccessionProprieteIn.copropriete_in in + let montant_forfaitaire_d842_6_: money = (log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "montant_forfaitaire_d842_6"] (embed_money) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=879; start_column=11; end_line=879; end_column=37; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=4156; start_column=14; end_line=4156; end_column=40; + law_headings=["Article 35"; + "Chapitre IV : Calcul des allocations de logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + true)) (fun (_: _) -> money_of_cents_string "500")) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=879; start_column=11; end_line=879; end_column=37; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})))) in + let taux_francs_vers_euros_: decimal = (log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "taux_francs_vers_euros"] (embed_decimal) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=882; start_column=11; end_line=882; end_column=33; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/autres_sources.catala_fr"; + start_line=278; start_column=14; end_line=278; end_column=36; + law_headings=["Article premier"; + "Règlement (CE) n°2866/98 du conseil du 31 décembre 1998 concernant les taux de conversion entre l'euro et les monnaies des États membres adoptant l'euro"]} + true)) + (fun (_: _) -> + (decimal_of_string "1.") /& (decimal_of_string "6.55957"))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=882; start_column=11; end_line=882; end_column=33; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})))) in + let montant_minimal_aide_d842_6_: money = (log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "montant_minimal_aide_d842_6"] (embed_money) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=885; start_column=11; end_line=885; end_column=38; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=4166; start_column=14; end_line=4166; end_column=41; + law_headings=["Article 36"; + "Chapitre IV : Calcul des allocations de logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + true)) (fun (_: _) -> money_of_cents_string "1000")) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=885; start_column=11; end_line=885; end_column=38; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})))) in + let montant_forfaitaire_d842_11_: money = (log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "montant_forfaitaire_d842_11"] (embed_money) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=886; start_column=11; end_line=886; end_column=38; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=4218; start_column=14; end_line=4218; end_column=41; + law_headings=["Article 38"; + "Chapitre IV : Calcul des allocations de logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + true)) (fun (_: _) -> money_of_cents_string "1500")) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=886; start_column=11; end_line=886; end_column=38; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})))) in + let montant_forfaitaire_d842_12_: money = (log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "montant_forfaitaire_d842_12"] (embed_money) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=887; start_column=11; end_line=887; end_column=38; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=4243; start_column=14; end_line=4243; end_column=41; + law_headings=["Article 39"; + "Chapitre IV : Calcul des allocations de logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + true)) (fun (_: _) -> money_of_cents_string "390000")) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=887; start_column=11; end_line=887; end_column=38; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})))) in + let coefficient_d842_11_: decimal = (log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; "coefficient_d842_11"] + (embed_decimal) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=888; start_column=11; end_line=888; end_column=30; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=4225; start_column=14; end_line=4225; end_column=33; + law_headings=["Article 38"; + "Chapitre IV : Calcul des allocations de logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + true)) (fun (_: _) -> decimal_of_string "0.0234")) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=888; start_column=11; end_line=888; end_column=30; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})))) in + let coefficient_d842_12_: decimal = (log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; "coefficient_d842_12"] + (embed_decimal) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=889; start_column=11; end_line=889; end_column=30; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=4236; start_column=14; end_line=4236; end_column=33; + law_headings=["Article 39"; + "Chapitre IV : Calcul des allocations de logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + true)) (fun (_: _) -> decimal_of_string "16.25")) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=889; start_column=11; end_line=889; end_column=30; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})))) in + let calcul_nombre_parts_dot_nombre_personnes_a_charge_: integer = + try ((log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "calcul_nombre_parts.nombre_personnes_à_charge"] (embed_integer) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=891; start_column=3; end_line=891; end_column=22; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=4503; start_column=14; end_line=4503; end_column=59; + law_headings=["Article D842-6"; + "Section 2 : Accession à la propriété"; + "Chapitre 2 : Modalités de liquidation et de versement des allocations de logement"; + "Titre IV : Allocations de Logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) (fun (_: _) -> nombre_personnes_a_charge_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=681; start_column=10; end_line=681; end_column=35; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let calcul_nombre_parts_dot_situation_familiale_calcul_apl_: SituationFamilialeCalculAPL.t = + try ((log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "calcul_nombre_parts.situation_familiale_calcul_apl"] + (embed_situation_familiale_calcul_a_p_l) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=891; start_column=3; end_line=891; end_column=22; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=4505; start_column=14; end_line=4505; end_column=64; + law_headings=["Article D842-6"; + "Section 2 : Accession à la propriété"; + "Chapitre 2 : Modalités de liquidation et de versement des allocations de logement"; + "Titre IV : Allocations de Logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) (fun (_: _) -> situation_familiale_calcul_apl_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=682; start_column=10; end_line=682; end_column=40; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let result_: CalculNombrePartsAccessionProprieteOut.t = (log_end_call + ["CalculAllocationLogementAccessionPropriété"; "calcul_nombre_parts"; + "CalculNombrePartsAccessionPropriété"] ((log_begin_call + ["CalculAllocationLogementAccessionPropriété"; "calcul_nombre_parts"; + "CalculNombrePartsAccessionPropriété"] + calcul_nombre_parts_accession_propriete) + {CalculNombrePartsAccessionProprieteIn.nombre_personnes_a_charge_in = + calcul_nombre_parts_dot_nombre_personnes_a_charge_; + CalculNombrePartsAccessionProprieteIn.situation_familiale_calcul_apl_in = + calcul_nombre_parts_dot_situation_familiale_calcul_apl_})) in + let calcul_nombre_parts_dot_n_nombre_parts_d832_11_: decimal = result_.CalculNombrePartsAccessionProprieteOut.n_nombre_parts_d832_11_out in + let contributions_sociales_dot_date_courante_: date = + try ((log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "contributions_sociales.date_courante"] (embed_date) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=894; start_column=3; end_line=894; end_column=25; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=941; start_column=14; end_line=941; end_column=50; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> date_courante_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=544; start_column=10; end_line=544; end_column=23; + law_headings=["Calcul des contributions sociales s'appliquant aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let result_: ContributionsSocialesAidesPersonnelleLogementOut.t = (log_end_call + ["CalculAllocationLogementAccessionPropriété"; + "contributions_sociales"; + "ContributionsSocialesAidesPersonnelleLogement"] ((log_begin_call + ["CalculAllocationLogementAccessionPropriété"; + "contributions_sociales"; + "ContributionsSocialesAidesPersonnelleLogement"] + contributions_sociales_aides_personnelle_logement) + {ContributionsSocialesAidesPersonnelleLogementIn.date_courante_in = + contributions_sociales_dot_date_courante_})) in + let contributions_sociales_dot_montant_: money -> money = result_.ContributionsSocialesAidesPersonnelleLogementOut.montant_out in + let montant_forfaitaire_charges_: money = (log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "montant_forfaitaire_charges"] (embed_money) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=872; start_column=11; end_line=872; end_column=38; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=872; start_column=11; + end_line=872; end_column=38; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=4198; start_column=5; + end_line=4198; end_column=16; + law_headings=["Article 37"; + "Chapitre IV : Calcul des allocations de logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + ((date_courante_ >=@ (date_of_numbers (2021) (10) (1))) + && copropriete_))) + (fun (_: _) -> + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "2710") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "5422")) +$ + ((money_of_cents_string "1229") *$ + (decimal_of_integer nombre_personnes_a_charge_))))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=4144; start_column=14; end_line=4144; end_column=41; + law_headings=["Article 34"; + "Chapitre IV : Calcul des allocations de logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + (date_courante_ >=@ (date_of_numbers (2021) (10) (1))))) + (fun (_: _) -> + if (nombre_personnes_a_charge_ = (integer_of_string "0")) then + (money_of_cents_string "5422") else + ((money_of_cents_string "5422") +$ + ((money_of_cents_string "1229") *$ + (decimal_of_integer nombre_personnes_a_charge_))))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=872; start_column=11; end_line=872; end_column=38; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})))) in + let traitement_aide_finale_minoration_forfaitaire_: money -> money = (log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "traitement_aide_finale_minoration_forfaitaire"] (unembeddable) ( + try + (fun (param_: money) -> + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=902; start_column=10; end_line=902; end_column=32; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=4513; start_column=14; + end_line=4513; end_column=36; + law_headings=["Article D842-6"; + "Section 2 : Accession à la propriété"; + "Chapitre 2 : Modalités de liquidation et de versement des allocations de logement"; + "Titre IV : Allocations de Logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + if + ((param_ -$ montant_forfaitaire_d842_6_) <$ + (money_of_cents_string "0")) then + (money_of_cents_string "0") else + (param_ -$ montant_forfaitaire_d842_6_))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=902; start_column=10; end_line=902; end_column=32; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]}))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=902; start_column=10; end_line=902; end_column=32; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})))) in + let calcul_plafond_mensualite_d842_6_base_: date -> money = (log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "calcul_plafond_mensualité_d842_6_base"] (unembeddable) ( + try + (fun (param_: date) -> + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=877; start_column=10; end_line=877; end_column=14; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=877; start_column=10; + end_line=877; end_column=14; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=3124; start_column=5; + end_line=3124; end_column=64; + law_headings=["Article 33"; + "Chapitre IV : Calcul des allocations de logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + ((date_courante_ >=@ + (date_of_numbers (2020) (1) (1))) && + ((param_ >=@ (date_of_numbers (1992) (7) (1))) && + (param_ <@ (date_of_numbers (1994) (7) (1))))))) + (fun (_: _) -> + (match zone_ + with + | ZoneDHabitation.Zone1 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "158700") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "191300")) else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "1")) then + (money_of_cents_string "205500") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "2")) then + (money_of_cents_string "211300") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "3")) then + (money_of_cents_string "217100") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "4")) then + (money_of_cents_string "222900") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "5")) + then + (money_of_cents_string + "228000") else + ((money_of_cents_string + "228000") +$ + ((money_of_cents_string + "19800") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ + -! + (integer_of_string + "5"))))))))))) + | ZoneDHabitation.Zone2 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "139300") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "170600")) else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "1")) then + (money_of_cents_string "184700") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "2")) then + (money_of_cents_string "191200") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "3")) then + (money_of_cents_string "197700") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "4")) then + (money_of_cents_string "204200") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "5")) + then + (money_of_cents_string + "218700") else + ((money_of_cents_string + "218700") +$ + ((money_of_cents_string + "19100") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ + -! + (integer_of_string + "5"))))))))))) + | ZoneDHabitation.Zone3 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "130600") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "158400")) else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "1")) then + (money_of_cents_string "172600") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "2")) then + (money_of_cents_string "179800") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "3")) then + (money_of_cents_string "187000") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "4")) then + (money_of_cents_string "194200") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "5")) + then + (money_of_cents_string + "208600") else + ((money_of_cents_string + "208600") +$ + ((money_of_cents_string + "18200") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ + -! + (integer_of_string + "5")))))))))))) + *$ taux_francs_vers_euros_)); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=877; start_column=10; + end_line=877; end_column=14; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=3170; start_column=5; + end_line=3170; end_column=64; + law_headings=["Article 33"; + "Chapitre IV : Calcul des allocations de logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + ((date_courante_ >=@ + (date_of_numbers (2020) (1) (1))) && + ((param_ >=@ (date_of_numbers (1994) (7) (1))) && + (param_ <@ (date_of_numbers (1997) (7) (1))))))) + (fun (_: _) -> + (match zone_ + with + | ZoneDHabitation.Zone1 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "160400") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "193400")) else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "1")) then + (money_of_cents_string "207800") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "2")) then + (money_of_cents_string "213700") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "3")) then + (money_of_cents_string "219600") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "4")) then + (money_of_cents_string "225500") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "5")) + then + (money_of_cents_string + "230500") else + ((money_of_cents_string + "230500") +$ + ((money_of_cents_string + "20000") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ + -! + (integer_of_string + "5"))))))))))) + | ZoneDHabitation.Zone2 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "140800") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "172500")) else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "1")) then + (money_of_cents_string "186700") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "2")) then + (money_of_cents_string "193300") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "3")) then + (money_of_cents_string "199900") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "4")) then + (money_of_cents_string "206500") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "5")) + then + (money_of_cents_string + "221100") else + ((money_of_cents_string + "221100") +$ + ((money_of_cents_string + "19300") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ + -! + (integer_of_string + "5"))))))))))) + | ZoneDHabitation.Zone3 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "132000") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "180100")) else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "1")) then + (money_of_cents_string "174500") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "2")) then + (money_of_cents_string "181800") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "3")) then + (money_of_cents_string "189100") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "4")) then + (money_of_cents_string "194200") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "5")) + then + (money_of_cents_string + "210900") else + ((money_of_cents_string + "210900") +$ + ((money_of_cents_string + "18400") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ + -! + (integer_of_string + "5")))))))))))) + *$ taux_francs_vers_euros_)); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=877; start_column=10; + end_line=877; end_column=14; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=3216; start_column=5; + end_line=3216; end_column=64; + law_headings=["Article 33"; + "Chapitre IV : Calcul des allocations de logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + ((date_courante_ >=@ + (date_of_numbers (2020) (1) (1))) && + ((param_ >=@ (date_of_numbers (1997) (7) (1))) && + (param_ <@ (date_of_numbers (1998) (7) (1))))))) + (fun (_: _) -> + (match zone_ + with + | ZoneDHabitation.Zone1 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "163300") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "196900")) else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "1")) then + (money_of_cents_string "211600") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "2")) then + (money_of_cents_string "217600") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "3")) then + (money_of_cents_string "223600") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "4")) then + (money_of_cents_string "229600") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "5")) + then + (money_of_cents_string + "234600") else + ((money_of_cents_string + "234600") +$ + ((money_of_cents_string + "20400") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ + -! + (integer_of_string + "5"))))))))))) + | ZoneDHabitation.Zone2 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "143300") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "175600")) else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "1")) then + (money_of_cents_string "190100") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "2")) then + (money_of_cents_string "196600") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "3")) then + (money_of_cents_string "203500") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "4")) then + (money_of_cents_string "210200") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "5")) + then + (money_of_cents_string + "225100") else + ((money_of_cents_string + "225100") +$ + ((money_of_cents_string + "19600") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ + -! + (integer_of_string + "5"))))))))))) + | ZoneDHabitation.Zone3 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "134400") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "163000")) else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "1")) then + (money_of_cents_string "177700") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "2")) then + (money_of_cents_string "185100") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "3")) then + (money_of_cents_string "192500") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "4")) then + (money_of_cents_string "199900") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "5")) + then + (money_of_cents_string + "214700") else + ((money_of_cents_string + "214700") +$ + ((money_of_cents_string + "18700") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ + -! + (integer_of_string + "5")))))))))))) + *$ taux_francs_vers_euros_)); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=877; start_column=10; + end_line=877; end_column=14; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=3262; start_column=5; + end_line=3262; end_column=64; + law_headings=["Article 33"; + "Chapitre IV : Calcul des allocations de logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + ((date_courante_ >=@ + (date_of_numbers (2020) (1) (1))) && + ((param_ >=@ (date_of_numbers (1998) (7) (1))) && + (param_ <@ (date_of_numbers (1999) (7) (1))))))) + (fun (_: _) -> + (match zone_ + with + | ZoneDHabitation.Zone1 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "167200") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "201600")) else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "1")) then + (money_of_cents_string "216700") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "2")) then + (money_of_cents_string "222800") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "3")) then + (money_of_cents_string "229000") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "4")) then + (money_of_cents_string "235100") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "5")) + then + (money_of_cents_string + "240200") else + ((money_of_cents_string + "240200") +$ + ((money_of_cents_string + "20900") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ + -! + (integer_of_string + "5"))))))))))) + | ZoneDHabitation.Zone2 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "146700") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "179800")) else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "1")) then + (money_of_cents_string "194700") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "2")) then + (money_of_cents_string "201500") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "3")) then + (money_of_cents_string "208400") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "4")) then + (money_of_cents_string "215200") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "5")) + then + (money_of_cents_string + "230500") else + ((money_of_cents_string + "230500") +$ + ((money_of_cents_string + "20100") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ + -! + (integer_of_string + "5"))))))))))) + | ZoneDHabitation.Zone3 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "137600") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "166900")) else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "1")) then + (money_of_cents_string "182000") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "2")) then + (money_of_cents_string "189500") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "3")) then + (money_of_cents_string "197100") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "4")) then + (money_of_cents_string "204700") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "5")) + then + (money_of_cents_string + "219900") else + ((money_of_cents_string + "219900") +$ + ((money_of_cents_string + "19100") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ + -! + (integer_of_string + "5")))))))))))) + *$ taux_francs_vers_euros_)); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=877; start_column=10; + end_line=877; end_column=14; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=3308; start_column=5; + end_line=3308; end_column=64; + law_headings=["Article 33"; + "Chapitre IV : Calcul des allocations de logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + ((date_courante_ >=@ + (date_of_numbers (2020) (1) (1))) && + ((param_ >=@ (date_of_numbers (1999) (7) (1))) && + (param_ <@ (date_of_numbers (2000) (7) (1))))))) + (fun (_: _) -> + (match zone_ + with + | ZoneDHabitation.Zone1 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "167400") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "201800")) else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "1")) then + (money_of_cents_string "216900") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "2")) then + (money_of_cents_string "223000") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "3")) then + (money_of_cents_string "229200") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "4")) then + (money_of_cents_string "235300") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "5")) + then + (money_of_cents_string + "240400") else + ((money_of_cents_string + "240400") +$ + ((money_of_cents_string + "20900") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ + -! + (integer_of_string + "5"))))))))))) + | ZoneDHabitation.Zone2 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "146800") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "180000")) else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "1")) then + (money_of_cents_string "194900") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "2")) then + (money_of_cents_string "201700") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "3")) then + (money_of_cents_string "208600") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "4")) then + (money_of_cents_string "215400") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "5")) + then + (money_of_cents_string + "230700") else + ((money_of_cents_string + "230700") +$ + ((money_of_cents_string + "20100") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ + -! + (integer_of_string + "5"))))))))))) + | ZoneDHabitation.Zone3 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "137700") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "167100")) else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "1")) then + (money_of_cents_string "182200") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "2")) then + (money_of_cents_string "189700") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "3")) then + (money_of_cents_string "197300") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "4")) then + (money_of_cents_string "204900") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "5")) + then + (money_of_cents_string + "220100") else + ((money_of_cents_string + "220100") +$ + ((money_of_cents_string + "19100") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ + -! + (integer_of_string + "5")))))))))))) + *$ taux_francs_vers_euros_)); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=877; start_column=10; + end_line=877; end_column=14; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=3354; start_column=5; + end_line=3354; end_column=64; + law_headings=["Article 33"; + "Chapitre IV : Calcul des allocations de logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + ((date_courante_ >=@ + (date_of_numbers (2020) (1) (1))) && + ((param_ >=@ (date_of_numbers (2000) (7) (1))) && + (param_ <@ (date_of_numbers (2001) (7) (1))))))) + (fun (_: _) -> + (match zone_ + with + | ZoneDHabitation.Zone1 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "169100") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "203800")) else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "1")) then + (money_of_cents_string "219100") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "2")) then + (money_of_cents_string "225200") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "3")) then + (money_of_cents_string "231500") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "4")) then + (money_of_cents_string "237700") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "5")) + then + (money_of_cents_string + "242800") else + ((money_of_cents_string + "242800") +$ + ((money_of_cents_string + "21100") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ + -! + (integer_of_string + "5"))))))))))) + | ZoneDHabitation.Zone2 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "148300") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "181800")) else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "1")) then + (money_of_cents_string "196800") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "2")) then + (money_of_cents_string "203700") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "3")) then + (money_of_cents_string "210700") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "4")) then + (money_of_cents_string "217600") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "5")) + then + (money_of_cents_string + "233000") else + ((money_of_cents_string + "233000") +$ + ((money_of_cents_string + "20300") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ + -! + (integer_of_string + "5"))))))))))) + | ZoneDHabitation.Zone3 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "139100") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "168800")) else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "1")) then + (money_of_cents_string "184000") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "2")) then + (money_of_cents_string "191600") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "3")) then + (money_of_cents_string "199300") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "4")) then + (money_of_cents_string "206900") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "5")) + then + (money_of_cents_string + "222300") else + ((money_of_cents_string + "222300") +$ + ((money_of_cents_string + "19300") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ + -! + (integer_of_string + "5")))))))))))) + *$ taux_francs_vers_euros_)); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=877; start_column=10; + end_line=877; end_column=14; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=3400; start_column=5; + end_line=3400; end_column=64; + law_headings=["Article 33"; + "Chapitre IV : Calcul des allocations de logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + ((date_courante_ >=@ + (date_of_numbers (2020) (1) (1))) && + ((param_ >=@ (date_of_numbers (2001) (7) (1))) && + (param_ <@ (date_of_numbers (2002) (1) (1))))))) + (fun (_: _) -> + (match zone_ + with + | ZoneDHabitation.Zone1 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "171100") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "206200")) else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "1")) then + (money_of_cents_string "221700") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "2")) then + (money_of_cents_string "227900") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "3")) then + (money_of_cents_string "234300") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "4")) then + (money_of_cents_string "240600") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "5")) + then + (money_of_cents_string + "245700") else + ((money_of_cents_string + "245700") +$ + ((money_of_cents_string + "21400") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ + -! + (integer_of_string + "5"))))))))))) + | ZoneDHabitation.Zone2 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "150100") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "184000")) else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "1")) then + (money_of_cents_string "199200") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "2")) then + (money_of_cents_string "206100") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "3")) then + (money_of_cents_string "213200") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "4")) then + (money_of_cents_string "220200") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "5")) + then + (money_of_cents_string + "235800") else + ((money_of_cents_string + "235800") +$ + ((money_of_cents_string + "20500") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ + -! + (integer_of_string + "5"))))))))))) + | ZoneDHabitation.Zone3 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "140800") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "170800")) else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "1")) then + (money_of_cents_string "186200") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "2")) then + (money_of_cents_string "193900") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "3")) then + (money_of_cents_string "201700") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "4")) then + (money_of_cents_string "209400") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "5")) + then + (money_of_cents_string + "225000") else + ((money_of_cents_string + "225000") +$ + ((money_of_cents_string + "19500") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ + -! + (integer_of_string + "5")))))))))))) + *$ taux_francs_vers_euros_)); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=877; start_column=10; + end_line=877; end_column=14; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=3446; start_column=5; + end_line=3446; end_column=64; + law_headings=["Article 33"; + "Chapitre IV : Calcul des allocations de logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + ((date_courante_ >=@ + (date_of_numbers (2020) (1) (1))) && + ((param_ >=@ (date_of_numbers (2002) (1) (1))) && + (param_ <@ (date_of_numbers (2002) (7) (1))))))) + (fun (_: _) -> + match zone_ + with + | ZoneDHabitation.Zone1 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "26084") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "31435")) else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "1")) then + (money_of_cents_string "33798") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "2")) then + (money_of_cents_string "34743") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "3")) then + (money_of_cents_string "35719") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "4")) then + (money_of_cents_string "36679") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "5")) + then + (money_of_cents_string + "37457") else + ((money_of_cents_string + "37457") +$ + ((money_of_cents_string + "3262") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ + -! + (integer_of_string + "5"))))))))))) + | ZoneDHabitation.Zone2 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "22883") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "28051")) else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "1")) then + (money_of_cents_string "30368") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "2")) then + (money_of_cents_string "31420") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "3")) then + (money_of_cents_string "32502") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "4")) then + (money_of_cents_string "33569") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "5")) + then + (money_of_cents_string + "35947") else + ((money_of_cents_string + "35947") +$ + ((money_of_cents_string + "3125") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ + -! + (integer_of_string + "5"))))))))))) + | ZoneDHabitation.Zone3 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "21465") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "26038")) else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "1")) then + (money_of_cents_string "28386") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "2")) then + (money_of_cents_string "29560") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "3")) then + (money_of_cents_string "30749") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "4")) then + (money_of_cents_string "31923") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "5")) + then + (money_of_cents_string + "34301") else + ((money_of_cents_string + "34301") +$ + ((money_of_cents_string + "2973") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ + -! + (integer_of_string + "5"))))))))))))); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=877; start_column=10; + end_line=877; end_column=14; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=3491; start_column=5; + end_line=3491; end_column=64; + law_headings=["Article 33"; + "Chapitre IV : Calcul des allocations de logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + ((date_courante_ >=@ + (date_of_numbers (2020) (1) (1))) && + ((param_ >=@ (date_of_numbers (2002) (7) (1))) && + (param_ <@ (date_of_numbers (2003) (7) (1))))))) + (fun (_: _) -> + match zone_ + with + | ZoneDHabitation.Zone1 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "26397") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "31812")) else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "1")) then + (money_of_cents_string "34204") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "2")) then + (money_of_cents_string "35160") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "3")) then + (money_of_cents_string "36148") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "4")) then + (money_of_cents_string "37119") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "5")) + then + (money_of_cents_string + "37906") else + ((money_of_cents_string + "37906") +$ + ((money_of_cents_string + "3301") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ + -! + (integer_of_string + "5"))))))))))) + | ZoneDHabitation.Zone2 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "23158") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "28388")) else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "1")) then + (money_of_cents_string "30732") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "2")) then + (money_of_cents_string "31797") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "3")) then + (money_of_cents_string "32892") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "4")) then + (money_of_cents_string "33972") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "5")) + then + (money_of_cents_string + "36378") else + ((money_of_cents_string + "36378") +$ + ((money_of_cents_string + "3163") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ + -! + (integer_of_string + "5"))))))))))) + | ZoneDHabitation.Zone3 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "21723") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "26350")) else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "1")) then + (money_of_cents_string "28727") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "2")) then + (money_of_cents_string "29915") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "3")) then + (money_of_cents_string "31118") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "4")) then + (money_of_cents_string "32306") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "5")) + then + (money_of_cents_string + "34713") else + ((money_of_cents_string + "34713") +$ + ((money_of_cents_string + "3009") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ + -! + (integer_of_string + "5"))))))))))))); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=877; start_column=10; + end_line=877; end_column=14; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=3538; start_column=5; + end_line=3538; end_column=64; + law_headings=["Article 33"; + "Chapitre IV : Calcul des allocations de logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + ((date_courante_ >=@ + (date_of_numbers (2020) (1) (1))) && + ((param_ >=@ (date_of_numbers (2003) (7) (1))) && + (param_ <@ (date_of_numbers (2005) (9) (1))))))) + (fun (_: _) -> + match zone_ + with + | ZoneDHabitation.Zone1 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "26714") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "32194")) else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "1")) then + (money_of_cents_string "34614") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "2")) then + (money_of_cents_string "35582") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "3")) then + (money_of_cents_string "36582") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "4")) then + (money_of_cents_string "37564") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "5")) + then + (money_of_cents_string + "38361") else + ((money_of_cents_string + "38361") +$ + ((money_of_cents_string + "3341") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ + -! + (integer_of_string + "5"))))))))))) + | ZoneDHabitation.Zone2 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "23436") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "28729")) else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "1")) then + (money_of_cents_string "31101") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "2")) then + (money_of_cents_string "32179") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "3")) then + (money_of_cents_string "33287") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "4")) then + (money_of_cents_string "34380") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "5")) + then + (money_of_cents_string + "36815") else + ((money_of_cents_string + "36815") +$ + ((money_of_cents_string + "3201") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ + -! + (integer_of_string + "5"))))))))))) + | ZoneDHabitation.Zone3 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "21984") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "26666")) else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "1")) then + (money_of_cents_string "29072") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "2")) then + (money_of_cents_string "30274") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "3")) then + (money_of_cents_string "31491") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "4")) then + (money_of_cents_string "32694") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "5")) + then + (money_of_cents_string + "35130") else + ((money_of_cents_string + "35130") +$ + ((money_of_cents_string + "3045") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ + -! + (integer_of_string + "5"))))))))))))); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=877; start_column=10; + end_line=877; end_column=14; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=3583; start_column=5; + end_line=3583; end_column=64; + law_headings=["Article 33"; + "Chapitre IV : Calcul des allocations de logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + ((date_courante_ >=@ + (date_of_numbers (2020) (1) (1))) && + ((param_ >=@ (date_of_numbers (2005) (9) (1))) && + (param_ <@ (date_of_numbers (2007) (1) (1))))))) + (fun (_: _) -> + match zone_ + with + | ZoneDHabitation.Zone1 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "27195") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "32773")) else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "1")) then + (money_of_cents_string "35237") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "2")) then + (money_of_cents_string "36222") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "3")) then + (money_of_cents_string "37240") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "4")) then + (money_of_cents_string "38240") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "5")) + then + (money_of_cents_string + "39051") else + ((money_of_cents_string + "39051") +$ + ((money_of_cents_string + "3401") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ + -! + (integer_of_string + "5"))))))))))) + | ZoneDHabitation.Zone2 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "23858") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "29246")) else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "1")) then + (money_of_cents_string "31661") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "2")) then + (money_of_cents_string "32758") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "3")) then + (money_of_cents_string "33886") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "4")) then + (money_of_cents_string "34999") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "5")) + then + (money_of_cents_string + "37478") else + ((money_of_cents_string + "37478") +$ + ((money_of_cents_string + "3259") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ + -! + (integer_of_string + "5"))))))))))) + | ZoneDHabitation.Zone3 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "22380") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "27146")) else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "1")) then + (money_of_cents_string "29595") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "2")) then + (money_of_cents_string "30819") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "3")) then + (money_of_cents_string "32058") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "4")) then + (money_of_cents_string "33282") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "5")) + then + (money_of_cents_string + "35762") else + ((money_of_cents_string + "35762") +$ + ((money_of_cents_string + "3100") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ + -! + (integer_of_string + "5"))))))))))))); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=877; start_column=10; + end_line=877; end_column=14; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=3628; start_column=5; + end_line=3628; end_column=64; + law_headings=["Article 33"; + "Chapitre IV : Calcul des allocations de logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + ((date_courante_ >=@ + (date_of_numbers (2020) (1) (1))) && + ((param_ >=@ (date_of_numbers (2007) (1) (1))) && + (param_ <@ (date_of_numbers (2008) (1) (1))))))) + (fun (_: _) -> + match zone_ + with + | ZoneDHabitation.Zone1 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "27956") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "33691")) else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "1")) then + (money_of_cents_string "36224") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "2")) then + (money_of_cents_string "37236") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "3")) then + (money_of_cents_string "38283") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "4")) then + (money_of_cents_string "39311") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "5")) + then + (money_of_cents_string + "40144") else + ((money_of_cents_string + "40144") +$ + ((money_of_cents_string + "3496") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ + -! + (integer_of_string + "5"))))))))))) + | ZoneDHabitation.Zone2 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "24526") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "30065")) else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "1")) then + (money_of_cents_string "32548") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "2")) then + (money_of_cents_string "33675") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "3")) then + (money_of_cents_string "34865") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "4")) then + (money_of_cents_string "35979") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "5")) + then + (money_of_cents_string + "38527") else + ((money_of_cents_string + "38527") +$ + ((money_of_cents_string + "3350") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ + -! + (integer_of_string + "5"))))))))))) + | ZoneDHabitation.Zone3 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "23007") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "27906")) else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "1")) then + (money_of_cents_string "30424") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "2")) then + (money_of_cents_string "31682") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "3")) then + (money_of_cents_string "32956") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "4")) then + (money_of_cents_string "34214") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "5")) + then + (money_of_cents_string + "36733") else + ((money_of_cents_string + "36733") +$ + ((money_of_cents_string + "3187") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ + -! + (integer_of_string + "5"))))))))))))); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=877; start_column=10; + end_line=877; end_column=14; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=3673; start_column=5; + end_line=3673; end_column=64; + law_headings=["Article 33"; + "Chapitre IV : Calcul des allocations de logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + ((date_courante_ >=@ + (date_of_numbers (2020) (1) (1))) && + ((param_ >=@ (date_of_numbers (2008) (1) (1))) && + (param_ <@ (date_of_numbers (2009) (1) (1))))))) + (fun (_: _) -> + match zone_ + with + | ZoneDHabitation.Zone1 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "28728") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "34621")) else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "1")) then + (money_of_cents_string "37224") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "2")) then + (money_of_cents_string "38264") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "3")) then + (money_of_cents_string "39340") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "4")) then + (money_of_cents_string "40396") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "5")) + then + (money_of_cents_string + "41252") else + ((money_of_cents_string + "41252") +$ + ((money_of_cents_string + "3592") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ + -! + (integer_of_string + "5"))))))))))) + | ZoneDHabitation.Zone2 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "25203") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "30895")) else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "1")) then + (money_of_cents_string "33446") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "2")) then + (money_of_cents_string "34604") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "3")) then + (money_of_cents_string "35796") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "4")) then + (money_of_cents_string "36972") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "5")) + then + (money_of_cents_string + "39590") else + ((money_of_cents_string + "39590") +$ + ((money_of_cents_string + "3442") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ + -! + (integer_of_string + "5"))))))))))) + | ZoneDHabitation.Zone3 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "23642") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "28676")) else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "1")) then + (money_of_cents_string "31264") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "2")) then + (money_of_cents_string "32556") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "3")) then + (money_of_cents_string "33866") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "4")) then + (money_of_cents_string "35158") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "5")) + then + (money_of_cents_string + "37778") else + ((money_of_cents_string + "37778") +$ + ((money_of_cents_string + "3275") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ + -! + (integer_of_string + "5"))))))))))))); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=877; start_column=10; + end_line=877; end_column=14; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=3718; start_column=5; + end_line=3718; end_column=64; + law_headings=["Article 33"; + "Chapitre IV : Calcul des allocations de logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + ((date_courante_ >=@ + (date_of_numbers (2020) (1) (1))) && + ((param_ >=@ (date_of_numbers (2009) (1) (1))) && + (param_ <@ (date_of_numbers (2010) (1) (1))))))) + (fun (_: _) -> + match zone_ + with + | ZoneDHabitation.Zone1 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "29575") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "35642")) else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "1")) then + (money_of_cents_string "38322") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "2")) then + (money_of_cents_string "39393") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "3")) then + (money_of_cents_string "40501") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "4")) then + (money_of_cents_string "41588") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "5")) + then + (money_of_cents_string + "42469") else + ((money_of_cents_string + "42469") +$ + ((money_of_cents_string + "3698") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ + -! + (integer_of_string + "5"))))))))))) + | ZoneDHabitation.Zone2 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "25946") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "31806")) else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "1")) then + (money_of_cents_string "34433") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "2")) then + (money_of_cents_string "35625") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "3")) then + (money_of_cents_string "36852") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "4")) then + (money_of_cents_string "38063") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "5")) + then + (money_of_cents_string + "40758") else + ((money_of_cents_string + "40758") +$ + ((money_of_cents_string + "3544") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ + -! + (integer_of_string + "5"))))))))))) + | ZoneDHabitation.Zone3 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "24339") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "29522")) else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "1")) then + (money_of_cents_string "32186") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "2")) then + (money_of_cents_string "33516") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "3")) then + (money_of_cents_string "34865") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "4")) then + (money_of_cents_string "36195") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "5")) + then + (money_of_cents_string + "38892") else + ((money_of_cents_string + "38892") +$ + ((money_of_cents_string + "3372") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ + -! + (integer_of_string + "5"))))))))))))); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=877; start_column=10; + end_line=877; end_column=14; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=3763; start_column=5; + end_line=3763; end_column=64; + law_headings=["Article 33"; + "Chapitre IV : Calcul des allocations de logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + ((date_courante_ >=@ + (date_of_numbers (2020) (1) (1))) && + ((param_ >=@ (date_of_numbers (2010) (1) (1))) && + (param_ <@ (date_of_numbers (2011) (1) (1))))))) + (fun (_: _) -> + match zone_ + with + | ZoneDHabitation.Zone1 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "29670") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "35757")) else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "1")) then + (money_of_cents_string "38445") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "2")) then + (money_of_cents_string "39519") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "3")) then + (money_of_cents_string "40601") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "4")) then + (money_of_cents_string "41721") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "5")) + then + (money_of_cents_string + "42605") else + ((money_of_cents_string + "42605") +$ + ((money_of_cents_string + "3710") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ + -! + (integer_of_string + "5"))))))))))) + | ZoneDHabitation.Zone2 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "26029") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "31908")) else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "1")) then + (money_of_cents_string "34643") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "2")) then + (money_of_cents_string "35739") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "3")) then + (money_of_cents_string "36970") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "4")) then + (money_of_cents_string "38185") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "5")) + then + (money_of_cents_string + "40888") else + ((money_of_cents_string + "40888") +$ + ((money_of_cents_string + "3555") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ + -! + (integer_of_string + "5"))))))))))) + | ZoneDHabitation.Zone3 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "24417") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "29616")) else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "1")) then + (money_of_cents_string "32289") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "2")) then + (money_of_cents_string "33623") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "3")) then + (money_of_cents_string "34977") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "4")) then + (money_of_cents_string "36311") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "5")) + then + (money_of_cents_string + "39016") else + ((money_of_cents_string + "39016") +$ + ((money_of_cents_string + "3383") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ + -! + (integer_of_string + "5"))))))))))))); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=877; start_column=10; + end_line=877; end_column=14; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=3808; start_column=5; + end_line=3808; end_column=64; + law_headings=["Article 33"; + "Chapitre IV : Calcul des allocations de logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + ((date_courante_ >=@ + (date_of_numbers (2020) (1) (1))) && + ((param_ >=@ (date_of_numbers (2011) (1) (1))) && + (param_ <@ (date_of_numbers (2012) (1) (1))))))) + (fun (_: _) -> + match zone_ + with + | ZoneDHabitation.Zone1 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "29996") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "36149")) else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "1")) then + (money_of_cents_string "38868") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "2")) then + (money_of_cents_string "39954") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "3")) then + (money_of_cents_string "41078") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "4")) then + (money_of_cents_string "42180") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "5")) + then + (money_of_cents_string + "43074") else + ((money_of_cents_string + "43074") +$ + ((money_of_cents_string + "3751") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ + -! + (integer_of_string + "5"))))))))))) + | ZoneDHabitation.Zone2 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "26315") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "32259")) else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "1")) then + (money_of_cents_string "34923") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "2")) then + (money_of_cents_string "36132") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "3")) then + (money_of_cents_string "37373") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "4")) then + (money_of_cents_string "38605") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "5")) + then + (money_of_cents_string + "41338") else + ((money_of_cents_string + "41338") +$ + ((money_of_cents_string + "3594") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ + -! + (integer_of_string + "5"))))))))))) + | ZoneDHabitation.Zone3 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "24686") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "29942")) else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "1")) then + (money_of_cents_string "32644") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "2")) then + (money_of_cents_string "33993") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "3")) then + (money_of_cents_string "35362") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "4")) then + (money_of_cents_string "36710") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "5")) + then + (money_of_cents_string + "39445") else + ((money_of_cents_string + "39445") +$ + ((money_of_cents_string + "3420") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ + -! + (integer_of_string + "5"))))))))))))); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=877; start_column=10; + end_line=877; end_column=14; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=3853; start_column=5; + end_line=3853; end_column=64; + law_headings=["Article 33"; + "Chapitre IV : Calcul des allocations de logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + ((date_courante_ >=@ + (date_of_numbers (2020) (1) (1))) && + ((param_ >=@ (date_of_numbers (2012) (1) (1))) && + (param_ <@ (date_of_numbers (2013) (1) (1))))))) + (fun (_: _) -> + match zone_ + with + | ZoneDHabitation.Zone1 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "30296") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "36510")) else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "1")) then + (money_of_cents_string "39257") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "2")) then + (money_of_cents_string "40354") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "3")) then + (money_of_cents_string "41489") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "4")) then + (money_of_cents_string "42602") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "5")) + then + (money_of_cents_string + "43505") else + ((money_of_cents_string + "43505") +$ + ((money_of_cents_string + "3789") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ + -! + (integer_of_string + "5"))))))))))) + | ZoneDHabitation.Zone2 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "26578") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "32582")) else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "1")) then + (money_of_cents_string "35272") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "2")) then + (money_of_cents_string "36493") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "3")) then + (money_of_cents_string "37751") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "4")) then + (money_of_cents_string "38991") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "5")) + then + (money_of_cents_string + "41751") else + ((money_of_cents_string + "41751") +$ + ((money_of_cents_string + "3630") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ + -! + (integer_of_string + "5"))))))))))) + | ZoneDHabitation.Zone3 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "24933") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "30241")) else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "1")) then + (money_of_cents_string "32970") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "2")) then + (money_of_cents_string "34333") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "3")) then + (money_of_cents_string "35716") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "4")) then + (money_of_cents_string "37077") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "5")) + then + (money_of_cents_string + "39839") else + ((money_of_cents_string + "39839") +$ + ((money_of_cents_string + "3454") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ + -! + (integer_of_string + "5"))))))))))))); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=877; start_column=10; + end_line=877; end_column=14; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=3898; start_column=5; + end_line=3898; end_column=64; + law_headings=["Article 33"; + "Chapitre IV : Calcul des allocations de logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + ((date_courante_ >=@ + (date_of_numbers (2020) (1) (1))) && + ((param_ >=@ (date_of_numbers (2013) (1) (1))) && + (param_ <@ (date_of_numbers (2014) (10) (1))))))) + (fun (_: _) -> + match zone_ + with + | ZoneDHabitation.Zone1 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "30947") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "37295")) else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "1")) then + (money_of_cents_string "40101") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "2")) then + (money_of_cents_string "41222") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "3")) then + (money_of_cents_string "42381") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "4")) then + (money_of_cents_string "43518") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "5")) + then + (money_of_cents_string + "44440") else + ((money_of_cents_string + "44440") +$ + ((money_of_cents_string + "3870") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ + -! + (integer_of_string + "5"))))))))))) + | ZoneDHabitation.Zone2 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "27149") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "33283")) else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "1")) then + (money_of_cents_string "36030") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "2")) then + (money_of_cents_string "37278") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "3")) then + (money_of_cents_string "38563") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "4")) then + (money_of_cents_string "39829") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "5")) + then + (money_of_cents_string + "42649") else + ((money_of_cents_string + "42659") +$ + ((money_of_cents_string + "3708") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ + -! + (integer_of_string + "5"))))))))))) + | ZoneDHabitation.Zone3 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "25469") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "30891")) else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "1")) then + (money_of_cents_string "33679") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "2")) then + (money_of_cents_string "35071") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "3")) then + (money_of_cents_string "36484") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "4")) then + (money_of_cents_string "37874") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "5")) + then + (money_of_cents_string + "40696") else + ((money_of_cents_string + "40696") +$ + ((money_of_cents_string + "3528") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ + -! + (integer_of_string + "5"))))))))))))); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=877; start_column=10; + end_line=877; end_column=14; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=3943; start_column=5; + end_line=3943; end_column=64; + law_headings=["Article 33"; + "Chapitre IV : Calcul des allocations de logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + ((date_courante_ >=@ + (date_of_numbers (2020) (1) (1))) && + ((param_ >=@ (date_of_numbers (2014) (10) (1))) + && + (param_ <@ (date_of_numbers (2015) (10) (1))))))) + (fun (_: _) -> + match zone_ + with + | ZoneDHabitation.Zone1 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "31123") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "37508")) else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "1")) then + (money_of_cents_string "40330") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "2")) then + (money_of_cents_string "41457") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "3")) then + (money_of_cents_string "42623") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "4")) then + (money_of_cents_string "43766") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "5")) + then + (money_of_cents_string + "44693") else + ((money_of_cents_string + "44693") +$ + ((money_of_cents_string + "3892") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ + -! + (integer_of_string + "5"))))))))))) + | ZoneDHabitation.Zone2 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "27304") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "33473")) else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "1")) then + (money_of_cents_string "36235") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "2")) then + (money_of_cents_string "37490") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "3")) then + (money_of_cents_string "38783") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "4")) then + (money_of_cents_string "40056") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "5")) + then + (money_of_cents_string + "42892") else + ((money_of_cents_string + "42892") +$ + ((money_of_cents_string + "3729") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ + -! + (integer_of_string + "5"))))))))))) + | ZoneDHabitation.Zone3 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "25614") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "31067")) else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "1")) then + (money_of_cents_string "33871") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "2")) then + (money_of_cents_string "35271") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "3")) then + (money_of_cents_string "36692") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "4")) then + (money_of_cents_string "38090") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "5")) + then + (money_of_cents_string + "40928") else + ((money_of_cents_string + "40928") +$ + ((money_of_cents_string + "3548") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ + -! + (integer_of_string + "5"))))))))))))); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=877; start_column=10; + end_line=877; end_column=14; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=3988; start_column=5; + end_line=3988; end_column=64; + law_headings=["Article 33"; + "Chapitre IV : Calcul des allocations de logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + ((date_courante_ >=@ + (date_of_numbers (2020) (1) (1))) && + ((param_ >=@ (date_of_numbers (2015) (10) (1))) + && + (param_ <@ (date_of_numbers (2017) (10) (1))))))) + (fun (_: _) -> + match zone_ + with + | ZoneDHabitation.Zone1 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "31148") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "37538")) else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "1")) then + (money_of_cents_string "40362") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "2")) then + (money_of_cents_string "41490") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "3")) then + (money_of_cents_string "42657") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "4")) then + (money_of_cents_string "43801") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "5")) + then + (money_of_cents_string + "44729") else + ((money_of_cents_string + "44729") +$ + ((money_of_cents_string + "3895") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ + -! + (integer_of_string + "5"))))))))))) + | ZoneDHabitation.Zone2 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "27326") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "33500")) else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "1")) then + (money_of_cents_string "36264") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "2")) then + (money_of_cents_string "37520") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "3")) then + (money_of_cents_string "38814") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "4")) then + (money_of_cents_string "40088") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "5")) + then + (money_of_cents_string + "42926") else + ((money_of_cents_string + "42926") +$ + ((money_of_cents_string + "3732") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ + -! + (integer_of_string + "5"))))))))))) + | ZoneDHabitation.Zone3 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "25634") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "31092")) else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "1")) then + (money_of_cents_string "33898") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "2")) then + (money_of_cents_string "35299") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "3")) then + (money_of_cents_string "36721") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "4")) then + (money_of_cents_string "38120") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "5")) + then + (money_of_cents_string + "40961") else + ((money_of_cents_string + "40961") +$ + ((money_of_cents_string + "3551") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ + -! + (integer_of_string + "5"))))))))))))); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=877; start_column=10; + end_line=877; end_column=14; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=4033; start_column=5; + end_line=4033; end_column=64; + law_headings=["Article 33"; + "Chapitre IV : Calcul des allocations de logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + ((date_courante_ >=@ + (date_of_numbers (2020) (1) (1))) && + ((param_ >=@ (date_of_numbers (2017) (10) (1))) + && + (param_ <@ (date_of_numbers (2019) (10) (1))))))) + (fun (_: _) -> + match zone_ + with + | ZoneDHabitation.Zone1 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "31382") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "37820")) else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "1")) then + (money_of_cents_string "40665") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "2")) then + (money_of_cents_string "41801") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "3")) then + (money_of_cents_string "42977") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "4")) then + (money_of_cents_string "44130") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "5")) + then + (money_of_cents_string + "45064") else + ((money_of_cents_string + "45064") +$ + ((money_of_cents_string + "3924") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ + -! + (integer_of_string + "5"))))))))))) + | ZoneDHabitation.Zone2 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "27531") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "33751")) else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "1")) then + (money_of_cents_string "36536") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "2")) then + (money_of_cents_string "37801") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "3")) then + (money_of_cents_string "39105") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "4")) then + (money_of_cents_string "40389") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "5")) + then + (money_of_cents_string + "43248") else + ((money_of_cents_string + "43248") +$ + ((money_of_cents_string + "3760") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ + -! + (integer_of_string + "5"))))))))))) + | ZoneDHabitation.Zone3 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "25826") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "31325")) else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "1")) then + (money_of_cents_string "34152") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "2")) then + (money_of_cents_string "35564") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "3")) then + (money_of_cents_string "36996") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "4")) then + (money_of_cents_string "38406") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "5")) + then + (money_of_cents_string + "41268") else + ((money_of_cents_string + "41268") +$ + ((money_of_cents_string + "3578") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ + -! + (integer_of_string + "5"))))))))))))); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=877; start_column=10; + end_line=877; end_column=14; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=4078; start_column=5; + end_line=4078; end_column=33; + law_headings=["Article 33"; + "Chapitre IV : Calcul des allocations de logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + ((date_courante_ >=@ + (date_of_numbers (2020) (1) (1))) && + (param_ >=@ (date_of_numbers (2019) (10) (1)))))) + (fun (_: _) -> + match zone_ + with + | ZoneDHabitation.Zone1 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "31476") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "37933")) else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "1")) then + (money_of_cents_string "40787") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "2")) then + (money_of_cents_string "41927") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "3")) then + (money_of_cents_string "43106") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "4")) then + (money_of_cents_string "44262") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "5")) + then + (money_of_cents_string + "45200") else + ((money_of_cents_string + "45200") +$ + ((money_of_cents_string + "3936") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ + -! + (integer_of_string + "5"))))))))))) + | ZoneDHabitation.Zone2 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "27614") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "33853")) else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "1")) then + (money_of_cents_string "36646") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "2")) then + (money_of_cents_string "37915") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "3")) then + (money_of_cents_string "39222") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "4")) then + (money_of_cents_string "40510") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "5")) + then + (money_of_cents_string + "43378") else + ((money_of_cents_string + "43378") +$ + ((money_of_cents_string + "3771") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ + -! + (integer_of_string + "5"))))))))))) + | ZoneDHabitation.Zone3 _ -> + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "0")) then + (match situation_familiale_calcul_apl_ + with + | SituationFamilialeCalculAPL.PersonneSeule _ -> + (money_of_cents_string "25904") + | SituationFamilialeCalculAPL.Couple _ -> + (money_of_cents_string "31419")) else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "1")) then + (money_of_cents_string "34255") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "2")) then + (money_of_cents_string "35670") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "3")) then + (money_of_cents_string "37107") else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "4")) then + (money_of_cents_string "38521") + else + ( if + (nombre_personnes_a_charge_ = + (integer_of_string "5")) + then + (money_of_cents_string + "41392") else + ((money_of_cents_string + "41392") +$ + ((money_of_cents_string + "3588") *$ + (decimal_of_integer + (nombre_personnes_a_charge_ + -! + (integer_of_string + "5")))))))))))))|]) + (fun (_: _) -> false) (fun (_: _) -> raise EmptyError)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=877; start_column=10; end_line=877; end_column=14; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]}))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=877; start_column=10; end_line=877; end_column=14; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})))) in + let seuil_minimal_ressources_menage_: money = (log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "seuil_minimal_ressources_ménage"] (embed_money) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=881; start_column=11; end_line=881; end_column=42; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=881; start_column=11; + end_line=881; end_column=42; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=4756; start_column=6; + end_line=4762; end_column=6; + law_headings=["Article D842-12"; + "Section 2 : Accession à la propriété"; + "Chapitre 2 : Modalités de liquidation et de versement des allocations de logement"; + "Titre IV : Allocations de Logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + (((date_signature_pret_ >=@ + (date_of_numbers (1992) (9) (30))) && + (date_signature_pret_ >=@ + (date_of_numbers (1994) (9) (30)))) || + ((date_signature_pret_ >=@ + (date_of_numbers (1994) (9) (30))) && + ((match type_travaux_logement_ + with + | TypeTravauxLogementR8425.ObjectifDecenceLogement _ -> + false + | TypeTravauxLogementR8425.PrevuDansListeR321_15 _ -> + false + | TypeTravauxLogementR8425.AgrandirOuRendreHabitableD331_63 _ -> + false + | TypeTravauxLogementR8425.PasDeTravaux _ -> true) + || + ((match type_travaux_logement_ + with + | TypeTravauxLogementR8425.ObjectifDecenceLogement _ -> + true + | TypeTravauxLogementR8425.PrevuDansListeR321_15 _ -> + false + | TypeTravauxLogementR8425.AgrandirOuRendreHabitableD331_63 _ -> + false + | TypeTravauxLogementR8425.PasDeTravaux _ -> + false) || + (match type_travaux_logement_ + with + | TypeTravauxLogementR8425.ObjectifDecenceLogement _ -> + false + | TypeTravauxLogementR8425.PrevuDansListeR321_15 _ -> + false + | TypeTravauxLogementR8425.AgrandirOuRendreHabitableD331_63 _ -> + true + | TypeTravauxLogementR8425.PasDeTravaux _ -> + false))))))) + (fun (_: _) -> + mensualite_principale_ *$ coefficient_d842_12_)); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=881; start_column=11; + end_line=881; end_column=42; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=4774; start_column=5; + end_line=4775; end_column=59; + law_headings=["Article D842-12"; + "Section 2 : Accession à la propriété"; + "Chapitre 2 : Modalités de liquidation et de versement des allocations de logement"; + "Titre IV : Allocations de Logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + ((date_signature_pret_ >=@ + (date_of_numbers (1994) (9) (30))) && + (match type_travaux_logement_ + with + | TypeTravauxLogementR8425.ObjectifDecenceLogement _ -> + false + | TypeTravauxLogementR8425.PrevuDansListeR321_15 _ -> + true + | TypeTravauxLogementR8425.AgrandirOuRendreHabitableD331_63 _ -> + false + | TypeTravauxLogementR8425.PasDeTravaux _ -> false)))) + (fun (_: _) -> montant_forfaitaire_d842_12_))|]) + (fun (_: _) -> false) (fun (_: _) -> raise EmptyError)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=881; start_column=11; end_line=881; end_column=42; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})))) in + let depense_nette_minimale_: money -> money = (log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "dépense_nette_minimale"] (unembeddable) ( + try + (fun (param_: money) -> + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=883; start_column=11; end_line=883; end_column=33; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=4697; start_column=15; + end_line=4697; end_column=37; + law_headings=["Article D842-11"; + "Section 2 : Accession à la propriété"; + "Chapitre 2 : Modalités de liquidation et de versement des allocations de logement"; + "Titre IV : Allocations de Logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + (charges_mensuelles_pret_ +$ montant_forfaitaire_charges_) + -$ param_)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=883; start_column=11; end_line=883; end_column=33; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]}))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=883; start_column=11; end_line=883; end_column=33; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})))) in + let calcul_plafond_mensualite_d842_6_avec_copropriete_: date -> money = (log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "calcul_plafond_mensualité_d842_6_avec_copropriété"] (unembeddable) + ( + try + (fun (param_: date) -> + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=878; start_column=10; end_line=878; end_column=26; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=878; start_column=10; + end_line=878; end_column=26; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=4178; start_column=24; + end_line=4178; end_column=56; + law_headings=["Article 37"; + "Chapitre IV : Calcul des allocations de logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + (date_courante_ >=@ + (date_of_numbers (2021) (10) (1))))) + (fun (_: _) -> + if copropriete_ then + (((log_end_call + ["CalculAllocationLogementAccessionPropriété"; + "calcul_plafond_mensualité_d842_6_base"] + ((log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "calcul_plafond_mensualité_d842_6_base"; + "output"] (embed_money) ((log_begin_call + ["CalculAllocationLogementAccessionPropriété"; + "calcul_plafond_mensualité_d842_6_base"] + calcul_plafond_mensualite_d842_6_base_) + ((log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "calcul_plafond_mensualité_d842_6_base"; + "input"] (embed_date) param_))))))) *$ + (decimal_of_string "0.75")) else + ((log_end_call + ["CalculAllocationLogementAccessionPropriété"; + "calcul_plafond_mensualité_d842_6_base"] + ((log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "calcul_plafond_mensualité_d842_6_base"; + "output"] (embed_money) ((log_begin_call + ["CalculAllocationLogementAccessionPropriété"; + "calcul_plafond_mensualité_d842_6_base"] + calcul_plafond_mensualite_d842_6_base_) + ((log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "calcul_plafond_mensualité_d842_6_base"; + "input"] (embed_date) param_)))))))))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=4122; start_column=14; + end_line=4122; end_column=46; + law_headings=["Article 33"; + "Chapitre IV : Calcul des allocations de logement en secteur accession"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + (date_courante_ >=@ (date_of_numbers (2020) (1) (1))))) + (fun (_: _) -> (log_end_call + ["CalculAllocationLogementAccessionPropriété"; + "calcul_plafond_mensualité_d842_6_base"] + ((log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "calcul_plafond_mensualité_d842_6_base"; "output"] + (embed_money) ((log_begin_call + ["CalculAllocationLogementAccessionPropriété"; + "calcul_plafond_mensualité_d842_6_base"] + calcul_plafond_mensualite_d842_6_base_) + ((log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "calcul_plafond_mensualité_d842_6_base"; "input"] + (embed_date) param_)))))))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=878; start_column=10; end_line=878; end_column=26; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]}))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=878; start_column=10; end_line=878; end_column=26; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})))) in + let ressources_menage_arrondies_seuil_: money = (log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "ressources_ménage_arrondies_seuil"] (embed_money) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=857; start_column=10; end_line=857; end_column=15; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=857; start_column=10; + end_line=857; end_column=15; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=4795; start_column=5; + end_line=4795; end_column=28; + law_headings=["Article D842-12"; + "Section 2 : Accession à la propriété"; + "Chapitre 2 : Modalités de liquidation et de versement des allocations de logement"; + "Titre IV : Allocations de Logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + situation_r822_11_13_17_)) + (fun (_: _) -> ressources_menage_arrondies_base_))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=4785; start_column=14; end_line=4785; end_column=41; + law_headings=["Article D842-12"; + "Section 2 : Accession à la propriété"; + "Chapitre 2 : Modalités de liquidation et de versement des allocations de logement"; + "Titre IV : Allocations de Logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + if + (ressources_menage_arrondies_base_ <=$ + seuil_minimal_ressources_menage_) then + ((money_round + ((seuil_minimal_ressources_menage_ +$ + (money_of_cents_string "4999")) *$ + (decimal_of_string "0.01"))) *$ + (decimal_of_string "100.")) else + ressources_menage_arrondies_base_)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=857; start_column=10; end_line=857; end_column=15; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})))) in + let plafond_mensualite_d842_6_: money = (log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "plafond_mensualité_d842_6"] (embed_money) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=875; start_column=11; end_line=875; end_column=36; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=875; start_column=11; + end_line=875; end_column=36; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=4650; start_column=5; + end_line=4650; end_column=44; + law_headings=["Article D842-9"; + "Section 2 : Accession à la propriété"; + "Chapitre 2 : Modalités de liquidation et de versement des allocations de logement"; + "Titre IV : Allocations de Logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + local_habite_premiere_fois_beneficiaire_)) + (fun (_: _) -> + if + (((log_end_call + ["CalculAllocationLogementAccessionPropriété"; + "calcul_plafond_mensualité_d842_6_avec_copropriété"] + ((log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "calcul_plafond_mensualité_d842_6_avec_copropriété"; + "output"] (embed_money) ((log_begin_call + ["CalculAllocationLogementAccessionPropriété"; + "calcul_plafond_mensualité_d842_6_avec_copropriété"] + calcul_plafond_mensualite_d842_6_avec_copropriete_) + ((log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "calcul_plafond_mensualité_d842_6_avec_copropriété"; + "input"] (embed_date) date_signature_pret_))))))) + <$ ((log_end_call + ["CalculAllocationLogementAccessionPropriété"; + "calcul_plafond_mensualité_d842_6_avec_copropriété"] + ((log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "calcul_plafond_mensualité_d842_6_avec_copropriété"; + "output"] (embed_money) ((log_begin_call + ["CalculAllocationLogementAccessionPropriété"; + "calcul_plafond_mensualité_d842_6_avec_copropriété"] + calcul_plafond_mensualite_d842_6_avec_copropriete_) + ((log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "calcul_plafond_mensualité_d842_6_avec_copropriété"; + "input"] (embed_date) date_entree_logement_)))))))) + then + ((log_end_call + ["CalculAllocationLogementAccessionPropriété"; + "calcul_plafond_mensualité_d842_6_avec_copropriété"] + ((log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "calcul_plafond_mensualité_d842_6_avec_copropriété"; + "output"] (embed_money) ((log_begin_call + ["CalculAllocationLogementAccessionPropriété"; + "calcul_plafond_mensualité_d842_6_avec_copropriété"] + calcul_plafond_mensualite_d842_6_avec_copropriete_) + ((log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "calcul_plafond_mensualité_d842_6_avec_copropriété"; + "input"] (embed_date) date_entree_logement_))))))) + else + ((log_end_call + ["CalculAllocationLogementAccessionPropriété"; + "calcul_plafond_mensualité_d842_6_avec_copropriété"] + ((log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "calcul_plafond_mensualité_d842_6_avec_copropriété"; + "output"] (embed_money) ((log_begin_call + ["CalculAllocationLogementAccessionPropriété"; + "calcul_plafond_mensualité_d842_6_avec_copropriété"] + calcul_plafond_mensualite_d842_6_avec_copropriete_) + ((log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "calcul_plafond_mensualité_d842_6_avec_copropriété"; + "input"] (embed_date) date_signature_pret_)))))))))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=4632; start_column=14; end_line=4632; end_column=39; + law_headings=["Article D842-9"; + "Section 2 : Accession à la propriété"; + "Chapitre 2 : Modalités de liquidation et de versement des allocations de logement"; + "Titre IV : Allocations de Logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> (log_end_call + ["CalculAllocationLogementAccessionPropriété"; + "calcul_plafond_mensualité_d842_6_avec_copropriété"] + ((log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "calcul_plafond_mensualité_d842_6_avec_copropriété"; + "output"] (embed_money) ((log_begin_call + ["CalculAllocationLogementAccessionPropriété"; + "calcul_plafond_mensualité_d842_6_avec_copropriété"] + calcul_plafond_mensualite_d842_6_avec_copropriete_) + ((log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "calcul_plafond_mensualité_d842_6_avec_copropriété"; + "input"] (embed_date) date_signature_pret_)))))))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=875; start_column=11; end_line=875; end_column=36; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})))) in + let calcul_equivalence_loyer_minimale_dot_ressources_menage_arrondies_: money = + try ((log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "calcul_équivalence_loyer_minimale.ressources_ménage_arrondies"] + (embed_money) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=896; start_column=3; end_line=896; end_column=36; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=4499; start_column=14; end_line=4499; end_column=75; + law_headings=["Article D842-6"; + "Section 2 : Accession à la propriété"; + "Chapitre 2 : Modalités de liquidation et de versement des allocations de logement"; + "Titre IV : Allocations de Logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) (fun (_: _) -> ressources_menage_arrondies_seuil_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=613; start_column=10; end_line=613; end_column=37; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let calcul_equivalence_loyer_minimale_dot_condition_2_du_832_25_: bool = + try ((log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "calcul_équivalence_loyer_minimale.condition_2_du_832_25"] + (embed_bool) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=896; start_column=3; end_line=896; end_column=36; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=4498; start_column=14; end_line=4498; end_column=69; + law_headings=["Article D842-6"; + "Section 2 : Accession à la propriété"; + "Chapitre 2 : Modalités de liquidation et de versement des allocations de logement"; + "Titre IV : Allocations de Logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) (fun (_: _) -> true)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=614; start_column=10; end_line=614; end_column=31; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let calcul_equivalence_loyer_minimale_dot_n_nombre_parts_d832_25_: decimal = + try ((log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "calcul_équivalence_loyer_minimale.n_nombre_parts_d832_25"] + (embed_decimal) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=896; start_column=3; end_line=896; end_column=36; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=4501; start_column=14; end_line=4501; end_column=70; + law_headings=["Article D842-6"; + "Section 2 : Accession à la propriété"; + "Chapitre 2 : Modalités de liquidation et de versement des allocations de logement"; + "Titre IV : Allocations de Logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> calcul_nombre_parts_dot_n_nombre_parts_d832_11_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=615; start_column=10; end_line=615; end_column=32; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let result_: CalculEquivalenceLoyerMinimaleOut.t = (log_end_call + ["CalculAllocationLogementAccessionPropriété"; + "calcul_équivalence_loyer_minimale"; + "CalculÉquivalenceLoyerMinimale"] ((log_begin_call + ["CalculAllocationLogementAccessionPropriété"; + "calcul_équivalence_loyer_minimale"; + "CalculÉquivalenceLoyerMinimale"] calcul_equivalence_loyer_minimale) + {CalculEquivalenceLoyerMinimaleIn.ressources_menage_arrondies_in = + calcul_equivalence_loyer_minimale_dot_ressources_menage_arrondies_; + CalculEquivalenceLoyerMinimaleIn.condition_2_du_832_25_in = + calcul_equivalence_loyer_minimale_dot_condition_2_du_832_25_; + CalculEquivalenceLoyerMinimaleIn.n_nombre_parts_d832_25_in = + calcul_equivalence_loyer_minimale_dot_n_nombre_parts_d832_25_})) in + let calcul_equivalence_loyer_minimale_dot_montant_: money = result_.CalculEquivalenceLoyerMinimaleOut.montant_out in + let calcul_apl_logement_foyer_dot_mode_occupation_: ModeOccupation.t = + try ((log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "calcul_apl_logement_foyer.mode_occupation"] (embed_mode_occupation) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=892; start_column=3; end_line=892; end_column=28; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=908; start_column=14; end_line=908; end_column=55; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> + ModeOccupation.ResidentLogementFoyer + {LogementFoyer.type_user = + (TypeLogementFoyer.ResidenceSociale ()); + LogementFoyer.date_conventionnement = + (date_of_numbers (2022) (1) (1)); + LogementFoyer.location = + {Location.bailleur = + {Bailleur.type_bailleur = + (TypeBailleur.BailleurSocial ()); + Bailleur.respecte_convention_titre_V = true; + Bailleur.respecte_convention_titre_II = true; + Bailleur.construit_ameliore_conditions_l831_1_4 = + true; + Bailleur.acquisition_aides_etat_pret_titre_II_ou_livre_III = + true}}; + LogementFoyer.remplit_conditions_r832_21 = false; + LogementFoyer.construit_application_loi_1957_12_III = false})))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=632; start_column=10; end_line=632; end_column=25; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let calcul_apl_logement_foyer_dot_ressources_menage_arrondies_: money = + try ((log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "calcul_apl_logement_foyer.ressources_ménage_arrondies"] + (embed_money) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=892; start_column=3; end_line=892; end_column=28; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=931; start_column=14; end_line=931; end_column=67; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> ressources_menage_arrondies_seuil_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=633; start_column=10; end_line=633; end_column=37; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let calcul_apl_logement_foyer_dot_nombre_personnes_a_charge_: integer = + try ((log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "calcul_apl_logement_foyer.nombre_personnes_à_charge"] + (embed_integer) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=892; start_column=3; end_line=892; end_column=28; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=933; start_column=14; end_line=933; end_column=65; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> nombre_personnes_a_charge_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=634; start_column=10; end_line=634; end_column=35; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let calcul_apl_logement_foyer_dot_situation_familiale_calcul_apl_: SituationFamilialeCalculAPL.t = + try ((log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "calcul_apl_logement_foyer.situation_familiale_calcul_apl"] + (embed_situation_familiale_calcul_a_p_l) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=892; start_column=3; end_line=892; end_column=28; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=935; start_column=14; end_line=935; end_column=70; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> situation_familiale_calcul_apl_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=635; start_column=10; end_line=635; end_column=40; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let calcul_apl_logement_foyer_dot_zone_: ZoneDHabitation.t = + try ((log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "calcul_apl_logement_foyer.zone"] (embed_zone_d_habitation) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=892; start_column=3; end_line=892; end_column=28; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=937; start_column=14; end_line=937; end_column=44; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> zone_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=636; start_column=10; end_line=636; end_column=14; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let calcul_apl_logement_foyer_dot_date_courante_: date = + try ((log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "calcul_apl_logement_foyer.date_courante"] (embed_date) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=892; start_column=3; end_line=892; end_column=28; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=939; start_column=14; end_line=939; end_column=53; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> date_courante_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=637; start_column=10; end_line=637; end_column=23; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let calcul_apl_logement_foyer_dot_redevance_: money = + try ((log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "calcul_apl_logement_foyer.redevance"] (embed_money) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=892; start_column=3; end_line=892; end_column=28; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=929; start_column=14; end_line=929; end_column=49; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> money_of_cents_string "0")))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=638; start_column=10; end_line=638; end_column=19; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let calcul_apl_logement_foyer_dot_condition_2_du_832_25_: unit -> bool = + fun (_: unit) -> (log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "calcul_apl_logement_foyer.condition_2_du_832_25"] (embed_bool) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=892; start_column=3; end_line=892; end_column=28; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=4458; start_column=14; end_line=4458; end_column=61; + law_headings=["Article D842-6"; + "Section 2 : Accession à la propriété"; + "Chapitre 2 : Modalités de liquidation et de versement des allocations de logement"; + "Titre IV : Allocations de Logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) (fun (_: _) -> true))) in + let calcul_apl_logement_foyer_dot_n_nombre_parts_d832_25_: unit -> decimal = + fun (_: unit) -> (log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "calcul_apl_logement_foyer.n_nombre_parts_d832_25"] (embed_decimal) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=892; start_column=3; end_line=892; end_column=28; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=4465; start_column=14; end_line=4465; end_column=62; + law_headings=["Article D842-6"; + "Section 2 : Accession à la propriété"; + "Chapitre 2 : Modalités de liquidation et de versement des allocations de logement"; + "Titre IV : Allocations de Logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> calcul_nombre_parts_dot_n_nombre_parts_d832_11_))) in + let result_: CalculAidePersonnaliseeLogementFoyerOut.t = (log_end_call + ["CalculAllocationLogementAccessionPropriété"; + "calcul_apl_logement_foyer"; "CalculAidePersonnaliséeLogementFoyer"] + ((log_begin_call + ["CalculAllocationLogementAccessionPropriété"; + "calcul_apl_logement_foyer"; "CalculAidePersonnaliséeLogementFoyer"] + calcul_aide_personnalisee_logement_foyer) + {CalculAidePersonnaliseeLogementFoyerIn.mode_occupation_in = + calcul_apl_logement_foyer_dot_mode_occupation_; + CalculAidePersonnaliseeLogementFoyerIn.ressources_menage_arrondies_in = + calcul_apl_logement_foyer_dot_ressources_menage_arrondies_; + CalculAidePersonnaliseeLogementFoyerIn.nombre_personnes_a_charge_in = + calcul_apl_logement_foyer_dot_nombre_personnes_a_charge_; + CalculAidePersonnaliseeLogementFoyerIn.situation_familiale_calcul_apl_in = + calcul_apl_logement_foyer_dot_situation_familiale_calcul_apl_; + CalculAidePersonnaliseeLogementFoyerIn.zone_in = + calcul_apl_logement_foyer_dot_zone_; + CalculAidePersonnaliseeLogementFoyerIn.date_courante_in = + calcul_apl_logement_foyer_dot_date_courante_; + CalculAidePersonnaliseeLogementFoyerIn.redevance_in = + calcul_apl_logement_foyer_dot_redevance_; + CalculAidePersonnaliseeLogementFoyerIn.condition_2_du_832_25_in = + calcul_apl_logement_foyer_dot_condition_2_du_832_25_; + CalculAidePersonnaliseeLogementFoyerIn.n_nombre_parts_d832_25_in = + calcul_apl_logement_foyer_dot_n_nombre_parts_d832_25_})) in + let calcul_apl_logement_foyer_dot_coefficient_multiplicateur_d832_25_: money = result_.CalculAidePersonnaliseeLogementFoyerOut.coefficient_multiplicateur_d832_25_out in + let calcul_apl_logement_foyer_dot_coefficient_r_d832_25_: money = result_.CalculAidePersonnaliseeLogementFoyerOut.coefficient_r_d832_25_out in + let calcul_apl_logement_foyer_dot_n_nombre_parts_d832_25_: decimal = result_.CalculAidePersonnaliseeLogementFoyerOut.n_nombre_parts_d832_25_out in + let calcul_apl_logement_foyer_dot_equivalence_loyer_eligible_: money = result_.CalculAidePersonnaliseeLogementFoyerOut.equivalence_loyer_eligible_out in + let calcul_apl_logement_foyer_dot_plafond_equivalence_loyer_eligible_: money = result_.CalculAidePersonnaliseeLogementFoyerOut.plafond_equivalence_loyer_eligible_out in + let calcul_apl_logement_foyer_dot_equivalence_loyer_minimale_: money = result_.CalculAidePersonnaliseeLogementFoyerOut.equivalence_loyer_minimale_out in + let calcul_apl_logement_foyer_dot_coefficient_prise_en_charge_d832_25_seuil_: decimal = result_.CalculAidePersonnaliseeLogementFoyerOut.coefficient_prise_en_charge_d832_25_seuil_out in + let calcul_apl_logement_foyer_dot_aide_finale_formule_: money = result_.CalculAidePersonnaliseeLogementFoyerOut.aide_finale_formule_out in + let calcul_apl_logement_foyer_dot_traitement_aide_finale_montant_minimal_: + money -> money = result_.CalculAidePersonnaliseeLogementFoyerOut.traitement_aide_finale_montant_minimal_out in + let seuil_minimal_depense_nette_minimale_: money = (log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "seuil_minimal_dépense_nette_minimale"] (embed_money) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=880; start_column=11; end_line=880; end_column=47; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=880; start_column=11; + end_line=880; end_column=47; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=4731; start_column=7; + end_line=4734; end_column=45; + law_headings=["Article D842-11"; + "Section 2 : Accession à la propriété"; + "Chapitre 2 : Modalités de liquidation et de versement des allocations de logement"; + "Titre IV : Allocations de Logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + (((match type_travaux_logement_ + with + | TypeTravauxLogementR8425.ObjectifDecenceLogement _ -> + false + | TypeTravauxLogementR8425.PrevuDansListeR321_15 _ -> + false + | TypeTravauxLogementR8425.AgrandirOuRendreHabitableD331_63 _ -> + false + | TypeTravauxLogementR8425.PasDeTravaux _ -> true) || + ((match type_travaux_logement_ + with + | TypeTravauxLogementR8425.ObjectifDecenceLogement _ -> + true + | TypeTravauxLogementR8425.PrevuDansListeR321_15 _ -> + false + | TypeTravauxLogementR8425.AgrandirOuRendreHabitableD331_63 _ -> + false + | TypeTravauxLogementR8425.PasDeTravaux _ -> false) + || + (match type_travaux_logement_ + with + | TypeTravauxLogementR8425.ObjectifDecenceLogement _ -> + false + | TypeTravauxLogementR8425.PrevuDansListeR321_15 _ -> + false + | TypeTravauxLogementR8425.AgrandirOuRendreHabitableD331_63 _ -> + true + | TypeTravauxLogementR8425.PasDeTravaux _ -> + false))) && + (date_signature_pret_ >=@ + (date_of_numbers (1999) (7) (1)))))) + (fun (_: _) -> + ressources_menage_arrondies_seuil_ *$ + coefficient_d842_11_))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=4719; start_column=14; end_line=4719; end_column=50; + law_headings=["Article D842-11"; + "Section 2 : Accession à la propriété"; + "Chapitre 2 : Modalités de liquidation et de versement des allocations de logement"; + "Titre IV : Allocations de Logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) (fun (_: _) -> montant_forfaitaire_d842_11_)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=880; start_column=11; end_line=880; end_column=47; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})))) in + let mensualite_eligible_: money = (log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; "mensualité_éligible"] + (embed_money) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=871; start_column=11; end_line=871; end_column=30; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=4479; start_column=14; end_line=4479; end_column=33; + law_headings=["Article D842-6"; + "Section 2 : Accession à la propriété"; + "Chapitre 2 : Modalités de liquidation et de versement des allocations de logement"; + "Titre IV : Allocations de Logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + if (mensualite_principale_ >$ plafond_mensualite_d842_6_) then + plafond_mensualite_d842_6_ else mensualite_principale_)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=871; start_column=11; end_line=871; end_column=30; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})))) in + let mensualite_minimale_: money = (log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; "mensualité_minimale"] + (embed_money) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=873; start_column=11; end_line=873; end_column=30; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=4494; start_column=14; end_line=4494; end_column=33; + law_headings=["Article D842-6"; + "Section 2 : Accession à la propriété"; + "Chapitre 2 : Modalités de liquidation et de versement des allocations de logement"; + "Titre IV : Allocations de Logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> calcul_equivalence_loyer_minimale_dot_montant_)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=873; start_column=11; end_line=873; end_column=30; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})))) in + let coefficient_prise_en_charge_: decimal = (log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "coefficient_prise_en_charge"] (embed_decimal) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=874; start_column=11; end_line=874; end_column=38; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=4468; start_column=14; end_line=4468; end_column=41; + law_headings=["Article D842-6"; + "Section 2 : Accession à la propriété"; + "Chapitre 2 : Modalités de liquidation et de versement des allocations de logement"; + "Titre IV : Allocations de Logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + calcul_apl_logement_foyer_dot_coefficient_prise_en_charge_d832_25_seuil_)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=874; start_column=11; end_line=874; end_column=38; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})))) in + let abattement_depense_nette_minimale_: money -> money = (log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "abattement_dépense_nette_minimale"] (unembeddable) ( + try + (fun (param_: money) -> + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=884; start_column=11; end_line=884; end_column=44; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=4708; start_column=14; + end_line=4708; end_column=47; + law_headings=["Article D842-11"; + "Section 2 : Accession à la propriété"; + "Chapitre 2 : Modalités de liquidation et de versement des allocations de logement"; + "Titre IV : Allocations de Logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + if + (((log_end_call + ["CalculAllocationLogementAccessionPropriété"; + "dépense_nette_minimale"] ((log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "dépense_nette_minimale"; "output"] (embed_money) + ((log_begin_call + ["CalculAllocationLogementAccessionPropriété"; + "dépense_nette_minimale"] depense_nette_minimale_) + ((log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "dépense_nette_minimale"; "input"] (embed_money) + param_))))))) <$ seuil_minimal_depense_nette_minimale_) + then + (seuil_minimal_depense_nette_minimale_ -$ ((log_end_call + ["CalculAllocationLogementAccessionPropriété"; + "dépense_nette_minimale"] ((log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "dépense_nette_minimale"; "output"] (embed_money) + ((log_begin_call + ["CalculAllocationLogementAccessionPropriété"; + "dépense_nette_minimale"] depense_nette_minimale_) + ((log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "dépense_nette_minimale"; "input"] (embed_money) + param_)))))))) else (money_of_cents_string "0"))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=884; start_column=11; end_line=884; end_column=44; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]}))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=884; start_column=11; end_line=884; end_column=44; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})))) in + let aide_finale_formule_: money = (log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; "aide_finale_formule"] + (embed_money) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=899; start_column=10; end_line=899; end_column=29; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=4439; start_column=14; end_line=4439; end_column=33; + law_headings=["Article D842-6"; + "Section 2 : Accession à la propriété"; + "Chapitre 2 : Modalités de liquidation et de versement des allocations de logement"; + "Titre IV : Allocations de Logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + ((mensualite_eligible_ +$ montant_forfaitaire_charges_) -$ + mensualite_minimale_) *$ coefficient_prise_en_charge_)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=899; start_column=10; end_line=899; end_column=29; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})))) in + let traitement_aide_finale_depense_nette_minimale_: money -> money = (log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "traitement_aide_finale_dépense_nette_minimale"] (unembeddable) ( + try + (fun (param_: money) -> + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=903; start_column=10; end_line=903; end_column=32; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=4527; start_column=14; + end_line=4527; end_column=36; + law_headings=["Article D842-6"; + "Section 2 : Accession à la propriété"; + "Chapitre 2 : Modalités de liquidation et de versement des allocations de logement"; + "Titre IV : Allocations de Logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + if + ((((log_end_call + ["CalculAllocationLogementAccessionPropriété"; + "traitement_aide_finale_minoration_forfaitaire"] + ((log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "traitement_aide_finale_minoration_forfaitaire"; + "output"] (embed_money) ((log_begin_call + ["CalculAllocationLogementAccessionPropriété"; + "traitement_aide_finale_minoration_forfaitaire"] + traitement_aide_finale_minoration_forfaitaire_) + ((log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "traitement_aide_finale_minoration_forfaitaire"; + "input"] (embed_money) param_))))))) -$ + ((log_end_call + ["CalculAllocationLogementAccessionPropriété"; + "abattement_dépense_nette_minimale"] + ((log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "abattement_dépense_nette_minimale"; "output"] + (embed_money) ((log_begin_call + ["CalculAllocationLogementAccessionPropriété"; + "abattement_dépense_nette_minimale"] + abattement_depense_nette_minimale_) + ((log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "abattement_dépense_nette_minimale"; "input"] + (embed_money) ((log_end_call + ["CalculAllocationLogementAccessionPropriété"; + "traitement_aide_finale_minoration_forfaitaire"] + ((log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "traitement_aide_finale_minoration_forfaitaire"; + "output"] (embed_money) ((log_begin_call + ["CalculAllocationLogementAccessionPropriété"; + "traitement_aide_finale_minoration_forfaitaire"] + traitement_aide_finale_minoration_forfaitaire_) + ((log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "traitement_aide_finale_minoration_forfaitaire"; + "input"] (embed_money) param_))))))))))))))) <$ + (money_of_cents_string "0")) then + (money_of_cents_string "0") else + (((log_end_call + ["CalculAllocationLogementAccessionPropriété"; + "traitement_aide_finale_minoration_forfaitaire"] + ((log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "traitement_aide_finale_minoration_forfaitaire"; + "output"] (embed_money) ((log_begin_call + ["CalculAllocationLogementAccessionPropriété"; + "traitement_aide_finale_minoration_forfaitaire"] + traitement_aide_finale_minoration_forfaitaire_) + ((log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "traitement_aide_finale_minoration_forfaitaire"; + "input"] (embed_money) param_))))))) -$ + ((log_end_call + ["CalculAllocationLogementAccessionPropriété"; + "abattement_dépense_nette_minimale"] + ((log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "abattement_dépense_nette_minimale"; "output"] + (embed_money) ((log_begin_call + ["CalculAllocationLogementAccessionPropriété"; + "abattement_dépense_nette_minimale"] + abattement_depense_nette_minimale_) + ((log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "abattement_dépense_nette_minimale"; "input"] + (embed_money) ((log_end_call + ["CalculAllocationLogementAccessionPropriété"; + "traitement_aide_finale_minoration_forfaitaire"] + ((log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "traitement_aide_finale_minoration_forfaitaire"; + "output"] (embed_money) ((log_begin_call + ["CalculAllocationLogementAccessionPropriété"; + "traitement_aide_finale_minoration_forfaitaire"] + traitement_aide_finale_minoration_forfaitaire_) + ((log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "traitement_aide_finale_minoration_forfaitaire"; + "input"] (embed_money) param_))))))))))))))))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=903; start_column=10; end_line=903; end_column=32; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]}))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=903; start_column=10; end_line=903; end_column=32; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})))) in + let traitement_aide_finale_contributions_sociales_arrondi_: money -> money = (log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "traitement_aide_finale_contributions_sociales_arrondi"] (unembeddable) + ( + try + (fun (param_: money) -> + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=904; start_column=10; end_line=904; end_column=40; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=4546; start_column=14; + end_line=4546; end_column=36; + law_headings=["Article D842-6"; + "Section 2 : Accession à la propriété"; + "Chapitre 2 : Modalités de liquidation et de versement des allocations de logement"; + "Titre IV : Allocations de Logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + if + (((money_round + ((((log_end_call + ["CalculAllocationLogementAccessionPropriété"; + "traitement_aide_finale_dépense_nette_minimale"] + ((log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "traitement_aide_finale_dépense_nette_minimale"; + "output"] (embed_money) ((log_begin_call + ["CalculAllocationLogementAccessionPropriété"; + "traitement_aide_finale_dépense_nette_minimale"] + traitement_aide_finale_depense_nette_minimale_) + ((log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "traitement_aide_finale_dépense_nette_minimale"; + "input"] (embed_money) param_))))))) -$ + ((log_end_call + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"] ((log_variable_definition + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"; "output"] (embed_money) + ((log_begin_call + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"] contributions_sociales_dot_montant_) + ((log_variable_definition + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"; "input"] (embed_money) + ((log_end_call + ["CalculAllocationLogementAccessionPropriété"; + "traitement_aide_finale_dépense_nette_minimale"] + ((log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "traitement_aide_finale_dépense_nette_minimale"; + "output"] (embed_money) ((log_begin_call + ["CalculAllocationLogementAccessionPropriété"; + "traitement_aide_finale_dépense_nette_minimale"] + traitement_aide_finale_depense_nette_minimale_) + ((log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "traitement_aide_finale_dépense_nette_minimale"; + "input"] (embed_money) param_))))))))))))))) -$ + (money_of_cents_string "50"))) +$ ((log_end_call + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"] ((log_variable_definition + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"; "output"] (embed_money) ((log_begin_call + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"] contributions_sociales_dot_montant_) + ((log_variable_definition + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"; "input"] (embed_money) ((log_end_call + ["CalculAllocationLogementAccessionPropriété"; + "traitement_aide_finale_dépense_nette_minimale"] + ((log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "traitement_aide_finale_dépense_nette_minimale"; + "output"] (embed_money) ((log_begin_call + ["CalculAllocationLogementAccessionPropriété"; + "traitement_aide_finale_dépense_nette_minimale"] + traitement_aide_finale_depense_nette_minimale_) + ((log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "traitement_aide_finale_dépense_nette_minimale"; + "input"] (embed_money) param_))))))))))))))) >=$ + (money_of_cents_string "0")) then + ((money_round + ((((log_end_call + ["CalculAllocationLogementAccessionPropriété"; + "traitement_aide_finale_dépense_nette_minimale"] + ((log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "traitement_aide_finale_dépense_nette_minimale"; + "output"] (embed_money) ((log_begin_call + ["CalculAllocationLogementAccessionPropriété"; + "traitement_aide_finale_dépense_nette_minimale"] + traitement_aide_finale_depense_nette_minimale_) + ((log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "traitement_aide_finale_dépense_nette_minimale"; + "input"] (embed_money) param_))))))) -$ + ((log_end_call + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"] ((log_variable_definition + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"; "output"] (embed_money) + ((log_begin_call + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"] contributions_sociales_dot_montant_) + ((log_variable_definition + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"; "input"] (embed_money) ((log_end_call + ["CalculAllocationLogementAccessionPropriété"; + "traitement_aide_finale_dépense_nette_minimale"] + ((log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "traitement_aide_finale_dépense_nette_minimale"; + "output"] (embed_money) ((log_begin_call + ["CalculAllocationLogementAccessionPropriété"; + "traitement_aide_finale_dépense_nette_minimale"] + traitement_aide_finale_depense_nette_minimale_) + ((log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "traitement_aide_finale_dépense_nette_minimale"; + "input"] (embed_money) param_))))))))))))))) -$ + (money_of_cents_string "50"))) +$ ((log_end_call + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"] ((log_variable_definition + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"; "output"] (embed_money) ((log_begin_call + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"] contributions_sociales_dot_montant_) + ((log_variable_definition + ["ContributionsSocialesAidesPersonnelleLogement"; + "montant"; "input"] (embed_money) ((log_end_call + ["CalculAllocationLogementAccessionPropriété"; + "traitement_aide_finale_dépense_nette_minimale"] + ((log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "traitement_aide_finale_dépense_nette_minimale"; + "output"] (embed_money) ((log_begin_call + ["CalculAllocationLogementAccessionPropriété"; + "traitement_aide_finale_dépense_nette_minimale"] + traitement_aide_finale_depense_nette_minimale_) + ((log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "traitement_aide_finale_dépense_nette_minimale"; + "input"] (embed_money) param_))))))))))))))) else + (money_of_cents_string "0"))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=904; start_column=10; end_line=904; end_column=40; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]}))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=904; start_column=10; end_line=904; end_column=40; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})))) in + let traitement_aide_finale_montant_minimal_: money -> money = (log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "traitement_aide_finale_montant_minimal"] (unembeddable) ( + try + (fun (param_: money) -> + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=905; start_column=10; end_line=905; end_column=25; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=4569; start_column=14; + end_line=4569; end_column=36; + law_headings=["Article D842-6"; + "Section 2 : Accession à la propriété"; + "Chapitre 2 : Modalités de liquidation et de versement des allocations de logement"; + "Titre IV : Allocations de Logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + if + (((log_end_call + ["CalculAllocationLogementAccessionPropriété"; + "traitement_aide_finale_contributions_sociales_arrondi"] + ((log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "traitement_aide_finale_contributions_sociales_arrondi"; + "output"] (embed_money) ((log_begin_call + ["CalculAllocationLogementAccessionPropriété"; + "traitement_aide_finale_contributions_sociales_arrondi"] + traitement_aide_finale_contributions_sociales_arrondi_) + ((log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "traitement_aide_finale_contributions_sociales_arrondi"; + "input"] (embed_money) param_))))))) <$ + montant_minimal_aide_d842_6_) then + (money_of_cents_string "0") else + ((log_end_call + ["CalculAllocationLogementAccessionPropriété"; + "traitement_aide_finale_contributions_sociales_arrondi"] + ((log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "traitement_aide_finale_contributions_sociales_arrondi"; + "output"] (embed_money) ((log_begin_call + ["CalculAllocationLogementAccessionPropriété"; + "traitement_aide_finale_contributions_sociales_arrondi"] + traitement_aide_finale_contributions_sociales_arrondi_) + ((log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "traitement_aide_finale_contributions_sociales_arrondi"; + "input"] (embed_money) param_))))))))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=905; start_column=10; end_line=905; end_column=25; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]}))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=905; start_column=10; end_line=905; end_column=25; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})))) in + {CalculAllocationLogementAccessionProprieteOut.aide_finale_formule_out = + aide_finale_formule_; + CalculAllocationLogementAccessionProprieteOut.traitement_aide_finale_montant_minimal_out = + traitement_aide_finale_montant_minimal_} + +let calcul_aide_personnalisee_logement (calcul_aide_personnalisee_logement_in: CalculAidePersonnaliseeLogementIn.t) : CalculAidePersonnaliseeLogementOut.t = + let mode_occupation_: ModeOccupation.t = calcul_aide_personnalisee_logement_in.CalculAidePersonnaliseeLogementIn.mode_occupation_in in + let type_aide_: TypeAidesPersonnelleLogement.t = calcul_aide_personnalisee_logement_in.CalculAidePersonnaliseeLogementIn.type_aide_in in + let informations_calcul_: InformationsCalculAPL.t = calcul_aide_personnalisee_logement_in.CalculAidePersonnaliseeLogementIn.informations_calcul_in in + let ressources_menage_sans_arrondi_: money = calcul_aide_personnalisee_logement_in.CalculAidePersonnaliseeLogementIn.ressources_menage_sans_arrondi_in in + let situation_familiale_: SituationFamiliale.t = calcul_aide_personnalisee_logement_in.CalculAidePersonnaliseeLogementIn.situation_familiale_in in + let nombre_personnes_a_charge_: integer = calcul_aide_personnalisee_logement_in.CalculAidePersonnaliseeLogementIn.nombre_personnes_a_charge_in in + let zone_: ZoneDHabitation.t = calcul_aide_personnalisee_logement_in.CalculAidePersonnaliseeLogementIn.zone_in in + let date_courante_: date = calcul_aide_personnalisee_logement_in.CalculAidePersonnaliseeLogementIn.date_courante_in in + let categorie_calcul_apl_: CategorieCalculAPL.t = (log_variable_definition + ["CalculAidePersonnaliséeLogement"; "catégorie_calcul_apl"] + (embed_categorie_calcul_a_p_l) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=762; start_column=11; end_line=762; end_column=31; + law_headings=["Tous secteurs"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1416; start_column=14; end_line=1416; end_column=34; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + match mode_occupation_ + with + | ModeOccupation.Locataire _ -> (CategorieCalculAPL.Location ()) + | ModeOccupation.ResidentLogementFoyer _ -> + (CategorieCalculAPL.LogementFoyer ()) + | ModeOccupation.AccessionProprieteLocalUsageExclusifHabitation _ -> + (CategorieCalculAPL.AccessionPropriete ()) + | ModeOccupation.SousLocataire _ -> + (CategorieCalculAPL.Location ()) + | ModeOccupation.LocationAccession _ -> + (CategorieCalculAPL.AccessionPropriete ()))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=762; start_column=11; end_line=762; end_column=31; + law_headings=["Tous secteurs"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let ressources_menage_avec_arrondi_: money = (log_variable_definition + ["CalculAidePersonnaliséeLogement"; "ressources_ménage_avec_arrondi"] + (embed_money) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=756; start_column=10; end_line=756; end_column=22; + law_headings=["Tous secteurs"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=2041; start_column=14; end_line=2041; end_column=31; + law_headings=["Article D823-17"; + "Sous-section 2 : Calcul de l'aide en secteur locatif"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + (money_round + ((ressources_menage_sans_arrondi_ +$ (money_of_cents_string + "4999")) *$ (decimal_of_string "0.01"))) *$ + (decimal_of_string "100."))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=756; start_column=10; end_line=756; end_column=22; + law_headings=["Tous secteurs"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let situation_familiale_calcul_apl_: SituationFamilialeCalculAPL.t = (log_variable_definition + ["CalculAidePersonnaliséeLogement"; "situation_familiale_calcul_apl"] + (embed_situation_familiale_calcul_a_p_l) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=763; start_column=11; end_line=763; end_column=41; + law_headings=["Tous secteurs"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=71; start_column=14; end_line=71; end_column=44; + law_headings=["Article 7"; + "Chapitre III : Calcul des aides personnelles au logement en secteur locatif"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + true)) + (fun (_: _) -> + match situation_familiale_ + with + | SituationFamiliale.Celibataire _ -> + (SituationFamilialeCalculAPL.PersonneSeule ()) + | SituationFamiliale.Maries _ -> + (SituationFamilialeCalculAPL.Couple ()) + | SituationFamiliale.Pacses _ -> + (SituationFamilialeCalculAPL.Couple ()) + | SituationFamiliale.Concubins _ -> + (SituationFamilialeCalculAPL.Couple ()) + | SituationFamiliale.CelibataireSepareDeFait _ -> + (SituationFamilialeCalculAPL.PersonneSeule ()) + | SituationFamiliale.ConcubinageDontSepareDeFait _ -> + (SituationFamilialeCalculAPL.Couple ()))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=763; start_column=11; end_line=763; end_column=41; + law_headings=["Tous secteurs"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let accession_propriete_dot_mensualite_principale_: money = + try ((log_variable_definition + ["CalculAidePersonnaliséeLogement"; + "accession_propriété.mensualité_principale"] (embed_money) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=767; start_column=3; end_line=767; end_column=22; + law_headings=["Tous secteurs"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1537; start_column=14; end_line=1537; end_column=55; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + match informations_calcul_ + with + | InformationsCalculAPL.InfosLocatif _ -> (money_of_cents_string + "0") + | InformationsCalculAPL.InfosLogementFoyer _ -> + (money_of_cents_string "0") + | InformationsCalculAPL.InfosAccessionPropriete infos_ -> + (infos_.InformationsCalculAPLAccessionPropriete.mensualite_principale))))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=689; start_column=10; end_line=689; end_column=31; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let accession_propriete_dot_ressources_menage_arrondies_: money = + try ((log_variable_definition + ["CalculAidePersonnaliséeLogement"; + "accession_propriété.ressources_ménage_arrondies"] (embed_money) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=767; start_column=3; end_line=767; end_column=22; + law_headings=["Tous secteurs"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1476; start_column=14; end_line=1476; end_column=61; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) (fun (_: _) -> ressources_menage_avec_arrondi_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=690; start_column=10; end_line=690; end_column=37; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let accession_propriete_dot_nombre_personnes_a_charge_: integer = + try ((log_variable_definition + ["CalculAidePersonnaliséeLogement"; + "accession_propriété.nombre_personnes_à_charge"] (embed_integer) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=767; start_column=3; end_line=767; end_column=22; + law_headings=["Tous secteurs"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1482; start_column=14; end_line=1482; end_column=59; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) (fun (_: _) -> nombre_personnes_a_charge_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=691; start_column=10; end_line=691; end_column=35; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let accession_propriete_dot_situation_familiale_calcul_apl_: SituationFamilialeCalculAPL.t = + try ((log_variable_definition + ["CalculAidePersonnaliséeLogement"; + "accession_propriété.situation_familiale_calcul_apl"] + (embed_situation_familiale_calcul_a_p_l) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=767; start_column=3; end_line=767; end_column=22; + law_headings=["Tous secteurs"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1494; start_column=14; end_line=1494; end_column=64; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) (fun (_: _) -> situation_familiale_calcul_apl_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=692; start_column=10; end_line=692; end_column=40; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let accession_propriete_dot_type_travaux_logement_: TypeTravauxLogementD83215.t = + try ((log_variable_definition + ["CalculAidePersonnaliséeLogement"; + "accession_propriété.type_travaux_logement"] + (embed_type_travaux_logement_d832_15) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=767; start_column=3; end_line=767; end_column=22; + law_headings=["Tous secteurs"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1542; start_column=14; end_line=1542; end_column=55; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + match informations_calcul_ + with + | InformationsCalculAPL.InfosLocatif _ -> + (TypeTravauxLogementD83215.PasDeTravaux ()) + | InformationsCalculAPL.InfosLogementFoyer _ -> + (TypeTravauxLogementD83215.PasDeTravaux ()) + | InformationsCalculAPL.InfosAccessionPropriete infos_ -> + (infos_.InformationsCalculAPLAccessionPropriete.type_travaux_logement_d832_15))))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=693; start_column=10; end_line=693; end_column=31; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let accession_propriete_dot_date_signature_pret_: date = + try ((log_variable_definition + ["CalculAidePersonnaliséeLogement"; + "accession_propriété.date_signature_prêt"] (embed_date) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=767; start_column=3; end_line=767; end_column=22; + law_headings=["Tous secteurs"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1548; start_column=14; end_line=1548; end_column=53; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + match informations_calcul_ + with + | InformationsCalculAPL.InfosLocatif _ -> + (date_of_numbers (2010) (1) (1)) + | InformationsCalculAPL.InfosLogementFoyer _ -> + (date_of_numbers (2010) (1) (1)) + | InformationsCalculAPL.InfosAccessionPropriete infos_ -> + (infos_.InformationsCalculAPLAccessionPropriete.date_signature_pret))))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=694; start_column=10; end_line=694; end_column=29; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let accession_propriete_dot_local_habite_premiere_fois_beneficiaire_: bool = + try ((log_variable_definition + ["CalculAidePersonnaliséeLogement"; + "accession_propriété.local_habité_première_fois_bénéficiaire"] + (embed_bool) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=767; start_column=3; end_line=767; end_column=22; + law_headings=["Tous secteurs"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1553; start_column=14; end_line=1553; end_column=73; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + match informations_calcul_ + with + | InformationsCalculAPL.InfosLocatif _ -> false + | InformationsCalculAPL.InfosLogementFoyer _ -> false + | InformationsCalculAPL.InfosAccessionPropriete infos_ -> + (infos_.InformationsCalculAPLAccessionPropriete.local_habite_premiere_fois_beneficiaire))))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=695; start_column=10; end_line=695; end_column=49; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let accession_propriete_dot_date_entree_logement_: date = + try ((log_variable_definition + ["CalculAidePersonnaliséeLogement"; + "accession_propriété.date_entrée_logement"] (embed_date) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=767; start_column=3; end_line=767; end_column=22; + law_headings=["Tous secteurs"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1559; start_column=14; end_line=1559; end_column=54; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + match informations_calcul_ + with + | InformationsCalculAPL.InfosLocatif _ -> + (date_of_numbers (2010) (1) (1)) + | InformationsCalculAPL.InfosLogementFoyer _ -> + (date_of_numbers (2010) (1) (1)) + | InformationsCalculAPL.InfosAccessionPropriete infos_ -> + (infos_.InformationsCalculAPLAccessionPropriete.date_entree_logement))))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=696; start_column=10; end_line=696; end_column=30; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let accession_propriete_dot_copropriete_: bool = + try ((log_variable_definition + ["CalculAidePersonnaliséeLogement"; + "accession_propriété.copropriété"] (embed_bool) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=767; start_column=3; end_line=767; end_column=22; + law_headings=["Tous secteurs"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1564; start_column=14; end_line=1564; end_column=45; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + match informations_calcul_ + with + | InformationsCalculAPL.InfosLocatif _ -> false + | InformationsCalculAPL.InfosLogementFoyer _ -> false + | InformationsCalculAPL.InfosAccessionPropriete infos_ -> + (infos_.InformationsCalculAPLAccessionPropriete.copropriete))))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=697; start_column=10; end_line=697; end_column=21; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let accession_propriete_dot_situation_r822_11_13_17_: bool = + try ((log_variable_definition + ["CalculAidePersonnaliséeLogement"; + "accession_propriété.situation_r822_11_13_17"] (embed_bool) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=767; start_column=3; end_line=767; end_column=22; + law_headings=["Tous secteurs"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1569; start_column=14; end_line=1569; end_column=57; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + match informations_calcul_ + with + | InformationsCalculAPL.InfosLocatif _ -> false + | InformationsCalculAPL.InfosLogementFoyer _ -> false + | InformationsCalculAPL.InfosAccessionPropriete infos_ -> + (infos_.InformationsCalculAPLAccessionPropriete.situation_r822_11_13_17))))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=698; start_column=10; end_line=698; end_column=33; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let accession_propriete_dot_zone_: ZoneDHabitation.t = + try ((log_variable_definition + ["CalculAidePersonnaliséeLogement"; "accession_propriété.zone"] + (embed_zone_d_habitation) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=767; start_column=3; end_line=767; end_column=22; + law_headings=["Tous secteurs"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1486; start_column=14; end_line=1486; end_column=38; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) (fun (_: _) -> zone_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=699; start_column=10; end_line=699; end_column=14; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let accession_propriete_dot_type_pret_: TypePret.t = + try ((log_variable_definition + ["CalculAidePersonnaliséeLogement"; + "accession_propriété.type_prêt"] (embed_type_pret) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=767; start_column=3; end_line=767; end_column=22; + law_headings=["Tous secteurs"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1574; start_column=14; end_line=1574; end_column=43; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + match informations_calcul_ + with + | InformationsCalculAPL.InfosLocatif _ -> (TypePret.D331_32 ()) + | InformationsCalculAPL.InfosLogementFoyer _ -> + (TypePret.D331_32 ()) + | InformationsCalculAPL.InfosAccessionPropriete infos_ -> + (infos_.InformationsCalculAPLAccessionPropriete.type_pret))))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=700; start_column=10; end_line=700; end_column=19; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let accession_propriete_dot_anciennete_logement_: NeufOuAncien.t = + try ((log_variable_definition + ["CalculAidePersonnaliséeLogement"; + "accession_propriété.ancienneté_logement"] (embed_neuf_ou_ancien) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=767; start_column=3; end_line=767; end_column=22; + law_headings=["Tous secteurs"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1580; start_column=14; end_line=1580; end_column=53; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + match informations_calcul_ + with + | InformationsCalculAPL.InfosLocatif _ -> (NeufOuAncien.Neuf ()) + | InformationsCalculAPL.InfosLogementFoyer _ -> + (NeufOuAncien.Neuf ()) + | InformationsCalculAPL.InfosAccessionPropriete infos_ -> + (infos_.InformationsCalculAPLAccessionPropriete.anciennete_logement))))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=701; start_column=10; end_line=701; end_column=29; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let accession_propriete_dot_date_courante_: date = + try ((log_variable_definition + ["CalculAidePersonnaliséeLogement"; + "accession_propriété.date_courante"] (embed_date) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=767; start_column=3; end_line=767; end_column=22; + law_headings=["Tous secteurs"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1489; start_column=14; end_line=1489; end_column=47; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) (fun (_: _) -> date_courante_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=702; start_column=10; end_line=702; end_column=23; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let result_: CalculAidePersonnaliseeLogementAccessionProprieteOut.t = (log_end_call + ["CalculAidePersonnaliséeLogement"; "accession_propriété"; + "CalculAidePersonnaliséeLogementAccessionPropriété"] + ((log_begin_call + ["CalculAidePersonnaliséeLogement"; "accession_propriété"; + "CalculAidePersonnaliséeLogementAccessionPropriété"] + calcul_aide_personnalisee_logement_accession_propriete) + {CalculAidePersonnaliseeLogementAccessionProprieteIn.mensualite_principale_in = + accession_propriete_dot_mensualite_principale_; + CalculAidePersonnaliseeLogementAccessionProprieteIn.ressources_menage_arrondies_in = + accession_propriete_dot_ressources_menage_arrondies_; + CalculAidePersonnaliseeLogementAccessionProprieteIn.nombre_personnes_a_charge_in = + accession_propriete_dot_nombre_personnes_a_charge_; + CalculAidePersonnaliseeLogementAccessionProprieteIn.situation_familiale_calcul_apl_in = + accession_propriete_dot_situation_familiale_calcul_apl_; + CalculAidePersonnaliseeLogementAccessionProprieteIn.type_travaux_logement_in = + accession_propriete_dot_type_travaux_logement_; + CalculAidePersonnaliseeLogementAccessionProprieteIn.date_signature_pret_in = + accession_propriete_dot_date_signature_pret_; + CalculAidePersonnaliseeLogementAccessionProprieteIn.local_habite_premiere_fois_beneficiaire_in = + accession_propriete_dot_local_habite_premiere_fois_beneficiaire_; + CalculAidePersonnaliseeLogementAccessionProprieteIn.date_entree_logement_in = + accession_propriete_dot_date_entree_logement_; + CalculAidePersonnaliseeLogementAccessionProprieteIn.copropriete_in = + accession_propriete_dot_copropriete_; + CalculAidePersonnaliseeLogementAccessionProprieteIn.situation_r822_11_13_17_in = + accession_propriete_dot_situation_r822_11_13_17_; + CalculAidePersonnaliseeLogementAccessionProprieteIn.zone_in = + accession_propriete_dot_zone_; + CalculAidePersonnaliseeLogementAccessionProprieteIn.type_pret_in = + accession_propriete_dot_type_pret_; + CalculAidePersonnaliseeLogementAccessionProprieteIn.anciennete_logement_in = + accession_propriete_dot_anciennete_logement_; + CalculAidePersonnaliseeLogementAccessionProprieteIn.date_courante_in = + accession_propriete_dot_date_courante_})) in + let accession_propriete_dot_mensualite_eligible_: money = result_.CalculAidePersonnaliseeLogementAccessionProprieteOut.mensualite_eligible_out in + let accession_propriete_dot_mensualite_minimale_: money = result_.CalculAidePersonnaliseeLogementAccessionProprieteOut.mensualite_minimale_out in + let accession_propriete_dot_coefficient_prise_en_charge_d832_10_seuil_: decimal = result_.CalculAidePersonnaliseeLogementAccessionProprieteOut.coefficient_prise_en_charge_d832_10_seuil_out in + let accession_propriete_dot_aide_finale_formule_: money = result_.CalculAidePersonnaliseeLogementAccessionProprieteOut.aide_finale_formule_out in + let accession_propriete_dot_traitement_aide_finale_montant_minimal_: + money -> money = result_.CalculAidePersonnaliseeLogementAccessionProprieteOut.traitement_aide_finale_montant_minimal_out in + let logement_foyer_dot_mode_occupation_: ModeOccupation.t = + try ((log_variable_definition + ["CalculAidePersonnaliséeLogement"; "logement_foyer.mode_occupation"] + (embed_mode_occupation) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=766; start_column=3; end_line=766; end_column=17; + law_headings=["Tous secteurs"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1496; start_column=14; end_line=1496; end_column=44; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) (fun (_: _) -> mode_occupation_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=632; start_column=10; end_line=632; end_column=25; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let logement_foyer_dot_ressources_menage_arrondies_: money = + try ((log_variable_definition + ["CalculAidePersonnaliséeLogement"; + "logement_foyer.ressources_ménage_arrondies"] (embed_money) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=766; start_column=3; end_line=766; end_column=17; + law_headings=["Tous secteurs"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1474; start_column=14; end_line=1474; end_column=56; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) (fun (_: _) -> ressources_menage_avec_arrondi_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=633; start_column=10; end_line=633; end_column=37; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let logement_foyer_dot_nombre_personnes_a_charge_: integer = + try ((log_variable_definition + ["CalculAidePersonnaliséeLogement"; + "logement_foyer.nombre_personnes_à_charge"] (embed_integer) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=766; start_column=3; end_line=766; end_column=17; + law_headings=["Tous secteurs"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1480; start_column=14; end_line=1480; end_column=54; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) (fun (_: _) -> nombre_personnes_a_charge_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=634; start_column=10; end_line=634; end_column=35; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let logement_foyer_dot_situation_familiale_calcul_apl_: SituationFamilialeCalculAPL.t = + try ((log_variable_definition + ["CalculAidePersonnaliséeLogement"; + "logement_foyer.situation_familiale_calcul_apl"] + (embed_situation_familiale_calcul_a_p_l) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=766; start_column=3; end_line=766; end_column=17; + law_headings=["Tous secteurs"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1492; start_column=14; end_line=1492; end_column=59; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) (fun (_: _) -> situation_familiale_calcul_apl_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=635; start_column=10; end_line=635; end_column=40; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let logement_foyer_dot_zone_: ZoneDHabitation.t = + try ((log_variable_definition + ["CalculAidePersonnaliséeLogement"; "logement_foyer.zone"] + (embed_zone_d_habitation) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=766; start_column=3; end_line=766; end_column=17; + law_headings=["Tous secteurs"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1485; start_column=14; end_line=1485; end_column=33; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) (fun (_: _) -> zone_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=636; start_column=10; end_line=636; end_column=14; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let logement_foyer_dot_date_courante_: date = + try ((log_variable_definition + ["CalculAidePersonnaliséeLogement"; "logement_foyer.date_courante"] + (embed_date) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=766; start_column=3; end_line=766; end_column=17; + law_headings=["Tous secteurs"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1488; start_column=14; end_line=1488; end_column=42; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) (fun (_: _) -> date_courante_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=637; start_column=10; end_line=637; end_column=23; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let logement_foyer_dot_redevance_: money = + try ((log_variable_definition + ["CalculAidePersonnaliséeLogement"; "logement_foyer.redevance"] + (embed_money) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=766; start_column=3; end_line=766; end_column=17; + law_headings=["Tous secteurs"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1587; start_column=14; end_line=1587; end_column=38; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + match informations_calcul_ + with + | InformationsCalculAPL.InfosLocatif _ -> (money_of_cents_string + "0") + | InformationsCalculAPL.InfosLogementFoyer infos_ -> + (infos_.InformationsCalculAPLLogementFoyer.redevance) + | InformationsCalculAPL.InfosAccessionPropriete _ -> + (money_of_cents_string "0"))))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=638; start_column=10; end_line=638; end_column=19; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let logement_foyer_dot_condition_2_du_832_25_: unit -> bool = fun + (_: unit) -> + (log_variable_definition + ["CalculAidePersonnaliséeLogement"; + "logement_foyer.condition_2_du_832_25"] + (embed_bool) + (raise + EmptyError)) in + let logement_foyer_dot_n_nombre_parts_d832_25_: unit -> decimal = fun + (_: unit) -> + (log_variable_definition + ["CalculAidePersonnaliséeLogement"; + "logement_foyer.n_nombre_parts_d832_25"] + (embed_decimal) + (raise + EmptyError)) in + let result_: CalculAidePersonnaliseeLogementFoyerOut.t = (log_end_call + ["CalculAidePersonnaliséeLogement"; "logement_foyer"; + "CalculAidePersonnaliséeLogementFoyer"] ((log_begin_call + ["CalculAidePersonnaliséeLogement"; "logement_foyer"; + "CalculAidePersonnaliséeLogementFoyer"] + calcul_aide_personnalisee_logement_foyer) + {CalculAidePersonnaliseeLogementFoyerIn.mode_occupation_in = + logement_foyer_dot_mode_occupation_; + CalculAidePersonnaliseeLogementFoyerIn.ressources_menage_arrondies_in = + logement_foyer_dot_ressources_menage_arrondies_; + CalculAidePersonnaliseeLogementFoyerIn.nombre_personnes_a_charge_in = + logement_foyer_dot_nombre_personnes_a_charge_; + CalculAidePersonnaliseeLogementFoyerIn.situation_familiale_calcul_apl_in = + logement_foyer_dot_situation_familiale_calcul_apl_; + CalculAidePersonnaliseeLogementFoyerIn.zone_in = + logement_foyer_dot_zone_; + CalculAidePersonnaliseeLogementFoyerIn.date_courante_in = + logement_foyer_dot_date_courante_; + CalculAidePersonnaliseeLogementFoyerIn.redevance_in = + logement_foyer_dot_redevance_; + CalculAidePersonnaliseeLogementFoyerIn.condition_2_du_832_25_in = + logement_foyer_dot_condition_2_du_832_25_; + CalculAidePersonnaliseeLogementFoyerIn.n_nombre_parts_d832_25_in = + logement_foyer_dot_n_nombre_parts_d832_25_})) in + let logement_foyer_dot_coefficient_multiplicateur_d832_25_: money = result_.CalculAidePersonnaliseeLogementFoyerOut.coefficient_multiplicateur_d832_25_out in + let logement_foyer_dot_coefficient_r_d832_25_: money = result_.CalculAidePersonnaliseeLogementFoyerOut.coefficient_r_d832_25_out in + let logement_foyer_dot_n_nombre_parts_d832_25_: decimal = result_.CalculAidePersonnaliseeLogementFoyerOut.n_nombre_parts_d832_25_out in + let logement_foyer_dot_equivalence_loyer_eligible_: money = result_.CalculAidePersonnaliseeLogementFoyerOut.equivalence_loyer_eligible_out in + let logement_foyer_dot_plafond_equivalence_loyer_eligible_: money = result_.CalculAidePersonnaliseeLogementFoyerOut.plafond_equivalence_loyer_eligible_out in + let logement_foyer_dot_equivalence_loyer_minimale_: money = result_.CalculAidePersonnaliseeLogementFoyerOut.equivalence_loyer_minimale_out in + let logement_foyer_dot_coefficient_prise_en_charge_d832_25_seuil_: decimal = result_.CalculAidePersonnaliseeLogementFoyerOut.coefficient_prise_en_charge_d832_25_seuil_out in + let logement_foyer_dot_aide_finale_formule_: money = result_.CalculAidePersonnaliseeLogementFoyerOut.aide_finale_formule_out in + let logement_foyer_dot_traitement_aide_finale_montant_minimal_: money -> + money = result_.CalculAidePersonnaliseeLogementFoyerOut.traitement_aide_finale_montant_minimal_out in + let locatif_dot_loyer_principal_: money = + try ((log_variable_definition + ["CalculAidePersonnaliséeLogement"; "locatif.loyer_principal"] + (embed_money) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=765; start_column=3; end_line=765; end_column=10; + law_headings=["Tous secteurs"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1499; start_column=14; end_line=1499; end_column=37; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + match informations_calcul_ + with + | InformationsCalculAPL.InfosLocatif infos_ -> + (infos_.InformationsCalculAPLLocatif.loyer_principal) + | InformationsCalculAPL.InfosLogementFoyer _ -> + (money_of_cents_string "0") + | InformationsCalculAPL.InfosAccessionPropriete _ -> + (money_of_cents_string "0"))))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=558; start_column=10; end_line=558; end_column=25; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let locatif_dot_ressources_menage_arrondies_: money = + try ((log_variable_definition + ["CalculAidePersonnaliséeLogement"; + "locatif.ressources_ménage_arrondies"] (embed_money) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=765; start_column=3; end_line=765; end_column=10; + law_headings=["Tous secteurs"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1473; start_column=14; end_line=1473; end_column=49; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) (fun (_: _) -> ressources_menage_avec_arrondi_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=559; start_column=10; end_line=559; end_column=37; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let locatif_dot_beneficiaire_aide_adulte_ou_enfant_handicapes_: bool = + try ((log_variable_definition + ["CalculAidePersonnaliséeLogement"; + "locatif.bénéficiaire_aide_adulte_ou_enfant_handicapés"] + (embed_bool) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=765; start_column=3; end_line=765; end_column=10; + law_headings=["Tous secteurs"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1504; start_column=14; end_line=1504; end_column=67; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + match informations_calcul_ + with + | InformationsCalculAPL.InfosLocatif infos_ -> + (infos_.InformationsCalculAPLLocatif.beneficiaire_aide_adulte_ou_enfant_handicapes) + | InformationsCalculAPL.InfosLogementFoyer _ -> false + | InformationsCalculAPL.InfosAccessionPropriete _ -> false)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=560; start_column=10; end_line=560; end_column=55; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let locatif_dot_date_courante_: date = + try ((log_variable_definition + ["CalculAidePersonnaliséeLogement"; "locatif.date_courante"] + (embed_date) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=765; start_column=3; end_line=765; end_column=10; + law_headings=["Tous secteurs"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1487; start_column=14; end_line=1487; end_column=35; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) (fun (_: _) -> date_courante_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=562; start_column=10; end_line=562; end_column=23; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let locatif_dot_nombre_personnes_a_charge_: integer = + try ((log_variable_definition + ["CalculAidePersonnaliséeLogement"; + "locatif.nombre_personnes_à_charge"] (embed_integer) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=765; start_column=3; end_line=765; end_column=10; + law_headings=["Tous secteurs"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1478; start_column=14; end_line=1478; end_column=47; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) (fun (_: _) -> nombre_personnes_a_charge_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=563; start_column=10; end_line=563; end_column=35; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let locatif_dot_situation_familiale_calcul_apl_: SituationFamilialeCalculAPL.t = + try ((log_variable_definition + ["CalculAidePersonnaliséeLogement"; + "locatif.situation_familiale_calcul_apl"] + (embed_situation_familiale_calcul_a_p_l) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=765; start_column=3; end_line=765; end_column=10; + law_headings=["Tous secteurs"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1490; start_column=14; end_line=1490; end_column=52; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) (fun (_: _) -> situation_familiale_calcul_apl_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=564; start_column=10; end_line=564; end_column=40; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let locatif_dot_zone_: ZoneDHabitation.t = + try ((log_variable_definition + ["CalculAidePersonnaliséeLogement"; "locatif.zone"] + (embed_zone_d_habitation) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=765; start_column=3; end_line=765; end_column=10; + law_headings=["Tous secteurs"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1484; start_column=14; end_line=1484; end_column=26; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) (fun (_: _) -> zone_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=565; start_column=10; end_line=565; end_column=14; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let locatif_dot_logement_est_chambre_: bool = + try ((log_variable_definition + ["CalculAidePersonnaliséeLogement"; "locatif.logement_est_chambre"] + (embed_bool) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=765; start_column=3; end_line=765; end_column=10; + law_headings=["Tous secteurs"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1510; start_column=14; end_line=1510; end_column=42; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + match informations_calcul_ + with + | InformationsCalculAPL.InfosLocatif infos_ -> + (infos_.InformationsCalculAPLLocatif.logement_est_chambre) + | InformationsCalculAPL.InfosLogementFoyer _ -> false + | InformationsCalculAPL.InfosAccessionPropriete _ -> false)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=566; start_column=10; end_line=566; end_column=30; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let locatif_dot_agees_ou_handicap_adultes_hebergees_onereux_particuliers_: bool = + try ((log_variable_definition + ["CalculAidePersonnaliséeLogement"; + "locatif.âgées_ou_handicap_adultes_hébergées_onéreux_particuliers"] + (embed_bool) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=765; start_column=3; end_line=765; end_column=10; + law_headings=["Tous secteurs"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1523; start_column=5; end_line=1523; end_column=69; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + match informations_calcul_ + with + | InformationsCalculAPL.InfosLocatif infos_ -> + (infos_.InformationsCalculAPLLocatif.agees_ou_handicap_adultes_hebergees_onereux_particuliers) + | InformationsCalculAPL.InfosLogementFoyer _ -> false + | InformationsCalculAPL.InfosAccessionPropriete _ -> false)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=567; start_column=10; end_line=567; end_column=66; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let locatif_dot_type_aide_: TypeAidesPersonnelleLogement.t = + try ((log_variable_definition + ["CalculAidePersonnaliséeLogement"; "locatif.type_aide"] + (embed_type_aides_personnelle_logement) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=765; start_column=3; end_line=765; end_column=10; + law_headings=["Tous secteurs"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1530; start_column=14; end_line=1530; end_column=31; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) (fun (_: _) -> type_aide_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=569; start_column=10; end_line=569; end_column=19; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let locatif_dot_colocation_: bool = + try ((log_variable_definition + ["CalculAidePersonnaliséeLogement"; "locatif.colocation"] (embed_bool) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=765; start_column=3; end_line=765; end_column=10; + law_headings=["Tous secteurs"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1516; start_column=14; end_line=1516; end_column=32; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + match informations_calcul_ + with + | InformationsCalculAPL.InfosLocatif infos_ -> + (infos_.InformationsCalculAPLLocatif.colocation) + | InformationsCalculAPL.InfosLogementFoyer _ -> false + | InformationsCalculAPL.InfosAccessionPropriete _ -> false)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=570; start_column=10; end_line=570; end_column=20; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let locatif_dot_reduction_loyer_solidarite_: money = + try ((log_variable_definition + ["CalculAidePersonnaliséeLogement"; + "locatif.réduction_loyer_solidarité"] (embed_money) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=765; start_column=3; end_line=765; end_column=10; + law_headings=["Tous secteurs"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1531; start_column=14; end_line=1531; end_column=48; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + match informations_calcul_ + with + | InformationsCalculAPL.InfosLocatif infos_ -> + (infos_.InformationsCalculAPLLocatif.reduction_loyer_solidarite) + | InformationsCalculAPL.InfosLogementFoyer _ -> + (money_of_cents_string "0") + | InformationsCalculAPL.InfosAccessionPropriete _ -> + (money_of_cents_string "0"))))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=571; start_column=10; end_line=571; end_column=36; + law_headings=["Secteur locatif"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let result_: CalculAidePersonnaliseeLogementLocatifOut.t = (log_end_call + ["CalculAidePersonnaliséeLogement"; "locatif"; + "CalculAidePersonnaliséeLogementLocatif"] ((log_begin_call + ["CalculAidePersonnaliséeLogement"; "locatif"; + "CalculAidePersonnaliséeLogementLocatif"] + calcul_aide_personnalisee_logement_locatif) + {CalculAidePersonnaliseeLogementLocatifIn.loyer_principal_in = + locatif_dot_loyer_principal_; + CalculAidePersonnaliseeLogementLocatifIn.ressources_menage_arrondies_in = + locatif_dot_ressources_menage_arrondies_; + CalculAidePersonnaliseeLogementLocatifIn.beneficiaire_aide_adulte_ou_enfant_handicapes_in = + locatif_dot_beneficiaire_aide_adulte_ou_enfant_handicapes_; + CalculAidePersonnaliseeLogementLocatifIn.date_courante_in = + locatif_dot_date_courante_; + CalculAidePersonnaliseeLogementLocatifIn.nombre_personnes_a_charge_in = + locatif_dot_nombre_personnes_a_charge_; + CalculAidePersonnaliseeLogementLocatifIn.situation_familiale_calcul_apl_in = + locatif_dot_situation_familiale_calcul_apl_; + CalculAidePersonnaliseeLogementLocatifIn.zone_in = locatif_dot_zone_; + CalculAidePersonnaliseeLogementLocatifIn.logement_est_chambre_in = + locatif_dot_logement_est_chambre_; + CalculAidePersonnaliseeLogementLocatifIn.agees_ou_handicap_adultes_hebergees_onereux_particuliers_in = + locatif_dot_agees_ou_handicap_adultes_hebergees_onereux_particuliers_; + CalculAidePersonnaliseeLogementLocatifIn.type_aide_in = + locatif_dot_type_aide_; + CalculAidePersonnaliseeLogementLocatifIn.colocation_in = + locatif_dot_colocation_; + CalculAidePersonnaliseeLogementLocatifIn.reduction_loyer_solidarite_in = + locatif_dot_reduction_loyer_solidarite_})) in + let locatif_dot_montant_forfaitaire_charges_d823_16_: money = result_.CalculAidePersonnaliseeLogementLocatifOut.montant_forfaitaire_charges_d823_16_out in + let locatif_dot_plafond_loyer_d823_16_2_: money = result_.CalculAidePersonnaliseeLogementLocatifOut.plafond_loyer_d823_16_2_out in + let locatif_dot_participation_minimale_: money = result_.CalculAidePersonnaliseeLogementLocatifOut.participation_minimale_out in + let locatif_dot_taux_composition_familiale_: decimal = result_.CalculAidePersonnaliseeLogementLocatifOut.taux_composition_familiale_out in + let locatif_dot_participation_personnelle_: money = result_.CalculAidePersonnaliseeLogementLocatifOut.participation_personnelle_out in + let locatif_dot_aide_finale_formule_: money = result_.CalculAidePersonnaliseeLogementLocatifOut.aide_finale_formule_out in + let locatif_dot_traitement_aide_finale_montant_minimal_: money -> money = result_.CalculAidePersonnaliseeLogementLocatifOut.traitement_aide_finale_montant_minimal_out in + let traitement_aide_finale_: money -> money = (log_variable_definition + ["CalculAidePersonnaliséeLogement"; "traitement_aide_finale"] + (unembeddable) ( + try + (fun (param_: money) -> + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=771; start_column=10; end_line=771; end_column=32; + law_headings=["Tous secteurs"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1429; start_column=14; + end_line=1429; end_column=36; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + match categorie_calcul_apl_ + with + | CategorieCalculAPL.Location _ -> ((log_end_call + ["CalculAidePersonnaliséeLogementLocatif"; + "traitement_aide_finale_montant_minimal"] + ((log_variable_definition + ["CalculAidePersonnaliséeLogementLocatif"; + "traitement_aide_finale_montant_minimal"; "output"] + (embed_money) ((log_begin_call + ["CalculAidePersonnaliséeLogementLocatif"; + "traitement_aide_finale_montant_minimal"] + locatif_dot_traitement_aide_finale_montant_minimal_) + ((log_variable_definition + ["CalculAidePersonnaliséeLogementLocatif"; + "traitement_aide_finale_montant_minimal"; "input"] + (embed_money) param_))))))) + | CategorieCalculAPL.AccessionPropriete _ -> ((log_end_call + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "traitement_aide_finale_montant_minimal"] + ((log_variable_definition + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "traitement_aide_finale_montant_minimal"; "output"] + (embed_money) ((log_begin_call + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "traitement_aide_finale_montant_minimal"] + accession_propriete_dot_traitement_aide_finale_montant_minimal_) + ((log_variable_definition + ["CalculAidePersonnaliséeLogementAccessionPropriété"; + "traitement_aide_finale_montant_minimal"; "input"] + (embed_money) param_))))))) + | CategorieCalculAPL.LogementFoyer _ -> ((log_end_call + ["CalculAidePersonnaliséeLogementFoyer"; + "traitement_aide_finale_montant_minimal"] + ((log_variable_definition + ["CalculAidePersonnaliséeLogementFoyer"; + "traitement_aide_finale_montant_minimal"; "output"] + (embed_money) ((log_begin_call + ["CalculAidePersonnaliséeLogementFoyer"; + "traitement_aide_finale_montant_minimal"] + logement_foyer_dot_traitement_aide_finale_montant_minimal_) + ((log_variable_definition + ["CalculAidePersonnaliséeLogementFoyer"; + "traitement_aide_finale_montant_minimal"; "input"] + (embed_money) param_))))))))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=771; start_column=10; end_line=771; end_column=32; + law_headings=["Tous secteurs"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]}))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=771; start_column=10; end_line=771; end_column=32; + law_headings=["Tous secteurs"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let aide_finale_formule_: money = (log_variable_definition + ["CalculAidePersonnaliséeLogement"; "aide_finale_formule"] (embed_money) + ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=770; start_column=10; end_line=770; end_column=29; + law_headings=["Tous secteurs"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1424; start_column=14; end_line=1424; end_column=33; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + match categorie_calcul_apl_ + with + | CategorieCalculAPL.Location _ -> + locatif_dot_aide_finale_formule_ + | CategorieCalculAPL.AccessionPropriete _ -> + accession_propriete_dot_aide_finale_formule_ + | CategorieCalculAPL.LogementFoyer _ -> + logement_foyer_dot_aide_finale_formule_)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=770; start_column=10; end_line=770; end_column=29; + law_headings=["Tous secteurs"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let _: unit = if ( + try + ( if + (match categorie_calcul_apl_ + with + | CategorieCalculAPL.Location _ -> false + | CategorieCalculAPL.AccessionPropriete _ -> true + | CategorieCalculAPL.LogementFoyer _ -> false) then + (match informations_calcul_ + with + | InformationsCalculAPL.InfosLocatif _ -> false + | InformationsCalculAPL.InfosLogementFoyer _ -> false + | InformationsCalculAPL.InfosAccessionPropriete _ -> + true) else true) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1469; start_column=5; + end_line=1471; end_column=15; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]}))) + then () else + raise (AssertionFailed {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1469; start_column=5; + end_line=1471; end_column=15; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]}) in + let _: unit = if ( + try + ( if + (match categorie_calcul_apl_ + with + | CategorieCalculAPL.Location _ -> false + | CategorieCalculAPL.AccessionPropriete _ -> false + | CategorieCalculAPL.LogementFoyer _ -> true) then + (match informations_calcul_ + with + | InformationsCalculAPL.InfosLocatif _ -> false + | InformationsCalculAPL.InfosLogementFoyer _ -> true + | InformationsCalculAPL.InfosAccessionPropriete _ -> + false) else true) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1465; start_column=5; + end_line=1467; end_column=15; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]}))) + then () else + raise (AssertionFailed {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1465; start_column=5; + end_line=1467; end_column=15; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]}) in + let _: unit = if ( + try + ( if + (match categorie_calcul_apl_ + with + | CategorieCalculAPL.Location _ -> true + | CategorieCalculAPL.AccessionPropriete _ -> false + | CategorieCalculAPL.LogementFoyer _ -> false) then + (match informations_calcul_ + with + | InformationsCalculAPL.InfosLocatif _ -> true + | InformationsCalculAPL.InfosLogementFoyer _ -> false + | InformationsCalculAPL.InfosAccessionPropriete _ -> + false) else true) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1461; start_column=5; + end_line=1463; end_column=15; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]}))) + then () else + raise (AssertionFailed {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1461; start_column=5; + end_line=1463; end_column=15; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]}) in + {CalculAidePersonnaliseeLogementOut.aide_finale_formule_out = + aide_finale_formule_; + CalculAidePersonnaliseeLogementOut.traitement_aide_finale_out = + traitement_aide_finale_} + +let eligibilite_prime_de_demenagement (eligibilite_prime_de_demenagement_in: EligibilitePrimeDeDemenagementIn.t) : EligibilitePrimeDeDemenagementOut.t = + let date_emmenagement_: date = eligibilite_prime_de_demenagement_in.EligibilitePrimeDeDemenagementIn.date_emmenagement_in in + let menage_: Menage.t = eligibilite_prime_de_demenagement_in.EligibilitePrimeDeDemenagementIn.menage_in in + let demandeur_: Demandeur.t = eligibilite_prime_de_demenagement_in.EligibilitePrimeDeDemenagementIn.demandeur_in in + let date_courante_: date = eligibilite_prime_de_demenagement_in.EligibilitePrimeDeDemenagementIn.date_courante_in in + let depenses_justifiees_reellement_engagees_: money = eligibilite_prime_de_demenagement_in.EligibilitePrimeDeDemenagementIn.depenses_justifiees_reellement_engagees_in in + let delai_apres_emmenagement_l823_8_2_: duration = (log_variable_definition + ["ÉligibilitéPrimeDeDéménagement"; + "délai_après_emménagement_l823_8_2"] (embed_duration) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=486; start_column=11; end_line=486; end_column=44; + law_headings=["Éligibilité à la prime de déménagement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=2148; start_column=14; end_line=2148; end_column=47; + law_headings=["Article D823-20"; + "Section 2 : Prime de déménagement"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) (fun (_: _) -> duration_of_numbers (0) (6) (0))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=486; start_column=11; end_line=486; end_column=44; + law_headings=["Éligibilité à la prime de déménagement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let condition_rang_enfant_: bool = (log_variable_definition + ["ÉligibilitéPrimeDeDéménagement"; "condition_rang_enfant"] + (embed_bool) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=483; start_column=11; end_line=483; end_column=32; + law_headings=["Éligibilité à la prime de déménagement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=483; start_column=11; + end_line=483; end_column=32; + law_headings=["Éligibilité à la prime de déménagement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=2127; start_column=5; + end_line=2132; end_column=71; + law_headings=["Article D823-20"; + "Section 2 : Prime de déménagement"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + (((Array.fold_left + (fun (acc_: integer) (personne_a_charge_: _) -> + if + (match personne_a_charge_ + with + | PersonneACharge.EnfantACharge _ -> true + | PersonneACharge.AutrePersonneACharge _ -> + false) then + (acc_ +! (integer_of_string "1")) else + acc_) (integer_of_string "0") + (menage_.Menage.personnes_a_charge)) +! + (menage_.Menage.nombre_enfants_a_naitre_apres_troisieme_mois_grossesse)) + >=! (integer_of_string "3")))) (fun (_: _) -> true))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=483; start_column=11; end_line=483; end_column=32; + law_headings=["Éligibilité à la prime de déménagement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> false)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=483; start_column=11; end_line=483; end_column=32; + law_headings=["Éligibilité à la prime de déménagement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let base_mensuelle_allocations_familiales_dot_date_courante_: date = + try ((log_variable_definition + ["ÉligibilitéPrimeDeDéménagement"; + "base_mensuelle_allocations_familiales.date_courante"] (embed_date) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=490; start_column=3; end_line=490; end_column=40; + law_headings=["Éligibilité à la prime de déménagement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=500; start_column=14; end_line=500; end_column=65; + law_headings=["Éligibilité à la prime de déménagement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> date_courante_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/../base_mensuelle_allocations_familiales/bmaf.catala_fr"; + start_line=5; start_column=10; end_line=5; end_column=23; + law_headings=["Montant de la base mensuelle des allocations familiales"]})) in + let result_: BaseMensuelleAllocationsFamilialesOut.t = (log_end_call + ["ÉligibilitéPrimeDeDéménagement"; + "base_mensuelle_allocations_familiales"; + "BaseMensuelleAllocationsFamiliales"] ((log_begin_call + ["ÉligibilitéPrimeDeDéménagement"; + "base_mensuelle_allocations_familiales"; + "BaseMensuelleAllocationsFamiliales"] + base_mensuelle_allocations_familiales) + {BaseMensuelleAllocationsFamilialesIn.date_courante_in = + base_mensuelle_allocations_familiales_dot_date_courante_})) in + let base_mensuelle_allocations_familiales_dot_montant_: money = result_.BaseMensuelleAllocationsFamilialesOut.montant_out in + let eligibilite_apl_dot_menage_: Menage.t = + try ((log_variable_definition + ["ÉligibilitéPrimeDeDéménagement"; "éligibilité_apl.ménage"] + (embed_menage) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=489; start_column=3; end_line=489; end_column=18; + law_headings=["Éligibilité à la prime de déménagement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=496; start_column=14; end_line=496; end_column=36; + law_headings=["Éligibilité à la prime de déménagement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> menage_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=311; start_column=10; end_line=311; end_column=16; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let eligibilite_apl_dot_demandeur_: Demandeur.t = + try ((log_variable_definition + ["ÉligibilitéPrimeDeDéménagement"; "éligibilité_apl.demandeur"] + (embed_demandeur) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=489; start_column=3; end_line=489; end_column=18; + law_headings=["Éligibilité à la prime de déménagement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=497; start_column=14; end_line=497; end_column=39; + law_headings=["Éligibilité à la prime de déménagement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> demandeur_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=312; start_column=10; end_line=312; end_column=19; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let eligibilite_apl_dot_date_courante_: date = + try ((log_variable_definition + ["ÉligibilitéPrimeDeDéménagement"; + "éligibilité_apl.date_courante"] (embed_date) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=489; start_column=3; end_line=489; end_column=18; + law_headings=["Éligibilité à la prime de déménagement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=498; start_column=14; end_line=498; end_column=43; + law_headings=["Éligibilité à la prime de déménagement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> date_courante_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=313; start_column=17; end_line=313; end_column=30; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let eligibilite_apl_dot_condition_logement_residence_principale_: unit -> + bool = + fun (_: unit) -> (log_variable_definition + ["ÉligibilitéPrimeDeDéménagement"; + "éligibilité_apl.condition_logement_résidence_principale"] + (embed_bool) (raise EmptyError)) in + let eligibilite_apl_dot_condition_logement_surface_: unit -> bool = + fun (_: unit) -> (log_variable_definition + ["ÉligibilitéPrimeDeDéménagement"; + "éligibilité_apl.condition_logement_surface"] (embed_bool) (raise + EmptyError)) in + let result_: EligibiliteAidesPersonnelleLogementOut.t = (log_end_call + ["ÉligibilitéPrimeDeDéménagement"; "éligibilité_apl"; + "ÉligibilitéAidesPersonnelleLogement"] ((log_begin_call + ["ÉligibilitéPrimeDeDéménagement"; "éligibilité_apl"; + "ÉligibilitéAidesPersonnelleLogement"] + eligibilite_aides_personnelle_logement) + {EligibiliteAidesPersonnelleLogementIn.menage_in = + eligibilite_apl_dot_menage_; + EligibiliteAidesPersonnelleLogementIn.demandeur_in = + eligibilite_apl_dot_demandeur_; + EligibiliteAidesPersonnelleLogementIn.date_courante_in = + eligibilite_apl_dot_date_courante_; + EligibiliteAidesPersonnelleLogementIn.condition_logement_residence_principale_in = + eligibilite_apl_dot_condition_logement_residence_principale_; + EligibiliteAidesPersonnelleLogementIn.condition_logement_surface_in = + eligibilite_apl_dot_condition_logement_surface_})) in + let eligibilite_apl_dot_date_courante_: date = result_.EligibiliteAidesPersonnelleLogementOut.date_courante_out in + let eligibilite_apl_dot_eligibilite_: bool = result_.EligibiliteAidesPersonnelleLogementOut.eligibilite_out in + let eligibilite_apl_dot_nombre_personnes_a_charge_prises_en_compte_: integer = result_.EligibiliteAidesPersonnelleLogementOut.nombre_personnes_a_charge_prises_en_compte_out in + let eligibilite_apl_dot_coefficents_enfants_garde_alternee_pris_en_compte_: + decimal array = result_.EligibiliteAidesPersonnelleLogementOut.coefficents_enfants_garde_alternee_pris_en_compte_out in + let eligibilite_apl_dot_condition_2_r823_4_: PersonneACharge.t -> bool = result_.EligibiliteAidesPersonnelleLogementOut.condition_2_r823_4_out in + let condition_periode_demenagement_: bool = (log_variable_definition + ["ÉligibilitéPrimeDeDéménagement"; + "condition_période_déménagement"] (embed_bool) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=484; start_column=11; end_line=484; end_column=41; + law_headings=["Éligibilité à la prime de déménagement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=484; start_column=11; + end_line=484; end_column=41; + law_headings=["Éligibilité à la prime de déménagement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=2136; start_column=6; + end_line=2144; end_column=77; + law_headings=["Article D823-20"; + "Section 2 : Prime de déménagement"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + (match + (menage_.Menage.date_naissance_troisieme_enfant_ou_dernier_si_plus) + with + | DateNaissanceTroisiemeOuDernierPlusEnfant.MoinsDeTroisEnfants _ -> + false + | DateNaissanceTroisiemeOuDernierPlusEnfant.PlusDeTroisEnfants date_naissance_ou_grossesse_ -> + (match date_naissance_ou_grossesse_ + with + | DateDeNaissanceOuMoisDeGrossesse.DateDeNaissance date_naissance_ -> + (date_courante_ <=@ + ((first_day_of_month + (date_naissance_ +@ + (duration_of_numbers (2) (0) (0)))) + +@ (duration_of_numbers (0) (0) (-1)))) + | DateDeNaissanceOuMoisDeGrossesse.AvantPremierJourMoisCivilTroisiemeMoisDeGrossesse _ -> + false + | DateDeNaissanceOuMoisDeGrossesse.ApresPremierJourMoisCivilTroisiemeMoisDeGrossesse _ -> + true)))) (fun (_: _) -> true))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=484; start_column=11; end_line=484; end_column=41; + law_headings=["Éligibilité à la prime de déménagement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> false)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=484; start_column=11; end_line=484; end_column=41; + law_headings=["Éligibilité à la prime de déménagement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let plafond_d823_22_: money = (log_variable_definition + ["ÉligibilitéPrimeDeDéménagement"; "plafond_d823_22"] (embed_money) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=487; start_column=11; end_line=487; end_column=26; + law_headings=["Éligibilité à la prime de déménagement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=4394; start_column=14; end_line=4394; end_column=29; + law_headings=["Article 45"; + "Chapitre VIII : Prime de déménagement"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + true)) + (fun (_: _) -> + (base_mensuelle_allocations_familiales_dot_montant_ *$ + (decimal_of_string "2.4")) +$ + ( if + ((Array.fold_left + (fun (acc_: integer) (personne_a_charge_: _) -> + if + (match personne_a_charge_ + with + | PersonneACharge.EnfantACharge _ -> true + | PersonneACharge.AutrePersonneACharge _ -> false) + then (acc_ +! (integer_of_string "1")) else + acc_) (integer_of_string "0") + (menage_.Menage.personnes_a_charge)) >! + (integer_of_string "3")) then + (base_mensuelle_allocations_familiales_dot_montant_ *$ + ((decimal_of_integer + ((Array.fold_left + (fun (acc_: integer) (personne_a_charge_: _) -> + if + (match personne_a_charge_ + with + | PersonneACharge.EnfantACharge _ -> true + | PersonneACharge.AutrePersonneACharge _ -> + false) then + (acc_ +! (integer_of_string "1")) else + acc_) (integer_of_string "0") + (menage_.Menage.personnes_a_charge)) -! + (integer_of_string "3"))) *& + (decimal_of_string "0.2"))) else + (money_of_cents_string "0")))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=487; start_column=11; end_line=487; end_column=26; + law_headings=["Éligibilité à la prime de déménagement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let eligibilite_logement_: bool = (log_variable_definition + ["ÉligibilitéPrimeDeDéménagement"; "éligibilité_logement"] + (embed_bool) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=485; start_column=11; end_line=485; end_column=31; + law_headings=["Éligibilité à la prime de déménagement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=485; start_column=11; + end_line=485; end_column=31; + law_headings=["Éligibilité à la prime de déménagement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_legislatif.catala_fr"; + start_line=556; start_column=5; + end_line=559; end_column=43; + law_headings=["Article L823-8"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie législative"; + "Code de la construction et de l'habitation"]} + (eligibilite_apl_dot_eligibilite_ && + (condition_rang_enfant_ && + (condition_periode_demenagement_ && + ((eligibilite_apl_dot_date_courante_ -@ + date_emmenagement_) <=^ + delai_apres_emmenagement_l823_8_2_)))))) + (fun (_: _) -> true))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=485; start_column=11; end_line=485; end_column=31; + law_headings=["Éligibilité à la prime de déménagement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> false)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=485; start_column=11; end_line=485; end_column=31; + law_headings=["Éligibilité à la prime de déménagement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let montant_prime_demenagement_: money = (log_variable_definition + ["ÉligibilitéPrimeDeDéménagement"; "montant_prime_déménagement"] + (embed_money) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=493; start_column=10; end_line=493; end_column=36; + law_headings=["Éligibilité à la prime de déménagement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=2174; start_column=14; end_line=2174; end_column=40; + law_headings=["Article D823-22"; + "Section 2 : Prime de déménagement"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + if + (depenses_justifiees_reellement_engagees_ <=$ plafond_d823_22_) + then depenses_justifiees_reellement_engagees_ else + plafond_d823_22_)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=493; start_column=10; end_line=493; end_column=36; + law_headings=["Éligibilité à la prime de déménagement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + {EligibilitePrimeDeDemenagementOut.montant_prime_demenagement_out = + montant_prime_demenagement_} + +let eligibilite_aide_personnalisee_logement (eligibilite_aide_personnalisee_logement_in: EligibiliteAidePersonnaliseeLogementIn.t) : EligibiliteAidePersonnaliseeLogementOut.t = + let menage_: Menage.t = eligibilite_aide_personnalisee_logement_in.EligibiliteAidePersonnaliseeLogementIn.menage_in in + let demandeur_: Demandeur.t = eligibilite_aide_personnalisee_logement_in.EligibiliteAidePersonnaliseeLogementIn.demandeur_in in + let date_courante_: date = eligibilite_aide_personnalisee_logement_in.EligibiliteAidePersonnaliseeLogementIn.date_courante_in in + let caracteristiques_pret_l831_1_1_: Pret.t -> bool = (log_variable_definition + ["ÉligibilitéAidePersonnaliséeLogement"; + "caractéristiques_prêt_l831_1_1"] (unembeddable) ( + try + (fun (param_: Pret.t) -> + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=392; start_column=11; end_line=392; end_column=41; + law_headings=["Éligibilité à l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=392; start_column=11; + end_line=392; end_column=41; + law_headings=["Éligibilité à l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=392; start_column=11; + end_line=392; end_column=41; + law_headings=["Éligibilité à l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=392; start_column=11; + end_line=392; end_column=41; + law_headings=["Éligibilité à l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=3085; start_column=5; + end_line=3088; end_column=46; + law_headings=["Article R832-7"; + "Section 2 : Accession à la propriété"; + "Chapitre II : Modalités de liquidation et de versement de l'aide personnalisée au logement"; + "Titre III : Aide personnalisée au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + ((match (param_.Pret.titulaire_pret) + with + | TitulairePret.Demandeur _ -> + false + | TitulairePret.VendeurQuandDemandeurAContratLocationAccession _ -> + true) && + ((match (param_.Pret.type_pret) + with + | TypePret.D331_32 _ -> false + | TypePret.D331_63_64 _ -> + false + | TypePret.D331_59_8 _ -> true + | TypePret.D331_76_1 _ -> false + | TypePret.Autre _ -> false) || + (match (param_.Pret.type_pret) + with + | TypePret.D331_32 _ -> false + | TypePret.D331_63_64 _ -> + false + | TypePret.D331_59_8 _ -> + false + | TypePret.D331_76_1 _ -> + true + | TypePret.Autre _ -> false))))) + (fun (_: _) -> true))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=3050; start_column=5; + end_line=3052; end_column=47; + law_headings=["Article R832-5"; + "Section 2 : Accession à la propriété"; + "Chapitre II : Modalités de liquidation et de versement de l'aide personnalisée au logement"; + "Titre III : Aide personnalisée au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + ((match (param_.Pret.titulaire_pret) + with + | TitulairePret.Demandeur _ -> true + | TitulairePret.VendeurQuandDemandeurAContratLocationAccession _ -> + false) && + ((match (param_.Pret.type_pret) + with + | TypePret.D331_32 _ -> true + | TypePret.D331_63_64 _ -> false + | TypePret.D331_59_8 _ -> false + | TypePret.D331_76_1 _ -> false + | TypePret.Autre _ -> false) || + (match (param_.Pret.type_pret) + with + | TypePret.D331_32 _ -> false + | TypePret.D331_63_64 _ -> true + | TypePret.D331_59_8 _ -> false + | TypePret.D331_76_1 _ -> false + | TypePret.Autre _ -> false))))) + (fun (_: _) -> true))|]) (fun (_: _) -> false) + (fun (_: _) -> raise EmptyError))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=392; start_column=11; + end_line=392; end_column=41; + law_headings=["Éligibilité à l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> false)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=392; start_column=11; end_line=392; end_column=41; + law_headings=["Éligibilité à l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]}))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=392; start_column=11; end_line=392; end_column=41; + law_headings=["Éligibilité à l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let caracteristiques_pret_l831_1_6_: Pret.t -> bool = (log_variable_definition + ["ÉligibilitéAidePersonnaliséeLogement"; + "caractéristiques_prêt_l831_1_6"] (unembeddable) ( + try + (fun (param_: Pret.t) -> + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=393; start_column=11; end_line=393; end_column=41; + law_headings=["Éligibilité à l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=393; start_column=11; + end_line=393; end_column=41; + law_headings=["Éligibilité à l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> false)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=393; start_column=11; end_line=393; end_column=41; + law_headings=["Éligibilité à l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]}))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=393; start_column=11; end_line=393; end_column=41; + law_headings=["Éligibilité à l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let condition_logement_pret_: bool = (log_variable_definition + ["ÉligibilitéAidePersonnaliséeLogement"; "condition_logement_prêt"] + (embed_bool) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=391; start_column=11; end_line=391; end_column=34; + law_headings=["Éligibilité à l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=391; start_column=11; + end_line=391; end_column=34; + law_headings=["Éligibilité à l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=391; start_column=11; + end_line=391; end_column=34; + law_headings=["Éligibilité à l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=391; start_column=11; + end_line=391; end_column=34; + law_headings=["Éligibilité à l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_legislatif.catala_fr"; + start_line=756; start_column=5; + end_line=769; end_column=30; + law_headings=["Article L831-2"; + "Chapitre Ier : Champ d'application"; + "Titre III : Aide personnalisée au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie législative"; + "Code de la construction et de l'habitation"]} + (match + ((menage_.Menage.logement).Logement.mode_occupation) + with + | ModeOccupation.Locataire _ -> false + | ModeOccupation.ResidentLogementFoyer _ -> + false + | ModeOccupation.AccessionProprieteLocalUsageExclusifHabitation propriete_ -> + ((((propriete_.Proprietaire.pret).Pret.date_signature) + >=@ + (date_of_numbers (2018) (1) (1))) + && + ((((propriete_.Proprietaire.pret).Pret.date_signature) + <@ + (date_of_numbers (2020) (1) (1))) + && + (((menage_.Menage.logement).Logement.est_ancien_l831_2) + && + ((menage_.Menage.logement).Logement.situe_commune_desequilibre_l831_2)))) + | ModeOccupation.SousLocataire _ -> + false + | ModeOccupation.LocationAccession propriete_ -> + ((((propriete_.Proprietaire.pret).Pret.date_signature) + >=@ + (date_of_numbers (2018) (1) (1))) + && + ((((propriete_.Proprietaire.pret).Pret.date_signature) + <@ + (date_of_numbers (2020) (1) (1))) + && + (((menage_.Menage.logement).Logement.est_ancien_l831_2) + && + ((menage_.Menage.logement).Logement.situe_commune_desequilibre_l831_2))))))) + (fun (_: _) -> true))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_legislatif.catala_fr"; + start_line=737; start_column=5; + end_line=742; end_column=30; + law_headings=["Article L831-2"; + "Chapitre Ier : Champ d'application"; + "Titre III : Aide personnalisée au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie législative"; + "Code de la construction et de l'habitation"]} + (match + ((menage_.Menage.logement).Logement.mode_occupation) + with + | ModeOccupation.Locataire _ -> false + | ModeOccupation.ResidentLogementFoyer _ -> + false + | ModeOccupation.AccessionProprieteLocalUsageExclusifHabitation propriete_ -> + (((propriete_.Proprietaire.pret).Pret.date_signature) + >=@ (date_of_numbers (2017) (12) (31))) + | ModeOccupation.SousLocataire _ -> false + | ModeOccupation.LocationAccession propriete_ -> + (((propriete_.Proprietaire.pret).Pret.date_signature) + >=@ (date_of_numbers (2017) (12) (31)))))) + (fun (_: _) -> false))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_legislatif.catala_fr"; + start_line=733; start_column=31; + end_line=733; end_column=54; + law_headings=["Article L831-2"; + "Chapitre Ier : Champ d'application"; + "Titre III : Aide personnalisée au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie législative"; + "Code de la construction et de l'habitation"]} + true)) (fun (_: _) -> true))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=391; start_column=11; end_line=391; end_column=34; + law_headings=["Éligibilité à l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> false)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=391; start_column=11; end_line=391; end_column=34; + law_headings=["Éligibilité à l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let eligibilite_commune_dot_menage_: Menage.t = + try ((log_variable_definition + ["ÉligibilitéAidePersonnaliséeLogement"; + "éligibilité_commune.ménage"] (embed_menage) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=395; start_column=3; end_line=395; end_column=22; + law_headings=["Éligibilité à l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=404; start_column=14; end_line=404; end_column=40; + law_headings=["Éligibilité à l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> menage_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=311; start_column=10; end_line=311; end_column=16; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let eligibilite_commune_dot_demandeur_: Demandeur.t = + try ((log_variable_definition + ["ÉligibilitéAidePersonnaliséeLogement"; + "éligibilité_commune.demandeur"] (embed_demandeur) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=395; start_column=3; end_line=395; end_column=22; + law_headings=["Éligibilité à l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=405; start_column=14; end_line=405; end_column=43; + law_headings=["Éligibilité à l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> demandeur_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=312; start_column=10; end_line=312; end_column=19; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let eligibilite_commune_dot_date_courante_: date = + try ((log_variable_definition + ["ÉligibilitéAidePersonnaliséeLogement"; + "éligibilité_commune.date_courante"] (embed_date) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=395; start_column=3; end_line=395; end_column=22; + law_headings=["Éligibilité à l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=406; start_column=14; end_line=406; end_column=47; + law_headings=["Éligibilité à l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> date_courante_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=313; start_column=17; end_line=313; end_column=30; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let eligibilite_commune_dot_condition_logement_residence_principale_: + unit -> bool = fun (_: unit) -> (log_variable_definition + ["ÉligibilitéAidePersonnaliséeLogement"; + "éligibilité_commune.condition_logement_résidence_principale"] + (embed_bool) (raise EmptyError)) in + let eligibilite_commune_dot_condition_logement_surface_: unit -> bool = + fun (_: unit) -> (log_variable_definition + ["ÉligibilitéAidePersonnaliséeLogement"; + "éligibilité_commune.condition_logement_surface"] (embed_bool) + (raise EmptyError)) in + let result_: EligibiliteAidesPersonnelleLogementOut.t = (log_end_call + ["ÉligibilitéAidePersonnaliséeLogement"; "éligibilité_commune"; + "ÉligibilitéAidesPersonnelleLogement"] ((log_begin_call + ["ÉligibilitéAidePersonnaliséeLogement"; "éligibilité_commune"; + "ÉligibilitéAidesPersonnelleLogement"] + eligibilite_aides_personnelle_logement) + {EligibiliteAidesPersonnelleLogementIn.menage_in = + eligibilite_commune_dot_menage_; + EligibiliteAidesPersonnelleLogementIn.demandeur_in = + eligibilite_commune_dot_demandeur_; + EligibiliteAidesPersonnelleLogementIn.date_courante_in = + eligibilite_commune_dot_date_courante_; + EligibiliteAidesPersonnelleLogementIn.condition_logement_residence_principale_in = + eligibilite_commune_dot_condition_logement_residence_principale_; + EligibiliteAidesPersonnelleLogementIn.condition_logement_surface_in = + eligibilite_commune_dot_condition_logement_surface_})) in + let eligibilite_commune_dot_date_courante_: date = result_.EligibiliteAidesPersonnelleLogementOut.date_courante_out in + let eligibilite_commune_dot_eligibilite_: bool = result_.EligibiliteAidesPersonnelleLogementOut.eligibilite_out in + let eligibilite_commune_dot_nombre_personnes_a_charge_prises_en_compte_: integer = result_.EligibiliteAidesPersonnelleLogementOut.nombre_personnes_a_charge_prises_en_compte_out in + let eligibilite_commune_dot_coefficents_enfants_garde_alternee_pris_en_compte_: + decimal array = result_.EligibiliteAidesPersonnelleLogementOut.coefficents_enfants_garde_alternee_pris_en_compte_out in + let eligibilite_commune_dot_condition_2_r823_4_: PersonneACharge.t -> bool = result_.EligibiliteAidesPersonnelleLogementOut.condition_2_r823_4_out in + let condition_logement_bailleur_: bool = (log_variable_definition + ["ÉligibilitéAidePersonnaliséeLogement"; + "condition_logement_bailleur"] (embed_bool) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=390; start_column=11; end_line=390; end_column=38; + law_headings=["Éligibilité à l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=390; start_column=11; + end_line=390; end_column=38; + law_headings=["Éligibilité à l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=390; start_column=11; + end_line=390; end_column=38; + law_headings=["Éligibilité à l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=390; start_column=11; + end_line=390; end_column=38; + law_headings=["Éligibilité à l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_legislatif.catala_fr"; + start_line=661; start_column=5; + end_line=671; end_column=30; + law_headings=["Article L831-1"; + "Chapitre Ier : Champ d'application"; + "Titre III : Aide personnalisée au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie législative"; + "Code de la construction et de l'habitation"]} + (match + ((menage_.Menage.logement).Logement.mode_occupation) + with + | ModeOccupation.Locataire location_ -> + (match + ((location_.Location.bailleur).Bailleur.type_bailleur) + with + | TypeBailleur.BailleurSocial _ -> + false + | TypeBailleur.BailleurPrive _ -> + (((location_.Location.bailleur).Bailleur.acquisition_aides_etat_pret_titre_II_ou_livre_III) + && + (not + ((location_.Location.bailleur).Bailleur.respecte_convention_titre_V)))) + | ModeOccupation.ResidentLogementFoyer _ -> + false + | ModeOccupation.AccessionProprieteLocalUsageExclusifHabitation _ -> + false + | ModeOccupation.SousLocataire _ -> + false + | ModeOccupation.LocationAccession _ -> + false))) (fun (_: _) -> false))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_legislatif.catala_fr"; + start_line=684; start_column=5; + end_line=695; end_column=30; + law_headings=["Article L831-1"; + "Chapitre Ier : Champ d'application"; + "Titre III : Aide personnalisée au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie législative"; + "Code de la construction et de l'habitation"]} + (match + ((menage_.Menage.logement).Logement.mode_occupation) + with + | ModeOccupation.Locataire location_ -> + (match + ((location_.Location.bailleur).Bailleur.type_bailleur) + with + | TypeBailleur.BailleurSocial _ -> + (((location_.Location.bailleur).Bailleur.construit_ameliore_conditions_l831_1_4) + && + (((location_.Location.bailleur).Bailleur.respecte_convention_titre_V) + || + ((location_.Location.bailleur).Bailleur.respecte_convention_titre_II))) + | TypeBailleur.BailleurPrive _ -> + (((location_.Location.bailleur).Bailleur.construit_ameliore_conditions_l831_1_4) + && + (((location_.Location.bailleur).Bailleur.respecte_convention_titre_V) + || + ((location_.Location.bailleur).Bailleur.respecte_convention_titre_II)))) + | ModeOccupation.ResidentLogementFoyer _ -> + false + | ModeOccupation.AccessionProprieteLocalUsageExclusifHabitation _ -> + false + | ModeOccupation.SousLocataire _ -> false + | ModeOccupation.LocationAccession _ -> false))) + (fun (_: _) -> true))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_legislatif.catala_fr"; + start_line=634; start_column=5; + end_line=641; end_column=30; + law_headings=["Article L831-1"; + "Chapitre Ier : Champ d'application"; + "Titre III : Aide personnalisée au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie législative"; + "Code de la construction et de l'habitation"]} + (match + ((menage_.Menage.logement).Logement.mode_occupation) + with + | ModeOccupation.Locataire location_ -> + (match + ((location_.Location.bailleur).Bailleur.type_bailleur) + with + | TypeBailleur.BailleurSocial _ -> + ((location_.Location.bailleur).Bailleur.respecte_convention_titre_V) + | TypeBailleur.BailleurPrive _ -> + ((location_.Location.bailleur).Bailleur.respecte_convention_titre_II)) + | ModeOccupation.ResidentLogementFoyer _ -> false + | ModeOccupation.AccessionProprieteLocalUsageExclusifHabitation _ -> + false + | ModeOccupation.SousLocataire _ -> false + | ModeOccupation.LocationAccession _ -> false))) + (fun (_: _) -> true)); + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=390; start_column=11; + end_line=390; end_column=38; + law_headings=["Éligibilité à l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=390; start_column=11; + end_line=390; end_column=38; + law_headings=["Éligibilité à l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=390; start_column=11; + end_line=390; end_column=38; + law_headings=["Éligibilité à l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=390; start_column=11; + end_line=390; end_column=38; + law_headings=["Éligibilité à l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=3758; + start_column=5; + end_line=3763; end_column=30; + law_headings=["Article R832-21"; + "Sous-Section 1 : Conditions d'assimilation des logements-foyers aux logements à usage locatif"; + "Section 3 : Logements-foyers"; + "Chapitre II : Modalités de liquidation et de versement de l'aide personnalisée au logement"; + "Titre III : Aide personnalisée au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + (match + ((menage_.Menage.logement).Logement.mode_occupation) + with + | ModeOccupation.Locataire _ -> + false + | ModeOccupation.ResidentLogementFoyer logement_foyer_ -> + (logement_foyer_.LogementFoyer.remplit_conditions_r832_21) + | ModeOccupation.AccessionProprieteLocalUsageExclusifHabitation _ -> + false + | ModeOccupation.SousLocataire _ -> + false + | ModeOccupation.LocationAccession _ -> + false))) + (fun (_: _) -> true))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_legislatif.catala_fr"; + start_line=718; start_column=5; + end_line=721; end_column=30; + law_headings=["Article L831-1"; + "Chapitre Ier : Champ d'application"; + "Titre III : Aide personnalisée au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie législative"; + "Code de la construction et de l'habitation"]} + (match + ((menage_.Menage.logement).Logement.mode_occupation) + with + | ModeOccupation.Locataire _ -> false + | ModeOccupation.ResidentLogementFoyer _ -> + false + | ModeOccupation.AccessionProprieteLocalUsageExclusifHabitation _ -> + false + | ModeOccupation.SousLocataire _ -> + false + | ModeOccupation.LocationAccession propriete_ -> + ((log_end_call + ["ÉligibilitéAidePersonnaliséeLogement"; + "caractéristiques_prêt_l831_1_6"] + ((log_variable_definition + ["ÉligibilitéAidePersonnaliséeLogement"; + "caractéristiques_prêt_l831_1_6"; + "output"] (embed_bool) + ((log_begin_call + ["ÉligibilitéAidePersonnaliséeLogement"; + "caractéristiques_prêt_l831_1_6"] + caracteristiques_pret_l831_1_6_) + ((log_variable_definition + ["ÉligibilitéAidePersonnaliséeLogement"; + "caractéristiques_prêt_l831_1_6"; + "input"] (embed_pret) + (propriete_.Proprietaire.pret))))))))))) + (fun (_: _) -> true))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_legislatif.catala_fr"; + start_line=613; start_column=5; + end_line=616; end_column=30; + law_headings=["Article L831-1"; + "Chapitre Ier : Champ d'application"; + "Titre III : Aide personnalisée au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie législative"; + "Code de la construction et de l'habitation"]} + (match + ((menage_.Menage.logement).Logement.mode_occupation) + with + | ModeOccupation.Locataire _ -> false + | ModeOccupation.ResidentLogementFoyer _ -> + false + | ModeOccupation.AccessionProprieteLocalUsageExclusifHabitation propriete_ -> + ((log_end_call + ["ÉligibilitéAidePersonnaliséeLogement"; + "caractéristiques_prêt_l831_1_1"] + ((log_variable_definition + ["ÉligibilitéAidePersonnaliséeLogement"; + "caractéristiques_prêt_l831_1_1"; + "output"] (embed_bool) ((log_begin_call + ["ÉligibilitéAidePersonnaliséeLogement"; + "caractéristiques_prêt_l831_1_1"] + caracteristiques_pret_l831_1_1_) + ((log_variable_definition + ["ÉligibilitéAidePersonnaliséeLogement"; + "caractéristiques_prêt_l831_1_1"; + "input"] (embed_pret) + (propriete_.Proprietaire.pret)))))))) + | ModeOccupation.SousLocataire _ -> false + | ModeOccupation.LocationAccession _ -> false))) + (fun (_: _) -> true))|]) (fun (_: _) -> false) + (fun (_: _) -> raise EmptyError))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=390; start_column=11; end_line=390; end_column=38; + law_headings=["Éligibilité à l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> false)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=390; start_column=11; end_line=390; end_column=38; + law_headings=["Éligibilité à l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let coefficents_enfants_garde_alternee_pris_en_compte_: decimal array = (log_variable_definition + ["ÉligibilitéAidePersonnaliséeLogement"; + "coefficents_enfants_garde_alternée_pris_en_compte"] + (embed_array (embed_decimal)) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=399; start_column=10; end_line=399; end_column=59; + law_headings=["Éligibilité à l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=410; start_column=14; end_line=410; end_column=63; + law_headings=["Éligibilité à l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> + eligibilite_commune_dot_coefficents_enfants_garde_alternee_pris_en_compte_)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=399; start_column=10; end_line=399; end_column=59; + law_headings=["Éligibilité à l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let nombre_personnes_a_charge_prises_en_compte_: integer = (log_variable_definition + ["ÉligibilitéAidePersonnaliséeLogement"; + "nombre_personnes_à_charge_prises_en_compte"] (embed_integer) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=398; start_column=10; end_line=398; end_column=52; + law_headings=["Éligibilité à l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=408; start_column=14; end_line=408; end_column=56; + law_headings=["Éligibilité à l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> + eligibilite_commune_dot_nombre_personnes_a_charge_prises_en_compte_)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=398; start_column=10; end_line=398; end_column=52; + law_headings=["Éligibilité à l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let eligibilite_: bool = (log_variable_definition + ["ÉligibilitéAidePersonnaliséeLogement"; "éligibilité"] (embed_bool) + ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=397; start_column=10; end_line=397; end_column=21; + law_headings=["Éligibilité à l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=397; start_column=10; + end_line=397; end_column=21; + law_headings=["Éligibilité à l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_legislatif.catala_fr"; + start_line=584; start_column=5; + end_line=586; end_column=36; + law_headings=["Chapitre Ier : Champ d'application"; + "Titre III : Aide personnalisée au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie législative"; + "Code de la construction et de l'habitation"]} + (condition_logement_bailleur_ && + (condition_logement_pret_ && + eligibilite_commune_dot_eligibilite_)))) + (fun (_: _) -> true))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=397; start_column=10; end_line=397; end_column=21; + law_headings=["Éligibilité à l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> false)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=397; start_column=10; end_line=397; end_column=21; + law_headings=["Éligibilité à l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + {EligibiliteAidePersonnaliseeLogementOut.date_courante_out = date_courante_; + EligibiliteAidePersonnaliseeLogementOut.eligibilite_out = eligibilite_; + EligibiliteAidePersonnaliseeLogementOut.nombre_personnes_a_charge_prises_en_compte_out = + nombre_personnes_a_charge_prises_en_compte_; + EligibiliteAidePersonnaliseeLogementOut.coefficents_enfants_garde_alternee_pris_en_compte_out = + coefficents_enfants_garde_alternee_pris_en_compte_} + +let eligibilite_allocation_logement (eligibilite_allocation_logement_in: EligibiliteAllocationLogementIn.t) : EligibiliteAllocationLogementOut.t = + let date_courante_: date = eligibilite_allocation_logement_in.EligibiliteAllocationLogementIn.date_courante_in in + let menage_: Menage.t = eligibilite_allocation_logement_in.EligibiliteAllocationLogementIn.menage_in in + let demandeur_: Demandeur.t = eligibilite_allocation_logement_in.EligibiliteAllocationLogementIn.demandeur_in in + let beneficie_aide_personnalisee_logement_: bool = eligibilite_allocation_logement_in.EligibiliteAllocationLogementIn.beneficie_aide_personnalisee_logement_in in + let informations_calcul_: InformationsCalculAPL.t = eligibilite_allocation_logement_in.EligibiliteAllocationLogementIn.informations_calcul_in in + let duree_l841_1_3_: duration = (log_variable_definition + ["ÉligibilitéAllocationLogement"; "durée_l841_1_3"] (embed_duration) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=433; start_column=11; end_line=433; end_column=25; + law_headings=["Éligibilité aux allocations de logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=4241; start_column=14; end_line=4241; end_column=28; + law_headings=["Article D841-1"; + "Chapitre 1 : Champ d'application"; + "Titre IV : Allocations de Logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) (fun (_: _) -> duration_of_numbers (5) (0) (0))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=433; start_column=11; end_line=433; end_column=25; + law_headings=["Éligibilité aux allocations de logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let prestations_familiales_dot_date_courante_: date = + try ((log_variable_definition + ["ÉligibilitéAllocationLogement"; + "prestations_familiales.date_courante"] (embed_date) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=435; start_column=3; end_line=435; end_column=25; + law_headings=["Éligibilité aux allocations de logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=450; start_column=14; end_line=450; end_column=50; + law_headings=["Éligibilité aux allocations de logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> date_courante_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/../prestations_familiales/prologue.catala_fr"; + start_line=46; start_column=10; end_line=46; end_column=23; + law_headings=["Prologue : prestations familiales"]})) in + let prestations_familiales_dot_prestation_courante_: ElementPrestationsFamiliales.t = + try ((log_variable_definition + ["ÉligibilitéAllocationLogement"; + "prestations_familiales.prestation_courante"] + (embed_element_prestations_familiales) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=435; start_column=3; end_line=435; end_column=25; + law_headings=["Éligibilité aux allocations de logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=451; start_column=14; end_line=451; end_column=56; + law_headings=["Éligibilité aux allocations de logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> ElementPrestationsFamiliales.AllocationsFamiliales ())))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/../prestations_familiales/prologue.catala_fr"; + start_line=47; start_column=10; end_line=47; end_column=29; + law_headings=["Prologue : prestations familiales"]})) in + let prestations_familiales_dot_residence_: Collectivite.t = + try ((log_variable_definition + ["ÉligibilitéAllocationLogement"; + "prestations_familiales.résidence"] (embed_collectivite) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=435; start_column=3; end_line=435; end_column=25; + law_headings=["Éligibilité aux allocations de logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=455; start_column=14; end_line=455; end_column=46; + law_headings=["Éligibilité aux allocations de logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> Collectivite.Metropole ())))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/../prestations_familiales/prologue.catala_fr"; + start_line=48; start_column=10; end_line=48; end_column=19; + law_headings=["Prologue : prestations familiales"]})) in + let result_: EligibilitePrestationsFamilialesOut.t = (log_end_call + ["ÉligibilitéAllocationLogement"; "prestations_familiales"; + "ÉligibilitéPrestationsFamiliales"] ((log_begin_call + ["ÉligibilitéAllocationLogement"; "prestations_familiales"; + "ÉligibilitéPrestationsFamiliales"] + eligibilite_prestations_familiales) + {EligibilitePrestationsFamilialesIn.date_courante_in = + prestations_familiales_dot_date_courante_; + EligibilitePrestationsFamilialesIn.prestation_courante_in = + prestations_familiales_dot_prestation_courante_; + EligibilitePrestationsFamilialesIn.residence_in = + prestations_familiales_dot_residence_})) in + let prestations_familiales_dot_droit_ouvert_: EnfantPrestationsFamiliales.t -> + bool = result_.EligibilitePrestationsFamilialesOut.droit_ouvert_out in + let prestations_familiales_dot_conditions_hors_age_: EnfantPrestationsFamiliales.t -> + bool = result_.EligibilitePrestationsFamilialesOut.conditions_hors_age_out in + let prestations_familiales_dot_age_l512_3_2_: integer = result_.EligibilitePrestationsFamilialesOut.age_l512_3_2_out in + let prestations_familiales_dot_regime_outre_mer_l751_1_: bool = result_.EligibilitePrestationsFamilialesOut.regime_outre_mer_l751_1_out in + let eligibilite_commune_dot_menage_: Menage.t = + try ((log_variable_definition + ["ÉligibilitéAllocationLogement"; "éligibilité_commune.ménage"] + (embed_menage) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=436; start_column=3; end_line=436; end_column=22; + law_headings=["Éligibilité aux allocations de logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=457; start_column=14; end_line=457; end_column=40; + law_headings=["Éligibilité aux allocations de logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> menage_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=311; start_column=10; end_line=311; end_column=16; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let eligibilite_commune_dot_demandeur_: Demandeur.t = + try ((log_variable_definition + ["ÉligibilitéAllocationLogement"; "éligibilité_commune.demandeur"] + (embed_demandeur) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=436; start_column=3; end_line=436; end_column=22; + law_headings=["Éligibilité aux allocations de logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=458; start_column=14; end_line=458; end_column=43; + law_headings=["Éligibilité aux allocations de logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> demandeur_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=312; start_column=10; end_line=312; end_column=19; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let eligibilite_commune_dot_date_courante_: date = + try ((log_variable_definition + ["ÉligibilitéAllocationLogement"; + "éligibilité_commune.date_courante"] (embed_date) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=436; start_column=3; end_line=436; end_column=22; + law_headings=["Éligibilité aux allocations de logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=459; start_column=14; end_line=459; end_column=47; + law_headings=["Éligibilité aux allocations de logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> date_courante_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=313; start_column=17; end_line=313; end_column=30; + law_headings=["Éligibilité aux aides personnelles au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let eligibilite_commune_dot_condition_logement_residence_principale_: + unit -> bool = fun (_: unit) -> (log_variable_definition + ["ÉligibilitéAllocationLogement"; + "éligibilité_commune.condition_logement_résidence_principale"] + (embed_bool) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=436; start_column=3; + end_line=436; end_column=22; + law_headings=["Éligibilité aux allocations de logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=436; start_column=3; + end_line=436; end_column=22; + law_headings=["Éligibilité aux allocations de logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=4828; start_column=9; + end_line=4828; end_column=68; + law_headings=["Article R842-14"; + "Section 3 : Logements-foyers"; + "Chapitre 2 : Modalités de liquidation et de versement des allocations de logement"; + "Titre IV : Allocations de Logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + (match + ((menage_.Menage.logement).Logement.mode_occupation) + with + | ModeOccupation.Locataire _ -> false + | ModeOccupation.ResidentLogementFoyer logement_foyer_ -> + (logement_foyer_.LogementFoyer.construit_application_loi_1957_12_III) + | ModeOccupation.AccessionProprieteLocalUsageExclusifHabitation _ -> + false + | ModeOccupation.SousLocataire _ -> false + | ModeOccupation.LocationAccession _ -> + false))) (fun (_: _) -> true))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=436; start_column=3; + end_line=436; end_column=22; + law_headings=["Éligibilité aux allocations de logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + true)) (fun (_: _) -> false))) in + let eligibilite_commune_dot_condition_logement_surface_: unit -> bool = + fun (_: unit) -> (log_variable_definition + ["ÉligibilitéAllocationLogement"; + "éligibilité_commune.condition_logement_surface"] (embed_bool) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=436; start_column=3; end_line=436; end_column=22; + law_headings=["Éligibilité aux allocations de logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=436; start_column=3; + end_line=436; end_column=22; + law_headings=["Éligibilité aux allocations de logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=4829; start_column=9; + end_line=4829; end_column=55; + law_headings=["Article R842-14"; + "Section 3 : Logements-foyers"; + "Chapitre 2 : Modalités de liquidation et de versement des allocations de logement"; + "Titre IV : Allocations de Logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + (match + ((menage_.Menage.logement).Logement.mode_occupation) + with + | ModeOccupation.Locataire _ -> false + | ModeOccupation.ResidentLogementFoyer logement_foyer_ -> + (logement_foyer_.LogementFoyer.construit_application_loi_1957_12_III) + | ModeOccupation.AccessionProprieteLocalUsageExclusifHabitation _ -> + false + | ModeOccupation.SousLocataire _ -> false + | ModeOccupation.LocationAccession _ -> false))) + (fun (_: _) -> true))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=436; start_column=3; end_line=436; end_column=22; + law_headings=["Éligibilité aux allocations de logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> false))) in + let result_: EligibiliteAidesPersonnelleLogementOut.t = (log_end_call + ["ÉligibilitéAllocationLogement"; "éligibilité_commune"; + "ÉligibilitéAidesPersonnelleLogement"] ((log_begin_call + ["ÉligibilitéAllocationLogement"; "éligibilité_commune"; + "ÉligibilitéAidesPersonnelleLogement"] + eligibilite_aides_personnelle_logement) + {EligibiliteAidesPersonnelleLogementIn.menage_in = + eligibilite_commune_dot_menage_; + EligibiliteAidesPersonnelleLogementIn.demandeur_in = + eligibilite_commune_dot_demandeur_; + EligibiliteAidesPersonnelleLogementIn.date_courante_in = + eligibilite_commune_dot_date_courante_; + EligibiliteAidesPersonnelleLogementIn.condition_logement_residence_principale_in = + eligibilite_commune_dot_condition_logement_residence_principale_; + EligibiliteAidesPersonnelleLogementIn.condition_logement_surface_in = + eligibilite_commune_dot_condition_logement_surface_})) in + let eligibilite_commune_dot_date_courante_: date = result_.EligibiliteAidesPersonnelleLogementOut.date_courante_out in + let eligibilite_commune_dot_eligibilite_: bool = result_.EligibiliteAidesPersonnelleLogementOut.eligibilite_out in + let eligibilite_commune_dot_nombre_personnes_a_charge_prises_en_compte_: integer = result_.EligibiliteAidesPersonnelleLogementOut.nombre_personnes_a_charge_prises_en_compte_out in + let eligibilite_commune_dot_coefficents_enfants_garde_alternee_pris_en_compte_: + decimal array = result_.EligibiliteAidesPersonnelleLogementOut.coefficents_enfants_garde_alternee_pris_en_compte_out in + let eligibilite_commune_dot_condition_2_r823_4_: PersonneACharge.t -> bool = result_.EligibiliteAidesPersonnelleLogementOut.condition_2_r823_4_out in + let eligibilite_allocation_logement_sociale_: bool = (log_variable_definition + ["ÉligibilitéAllocationLogement"; + "éligibilité_allocation_logement_sociale"] (embed_bool) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=432; start_column=11; end_line=432; end_column=50; + law_headings=["Éligibilité aux allocations de logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=432; start_column=11; + end_line=432; end_column=50; + law_headings=["Éligibilité aux allocations de logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_legislatif.catala_fr"; + start_line=1136; start_column=5; + end_line=1136; end_column=73; + law_headings=["Article L841-3"; + "Chapitre Ier : Champ d'application"; + "Titre IV : Allocations de logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie législative"; + "Code de la construction et de l'habitation"]} + (demandeur_.Demandeur.personne_hebergee_centre_soin_l_L162_22_3_securite_sociale))) + (fun (_: _) -> true))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=432; start_column=11; end_line=432; end_column=50; + law_headings=["Éligibilité aux allocations de logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> false)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=432; start_column=11; end_line=432; end_column=50; + law_headings=["Éligibilité aux allocations de logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let condition_logement_: bool = (log_variable_definition + ["ÉligibilitéAllocationLogement"; "condition_logement"] (embed_bool) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=429; start_column=11; end_line=429; end_column=29; + law_headings=["Éligibilité aux allocations de logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=429; start_column=11; + end_line=429; end_column=29; + law_headings=["Éligibilité aux allocations de logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=429; start_column=11; + end_line=429; end_column=29; + law_headings=["Éligibilité aux allocations de logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=429; start_column=11; + end_line=429; end_column=29; + law_headings=["Éligibilité aux allocations de logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=429; start_column=11; + end_line=429; end_column=29; + law_headings=["Éligibilité aux allocations de logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=4418; + start_column=5; + end_line=4426; end_column=28; + law_headings=["Article R842-5"; + "Section 2 : Accession à la propriété"; + "Chapitre 2 : Modalités de liquidation et de versement des allocations de logement"; + "Titre IV : Allocations de Logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + (match informations_calcul_ + with + | InformationsCalculAPL.InfosLocatif _ -> + false + | InformationsCalculAPL.InfosLogementFoyer _ -> + false + | InformationsCalculAPL.InfosAccessionPropriete infos_ -> + (match + ((menage_.Menage.logement).Logement.mode_occupation) + with + | ModeOccupation.Locataire _ -> + false + | ModeOccupation.ResidentLogementFoyer _ -> + false + | ModeOccupation.AccessionProprieteLocalUsageExclusifHabitation proprietaire_ -> + ((match + ((proprietaire_.Proprietaire.pret).Pret.titulaire_pret) + with + | TitulairePret.Demandeur _ -> + true + | TitulairePret.VendeurQuandDemandeurAContratLocationAccession _ -> + false) && + (match + (infos_.InformationsCalculAPLAccessionPropriete.type_travaux_logement_r842_5) + with + | TypeTravauxLogementR8425.ObjectifDecenceLogement _ -> + false + | TypeTravauxLogementR8425.PrevuDansListeR321_15 _ -> + false + | TypeTravauxLogementR8425.AgrandirOuRendreHabitableD331_63 _ -> + true + | TypeTravauxLogementR8425.PasDeTravaux _ -> + false)) + | ModeOccupation.SousLocataire _ -> + false + | ModeOccupation.LocationAccession _ -> + false)))) + (fun (_: _) -> true))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=4399; start_column=5; + end_line=4406; end_column=28; + law_headings=["Article R842-5"; + "Section 2 : Accession à la propriété"; + "Chapitre 2 : Modalités de liquidation et de versement des allocations de logement"; + "Titre IV : Allocations de Logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + (match informations_calcul_ + with + | InformationsCalculAPL.InfosLocatif _ -> + false + | InformationsCalculAPL.InfosLogementFoyer _ -> + false + | InformationsCalculAPL.InfosAccessionPropriete infos_ -> + (match + ((menage_.Menage.logement).Logement.mode_occupation) + with + | ModeOccupation.Locataire _ -> + false + | ModeOccupation.ResidentLogementFoyer _ -> + false + | ModeOccupation.AccessionProprieteLocalUsageExclusifHabitation proprietaire_ -> + ((match + ((proprietaire_.Proprietaire.pret).Pret.titulaire_pret) + with + | TitulairePret.Demandeur _ -> + true + | TitulairePret.VendeurQuandDemandeurAContratLocationAccession _ -> + false) && + (match + (infos_.InformationsCalculAPLAccessionPropriete.type_travaux_logement_r842_5) + with + | TypeTravauxLogementR8425.ObjectifDecenceLogement _ -> + false + | TypeTravauxLogementR8425.PrevuDansListeR321_15 _ -> + true + | TypeTravauxLogementR8425.AgrandirOuRendreHabitableD331_63 _ -> + false + | TypeTravauxLogementR8425.PasDeTravaux _ -> + false)) + | ModeOccupation.SousLocataire _ -> + false + | ModeOccupation.LocationAccession _ -> + false)))) (fun (_: _) -> true))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=4380; start_column=5; + end_line=4389; end_column=28; + law_headings=["Article R842-5"; + "Section 2 : Accession à la propriété"; + "Chapitre 2 : Modalités de liquidation et de versement des allocations de logement"; + "Titre IV : Allocations de Logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + (match informations_calcul_ + with + | InformationsCalculAPL.InfosLocatif _ -> false + | InformationsCalculAPL.InfosLogementFoyer _ -> + false + | InformationsCalculAPL.InfosAccessionPropriete infos_ -> + (match + ((menage_.Menage.logement).Logement.mode_occupation) + with + | ModeOccupation.Locataire _ -> false + | ModeOccupation.ResidentLogementFoyer _ -> + false + | ModeOccupation.AccessionProprieteLocalUsageExclusifHabitation proprietaire_ -> + ((match + ((proprietaire_.Proprietaire.pret).Pret.titulaire_pret) + with + | TitulairePret.Demandeur _ -> true + | TitulairePret.VendeurQuandDemandeurAContratLocationAccession _ -> + false) && + ((match + (infos_.InformationsCalculAPLAccessionPropriete.type_travaux_logement_r842_5) + with + | TypeTravauxLogementR8425.ObjectifDecenceLogement _ -> + false + | TypeTravauxLogementR8425.PrevuDansListeR321_15 _ -> + false + | TypeTravauxLogementR8425.AgrandirOuRendreHabitableD331_63 _ -> + false + | TypeTravauxLogementR8425.PasDeTravaux _ -> + true) || + (match + (infos_.InformationsCalculAPLAccessionPropriete.type_travaux_logement_r842_5) + with + | TypeTravauxLogementR8425.ObjectifDecenceLogement _ -> + true + | TypeTravauxLogementR8425.PrevuDansListeR321_15 _ -> + false + | TypeTravauxLogementR8425.AgrandirOuRendreHabitableD331_63 _ -> + false + | TypeTravauxLogementR8425.PasDeTravaux _ -> + false))) + | ModeOccupation.SousLocataire _ -> false + | ModeOccupation.LocationAccession _ -> + false)))) (fun (_: _) -> true))|]) + (fun (_: _) -> false) (fun (_: _) -> raise EmptyError))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=429; start_column=11; end_line=429; end_column=29; + law_headings=["Éligibilité aux allocations de logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> false)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=429; start_column=11; end_line=429; end_column=29; + law_headings=["Éligibilité aux allocations de logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let coefficents_enfants_garde_alternee_pris_en_compte_: decimal array = (log_variable_definition + ["ÉligibilitéAllocationLogement"; + "coefficents_enfants_garde_alternée_pris_en_compte"] + (embed_array (embed_decimal)) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=444; start_column=10; end_line=444; end_column=59; + law_headings=["Éligibilité aux allocations de logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=469; start_column=14; end_line=469; end_column=63; + law_headings=["Éligibilité aux allocations de logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> + eligibilite_commune_dot_coefficents_enfants_garde_alternee_pris_en_compte_)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=444; start_column=10; end_line=444; end_column=59; + law_headings=["Éligibilité aux allocations de logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let nombre_personnes_a_charge_prises_en_compte_: integer = (log_variable_definition + ["ÉligibilitéAllocationLogement"; + "nombre_personnes_à_charge_prises_en_compte"] (embed_integer) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=443; start_column=10; end_line=443; end_column=52; + law_headings=["Éligibilité aux allocations de logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=467; start_column=14; end_line=467; end_column=56; + law_headings=["Éligibilité aux allocations de logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> + eligibilite_commune_dot_nombre_personnes_a_charge_prises_en_compte_)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=443; start_column=10; end_line=443; end_column=52; + law_headings=["Éligibilité aux allocations de logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let eligibilite_dispositions_communes_: EligibiliteAllocationLogement.t = (log_variable_definition + ["ÉligibilitéAllocationLogement"; + "éligibilité_dispositions_communes"] + (embed_eligibilite_allocation_logement) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=440; start_column=10; end_line=440; end_column=31; + law_headings=["Éligibilité aux allocations de logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_legislatif.catala_fr"; + start_line=856; start_column=14; end_line=856; end_column=25; + law_headings=["Chapitre Ier : Champ d'application"; + "Titre IV : Allocations de logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie législative"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + if (not eligibilite_commune_dot_eligibilite_) then + (EligibiliteAllocationLogement.PasEligible ()) else + (EligibiliteAllocationLogement.AllocationLogementSociale ()))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=440; start_column=10; end_line=440; end_column=31; + law_headings=["Éligibilité aux allocations de logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let eligibilite_allocation_logement_familiale_: bool = (log_variable_definition + ["ÉligibilitéAllocationLogement"; + "éligibilité_allocation_logement_familiale"] (embed_bool) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=431; start_column=11; end_line=431; end_column=52; + law_headings=["Éligibilité aux allocations de logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=431; start_column=11; + end_line=431; end_column=52; + law_headings=["Éligibilité aux allocations de logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=431; start_column=11; + end_line=431; end_column=52; + law_headings=["Éligibilité aux allocations de logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=431; start_column=11; + end_line=431; end_column=52; + law_headings=["Éligibilité aux allocations de logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=431; start_column=11; + end_line=431; end_column=52; + law_headings=["Éligibilité aux allocations de logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=431; + start_column=11; + end_line=431; end_column=52; + law_headings=["Éligibilité aux allocations de logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> + (log_decision_taken + {filename = "examples/aides_logement/code_construction_legislatif.catala_fr"; + start_line=1018; + start_column=5; + end_line=1022; end_column=29; + law_headings=["Article L841-1"; + "Chapitre Ier : Champ d'application"; + "Titre IV : Allocations de logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie législative"; + "Code de la construction et de l'habitation"]} + (match + (menage_.Menage.situation_familiale) + with + | SituationFamiliale.Celibataire _ -> + (((array_length + (menage_.Menage.personnes_a_charge)) + = + (integer_of_string + "0")) && + (menage_.Menage.enfant_a_naitre_apres_quatrieme_mois_grossesse)) + | SituationFamiliale.Maries _ -> + false + | SituationFamiliale.Pacses _ -> + false + | SituationFamiliale.Concubins _ -> + false + | SituationFamiliale.CelibataireSepareDeFait _ -> + false + | SituationFamiliale.ConcubinageDontSepareDeFait _ -> + false))) + (fun (_: _) -> true))|]) + (fun (_: _) -> true) + (fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=431; + start_column=11; + end_line=431; end_column=52; + law_headings=["Éligibilité aux allocations de logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=431; + start_column=11; + end_line=431; end_column=52; + law_headings= + ["Éligibilité aux allocations de logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=431; + start_column=11; + end_line=431; end_column=52; + law_headings= + ["Éligibilité aux allocations de logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> + (log_decision_taken + {filename = "examples/aides_logement/code_construction_legislatif.catala_fr"; + start_line=995; + start_column=5; + end_line=1006; end_column=12; + law_headings= + ["Article L841-1"; + "Chapitre Ier : Champ d'application"; + "Titre IV : Allocations de logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie législative"; + "Code de la construction et de l'habitation"]} + ((Array.fold_left + (fun + (acc_: + integer) + (personne_a_charge_: + _) -> + if + (match + personne_a_charge_ + with + | + PersonneACharge.EnfantACharge enfant_ -> + false + | + PersonneACharge.AutrePersonneACharge parent_ -> + ((parent_.AutrePersonneACharge.ascendant_descendant_collateral_deuxieme_troisieme_degre) + && + (parent_.AutrePersonneACharge.incapacite_80_pourcent_ou_restriction_emploi))) + then + (acc_ +! + (integer_of_string + "1")) + else + acc_) + (integer_of_string + "0") + (menage_.Menage.personnes_a_charge)) + >=! + (integer_of_string + "1")))) + (fun (_: _) -> + true))|]) + (fun (_: _) -> + (log_decision_taken + {filename = "examples/aides_logement/code_construction_legislatif.catala_fr"; + start_line=978; + start_column=5; + end_line=979; end_column=72; + law_headings= + ["Article L841-1"; + "Chapitre Ier : Champ d'application"; + "Titre IV : Allocations de logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie législative"; + "Code de la construction et de l'habitation"]} + ((Array.fold_left + (fun + (acc_: + integer) + (personne_a_charge_: + _) -> + if + ((log_end_call + ["ÉligibilitéAidesPersonnelleLogement"; + "condition_2_r823_4"] + ((log_variable_definition + ["ÉligibilitéAidesPersonnelleLogement"; + "condition_2_r823_4"; + "output"] + (embed_bool) + ((log_begin_call + ["ÉligibilitéAidesPersonnelleLogement"; + "condition_2_r823_4"] + eligibilite_commune_dot_condition_2_r823_4_) + ((log_variable_definition + ["ÉligibilitéAidesPersonnelleLogement"; + "condition_2_r823_4"; + "input"] + (embed_personne_a_charge) + personne_a_charge_))))))) + then + (acc_ +! + (integer_of_string + "1")) + else + acc_) + (integer_of_string + "0") + (menage_.Menage.personnes_a_charge)) + >=! + (integer_of_string + "1")))) + (fun (_: _) -> true))|]) + (fun (_: _) -> false) + (fun (_: _) -> raise EmptyError)))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_legislatif.catala_fr"; + start_line=937; start_column=5; + end_line=964; end_column=29; + law_headings=["Article L841-1"; + "Chapitre Ier : Champ d'application"; + "Titre IV : Allocations de logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie législative"; + "Code de la construction et de l'habitation"]} + (((Array.fold_left + (fun (acc_: integer) + (personne_a_charge_: _) -> + if + (match personne_a_charge_ + with + | PersonneACharge.EnfantACharge enfant_ -> + (not ((log_end_call + ["ÉligibilitéPrestationsFamiliales"; + "droit_ouvert"] + ((log_variable_definition + ["ÉligibilitéPrestationsFamiliales"; + "droit_ouvert"; + "output"] + (embed_bool) + ((log_begin_call + ["ÉligibilitéPrestationsFamiliales"; + "droit_ouvert"] + prestations_familiales_dot_droit_ouvert_) + ((log_variable_definition + ["ÉligibilitéPrestationsFamiliales"; + "droit_ouvert"; + "input"] + (embed_enfant_prestations_familiales) + {EnfantPrestationsFamiliales.identifiant = + (enfant_.EnfantACharge.identifiant); + EnfantPrestationsFamiliales.obligation_scolaire = + (enfant_.EnfantACharge.obligation_scolaire); + EnfantPrestationsFamiliales.remuneration_mensuelle = + (enfant_.EnfantACharge.remuneration_mensuelle); + EnfantPrestationsFamiliales.date_de_naissance = + (enfant_.EnfantACharge.date_de_naissance); + EnfantPrestationsFamiliales.age = + (enfant_.EnfantACharge.age); + EnfantPrestationsFamiliales.prise_en_charge = + (match + (enfant_.EnfantACharge.prise_en_charge) + with + | PriseEnCharge.EffectiveEtPermanente _ -> + (PriseEnChargeEnfant.EffectiveEtPermanente + ()) + | PriseEnCharge.ResidenceAlterneeAllocataireUnique _ -> + (PriseEnChargeEnfant.GardeAlterneeAllocataireUnique + ()) + | PriseEnCharge.ResidenceAlterneeAllocationsPartagee _ -> + (PriseEnChargeEnfant.GardeAlterneePartageAllocations + ())); + EnfantPrestationsFamiliales.a_deja_ouvert_droit_aux_allocations_familiales = + (enfant_.EnfantACharge.a_deja_ouvert_droit_aux_allocations_familiales); + EnfantPrestationsFamiliales.beneficie_titre_personnel_aide_personnelle_logement = + (enfant_.EnfantACharge.beneficie_titre_personnel_aide_personnelle_logement)})))))))) + | PersonneACharge.AutrePersonneACharge _ -> + false) then + (acc_ +! (integer_of_string + "1")) else acc_) + (integer_of_string "0") + (menage_.Menage.personnes_a_charge)) + = (integer_of_string "0")) && + (match + (menage_.Menage.situation_familiale) + with + | SituationFamiliale.Celibataire _ -> + false + | SituationFamiliale.Maries date_mariage_ -> + (date_courante_ <=@ + (date_mariage_ +@ + duree_l841_1_3_)) + | SituationFamiliale.Pacses _ -> + false + | SituationFamiliale.Concubins _ -> + false + | SituationFamiliale.CelibataireSepareDeFait _ -> + false + | SituationFamiliale.ConcubinageDontSepareDeFait _ -> + false)))) (fun (_: _) -> true))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_legislatif.catala_fr"; + start_line=902; start_column=5; + end_line=926; end_column=11; + law_headings=["Article L841-1"; + "Chapitre Ier : Champ d'application"; + "Titre IV : Allocations de logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie législative"; + "Code de la construction et de l'habitation"]} + ((Array.fold_left + (fun (acc_: integer) + (personne_a_charge_: _) -> + if + (match personne_a_charge_ + with + | PersonneACharge.EnfantACharge enfant_ -> + ((log_end_call + ["ÉligibilitéPrestationsFamiliales"; + "droit_ouvert"] + ((log_variable_definition + ["ÉligibilitéPrestationsFamiliales"; + "droit_ouvert"; "output"] + (embed_bool) ((log_begin_call + ["ÉligibilitéPrestationsFamiliales"; + "droit_ouvert"] + prestations_familiales_dot_droit_ouvert_) + ((log_variable_definition + ["ÉligibilitéPrestationsFamiliales"; + "droit_ouvert"; "input"] + (embed_enfant_prestations_familiales) + {EnfantPrestationsFamiliales.identifiant = + (enfant_.EnfantACharge.identifiant); + EnfantPrestationsFamiliales.obligation_scolaire = + (enfant_.EnfantACharge.obligation_scolaire); + EnfantPrestationsFamiliales.remuneration_mensuelle = + (enfant_.EnfantACharge.remuneration_mensuelle); + EnfantPrestationsFamiliales.date_de_naissance = + (enfant_.EnfantACharge.date_de_naissance); + EnfantPrestationsFamiliales.age = + (enfant_.EnfantACharge.age); + EnfantPrestationsFamiliales.prise_en_charge = + (match + (enfant_.EnfantACharge.prise_en_charge) + with + | PriseEnCharge.EffectiveEtPermanente _ -> + (PriseEnChargeEnfant.EffectiveEtPermanente + ()) + | PriseEnCharge.ResidenceAlterneeAllocataireUnique _ -> + (PriseEnChargeEnfant.GardeAlterneeAllocataireUnique + ()) + | PriseEnCharge.ResidenceAlterneeAllocationsPartagee _ -> + (PriseEnChargeEnfant.GardeAlterneePartageAllocations + ())); + EnfantPrestationsFamiliales.a_deja_ouvert_droit_aux_allocations_familiales = + (enfant_.EnfantACharge.a_deja_ouvert_droit_aux_allocations_familiales); + EnfantPrestationsFamiliales.beneficie_titre_personnel_aide_personnelle_logement = + (enfant_.EnfantACharge.beneficie_titre_personnel_aide_personnelle_logement)}))))))) + | PersonneACharge.AutrePersonneACharge _ -> + false) then + (acc_ +! (integer_of_string "1")) else + acc_) (integer_of_string "0") + (menage_.Menage.personnes_a_charge)) = + (integer_of_string "1")))) + (fun (_: _) -> true))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_legislatif.catala_fr"; + start_line=883; start_column=5; + end_line=887; end_column=52; + law_headings=["Article L841-1"; + "Chapitre Ier : Champ d'application"; + "Titre IV : Allocations de logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie législative"; + "Code de la construction et de l'habitation"]} + (Array.fold_left + (fun (acc_: bool) (prestation_: _) -> + acc_ || + ((prestation_ = + (PrestationRecue.AllocationsFamiliales ())) + || + ((prestation_ = + (PrestationRecue.ComplementFamilial ())) + || + ((prestation_ = + (PrestationRecue.AllocationSoutienFamilial + ())) || + (prestation_ = + (PrestationRecue.AllocationSoutienEnfantHandicape + ())))))) false + (menage_.Menage.prestations_recues)))) + (fun (_: _) -> true))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=431; start_column=11; end_line=431; end_column=52; + law_headings=["Éligibilité aux allocations de logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> false)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=431; start_column=11; end_line=431; end_column=52; + law_headings=["Éligibilité aux allocations de logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let eligibilite_l841_2_: EligibiliteAllocationLogement.t = (log_variable_definition + ["ÉligibilitéAllocationLogement"; "éligibilité_l841_2"] + (embed_eligibilite_allocation_logement) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=441; start_column=10; end_line=441; end_column=16; + law_headings=["Éligibilité aux allocations de logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=441; start_column=10; + end_line=441; end_column=16; + law_headings=["Éligibilité aux allocations de logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_legislatif.catala_fr"; + start_line=1148; start_column=5; + end_line=1151; end_column=28; + law_headings=["Article L841-4"; + "Chapitre Ier : Champ d'application"; + "Titre IV : Allocations de logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie législative"; + "Code de la construction et de l'habitation"]} + (match + ((menage_.Menage.logement).Logement.mode_occupation) + with + | ModeOccupation.Locataire _ -> false + | ModeOccupation.ResidentLogementFoyer _ -> false + | ModeOccupation.AccessionProprieteLocalUsageExclusifHabitation proprietaire_ -> + (((proprietaire_.Proprietaire.pret).Pret.date_signature) + >@ (date_of_numbers (2017) (12) (31))) + | ModeOccupation.SousLocataire _ -> false + | ModeOccupation.LocationAccession _ -> false))) + (fun (_: _) -> EligibiliteAllocationLogement.PasEligible ()))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_legislatif.catala_fr"; + start_line=1049; start_column=14; end_line=1049; end_column=25; + law_headings=["Article L841-2"; + "Chapitre Ier : Champ d'application"; + "Titre IV : Allocations de logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie législative"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + if + ((eligibilite_dispositions_communes_ = + (EligibiliteAllocationLogement.PasEligible ())) || + beneficie_aide_personnalisee_logement_) then + (EligibiliteAllocationLogement.PasEligible ()) else + ( if eligibilite_allocation_logement_familiale_ then + (EligibiliteAllocationLogement.AllocationLogementFamiliale + ()) else + ( if eligibilite_allocation_logement_sociale_ then + (EligibiliteAllocationLogement.AllocationLogementSociale + ()) else + (EligibiliteAllocationLogement.PasEligible ()))))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=441; start_column=10; end_line=441; end_column=16; + law_headings=["Éligibilité aux allocations de logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + let eligibilite_avec_condition_logement_: EligibiliteAllocationLogement.t = (log_variable_definition + ["ÉligibilitéAllocationLogement"; + "éligibilité_avec_condition_logement"] + (embed_eligibilite_allocation_logement) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=442; start_column=10; end_line=442; end_column=33; + law_headings=["Éligibilité aux allocations de logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=462; start_column=14; end_line=462; end_column=25; + law_headings=["Éligibilité aux allocations de logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> + if (not condition_logement_) then + (EligibiliteAllocationLogement.PasEligible ()) else + eligibilite_l841_2_)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=442; start_column=10; end_line=442; end_column=33; + law_headings=["Éligibilité aux allocations de logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})))) in + {EligibiliteAllocationLogementOut.eligibilite_avec_condition_logement_out = + eligibilite_avec_condition_logement_; + EligibiliteAllocationLogementOut.nombre_personnes_a_charge_prises_en_compte_out = + nombre_personnes_a_charge_prises_en_compte_; + EligibiliteAllocationLogementOut.coefficents_enfants_garde_alternee_pris_en_compte_out = + coefficents_enfants_garde_alternee_pris_en_compte_} + +let calcul_allocation_logement (calcul_allocation_logement_in: CalculAllocationLogementIn.t) : CalculAllocationLogementOut.t = + let mode_occupation_: ModeOccupation.t = calcul_allocation_logement_in.CalculAllocationLogementIn.mode_occupation_in in + let informations_calcul_: InformationsCalculAPL.t = calcul_allocation_logement_in.CalculAllocationLogementIn.informations_calcul_in in + let ressources_menage_sans_arrondi_: money = calcul_allocation_logement_in.CalculAllocationLogementIn.ressources_menage_sans_arrondi_in in + let situation_familiale_: SituationFamiliale.t = calcul_allocation_logement_in.CalculAllocationLogementIn.situation_familiale_in in + let nombre_personnes_a_charge_: integer = calcul_allocation_logement_in.CalculAllocationLogementIn.nombre_personnes_a_charge_in in + let zone_: ZoneDHabitation.t = calcul_allocation_logement_in.CalculAllocationLogementIn.zone_in in + let date_courante_: date = calcul_allocation_logement_in.CalculAllocationLogementIn.date_courante_in in + let type_aide_: TypeAidesPersonnelleLogement.t = calcul_allocation_logement_in.CalculAllocationLogementIn.type_aide_in in + let categorie_calcul_apl_: CategorieCalculAPL.t = (log_variable_definition + ["CalculAllocationLogement"; "catégorie_calcul_apl"] + (embed_categorie_calcul_a_p_l) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1017; start_column=11; end_line=1017; end_column=31; + law_headings=["Tous secteurs"; "Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1395; start_column=14; end_line=1395; end_column=34; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + match mode_occupation_ + with + | ModeOccupation.Locataire _ -> (CategorieCalculAPL.Location ()) + | ModeOccupation.ResidentLogementFoyer _ -> + (CategorieCalculAPL.LogementFoyer ()) + | ModeOccupation.AccessionProprieteLocalUsageExclusifHabitation _ -> + (CategorieCalculAPL.AccessionPropriete ()) + | ModeOccupation.SousLocataire _ -> + (CategorieCalculAPL.Location ()) + | ModeOccupation.LocationAccession _ -> + (CategorieCalculAPL.AccessionPropriete ()))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1017; start_column=11; end_line=1017; end_column=31; + law_headings=["Tous secteurs"; "Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})))) in + let ressources_menage_avec_arrondi_: money = (log_variable_definition + ["CalculAllocationLogement"; "ressources_ménage_avec_arrondi"] + (embed_money) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1010; start_column=10; end_line=1010; end_column=22; + law_headings=["Tous secteurs"; "Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=4871; start_column=14; end_line=4871; end_column=31; + law_headings=["Article D842-15"; + "Section 3 : Logements-foyers"; + "Chapitre 2 : Modalités de liquidation et de versement des allocations de logement"; + "Titre IV : Allocations de Logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + (money_round + ((ressources_menage_sans_arrondi_ +$ (money_of_cents_string + "4999")) *$ (decimal_of_string "0.01"))) *$ + (decimal_of_string "100."))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1010; start_column=10; end_line=1010; end_column=22; + law_headings=["Tous secteurs"; "Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})))) in + let situation_familiale_calcul_apl_: SituationFamilialeCalculAPL.t = (log_variable_definition + ["CalculAllocationLogement"; "situation_familiale_calcul_apl"] + (embed_situation_familiale_calcul_a_p_l) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1018; start_column=11; end_line=1018; end_column=41; + law_headings=["Tous secteurs"; "Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/arrete_2019-09-27.catala_fr"; + start_line=81; start_column=14; end_line=81; end_column=44; + law_headings=["Article 7"; + "Chapitre III : Calcul des aides personnelles au logement en secteur locatif"; + "Arrêté du 27 septembre 2019 relatif au calcul des aides personnelles au logement et de la prime de déménagement"]} + true)) + (fun (_: _) -> + match situation_familiale_ + with + | SituationFamiliale.Celibataire _ -> + (SituationFamilialeCalculAPL.PersonneSeule ()) + | SituationFamiliale.Maries _ -> + (SituationFamilialeCalculAPL.Couple ()) + | SituationFamiliale.Pacses _ -> + (SituationFamilialeCalculAPL.Couple ()) + | SituationFamiliale.Concubins _ -> + (SituationFamilialeCalculAPL.Couple ()) + | SituationFamiliale.CelibataireSepareDeFait _ -> + (SituationFamilialeCalculAPL.PersonneSeule ()) + | SituationFamiliale.ConcubinageDontSepareDeFait _ -> + (SituationFamilialeCalculAPL.Couple ()))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1018; start_column=11; end_line=1018; end_column=41; + law_headings=["Tous secteurs"; "Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})))) in + let accession_propriete_dot_ressources_menage_arrondies_base_: money = + try ((log_variable_definition + ["CalculAllocationLogement"; + "accession_propriété.ressources_ménage_arrondies_base"] + (embed_money) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1022; start_column=3; end_line=1022; end_column=22; + law_headings=["Tous secteurs"; "Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1610; start_column=14; end_line=1610; end_column=61; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) (fun (_: _) -> ressources_menage_avec_arrondi_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=855; start_column=10; end_line=855; end_column=37; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})) in + let accession_propriete_dot_nombre_personnes_a_charge_: integer = + try ((log_variable_definition + ["CalculAllocationLogement"; + "accession_propriété.nombre_personnes_à_charge"] (embed_integer) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1022; start_column=3; end_line=1022; end_column=22; + law_headings=["Tous secteurs"; "Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1616; start_column=14; end_line=1616; end_column=59; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) (fun (_: _) -> nombre_personnes_a_charge_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=858; start_column=10; end_line=858; end_column=35; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})) in + let accession_propriete_dot_situation_familiale_calcul_apl_: SituationFamilialeCalculAPL.t = + try ((log_variable_definition + ["CalculAllocationLogement"; + "accession_propriété.situation_familiale_calcul_apl"] + (embed_situation_familiale_calcul_a_p_l) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1022; start_column=3; end_line=1022; end_column=22; + law_headings=["Tous secteurs"; "Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1628; start_column=14; end_line=1628; end_column=64; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) (fun (_: _) -> situation_familiale_calcul_apl_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=859; start_column=10; end_line=859; end_column=40; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})) in + let accession_propriete_dot_zone_: ZoneDHabitation.t = + try ((log_variable_definition + ["CalculAllocationLogement"; "accession_propriété.zone"] + (embed_zone_d_habitation) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1022; start_column=3; end_line=1022; end_column=22; + law_headings=["Tous secteurs"; "Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1620; start_column=14; end_line=1620; end_column=38; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) (fun (_: _) -> zone_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=860; start_column=10; end_line=860; end_column=14; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})) in + let accession_propriete_dot_date_courante_: date = + try ((log_variable_definition + ["CalculAllocationLogement"; "accession_propriété.date_courante"] + (embed_date) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1022; start_column=3; end_line=1022; end_column=22; + law_headings=["Tous secteurs"; "Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1623; start_column=14; end_line=1623; end_column=47; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) (fun (_: _) -> date_courante_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=861; start_column=10; end_line=861; end_column=23; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})) in + let accession_propriete_dot_mensualite_principale_: money = + try ((log_variable_definition + ["CalculAllocationLogement"; + "accession_propriété.mensualité_principale"] (embed_money) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1022; start_column=3; end_line=1022; end_column=22; + law_headings=["Tous secteurs"; "Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1681; start_column=14; end_line=1681; end_column=55; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + match informations_calcul_ + with + | InformationsCalculAPL.InfosLocatif _ -> (money_of_cents_string + "0") + | InformationsCalculAPL.InfosLogementFoyer _ -> + (money_of_cents_string "0") + | InformationsCalculAPL.InfosAccessionPropriete infos_ -> + (infos_.InformationsCalculAPLAccessionPropriete.mensualite_principale))))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=862; start_column=10; end_line=862; end_column=31; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})) in + let accession_propriete_dot_situation_r822_11_13_17_: bool = + try ((log_variable_definition + ["CalculAllocationLogement"; + "accession_propriété.situation_r822_11_13_17"] (embed_bool) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1022; start_column=3; end_line=1022; end_column=22; + law_headings=["Tous secteurs"; "Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1713; start_column=14; end_line=1713; end_column=57; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + match informations_calcul_ + with + | InformationsCalculAPL.InfosLocatif _ -> false + | InformationsCalculAPL.InfosLogementFoyer _ -> false + | InformationsCalculAPL.InfosAccessionPropriete infos_ -> + (infos_.InformationsCalculAPLAccessionPropriete.situation_r822_11_13_17))))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=863; start_column=10; end_line=863; end_column=33; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})) in + let accession_propriete_dot_date_signature_pret_: date = + try ((log_variable_definition + ["CalculAllocationLogement"; + "accession_propriété.date_signature_prêt"] (embed_date) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1022; start_column=3; end_line=1022; end_column=22; + law_headings=["Tous secteurs"; "Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1692; start_column=14; end_line=1692; end_column=53; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + match informations_calcul_ + with + | InformationsCalculAPL.InfosLocatif _ -> + (date_of_numbers (2010) (1) (1)) + | InformationsCalculAPL.InfosLogementFoyer _ -> + (date_of_numbers (2010) (1) (1)) + | InformationsCalculAPL.InfosAccessionPropriete infos_ -> + (infos_.InformationsCalculAPLAccessionPropriete.date_signature_pret))))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=864; start_column=10; end_line=864; end_column=29; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})) in + let accession_propriete_dot_type_travaux_logement_: TypeTravauxLogementR8425.t = + try ((log_variable_definition + ["CalculAllocationLogement"; + "accession_propriété.type_travaux_logement"] + (embed_type_travaux_logement_r842_5) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1022; start_column=3; end_line=1022; end_column=22; + law_headings=["Tous secteurs"; "Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1686; start_column=14; end_line=1686; end_column=55; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + match informations_calcul_ + with + | InformationsCalculAPL.InfosLocatif _ -> + (TypeTravauxLogementR8425.PasDeTravaux ()) + | InformationsCalculAPL.InfosLogementFoyer _ -> + (TypeTravauxLogementR8425.PasDeTravaux ()) + | InformationsCalculAPL.InfosAccessionPropriete infos_ -> + (infos_.InformationsCalculAPLAccessionPropriete.type_travaux_logement_r842_5))))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=865; start_column=10; end_line=865; end_column=31; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})) in + let accession_propriete_dot_local_habite_premiere_fois_beneficiaire_: bool = + try ((log_variable_definition + ["CalculAllocationLogement"; + "accession_propriété.local_habité_première_fois_bénéficiaire"] + (embed_bool) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1022; start_column=3; end_line=1022; end_column=22; + law_headings=["Tous secteurs"; "Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1697; start_column=14; end_line=1697; end_column=73; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + match informations_calcul_ + with + | InformationsCalculAPL.InfosLocatif _ -> false + | InformationsCalculAPL.InfosLogementFoyer _ -> false + | InformationsCalculAPL.InfosAccessionPropriete infos_ -> + (infos_.InformationsCalculAPLAccessionPropriete.local_habite_premiere_fois_beneficiaire))))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=866; start_column=10; end_line=866; end_column=49; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})) in + let accession_propriete_dot_date_entree_logement_: date = + try ((log_variable_definition + ["CalculAllocationLogement"; + "accession_propriété.date_entrée_logement"] (embed_date) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1022; start_column=3; end_line=1022; end_column=22; + law_headings=["Tous secteurs"; "Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1703; start_column=14; end_line=1703; end_column=54; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + match informations_calcul_ + with + | InformationsCalculAPL.InfosLocatif _ -> + (date_of_numbers (2010) (1) (1)) + | InformationsCalculAPL.InfosLogementFoyer _ -> + (date_of_numbers (2010) (1) (1)) + | InformationsCalculAPL.InfosAccessionPropriete infos_ -> + (infos_.InformationsCalculAPLAccessionPropriete.date_entree_logement))))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=867; start_column=10; end_line=867; end_column=30; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})) in + let accession_propriete_dot_charges_mensuelles_pret_: money = + try ((log_variable_definition + ["CalculAllocationLogement"; + "accession_propriété.charges_mensuelles_prêt"] (embed_money) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1022; start_column=3; end_line=1022; end_column=22; + law_headings=["Tous secteurs"; "Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1718; start_column=14; end_line=1718; end_column=57; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + match informations_calcul_ + with + | InformationsCalculAPL.InfosLocatif _ -> (money_of_cents_string + "0") + | InformationsCalculAPL.InfosLogementFoyer _ -> + (money_of_cents_string "0") + | InformationsCalculAPL.InfosAccessionPropriete infos_ -> + (infos_.InformationsCalculAPLAccessionPropriete.charges_mensuelles_pret))))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=868; start_column=10; end_line=868; end_column=33; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})) in + let accession_propriete_dot_copropriete_: bool = + try ((log_variable_definition + ["CalculAllocationLogement"; "accession_propriété.copropriété"] + (embed_bool) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1022; start_column=3; end_line=1022; end_column=22; + law_headings=["Tous secteurs"; "Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1708; start_column=14; end_line=1708; end_column=45; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + match informations_calcul_ + with + | InformationsCalculAPL.InfosLocatif _ -> false + | InformationsCalculAPL.InfosLogementFoyer _ -> false + | InformationsCalculAPL.InfosAccessionPropriete infos_ -> + (infos_.InformationsCalculAPLAccessionPropriete.copropriete))))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=869; start_column=10; end_line=869; end_column=21; + law_headings=["Secteur accession à la propriété"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})) in + let result_: CalculAllocationLogementAccessionProprieteOut.t = (log_end_call + ["CalculAllocationLogement"; "accession_propriété"; + "CalculAllocationLogementAccessionPropriété"] ((log_begin_call + ["CalculAllocationLogement"; "accession_propriété"; + "CalculAllocationLogementAccessionPropriété"] + calcul_allocation_logement_accession_propriete) + {CalculAllocationLogementAccessionProprieteIn.ressources_menage_arrondies_base_in = + accession_propriete_dot_ressources_menage_arrondies_base_; + CalculAllocationLogementAccessionProprieteIn.nombre_personnes_a_charge_in = + accession_propriete_dot_nombre_personnes_a_charge_; + CalculAllocationLogementAccessionProprieteIn.situation_familiale_calcul_apl_in = + accession_propriete_dot_situation_familiale_calcul_apl_; + CalculAllocationLogementAccessionProprieteIn.zone_in = + accession_propriete_dot_zone_; + CalculAllocationLogementAccessionProprieteIn.date_courante_in = + accession_propriete_dot_date_courante_; + CalculAllocationLogementAccessionProprieteIn.mensualite_principale_in = + accession_propriete_dot_mensualite_principale_; + CalculAllocationLogementAccessionProprieteIn.situation_r822_11_13_17_in = + accession_propriete_dot_situation_r822_11_13_17_; + CalculAllocationLogementAccessionProprieteIn.date_signature_pret_in = + accession_propriete_dot_date_signature_pret_; + CalculAllocationLogementAccessionProprieteIn.type_travaux_logement_in = + accession_propriete_dot_type_travaux_logement_; + CalculAllocationLogementAccessionProprieteIn.local_habite_premiere_fois_beneficiaire_in = + accession_propriete_dot_local_habite_premiere_fois_beneficiaire_; + CalculAllocationLogementAccessionProprieteIn.date_entree_logement_in = + accession_propriete_dot_date_entree_logement_; + CalculAllocationLogementAccessionProprieteIn.charges_mensuelles_pret_in = + accession_propriete_dot_charges_mensuelles_pret_; + CalculAllocationLogementAccessionProprieteIn.copropriete_in = + accession_propriete_dot_copropriete_})) in + let accession_propriete_dot_aide_finale_formule_: money = result_.CalculAllocationLogementAccessionProprieteOut.aide_finale_formule_out in + let accession_propriete_dot_traitement_aide_finale_montant_minimal_: + money -> money = result_.CalculAllocationLogementAccessionProprieteOut.traitement_aide_finale_montant_minimal_out in + let logement_foyer_dot_redevance_: money = + try ((log_variable_definition + ["CalculAllocationLogement"; "logement_foyer.redevance"] (embed_money) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1021; start_column=3; end_line=1021; end_column=17; + law_headings=["Tous secteurs"; "Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1724; start_column=14; end_line=1724; end_column=38; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + match informations_calcul_ + with + | InformationsCalculAPL.InfosLocatif _ -> (money_of_cents_string + "0") + | InformationsCalculAPL.InfosLogementFoyer infos_ -> + (infos_.InformationsCalculAPLLogementFoyer.redevance) + | InformationsCalculAPL.InfosAccessionPropriete _ -> + (money_of_cents_string "0"))))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=948; start_column=10; end_line=948; end_column=19; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})) in + let logement_foyer_dot_mode_occupation_: ModeOccupation.t = + try ((log_variable_definition + ["CalculAllocationLogement"; "logement_foyer.mode_occupation"] + (embed_mode_occupation) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1021; start_column=3; end_line=1021; end_column=17; + law_headings=["Tous secteurs"; "Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1630; start_column=14; end_line=1630; end_column=44; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) (fun (_: _) -> mode_occupation_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=949; start_column=10; end_line=949; end_column=25; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})) in + let logement_foyer_dot_ressources_menage_arrondies_: money = + try ((log_variable_definition + ["CalculAllocationLogement"; + "logement_foyer.ressources_ménage_arrondies"] (embed_money) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1021; start_column=3; end_line=1021; end_column=17; + law_headings=["Tous secteurs"; "Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1608; start_column=14; end_line=1608; end_column=56; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) (fun (_: _) -> ressources_menage_avec_arrondi_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=950; start_column=10; end_line=950; end_column=37; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})) in + let logement_foyer_dot_nombre_personnes_a_charge_: integer = + try ((log_variable_definition + ["CalculAllocationLogement"; + "logement_foyer.nombre_personnes_à_charge"] (embed_integer) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1021; start_column=3; end_line=1021; end_column=17; + law_headings=["Tous secteurs"; "Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1614; start_column=14; end_line=1614; end_column=54; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) (fun (_: _) -> nombre_personnes_a_charge_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=951; start_column=10; end_line=951; end_column=35; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})) in + let logement_foyer_dot_situation_familiale_calcul_apl_: SituationFamilialeCalculAPL.t = + try ((log_variable_definition + ["CalculAllocationLogement"; + "logement_foyer.situation_familiale_calcul_apl"] + (embed_situation_familiale_calcul_a_p_l) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1021; start_column=3; end_line=1021; end_column=17; + law_headings=["Tous secteurs"; "Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1626; start_column=14; end_line=1626; end_column=59; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) (fun (_: _) -> situation_familiale_calcul_apl_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=952; start_column=10; end_line=952; end_column=40; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})) in + let logement_foyer_dot_zone_: ZoneDHabitation.t = + try ((log_variable_definition + ["CalculAllocationLogement"; "logement_foyer.zone"] + (embed_zone_d_habitation) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1021; start_column=3; end_line=1021; end_column=17; + law_headings=["Tous secteurs"; "Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1619; start_column=14; end_line=1619; end_column=33; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) (fun (_: _) -> zone_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=953; start_column=10; end_line=953; end_column=14; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})) in + let logement_foyer_dot_date_courante_: date = + try ((log_variable_definition + ["CalculAllocationLogement"; "logement_foyer.date_courante"] + (embed_date) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1021; start_column=3; end_line=1021; end_column=17; + law_headings=["Tous secteurs"; "Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1622; start_column=14; end_line=1622; end_column=42; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) (fun (_: _) -> date_courante_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=954; start_column=10; end_line=954; end_column=23; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})) in + let logement_foyer_dot_categorie_equivalence_loyer_d842_16_: CategorieEquivalenceLoyerAllocationLogementFoyer.t = + try ((log_variable_definition + ["CalculAllocationLogement"; + "logement_foyer.catégorie_équivalence_loyer_d842_16"] + (embed_categorie_equivalence_loyer_allocation_logement_foyer) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1021; start_column=3; end_line=1021; end_column=17; + law_headings=["Tous secteurs"; "Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1729; start_column=14; end_line=1729; end_column=64; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + match informations_calcul_ + with + | InformationsCalculAPL.InfosLocatif _ -> + (CategorieEquivalenceLoyerAllocationLogementFoyer.AutresPersonnes + ()) + | InformationsCalculAPL.InfosLogementFoyer infos_ -> + (infos_.InformationsCalculAPLLogementFoyer.categorie_equivalence_loyer_d842_16) + | InformationsCalculAPL.InfosAccessionPropriete _ -> + (CategorieEquivalenceLoyerAllocationLogementFoyer.AutresPersonnes + ()))))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=955; start_column=10; end_line=955; end_column=45; + law_headings=["Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})) in + let result_: CalculAllocationLogementFoyerOut.t = (log_end_call + ["CalculAllocationLogement"; "logement_foyer"; + "CalculAllocationLogementFoyer"] ((log_begin_call + ["CalculAllocationLogement"; "logement_foyer"; + "CalculAllocationLogementFoyer"] calcul_allocation_logement_foyer) + {CalculAllocationLogementFoyerIn.redevance_in = + logement_foyer_dot_redevance_; + CalculAllocationLogementFoyerIn.mode_occupation_in = + logement_foyer_dot_mode_occupation_; + CalculAllocationLogementFoyerIn.ressources_menage_arrondies_in = + logement_foyer_dot_ressources_menage_arrondies_; + CalculAllocationLogementFoyerIn.nombre_personnes_a_charge_in = + logement_foyer_dot_nombre_personnes_a_charge_; + CalculAllocationLogementFoyerIn.situation_familiale_calcul_apl_in = + logement_foyer_dot_situation_familiale_calcul_apl_; + CalculAllocationLogementFoyerIn.zone_in = logement_foyer_dot_zone_; + CalculAllocationLogementFoyerIn.date_courante_in = + logement_foyer_dot_date_courante_; + CalculAllocationLogementFoyerIn.categorie_equivalence_loyer_d842_16_in = + logement_foyer_dot_categorie_equivalence_loyer_d842_16_})) in + let logement_foyer_dot_coefficient_prise_en_charge_: decimal = result_.CalculAllocationLogementFoyerOut.coefficient_prise_en_charge_out in + let logement_foyer_dot_equivalence_loyer_: money = result_.CalculAllocationLogementFoyerOut.equivalence_loyer_out in + let logement_foyer_dot_montant_forfaitaire_charges_: money = result_.CalculAllocationLogementFoyerOut.montant_forfaitaire_charges_out in + let logement_foyer_dot_loyer_minimal_: money = result_.CalculAllocationLogementFoyerOut.loyer_minimal_out in + let logement_foyer_dot_aide_finale_formule_: money = result_.CalculAllocationLogementFoyerOut.aide_finale_formule_out in + let logement_foyer_dot_traitement_aide_finale_montant_minimal_: money -> + money = result_.CalculAllocationLogementFoyerOut.traitement_aide_finale_montant_minimal_out in + let locatif_dot_loyer_principal_: money = + try ((log_variable_definition + ["CalculAllocationLogement"; "locatif.loyer_principal"] (embed_money) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1020; start_column=3; end_line=1020; end_column=10; + law_headings=["Tous secteurs"; "Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1633; start_column=14; end_line=1633; end_column=37; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + match informations_calcul_ + with + | InformationsCalculAPL.InfosLocatif infos_ -> + (infos_.InformationsCalculAPLLocatif.loyer_principal) + | InformationsCalculAPL.InfosLogementFoyer _ -> + (money_of_cents_string "0") + | InformationsCalculAPL.InfosAccessionPropriete _ -> + (money_of_cents_string "0"))))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=790; start_column=10; end_line=790; end_column=25; + law_headings=["Secteur locatif"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})) in + let locatif_dot_ressources_menage_arrondies_: money = + try ((log_variable_definition + ["CalculAllocationLogement"; "locatif.ressources_ménage_arrondies"] + (embed_money) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1020; start_column=3; end_line=1020; end_column=10; + law_headings=["Tous secteurs"; "Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1607; start_column=14; end_line=1607; end_column=49; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) (fun (_: _) -> ressources_menage_avec_arrondi_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=791; start_column=10; end_line=791; end_column=37; + law_headings=["Secteur locatif"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})) in + let locatif_dot_beneficiaire_aide_adulte_ou_enfant_handicapes_: bool = + try ((log_variable_definition + ["CalculAllocationLogement"; + "locatif.bénéficiaire_aide_adulte_ou_enfant_handicapés"] + (embed_bool) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1020; start_column=3; end_line=1020; end_column=10; + law_headings=["Tous secteurs"; "Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1638; start_column=14; end_line=1638; end_column=67; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + match informations_calcul_ + with + | InformationsCalculAPL.InfosLocatif infos_ -> + (infos_.InformationsCalculAPLLocatif.beneficiaire_aide_adulte_ou_enfant_handicapes) + | InformationsCalculAPL.InfosLogementFoyer _ -> false + | InformationsCalculAPL.InfosAccessionPropriete _ -> false)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=792; start_column=10; end_line=792; end_column=55; + law_headings=["Secteur locatif"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})) in + let locatif_dot_date_courante_: date = + try ((log_variable_definition + ["CalculAllocationLogement"; "locatif.date_courante"] (embed_date) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1020; start_column=3; end_line=1020; end_column=10; + law_headings=["Tous secteurs"; "Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1621; start_column=14; end_line=1621; end_column=35; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) (fun (_: _) -> date_courante_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=794; start_column=10; end_line=794; end_column=23; + law_headings=["Secteur locatif"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})) in + let locatif_dot_nombre_personnes_a_charge_: integer = + try ((log_variable_definition + ["CalculAllocationLogement"; "locatif.nombre_personnes_à_charge"] + (embed_integer) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1020; start_column=3; end_line=1020; end_column=10; + law_headings=["Tous secteurs"; "Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1612; start_column=14; end_line=1612; end_column=47; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) (fun (_: _) -> nombre_personnes_a_charge_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=795; start_column=10; end_line=795; end_column=35; + law_headings=["Secteur locatif"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})) in + let locatif_dot_situation_familiale_calcul_apl_: SituationFamilialeCalculAPL.t = + try ((log_variable_definition + ["CalculAllocationLogement"; "locatif.situation_familiale_calcul_apl"] + (embed_situation_familiale_calcul_a_p_l) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1020; start_column=3; end_line=1020; end_column=10; + law_headings=["Tous secteurs"; "Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1624; start_column=14; end_line=1624; end_column=52; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) (fun (_: _) -> situation_familiale_calcul_apl_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=796; start_column=10; end_line=796; end_column=40; + law_headings=["Secteur locatif"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})) in + let locatif_dot_zone_: ZoneDHabitation.t = + try ((log_variable_definition + ["CalculAllocationLogement"; "locatif.zone"] (embed_zone_d_habitation) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1020; start_column=3; end_line=1020; end_column=10; + law_headings=["Tous secteurs"; "Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1618; start_column=14; end_line=1618; end_column=26; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) (fun (_: _) -> zone_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=797; start_column=10; end_line=797; end_column=14; + law_headings=["Secteur locatif"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})) in + let locatif_dot_logement_est_chambre_: bool = + try ((log_variable_definition + ["CalculAllocationLogement"; "locatif.logement_est_chambre"] + (embed_bool) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1020; start_column=3; end_line=1020; end_column=10; + law_headings=["Tous secteurs"; "Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1644; start_column=14; end_line=1644; end_column=42; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + match informations_calcul_ + with + | InformationsCalculAPL.InfosLocatif infos_ -> + (infos_.InformationsCalculAPLLocatif.logement_est_chambre) + | InformationsCalculAPL.InfosLogementFoyer _ -> false + | InformationsCalculAPL.InfosAccessionPropriete _ -> false)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=798; start_column=10; end_line=798; end_column=30; + law_headings=["Secteur locatif"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})) in + let locatif_dot_agees_ou_handicap_adultes_hebergees_onereux_particuliers_: bool = + try ((log_variable_definition + ["CalculAllocationLogement"; + "locatif.âgées_ou_handicap_adultes_hébergées_onéreux_particuliers"] + (embed_bool) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1020; start_column=3; end_line=1020; end_column=10; + law_headings=["Tous secteurs"; "Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1657; start_column=5; end_line=1657; end_column=69; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + match informations_calcul_ + with + | InformationsCalculAPL.InfosLocatif infos_ -> + (infos_.InformationsCalculAPLLocatif.agees_ou_handicap_adultes_hebergees_onereux_particuliers) + | InformationsCalculAPL.InfosLogementFoyer _ -> false + | InformationsCalculAPL.InfosAccessionPropriete _ -> false)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=799; start_column=10; end_line=799; end_column=66; + law_headings=["Secteur locatif"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})) in + let locatif_dot_type_aide_: TypeAidesPersonnelleLogement.t = + try ((log_variable_definition + ["CalculAllocationLogement"; "locatif.type_aide"] + (embed_type_aides_personnelle_logement) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1020; start_column=3; end_line=1020; end_column=10; + law_headings=["Tous secteurs"; "Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1664; start_column=14; end_line=1664; end_column=31; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) (fun (_: _) -> type_aide_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=801; start_column=10; end_line=801; end_column=19; + law_headings=["Secteur locatif"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})) in + let locatif_dot_colocation_: bool = + try ((log_variable_definition + ["CalculAllocationLogement"; "locatif.colocation"] (embed_bool) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1020; start_column=3; end_line=1020; end_column=10; + law_headings=["Tous secteurs"; "Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1650; start_column=14; end_line=1650; end_column=32; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + match informations_calcul_ + with + | InformationsCalculAPL.InfosLocatif infos_ -> + (infos_.InformationsCalculAPLLocatif.colocation) + | InformationsCalculAPL.InfosLogementFoyer _ -> false + | InformationsCalculAPL.InfosAccessionPropriete _ -> false)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=802; start_column=10; end_line=802; end_column=20; + law_headings=["Secteur locatif"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})) in + let locatif_dot_reduction_loyer_solidarite_: money = + try ((log_variable_definition + ["CalculAllocationLogement"; "locatif.réduction_loyer_solidarité"] + (embed_money) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1020; start_column=3; end_line=1020; end_column=10; + law_headings=["Tous secteurs"; "Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1665; start_column=14; end_line=1665; end_column=48; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + match informations_calcul_ + with + | InformationsCalculAPL.InfosLocatif infos_ -> + (infos_.InformationsCalculAPLLocatif.reduction_loyer_solidarite) + | InformationsCalculAPL.InfosLogementFoyer _ -> + (money_of_cents_string "0") + | InformationsCalculAPL.InfosAccessionPropriete _ -> + (money_of_cents_string "0"))))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=803; start_column=10; end_line=803; end_column=36; + law_headings=["Secteur locatif"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})) in + let locatif_dot_logement_meuble_d842_2_: bool = + try ((log_variable_definition + ["CalculAllocationLogement"; "locatif.logement_meublé_d842_2"] + (embed_bool) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1020; start_column=3; end_line=1020; end_column=10; + law_headings=["Tous secteurs"; "Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1670; start_column=14; end_line=1670; end_column=44; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + match informations_calcul_ + with + | InformationsCalculAPL.InfosLocatif infos_ -> + (infos_.InformationsCalculAPLLocatif.logement_meuble_d842_2) + | InformationsCalculAPL.InfosLogementFoyer _ -> false + | InformationsCalculAPL.InfosAccessionPropriete _ -> false)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=806; start_column=10; end_line=806; end_column=32; + law_headings=["Secteur locatif"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})) in + let locatif_dot_changement_logement_d842_4_: ChangementLogementD8424.t = + try ((log_variable_definition + ["CalculAllocationLogement"; "locatif.changement_logement_d842_4"] + (embed_changement_logement_d842_4) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1020; start_column=3; end_line=1020; end_column=10; + law_headings=["Tous secteurs"; "Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1675; start_column=14; end_line=1675; end_column=48; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + match informations_calcul_ + with + | InformationsCalculAPL.InfosLocatif infos_ -> + (infos_.InformationsCalculAPLLocatif.changement_logement_d842_4) + | InformationsCalculAPL.InfosLogementFoyer _ -> + (ChangementLogementD8424.PasDeChangement ()) + | InformationsCalculAPL.InfosAccessionPropriete _ -> + (ChangementLogementD8424.PasDeChangement ()))))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=807; start_column=10; end_line=807; end_column=36; + law_headings=["Secteur locatif"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})) in + let result_: CalculAllocationLogementLocatifOut.t = (log_end_call + ["CalculAllocationLogement"; "locatif"; + "CalculAllocationLogementLocatif"] ((log_begin_call + ["CalculAllocationLogement"; "locatif"; + "CalculAllocationLogementLocatif"] calcul_allocation_logement_locatif) + {CalculAllocationLogementLocatifIn.loyer_principal_in = + locatif_dot_loyer_principal_; + CalculAllocationLogementLocatifIn.ressources_menage_arrondies_in = + locatif_dot_ressources_menage_arrondies_; + CalculAllocationLogementLocatifIn.beneficiaire_aide_adulte_ou_enfant_handicapes_in = + locatif_dot_beneficiaire_aide_adulte_ou_enfant_handicapes_; + CalculAllocationLogementLocatifIn.date_courante_in = + locatif_dot_date_courante_; + CalculAllocationLogementLocatifIn.nombre_personnes_a_charge_in = + locatif_dot_nombre_personnes_a_charge_; + CalculAllocationLogementLocatifIn.situation_familiale_calcul_apl_in = + locatif_dot_situation_familiale_calcul_apl_; + CalculAllocationLogementLocatifIn.zone_in = locatif_dot_zone_; + CalculAllocationLogementLocatifIn.logement_est_chambre_in = + locatif_dot_logement_est_chambre_; + CalculAllocationLogementLocatifIn.agees_ou_handicap_adultes_hebergees_onereux_particuliers_in = + locatif_dot_agees_ou_handicap_adultes_hebergees_onereux_particuliers_; + CalculAllocationLogementLocatifIn.type_aide_in = + locatif_dot_type_aide_; + CalculAllocationLogementLocatifIn.colocation_in = + locatif_dot_colocation_; + CalculAllocationLogementLocatifIn.reduction_loyer_solidarite_in = + locatif_dot_reduction_loyer_solidarite_; + CalculAllocationLogementLocatifIn.logement_meuble_d842_2_in = + locatif_dot_logement_meuble_d842_2_; + CalculAllocationLogementLocatifIn.changement_logement_d842_4_in = + locatif_dot_changement_logement_d842_4_})) in + let locatif_dot_aide_finale_formule_: money = result_.CalculAllocationLogementLocatifOut.aide_finale_formule_out in + let locatif_dot_traitement_aide_finale_: money -> money = result_.CalculAllocationLogementLocatifOut.traitement_aide_finale_out in + let traitement_aide_finale_: money -> money = (log_variable_definition + ["CalculAllocationLogement"; "traitement_aide_finale"] (unembeddable) ( + try + (fun (param_: money) -> + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1026; start_column=10; + end_line=1026; end_column=32; + law_headings=["Tous secteurs"; "Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1408; start_column=14; + end_line=1408; end_column=36; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + match categorie_calcul_apl_ + with + | CategorieCalculAPL.Location _ -> ((log_end_call + ["CalculAllocationLogementLocatif"; + "traitement_aide_finale"] ((log_variable_definition + ["CalculAllocationLogementLocatif"; + "traitement_aide_finale"; "output"] (embed_money) + ((log_begin_call + ["CalculAllocationLogementLocatif"; + "traitement_aide_finale"] + locatif_dot_traitement_aide_finale_) + ((log_variable_definition + ["CalculAllocationLogementLocatif"; + "traitement_aide_finale"; "input"] (embed_money) + param_))))))) + | CategorieCalculAPL.AccessionPropriete _ -> ((log_end_call + ["CalculAllocationLogementAccessionPropriété"; + "traitement_aide_finale_montant_minimal"] + ((log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "traitement_aide_finale_montant_minimal"; "output"] + (embed_money) ((log_begin_call + ["CalculAllocationLogementAccessionPropriété"; + "traitement_aide_finale_montant_minimal"] + accession_propriete_dot_traitement_aide_finale_montant_minimal_) + ((log_variable_definition + ["CalculAllocationLogementAccessionPropriété"; + "traitement_aide_finale_montant_minimal"; "input"] + (embed_money) param_))))))) + | CategorieCalculAPL.LogementFoyer _ -> ((log_end_call + ["CalculAllocationLogementFoyer"; + "traitement_aide_finale_montant_minimal"] + ((log_variable_definition + ["CalculAllocationLogementFoyer"; + "traitement_aide_finale_montant_minimal"; "output"] + (embed_money) ((log_begin_call + ["CalculAllocationLogementFoyer"; + "traitement_aide_finale_montant_minimal"] + logement_foyer_dot_traitement_aide_finale_montant_minimal_) + ((log_variable_definition + ["CalculAllocationLogementFoyer"; + "traitement_aide_finale_montant_minimal"; "input"] + (embed_money) param_))))))))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1026; start_column=10; end_line=1026; end_column=32; + law_headings=["Tous secteurs"; "Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]}))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1026; start_column=10; end_line=1026; end_column=32; + law_headings=["Tous secteurs"; "Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})))) in + let aide_finale_formule_: money = (log_variable_definition + ["CalculAllocationLogement"; "aide_finale_formule"] (embed_money) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1025; start_column=10; end_line=1025; end_column=29; + law_headings=["Tous secteurs"; "Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1403; start_column=14; end_line=1403; end_column=33; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + match categorie_calcul_apl_ + with + | CategorieCalculAPL.Location _ -> + locatif_dot_aide_finale_formule_ + | CategorieCalculAPL.AccessionPropriete _ -> + accession_propriete_dot_aide_finale_formule_ + | CategorieCalculAPL.LogementFoyer _ -> + logement_foyer_dot_aide_finale_formule_)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1025; start_column=10; end_line=1025; end_column=29; + law_headings=["Tous secteurs"; "Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})))) in + let _: unit = if ( + try + ( if + (match categorie_calcul_apl_ + with + | CategorieCalculAPL.Location _ -> false + | CategorieCalculAPL.AccessionPropriete _ -> true + | CategorieCalculAPL.LogementFoyer _ -> false) then + (match informations_calcul_ + with + | InformationsCalculAPL.InfosLocatif _ -> false + | InformationsCalculAPL.InfosLogementFoyer _ -> false + | InformationsCalculAPL.InfosAccessionPropriete _ -> + true) else true) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1603; start_column=5; + end_line=1605; end_column=15; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]}))) + then () else + raise (AssertionFailed {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1603; start_column=5; + end_line=1605; end_column=15; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]}) in + let _: unit = if ( + try + ( if + (match categorie_calcul_apl_ + with + | CategorieCalculAPL.Location _ -> false + | CategorieCalculAPL.AccessionPropriete _ -> false + | CategorieCalculAPL.LogementFoyer _ -> true) then + (match informations_calcul_ + with + | InformationsCalculAPL.InfosLocatif _ -> false + | InformationsCalculAPL.InfosLogementFoyer _ -> true + | InformationsCalculAPL.InfosAccessionPropriete _ -> + false) else true) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1599; start_column=5; + end_line=1601; end_column=15; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]}))) + then () else + raise (AssertionFailed {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1599; start_column=5; + end_line=1601; end_column=15; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]}) in + let _: unit = if ( + try + ( if + (match categorie_calcul_apl_ + with + | CategorieCalculAPL.Location _ -> true + | CategorieCalculAPL.AccessionPropriete _ -> false + | CategorieCalculAPL.LogementFoyer _ -> false) then + (match informations_calcul_ + with + | InformationsCalculAPL.InfosLocatif _ -> true + | InformationsCalculAPL.InfosLogementFoyer _ -> false + | InformationsCalculAPL.InfosAccessionPropriete _ -> + false) else true) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1595; start_column=5; + end_line=1597; end_column=15; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]}))) + then () else + raise (AssertionFailed {filename = "examples/aides_logement/code_construction_reglementaire.catala_fr"; + start_line=1595; start_column=5; + end_line=1597; end_column=15; + law_headings=["Article D823-9"; + "Section 1 : Calcul, liquidation et versement des aides"; + "Chapitre III : Modalités de liquidation et de versement"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie réglementaire"; + "Code de la construction et de l'habitation"]}) in + {CalculAllocationLogementOut.aide_finale_formule_out = aide_finale_formule_; + CalculAllocationLogementOut.traitement_aide_finale_out = + traitement_aide_finale_} + +let calculette_aides_au_logement (calculette_aides_au_logement_in: CalculetteAidesAuLogementIn.t) : CalculetteAidesAuLogementOut.t = + let menage_: Menage.t = calculette_aides_au_logement_in.CalculetteAidesAuLogementIn.menage_in in + let demandeur_: Demandeur.t = calculette_aides_au_logement_in.CalculetteAidesAuLogementIn.demandeur_in in + let informations_calcul_: InformationsCalculAPL.t = calculette_aides_au_logement_in.CalculetteAidesAuLogementIn.informations_calcul_in in + let date_courante_: date = calculette_aides_au_logement_in.CalculetteAidesAuLogementIn.date_courante_in in + let ressources_menage_prises_en_compte_: money = calculette_aides_au_logement_in.CalculetteAidesAuLogementIn.ressources_menage_prises_en_compte_in in + let eligibilite_allocation_logement_dot_date_courante_: date = + try ((log_variable_definition + ["CalculetteAidesAuLogement"; + "éligibilité_allocation_logement.date_courante"] (embed_date) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1079; start_column=3; end_line=1079; end_column=34; + law_headings=["Calculette globale"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1105; start_column=14; end_line=1105; end_column=59; + law_headings=["Calculette globale"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> date_courante_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=423; start_column=10; end_line=423; end_column=23; + law_headings=["Éligibilité aux allocations de logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let eligibilite_allocation_logement_dot_menage_: Menage.t = + try ((log_variable_definition + ["CalculetteAidesAuLogement"; + "éligibilité_allocation_logement.ménage"] (embed_menage) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1079; start_column=3; end_line=1079; end_column=34; + law_headings=["Calculette globale"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1097; start_column=14; end_line=1097; end_column=52; + law_headings=["Calculette globale"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> menage_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=424; start_column=10; end_line=424; end_column=16; + law_headings=["Éligibilité aux allocations de logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let eligibilite_allocation_logement_dot_demandeur_: Demandeur.t = + try ((log_variable_definition + ["CalculetteAidesAuLogement"; + "éligibilité_allocation_logement.demandeur"] (embed_demandeur) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1079; start_column=3; end_line=1079; end_column=34; + law_headings=["Calculette globale"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1101; start_column=14; end_line=1101; end_column=55; + law_headings=["Calculette globale"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> demandeur_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=425; start_column=10; end_line=425; end_column=19; + law_headings=["Éligibilité aux allocations de logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let eligibilite_allocation_logement_dot_beneficie_aide_personnalisee_logement_: bool = + try ((log_variable_definition + ["CalculetteAidesAuLogement"; + "éligibilité_allocation_logement.bénéficie_aide_personnalisée_logement"] + (embed_bool) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1079; start_column=3; end_line=1079; end_column=34; + law_headings=["Calculette globale"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_legislatif.catala_fr"; + start_line=1066; start_column=5; end_line=1066; end_column=74; + law_headings=["Article L841-2"; + "Chapitre Ier : Champ d'application"; + "Titre IV : Allocations de logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie législative"; + "Code de la construction et de l'habitation"]} + true)) (fun (_: _) -> false)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=426; start_column=10; end_line=426; end_column=47; + law_headings=["Éligibilité aux allocations de logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let eligibilite_allocation_logement_dot_informations_calcul_: InformationsCalculAPL.t = + try ((log_variable_definition + ["CalculetteAidesAuLogement"; + "éligibilité_allocation_logement.informations_calcul"] + (embed_informations_calcul_a_p_l) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1079; start_column=3; end_line=1079; end_column=34; + law_headings=["Calculette globale"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1107; start_column=14; end_line=1107; end_column=65; + law_headings=["Calculette globale"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> informations_calcul_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=427; start_column=10; end_line=427; end_column=29; + law_headings=["Éligibilité aux allocations de logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let result_: EligibiliteAllocationLogementOut.t = (log_end_call + ["CalculetteAidesAuLogement"; "éligibilité_allocation_logement"; + "ÉligibilitéAllocationLogement"] ((log_begin_call + ["CalculetteAidesAuLogement"; "éligibilité_allocation_logement"; + "ÉligibilitéAllocationLogement"] eligibilite_allocation_logement) + {EligibiliteAllocationLogementIn.date_courante_in = + eligibilite_allocation_logement_dot_date_courante_; + EligibiliteAllocationLogementIn.menage_in = + eligibilite_allocation_logement_dot_menage_; + EligibiliteAllocationLogementIn.demandeur_in = + eligibilite_allocation_logement_dot_demandeur_; + EligibiliteAllocationLogementIn.beneficie_aide_personnalisee_logement_in = + eligibilite_allocation_logement_dot_beneficie_aide_personnalisee_logement_; + EligibiliteAllocationLogementIn.informations_calcul_in = + eligibilite_allocation_logement_dot_informations_calcul_})) in + let eligibilite_allocation_logement_dot_eligibilite_avec_condition_logement_: EligibiliteAllocationLogement.t = result_.EligibiliteAllocationLogementOut.eligibilite_avec_condition_logement_out in + let eligibilite_allocation_logement_dot_nombre_personnes_a_charge_prises_en_compte_: integer = result_.EligibiliteAllocationLogementOut.nombre_personnes_a_charge_prises_en_compte_out in + let eligibilite_allocation_logement_dot_coefficents_enfants_garde_alternee_pris_en_compte_: + decimal array = result_.EligibiliteAllocationLogementOut.coefficents_enfants_garde_alternee_pris_en_compte_out in + let eligibilite_aide_personnalisee_logement_dot_menage_: Menage.t = + try ((log_variable_definition + ["CalculetteAidesAuLogement"; + "éligibilité_aide_personnalisée_logement.ménage"] (embed_menage) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1076; start_column=3; end_line=1076; end_column=42; + law_headings=["Calculette globale"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1095; start_column=14; end_line=1095; end_column=60; + law_headings=["Calculette globale"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> menage_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=386; start_column=10; end_line=386; end_column=16; + law_headings=["Éligibilité à l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let eligibilite_aide_personnalisee_logement_dot_demandeur_: Demandeur.t = + try ((log_variable_definition + ["CalculetteAidesAuLogement"; + "éligibilité_aide_personnalisée_logement.demandeur"] + (embed_demandeur) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1076; start_column=3; end_line=1076; end_column=42; + law_headings=["Calculette globale"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1099; start_column=14; end_line=1099; end_column=63; + law_headings=["Calculette globale"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> demandeur_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=387; start_column=10; end_line=387; end_column=19; + law_headings=["Éligibilité à l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let eligibilite_aide_personnalisee_logement_dot_date_courante_: date = + try ((log_variable_definition + ["CalculetteAidesAuLogement"; + "éligibilité_aide_personnalisée_logement.date_courante"] + (embed_date) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1076; start_column=3; end_line=1076; end_column=42; + law_headings=["Calculette globale"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1103; start_column=14; end_line=1103; end_column=67; + law_headings=["Calculette globale"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> date_courante_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=388; start_column=17; end_line=388; end_column=30; + law_headings=["Éligibilité à l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let result_: EligibiliteAidePersonnaliseeLogementOut.t = (log_end_call + ["CalculetteAidesAuLogement"; + "éligibilité_aide_personnalisée_logement"; + "ÉligibilitéAidePersonnaliséeLogement"] ((log_begin_call + ["CalculetteAidesAuLogement"; + "éligibilité_aide_personnalisée_logement"; + "ÉligibilitéAidePersonnaliséeLogement"] + eligibilite_aide_personnalisee_logement) + {EligibiliteAidePersonnaliseeLogementIn.menage_in = + eligibilite_aide_personnalisee_logement_dot_menage_; + EligibiliteAidePersonnaliseeLogementIn.demandeur_in = + eligibilite_aide_personnalisee_logement_dot_demandeur_; + EligibiliteAidePersonnaliseeLogementIn.date_courante_in = + eligibilite_aide_personnalisee_logement_dot_date_courante_})) in + let eligibilite_aide_personnalisee_logement_dot_date_courante_: date = result_.EligibiliteAidePersonnaliseeLogementOut.date_courante_out in + let eligibilite_aide_personnalisee_logement_dot_eligibilite_: bool = result_.EligibiliteAidePersonnaliseeLogementOut.eligibilite_out in + let eligibilite_aide_personnalisee_logement_dot_nombre_personnes_a_charge_prises_en_compte_: integer = result_.EligibiliteAidePersonnaliseeLogementOut.nombre_personnes_a_charge_prises_en_compte_out in + let eligibilite_aide_personnalisee_logement_dot_coefficents_enfants_garde_alternee_pris_en_compte_: + decimal array = result_.EligibiliteAidePersonnaliseeLogementOut.coefficents_enfants_garde_alternee_pris_en_compte_out in + let calcul_allocation_logement_dot_mode_occupation_: ModeOccupation.t = + try ((log_variable_definition + ["CalculetteAidesAuLogement"; + "calcul_allocation_logement.mode_occupation"] (embed_mode_occupation) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1085; start_column=3; end_line=1085; end_column=29; + law_headings=["Calculette globale"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1120; start_column=14; end_line=1120; end_column=56; + law_headings=["Calculette globale"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> (menage_.Menage.logement).Logement.mode_occupation)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1006; start_column=10; end_line=1006; end_column=25; + law_headings=["Tous secteurs"; "Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})) in + let calcul_allocation_logement_dot_informations_calcul_: InformationsCalculAPL.t = + try ((log_variable_definition + ["CalculetteAidesAuLogement"; + "calcul_allocation_logement.informations_calcul"] + (embed_informations_calcul_a_p_l) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1085; start_column=3; end_line=1085; end_column=29; + law_headings=["Calculette globale"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1085; start_column=3; + end_line=1085; end_column=29; + law_headings=["Calculette globale"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1085; start_column=3; + end_line=1085; end_column=29; + law_headings=["Calculette globale"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1116; start_column=14; + end_line=1116; end_column=60; + law_headings=["Calculette globale"; + "Prologue : aides au logement"]} + true)) (fun (_: _) -> informations_calcul_))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1112; start_column=14; + end_line=1112; end_column=60; + law_headings=["Calculette globale"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> informations_calcul_))|]) + (fun (_: _) -> false) (fun (_: _) -> raise EmptyError)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1007; start_column=10; end_line=1007; end_column=29; + law_headings=["Tous secteurs"; "Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})) in + let calcul_allocation_logement_dot_ressources_menage_sans_arrondi_: money = + try ((log_variable_definition + ["CalculetteAidesAuLogement"; + "calcul_allocation_logement.ressources_ménage_sans_arrondi"] + (embed_money) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1085; start_column=3; end_line=1085; end_column=29; + law_headings=["Calculette globale"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1124; start_column=14; end_line=1124; end_column=58; + law_headings=["Calculette globale"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> ressources_menage_prises_en_compte_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1008; start_column=10; end_line=1008; end_column=27; + law_headings=["Tous secteurs"; "Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})) in + let calcul_allocation_logement_dot_situation_familiale_: SituationFamiliale.t = + try ((log_variable_definition + ["CalculetteAidesAuLogement"; + "calcul_allocation_logement.situation_familiale"] + (embed_situation_familiale) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1085; start_column=3; end_line=1085; end_column=29; + law_headings=["Calculette globale"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1128; start_column=14; end_line=1128; end_column=60; + law_headings=["Calculette globale"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> menage_.Menage.situation_familiale)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1011; start_column=10; end_line=1011; end_column=29; + law_headings=["Tous secteurs"; "Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})) in + let calcul_allocation_logement_dot_nombre_personnes_a_charge_: integer = + try ((log_variable_definition + ["CalculetteAidesAuLogement"; + "calcul_allocation_logement.nombre_personnes_à_charge"] + (embed_integer) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1085; start_column=3; end_line=1085; end_column=29; + law_headings=["Calculette globale"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1135; start_column=14; end_line=1135; end_column=66; + law_headings=["Calculette globale"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> + eligibilite_allocation_logement_dot_nombre_personnes_a_charge_prises_en_compte_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1012; start_column=10; end_line=1012; end_column=35; + law_headings=["Tous secteurs"; "Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})) in + let calcul_allocation_logement_dot_zone_: ZoneDHabitation.t = + try ((log_variable_definition + ["CalculetteAidesAuLogement"; "calcul_allocation_logement.zone"] + (embed_zone_d_habitation) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1085; start_column=3; end_line=1085; end_column=29; + law_headings=["Calculette globale"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1139; start_column=14; end_line=1139; end_column=45; + law_headings=["Calculette globale"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> (menage_.Menage.logement).Logement.zone)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1013; start_column=10; end_line=1013; end_column=14; + law_headings=["Tous secteurs"; "Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})) in + let calcul_allocation_logement_dot_date_courante_: date = + try ((log_variable_definition + ["CalculetteAidesAuLogement"; + "calcul_allocation_logement.date_courante"] (embed_date) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1085; start_column=3; end_line=1085; end_column=29; + law_headings=["Calculette globale"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1143; start_column=14; end_line=1143; end_column=54; + law_headings=["Calculette globale"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> date_courante_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1014; start_column=10; end_line=1014; end_column=23; + law_headings=["Tous secteurs"; "Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})) in + let calcul_allocation_logement_dot_type_aide_: TypeAidesPersonnelleLogement.t = + try ((log_variable_definition + ["CalculetteAidesAuLogement"; "calcul_allocation_logement.type_aide"] + (embed_type_aides_personnelle_logement) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1085; start_column=3; end_line=1085; end_column=29; + law_headings=["Calculette globale"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_legislatif.catala_fr"; + start_line=1082; start_column=14; end_line=1082; end_column=50; + law_headings=["Article L841-2"; + "Chapitre Ier : Champ d'application"; + "Titre IV : Allocations de logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie législative"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + match + eligibilite_allocation_logement_dot_eligibilite_avec_condition_logement_ + with + | EligibiliteAllocationLogement.PasEligible _ -> + (TypeAidesPersonnelleLogement.AllocationLogementSociale ()) + | EligibiliteAllocationLogement.AllocationLogementFamiliale _ -> + (TypeAidesPersonnelleLogement.AllocationLogementFamiliale ()) + | EligibiliteAllocationLogement.AllocationLogementSociale _ -> + (TypeAidesPersonnelleLogement.AllocationLogementSociale ()))))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1015; start_column=10; end_line=1015; end_column=19; + law_headings=["Tous secteurs"; "Secteur logement-foyer"; + "Calcul du montant de l'allocation logement"; + "Prologue : aides au logement"]})) in + let result_: CalculAllocationLogementOut.t = (log_end_call + ["CalculetteAidesAuLogement"; "calcul_allocation_logement"; + "CalculAllocationLogement"] ((log_begin_call + ["CalculetteAidesAuLogement"; "calcul_allocation_logement"; + "CalculAllocationLogement"] calcul_allocation_logement) + {CalculAllocationLogementIn.mode_occupation_in = + calcul_allocation_logement_dot_mode_occupation_; + CalculAllocationLogementIn.informations_calcul_in = + calcul_allocation_logement_dot_informations_calcul_; + CalculAllocationLogementIn.ressources_menage_sans_arrondi_in = + calcul_allocation_logement_dot_ressources_menage_sans_arrondi_; + CalculAllocationLogementIn.situation_familiale_in = + calcul_allocation_logement_dot_situation_familiale_; + CalculAllocationLogementIn.nombre_personnes_a_charge_in = + calcul_allocation_logement_dot_nombre_personnes_a_charge_; + CalculAllocationLogementIn.zone_in = + calcul_allocation_logement_dot_zone_; + CalculAllocationLogementIn.date_courante_in = + calcul_allocation_logement_dot_date_courante_; + CalculAllocationLogementIn.type_aide_in = + calcul_allocation_logement_dot_type_aide_})) in + let calcul_allocation_logement_dot_aide_finale_formule_: money = result_.CalculAllocationLogementOut.aide_finale_formule_out in + let calcul_allocation_logement_dot_traitement_aide_finale_: money -> money = result_.CalculAllocationLogementOut.traitement_aide_finale_out in + let calcul_aide_personnalisee_logement_dot_mode_occupation_: ModeOccupation.t = + try ((log_variable_definition + ["CalculetteAidesAuLogement"; + "calcul_aide_personnalisée_logement.mode_occupation"] + (embed_mode_occupation) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1082; start_column=3; end_line=1082; end_column=37; + law_headings=["Calculette globale"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1118; start_column=14; end_line=1118; end_column=64; + law_headings=["Calculette globale"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> (menage_.Menage.logement).Logement.mode_occupation)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=751; start_column=10; end_line=751; end_column=25; + law_headings=["Tous secteurs"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let calcul_aide_personnalisee_logement_dot_type_aide_: TypeAidesPersonnelleLogement.t = + try ((log_variable_definition + ["CalculetteAidesAuLogement"; + "calcul_aide_personnalisée_logement.type_aide"] + (embed_type_aides_personnelle_logement) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1082; start_column=3; end_line=1082; end_column=37; + law_headings=["Calculette globale"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_legislatif.catala_fr"; + start_line=1080; start_column=14; end_line=1080; end_column=58; + law_headings=["Article L841-2"; + "Chapitre Ier : Champ d'application"; + "Titre IV : Allocations de logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie législative"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + TypeAidesPersonnelleLogement.AidePersonnaliseeLogement ())))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=752; start_column=10; end_line=752; end_column=19; + law_headings=["Tous secteurs"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let calcul_aide_personnalisee_logement_dot_informations_calcul_: InformationsCalculAPL.t = + try ((log_variable_definition + ["CalculetteAidesAuLogement"; + "calcul_aide_personnalisée_logement.informations_calcul"] + (embed_informations_calcul_a_p_l) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1082; start_column=3; end_line=1082; end_column=37; + law_headings=["Calculette globale"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1082; start_column=3; + end_line=1082; end_column=37; + law_headings=["Calculette globale"; + "Prologue : aides au logement"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1082; start_column=3; + end_line=1082; end_column=37; + law_headings=["Calculette globale"; + "Prologue : aides au logement"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1114; start_column=14; + end_line=1114; end_column=68; + law_headings=["Calculette globale"; + "Prologue : aides au logement"]} + true)) (fun (_: _) -> informations_calcul_))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1110; start_column=14; + end_line=1110; end_column=68; + law_headings=["Calculette globale"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> informations_calcul_))|]) + (fun (_: _) -> false) (fun (_: _) -> raise EmptyError)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=753; start_column=10; end_line=753; end_column=29; + law_headings=["Tous secteurs"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let calcul_aide_personnalisee_logement_dot_ressources_menage_sans_arrondi_: money = + try ((log_variable_definition + ["CalculetteAidesAuLogement"; + "calcul_aide_personnalisée_logement.ressources_ménage_sans_arrondi"] + (embed_money) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1082; start_column=3; end_line=1082; end_column=37; + law_headings=["Calculette globale"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1122; start_column=14; end_line=1122; end_column=66; + law_headings=["Calculette globale"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> ressources_menage_prises_en_compte_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=754; start_column=10; end_line=754; end_column=27; + law_headings=["Tous secteurs"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let calcul_aide_personnalisee_logement_dot_situation_familiale_: SituationFamiliale.t = + try ((log_variable_definition + ["CalculetteAidesAuLogement"; + "calcul_aide_personnalisée_logement.situation_familiale"] + (embed_situation_familiale) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1082; start_column=3; end_line=1082; end_column=37; + law_headings=["Calculette globale"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1126; start_column=14; end_line=1126; end_column=68; + law_headings=["Calculette globale"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> menage_.Menage.situation_familiale)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=757; start_column=10; end_line=757; end_column=29; + law_headings=["Tous secteurs"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let calcul_aide_personnalisee_logement_dot_nombre_personnes_a_charge_: integer = + try ((log_variable_definition + ["CalculetteAidesAuLogement"; + "calcul_aide_personnalisée_logement.nombre_personnes_à_charge"] + (embed_integer) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1082; start_column=3; end_line=1082; end_column=37; + law_headings=["Calculette globale"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1131; start_column=5; end_line=1131; end_column=65; + law_headings=["Calculette globale"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> + eligibilite_aide_personnalisee_logement_dot_nombre_personnes_a_charge_prises_en_compte_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=758; start_column=10; end_line=758; end_column=35; + law_headings=["Tous secteurs"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let calcul_aide_personnalisee_logement_dot_zone_: ZoneDHabitation.t = + try ((log_variable_definition + ["CalculetteAidesAuLogement"; + "calcul_aide_personnalisée_logement.zone"] (embed_zone_d_habitation) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1082; start_column=3; end_line=1082; end_column=37; + law_headings=["Calculette globale"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1137; start_column=14; end_line=1137; end_column=53; + law_headings=["Calculette globale"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> (menage_.Menage.logement).Logement.zone)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=759; start_column=10; end_line=759; end_column=14; + law_headings=["Tous secteurs"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let calcul_aide_personnalisee_logement_dot_date_courante_: date = + try ((log_variable_definition + ["CalculetteAidesAuLogement"; + "calcul_aide_personnalisée_logement.date_courante"] (embed_date) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1082; start_column=3; end_line=1082; end_column=37; + law_headings=["Calculette globale"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1141; start_column=14; end_line=1141; end_column=62; + law_headings=["Calculette globale"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> date_courante_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=760; start_column=10; end_line=760; end_column=23; + law_headings=["Tous secteurs"; + "Calcul du montant de l'aide personnalisée au logement"; + "Déclarations des champs d'application"; + "Prologue : aides au logement"]})) in + let result_: CalculAidePersonnaliseeLogementOut.t = (log_end_call + ["CalculetteAidesAuLogement"; "calcul_aide_personnalisée_logement"; + "CalculAidePersonnaliséeLogement"] ((log_begin_call + ["CalculetteAidesAuLogement"; "calcul_aide_personnalisée_logement"; + "CalculAidePersonnaliséeLogement"] calcul_aide_personnalisee_logement) + {CalculAidePersonnaliseeLogementIn.mode_occupation_in = + calcul_aide_personnalisee_logement_dot_mode_occupation_; + CalculAidePersonnaliseeLogementIn.type_aide_in = + calcul_aide_personnalisee_logement_dot_type_aide_; + CalculAidePersonnaliseeLogementIn.informations_calcul_in = + calcul_aide_personnalisee_logement_dot_informations_calcul_; + CalculAidePersonnaliseeLogementIn.ressources_menage_sans_arrondi_in = + calcul_aide_personnalisee_logement_dot_ressources_menage_sans_arrondi_; + CalculAidePersonnaliseeLogementIn.situation_familiale_in = + calcul_aide_personnalisee_logement_dot_situation_familiale_; + CalculAidePersonnaliseeLogementIn.nombre_personnes_a_charge_in = + calcul_aide_personnalisee_logement_dot_nombre_personnes_a_charge_; + CalculAidePersonnaliseeLogementIn.zone_in = + calcul_aide_personnalisee_logement_dot_zone_; + CalculAidePersonnaliseeLogementIn.date_courante_in = + calcul_aide_personnalisee_logement_dot_date_courante_})) in + let calcul_aide_personnalisee_logement_dot_aide_finale_formule_: money = result_.CalculAidePersonnaliseeLogementOut.aide_finale_formule_out in + let calcul_aide_personnalisee_logement_dot_traitement_aide_finale_: + money -> money = result_.CalculAidePersonnaliseeLogementOut.traitement_aide_finale_out in + let coefficents_enfants_garde_alternee_pris_en_compte_: decimal array = (log_variable_definition + ["CalculetteAidesAuLogement"; + "coefficents_enfants_garde_alternée_pris_en_compte"] + (embed_array (embed_decimal)) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1091; start_column=10; end_line=1091; end_column=59; + law_headings=["Calculette globale"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1146; start_column=14; end_line=1146; end_column=63; + law_headings=["Calculette globale"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> + eligibilite_aide_personnalisee_logement_dot_coefficents_enfants_garde_alternee_pris_en_compte_)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1091; start_column=10; end_line=1091; end_column=59; + law_headings=["Calculette globale"; "Prologue : aides au logement"]})))) in + let eligibilite_: bool = (log_variable_definition + ["CalculetteAidesAuLogement"; "éligibilité"] (embed_bool) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1088; start_column=10; end_line=1088; end_column=21; + law_headings=["Calculette globale"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_legislatif.catala_fr"; + start_line=1071; start_column=14; end_line=1071; end_column=25; + law_headings=["Article L841-2"; + "Chapitre Ier : Champ d'application"; + "Titre IV : Allocations de logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie législative"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + eligibilite_aide_personnalisee_logement_dot_eligibilite_ || + (match + eligibilite_allocation_logement_dot_eligibilite_avec_condition_logement_ + with + | EligibiliteAllocationLogement.PasEligible _ -> false + | EligibiliteAllocationLogement.AllocationLogementFamiliale _ -> + true + | EligibiliteAllocationLogement.AllocationLogementSociale _ -> + true))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1088; start_column=10; end_line=1088; end_column=21; + law_headings=["Calculette globale"; "Prologue : aides au logement"]})))) in + let traitement_aide_finale_: money -> money = (log_variable_definition + ["CalculetteAidesAuLogement"; "traitement_aide_finale"] (unembeddable) ( + try + (fun (param_: money) -> + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1090; start_column=10; + end_line=1090; end_column=32; + law_headings=["Calculette globale"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_legislatif.catala_fr"; + start_line=1109; start_column=14; + end_line=1109; end_column=36; + law_headings=["Article L841-2"; + "Chapitre Ier : Champ d'application"; + "Titre IV : Allocations de logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie législative"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + if (not eligibilite_) then param_ else + ( if + (eligibilite_aide_personnalisee_logement_dot_eligibilite_ + && + (not + (match + eligibilite_allocation_logement_dot_eligibilite_avec_condition_logement_ + with + | EligibiliteAllocationLogement.PasEligible _ -> + true + | EligibiliteAllocationLogement.AllocationLogementFamiliale _ -> + false + | EligibiliteAllocationLogement.AllocationLogementSociale _ -> + false))) then + ( if + (((log_end_call + ["CalculAidePersonnaliséeLogement"; + "traitement_aide_finale"] + ((log_variable_definition + ["CalculAidePersonnaliséeLogement"; + "traitement_aide_finale"; "output"] + (embed_money) ((log_begin_call + ["CalculAidePersonnaliséeLogement"; + "traitement_aide_finale"] + calcul_aide_personnalisee_logement_dot_traitement_aide_finale_) + ((log_variable_definition + ["CalculAidePersonnaliséeLogement"; + "traitement_aide_finale"; "input"] + (embed_money) + calcul_aide_personnalisee_logement_dot_aide_finale_formule_))))))) + >$ ((log_end_call + ["CalculAllocationLogement"; + "traitement_aide_finale"] + ((log_variable_definition + ["CalculAllocationLogement"; + "traitement_aide_finale"; "output"] + (embed_money) ((log_begin_call + ["CalculAllocationLogement"; + "traitement_aide_finale"] + calcul_allocation_logement_dot_traitement_aide_finale_) + ((log_variable_definition + ["CalculAllocationLogement"; + "traitement_aide_finale"; "input"] + (embed_money) + calcul_allocation_logement_dot_aide_finale_formule_)))))))) + then + ((log_end_call + ["CalculAidePersonnaliséeLogement"; + "traitement_aide_finale"] + ((log_variable_definition + ["CalculAidePersonnaliséeLogement"; + "traitement_aide_finale"; "output"] + (embed_money) ((log_begin_call + ["CalculAidePersonnaliséeLogement"; + "traitement_aide_finale"] + calcul_aide_personnalisee_logement_dot_traitement_aide_finale_) + ((log_variable_definition + ["CalculAidePersonnaliséeLogement"; + "traitement_aide_finale"; "input"] (embed_money) + param_))))))) else + ((log_end_call + ["CalculAllocationLogement"; + "traitement_aide_finale"] + ((log_variable_definition + ["CalculAllocationLogement"; + "traitement_aide_finale"; "output"] + (embed_money) ((log_begin_call + ["CalculAllocationLogement"; + "traitement_aide_finale"] + calcul_allocation_logement_dot_traitement_aide_finale_) + ((log_variable_definition + ["CalculAllocationLogement"; + "traitement_aide_finale"; "input"] (embed_money) + param_)))))))) else + ( if + eligibilite_aide_personnalisee_logement_dot_eligibilite_ + then + ((log_end_call + ["CalculAidePersonnaliséeLogement"; + "traitement_aide_finale"] + ((log_variable_definition + ["CalculAidePersonnaliséeLogement"; + "traitement_aide_finale"; "output"] + (embed_money) ((log_begin_call + ["CalculAidePersonnaliséeLogement"; + "traitement_aide_finale"] + calcul_aide_personnalisee_logement_dot_traitement_aide_finale_) + ((log_variable_definition + ["CalculAidePersonnaliséeLogement"; + "traitement_aide_finale"; "input"] (embed_money) + param_))))))) else + ((log_end_call + ["CalculAllocationLogement"; + "traitement_aide_finale"] + ((log_variable_definition + ["CalculAllocationLogement"; + "traitement_aide_finale"; "output"] + (embed_money) ((log_begin_call + ["CalculAllocationLogement"; + "traitement_aide_finale"] + calcul_allocation_logement_dot_traitement_aide_finale_) + ((log_variable_definition + ["CalculAllocationLogement"; + "traitement_aide_finale"; "input"] (embed_money) + param_))))))))))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1090; start_column=10; end_line=1090; end_column=32; + law_headings=["Calculette globale"; + "Prologue : aides au logement"]}))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1090; start_column=10; end_line=1090; end_column=32; + law_headings=["Calculette globale"; "Prologue : aides au logement"]})))) in + let aide_finale_formule_: money = (log_variable_definition + ["CalculetteAidesAuLogement"; "aide_finale_formule"] (embed_money) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1089; start_column=10; end_line=1089; end_column=29; + law_headings=["Calculette globale"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/code_construction_legislatif.catala_fr"; + start_line=1092; start_column=14; end_line=1092; end_column=33; + law_headings=["Article L841-2"; + "Chapitre Ier : Champ d'application"; + "Titre IV : Allocations de logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie législative"; + "Code de la construction et de l'habitation"]} + true)) + (fun (_: _) -> + if (not eligibilite_) then (money_of_cents_string "0") else + ( if + (eligibilite_aide_personnalisee_logement_dot_eligibilite_ && + (not + (match + eligibilite_allocation_logement_dot_eligibilite_avec_condition_logement_ + with + | EligibiliteAllocationLogement.PasEligible _ -> true + | EligibiliteAllocationLogement.AllocationLogementFamiliale _ -> + false + | EligibiliteAllocationLogement.AllocationLogementSociale _ -> + false))) then + ( if + (((log_end_call + ["CalculAidePersonnaliséeLogement"; + "traitement_aide_finale"] ((log_variable_definition + ["CalculAidePersonnaliséeLogement"; + "traitement_aide_finale"; "output"] (embed_money) + ((log_begin_call + ["CalculAidePersonnaliséeLogement"; + "traitement_aide_finale"] + calcul_aide_personnalisee_logement_dot_traitement_aide_finale_) + ((log_variable_definition + ["CalculAidePersonnaliséeLogement"; + "traitement_aide_finale"; "input"] (embed_money) + calcul_aide_personnalisee_logement_dot_aide_finale_formule_))))))) + >$ ((log_end_call + ["CalculAllocationLogement"; "traitement_aide_finale"] + ((log_variable_definition + ["CalculAllocationLogement"; "traitement_aide_finale"; + "output"] (embed_money) ((log_begin_call + ["CalculAllocationLogement"; "traitement_aide_finale"] + calcul_allocation_logement_dot_traitement_aide_finale_) + ((log_variable_definition + ["CalculAllocationLogement"; "traitement_aide_finale"; + "input"] (embed_money) + calcul_allocation_logement_dot_aide_finale_formule_)))))))) + then + calcul_aide_personnalisee_logement_dot_aide_finale_formule_ + else calcul_allocation_logement_dot_aide_finale_formule_) + else + ( if + eligibilite_aide_personnalisee_logement_dot_eligibilite_ + then + calcul_aide_personnalisee_logement_dot_aide_finale_formule_ + else calcul_allocation_logement_dot_aide_finale_formule_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1089; start_column=10; end_line=1089; end_column=29; + law_headings=["Calculette globale"; "Prologue : aides au logement"]})))) in + {CalculetteAidesAuLogementOut.eligibilite_out = eligibilite_; + CalculetteAidesAuLogementOut.aide_finale_formule_out = + aide_finale_formule_; + CalculetteAidesAuLogementOut.traitement_aide_finale_out = + traitement_aide_finale_; + CalculetteAidesAuLogementOut.coefficents_enfants_garde_alternee_pris_en_compte_out = + coefficents_enfants_garde_alternee_pris_en_compte_} + +let calculette_aides_au_logement_garde_alternee (calculette_aides_au_logement_garde_alternee_in: CalculetteAidesAuLogementGardeAlterneeIn.t) : CalculetteAidesAuLogementGardeAlterneeOut.t = + let menage_: Menage.t = calculette_aides_au_logement_garde_alternee_in.CalculetteAidesAuLogementGardeAlterneeIn.menage_in in + let demandeur_: Demandeur.t = calculette_aides_au_logement_garde_alternee_in.CalculetteAidesAuLogementGardeAlterneeIn.demandeur_in in + let informations_calcul_: InformationsCalculAPL.t = calculette_aides_au_logement_garde_alternee_in.CalculetteAidesAuLogementGardeAlterneeIn.informations_calcul_in in + let date_courante_: date = calculette_aides_au_logement_garde_alternee_in.CalculetteAidesAuLogementGardeAlterneeIn.date_courante_in in + let ressources_menage_prises_en_compte_: money = calculette_aides_au_logement_garde_alternee_in.CalculetteAidesAuLogementGardeAlterneeIn.ressources_menage_prises_en_compte_in in + let menage_sans_enfants_garde_alternee_: Menage.t = (log_variable_definition + ["CalculetteAidesAuLogementGardeAlternée"; + "ménage_sans_enfants_garde_alternée"] (embed_menage) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1166; start_column=11; end_line=1166; end_column=45; + law_headings=["Calculette avec garde alternée"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1202; start_column=14; end_line=1202; end_column=48; + law_headings=["Calculette avec garde alternée"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> + {Menage.prestations_recues = (menage_.Menage.prestations_recues); + Menage.logement = (menage_.Menage.logement); + Menage.personnes_a_charge = + (array_filter + (fun (personne_a_charge_: _) -> + match personne_a_charge_ + with + | PersonneACharge.EnfantACharge enfant_ -> + (match + (enfant_.EnfantACharge.situation_garde_alternee) + with + | SituationGardeAlternee.PasDeGardeAlternee _ -> + true + | SituationGardeAlternee.GardeAlterneeCoefficientPriseEnCharge _ -> + false) + | PersonneACharge.AutrePersonneACharge _ -> true) + (menage_.Menage.personnes_a_charge)); + Menage.nombre_autres_occupants_logement = + (menage_.Menage.nombre_autres_occupants_logement); + Menage.situation_familiale = + (menage_.Menage.situation_familiale); + Menage.condition_rattache_foyer_fiscal_parent_ifi = + (menage_.Menage.condition_rattache_foyer_fiscal_parent_ifi); + Menage.nombre_enfants_a_naitre_apres_troisieme_mois_grossesse = + (menage_.Menage.nombre_enfants_a_naitre_apres_troisieme_mois_grossesse); + Menage.enfant_a_naitre_apres_quatrieme_mois_grossesse = + (menage_.Menage.enfant_a_naitre_apres_quatrieme_mois_grossesse); + Menage.date_naissance_troisieme_enfant_ou_dernier_si_plus = + (menage_.Menage.date_naissance_troisieme_enfant_ou_dernier_si_plus)})) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1166; start_column=11; end_line=1166; end_column=45; + law_headings=["Calculette avec garde alternée"; + "Prologue : aides au logement"]})))) in + let calculette_dot_menage_: Menage.t = + try ((log_variable_definition + ["CalculetteAidesAuLogementGardeAlternée"; "calculette.ménage"] + (embed_menage) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1170; start_column=3; end_line=1170; end_column=13; + law_headings=["Calculette avec garde alternée"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1177; start_column=14; end_line=1177; end_column=31; + law_headings=["Calculette avec garde alternée"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> menage_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1066; start_column=10; end_line=1066; end_column=16; + law_headings=["Calculette globale"; "Prologue : aides au logement"]})) in + let calculette_dot_demandeur_: Demandeur.t = + try ((log_variable_definition + ["CalculetteAidesAuLogementGardeAlternée"; "calculette.demandeur"] + (embed_demandeur) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1170; start_column=3; end_line=1170; end_column=13; + law_headings=["Calculette avec garde alternée"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1179; start_column=14; end_line=1179; end_column=34; + law_headings=["Calculette avec garde alternée"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> demandeur_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1067; start_column=10; end_line=1067; end_column=19; + law_headings=["Calculette globale"; "Prologue : aides au logement"]})) in + let calculette_dot_informations_calcul_: InformationsCalculAPL.t = + try ((log_variable_definition + ["CalculetteAidesAuLogementGardeAlternée"; + "calculette.informations_calcul"] (embed_informations_calcul_a_p_l) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1170; start_column=3; end_line=1170; end_column=13; + law_headings=["Calculette avec garde alternée"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1181; start_column=14; end_line=1181; end_column=44; + law_headings=["Calculette avec garde alternée"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> informations_calcul_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1068; start_column=10; end_line=1068; end_column=29; + law_headings=["Calculette globale"; "Prologue : aides au logement"]})) in + let calculette_dot_date_courante_: date = + try ((log_variable_definition + ["CalculetteAidesAuLogementGardeAlternée"; "calculette.date_courante"] + (embed_date) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1170; start_column=3; end_line=1170; end_column=13; + law_headings=["Calculette avec garde alternée"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1183; start_column=14; end_line=1183; end_column=38; + law_headings=["Calculette avec garde alternée"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> date_courante_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1069; start_column=10; end_line=1069; end_column=23; + law_headings=["Calculette globale"; "Prologue : aides au logement"]})) in + let calculette_dot_ressources_menage_prises_en_compte_: money = + try ((log_variable_definition + ["CalculetteAidesAuLogementGardeAlternée"; + "calculette.ressources_ménage_prises_en_compte"] (embed_money) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1170; start_column=3; end_line=1170; end_column=13; + law_headings=["Calculette avec garde alternée"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1185; start_column=14; end_line=1185; end_column=59; + law_headings=["Calculette avec garde alternée"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> ressources_menage_prises_en_compte_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1074; start_column=10; end_line=1074; end_column=44; + law_headings=["Calculette globale"; "Prologue : aides au logement"]})) in + let result_: CalculetteAidesAuLogementOut.t = (log_end_call + ["CalculetteAidesAuLogementGardeAlternée"; "calculette"; + "CalculetteAidesAuLogement"] ((log_begin_call + ["CalculetteAidesAuLogementGardeAlternée"; "calculette"; + "CalculetteAidesAuLogement"] calculette_aides_au_logement) + {CalculetteAidesAuLogementIn.menage_in = calculette_dot_menage_; + CalculetteAidesAuLogementIn.demandeur_in = calculette_dot_demandeur_; + CalculetteAidesAuLogementIn.informations_calcul_in = + calculette_dot_informations_calcul_; + CalculetteAidesAuLogementIn.date_courante_in = + calculette_dot_date_courante_; + CalculetteAidesAuLogementIn.ressources_menage_prises_en_compte_in = + calculette_dot_ressources_menage_prises_en_compte_})) in + let calculette_dot_eligibilite_: bool = result_.CalculetteAidesAuLogementOut.eligibilite_out in + let calculette_dot_aide_finale_formule_: money = result_.CalculetteAidesAuLogementOut.aide_finale_formule_out in + let calculette_dot_traitement_aide_finale_: money -> money = result_.CalculetteAidesAuLogementOut.traitement_aide_finale_out in + let calculette_dot_coefficents_enfants_garde_alternee_pris_en_compte_: + decimal array = result_.CalculetteAidesAuLogementOut.coefficents_enfants_garde_alternee_pris_en_compte_out in + let calculette_sans_garde_alternee_dot_menage_: Menage.t = + try ((log_variable_definition + ["CalculetteAidesAuLogementGardeAlternée"; + "calculette_sans_garde_alternée.ménage"] (embed_menage) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1171; start_column=3; end_line=1171; end_column=33; + law_headings=["Calculette avec garde alternée"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1187; start_column=14; end_line=1187; end_column=51; + law_headings=["Calculette avec garde alternée"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> menage_sans_enfants_garde_alternee_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1066; start_column=10; end_line=1066; end_column=16; + law_headings=["Calculette globale"; "Prologue : aides au logement"]})) in + let calculette_sans_garde_alternee_dot_demandeur_: Demandeur.t = + try ((log_variable_definition + ["CalculetteAidesAuLogementGardeAlternée"; + "calculette_sans_garde_alternée.demandeur"] (embed_demandeur) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1171; start_column=3; end_line=1171; end_column=33; + law_headings=["Calculette avec garde alternée"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1189; start_column=14; end_line=1189; end_column=54; + law_headings=["Calculette avec garde alternée"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> demandeur_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1067; start_column=10; end_line=1067; end_column=19; + law_headings=["Calculette globale"; "Prologue : aides au logement"]})) in + let calculette_sans_garde_alternee_dot_informations_calcul_: InformationsCalculAPL.t = + try ((log_variable_definition + ["CalculetteAidesAuLogementGardeAlternée"; + "calculette_sans_garde_alternée.informations_calcul"] + (embed_informations_calcul_a_p_l) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1171; start_column=3; end_line=1171; end_column=33; + law_headings=["Calculette avec garde alternée"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1191; start_column=14; end_line=1191; end_column=64; + law_headings=["Calculette avec garde alternée"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> informations_calcul_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1068; start_column=10; end_line=1068; end_column=29; + law_headings=["Calculette globale"; "Prologue : aides au logement"]})) in + let calculette_sans_garde_alternee_dot_date_courante_: date = + try ((log_variable_definition + ["CalculetteAidesAuLogementGardeAlternée"; + "calculette_sans_garde_alternée.date_courante"] (embed_date) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1171; start_column=3; end_line=1171; end_column=33; + law_headings=["Calculette avec garde alternée"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1193; start_column=14; end_line=1193; end_column=58; + law_headings=["Calculette avec garde alternée"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> date_courante_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1069; start_column=10; end_line=1069; end_column=23; + law_headings=["Calculette globale"; "Prologue : aides au logement"]})) in + let calculette_sans_garde_alternee_dot_ressources_menage_prises_en_compte_: money = + try ((log_variable_definition + ["CalculetteAidesAuLogementGardeAlternée"; + "calculette_sans_garde_alternée.ressources_ménage_prises_en_compte"] + (embed_money) + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1171; start_column=3; end_line=1171; end_column=33; + law_headings=["Calculette avec garde alternée"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1196; start_column=5; end_line=1196; end_column=70; + law_headings=["Calculette avec garde alternée"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> ressources_menage_prises_en_compte_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1074; start_column=10; end_line=1074; end_column=44; + law_headings=["Calculette globale"; "Prologue : aides au logement"]})) in + let result_: CalculetteAidesAuLogementOut.t = (log_end_call + ["CalculetteAidesAuLogementGardeAlternée"; + "calculette_sans_garde_alternée"; "CalculetteAidesAuLogement"] + ((log_begin_call + ["CalculetteAidesAuLogementGardeAlternée"; + "calculette_sans_garde_alternée"; "CalculetteAidesAuLogement"] + calculette_aides_au_logement) + {CalculetteAidesAuLogementIn.menage_in = + calculette_sans_garde_alternee_dot_menage_; + CalculetteAidesAuLogementIn.demandeur_in = + calculette_sans_garde_alternee_dot_demandeur_; + CalculetteAidesAuLogementIn.informations_calcul_in = + calculette_sans_garde_alternee_dot_informations_calcul_; + CalculetteAidesAuLogementIn.date_courante_in = + calculette_sans_garde_alternee_dot_date_courante_; + CalculetteAidesAuLogementIn.ressources_menage_prises_en_compte_in = + calculette_sans_garde_alternee_dot_ressources_menage_prises_en_compte_})) in + let calculette_sans_garde_alternee_dot_eligibilite_: bool = result_.CalculetteAidesAuLogementOut.eligibilite_out in + let calculette_sans_garde_alternee_dot_aide_finale_formule_: money = result_.CalculetteAidesAuLogementOut.aide_finale_formule_out in + let calculette_sans_garde_alternee_dot_traitement_aide_finale_: money -> + money = result_.CalculetteAidesAuLogementOut.traitement_aide_finale_out in + let calculette_sans_garde_alternee_dot_coefficents_enfants_garde_alternee_pris_en_compte_: + decimal array = result_.CalculetteAidesAuLogementOut.coefficents_enfants_garde_alternee_pris_en_compte_out in + let eligibilite_: bool = (log_variable_definition + ["CalculetteAidesAuLogementGardeAlternée"; "éligibilité"] (embed_bool) + ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1173; start_column=10; end_line=1173; end_column=21; + law_headings=["Calculette avec garde alternée"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1233; start_column=14; end_line=1233; end_column=25; + law_headings=["Calculette avec garde alternée"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> calculette_dot_eligibilite_)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1173; start_column=10; end_line=1173; end_column=21; + law_headings=["Calculette avec garde alternée"; + "Prologue : aides au logement"]})))) in + let coefficents_enfants_garde_alternee_pris_en_compte_: decimal array = (log_variable_definition + ["CalculetteAidesAuLogementGardeAlternée"; + "coefficents_enfants_garde_alternée_pris_en_compte"] + (embed_array (embed_decimal)) ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1167; start_column=11; end_line=1167; end_column=60; + law_headings=["Calculette avec garde alternée"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1200; start_column=14; end_line=1200; end_column=63; + law_headings=["Calculette avec garde alternée"; + "Prologue : aides au logement"]} true)) + (fun (_: _) -> + calculette_dot_coefficents_enfants_garde_alternee_pris_en_compte_)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1167; start_column=11; end_line=1167; end_column=60; + law_headings=["Calculette avec garde alternée"; + "Prologue : aides au logement"]})))) in + let aide_finale_: money = (log_variable_definition + ["CalculetteAidesAuLogementGardeAlternée"; "aide_finale"] (embed_money) + ( + try + (handle_default + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1174; start_column=10; end_line=1174; end_column=21; + law_headings=["Calculette avec garde alternée"; + "Prologue : aides au logement"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/aides_logement/autres_sources.catala_fr"; + start_line=235; start_column=14; end_line=235; end_column=25; + law_headings=["Conseil d'État, 5ème - 4ème chambres réunies, 21/07/2017, 398563"]} + true)) + (fun (_: _) -> (log_end_call + ["CalculetteAidesAuLogement"; "traitement_aide_finale"] + ((log_variable_definition + ["CalculetteAidesAuLogement"; "traitement_aide_finale"; "output"] + (embed_money) ((log_begin_call + ["CalculetteAidesAuLogement"; "traitement_aide_finale"] + calculette_dot_traitement_aide_finale_) ((log_variable_definition + ["CalculetteAidesAuLogement"; "traitement_aide_finale"; "input"] + (embed_money) + (calculette_sans_garde_alternee_dot_aide_finale_formule_ +$ + ( if + ((array_length + coefficents_enfants_garde_alternee_pris_en_compte_) = + (integer_of_string "0")) then + (money_of_cents_string "0") else + ((calculette_dot_aide_finale_formule_ -$ + calculette_sans_garde_alternee_dot_aide_finale_formule_) + *$ + ((Array.fold_left + (fun (acc_: decimal) (coeff_: _) -> acc_ +& coeff_) + (decimal_of_string "0.") + coefficents_enfants_garde_alternee_pris_en_compte_) + /& + (decimal_of_integer + (array_length + coefficents_enfants_garde_alternee_pris_en_compte_)))))))))))))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/aides_logement/prologue.catala_fr"; + start_line=1174; start_column=10; end_line=1174; end_column=21; + law_headings=["Calculette avec garde alternée"; + "Prologue : aides au logement"]})))) in + {CalculetteAidesAuLogementGardeAlterneeOut.eligibilite_out = eligibilite_; + CalculetteAidesAuLogementGardeAlterneeOut.aide_finale_out = aide_finale_} diff --git a/french_law/ocaml/law_source/aides_logement_api_web.ml b/french_law/ocaml/law_source/aides_logement_api_web.ml new file mode 100644 index 00000000..ac9ee024 --- /dev/null +++ b/french_law/ocaml/law_source/aides_logement_api_web.ml @@ -0,0 +1,4895 @@ +(** This file has been generated by the Catala compiler, do not edit! *) + +open Runtime_ocaml.Runtime +open Runtime_jsoo.Runtime +open Js_of_ocaml +open Aides_logement + +[@@@ocaml.warning "-4-26-27-32-41-42"] + +(* Generated API *) + +class type type_bailleur = + object + method kind : + Js.js_string Js.t Js.readonly_prop + (** Expects one of: + - "BailleurSocial" + - "BailleurPrive" *) + + method payload : Js.Unsafe.any Js.t Js.readonly_prop + end + +let type_bailleur_to_jsoo : TypeBailleur.t -> type_bailleur Js.t + = function + | BailleurSocial arg -> object%js + val kind = Js.string "BailleurSocial" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | BailleurPrive arg -> object%js + val kind = Js.string "BailleurPrive" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + +let type_bailleur_of_jsoo (type_bailleur : type_bailleur Js.t) + : TypeBailleur.t = + match type_bailleur##.kind |> Js.to_string with + | "BailleurSocial" -> TypeBailleur.BailleurSocial () + | "BailleurPrive" -> TypeBailleur.BailleurPrive () + | cons -> + failwith + (Printf.sprintf + "Unexpected '%s' kind for the enumeration 'TypeBailleur.t'" cons) + + +class type type_pret = + object + method kind : + Js.js_string Js.t Js.readonly_prop + (** Expects one of: + - "D331_32" + - "D331_63_64" + - "D331_59_8" + - "D331_76_1" + - "Autre" *) + + method payload : Js.Unsafe.any Js.t Js.readonly_prop + end + +let type_pret_to_jsoo : TypePret.t -> type_pret Js.t + = function + | D331_32 arg -> object%js + val kind = Js.string "D331_32" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | D331_63_64 arg -> object%js + val kind = Js.string "D331_63_64" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | D331_59_8 arg -> object%js + val kind = Js.string "D331_59_8" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | D331_76_1 arg -> object%js + val kind = Js.string "D331_76_1" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | Autre arg -> object%js + val kind = Js.string "Autre" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + +let type_pret_of_jsoo (type_pret : type_pret Js.t) : TypePret.t = + match type_pret##.kind |> Js.to_string with + | "D331_32" -> TypePret.D331_32 () + | "D331_63_64" -> TypePret.D331_63_64 () + | "D331_59_8" -> TypePret.D331_59_8 () + | "D331_76_1" -> TypePret.D331_76_1 () + | "Autre" -> TypePret.Autre () + | cons -> + failwith + (Printf.sprintf "Unexpected '%s' kind for the enumeration 'TypePret.t'" + cons) + + +class type titulaire_pret = + object + method kind : + Js.js_string Js.t Js.readonly_prop + (** Expects one of: + - "Demandeur" + - "VendeurQuandDemandeurAContratLocationAccession" *) + + method payload : Js.Unsafe.any Js.t Js.readonly_prop + end + +let titulaire_pret_to_jsoo : TitulairePret.t -> titulaire_pret Js.t + = function + | Demandeur arg -> object%js + val kind = Js.string "Demandeur" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | VendeurQuandDemandeurAContratLocationAccession arg -> object%js + val kind = Js.string "VendeurQuandDemandeurAContratLocationAccession" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + +let titulaire_pret_of_jsoo (titulaire_pret : titulaire_pret Js.t) + : TitulairePret.t = + match titulaire_pret##.kind |> Js.to_string with + | "Demandeur" -> TitulairePret.Demandeur () + | "VendeurQuandDemandeurAContratLocationAccession" -> + TitulairePret.VendeurQuandDemandeurAContratLocationAccession () + | cons -> + failwith + (Printf.sprintf + "Unexpected '%s' kind for the enumeration 'TitulairePret.t'" cons) + + +class type type_travaux_logement_d832_15 = + object + method kind : + Js.js_string Js.t Js.readonly_prop + (** Expects one of: + - "TravauxPourAcquisitionD832_15_1" + - "TravauxSurLogementDejaAcquisD832_15_2" + - "PasDeTravaux" *) + + method payload : Js.Unsafe.any Js.t Js.readonly_prop + end + +let type_travaux_logement_d832_15_to_jsoo + : TypeTravauxLogementD83215.t -> type_travaux_logement_d832_15 Js.t + = function + | TravauxPourAcquisitionD832_15_1 arg -> object%js + val kind = Js.string "TravauxPourAcquisitionD832_15_1" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | TravauxSurLogementDejaAcquisD832_15_2 arg -> object%js + val kind = Js.string "TravauxSurLogementDejaAcquisD832_15_2" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | PasDeTravaux arg -> object%js + val kind = Js.string "PasDeTravaux" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + +let type_travaux_logement_d832_15_of_jsoo + (type_travaux_logement_d832_15 : type_travaux_logement_d832_15 Js.t) + : TypeTravauxLogementD83215.t = + match type_travaux_logement_d832_15##.kind |> Js.to_string with + | "TravauxPourAcquisitionD832_15_1" -> + TypeTravauxLogementD83215.TravauxPourAcquisitionD832_15_1 () + | "TravauxSurLogementDejaAcquisD832_15_2" -> + TypeTravauxLogementD83215.TravauxSurLogementDejaAcquisD832_15_2 () + | "PasDeTravaux" -> TypeTravauxLogementD83215.PasDeTravaux () + | cons -> + failwith + (Printf.sprintf + "Unexpected '%s' kind for the enumeration 'TypeTravauxLogementD83215.t'" + cons) + + +class type type_travaux_logement_r842_5 = + object + method kind : + Js.js_string Js.t Js.readonly_prop + (** Expects one of: + - "ObjectifDecenceLogement" + - "PrevuDansListeR321_15" + - "AgrandirOuRendreHabitableD331_63" + - "PasDeTravaux" *) + + method payload : Js.Unsafe.any Js.t Js.readonly_prop + end + +let type_travaux_logement_r842_5_to_jsoo + : TypeTravauxLogementR8425.t -> type_travaux_logement_r842_5 Js.t + = function + | ObjectifDecenceLogement arg -> object%js + val kind = Js.string "ObjectifDecenceLogement" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | PrevuDansListeR321_15 arg -> object%js + val kind = Js.string "PrevuDansListeR321_15" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | AgrandirOuRendreHabitableD331_63 arg -> object%js + val kind = Js.string "AgrandirOuRendreHabitableD331_63" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | PasDeTravaux arg -> object%js + val kind = Js.string "PasDeTravaux" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + +let type_travaux_logement_r842_5_of_jsoo + (type_travaux_logement_r842_5 : type_travaux_logement_r842_5 Js.t) + : TypeTravauxLogementR8425.t = + match type_travaux_logement_r842_5##.kind |> Js.to_string with + | "ObjectifDecenceLogement" -> + TypeTravauxLogementR8425.ObjectifDecenceLogement () + | "PrevuDansListeR321_15" -> + TypeTravauxLogementR8425.PrevuDansListeR321_15 () + | "AgrandirOuRendreHabitableD331_63" -> + TypeTravauxLogementR8425.AgrandirOuRendreHabitableD331_63 () + | "PasDeTravaux" -> TypeTravauxLogementR8425.PasDeTravaux () + | cons -> + failwith + (Printf.sprintf + "Unexpected '%s' kind for the enumeration 'TypeTravauxLogementR8425.t'" + cons) + + +class type ameliore_par_occupant = + object + method kind : + Js.js_string Js.t Js.readonly_prop + (** Expects one of: + - "Oui" + - "Non" *) + + method payload : Js.Unsafe.any Js.t Js.readonly_prop + end + +let ameliore_par_occupant_to_jsoo + : AmelioreParOccupant.t -> ameliore_par_occupant Js.t + = function + | Oui arg -> object%js + val kind = Js.string "Oui" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | Non arg -> object%js + val kind = Js.string "Non" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + +let ameliore_par_occupant_of_jsoo + (ameliore_par_occupant : ameliore_par_occupant Js.t) + : AmelioreParOccupant.t = + match ameliore_par_occupant##.kind |> Js.to_string with + | "Oui" -> AmelioreParOccupant.Oui () + | "Non" -> AmelioreParOccupant.Non () + | cons -> + failwith + (Printf.sprintf + "Unexpected '%s' kind for the enumeration 'AmelioreParOccupant.t'" + cons) + + +class type limite_tranche = + object + method kind : + Js.js_string Js.t Js.readonly_prop + (** Expects one of: + - "Revenu" + - "Infini" *) + + method payload : Js.Unsafe.any Js.t Js.readonly_prop + end + +let limite_tranche_to_jsoo : LimiteTranche.t -> limite_tranche Js.t + = function + | Revenu arg -> object%js + val kind = Js.string "Revenu" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject (Js.number_of_float @@ money_to_float arg)) + end + | Infini arg -> object%js + val kind = Js.string "Infini" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + +let limite_tranche_of_jsoo (limite_tranche : limite_tranche Js.t) + : LimiteTranche.t = + match limite_tranche##.kind |> Js.to_string with + | "Revenu" -> + LimiteTranche.Revenu (money_of_decimal @@ decimal_of_float @@ Js.float_of_number (Js.Unsafe.coerce limite_tranche##.payload)) + | "Infini" -> LimiteTranche.Infini () + | cons -> + failwith + (Printf.sprintf + "Unexpected '%s' kind for the enumeration 'LimiteTranche.t'" cons) + + +class type limite_tranche_decimal = + object + method kind : + Js.js_string Js.t Js.readonly_prop + (** Expects one of: + - "Revenu" + - "Infini" *) + + method payload : Js.Unsafe.any Js.t Js.readonly_prop + end + +let limite_tranche_decimal_to_jsoo + : LimiteTrancheDecimal.t -> limite_tranche_decimal Js.t + = function + | Revenu arg -> object%js + val kind = Js.string "Revenu" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject (Js.number_of_float @@ decimal_to_float arg)) + end + | Infini arg -> object%js + val kind = Js.string "Infini" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + +let limite_tranche_decimal_of_jsoo + (limite_tranche_decimal : limite_tranche_decimal Js.t) + : LimiteTrancheDecimal.t = + match limite_tranche_decimal##.kind |> Js.to_string with + | "Revenu" -> + LimiteTrancheDecimal.Revenu (decimal_of_float @@ Js.float_of_number (Js.Unsafe.coerce limite_tranche_decimal##.payload)) + | "Infini" -> LimiteTrancheDecimal.Infini () + | cons -> + failwith + (Printf.sprintf + "Unexpected '%s' kind for the enumeration 'LimiteTrancheDecimal.t'" + cons) + + +class type prestation_recue = + object + method kind : + Js.js_string Js.t Js.readonly_prop + (** Expects one of: + - "AllocationsFamiliales" + - "ComplementFamilial" + - "AllocationJeuneEnfant" + - "AllocationSoutienFamilial" + - "AllocationSoutienEnfantHandicape" + - "AllocationAdulteHandicape" *) + + method payload : Js.Unsafe.any Js.t Js.readonly_prop + end + +let prestation_recue_to_jsoo : PrestationRecue.t -> prestation_recue Js.t + = function + | AllocationsFamiliales arg -> object%js + val kind = Js.string "AllocationsFamiliales" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | ComplementFamilial arg -> object%js + val kind = Js.string "ComplementFamilial" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | AllocationJeuneEnfant arg -> object%js + val kind = Js.string "AllocationJeuneEnfant" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | AllocationSoutienFamilial arg -> object%js + val kind = Js.string "AllocationSoutienFamilial" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | AllocationSoutienEnfantHandicape arg -> object%js + val kind = Js.string "AllocationSoutienEnfantHandicape" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | AllocationAdulteHandicape arg -> object%js + val kind = Js.string "AllocationAdulteHandicape" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + +let prestation_recue_of_jsoo (prestation_recue : prestation_recue Js.t) + : PrestationRecue.t = + match prestation_recue##.kind |> Js.to_string with + | "AllocationsFamiliales" -> PrestationRecue.AllocationsFamiliales () + | "ComplementFamilial" -> PrestationRecue.ComplementFamilial () + | "AllocationJeuneEnfant" -> PrestationRecue.AllocationJeuneEnfant () + | "AllocationSoutienFamilial" -> + PrestationRecue.AllocationSoutienFamilial () + | "AllocationSoutienEnfantHandicape" -> + PrestationRecue.AllocationSoutienEnfantHandicape () + | "AllocationAdulteHandicape" -> + PrestationRecue.AllocationAdulteHandicape () + | cons -> + failwith + (Printf.sprintf + "Unexpected '%s' kind for the enumeration 'PrestationRecue.t'" cons) + + +class type type_contrat_travail = + object + method kind : + Js.js_string Js.t Js.readonly_prop + (** Expects one of: + - "CDI" + - "Autres" *) + + method payload : Js.Unsafe.any Js.t Js.readonly_prop + end + +let type_contrat_travail_to_jsoo + : TypeContratTravail.t -> type_contrat_travail Js.t + = function + | CDI arg -> object%js + val kind = Js.string "CDI" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | Autres arg -> object%js + val kind = Js.string "Autres" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + +let type_contrat_travail_of_jsoo + (type_contrat_travail : type_contrat_travail Js.t) : TypeContratTravail.t = + match type_contrat_travail##.kind |> Js.to_string with + | "CDI" -> TypeContratTravail.CDI () + | "Autres" -> TypeContratTravail.Autres () + | cons -> + failwith + (Printf.sprintf + "Unexpected '%s' kind for the enumeration 'TypeContratTravail.t'" + cons) + + +class type parent_ou_autre = + object + method kind : + Js.js_string Js.t Js.readonly_prop + (** Expects one of: + - "DemandeurOuConjointOuParentOuViaPartsSocietes" + - "Autre" *) + + method payload : Js.Unsafe.any Js.t Js.readonly_prop + end + +let parent_ou_autre_to_jsoo : ParentOuAutre.t -> parent_ou_autre Js.t + = function + | DemandeurOuConjointOuParentOuViaPartsSocietes arg -> object%js + val kind = Js.string "DemandeurOuConjointOuParentOuViaPartsSocietes" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject (Js.number_of_float @@ decimal_to_float arg)) + end + | Autre arg -> object%js + val kind = Js.string "Autre" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + +let parent_ou_autre_of_jsoo (parent_ou_autre : parent_ou_autre Js.t) + : ParentOuAutre.t = + match parent_ou_autre##.kind |> Js.to_string with + | "DemandeurOuConjointOuParentOuViaPartsSocietes" -> + ParentOuAutre.DemandeurOuConjointOuParentOuViaPartsSocietes (decimal_of_float @@ Js.float_of_number (Js.Unsafe.coerce parent_ou_autre##.payload)) + | "Autre" -> ParentOuAutre.Autre () + | cons -> + failwith + (Printf.sprintf + "Unexpected '%s' kind for the enumeration 'ParentOuAutre.t'" cons) + + +class type situation_garde_alternee = + object + method kind : + Js.js_string Js.t Js.readonly_prop + (** Expects one of: + - "PasDeGardeAlternee" + - "GardeAlterneeCoefficientPriseEnCharge" *) + + method payload : Js.Unsafe.any Js.t Js.readonly_prop + end + +let situation_garde_alternee_to_jsoo + : SituationGardeAlternee.t -> situation_garde_alternee Js.t + = function + | PasDeGardeAlternee arg -> object%js + val kind = Js.string "PasDeGardeAlternee" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | GardeAlterneeCoefficientPriseEnCharge arg -> object%js + val kind = Js.string "GardeAlterneeCoefficientPriseEnCharge" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject (Js.number_of_float @@ decimal_to_float arg)) + end + +let situation_garde_alternee_of_jsoo + (situation_garde_alternee : situation_garde_alternee Js.t) + : SituationGardeAlternee.t = + match situation_garde_alternee##.kind |> Js.to_string with + | "PasDeGardeAlternee" -> SituationGardeAlternee.PasDeGardeAlternee () + | "GardeAlterneeCoefficientPriseEnCharge" -> + SituationGardeAlternee.GardeAlterneeCoefficientPriseEnCharge (decimal_of_float @@ Js.float_of_number (Js.Unsafe.coerce situation_garde_alternee##.payload)) + | cons -> + failwith + (Printf.sprintf + "Unexpected '%s' kind for the enumeration 'SituationGardeAlternee.t'" + cons) + + +class type parente = + object + method kind : + Js.js_string Js.t Js.readonly_prop + (** Expects one of: + - "Ascendant" + - "Descendant" + - "CollateralDeuxiemeTroisiemeDegre" *) + + method payload : Js.Unsafe.any Js.t Js.readonly_prop + end + +let parente_to_jsoo : Parente.t -> parente Js.t + = function + | Ascendant arg -> object%js + val kind = Js.string "Ascendant" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | Descendant arg -> object%js + val kind = Js.string "Descendant" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | CollateralDeuxiemeTroisiemeDegre arg -> object%js + val kind = Js.string "CollateralDeuxiemeTroisiemeDegre" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + +let parente_of_jsoo (parente : parente Js.t) : Parente.t = + match parente##.kind |> Js.to_string with + | "Ascendant" -> Parente.Ascendant () + | "Descendant" -> Parente.Descendant () + | "CollateralDeuxiemeTroisiemeDegre" -> + Parente.CollateralDeuxiemeTroisiemeDegre () + | cons -> + failwith + (Printf.sprintf "Unexpected '%s' kind for the enumeration 'Parente.t'" + cons) + + +class type date_de_naissance_ou_mois_de_grossesse = + object + method kind : + Js.js_string Js.t Js.readonly_prop + (** Expects one of: + - "DateDeNaissance" + - "AvantPremierJourMoisCivilTroisiemeMoisDeGrossesse" + - "ApresPremierJourMoisCivilTroisiemeMoisDeGrossesse" *) + + method payload : Js.Unsafe.any Js.t Js.readonly_prop + end + +let date_de_naissance_ou_mois_de_grossesse_to_jsoo + : DateDeNaissanceOuMoisDeGrossesse.t -> date_de_naissance_ou_mois_de_grossesse Js.t + = function + | DateDeNaissance arg -> object%js + val kind = Js.string "DateDeNaissance" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject (date_to_jsoo arg)) + end + | AvantPremierJourMoisCivilTroisiemeMoisDeGrossesse arg -> object%js + val kind = Js.string "AvantPremierJourMoisCivilTroisiemeMoisDeGrossesse" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | ApresPremierJourMoisCivilTroisiemeMoisDeGrossesse arg -> object%js + val kind = Js.string "ApresPremierJourMoisCivilTroisiemeMoisDeGrossesse" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + +let date_de_naissance_ou_mois_de_grossesse_of_jsoo + (date_de_naissance_ou_mois_de_grossesse + : date_de_naissance_ou_mois_de_grossesse Js.t) + : DateDeNaissanceOuMoisDeGrossesse.t = + match date_de_naissance_ou_mois_de_grossesse##.kind |> Js.to_string with + | "DateDeNaissance" -> + DateDeNaissanceOuMoisDeGrossesse.DateDeNaissance (date_of_jsoo (Js.Unsafe.coerce date_de_naissance_ou_mois_de_grossesse##.payload)) + | "AvantPremierJourMoisCivilTroisiemeMoisDeGrossesse" -> + DateDeNaissanceOuMoisDeGrossesse.AvantPremierJourMoisCivilTroisiemeMoisDeGrossesse () + | "ApresPremierJourMoisCivilTroisiemeMoisDeGrossesse" -> + DateDeNaissanceOuMoisDeGrossesse.ApresPremierJourMoisCivilTroisiemeMoisDeGrossesse () + | cons -> + failwith + (Printf.sprintf + "Unexpected '%s' kind for the enumeration 'DateDeNaissanceOuMoisDeGrossesse.t'" + cons) + + +class type nationalite = + object + method kind : + Js.js_string Js.t Js.readonly_prop + (** Expects one of: + - "Francaise" + - "Etrangere" *) + + method payload : Js.Unsafe.any Js.t Js.readonly_prop + end + +let nationalite_to_jsoo : Nationalite.t -> nationalite Js.t + = function + | Francaise arg -> object%js + val kind = Js.string "Francaise" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | Etrangere arg -> object%js + val kind = Js.string "Etrangere" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + +let nationalite_of_jsoo (nationalite : nationalite Js.t) : Nationalite.t = + match nationalite##.kind |> Js.to_string with + | "Francaise" -> Nationalite.Francaise () + | "Etrangere" -> Nationalite.Etrangere () + | cons -> + failwith + (Printf.sprintf + "Unexpected '%s' kind for the enumeration 'Nationalite.t'" cons) + + +class type zone_d_habitation = + object + method kind : + Js.js_string Js.t Js.readonly_prop + (** Expects one of: + - "Zone1" + - "Zone2" + - "Zone3" *) + + method payload : Js.Unsafe.any Js.t Js.readonly_prop + end + +let zone_d_habitation_to_jsoo : ZoneDHabitation.t -> zone_d_habitation Js.t + = function + | Zone1 arg -> object%js + val kind = Js.string "Zone1" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | Zone2 arg -> object%js + val kind = Js.string "Zone2" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | Zone3 arg -> object%js + val kind = Js.string "Zone3" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + +let zone_d_habitation_of_jsoo (zone_d_habitation : zone_d_habitation Js.t) + : ZoneDHabitation.t = + match zone_d_habitation##.kind |> Js.to_string with + | "Zone1" -> ZoneDHabitation.Zone1 () + | "Zone2" -> ZoneDHabitation.Zone2 () + | "Zone3" -> ZoneDHabitation.Zone3 () + | cons -> + failwith + (Printf.sprintf + "Unexpected '%s' kind for the enumeration 'ZoneDHabitation.t'" cons) + + +class type categorie_calcul_a_p_l = + object + method kind : + Js.js_string Js.t Js.readonly_prop + (** Expects one of: + - "Location" + - "AccessionPropriete" + - "LogementFoyer" *) + + method payload : Js.Unsafe.any Js.t Js.readonly_prop + end + +let categorie_calcul_a_p_l_to_jsoo + : CategorieCalculAPL.t -> categorie_calcul_a_p_l Js.t + = function + | Location arg -> object%js + val kind = Js.string "Location" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | AccessionPropriete arg -> object%js + val kind = Js.string "AccessionPropriete" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | LogementFoyer arg -> object%js + val kind = Js.string "LogementFoyer" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + +let categorie_calcul_a_p_l_of_jsoo + (categorie_calcul_a_p_l : categorie_calcul_a_p_l Js.t) + : CategorieCalculAPL.t = + match categorie_calcul_a_p_l##.kind |> Js.to_string with + | "Location" -> CategorieCalculAPL.Location () + | "AccessionPropriete" -> CategorieCalculAPL.AccessionPropriete () + | "LogementFoyer" -> CategorieCalculAPL.LogementFoyer () + | cons -> + failwith + (Printf.sprintf + "Unexpected '%s' kind for the enumeration 'CategorieCalculAPL.t'" + cons) + + +class type paiement_logement_distinct_professionnel = + object + method kind : + Js.js_string Js.t Js.readonly_prop + (** Expects one of: + - "OuiAvecLoyerOuCharges" + - "Non" *) + + method payload : Js.Unsafe.any Js.t Js.readonly_prop + end + +let paiement_logement_distinct_professionnel_to_jsoo + : PaiementLogementDistinctProfessionnel.t -> paiement_logement_distinct_professionnel Js.t + = function + | OuiAvecLoyerOuCharges arg -> object%js + val kind = Js.string "OuiAvecLoyerOuCharges" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject (Js.number_of_float @@ money_to_float arg)) + end + | Non arg -> object%js + val kind = Js.string "Non" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + +let paiement_logement_distinct_professionnel_of_jsoo + (paiement_logement_distinct_professionnel + : paiement_logement_distinct_professionnel Js.t) + : PaiementLogementDistinctProfessionnel.t = + match paiement_logement_distinct_professionnel##.kind |> Js.to_string with + | "OuiAvecLoyerOuCharges" -> + PaiementLogementDistinctProfessionnel.OuiAvecLoyerOuCharges (money_of_decimal @@ decimal_of_float @@ Js.float_of_number (Js.Unsafe.coerce paiement_logement_distinct_professionnel##.payload)) + | "Non" -> PaiementLogementDistinctProfessionnel.Non () + | cons -> + failwith + (Printf.sprintf + "Unexpected '%s' kind for the enumeration 'PaiementLogementDistinctProfessionnel.t'" + cons) + + +class type versement_a = + object + method kind : + Js.js_string Js.t Js.readonly_prop + (** Expects one of: + - "Bailleur" + - "Beneficiaire" + - "EtablissementHabilite" *) + + method payload : Js.Unsafe.any Js.t Js.readonly_prop + end + +let versement_a_to_jsoo : VersementA.t -> versement_a Js.t + = function + | Bailleur arg -> object%js + val kind = Js.string "Bailleur" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | Beneficiaire arg -> object%js + val kind = Js.string "Beneficiaire" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | EtablissementHabilite arg -> object%js + val kind = Js.string "EtablissementHabilite" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + +let versement_a_of_jsoo (versement_a : versement_a Js.t) : VersementA.t = + match versement_a##.kind |> Js.to_string with + | "Bailleur" -> VersementA.Bailleur () + | "Beneficiaire" -> VersementA.Beneficiaire () + | "EtablissementHabilite" -> VersementA.EtablissementHabilite () + | cons -> + failwith + (Printf.sprintf + "Unexpected '%s' kind for the enumeration 'VersementA.t'" cons) + + +class type depense_logement = + object + method kind : + Js.js_string Js.t Js.readonly_prop + (** Expects one of: + - "TotalAnnuelEcheances" + - "Mensualite" + - "Loyer" *) + + method payload : Js.Unsafe.any Js.t Js.readonly_prop + end + +let depense_logement_to_jsoo : DepenseLogement.t -> depense_logement Js.t + = function + | TotalAnnuelEcheances arg -> object%js + val kind = Js.string "TotalAnnuelEcheances" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject (Js.number_of_float @@ money_to_float arg)) + end + | Mensualite arg -> object%js + val kind = Js.string "Mensualite" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject (Js.number_of_float @@ money_to_float arg)) + end + | Loyer arg -> object%js + val kind = Js.string "Loyer" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject (Js.number_of_float @@ money_to_float arg)) + end + +let depense_logement_of_jsoo (depense_logement : depense_logement Js.t) + : DepenseLogement.t = + match depense_logement##.kind |> Js.to_string with + | "TotalAnnuelEcheances" -> + DepenseLogement.TotalAnnuelEcheances (money_of_decimal @@ decimal_of_float @@ Js.float_of_number (Js.Unsafe.coerce depense_logement##.payload)) + | "Mensualite" -> + DepenseLogement.Mensualite (money_of_decimal @@ decimal_of_float @@ Js.float_of_number (Js.Unsafe.coerce depense_logement##.payload)) + | "Loyer" -> + DepenseLogement.Loyer (money_of_decimal @@ decimal_of_float @@ Js.float_of_number (Js.Unsafe.coerce depense_logement##.payload)) + | cons -> + failwith + (Printf.sprintf + "Unexpected '%s' kind for the enumeration 'DepenseLogement.t'" cons) + + +class type mode_occupation_impaye = + object + method kind : + Js.js_string Js.t Js.readonly_prop + (** Expects one of: + - "ImpayeLoyer" + - "ImpayePret" *) + + method payload : Js.Unsafe.any Js.t Js.readonly_prop + end + +let mode_occupation_impaye_to_jsoo + : ModeOccupationImpaye.t -> mode_occupation_impaye Js.t + = function + | ImpayeLoyer arg -> object%js + val kind = Js.string "ImpayeLoyer" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | ImpayePret arg -> object%js + val kind = Js.string "ImpayePret" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + +let mode_occupation_impaye_of_jsoo + (mode_occupation_impaye : mode_occupation_impaye Js.t) + : ModeOccupationImpaye.t = + match mode_occupation_impaye##.kind |> Js.to_string with + | "ImpayeLoyer" -> ModeOccupationImpaye.ImpayeLoyer () + | "ImpayePret" -> ModeOccupationImpaye.ImpayePret () + | cons -> + failwith + (Printf.sprintf + "Unexpected '%s' kind for the enumeration 'ModeOccupationImpaye.t'" + cons) + + +class type eligibilite_allocation_logement = + object + method kind : + Js.js_string Js.t Js.readonly_prop + (** Expects one of: + - "PasEligible" + - "AllocationLogementFamiliale" + - "AllocationLogementSociale" *) + + method payload : Js.Unsafe.any Js.t Js.readonly_prop + end + +let eligibilite_allocation_logement_to_jsoo + : EligibiliteAllocationLogement.t -> eligibilite_allocation_logement Js.t + = function + | PasEligible arg -> object%js + val kind = Js.string "PasEligible" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | AllocationLogementFamiliale arg -> object%js + val kind = Js.string "AllocationLogementFamiliale" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | AllocationLogementSociale arg -> object%js + val kind = Js.string "AllocationLogementSociale" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + +let eligibilite_allocation_logement_of_jsoo + (eligibilite_allocation_logement : eligibilite_allocation_logement Js.t) + : EligibiliteAllocationLogement.t = + match eligibilite_allocation_logement##.kind |> Js.to_string with + | "PasEligible" -> EligibiliteAllocationLogement.PasEligible () + | "AllocationLogementFamiliale" -> + EligibiliteAllocationLogement.AllocationLogementFamiliale () + | "AllocationLogementSociale" -> + EligibiliteAllocationLogement.AllocationLogementSociale () + | cons -> + failwith + (Printf.sprintf + "Unexpected '%s' kind for the enumeration 'EligibiliteAllocationLogement.t'" + cons) + + +class type type_aides_personnelle_logement = + object + method kind : + Js.js_string Js.t Js.readonly_prop + (** Expects one of: + - "AidePersonnaliseeLogement" + - "AllocationLogementFamiliale" + - "AllocationLogementSociale" *) + + method payload : Js.Unsafe.any Js.t Js.readonly_prop + end + +let type_aides_personnelle_logement_to_jsoo + : TypeAidesPersonnelleLogement.t -> type_aides_personnelle_logement Js.t + = function + | AidePersonnaliseeLogement arg -> object%js + val kind = Js.string "AidePersonnaliseeLogement" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | AllocationLogementFamiliale arg -> object%js + val kind = Js.string "AllocationLogementFamiliale" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | AllocationLogementSociale arg -> object%js + val kind = Js.string "AllocationLogementSociale" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + +let type_aides_personnelle_logement_of_jsoo + (type_aides_personnelle_logement : type_aides_personnelle_logement Js.t) + : TypeAidesPersonnelleLogement.t = + match type_aides_personnelle_logement##.kind |> Js.to_string with + | "AidePersonnaliseeLogement" -> + TypeAidesPersonnelleLogement.AidePersonnaliseeLogement () + | "AllocationLogementFamiliale" -> + TypeAidesPersonnelleLogement.AllocationLogementFamiliale () + | "AllocationLogementSociale" -> + TypeAidesPersonnelleLogement.AllocationLogementSociale () + | cons -> + failwith + (Printf.sprintf + "Unexpected '%s' kind for the enumeration 'TypeAidesPersonnelleLogement.t'" + cons) + + +class type situation_familiale = + object + method kind : + Js.js_string Js.t Js.readonly_prop + (** Expects one of: + - "Celibataire" + - "Maries" + - "Pacses" + - "Concubins" + - "CelibataireSepareDeFait" + - "ConcubinageDontSepareDeFait" *) + + method payload : Js.Unsafe.any Js.t Js.readonly_prop + end + +let situation_familiale_to_jsoo + : SituationFamiliale.t -> situation_familiale Js.t + = function + | Celibataire arg -> object%js + val kind = Js.string "Celibataire" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | Maries arg -> object%js + val kind = Js.string "Maries" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject (date_to_jsoo arg)) + end + | Pacses arg -> object%js + val kind = Js.string "Pacses" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | Concubins arg -> object%js + val kind = Js.string "Concubins" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | CelibataireSepareDeFait arg -> object%js + val kind = Js.string "CelibataireSepareDeFait" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | ConcubinageDontSepareDeFait arg -> object%js + val kind = Js.string "ConcubinageDontSepareDeFait" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + +let situation_familiale_of_jsoo + (situation_familiale : situation_familiale Js.t) : SituationFamiliale.t = + match situation_familiale##.kind |> Js.to_string with + | "Celibataire" -> SituationFamiliale.Celibataire () + | "Maries" -> + SituationFamiliale.Maries (date_of_jsoo (Js.Unsafe.coerce situation_familiale##.payload)) + | "Pacses" -> SituationFamiliale.Pacses () + | "Concubins" -> SituationFamiliale.Concubins () + | "CelibataireSepareDeFait" -> + SituationFamiliale.CelibataireSepareDeFait () + | "ConcubinageDontSepareDeFait" -> + SituationFamiliale.ConcubinageDontSepareDeFait () + | cons -> + failwith + (Printf.sprintf + "Unexpected '%s' kind for the enumeration 'SituationFamiliale.t'" + cons) + + +class type prise_en_charge = + object + method kind : + Js.js_string Js.t Js.readonly_prop + (** Expects one of: + - "EffectiveEtPermanente" + - "ResidenceAlterneeAllocataireUnique" + - "ResidenceAlterneeAllocationsPartagee" *) + + method payload : Js.Unsafe.any Js.t Js.readonly_prop + end + +let prise_en_charge_to_jsoo : PriseEnCharge.t -> prise_en_charge Js.t + = function + | EffectiveEtPermanente arg -> object%js + val kind = Js.string "EffectiveEtPermanente" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | ResidenceAlterneeAllocataireUnique arg -> object%js + val kind = Js.string "ResidenceAlterneeAllocataireUnique" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | ResidenceAlterneeAllocationsPartagee arg -> object%js + val kind = Js.string "ResidenceAlterneeAllocationsPartagee" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + +let prise_en_charge_of_jsoo (prise_en_charge : prise_en_charge Js.t) + : PriseEnCharge.t = + match prise_en_charge##.kind |> Js.to_string with + | "EffectiveEtPermanente" -> PriseEnCharge.EffectiveEtPermanente () + | "ResidenceAlterneeAllocataireUnique" -> + PriseEnCharge.ResidenceAlterneeAllocataireUnique () + | "ResidenceAlterneeAllocationsPartagee" -> + PriseEnCharge.ResidenceAlterneeAllocationsPartagee () + | cons -> + failwith + (Printf.sprintf + "Unexpected '%s' kind for the enumeration 'PriseEnCharge.t'" cons) + + +class type type_logement_foyer = + object + method kind : + Js.js_string Js.t Js.readonly_prop + (** Expects one of: + - "LogementPersonnesAgeesOuHandicapees" + - "ResidenceSociale" + - "FoyerJeunesTrvailleursOuMigrantsConventionneL353_2Avant1995" + - "Autre" *) + + method payload : Js.Unsafe.any Js.t Js.readonly_prop + end + +let type_logement_foyer_to_jsoo + : TypeLogementFoyer.t -> type_logement_foyer Js.t + = function + | LogementPersonnesAgeesOuHandicapees arg -> object%js + val kind = Js.string "LogementPersonnesAgeesOuHandicapees" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | ResidenceSociale arg -> object%js + val kind = Js.string "ResidenceSociale" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | FoyerJeunesTrvailleursOuMigrantsConventionneL353_2Avant1995 arg -> object%js + val kind = Js.string "FoyerJeunesTrvailleursOuMigrantsConventionneL353_2Avant1995" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | Autre arg -> object%js + val kind = Js.string "Autre" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + +let type_logement_foyer_of_jsoo + (type_logement_foyer : type_logement_foyer Js.t) : TypeLogementFoyer.t = + match type_logement_foyer##.kind |> Js.to_string with + | "LogementPersonnesAgeesOuHandicapees" -> + TypeLogementFoyer.LogementPersonnesAgeesOuHandicapees () + | "ResidenceSociale" -> TypeLogementFoyer.ResidenceSociale () + | "FoyerJeunesTrvailleursOuMigrantsConventionneL353_2Avant1995" -> + TypeLogementFoyer.FoyerJeunesTrvailleursOuMigrantsConventionneL353_2Avant1995 () + | "Autre" -> TypeLogementFoyer.Autre () + | cons -> + failwith + (Printf.sprintf + "Unexpected '%s' kind for the enumeration 'TypeLogementFoyer.t'" + cons) + + +class type categorie_equivalence_loyer_allocation_logement_foyer = + object + method kind : + Js.js_string Js.t Js.readonly_prop + (** Expects one of: + - "EtudiantLogeEnChambre" + - "EtudiantLogeEnChambreRehabilitee" + - "PersonnesAgeesSelon3DeD842_16" + - "AutresPersonnes" *) + + method payload : Js.Unsafe.any Js.t Js.readonly_prop + end + +let categorie_equivalence_loyer_allocation_logement_foyer_to_jsoo + : CategorieEquivalenceLoyerAllocationLogementFoyer.t -> categorie_equivalence_loyer_allocation_logement_foyer Js.t + = function + | EtudiantLogeEnChambre arg -> object%js + val kind = Js.string "EtudiantLogeEnChambre" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | EtudiantLogeEnChambreRehabilitee arg -> object%js + val kind = Js.string "EtudiantLogeEnChambreRehabilitee" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | PersonnesAgeesSelon3DeD842_16 arg -> object%js + val kind = Js.string "PersonnesAgeesSelon3DeD842_16" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | AutresPersonnes arg -> object%js + val kind = Js.string "AutresPersonnes" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + +let categorie_equivalence_loyer_allocation_logement_foyer_of_jsoo + (categorie_equivalence_loyer_allocation_logement_foyer + : categorie_equivalence_loyer_allocation_logement_foyer Js.t) + : CategorieEquivalenceLoyerAllocationLogementFoyer.t = + match categorie_equivalence_loyer_allocation_logement_foyer##.kind + |> Js.to_string with + | "EtudiantLogeEnChambre" -> + CategorieEquivalenceLoyerAllocationLogementFoyer.EtudiantLogeEnChambre () + | "EtudiantLogeEnChambreRehabilitee" -> + CategorieEquivalenceLoyerAllocationLogementFoyer.EtudiantLogeEnChambreRehabilitee () + | "PersonnesAgeesSelon3DeD842_16" -> + CategorieEquivalenceLoyerAllocationLogementFoyer.PersonnesAgeesSelon3DeD842_16 () + | "AutresPersonnes" -> + CategorieEquivalenceLoyerAllocationLogementFoyer.AutresPersonnes () + | cons -> + failwith + (Printf.sprintf + "Unexpected '%s' kind for the enumeration 'CategorieEquivalenceLoyerAllocationLogementFoyer.t'" + cons) + + +class type situation_familiale_calcul_a_p_l = + object + method kind : + Js.js_string Js.t Js.readonly_prop + (** Expects one of: + - "PersonneSeule" + - "Couple" *) + + method payload : Js.Unsafe.any Js.t Js.readonly_prop + end + +let situation_familiale_calcul_a_p_l_to_jsoo + : SituationFamilialeCalculAPL.t -> situation_familiale_calcul_a_p_l Js.t + = function + | PersonneSeule arg -> object%js + val kind = Js.string "PersonneSeule" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | Couple arg -> object%js + val kind = Js.string "Couple" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + +let situation_familiale_calcul_a_p_l_of_jsoo + (situation_familiale_calcul_a_p_l : situation_familiale_calcul_a_p_l Js.t) + : SituationFamilialeCalculAPL.t = + match situation_familiale_calcul_a_p_l##.kind |> Js.to_string with + | "PersonneSeule" -> SituationFamilialeCalculAPL.PersonneSeule () + | "Couple" -> SituationFamilialeCalculAPL.Couple () + | cons -> + failwith + (Printf.sprintf + "Unexpected '%s' kind for the enumeration 'SituationFamilialeCalculAPL.t'" + cons) + + +class type collectivite = + object + method kind : + Js.js_string Js.t Js.readonly_prop + (** Expects one of: + - "Guadeloupe" + - "Guyane" + - "Martinique" + - "LaReunion" + - "SaintBarthelemy" + - "SaintMartin" + - "Metropole" + - "SaintPierreEtMiquelon" + - "Mayotte" *) + + method payload : Js.Unsafe.any Js.t Js.readonly_prop + end + +let collectivite_to_jsoo : Collectivite.t -> collectivite Js.t + = function + | Guadeloupe arg -> object%js + val kind = Js.string "Guadeloupe" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | Guyane arg -> object%js + val kind = Js.string "Guyane" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | Martinique arg -> object%js + val kind = Js.string "Martinique" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | LaReunion arg -> object%js + val kind = Js.string "LaReunion" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | SaintBarthelemy arg -> object%js + val kind = Js.string "SaintBarthelemy" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | SaintMartin arg -> object%js + val kind = Js.string "SaintMartin" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | Metropole arg -> object%js + val kind = Js.string "Metropole" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | SaintPierreEtMiquelon arg -> object%js + val kind = Js.string "SaintPierreEtMiquelon" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | Mayotte arg -> object%js + val kind = Js.string "Mayotte" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + +let collectivite_of_jsoo (collectivite : collectivite Js.t) + : Collectivite.t = + match collectivite##.kind |> Js.to_string with + | "Guadeloupe" -> Collectivite.Guadeloupe () + | "Guyane" -> Collectivite.Guyane () + | "Martinique" -> Collectivite.Martinique () + | "LaReunion" -> Collectivite.LaReunion () + | "SaintBarthelemy" -> Collectivite.SaintBarthelemy () + | "SaintMartin" -> Collectivite.SaintMartin () + | "Metropole" -> Collectivite.Metropole () + | "SaintPierreEtMiquelon" -> Collectivite.SaintPierreEtMiquelon () + | "Mayotte" -> Collectivite.Mayotte () + | cons -> + failwith + (Printf.sprintf + "Unexpected '%s' kind for the enumeration 'Collectivite.t'" cons) + + +class type prise_en_charge_enfant = + object + method kind : + Js.js_string Js.t Js.readonly_prop + (** Expects one of: + - "GardeAlterneePartageAllocations" + - "GardeAlterneeAllocataireUnique" + - "EffectiveEtPermanente" + - "ServicesSociauxAllocationVerseeALaFamille" + - "ServicesSociauxAllocationVerseeAuxServicesSociaux" *) + + method payload : Js.Unsafe.any Js.t Js.readonly_prop + end + +let prise_en_charge_enfant_to_jsoo + : PriseEnChargeEnfant.t -> prise_en_charge_enfant Js.t + = function + | GardeAlterneePartageAllocations arg -> object%js + val kind = Js.string "GardeAlterneePartageAllocations" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | GardeAlterneeAllocataireUnique arg -> object%js + val kind = Js.string "GardeAlterneeAllocataireUnique" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | EffectiveEtPermanente arg -> object%js + val kind = Js.string "EffectiveEtPermanente" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | ServicesSociauxAllocationVerseeALaFamille arg -> object%js + val kind = Js.string "ServicesSociauxAllocationVerseeALaFamille" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | ServicesSociauxAllocationVerseeAuxServicesSociaux arg -> object%js + val kind = Js.string "ServicesSociauxAllocationVerseeAuxServicesSociaux" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + +let prise_en_charge_enfant_of_jsoo + (prise_en_charge_enfant : prise_en_charge_enfant Js.t) + : PriseEnChargeEnfant.t = + match prise_en_charge_enfant##.kind |> Js.to_string with + | "GardeAlterneePartageAllocations" -> + PriseEnChargeEnfant.GardeAlterneePartageAllocations () + | "GardeAlterneeAllocataireUnique" -> + PriseEnChargeEnfant.GardeAlterneeAllocataireUnique () + | "EffectiveEtPermanente" -> PriseEnChargeEnfant.EffectiveEtPermanente () + | "ServicesSociauxAllocationVerseeALaFamille" -> + PriseEnChargeEnfant.ServicesSociauxAllocationVerseeALaFamille () + | "ServicesSociauxAllocationVerseeAuxServicesSociaux" -> + PriseEnChargeEnfant.ServicesSociauxAllocationVerseeAuxServicesSociaux () + | cons -> + failwith + (Printf.sprintf + "Unexpected '%s' kind for the enumeration 'PriseEnChargeEnfant.t'" + cons) + + +class type situation_obligation_scolaire = + object + method kind : + Js.js_string Js.t Js.readonly_prop + (** Expects one of: + - "Avant" + - "Pendant" + - "Apres" *) + + method payload : Js.Unsafe.any Js.t Js.readonly_prop + end + +let situation_obligation_scolaire_to_jsoo + : SituationObligationScolaire.t -> situation_obligation_scolaire Js.t + = function + | Avant arg -> object%js + val kind = Js.string "Avant" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | Pendant arg -> object%js + val kind = Js.string "Pendant" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | Apres arg -> object%js + val kind = Js.string "Apres" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + +let situation_obligation_scolaire_of_jsoo + (situation_obligation_scolaire : situation_obligation_scolaire Js.t) + : SituationObligationScolaire.t = + match situation_obligation_scolaire##.kind |> Js.to_string with + | "Avant" -> SituationObligationScolaire.Avant () + | "Pendant" -> SituationObligationScolaire.Pendant () + | "Apres" -> SituationObligationScolaire.Apres () + | cons -> + failwith + (Printf.sprintf + "Unexpected '%s' kind for the enumeration 'SituationObligationScolaire.t'" + cons) + + +class type element_prestations_familiales = + object + method kind : + Js.js_string Js.t Js.readonly_prop + (** Expects one of: + - "PrestationAccueilJeuneEnfant" + - "AllocationsFamiliales" + - "ComplementFamilial" + - "AllocationLogement" + - "AllocationEducationEnfantHandicape" + - "AllocationSoutienFamilial" + - "AllocationRentreeScolaire" + - "AllocationJournalierePresenceParentale" *) + + method payload : Js.Unsafe.any Js.t Js.readonly_prop + end + +let element_prestations_familiales_to_jsoo + : ElementPrestationsFamiliales.t -> element_prestations_familiales Js.t + = function + | PrestationAccueilJeuneEnfant arg -> object%js + val kind = Js.string "PrestationAccueilJeuneEnfant" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | AllocationsFamiliales arg -> object%js + val kind = Js.string "AllocationsFamiliales" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | ComplementFamilial arg -> object%js + val kind = Js.string "ComplementFamilial" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | AllocationLogement arg -> object%js + val kind = Js.string "AllocationLogement" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | AllocationEducationEnfantHandicape arg -> object%js + val kind = Js.string "AllocationEducationEnfantHandicape" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | AllocationSoutienFamilial arg -> object%js + val kind = Js.string "AllocationSoutienFamilial" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | AllocationRentreeScolaire arg -> object%js + val kind = Js.string "AllocationRentreeScolaire" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | AllocationJournalierePresenceParentale arg -> object%js + val kind = Js.string "AllocationJournalierePresenceParentale" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + +let element_prestations_familiales_of_jsoo + (element_prestations_familiales : element_prestations_familiales Js.t) + : ElementPrestationsFamiliales.t = + match element_prestations_familiales##.kind |> Js.to_string with + | "PrestationAccueilJeuneEnfant" -> + ElementPrestationsFamiliales.PrestationAccueilJeuneEnfant () + | "AllocationsFamiliales" -> + ElementPrestationsFamiliales.AllocationsFamiliales () + | "ComplementFamilial" -> + ElementPrestationsFamiliales.ComplementFamilial () + | "AllocationLogement" -> + ElementPrestationsFamiliales.AllocationLogement () + | "AllocationEducationEnfantHandicape" -> + ElementPrestationsFamiliales.AllocationEducationEnfantHandicape () + | "AllocationSoutienFamilial" -> + ElementPrestationsFamiliales.AllocationSoutienFamilial () + | "AllocationRentreeScolaire" -> + ElementPrestationsFamiliales.AllocationRentreeScolaire () + | "AllocationJournalierePresenceParentale" -> + ElementPrestationsFamiliales.AllocationJournalierePresenceParentale () + | cons -> + failwith + (Printf.sprintf + "Unexpected '%s' kind for the enumeration 'ElementPrestationsFamiliales.t'" + cons) + + +class type personne_sous_location = + object + method agePersonneSousLocation: int Js.readonly_prop + method conformeArticleL4421: bool Js.t Js.readonly_prop + end + let personne_sous_location_to_jsoo (personne_sous_location + : PersonneSousLocation.t) : personne_sous_location Js.t = + object%js + val agePersonneSousLocation = + integer_to_int personne_sous_location.age_personne_sous_location + val conformeArticleL4421 = + Js.bool personne_sous_location.conforme_article_l442_1 + end + let personne_sous_location_of_jsoo + (personne_sous_location : personne_sous_location Js.t) : + PersonneSousLocation.t = + { + age_personne_sous_location = + integer_of_int personne_sous_location##.agePersonneSousLocation; + conforme_article_l442_1 = + Js.to_bool personne_sous_location##.conformeArticleL4421 + } + +class type patrimoine = + object + method produisantRevenuPeriodeR82233R8224: + Js.number Js.t Js.readonly_prop + method neProduisantPasRevenuPeriodeR82233R8224: + Js.number Js.t Js.readonly_prop + end + let patrimoine_to_jsoo (patrimoine : Patrimoine.t) : patrimoine Js.t = + object%js + val produisantRevenuPeriodeR82233R8224 = + Js.number_of_float @@ money_to_float patrimoine.produisant_revenu_periode_r822_3_3_r822_4 + val neProduisantPasRevenuPeriodeR82233R8224 = + Js.number_of_float @@ money_to_float patrimoine.ne_produisant_pas_revenu_periode_r822_3_3_r822_4 + end + let patrimoine_of_jsoo (patrimoine : patrimoine Js.t) : Patrimoine.t = + { + produisant_revenu_periode_r822_3_3_r822_4 = + money_of_decimal @@ decimal_of_float @@ Js.float_of_number + patrimoine##.produisantRevenuPeriodeR82233R8224; + ne_produisant_pas_revenu_periode_r822_3_3_r822_4 = + money_of_decimal @@ decimal_of_float @@ Js.float_of_number + patrimoine##.neProduisantPasRevenuPeriodeR82233R8224 + } + +class type personne_vivant_habituellement_au_foyer = + object + method dureeResidenceDurantPeriodeR82231SuperieureA6Mois: + bool Js.t Js.readonly_prop + method ressources: Js.number Js.t Js.readonly_prop + end + let personne_vivant_habituellement_au_foyer_to_jsoo + (personne_vivant_habituellement_au_foyer + : PersonneVivantHabituellementAuFoyer.t) + : personne_vivant_habituellement_au_foyer Js.t = + object%js + val dureeResidenceDurantPeriodeR82231SuperieureA6Mois = + Js.bool personne_vivant_habituellement_au_foyer.duree_residence_durant_periode_r_822_3_1_superieure_a_6_mois + val ressources = + Js.number_of_float @@ money_to_float personne_vivant_habituellement_au_foyer.ressources + end + let personne_vivant_habituellement_au_foyer_of_jsoo + (personne_vivant_habituellement_au_foyer + : personne_vivant_habituellement_au_foyer Js.t) : + PersonneVivantHabituellementAuFoyer.t = + { + duree_residence_durant_periode_r_822_3_1_superieure_a_6_mois = + Js.to_bool + personne_vivant_habituellement_au_foyer + ##.dureeResidenceDurantPeriodeR82231SuperieureA6Mois; + ressources = + money_of_decimal @@ decimal_of_float @@ Js.float_of_number + personne_vivant_habituellement_au_foyer##.ressources + } + +class type infos_changement_logement_d842_4 = + object + method ancienLoyerPrincipal: Js.number Js.t Js.readonly_prop + method ancienneAllocationLogement: Js.number Js.t Js.readonly_prop + end + let infos_changement_logement_d842_4_to_jsoo + (infos_changement_logement_d842_4 : InfosChangementLogementD8424.t) + : infos_changement_logement_d842_4 Js.t = + object%js + val ancienLoyerPrincipal = + Js.number_of_float @@ money_to_float infos_changement_logement_d842_4.ancien_loyer_principal + val ancienneAllocationLogement = + Js.number_of_float @@ money_to_float infos_changement_logement_d842_4.ancienne_allocation_logement + end + let infos_changement_logement_d842_4_of_jsoo + (infos_changement_logement_d842_4 + : infos_changement_logement_d842_4 Js.t) : + InfosChangementLogementD8424.t = + { + ancien_loyer_principal = + money_of_decimal @@ decimal_of_float @@ Js.float_of_number + infos_changement_logement_d842_4##.ancienLoyerPrincipal; + ancienne_allocation_logement = + money_of_decimal @@ decimal_of_float @@ Js.float_of_number + infos_changement_logement_d842_4##.ancienneAllocationLogement + } + +class type bailleur = + object + method typeBailleur: type_bailleur Js.t Js.readonly_prop + method respecteConventionTitreV: bool Js.t Js.readonly_prop + method respecteConventionTitreII: bool Js.t Js.readonly_prop + method construitAmelioreConditionsL83114: bool Js.t Js.readonly_prop + method acquisitionAidesEtatPretTitreIIOuLivreIII: + bool Js.t Js.readonly_prop + end + let bailleur_to_jsoo (bailleur : Bailleur.t) : bailleur Js.t = + object%js + val typeBailleur = type_bailleur_to_jsoo bailleur.type_bailleur + val respecteConventionTitreV = + Js.bool bailleur.respecte_convention_titre_V + val respecteConventionTitreII = + Js.bool bailleur.respecte_convention_titre_II + val construitAmelioreConditionsL83114 = + Js.bool bailleur.construit_ameliore_conditions_l831_1_4 + val acquisitionAidesEtatPretTitreIIOuLivreIII = + Js.bool bailleur.acquisition_aides_etat_pret_titre_II_ou_livre_III + end + let bailleur_of_jsoo (bailleur : bailleur Js.t) : Bailleur.t = + { + type_bailleur = type_bailleur_of_jsoo bailleur##.typeBailleur; + respecte_convention_titre_V = + Js.to_bool bailleur##.respecteConventionTitreV; + respecte_convention_titre_II = + Js.to_bool bailleur##.respecteConventionTitreII; + construit_ameliore_conditions_l831_1_4 = + Js.to_bool bailleur##.construitAmelioreConditionsL83114; + acquisition_aides_etat_pret_titre_II_ou_livre_III = + Js.to_bool bailleur##.acquisitionAidesEtatPretTitreIIOuLivreIII + } + +class type pret = + object + method typePret: type_pret Js.t Js.readonly_prop + method dateSignature: Js.js_string Js.t Js.readonly_prop + method titulairePret: titulaire_pret Js.t Js.readonly_prop + end + let pret_to_jsoo (pret : Pret.t) : pret Js.t = + object%js + val typePret = type_pret_to_jsoo pret.type_pret + val dateSignature = date_to_jsoo pret.date_signature + val titulairePret = titulaire_pret_to_jsoo pret.titulaire_pret + end + let pret_of_jsoo (pret : pret Js.t) : Pret.t = + { + type_pret = type_pret_of_jsoo pret##.typePret; + date_signature = date_of_jsoo pret##.dateSignature; + titulaire_pret = titulaire_pret_of_jsoo pret##.titulairePret + } + +class type neuf_ou_ancien = + object + method kind : + Js.js_string Js.t Js.readonly_prop + (** Expects one of: + - "Neuf" + - "Ancien" *) + + method payload : Js.Unsafe.any Js.t Js.readonly_prop + end + +let neuf_ou_ancien_to_jsoo : NeufOuAncien.t -> neuf_ou_ancien Js.t + = function + | Neuf arg -> object%js + val kind = Js.string "Neuf" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | Ancien arg -> object%js + val kind = Js.string "Ancien" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject (ameliore_par_occupant_to_jsoo arg)) + end + +let neuf_ou_ancien_of_jsoo (neuf_ou_ancien : neuf_ou_ancien Js.t) + : NeufOuAncien.t = + match neuf_ou_ancien##.kind |> Js.to_string with + | "Neuf" -> NeufOuAncien.Neuf () + | "Ancien" -> + NeufOuAncien.Ancien (ameliore_par_occupant_of_jsoo (Js.Unsafe.coerce neuf_ou_ancien##.payload)) + | cons -> + failwith + (Printf.sprintf + "Unexpected '%s' kind for the enumeration 'NeufOuAncien.t'" cons) + + +class type tranche_revenu = + object + method haut: limite_tranche Js.t Js.readonly_prop + method bas: Js.number Js.t Js.readonly_prop + method taux: Js.number Js.t Js.readonly_prop + end + let tranche_revenu_to_jsoo (tranche_revenu : TrancheRevenu.t) + : tranche_revenu Js.t = + object%js + val haut = limite_tranche_to_jsoo tranche_revenu.haut + val bas = Js.number_of_float @@ money_to_float tranche_revenu.bas + val taux = Js.number_of_float @@ decimal_to_float tranche_revenu.taux + end + let tranche_revenu_of_jsoo (tranche_revenu : tranche_revenu Js.t) : + TrancheRevenu.t = + { + haut = limite_tranche_of_jsoo tranche_revenu##.haut; + bas = + money_of_decimal @@ decimal_of_float @@ Js.float_of_number + tranche_revenu##.bas; + taux = decimal_of_float @@ Js.float_of_number tranche_revenu##.taux + } + +class type tranche_revenu_decimal = + object + method haut: limite_tranche_decimal Js.t Js.readonly_prop + method bas: Js.number Js.t Js.readonly_prop + method taux: Js.number Js.t Js.readonly_prop + end + let tranche_revenu_decimal_to_jsoo (tranche_revenu_decimal + : TrancheRevenuDecimal.t) : tranche_revenu_decimal Js.t = + object%js + val haut = limite_tranche_decimal_to_jsoo tranche_revenu_decimal.haut + val bas = + Js.number_of_float @@ decimal_to_float tranche_revenu_decimal.bas + val taux = + Js.number_of_float @@ decimal_to_float tranche_revenu_decimal.taux + end + let tranche_revenu_decimal_of_jsoo + (tranche_revenu_decimal : tranche_revenu_decimal Js.t) : + TrancheRevenuDecimal.t = + { + haut = limite_tranche_decimal_of_jsoo tranche_revenu_decimal##.haut; + bas = + decimal_of_float @@ Js.float_of_number tranche_revenu_decimal##.bas; + taux = + decimal_of_float @@ Js.float_of_number tranche_revenu_decimal##.taux + } + +class type autre_personne_a_charge = + object + method dateNaissance: Js.js_string Js.t Js.readonly_prop + method ressources: Js.number Js.t Js.readonly_prop + method ascendantDescendantCollateralDeuxiemeTroisiemeDegre: + bool Js.t Js.readonly_prop + method parente: parente Js.t Js.readonly_prop + method incapacite80PourcentOuRestrictionEmploi: + bool Js.t Js.readonly_prop + method beneficiaireL16119L3518L6433Secu: bool Js.t Js.readonly_prop + method titulaireAllocationPersonneAgee: bool Js.t Js.readonly_prop + end + let autre_personne_a_charge_to_jsoo (autre_personne_a_charge + : AutrePersonneACharge.t) : autre_personne_a_charge Js.t = + object%js + val dateNaissance = date_to_jsoo autre_personne_a_charge.date_naissance + val ressources = + Js.number_of_float @@ money_to_float autre_personne_a_charge.ressources + val ascendantDescendantCollateralDeuxiemeTroisiemeDegre = + Js.bool autre_personne_a_charge.ascendant_descendant_collateral_deuxieme_troisieme_degre + val parente = parente_to_jsoo autre_personne_a_charge.parente + val incapacite80PourcentOuRestrictionEmploi = + Js.bool autre_personne_a_charge.incapacite_80_pourcent_ou_restriction_emploi + val beneficiaireL16119L3518L6433Secu = + Js.bool autre_personne_a_charge.beneficiaire_l161_19_l351_8_l643_3_secu + val titulaireAllocationPersonneAgee = + Js.bool autre_personne_a_charge.titulaire_allocation_personne_agee + end + let autre_personne_a_charge_of_jsoo + (autre_personne_a_charge : autre_personne_a_charge Js.t) : + AutrePersonneACharge.t = + { + date_naissance = date_of_jsoo autre_personne_a_charge##.dateNaissance; + ressources = + money_of_decimal @@ decimal_of_float @@ Js.float_of_number + autre_personne_a_charge##.ressources; + ascendant_descendant_collateral_deuxieme_troisieme_degre = + Js.to_bool + autre_personne_a_charge + ##.ascendantDescendantCollateralDeuxiemeTroisiemeDegre; + parente = parente_of_jsoo autre_personne_a_charge##.parente; + incapacite_80_pourcent_ou_restriction_emploi = + Js.to_bool + autre_personne_a_charge##.incapacite80PourcentOuRestrictionEmploi; + beneficiaire_l161_19_l351_8_l643_3_secu = + Js.to_bool autre_personne_a_charge##.beneficiaireL16119L3518L6433Secu; + titulaire_allocation_personne_agee = + Js.to_bool autre_personne_a_charge##.titulaireAllocationPersonneAgee + } + +class type date_naissance_troisieme_ou_dernier_plus_enfant = + object + method kind : + Js.js_string Js.t Js.readonly_prop + (** Expects one of: + - "MoinsDeTroisEnfants" + - "PlusDeTroisEnfants" *) + + method payload : Js.Unsafe.any Js.t Js.readonly_prop + end + +let date_naissance_troisieme_ou_dernier_plus_enfant_to_jsoo + : DateNaissanceTroisiemeOuDernierPlusEnfant.t -> date_naissance_troisieme_ou_dernier_plus_enfant Js.t + = function + | MoinsDeTroisEnfants arg -> object%js + val kind = Js.string "MoinsDeTroisEnfants" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | PlusDeTroisEnfants arg -> object%js + val kind = Js.string "PlusDeTroisEnfants" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject (date_de_naissance_ou_mois_de_grossesse_to_jsoo arg)) + end + +let date_naissance_troisieme_ou_dernier_plus_enfant_of_jsoo + (date_naissance_troisieme_ou_dernier_plus_enfant + : date_naissance_troisieme_ou_dernier_plus_enfant Js.t) + : DateNaissanceTroisiemeOuDernierPlusEnfant.t = + match date_naissance_troisieme_ou_dernier_plus_enfant##.kind + |> Js.to_string with + | "MoinsDeTroisEnfants" -> + DateNaissanceTroisiemeOuDernierPlusEnfant.MoinsDeTroisEnfants () + | "PlusDeTroisEnfants" -> + DateNaissanceTroisiemeOuDernierPlusEnfant.PlusDeTroisEnfants (date_de_naissance_ou_mois_de_grossesse_of_jsoo (Js.Unsafe.coerce date_naissance_troisieme_ou_dernier_plus_enfant##.payload)) + | cons -> + failwith + (Printf.sprintf + "Unexpected '%s' kind for the enumeration 'DateNaissanceTroisiemeOuDernierPlusEnfant.t'" + cons) + + +class type informations_calcul_a_p_l_logement_foyer = + object + method redevance: Js.number Js.t Js.readonly_prop + method categorieEquivalenceLoyerD84216: + categorie_equivalence_loyer_allocation_logement_foyer Js.t Js.readonly_prop + end + let informations_calcul_a_p_l_logement_foyer_to_jsoo + (informations_calcul_a_p_l_logement_foyer + : InformationsCalculAPLLogementFoyer.t) + : informations_calcul_a_p_l_logement_foyer Js.t = + object%js + val redevance = + Js.number_of_float @@ money_to_float informations_calcul_a_p_l_logement_foyer.redevance + val categorieEquivalenceLoyerD84216 = + categorie_equivalence_loyer_allocation_logement_foyer_to_jsoo informations_calcul_a_p_l_logement_foyer.categorie_equivalence_loyer_d842_16 + end + let informations_calcul_a_p_l_logement_foyer_of_jsoo + (informations_calcul_a_p_l_logement_foyer + : informations_calcul_a_p_l_logement_foyer Js.t) : + InformationsCalculAPLLogementFoyer.t = + { + redevance = + money_of_decimal @@ decimal_of_float @@ Js.float_of_number + informations_calcul_a_p_l_logement_foyer##.redevance; + categorie_equivalence_loyer_d842_16 = + categorie_equivalence_loyer_allocation_logement_foyer_of_jsoo + informations_calcul_a_p_l_logement_foyer + ##.categorieEquivalenceLoyerD84216 + } + +class type enfant_prestations_familiales = + object + method identifiant: int Js.readonly_prop + method obligationScolaire: + situation_obligation_scolaire Js.t Js.readonly_prop + method remunerationMensuelle: Js.number Js.t Js.readonly_prop + method dateDeNaissance: Js.js_string Js.t Js.readonly_prop + method age: int Js.readonly_prop + method priseEnCharge: prise_en_charge_enfant Js.t Js.readonly_prop + method aDejaOuvertDroitAuxAllocationsFamiliales: + bool Js.t Js.readonly_prop + method beneficieTitrePersonnelAidePersonnelleLogement: + bool Js.t Js.readonly_prop + end + let enfant_prestations_familiales_to_jsoo (enfant_prestations_familiales + : EnfantPrestationsFamiliales.t) : enfant_prestations_familiales Js.t = + object%js + val identifiant = + integer_to_int enfant_prestations_familiales.identifiant + val obligationScolaire = + situation_obligation_scolaire_to_jsoo enfant_prestations_familiales.obligation_scolaire + val remunerationMensuelle = + Js.number_of_float @@ money_to_float enfant_prestations_familiales.remuneration_mensuelle + val dateDeNaissance = + date_to_jsoo enfant_prestations_familiales.date_de_naissance + val age = integer_to_int enfant_prestations_familiales.age + val priseEnCharge = + prise_en_charge_enfant_to_jsoo enfant_prestations_familiales.prise_en_charge + val aDejaOuvertDroitAuxAllocationsFamiliales = + Js.bool enfant_prestations_familiales.a_deja_ouvert_droit_aux_allocations_familiales + val beneficieTitrePersonnelAidePersonnelleLogement = + Js.bool enfant_prestations_familiales.beneficie_titre_personnel_aide_personnelle_logement + end + let enfant_prestations_familiales_of_jsoo + (enfant_prestations_familiales : enfant_prestations_familiales Js.t) : + EnfantPrestationsFamiliales.t = + { + identifiant = integer_of_int enfant_prestations_familiales##.identifiant; + obligation_scolaire = + situation_obligation_scolaire_of_jsoo + enfant_prestations_familiales##.obligationScolaire; + remuneration_mensuelle = + money_of_decimal @@ decimal_of_float @@ Js.float_of_number + enfant_prestations_familiales##.remunerationMensuelle; + date_de_naissance = + date_of_jsoo enfant_prestations_familiales##.dateDeNaissance; + age = integer_of_int enfant_prestations_familiales##.age; + prise_en_charge = + prise_en_charge_enfant_of_jsoo + enfant_prestations_familiales##.priseEnCharge; + a_deja_ouvert_droit_aux_allocations_familiales = + Js.to_bool + enfant_prestations_familiales + ##.aDejaOuvertDroitAuxAllocationsFamiliales; + beneficie_titre_personnel_aide_personnelle_logement = + Js.to_bool + enfant_prestations_familiales + ##.beneficieTitrePersonnelAidePersonnelleLogement + } + +class type enfant_a_charge = + object + method identifiant: int Js.readonly_prop + method beneficieTitrePersonnelAidePersonnelleLogement: + bool Js.t Js.readonly_prop + method aDejaOuvertDroitAuxAllocationsFamiliales: + bool Js.t Js.readonly_prop + method dateDeNaissance: Js.js_string Js.t Js.readonly_prop + method remunerationMensuelle: Js.number Js.t Js.readonly_prop + method obligationScolaire: + situation_obligation_scolaire Js.t Js.readonly_prop + method priseEnCharge: prise_en_charge Js.t Js.readonly_prop + method age: int Js.readonly_prop + method situationGardeAlternee: + situation_garde_alternee Js.t Js.readonly_prop + end + let enfant_a_charge_to_jsoo (enfant_a_charge : EnfantACharge.t) + : enfant_a_charge Js.t = + object%js + val identifiant = integer_to_int enfant_a_charge.identifiant + val beneficieTitrePersonnelAidePersonnelleLogement = + Js.bool enfant_a_charge.beneficie_titre_personnel_aide_personnelle_logement + val aDejaOuvertDroitAuxAllocationsFamiliales = + Js.bool enfant_a_charge.a_deja_ouvert_droit_aux_allocations_familiales + val dateDeNaissance = date_to_jsoo enfant_a_charge.date_de_naissance + val remunerationMensuelle = + Js.number_of_float @@ money_to_float enfant_a_charge.remuneration_mensuelle + val obligationScolaire = + situation_obligation_scolaire_to_jsoo enfant_a_charge.obligation_scolaire + val priseEnCharge = + prise_en_charge_to_jsoo enfant_a_charge.prise_en_charge + val age = integer_to_int enfant_a_charge.age + val situationGardeAlternee = + situation_garde_alternee_to_jsoo enfant_a_charge.situation_garde_alternee + end + let enfant_a_charge_of_jsoo (enfant_a_charge : enfant_a_charge Js.t) : + EnfantACharge.t = + { + identifiant = integer_of_int enfant_a_charge##.identifiant; + beneficie_titre_personnel_aide_personnelle_logement = + Js.to_bool + enfant_a_charge##.beneficieTitrePersonnelAidePersonnelleLogement; + a_deja_ouvert_droit_aux_allocations_familiales = + Js.to_bool enfant_a_charge##.aDejaOuvertDroitAuxAllocationsFamiliales; + date_de_naissance = date_of_jsoo enfant_a_charge##.dateDeNaissance; + remuneration_mensuelle = + money_of_decimal @@ decimal_of_float @@ Js.float_of_number + enfant_a_charge##.remunerationMensuelle; + obligation_scolaire = + situation_obligation_scolaire_of_jsoo + enfant_a_charge##.obligationScolaire; + prise_en_charge = + prise_en_charge_of_jsoo enfant_a_charge##.priseEnCharge; + age = integer_of_int enfant_a_charge##.age; + situation_garde_alternee = + situation_garde_alternee_of_jsoo + enfant_a_charge##.situationGardeAlternee + } + +class type loue_ou_sous_loue_a_des_tiers = + object + method kind : + Js.js_string Js.t Js.readonly_prop + (** Expects one of: + - "Non" + - "Oui" *) + + method payload : Js.Unsafe.any Js.t Js.readonly_prop + end + +let loue_ou_sous_loue_a_des_tiers_to_jsoo + : LoueOuSousLoueADesTiers.t -> loue_ou_sous_loue_a_des_tiers Js.t + = function + | Non arg -> object%js + val kind = Js.string "Non" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | Oui arg -> object%js + val kind = Js.string "Oui" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject (personne_sous_location_to_jsoo arg)) + end + +let loue_ou_sous_loue_a_des_tiers_of_jsoo + (loue_ou_sous_loue_a_des_tiers : loue_ou_sous_loue_a_des_tiers Js.t) + : LoueOuSousLoueADesTiers.t = + match loue_ou_sous_loue_a_des_tiers##.kind |> Js.to_string with + | "Non" -> LoueOuSousLoueADesTiers.Non () + | "Oui" -> + LoueOuSousLoueADesTiers.Oui (personne_sous_location_of_jsoo (Js.Unsafe.coerce loue_ou_sous_loue_a_des_tiers##.payload)) + | cons -> + failwith + (Printf.sprintf + "Unexpected '%s' kind for the enumeration 'LoueOuSousLoueADesTiers.t'" + cons) + + +class type demandeur = + object + method satisfaitConditionsL5122CodeSecuriteSociale: + bool Js.t Js.readonly_prop + method ageDemandeur: int Js.readonly_prop + method dateNaissance: Js.js_string Js.t Js.readonly_prop + method contratDeTravail: type_contrat_travail Js.t Js.readonly_prop + method nationalite: nationalite Js.t Js.readonly_prop + method patrimoine: patrimoine Js.t Js.readonly_prop + method personneHebergeeCentreSoinLL162223SecuriteSociale: + bool Js.t Js.readonly_prop + end + let demandeur_to_jsoo (demandeur : Demandeur.t) : demandeur Js.t = + object%js + val satisfaitConditionsL5122CodeSecuriteSociale = + Js.bool demandeur.satisfait_conditions_l512_2_code_securite_sociale + val ageDemandeur = integer_to_int demandeur.age_demandeur + val dateNaissance = date_to_jsoo demandeur.date_naissance + val contratDeTravail = + type_contrat_travail_to_jsoo demandeur.contrat_de_travail + val nationalite = nationalite_to_jsoo demandeur.nationalite + val patrimoine = patrimoine_to_jsoo demandeur.patrimoine + val personneHebergeeCentreSoinLL162223SecuriteSociale = + Js.bool demandeur.personne_hebergee_centre_soin_l_L162_22_3_securite_sociale + end + let demandeur_of_jsoo (demandeur : demandeur Js.t) : Demandeur.t = + { + satisfait_conditions_l512_2_code_securite_sociale = + Js.to_bool demandeur##.satisfaitConditionsL5122CodeSecuriteSociale; + age_demandeur = integer_of_int demandeur##.ageDemandeur; + date_naissance = date_of_jsoo demandeur##.dateNaissance; + contrat_de_travail = + type_contrat_travail_of_jsoo demandeur##.contratDeTravail; + nationalite = nationalite_of_jsoo demandeur##.nationalite; + patrimoine = patrimoine_of_jsoo demandeur##.patrimoine; + personne_hebergee_centre_soin_l_L162_22_3_securite_sociale = + Js.to_bool + demandeur##.personneHebergeeCentreSoinLL162223SecuriteSociale + } + +class type changement_logement_d842_4 = + object + method kind : + Js.js_string Js.t Js.readonly_prop + (** Expects one of: + - "Changement" + - "PasDeChangement" *) + + method payload : Js.Unsafe.any Js.t Js.readonly_prop + end + +let changement_logement_d842_4_to_jsoo + : ChangementLogementD8424.t -> changement_logement_d842_4 Js.t + = function + | Changement arg -> object%js + val kind = Js.string "Changement" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject (infos_changement_logement_d842_4_to_jsoo arg)) + end + | PasDeChangement arg -> object%js + val kind = Js.string "PasDeChangement" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + +let changement_logement_d842_4_of_jsoo + (changement_logement_d842_4 : changement_logement_d842_4 Js.t) + : ChangementLogementD8424.t = + match changement_logement_d842_4##.kind |> Js.to_string with + | "Changement" -> + ChangementLogementD8424.Changement (infos_changement_logement_d842_4_of_jsoo (Js.Unsafe.coerce changement_logement_d842_4##.payload)) + | "PasDeChangement" -> ChangementLogementD8424.PasDeChangement () + | cons -> + failwith + (Printf.sprintf + "Unexpected '%s' kind for the enumeration 'ChangementLogementD8424.t'" + cons) + + +class type location = + object method bailleur: bailleur Js.t Js.readonly_prop + end + let location_to_jsoo (location : Location.t) : location Js.t = + object%js + val bailleur = bailleur_to_jsoo location.bailleur + end + let location_of_jsoo (location : location Js.t) : Location.t = + {bailleur = bailleur_of_jsoo location##.bailleur + } + +class type proprietaire = + object method pret: pret Js.t Js.readonly_prop + end + let proprietaire_to_jsoo (proprietaire : Proprietaire.t) + : proprietaire Js.t = object%js + val pret = pret_to_jsoo proprietaire.pret + end + let proprietaire_of_jsoo (proprietaire : proprietaire Js.t) : + Proprietaire.t = {pret = pret_of_jsoo proprietaire##.pret + } + +class type informations_calcul_a_p_l_accession_propriete = + object + method mensualitePrincipale: Js.number Js.t Js.readonly_prop + method chargesMensuellesPret: Js.number Js.t Js.readonly_prop + method dateSignaturePret: Js.js_string Js.t Js.readonly_prop + method dateEntreeLogement: Js.js_string Js.t Js.readonly_prop + method typeTravauxLogementD83215: + type_travaux_logement_d832_15 Js.t Js.readonly_prop + method typeTravauxLogementR8425: + type_travaux_logement_r842_5 Js.t Js.readonly_prop + method localHabitePremiereFoisBeneficiaire: bool Js.t Js.readonly_prop + method copropriete: bool Js.t Js.readonly_prop + method situationR822111317: bool Js.t Js.readonly_prop + method typePret: type_pret Js.t Js.readonly_prop + method ancienneteLogement: neuf_ou_ancien Js.t Js.readonly_prop + end + let informations_calcul_a_p_l_accession_propriete_to_jsoo + (informations_calcul_a_p_l_accession_propriete + : InformationsCalculAPLAccessionPropriete.t) + : informations_calcul_a_p_l_accession_propriete Js.t = + object%js + val mensualitePrincipale = + Js.number_of_float @@ money_to_float informations_calcul_a_p_l_accession_propriete.mensualite_principale + val chargesMensuellesPret = + Js.number_of_float @@ money_to_float informations_calcul_a_p_l_accession_propriete.charges_mensuelles_pret + val dateSignaturePret = + date_to_jsoo informations_calcul_a_p_l_accession_propriete.date_signature_pret + val dateEntreeLogement = + date_to_jsoo informations_calcul_a_p_l_accession_propriete.date_entree_logement + val typeTravauxLogementD83215 = + type_travaux_logement_d832_15_to_jsoo informations_calcul_a_p_l_accession_propriete.type_travaux_logement_d832_15 + val typeTravauxLogementR8425 = + type_travaux_logement_r842_5_to_jsoo informations_calcul_a_p_l_accession_propriete.type_travaux_logement_r842_5 + val localHabitePremiereFoisBeneficiaire = + Js.bool informations_calcul_a_p_l_accession_propriete.local_habite_premiere_fois_beneficiaire + val copropriete = + Js.bool informations_calcul_a_p_l_accession_propriete.copropriete + val situationR822111317 = + Js.bool informations_calcul_a_p_l_accession_propriete.situation_r822_11_13_17 + val typePret = + type_pret_to_jsoo informations_calcul_a_p_l_accession_propriete.type_pret + val ancienneteLogement = + neuf_ou_ancien_to_jsoo informations_calcul_a_p_l_accession_propriete.anciennete_logement + end + let informations_calcul_a_p_l_accession_propriete_of_jsoo + (informations_calcul_a_p_l_accession_propriete + : informations_calcul_a_p_l_accession_propriete Js.t) : + InformationsCalculAPLAccessionPropriete.t = + { + mensualite_principale = + money_of_decimal @@ decimal_of_float @@ Js.float_of_number + informations_calcul_a_p_l_accession_propriete + ##.mensualitePrincipale; + charges_mensuelles_pret = + money_of_decimal @@ decimal_of_float @@ Js.float_of_number + informations_calcul_a_p_l_accession_propriete + ##.chargesMensuellesPret; + date_signature_pret = + date_of_jsoo + informations_calcul_a_p_l_accession_propriete##.dateSignaturePret; + date_entree_logement = + date_of_jsoo + informations_calcul_a_p_l_accession_propriete##.dateEntreeLogement; + type_travaux_logement_d832_15 = + type_travaux_logement_d832_15_of_jsoo + informations_calcul_a_p_l_accession_propriete + ##.typeTravauxLogementD83215; + type_travaux_logement_r842_5 = + type_travaux_logement_r842_5_of_jsoo + informations_calcul_a_p_l_accession_propriete + ##.typeTravauxLogementR8425; + local_habite_premiere_fois_beneficiaire = + Js.to_bool + informations_calcul_a_p_l_accession_propriete + ##.localHabitePremiereFoisBeneficiaire; + copropriete = + Js.to_bool + informations_calcul_a_p_l_accession_propriete##.copropriete; + situation_r822_11_13_17 = + Js.to_bool + informations_calcul_a_p_l_accession_propriete##.situationR822111317; + type_pret = + type_pret_of_jsoo + informations_calcul_a_p_l_accession_propriete##.typePret; + anciennete_logement = + neuf_ou_ancien_of_jsoo + informations_calcul_a_p_l_accession_propriete##.ancienneteLogement + } + +class type personne_a_charge = + object + method kind : + Js.js_string Js.t Js.readonly_prop + (** Expects one of: + - "EnfantACharge" + - "AutrePersonneACharge" *) + + method payload : Js.Unsafe.any Js.t Js.readonly_prop + end + +let personne_a_charge_to_jsoo : PersonneACharge.t -> personne_a_charge Js.t + = function + | EnfantACharge arg -> object%js + val kind = Js.string "EnfantACharge" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject (enfant_a_charge_to_jsoo arg)) + end + | AutrePersonneACharge arg -> object%js + val kind = Js.string "AutrePersonneACharge" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject (autre_personne_a_charge_to_jsoo arg)) + end + +let personne_a_charge_of_jsoo (personne_a_charge : personne_a_charge Js.t) + : PersonneACharge.t = + match personne_a_charge##.kind |> Js.to_string with + | "EnfantACharge" -> + PersonneACharge.EnfantACharge (enfant_a_charge_of_jsoo (Js.Unsafe.coerce personne_a_charge##.payload)) + | "AutrePersonneACharge" -> + PersonneACharge.AutrePersonneACharge (autre_personne_a_charge_of_jsoo (Js.Unsafe.coerce personne_a_charge##.payload)) + | cons -> + failwith + (Printf.sprintf + "Unexpected '%s' kind for the enumeration 'PersonneACharge.t'" cons) + + +class type informations_calcul_a_p_l_locatif = + object + method loyerPrincipal: Js.number Js.t Js.readonly_prop + method beneficiaireAideAdulteOuEnfantHandicapes: + bool Js.t Js.readonly_prop + method logementEstChambre: bool Js.t Js.readonly_prop + method colocation: bool Js.t Js.readonly_prop + method ageesOuHandicapAdultesHebergeesOnereuxParticuliers: + bool Js.t Js.readonly_prop + method reductionLoyerSolidarite: Js.number Js.t Js.readonly_prop + method logementMeubleD8422: bool Js.t Js.readonly_prop + method changementLogementD8424: + changement_logement_d842_4 Js.t Js.readonly_prop + end + let informations_calcul_a_p_l_locatif_to_jsoo + (informations_calcul_a_p_l_locatif : InformationsCalculAPLLocatif.t) + : informations_calcul_a_p_l_locatif Js.t = + object%js + val loyerPrincipal = + Js.number_of_float @@ money_to_float informations_calcul_a_p_l_locatif.loyer_principal + val beneficiaireAideAdulteOuEnfantHandicapes = + Js.bool informations_calcul_a_p_l_locatif.beneficiaire_aide_adulte_ou_enfant_handicapes + val logementEstChambre = + Js.bool informations_calcul_a_p_l_locatif.logement_est_chambre + val colocation = Js.bool informations_calcul_a_p_l_locatif.colocation + val ageesOuHandicapAdultesHebergeesOnereuxParticuliers = + Js.bool informations_calcul_a_p_l_locatif.agees_ou_handicap_adultes_hebergees_onereux_particuliers + val reductionLoyerSolidarite = + Js.number_of_float @@ money_to_float informations_calcul_a_p_l_locatif.reduction_loyer_solidarite + val logementMeubleD8422 = + Js.bool informations_calcul_a_p_l_locatif.logement_meuble_d842_2 + val changementLogementD8424 = + changement_logement_d842_4_to_jsoo informations_calcul_a_p_l_locatif.changement_logement_d842_4 + end + let informations_calcul_a_p_l_locatif_of_jsoo + (informations_calcul_a_p_l_locatif + : informations_calcul_a_p_l_locatif Js.t) : + InformationsCalculAPLLocatif.t = + { + loyer_principal = + money_of_decimal @@ decimal_of_float @@ Js.float_of_number + informations_calcul_a_p_l_locatif##.loyerPrincipal; + beneficiaire_aide_adulte_ou_enfant_handicapes = + Js.to_bool + informations_calcul_a_p_l_locatif + ##.beneficiaireAideAdulteOuEnfantHandicapes; + logement_est_chambre = + Js.to_bool informations_calcul_a_p_l_locatif##.logementEstChambre; + colocation = Js.to_bool informations_calcul_a_p_l_locatif##.colocation; + agees_ou_handicap_adultes_hebergees_onereux_particuliers = + Js.to_bool + informations_calcul_a_p_l_locatif + ##.ageesOuHandicapAdultesHebergeesOnereuxParticuliers; + reduction_loyer_solidarite = + money_of_decimal @@ decimal_of_float @@ Js.float_of_number + informations_calcul_a_p_l_locatif##.reductionLoyerSolidarite; + logement_meuble_d842_2 = + Js.to_bool informations_calcul_a_p_l_locatif##.logementMeubleD8422; + changement_logement_d842_4 = + changement_logement_d842_4_of_jsoo + informations_calcul_a_p_l_locatif##.changementLogementD8424 + } + +class type logement_foyer = + object + method typeUser: type_logement_foyer Js.t Js.readonly_prop + method dateConventionnement: Js.js_string Js.t Js.readonly_prop + method location: location Js.t Js.readonly_prop + method remplitConditionsR83221: bool Js.t Js.readonly_prop + method construitApplicationLoi195712III: bool Js.t Js.readonly_prop + end + let logement_foyer_to_jsoo (logement_foyer : LogementFoyer.t) + : logement_foyer Js.t = + object%js + val typeUser = type_logement_foyer_to_jsoo logement_foyer.type_user + val dateConventionnement = + date_to_jsoo logement_foyer.date_conventionnement + val location = location_to_jsoo logement_foyer.location + val remplitConditionsR83221 = + Js.bool logement_foyer.remplit_conditions_r832_21 + val construitApplicationLoi195712III = + Js.bool logement_foyer.construit_application_loi_1957_12_III + end + let logement_foyer_of_jsoo (logement_foyer : logement_foyer Js.t) : + LogementFoyer.t = + { + type_user = type_logement_foyer_of_jsoo logement_foyer##.typeUser; + date_conventionnement = + date_of_jsoo logement_foyer##.dateConventionnement; + location = location_of_jsoo logement_foyer##.location; + remplit_conditions_r832_21 = + Js.to_bool logement_foyer##.remplitConditionsR83221; + construit_application_loi_1957_12_III = + Js.to_bool logement_foyer##.construitApplicationLoi195712III + } + +class type informations_calcul_a_p_l = + object + method kind : + Js.js_string Js.t Js.readonly_prop + (** Expects one of: + - "InfosLocatif" + - "InfosLogementFoyer" + - "InfosAccessionPropriete" *) + + method payload : Js.Unsafe.any Js.t Js.readonly_prop + end + +let informations_calcul_a_p_l_to_jsoo + : InformationsCalculAPL.t -> informations_calcul_a_p_l Js.t + = function + | InfosLocatif arg -> object%js + val kind = Js.string "InfosLocatif" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject (informations_calcul_a_p_l_locatif_to_jsoo arg)) + end + | InfosLogementFoyer arg -> object%js + val kind = Js.string "InfosLogementFoyer" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject (informations_calcul_a_p_l_logement_foyer_to_jsoo arg)) + end + | InfosAccessionPropriete arg -> object%js + val kind = Js.string "InfosAccessionPropriete" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject (informations_calcul_a_p_l_accession_propriete_to_jsoo arg)) + end + +let informations_calcul_a_p_l_of_jsoo + (informations_calcul_a_p_l : informations_calcul_a_p_l Js.t) + : InformationsCalculAPL.t = + match informations_calcul_a_p_l##.kind |> Js.to_string with + | "InfosLocatif" -> + InformationsCalculAPL.InfosLocatif (informations_calcul_a_p_l_locatif_of_jsoo (Js.Unsafe.coerce informations_calcul_a_p_l##.payload)) + | "InfosLogementFoyer" -> + InformationsCalculAPL.InfosLogementFoyer (informations_calcul_a_p_l_logement_foyer_of_jsoo (Js.Unsafe.coerce informations_calcul_a_p_l##.payload)) + | "InfosAccessionPropriete" -> + InformationsCalculAPL.InfosAccessionPropriete (informations_calcul_a_p_l_accession_propriete_of_jsoo (Js.Unsafe.coerce informations_calcul_a_p_l##.payload)) + | cons -> + failwith + (Printf.sprintf + "Unexpected '%s' kind for the enumeration 'InformationsCalculAPL.t'" + cons) + + +class type mode_occupation = + object + method kind : + Js.js_string Js.t Js.readonly_prop + (** Expects one of: + - "Locataire" + - "ResidentLogementFoyer" + - "AccessionProprieteLocalUsageExclusifHabitation" + - "SousLocataire" + - "LocationAccession" *) + + method payload : Js.Unsafe.any Js.t Js.readonly_prop + end + +let mode_occupation_to_jsoo : ModeOccupation.t -> mode_occupation Js.t + = function + | Locataire arg -> object%js + val kind = Js.string "Locataire" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject (location_to_jsoo arg)) + end + | ResidentLogementFoyer arg -> object%js + val kind = Js.string "ResidentLogementFoyer" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject (logement_foyer_to_jsoo arg)) + end + | AccessionProprieteLocalUsageExclusifHabitation arg -> object%js + val kind = Js.string "AccessionProprieteLocalUsageExclusifHabitation" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject (proprietaire_to_jsoo arg)) + end + | SousLocataire arg -> object%js + val kind = Js.string "SousLocataire" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject (location_to_jsoo arg)) + end + | LocationAccession arg -> object%js + val kind = Js.string "LocationAccession" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject (proprietaire_to_jsoo arg)) + end + +let mode_occupation_of_jsoo (mode_occupation : mode_occupation Js.t) + : ModeOccupation.t = + match mode_occupation##.kind |> Js.to_string with + | "Locataire" -> + ModeOccupation.Locataire (location_of_jsoo (Js.Unsafe.coerce mode_occupation##.payload)) + | "ResidentLogementFoyer" -> + ModeOccupation.ResidentLogementFoyer (logement_foyer_of_jsoo (Js.Unsafe.coerce mode_occupation##.payload)) + | "AccessionProprieteLocalUsageExclusifHabitation" -> + ModeOccupation.AccessionProprieteLocalUsageExclusifHabitation (proprietaire_of_jsoo (Js.Unsafe.coerce mode_occupation##.payload)) + | "SousLocataire" -> + ModeOccupation.SousLocataire (location_of_jsoo (Js.Unsafe.coerce mode_occupation##.payload)) + | "LocationAccession" -> + ModeOccupation.LocationAccession (proprietaire_of_jsoo (Js.Unsafe.coerce mode_occupation##.payload)) + | cons -> + failwith + (Printf.sprintf + "Unexpected '%s' kind for the enumeration 'ModeOccupation.t'" cons) + + +class type logement = + object + method residencePrincipale: bool Js.t Js.readonly_prop + method estEhpadOuMaisonAutonomieL31312Asf: bool Js.t Js.readonly_prop + method modeOccupation: mode_occupation Js.t Js.readonly_prop + method proprietaire: parent_ou_autre Js.t Js.readonly_prop + method loueOuSousLoueADesTiers: + loue_ou_sous_loue_a_des_tiers Js.t Js.readonly_prop + method usufruit: parent_ou_autre Js.t Js.readonly_prop + method logementDecentL89462: bool Js.t Js.readonly_prop + method surfaceMCarres: int Js.readonly_prop + method estAncienL8312: bool Js.t Js.readonly_prop + method situeCommuneDesequilibreL8312: bool Js.t Js.readonly_prop + method zone: zone_d_habitation Js.t Js.readonly_prop + end + let logement_to_jsoo (logement : Logement.t) : logement Js.t = + object%js + val residencePrincipale = Js.bool logement.residence_principale + val estEhpadOuMaisonAutonomieL31312Asf = + Js.bool logement.est_ehpad_ou_maison_autonomie_l313_12_asf + val modeOccupation = mode_occupation_to_jsoo logement.mode_occupation + val proprietaire = parent_ou_autre_to_jsoo logement.proprietaire + val loueOuSousLoueADesTiers = + loue_ou_sous_loue_a_des_tiers_to_jsoo logement.loue_ou_sous_loue_a_des_tiers + val usufruit = parent_ou_autre_to_jsoo logement.usufruit + val logementDecentL89462 = Js.bool logement.logement_decent_l89_462 + val surfaceMCarres = integer_to_int logement.surface_m_carres + val estAncienL8312 = Js.bool logement.est_ancien_l831_2 + val situeCommuneDesequilibreL8312 = + Js.bool logement.situe_commune_desequilibre_l831_2 + val zone = zone_d_habitation_to_jsoo logement.zone + end + let logement_of_jsoo (logement : logement Js.t) : Logement.t = + { + residence_principale = Js.to_bool logement##.residencePrincipale; + est_ehpad_ou_maison_autonomie_l313_12_asf = + Js.to_bool logement##.estEhpadOuMaisonAutonomieL31312Asf; + mode_occupation = mode_occupation_of_jsoo logement##.modeOccupation; + proprietaire = parent_ou_autre_of_jsoo logement##.proprietaire; + loue_ou_sous_loue_a_des_tiers = + loue_ou_sous_loue_a_des_tiers_of_jsoo + logement##.loueOuSousLoueADesTiers; + usufruit = parent_ou_autre_of_jsoo logement##.usufruit; + logement_decent_l89_462 = Js.to_bool logement##.logementDecentL89462; + surface_m_carres = integer_of_int logement##.surfaceMCarres; + est_ancien_l831_2 = Js.to_bool logement##.estAncienL8312; + situe_commune_desequilibre_l831_2 = + Js.to_bool logement##.situeCommuneDesequilibreL8312; + zone = zone_d_habitation_of_jsoo logement##.zone + } + +class type menage = + object + method prestationsRecues: + prestation_recue Js.t Js.js_array Js.t Js.readonly_prop + method logement: logement Js.t Js.readonly_prop + method personnesACharge: + personne_a_charge Js.t Js.js_array Js.t Js.readonly_prop + method nombreAutresOccupantsLogement: int Js.readonly_prop + method situationFamiliale: situation_familiale Js.t Js.readonly_prop + method conditionRattacheFoyerFiscalParentIfi: bool Js.t Js.readonly_prop + method nombreEnfantsANaitreApresTroisiemeMoisGrossesse: + int Js.readonly_prop + method enfantANaitreApresQuatriemeMoisGrossesse: + bool Js.t Js.readonly_prop + method dateNaissanceTroisiemeEnfantOuDernierSiPlus: + date_naissance_troisieme_ou_dernier_plus_enfant Js.t Js.readonly_prop + end + let menage_to_jsoo (menage : Menage.t) : menage Js.t = + object%js + val prestationsRecues = + Js.array @@ Array.map (fun x -> prestation_recue_to_jsoo x) menage.prestations_recues + val logement = logement_to_jsoo menage.logement + val personnesACharge = + Js.array @@ Array.map (fun x -> personne_a_charge_to_jsoo x) menage.personnes_a_charge + val nombreAutresOccupantsLogement = + integer_to_int menage.nombre_autres_occupants_logement + val situationFamiliale = + situation_familiale_to_jsoo menage.situation_familiale + val conditionRattacheFoyerFiscalParentIfi = + Js.bool menage.condition_rattache_foyer_fiscal_parent_ifi + val nombreEnfantsANaitreApresTroisiemeMoisGrossesse = + integer_to_int menage.nombre_enfants_a_naitre_apres_troisieme_mois_grossesse + val enfantANaitreApresQuatriemeMoisGrossesse = + Js.bool menage.enfant_a_naitre_apres_quatrieme_mois_grossesse + val dateNaissanceTroisiemeEnfantOuDernierSiPlus = + date_naissance_troisieme_ou_dernier_plus_enfant_to_jsoo menage.date_naissance_troisieme_enfant_ou_dernier_si_plus + end + let menage_of_jsoo (menage : menage Js.t) : Menage.t = + { + prestations_recues = + Array.map (fun x -> prestation_recue_of_jsoo x) @@ Js.to_array + menage##.prestationsRecues; + logement = logement_of_jsoo menage##.logement; + personnes_a_charge = + Array.map (fun x -> personne_a_charge_of_jsoo x) @@ Js.to_array + menage##.personnesACharge; + nombre_autres_occupants_logement = + integer_of_int menage##.nombreAutresOccupantsLogement; + situation_familiale = + situation_familiale_of_jsoo menage##.situationFamiliale; + condition_rattache_foyer_fiscal_parent_ifi = + Js.to_bool menage##.conditionRattacheFoyerFiscalParentIfi; + nombre_enfants_a_naitre_apres_troisieme_mois_grossesse = + integer_of_int + menage##.nombreEnfantsANaitreApresTroisiemeMoisGrossesse; + enfant_a_naitre_apres_quatrieme_mois_grossesse = + Js.to_bool menage##.enfantANaitreApresQuatriemeMoisGrossesse; + date_naissance_troisieme_enfant_ou_dernier_si_plus = + date_naissance_troisieme_ou_dernier_plus_enfant_of_jsoo + menage##.dateNaissanceTroisiemeEnfantOuDernierSiPlus + } + +class type eligibilite_aides_personnelle_logement_out = + object + method dateCouranteOut: Js.js_string Js.t Js.readonly_prop + method eligibiliteOut: bool Js.t Js.readonly_prop + method nombrePersonnesAChargePrisesEnCompteOut: int Js.readonly_prop + method coefficentsEnfantsGardeAlterneePrisEnCompteOut: + Js.number Js.t Js.js_array Js.t Js.readonly_prop + method condition2R8234Out: + (personne_a_charge Js.t, bool Js.t) Js.meth_callback Js.meth + end + let eligibilite_aides_personnelle_logement_out_to_jsoo + (eligibilite_aides_personnelle_logement_out + : EligibiliteAidesPersonnelleLogementOut.t) + : eligibilite_aides_personnelle_logement_out Js.t = + object%js + val dateCouranteOut = + date_to_jsoo eligibilite_aides_personnelle_logement_out.date_courante_out + val eligibiliteOut = + Js.bool eligibilite_aides_personnelle_logement_out.eligibilite_out + val nombrePersonnesAChargePrisesEnCompteOut = + integer_to_int eligibilite_aides_personnelle_logement_out.nombre_personnes_a_charge_prises_en_compte_out + val coefficentsEnfantsGardeAlterneePrisEnCompteOut = + Js.array @@ Array.map (fun x -> Js.number_of_float @@ decimal_to_float x) eligibilite_aides_personnelle_logement_out.coefficents_enfants_garde_alternee_pris_en_compte_out + method condition2R8234Out = Js.wrap_meth_callback + ( + fun input -> + Js.bool (eligibilite_aides_personnelle_logement_out.condition_2_r823_4_out (personne_a_charge_of_jsoo input))) + end + let eligibilite_aides_personnelle_logement_out_of_jsoo + (eligibilite_aides_personnelle_logement_out + : eligibilite_aides_personnelle_logement_out Js.t) : + EligibiliteAidesPersonnelleLogementOut.t = + { + date_courante_out = + date_of_jsoo + eligibilite_aides_personnelle_logement_out##.dateCouranteOut; + eligibilite_out = + Js.to_bool + eligibilite_aides_personnelle_logement_out##.eligibiliteOut; + nombre_personnes_a_charge_prises_en_compte_out = + integer_of_int + eligibilite_aides_personnelle_logement_out + ##.nombrePersonnesAChargePrisesEnCompteOut; + coefficents_enfants_garde_alternee_pris_en_compte_out = + Array.map (fun x -> decimal_of_float @@ Js.float_of_number x) @@ Js.to_array + eligibilite_aides_personnelle_logement_out + ##.coefficentsEnfantsGardeAlterneePrisEnCompteOut; + condition_2_r823_4_out = failwith "The function 'condition_2_r823_4_out' translation isn't yet supported..." + } + +class type eligibilite_aides_personnelle_logement_in = + object + method menageIn: menage Js.t Js.readonly_prop + method demandeurIn: demandeur Js.t Js.readonly_prop + method dateCouranteIn: Js.js_string Js.t Js.readonly_prop + method conditionLogementResidencePrincipaleIn: + (unit, bool Js.t) Js.meth_callback Js.meth + method conditionLogementSurfaceIn: + (unit, bool Js.t) Js.meth_callback Js.meth + end + let eligibilite_aides_personnelle_logement_in_to_jsoo + (eligibilite_aides_personnelle_logement_in + : EligibiliteAidesPersonnelleLogementIn.t) + : eligibilite_aides_personnelle_logement_in Js.t = + object%js + val menageIn = + menage_to_jsoo eligibilite_aides_personnelle_logement_in.menage_in + val demandeurIn = + demandeur_to_jsoo eligibilite_aides_personnelle_logement_in.demandeur_in + val dateCouranteIn = + date_to_jsoo eligibilite_aides_personnelle_logement_in.date_courante_in + method conditionLogementResidencePrincipaleIn = Js.wrap_meth_callback + ( + fun input -> + Js.bool (eligibilite_aides_personnelle_logement_in.condition_logement_residence_principale_in ( input))) + method conditionLogementSurfaceIn = Js.wrap_meth_callback + ( + fun input -> + Js.bool (eligibilite_aides_personnelle_logement_in.condition_logement_surface_in ( input))) + end + let eligibilite_aides_personnelle_logement_in_of_jsoo + (eligibilite_aides_personnelle_logement_in + : eligibilite_aides_personnelle_logement_in Js.t) : + EligibiliteAidesPersonnelleLogementIn.t = + { + menage_in = + menage_of_jsoo eligibilite_aides_personnelle_logement_in##.menageIn; + demandeur_in = + demandeur_of_jsoo + eligibilite_aides_personnelle_logement_in##.demandeurIn; + date_courante_in = + date_of_jsoo + eligibilite_aides_personnelle_logement_in##.dateCouranteIn; + condition_logement_residence_principale_in = failwith "The function 'condition_logement_residence_principale_in' translation isn't yet supported..."; + condition_logement_surface_in = failwith "The function 'condition_logement_surface_in' translation isn't yet supported..." + } + +class type eligibilite_aide_personnalisee_logement_out = + object + method dateCouranteOut: Js.js_string Js.t Js.readonly_prop + method eligibiliteOut: bool Js.t Js.readonly_prop + method nombrePersonnesAChargePrisesEnCompteOut: int Js.readonly_prop + method coefficentsEnfantsGardeAlterneePrisEnCompteOut: + Js.number Js.t Js.js_array Js.t Js.readonly_prop + end + let eligibilite_aide_personnalisee_logement_out_to_jsoo + (eligibilite_aide_personnalisee_logement_out + : EligibiliteAidePersonnaliseeLogementOut.t) + : eligibilite_aide_personnalisee_logement_out Js.t = + object%js + val dateCouranteOut = + date_to_jsoo eligibilite_aide_personnalisee_logement_out.date_courante_out + val eligibiliteOut = + Js.bool eligibilite_aide_personnalisee_logement_out.eligibilite_out + val nombrePersonnesAChargePrisesEnCompteOut = + integer_to_int eligibilite_aide_personnalisee_logement_out.nombre_personnes_a_charge_prises_en_compte_out + val coefficentsEnfantsGardeAlterneePrisEnCompteOut = + Js.array @@ Array.map (fun x -> Js.number_of_float @@ decimal_to_float x) eligibilite_aide_personnalisee_logement_out.coefficents_enfants_garde_alternee_pris_en_compte_out + end + let eligibilite_aide_personnalisee_logement_out_of_jsoo + (eligibilite_aide_personnalisee_logement_out + : eligibilite_aide_personnalisee_logement_out Js.t) : + EligibiliteAidePersonnaliseeLogementOut.t = + { + date_courante_out = + date_of_jsoo + eligibilite_aide_personnalisee_logement_out##.dateCouranteOut; + eligibilite_out = + Js.to_bool + eligibilite_aide_personnalisee_logement_out##.eligibiliteOut; + nombre_personnes_a_charge_prises_en_compte_out = + integer_of_int + eligibilite_aide_personnalisee_logement_out + ##.nombrePersonnesAChargePrisesEnCompteOut; + coefficents_enfants_garde_alternee_pris_en_compte_out = + Array.map (fun x -> decimal_of_float @@ Js.float_of_number x) @@ Js.to_array + eligibilite_aide_personnalisee_logement_out + ##.coefficentsEnfantsGardeAlterneePrisEnCompteOut + } + +class type eligibilite_aide_personnalisee_logement_in = + object + method menageIn: menage Js.t Js.readonly_prop + method demandeurIn: demandeur Js.t Js.readonly_prop + method dateCouranteIn: Js.js_string Js.t Js.readonly_prop + end + let eligibilite_aide_personnalisee_logement_in_to_jsoo + (eligibilite_aide_personnalisee_logement_in + : EligibiliteAidePersonnaliseeLogementIn.t) + : eligibilite_aide_personnalisee_logement_in Js.t = + object%js + val menageIn = + menage_to_jsoo eligibilite_aide_personnalisee_logement_in.menage_in + val demandeurIn = + demandeur_to_jsoo eligibilite_aide_personnalisee_logement_in.demandeur_in + val dateCouranteIn = + date_to_jsoo eligibilite_aide_personnalisee_logement_in.date_courante_in + end + let eligibilite_aide_personnalisee_logement_in_of_jsoo + (eligibilite_aide_personnalisee_logement_in + : eligibilite_aide_personnalisee_logement_in Js.t) : + EligibiliteAidePersonnaliseeLogementIn.t = + { + menage_in = + menage_of_jsoo eligibilite_aide_personnalisee_logement_in##.menageIn; + demandeur_in = + demandeur_of_jsoo + eligibilite_aide_personnalisee_logement_in##.demandeurIn; + date_courante_in = + date_of_jsoo + eligibilite_aide_personnalisee_logement_in##.dateCouranteIn + } + +class type eligibilite_allocation_logement_out = + object + method eligibiliteAvecConditionLogementOut: + eligibilite_allocation_logement Js.t Js.readonly_prop + method nombrePersonnesAChargePrisesEnCompteOut: int Js.readonly_prop + method coefficentsEnfantsGardeAlterneePrisEnCompteOut: + Js.number Js.t Js.js_array Js.t Js.readonly_prop + end + let eligibilite_allocation_logement_out_to_jsoo + (eligibilite_allocation_logement_out + : EligibiliteAllocationLogementOut.t) + : eligibilite_allocation_logement_out Js.t = + object%js + val eligibiliteAvecConditionLogementOut = + eligibilite_allocation_logement_to_jsoo eligibilite_allocation_logement_out.eligibilite_avec_condition_logement_out + val nombrePersonnesAChargePrisesEnCompteOut = + integer_to_int eligibilite_allocation_logement_out.nombre_personnes_a_charge_prises_en_compte_out + val coefficentsEnfantsGardeAlterneePrisEnCompteOut = + Js.array @@ Array.map (fun x -> Js.number_of_float @@ decimal_to_float x) eligibilite_allocation_logement_out.coefficents_enfants_garde_alternee_pris_en_compte_out + end + let eligibilite_allocation_logement_out_of_jsoo + (eligibilite_allocation_logement_out + : eligibilite_allocation_logement_out Js.t) : + EligibiliteAllocationLogementOut.t = + { + eligibilite_avec_condition_logement_out = + eligibilite_allocation_logement_of_jsoo + eligibilite_allocation_logement_out + ##.eligibiliteAvecConditionLogementOut; + nombre_personnes_a_charge_prises_en_compte_out = + integer_of_int + eligibilite_allocation_logement_out + ##.nombrePersonnesAChargePrisesEnCompteOut; + coefficents_enfants_garde_alternee_pris_en_compte_out = + Array.map (fun x -> decimal_of_float @@ Js.float_of_number x) @@ Js.to_array + eligibilite_allocation_logement_out + ##.coefficentsEnfantsGardeAlterneePrisEnCompteOut + } + +class type eligibilite_allocation_logement_in = + object + method dateCouranteIn: Js.js_string Js.t Js.readonly_prop + method menageIn: menage Js.t Js.readonly_prop + method demandeurIn: demandeur Js.t Js.readonly_prop + method beneficieAidePersonnaliseeLogementIn: bool Js.t Js.readonly_prop + method informationsCalculIn: + informations_calcul_a_p_l Js.t Js.readonly_prop + end + let eligibilite_allocation_logement_in_to_jsoo + (eligibilite_allocation_logement_in : EligibiliteAllocationLogementIn.t) + : eligibilite_allocation_logement_in Js.t = + object%js + val dateCouranteIn = + date_to_jsoo eligibilite_allocation_logement_in.date_courante_in + val menageIn = + menage_to_jsoo eligibilite_allocation_logement_in.menage_in + val demandeurIn = + demandeur_to_jsoo eligibilite_allocation_logement_in.demandeur_in + val beneficieAidePersonnaliseeLogementIn = + Js.bool eligibilite_allocation_logement_in.beneficie_aide_personnalisee_logement_in + val informationsCalculIn = + informations_calcul_a_p_l_to_jsoo eligibilite_allocation_logement_in.informations_calcul_in + end + let eligibilite_allocation_logement_in_of_jsoo + (eligibilite_allocation_logement_in + : eligibilite_allocation_logement_in Js.t) : + EligibiliteAllocationLogementIn.t = + { + date_courante_in = + date_of_jsoo eligibilite_allocation_logement_in##.dateCouranteIn; + menage_in = + menage_of_jsoo eligibilite_allocation_logement_in##.menageIn; + demandeur_in = + demandeur_of_jsoo eligibilite_allocation_logement_in##.demandeurIn; + beneficie_aide_personnalisee_logement_in = + Js.to_bool + eligibilite_allocation_logement_in + ##.beneficieAidePersonnaliseeLogementIn; + informations_calcul_in = + informations_calcul_a_p_l_of_jsoo + eligibilite_allocation_logement_in##.informationsCalculIn + } + +class type eligibilite_prime_de_demenagement_out = + object method montantPrimeDemenagementOut: Js.number Js.t Js.readonly_prop + end + let eligibilite_prime_de_demenagement_out_to_jsoo + (eligibilite_prime_de_demenagement_out + : EligibilitePrimeDeDemenagementOut.t) + : eligibilite_prime_de_demenagement_out Js.t = + object%js + val montantPrimeDemenagementOut = + Js.number_of_float @@ money_to_float eligibilite_prime_de_demenagement_out.montant_prime_demenagement_out + end + let eligibilite_prime_de_demenagement_out_of_jsoo + (eligibilite_prime_de_demenagement_out + : eligibilite_prime_de_demenagement_out Js.t) : + EligibilitePrimeDeDemenagementOut.t = + { + montant_prime_demenagement_out = + money_of_decimal @@ decimal_of_float @@ Js.float_of_number + eligibilite_prime_de_demenagement_out##.montantPrimeDemenagementOut + } + +class type eligibilite_prime_de_demenagement_in = + object + method dateEmmenagementIn: Js.js_string Js.t Js.readonly_prop + method menageIn: menage Js.t Js.readonly_prop + method demandeurIn: demandeur Js.t Js.readonly_prop + method dateCouranteIn: Js.js_string Js.t Js.readonly_prop + method depensesJustifieesReellementEngageesIn: + Js.number Js.t Js.readonly_prop + end + let eligibilite_prime_de_demenagement_in_to_jsoo + (eligibilite_prime_de_demenagement_in + : EligibilitePrimeDeDemenagementIn.t) + : eligibilite_prime_de_demenagement_in Js.t = + object%js + val dateEmmenagementIn = + date_to_jsoo eligibilite_prime_de_demenagement_in.date_emmenagement_in + val menageIn = + menage_to_jsoo eligibilite_prime_de_demenagement_in.menage_in + val demandeurIn = + demandeur_to_jsoo eligibilite_prime_de_demenagement_in.demandeur_in + val dateCouranteIn = + date_to_jsoo eligibilite_prime_de_demenagement_in.date_courante_in + val depensesJustifieesReellementEngageesIn = + Js.number_of_float @@ money_to_float eligibilite_prime_de_demenagement_in.depenses_justifiees_reellement_engagees_in + end + let eligibilite_prime_de_demenagement_in_of_jsoo + (eligibilite_prime_de_demenagement_in + : eligibilite_prime_de_demenagement_in Js.t) : + EligibilitePrimeDeDemenagementIn.t = + { + date_emmenagement_in = + date_of_jsoo + eligibilite_prime_de_demenagement_in##.dateEmmenagementIn; + menage_in = + menage_of_jsoo eligibilite_prime_de_demenagement_in##.menageIn; + demandeur_in = + demandeur_of_jsoo eligibilite_prime_de_demenagement_in##.demandeurIn; + date_courante_in = + date_of_jsoo eligibilite_prime_de_demenagement_in##.dateCouranteIn; + depenses_justifiees_reellement_engagees_in = + money_of_decimal @@ decimal_of_float @@ Js.float_of_number + eligibilite_prime_de_demenagement_in + ##.depensesJustifieesReellementEngageesIn + } + +class type ressources_aides_personnelle_logement_out = + object method ressourcesPrisesEnCompteOut: Js.number Js.t Js.readonly_prop + end + let ressources_aides_personnelle_logement_out_to_jsoo + (ressources_aides_personnelle_logement_out + : RessourcesAidesPersonnelleLogementOut.t) + : ressources_aides_personnelle_logement_out Js.t = + object%js + val ressourcesPrisesEnCompteOut = + Js.number_of_float @@ money_to_float ressources_aides_personnelle_logement_out.ressources_prises_en_compte_out + end + let ressources_aides_personnelle_logement_out_of_jsoo + (ressources_aides_personnelle_logement_out + : ressources_aides_personnelle_logement_out Js.t) : + RessourcesAidesPersonnelleLogementOut.t = + { + ressources_prises_en_compte_out = + money_of_decimal @@ decimal_of_float @@ Js.float_of_number + ressources_aides_personnelle_logement_out + ##.ressourcesPrisesEnCompteOut + } + +class type ressources_aides_personnelle_logement_in = + object + method ressourcesDemandeurIn: Js.number Js.t Js.readonly_prop + method ressourcesConjointIn: Js.number Js.t Js.readonly_prop + method personnesVivantHabituellementFoyerIn: + personne_vivant_habituellement_au_foyer Js.t Js.js_array Js.t Js.readonly_prop + method demandeurExerceActiviteRemunereeIn: bool Js.t Js.readonly_prop + method conjointExerceActiviteRemunereeIn: bool Js.t Js.readonly_prop + method personnesAChargeIn: + personne_a_charge Js.t Js.js_array Js.t Js.readonly_prop + method situationFamilialeIn: situation_familiale Js.t Js.readonly_prop + method modeOccupationIn: mode_occupation Js.t Js.readonly_prop + method conditionAgeBourseEnseignementSuperieurIn: + bool Js.t Js.readonly_prop + method demandeurPoursuitDesEtudesIn: bool Js.t Js.readonly_prop + method dateDemandeOuReexamenDroitIn: Js.js_string Js.t Js.readonly_prop + method paiementLogementDistinctProfessionnelIn: + paiement_logement_distinct_professionnel Js.t Js.readonly_prop + method ressourcesMenageArrondiesBaseIn: Js.number Js.t Js.readonly_prop + end + let ressources_aides_personnelle_logement_in_to_jsoo + (ressources_aides_personnelle_logement_in + : RessourcesAidesPersonnelleLogementIn.t) + : ressources_aides_personnelle_logement_in Js.t = + object%js + val ressourcesDemandeurIn = + Js.number_of_float @@ money_to_float ressources_aides_personnelle_logement_in.ressources_demandeur_in + val ressourcesConjointIn = + Js.number_of_float @@ money_to_float ressources_aides_personnelle_logement_in.ressources_conjoint_in + val personnesVivantHabituellementFoyerIn = + Js.array @@ Array.map (fun x -> personne_vivant_habituellement_au_foyer_to_jsoo x) ressources_aides_personnelle_logement_in.personnes_vivant_habituellement_foyer_in + val demandeurExerceActiviteRemunereeIn = + Js.bool ressources_aides_personnelle_logement_in.demandeur_exerce_activite_remuneree_in + val conjointExerceActiviteRemunereeIn = + Js.bool ressources_aides_personnelle_logement_in.conjoint_exerce_activite_remuneree_in + val personnesAChargeIn = + Js.array @@ Array.map (fun x -> personne_a_charge_to_jsoo x) ressources_aides_personnelle_logement_in.personnes_a_charge_in + val situationFamilialeIn = + situation_familiale_to_jsoo ressources_aides_personnelle_logement_in.situation_familiale_in + val modeOccupationIn = + mode_occupation_to_jsoo ressources_aides_personnelle_logement_in.mode_occupation_in + val conditionAgeBourseEnseignementSuperieurIn = + Js.bool ressources_aides_personnelle_logement_in.condition_age_bourse_enseignement_superieur_in + val demandeurPoursuitDesEtudesIn = + Js.bool ressources_aides_personnelle_logement_in.demandeur_poursuit_des_etudes_in + val dateDemandeOuReexamenDroitIn = + date_to_jsoo ressources_aides_personnelle_logement_in.date_demande_ou_reexamen_droit_in + val paiementLogementDistinctProfessionnelIn = + paiement_logement_distinct_professionnel_to_jsoo ressources_aides_personnelle_logement_in.paiement_logement_distinct_professionnel_in + val ressourcesMenageArrondiesBaseIn = + Js.number_of_float @@ money_to_float ressources_aides_personnelle_logement_in.ressources_menage_arrondies_base_in + end + let ressources_aides_personnelle_logement_in_of_jsoo + (ressources_aides_personnelle_logement_in + : ressources_aides_personnelle_logement_in Js.t) : + RessourcesAidesPersonnelleLogementIn.t = + { + ressources_demandeur_in = + money_of_decimal @@ decimal_of_float @@ Js.float_of_number + ressources_aides_personnelle_logement_in##.ressourcesDemandeurIn; + ressources_conjoint_in = + money_of_decimal @@ decimal_of_float @@ Js.float_of_number + ressources_aides_personnelle_logement_in##.ressourcesConjointIn; + personnes_vivant_habituellement_foyer_in = + Array.map (fun x -> personne_vivant_habituellement_au_foyer_of_jsoo x) @@ Js.to_array + ressources_aides_personnelle_logement_in + ##.personnesVivantHabituellementFoyerIn; + demandeur_exerce_activite_remuneree_in = + Js.to_bool + ressources_aides_personnelle_logement_in + ##.demandeurExerceActiviteRemunereeIn; + conjoint_exerce_activite_remuneree_in = + Js.to_bool + ressources_aides_personnelle_logement_in + ##.conjointExerceActiviteRemunereeIn; + personnes_a_charge_in = + Array.map (fun x -> personne_a_charge_of_jsoo x) @@ Js.to_array + ressources_aides_personnelle_logement_in##.personnesAChargeIn; + situation_familiale_in = + situation_familiale_of_jsoo + ressources_aides_personnelle_logement_in##.situationFamilialeIn; + mode_occupation_in = + mode_occupation_of_jsoo + ressources_aides_personnelle_logement_in##.modeOccupationIn; + condition_age_bourse_enseignement_superieur_in = + Js.to_bool + ressources_aides_personnelle_logement_in + ##.conditionAgeBourseEnseignementSuperieurIn; + demandeur_poursuit_des_etudes_in = + Js.to_bool + ressources_aides_personnelle_logement_in + ##.demandeurPoursuitDesEtudesIn; + date_demande_ou_reexamen_droit_in = + date_of_jsoo + ressources_aides_personnelle_logement_in + ##.dateDemandeOuReexamenDroitIn; + paiement_logement_distinct_professionnel_in = + paiement_logement_distinct_professionnel_of_jsoo + ressources_aides_personnelle_logement_in + ##.paiementLogementDistinctProfessionnelIn; + ressources_menage_arrondies_base_in = + money_of_decimal @@ decimal_of_float @@ Js.float_of_number + ressources_aides_personnelle_logement_in + ##.ressourcesMenageArrondiesBaseIn + } + +class type contributions_sociales_aides_personnelle_logement_out = + object + method montantOut: + (Js.number Js.t, Js.number Js.t) Js.meth_callback Js.meth + end + let contributions_sociales_aides_personnelle_logement_out_to_jsoo + (contributions_sociales_aides_personnelle_logement_out + : ContributionsSocialesAidesPersonnelleLogementOut.t) + : contributions_sociales_aides_personnelle_logement_out Js.t = + object%js + method montantOut = Js.wrap_meth_callback + ( + fun input -> + Js.number_of_float @@ money_to_float (contributions_sociales_aides_personnelle_logement_out.montant_out (money_of_decimal @@ decimal_of_float @@ Js.float_of_number input))) + end + let contributions_sociales_aides_personnelle_logement_out_of_jsoo + (contributions_sociales_aides_personnelle_logement_out + : contributions_sociales_aides_personnelle_logement_out Js.t) : + ContributionsSocialesAidesPersonnelleLogementOut.t = + { + montant_out = failwith "The function 'montant_out' translation isn't yet supported..." + } + +class type contributions_sociales_aides_personnelle_logement_in = + object method dateCouranteIn: Js.js_string Js.t Js.readonly_prop + end + let contributions_sociales_aides_personnelle_logement_in_to_jsoo + (contributions_sociales_aides_personnelle_logement_in + : ContributionsSocialesAidesPersonnelleLogementIn.t) + : contributions_sociales_aides_personnelle_logement_in Js.t = + object%js + val dateCouranteIn = + date_to_jsoo contributions_sociales_aides_personnelle_logement_in.date_courante_in + end + let contributions_sociales_aides_personnelle_logement_in_of_jsoo + (contributions_sociales_aides_personnelle_logement_in + : contributions_sociales_aides_personnelle_logement_in Js.t) : + ContributionsSocialesAidesPersonnelleLogementIn.t = + { + date_courante_in = + date_of_jsoo + contributions_sociales_aides_personnelle_logement_in + ##.dateCouranteIn + } + +class type calcul_aide_personnalisee_logement_locatif_out = + object + method montantForfaitaireChargesD82316Out: + Js.number Js.t Js.readonly_prop + method plafondLoyerD823162Out: Js.number Js.t Js.readonly_prop + method participationMinimaleOut: Js.number Js.t Js.readonly_prop + method tauxCompositionFamilialeOut: Js.number Js.t Js.readonly_prop + method participationPersonnelleOut: Js.number Js.t Js.readonly_prop + method aideFinaleFormuleOut: Js.number Js.t Js.readonly_prop + method traitementAideFinaleMontantMinimalOut: + (Js.number Js.t, Js.number Js.t) Js.meth_callback Js.meth + end + let calcul_aide_personnalisee_logement_locatif_out_to_jsoo + (calcul_aide_personnalisee_logement_locatif_out + : CalculAidePersonnaliseeLogementLocatifOut.t) + : calcul_aide_personnalisee_logement_locatif_out Js.t = + object%js + val montantForfaitaireChargesD82316Out = + Js.number_of_float @@ money_to_float calcul_aide_personnalisee_logement_locatif_out.montant_forfaitaire_charges_d823_16_out + val plafondLoyerD823162Out = + Js.number_of_float @@ money_to_float calcul_aide_personnalisee_logement_locatif_out.plafond_loyer_d823_16_2_out + val participationMinimaleOut = + Js.number_of_float @@ money_to_float calcul_aide_personnalisee_logement_locatif_out.participation_minimale_out + val tauxCompositionFamilialeOut = + Js.number_of_float @@ decimal_to_float calcul_aide_personnalisee_logement_locatif_out.taux_composition_familiale_out + val participationPersonnelleOut = + Js.number_of_float @@ money_to_float calcul_aide_personnalisee_logement_locatif_out.participation_personnelle_out + val aideFinaleFormuleOut = + Js.number_of_float @@ money_to_float calcul_aide_personnalisee_logement_locatif_out.aide_finale_formule_out + method traitementAideFinaleMontantMinimalOut = Js.wrap_meth_callback + ( + fun input -> + Js.number_of_float @@ money_to_float (calcul_aide_personnalisee_logement_locatif_out.traitement_aide_finale_montant_minimal_out (money_of_decimal @@ decimal_of_float @@ Js.float_of_number input))) + end + let calcul_aide_personnalisee_logement_locatif_out_of_jsoo + (calcul_aide_personnalisee_logement_locatif_out + : calcul_aide_personnalisee_logement_locatif_out Js.t) : + CalculAidePersonnaliseeLogementLocatifOut.t = + { + montant_forfaitaire_charges_d823_16_out = + money_of_decimal @@ decimal_of_float @@ Js.float_of_number + calcul_aide_personnalisee_logement_locatif_out + ##.montantForfaitaireChargesD82316Out; + plafond_loyer_d823_16_2_out = + money_of_decimal @@ decimal_of_float @@ Js.float_of_number + calcul_aide_personnalisee_logement_locatif_out + ##.plafondLoyerD823162Out; + participation_minimale_out = + money_of_decimal @@ decimal_of_float @@ Js.float_of_number + calcul_aide_personnalisee_logement_locatif_out + ##.participationMinimaleOut; + taux_composition_familiale_out = + decimal_of_float @@ Js.float_of_number + calcul_aide_personnalisee_logement_locatif_out + ##.tauxCompositionFamilialeOut; + participation_personnelle_out = + money_of_decimal @@ decimal_of_float @@ Js.float_of_number + calcul_aide_personnalisee_logement_locatif_out + ##.participationPersonnelleOut; + aide_finale_formule_out = + money_of_decimal @@ decimal_of_float @@ Js.float_of_number + calcul_aide_personnalisee_logement_locatif_out + ##.aideFinaleFormuleOut; + traitement_aide_finale_montant_minimal_out = failwith "The function 'traitement_aide_finale_montant_minimal_out' translation isn't yet supported..." + } + +class type calcul_aide_personnalisee_logement_locatif_in = + object + method loyerPrincipalIn: Js.number Js.t Js.readonly_prop + method ressourcesMenageArrondiesIn: Js.number Js.t Js.readonly_prop + method beneficiaireAideAdulteOuEnfantHandicapesIn: + bool Js.t Js.readonly_prop + method dateCouranteIn: Js.js_string Js.t Js.readonly_prop + method nombrePersonnesAChargeIn: int Js.readonly_prop + method situationFamilialeCalculAplIn: + situation_familiale_calcul_a_p_l Js.t Js.readonly_prop + method zoneIn: zone_d_habitation Js.t Js.readonly_prop + method logementEstChambreIn: bool Js.t Js.readonly_prop + method ageesOuHandicapAdultesHebergeesOnereuxParticuliersIn: + bool Js.t Js.readonly_prop + method typeAideIn: type_aides_personnelle_logement Js.t Js.readonly_prop + method colocationIn: bool Js.t Js.readonly_prop + method reductionLoyerSolidariteIn: Js.number Js.t Js.readonly_prop + end + let calcul_aide_personnalisee_logement_locatif_in_to_jsoo + (calcul_aide_personnalisee_logement_locatif_in + : CalculAidePersonnaliseeLogementLocatifIn.t) + : calcul_aide_personnalisee_logement_locatif_in Js.t = + object%js + val loyerPrincipalIn = + Js.number_of_float @@ money_to_float calcul_aide_personnalisee_logement_locatif_in.loyer_principal_in + val ressourcesMenageArrondiesIn = + Js.number_of_float @@ money_to_float calcul_aide_personnalisee_logement_locatif_in.ressources_menage_arrondies_in + val beneficiaireAideAdulteOuEnfantHandicapesIn = + Js.bool calcul_aide_personnalisee_logement_locatif_in.beneficiaire_aide_adulte_ou_enfant_handicapes_in + val dateCouranteIn = + date_to_jsoo calcul_aide_personnalisee_logement_locatif_in.date_courante_in + val nombrePersonnesAChargeIn = + integer_to_int calcul_aide_personnalisee_logement_locatif_in.nombre_personnes_a_charge_in + val situationFamilialeCalculAplIn = + situation_familiale_calcul_a_p_l_to_jsoo calcul_aide_personnalisee_logement_locatif_in.situation_familiale_calcul_apl_in + val zoneIn = + zone_d_habitation_to_jsoo calcul_aide_personnalisee_logement_locatif_in.zone_in + val logementEstChambreIn = + Js.bool calcul_aide_personnalisee_logement_locatif_in.logement_est_chambre_in + val ageesOuHandicapAdultesHebergeesOnereuxParticuliersIn = + Js.bool calcul_aide_personnalisee_logement_locatif_in.agees_ou_handicap_adultes_hebergees_onereux_particuliers_in + val typeAideIn = + type_aides_personnelle_logement_to_jsoo calcul_aide_personnalisee_logement_locatif_in.type_aide_in + val colocationIn = + Js.bool calcul_aide_personnalisee_logement_locatif_in.colocation_in + val reductionLoyerSolidariteIn = + Js.number_of_float @@ money_to_float calcul_aide_personnalisee_logement_locatif_in.reduction_loyer_solidarite_in + end + let calcul_aide_personnalisee_logement_locatif_in_of_jsoo + (calcul_aide_personnalisee_logement_locatif_in + : calcul_aide_personnalisee_logement_locatif_in Js.t) : + CalculAidePersonnaliseeLogementLocatifIn.t = + { + loyer_principal_in = + money_of_decimal @@ decimal_of_float @@ Js.float_of_number + calcul_aide_personnalisee_logement_locatif_in##.loyerPrincipalIn; + ressources_menage_arrondies_in = + money_of_decimal @@ decimal_of_float @@ Js.float_of_number + calcul_aide_personnalisee_logement_locatif_in + ##.ressourcesMenageArrondiesIn; + beneficiaire_aide_adulte_ou_enfant_handicapes_in = + Js.to_bool + calcul_aide_personnalisee_logement_locatif_in + ##.beneficiaireAideAdulteOuEnfantHandicapesIn; + date_courante_in = + date_of_jsoo + calcul_aide_personnalisee_logement_locatif_in##.dateCouranteIn; + nombre_personnes_a_charge_in = + integer_of_int + calcul_aide_personnalisee_logement_locatif_in + ##.nombrePersonnesAChargeIn; + situation_familiale_calcul_apl_in = + situation_familiale_calcul_a_p_l_of_jsoo + calcul_aide_personnalisee_logement_locatif_in + ##.situationFamilialeCalculAplIn; + zone_in = + zone_d_habitation_of_jsoo + calcul_aide_personnalisee_logement_locatif_in##.zoneIn; + logement_est_chambre_in = + Js.to_bool + calcul_aide_personnalisee_logement_locatif_in + ##.logementEstChambreIn; + agees_ou_handicap_adultes_hebergees_onereux_particuliers_in = + Js.to_bool + calcul_aide_personnalisee_logement_locatif_in + ##.ageesOuHandicapAdultesHebergeesOnereuxParticuliersIn; + type_aide_in = + type_aides_personnelle_logement_of_jsoo + calcul_aide_personnalisee_logement_locatif_in##.typeAideIn; + colocation_in = + Js.to_bool + calcul_aide_personnalisee_logement_locatif_in##.colocationIn; + reduction_loyer_solidarite_in = + money_of_decimal @@ decimal_of_float @@ Js.float_of_number + calcul_aide_personnalisee_logement_locatif_in + ##.reductionLoyerSolidariteIn + } + +class type calcul_equivalence_loyer_minimale_out = + object method montantOut: Js.number Js.t Js.readonly_prop + end + let calcul_equivalence_loyer_minimale_out_to_jsoo + (calcul_equivalence_loyer_minimale_out + : CalculEquivalenceLoyerMinimaleOut.t) + : calcul_equivalence_loyer_minimale_out Js.t = + object%js + val montantOut = + Js.number_of_float @@ money_to_float calcul_equivalence_loyer_minimale_out.montant_out + end + let calcul_equivalence_loyer_minimale_out_of_jsoo + (calcul_equivalence_loyer_minimale_out + : calcul_equivalence_loyer_minimale_out Js.t) : + CalculEquivalenceLoyerMinimaleOut.t = + { + montant_out = + money_of_decimal @@ decimal_of_float @@ Js.float_of_number + calcul_equivalence_loyer_minimale_out##.montantOut + } + +class type calcul_equivalence_loyer_minimale_in = + object + method ressourcesMenageArrondiesIn: Js.number Js.t Js.readonly_prop + method condition2Du83225In: bool Js.t Js.readonly_prop + method nNombrePartsD83225In: Js.number Js.t Js.readonly_prop + end + let calcul_equivalence_loyer_minimale_in_to_jsoo + (calcul_equivalence_loyer_minimale_in + : CalculEquivalenceLoyerMinimaleIn.t) + : calcul_equivalence_loyer_minimale_in Js.t = + object%js + val ressourcesMenageArrondiesIn = + Js.number_of_float @@ money_to_float calcul_equivalence_loyer_minimale_in.ressources_menage_arrondies_in + val condition2Du83225In = + Js.bool calcul_equivalence_loyer_minimale_in.condition_2_du_832_25_in + val nNombrePartsD83225In = + Js.number_of_float @@ decimal_to_float calcul_equivalence_loyer_minimale_in.n_nombre_parts_d832_25_in + end + let calcul_equivalence_loyer_minimale_in_of_jsoo + (calcul_equivalence_loyer_minimale_in + : calcul_equivalence_loyer_minimale_in Js.t) : + CalculEquivalenceLoyerMinimaleIn.t = + { + ressources_menage_arrondies_in = + money_of_decimal @@ decimal_of_float @@ Js.float_of_number + calcul_equivalence_loyer_minimale_in##.ressourcesMenageArrondiesIn; + condition_2_du_832_25_in = + Js.to_bool calcul_equivalence_loyer_minimale_in##.condition2Du83225In; + n_nombre_parts_d832_25_in = + decimal_of_float @@ Js.float_of_number + calcul_equivalence_loyer_minimale_in##.nNombrePartsD83225In + } + +class type calcul_nombre_part_logement_foyer_out = + object method nNombrePartsD83225Out: Js.number Js.t Js.readonly_prop + end + let calcul_nombre_part_logement_foyer_out_to_jsoo + (calcul_nombre_part_logement_foyer_out + : CalculNombrePartLogementFoyerOut.t) + : calcul_nombre_part_logement_foyer_out Js.t = + object%js + val nNombrePartsD83225Out = + Js.number_of_float @@ decimal_to_float calcul_nombre_part_logement_foyer_out.n_nombre_parts_d832_25_out + end + let calcul_nombre_part_logement_foyer_out_of_jsoo + (calcul_nombre_part_logement_foyer_out + : calcul_nombre_part_logement_foyer_out Js.t) : + CalculNombrePartLogementFoyerOut.t = + { + n_nombre_parts_d832_25_out = + decimal_of_float @@ Js.float_of_number + calcul_nombre_part_logement_foyer_out##.nNombrePartsD83225Out + } + +class type calcul_nombre_part_logement_foyer_in = + object + method condition2Du83225In: bool Js.t Js.readonly_prop + method nombrePersonnesAChargeIn: int Js.readonly_prop + method situationFamilialeCalculAplIn: + situation_familiale_calcul_a_p_l Js.t Js.readonly_prop + end + let calcul_nombre_part_logement_foyer_in_to_jsoo + (calcul_nombre_part_logement_foyer_in + : CalculNombrePartLogementFoyerIn.t) + : calcul_nombre_part_logement_foyer_in Js.t = + object%js + val condition2Du83225In = + Js.bool calcul_nombre_part_logement_foyer_in.condition_2_du_832_25_in + val nombrePersonnesAChargeIn = + integer_to_int calcul_nombre_part_logement_foyer_in.nombre_personnes_a_charge_in + val situationFamilialeCalculAplIn = + situation_familiale_calcul_a_p_l_to_jsoo calcul_nombre_part_logement_foyer_in.situation_familiale_calcul_apl_in + end + let calcul_nombre_part_logement_foyer_in_of_jsoo + (calcul_nombre_part_logement_foyer_in + : calcul_nombre_part_logement_foyer_in Js.t) : + CalculNombrePartLogementFoyerIn.t = + { + condition_2_du_832_25_in = + Js.to_bool calcul_nombre_part_logement_foyer_in##.condition2Du83225In; + nombre_personnes_a_charge_in = + integer_of_int + calcul_nombre_part_logement_foyer_in##.nombrePersonnesAChargeIn; + situation_familiale_calcul_apl_in = + situation_familiale_calcul_a_p_l_of_jsoo + calcul_nombre_part_logement_foyer_in + ##.situationFamilialeCalculAplIn + } + +class type calcul_aide_personnalisee_logement_foyer_out = + object + method coefficientMultiplicateurD83225Out: + Js.number Js.t Js.readonly_prop + method coefficientRD83225Out: Js.number Js.t Js.readonly_prop + method nNombrePartsD83225Out: Js.number Js.t Js.readonly_prop + method equivalenceLoyerEligibleOut: Js.number Js.t Js.readonly_prop + method plafondEquivalenceLoyerEligibleOut: + Js.number Js.t Js.readonly_prop + method equivalenceLoyerMinimaleOut: Js.number Js.t Js.readonly_prop + method coefficientPriseEnChargeD83225SeuilOut: + Js.number Js.t Js.readonly_prop + method aideFinaleFormuleOut: Js.number Js.t Js.readonly_prop + method traitementAideFinaleMontantMinimalOut: + (Js.number Js.t, Js.number Js.t) Js.meth_callback Js.meth + end + let calcul_aide_personnalisee_logement_foyer_out_to_jsoo + (calcul_aide_personnalisee_logement_foyer_out + : CalculAidePersonnaliseeLogementFoyerOut.t) + : calcul_aide_personnalisee_logement_foyer_out Js.t = + object%js + val coefficientMultiplicateurD83225Out = + Js.number_of_float @@ money_to_float calcul_aide_personnalisee_logement_foyer_out.coefficient_multiplicateur_d832_25_out + val coefficientRD83225Out = + Js.number_of_float @@ money_to_float calcul_aide_personnalisee_logement_foyer_out.coefficient_r_d832_25_out + val nNombrePartsD83225Out = + Js.number_of_float @@ decimal_to_float calcul_aide_personnalisee_logement_foyer_out.n_nombre_parts_d832_25_out + val equivalenceLoyerEligibleOut = + Js.number_of_float @@ money_to_float calcul_aide_personnalisee_logement_foyer_out.equivalence_loyer_eligible_out + val plafondEquivalenceLoyerEligibleOut = + Js.number_of_float @@ money_to_float calcul_aide_personnalisee_logement_foyer_out.plafond_equivalence_loyer_eligible_out + val equivalenceLoyerMinimaleOut = + Js.number_of_float @@ money_to_float calcul_aide_personnalisee_logement_foyer_out.equivalence_loyer_minimale_out + val coefficientPriseEnChargeD83225SeuilOut = + Js.number_of_float @@ decimal_to_float calcul_aide_personnalisee_logement_foyer_out.coefficient_prise_en_charge_d832_25_seuil_out + val aideFinaleFormuleOut = + Js.number_of_float @@ money_to_float calcul_aide_personnalisee_logement_foyer_out.aide_finale_formule_out + method traitementAideFinaleMontantMinimalOut = Js.wrap_meth_callback + ( + fun input -> + Js.number_of_float @@ money_to_float (calcul_aide_personnalisee_logement_foyer_out.traitement_aide_finale_montant_minimal_out (money_of_decimal @@ decimal_of_float @@ Js.float_of_number input))) + end + let calcul_aide_personnalisee_logement_foyer_out_of_jsoo + (calcul_aide_personnalisee_logement_foyer_out + : calcul_aide_personnalisee_logement_foyer_out Js.t) : + CalculAidePersonnaliseeLogementFoyerOut.t = + { + coefficient_multiplicateur_d832_25_out = + money_of_decimal @@ decimal_of_float @@ Js.float_of_number + calcul_aide_personnalisee_logement_foyer_out + ##.coefficientMultiplicateurD83225Out; + coefficient_r_d832_25_out = + money_of_decimal @@ decimal_of_float @@ Js.float_of_number + calcul_aide_personnalisee_logement_foyer_out + ##.coefficientRD83225Out; + n_nombre_parts_d832_25_out = + decimal_of_float @@ Js.float_of_number + calcul_aide_personnalisee_logement_foyer_out + ##.nNombrePartsD83225Out; + equivalence_loyer_eligible_out = + money_of_decimal @@ decimal_of_float @@ Js.float_of_number + calcul_aide_personnalisee_logement_foyer_out + ##.equivalenceLoyerEligibleOut; + plafond_equivalence_loyer_eligible_out = + money_of_decimal @@ decimal_of_float @@ Js.float_of_number + calcul_aide_personnalisee_logement_foyer_out + ##.plafondEquivalenceLoyerEligibleOut; + equivalence_loyer_minimale_out = + money_of_decimal @@ decimal_of_float @@ Js.float_of_number + calcul_aide_personnalisee_logement_foyer_out + ##.equivalenceLoyerMinimaleOut; + coefficient_prise_en_charge_d832_25_seuil_out = + decimal_of_float @@ Js.float_of_number + calcul_aide_personnalisee_logement_foyer_out + ##.coefficientPriseEnChargeD83225SeuilOut; + aide_finale_formule_out = + money_of_decimal @@ decimal_of_float @@ Js.float_of_number + calcul_aide_personnalisee_logement_foyer_out##.aideFinaleFormuleOut; + traitement_aide_finale_montant_minimal_out = failwith "The function 'traitement_aide_finale_montant_minimal_out' translation isn't yet supported..." + } + +class type calcul_aide_personnalisee_logement_foyer_in = + object + method modeOccupationIn: mode_occupation Js.t Js.readonly_prop + method ressourcesMenageArrondiesIn: Js.number Js.t Js.readonly_prop + method nombrePersonnesAChargeIn: int Js.readonly_prop + method situationFamilialeCalculAplIn: + situation_familiale_calcul_a_p_l Js.t Js.readonly_prop + method zoneIn: zone_d_habitation Js.t Js.readonly_prop + method dateCouranteIn: Js.js_string Js.t Js.readonly_prop + method redevanceIn: Js.number Js.t Js.readonly_prop + method condition2Du83225In: (unit, bool Js.t) Js.meth_callback Js.meth + method nNombrePartsD83225In: + (unit, Js.number Js.t) Js.meth_callback Js.meth + end + let calcul_aide_personnalisee_logement_foyer_in_to_jsoo + (calcul_aide_personnalisee_logement_foyer_in + : CalculAidePersonnaliseeLogementFoyerIn.t) + : calcul_aide_personnalisee_logement_foyer_in Js.t = + object%js + val modeOccupationIn = + mode_occupation_to_jsoo calcul_aide_personnalisee_logement_foyer_in.mode_occupation_in + val ressourcesMenageArrondiesIn = + Js.number_of_float @@ money_to_float calcul_aide_personnalisee_logement_foyer_in.ressources_menage_arrondies_in + val nombrePersonnesAChargeIn = + integer_to_int calcul_aide_personnalisee_logement_foyer_in.nombre_personnes_a_charge_in + val situationFamilialeCalculAplIn = + situation_familiale_calcul_a_p_l_to_jsoo calcul_aide_personnalisee_logement_foyer_in.situation_familiale_calcul_apl_in + val zoneIn = + zone_d_habitation_to_jsoo calcul_aide_personnalisee_logement_foyer_in.zone_in + val dateCouranteIn = + date_to_jsoo calcul_aide_personnalisee_logement_foyer_in.date_courante_in + val redevanceIn = + Js.number_of_float @@ money_to_float calcul_aide_personnalisee_logement_foyer_in.redevance_in + method condition2Du83225In = Js.wrap_meth_callback + ( + fun input -> + Js.bool (calcul_aide_personnalisee_logement_foyer_in.condition_2_du_832_25_in ( input))) + method nNombrePartsD83225In = Js.wrap_meth_callback + ( + fun input -> + Js.number_of_float @@ decimal_to_float (calcul_aide_personnalisee_logement_foyer_in.n_nombre_parts_d832_25_in ( input))) + end + let calcul_aide_personnalisee_logement_foyer_in_of_jsoo + (calcul_aide_personnalisee_logement_foyer_in + : calcul_aide_personnalisee_logement_foyer_in Js.t) : + CalculAidePersonnaliseeLogementFoyerIn.t = + { + mode_occupation_in = + mode_occupation_of_jsoo + calcul_aide_personnalisee_logement_foyer_in##.modeOccupationIn; + ressources_menage_arrondies_in = + money_of_decimal @@ decimal_of_float @@ Js.float_of_number + calcul_aide_personnalisee_logement_foyer_in + ##.ressourcesMenageArrondiesIn; + nombre_personnes_a_charge_in = + integer_of_int + calcul_aide_personnalisee_logement_foyer_in + ##.nombrePersonnesAChargeIn; + situation_familiale_calcul_apl_in = + situation_familiale_calcul_a_p_l_of_jsoo + calcul_aide_personnalisee_logement_foyer_in + ##.situationFamilialeCalculAplIn; + zone_in = + zone_d_habitation_of_jsoo + calcul_aide_personnalisee_logement_foyer_in##.zoneIn; + date_courante_in = + date_of_jsoo + calcul_aide_personnalisee_logement_foyer_in##.dateCouranteIn; + redevance_in = + money_of_decimal @@ decimal_of_float @@ Js.float_of_number + calcul_aide_personnalisee_logement_foyer_in##.redevanceIn; + condition_2_du_832_25_in = failwith "The function 'condition_2_du_832_25_in' translation isn't yet supported..."; + n_nombre_parts_d832_25_in = failwith "The function 'n_nombre_parts_d832_25_in' translation isn't yet supported..." + } + +class type calcul_nombre_parts_accession_propriete_out = + object method nNombrePartsD83211Out: Js.number Js.t Js.readonly_prop + end + let calcul_nombre_parts_accession_propriete_out_to_jsoo + (calcul_nombre_parts_accession_propriete_out + : CalculNombrePartsAccessionProprieteOut.t) + : calcul_nombre_parts_accession_propriete_out Js.t = + object%js + val nNombrePartsD83211Out = + Js.number_of_float @@ decimal_to_float calcul_nombre_parts_accession_propriete_out.n_nombre_parts_d832_11_out + end + let calcul_nombre_parts_accession_propriete_out_of_jsoo + (calcul_nombre_parts_accession_propriete_out + : calcul_nombre_parts_accession_propriete_out Js.t) : + CalculNombrePartsAccessionProprieteOut.t = + { + n_nombre_parts_d832_11_out = + decimal_of_float @@ Js.float_of_number + calcul_nombre_parts_accession_propriete_out##.nNombrePartsD83211Out + } + +class type calcul_nombre_parts_accession_propriete_in = + object + method nombrePersonnesAChargeIn: int Js.readonly_prop + method situationFamilialeCalculAplIn: + situation_familiale_calcul_a_p_l Js.t Js.readonly_prop + end + let calcul_nombre_parts_accession_propriete_in_to_jsoo + (calcul_nombre_parts_accession_propriete_in + : CalculNombrePartsAccessionProprieteIn.t) + : calcul_nombre_parts_accession_propriete_in Js.t = + object%js + val nombrePersonnesAChargeIn = + integer_to_int calcul_nombre_parts_accession_propriete_in.nombre_personnes_a_charge_in + val situationFamilialeCalculAplIn = + situation_familiale_calcul_a_p_l_to_jsoo calcul_nombre_parts_accession_propriete_in.situation_familiale_calcul_apl_in + end + let calcul_nombre_parts_accession_propriete_in_of_jsoo + (calcul_nombre_parts_accession_propriete_in + : calcul_nombre_parts_accession_propriete_in Js.t) : + CalculNombrePartsAccessionProprieteIn.t = + { + nombre_personnes_a_charge_in = + integer_of_int + calcul_nombre_parts_accession_propriete_in + ##.nombrePersonnesAChargeIn; + situation_familiale_calcul_apl_in = + situation_familiale_calcul_a_p_l_of_jsoo + calcul_nombre_parts_accession_propriete_in + ##.situationFamilialeCalculAplIn + } + +class type calcul_aide_personnalisee_logement_accession_propriete_out = + object + method mensualiteEligibleOut: Js.number Js.t Js.readonly_prop + method mensualiteMinimaleOut: Js.number Js.t Js.readonly_prop + method coefficientPriseEnChargeD83210SeuilOut: + Js.number Js.t Js.readonly_prop + method aideFinaleFormuleOut: Js.number Js.t Js.readonly_prop + method traitementAideFinaleMontantMinimalOut: + (Js.number Js.t, Js.number Js.t) Js.meth_callback Js.meth + end + let calcul_aide_personnalisee_logement_accession_propriete_out_to_jsoo + (calcul_aide_personnalisee_logement_accession_propriete_out + : CalculAidePersonnaliseeLogementAccessionProprieteOut.t) + : calcul_aide_personnalisee_logement_accession_propriete_out Js.t = + object%js + val mensualiteEligibleOut = + Js.number_of_float @@ money_to_float calcul_aide_personnalisee_logement_accession_propriete_out.mensualite_eligible_out + val mensualiteMinimaleOut = + Js.number_of_float @@ money_to_float calcul_aide_personnalisee_logement_accession_propriete_out.mensualite_minimale_out + val coefficientPriseEnChargeD83210SeuilOut = + Js.number_of_float @@ decimal_to_float calcul_aide_personnalisee_logement_accession_propriete_out.coefficient_prise_en_charge_d832_10_seuil_out + val aideFinaleFormuleOut = + Js.number_of_float @@ money_to_float calcul_aide_personnalisee_logement_accession_propriete_out.aide_finale_formule_out + method traitementAideFinaleMontantMinimalOut = Js.wrap_meth_callback + ( + fun input -> + Js.number_of_float @@ money_to_float (calcul_aide_personnalisee_logement_accession_propriete_out.traitement_aide_finale_montant_minimal_out (money_of_decimal @@ decimal_of_float @@ Js.float_of_number input))) + end + let calcul_aide_personnalisee_logement_accession_propriete_out_of_jsoo + (calcul_aide_personnalisee_logement_accession_propriete_out + : calcul_aide_personnalisee_logement_accession_propriete_out Js.t) : + CalculAidePersonnaliseeLogementAccessionProprieteOut.t = + { + mensualite_eligible_out = + money_of_decimal @@ decimal_of_float @@ Js.float_of_number + calcul_aide_personnalisee_logement_accession_propriete_out + ##.mensualiteEligibleOut; + mensualite_minimale_out = + money_of_decimal @@ decimal_of_float @@ Js.float_of_number + calcul_aide_personnalisee_logement_accession_propriete_out + ##.mensualiteMinimaleOut; + coefficient_prise_en_charge_d832_10_seuil_out = + decimal_of_float @@ Js.float_of_number + calcul_aide_personnalisee_logement_accession_propriete_out + ##.coefficientPriseEnChargeD83210SeuilOut; + aide_finale_formule_out = + money_of_decimal @@ decimal_of_float @@ Js.float_of_number + calcul_aide_personnalisee_logement_accession_propriete_out + ##.aideFinaleFormuleOut; + traitement_aide_finale_montant_minimal_out = failwith "The function 'traitement_aide_finale_montant_minimal_out' translation isn't yet supported..." + } + +class type calcul_aide_personnalisee_logement_accession_propriete_in = + object + method mensualitePrincipaleIn: Js.number Js.t Js.readonly_prop + method ressourcesMenageArrondiesIn: Js.number Js.t Js.readonly_prop + method nombrePersonnesAChargeIn: int Js.readonly_prop + method situationFamilialeCalculAplIn: + situation_familiale_calcul_a_p_l Js.t Js.readonly_prop + method typeTravauxLogementIn: + type_travaux_logement_d832_15 Js.t Js.readonly_prop + method dateSignaturePretIn: Js.js_string Js.t Js.readonly_prop + method localHabitePremiereFoisBeneficiaireIn: bool Js.t Js.readonly_prop + method dateEntreeLogementIn: Js.js_string Js.t Js.readonly_prop + method coproprieteIn: bool Js.t Js.readonly_prop + method situationR822111317In: bool Js.t Js.readonly_prop + method zoneIn: zone_d_habitation Js.t Js.readonly_prop + method typePretIn: type_pret Js.t Js.readonly_prop + method ancienneteLogementIn: neuf_ou_ancien Js.t Js.readonly_prop + method dateCouranteIn: Js.js_string Js.t Js.readonly_prop + end + let calcul_aide_personnalisee_logement_accession_propriete_in_to_jsoo + (calcul_aide_personnalisee_logement_accession_propriete_in + : CalculAidePersonnaliseeLogementAccessionProprieteIn.t) + : calcul_aide_personnalisee_logement_accession_propriete_in Js.t = + object%js + val mensualitePrincipaleIn = + Js.number_of_float @@ money_to_float calcul_aide_personnalisee_logement_accession_propriete_in.mensualite_principale_in + val ressourcesMenageArrondiesIn = + Js.number_of_float @@ money_to_float calcul_aide_personnalisee_logement_accession_propriete_in.ressources_menage_arrondies_in + val nombrePersonnesAChargeIn = + integer_to_int calcul_aide_personnalisee_logement_accession_propriete_in.nombre_personnes_a_charge_in + val situationFamilialeCalculAplIn = + situation_familiale_calcul_a_p_l_to_jsoo calcul_aide_personnalisee_logement_accession_propriete_in.situation_familiale_calcul_apl_in + val typeTravauxLogementIn = + type_travaux_logement_d832_15_to_jsoo calcul_aide_personnalisee_logement_accession_propriete_in.type_travaux_logement_in + val dateSignaturePretIn = + date_to_jsoo calcul_aide_personnalisee_logement_accession_propriete_in.date_signature_pret_in + val localHabitePremiereFoisBeneficiaireIn = + Js.bool calcul_aide_personnalisee_logement_accession_propriete_in.local_habite_premiere_fois_beneficiaire_in + val dateEntreeLogementIn = + date_to_jsoo calcul_aide_personnalisee_logement_accession_propriete_in.date_entree_logement_in + val coproprieteIn = + Js.bool calcul_aide_personnalisee_logement_accession_propriete_in.copropriete_in + val situationR822111317In = + Js.bool calcul_aide_personnalisee_logement_accession_propriete_in.situation_r822_11_13_17_in + val zoneIn = + zone_d_habitation_to_jsoo calcul_aide_personnalisee_logement_accession_propriete_in.zone_in + val typePretIn = + type_pret_to_jsoo calcul_aide_personnalisee_logement_accession_propriete_in.type_pret_in + val ancienneteLogementIn = + neuf_ou_ancien_to_jsoo calcul_aide_personnalisee_logement_accession_propriete_in.anciennete_logement_in + val dateCouranteIn = + date_to_jsoo calcul_aide_personnalisee_logement_accession_propriete_in.date_courante_in + end + let calcul_aide_personnalisee_logement_accession_propriete_in_of_jsoo + (calcul_aide_personnalisee_logement_accession_propriete_in + : calcul_aide_personnalisee_logement_accession_propriete_in Js.t) : + CalculAidePersonnaliseeLogementAccessionProprieteIn.t = + { + mensualite_principale_in = + money_of_decimal @@ decimal_of_float @@ Js.float_of_number + calcul_aide_personnalisee_logement_accession_propriete_in + ##.mensualitePrincipaleIn; + ressources_menage_arrondies_in = + money_of_decimal @@ decimal_of_float @@ Js.float_of_number + calcul_aide_personnalisee_logement_accession_propriete_in + ##.ressourcesMenageArrondiesIn; + nombre_personnes_a_charge_in = + integer_of_int + calcul_aide_personnalisee_logement_accession_propriete_in + ##.nombrePersonnesAChargeIn; + situation_familiale_calcul_apl_in = + situation_familiale_calcul_a_p_l_of_jsoo + calcul_aide_personnalisee_logement_accession_propriete_in + ##.situationFamilialeCalculAplIn; + type_travaux_logement_in = + type_travaux_logement_d832_15_of_jsoo + calcul_aide_personnalisee_logement_accession_propriete_in + ##.typeTravauxLogementIn; + date_signature_pret_in = + date_of_jsoo + calcul_aide_personnalisee_logement_accession_propriete_in + ##.dateSignaturePretIn; + local_habite_premiere_fois_beneficiaire_in = + Js.to_bool + calcul_aide_personnalisee_logement_accession_propriete_in + ##.localHabitePremiereFoisBeneficiaireIn; + date_entree_logement_in = + date_of_jsoo + calcul_aide_personnalisee_logement_accession_propriete_in + ##.dateEntreeLogementIn; + copropriete_in = + Js.to_bool + calcul_aide_personnalisee_logement_accession_propriete_in + ##.coproprieteIn; + situation_r822_11_13_17_in = + Js.to_bool + calcul_aide_personnalisee_logement_accession_propriete_in + ##.situationR822111317In; + zone_in = + zone_d_habitation_of_jsoo + calcul_aide_personnalisee_logement_accession_propriete_in##.zoneIn; + type_pret_in = + type_pret_of_jsoo + calcul_aide_personnalisee_logement_accession_propriete_in + ##.typePretIn; + anciennete_logement_in = + neuf_ou_ancien_of_jsoo + calcul_aide_personnalisee_logement_accession_propriete_in + ##.ancienneteLogementIn; + date_courante_in = + date_of_jsoo + calcul_aide_personnalisee_logement_accession_propriete_in + ##.dateCouranteIn + } + +class type calcul_aide_personnalisee_logement_out = + object + method aideFinaleFormuleOut: Js.number Js.t Js.readonly_prop + method traitementAideFinaleOut: + (Js.number Js.t, Js.number Js.t) Js.meth_callback Js.meth + end + let calcul_aide_personnalisee_logement_out_to_jsoo + (calcul_aide_personnalisee_logement_out + : CalculAidePersonnaliseeLogementOut.t) + : calcul_aide_personnalisee_logement_out Js.t = + object%js + val aideFinaleFormuleOut = + Js.number_of_float @@ money_to_float calcul_aide_personnalisee_logement_out.aide_finale_formule_out + method traitementAideFinaleOut = Js.wrap_meth_callback + ( + fun input -> + Js.number_of_float @@ money_to_float (calcul_aide_personnalisee_logement_out.traitement_aide_finale_out (money_of_decimal @@ decimal_of_float @@ Js.float_of_number input))) + end + let calcul_aide_personnalisee_logement_out_of_jsoo + (calcul_aide_personnalisee_logement_out + : calcul_aide_personnalisee_logement_out Js.t) : + CalculAidePersonnaliseeLogementOut.t = + { + aide_finale_formule_out = + money_of_decimal @@ decimal_of_float @@ Js.float_of_number + calcul_aide_personnalisee_logement_out##.aideFinaleFormuleOut; + traitement_aide_finale_out = failwith "The function 'traitement_aide_finale_out' translation isn't yet supported..." + } + +class type calcul_aide_personnalisee_logement_in = + object + method modeOccupationIn: mode_occupation Js.t Js.readonly_prop + method typeAideIn: type_aides_personnelle_logement Js.t Js.readonly_prop + method informationsCalculIn: + informations_calcul_a_p_l Js.t Js.readonly_prop + method ressourcesMenageSansArrondiIn: Js.number Js.t Js.readonly_prop + method situationFamilialeIn: situation_familiale Js.t Js.readonly_prop + method nombrePersonnesAChargeIn: int Js.readonly_prop + method zoneIn: zone_d_habitation Js.t Js.readonly_prop + method dateCouranteIn: Js.js_string Js.t Js.readonly_prop + end + let calcul_aide_personnalisee_logement_in_to_jsoo + (calcul_aide_personnalisee_logement_in + : CalculAidePersonnaliseeLogementIn.t) + : calcul_aide_personnalisee_logement_in Js.t = + object%js + val modeOccupationIn = + mode_occupation_to_jsoo calcul_aide_personnalisee_logement_in.mode_occupation_in + val typeAideIn = + type_aides_personnelle_logement_to_jsoo calcul_aide_personnalisee_logement_in.type_aide_in + val informationsCalculIn = + informations_calcul_a_p_l_to_jsoo calcul_aide_personnalisee_logement_in.informations_calcul_in + val ressourcesMenageSansArrondiIn = + Js.number_of_float @@ money_to_float calcul_aide_personnalisee_logement_in.ressources_menage_sans_arrondi_in + val situationFamilialeIn = + situation_familiale_to_jsoo calcul_aide_personnalisee_logement_in.situation_familiale_in + val nombrePersonnesAChargeIn = + integer_to_int calcul_aide_personnalisee_logement_in.nombre_personnes_a_charge_in + val zoneIn = + zone_d_habitation_to_jsoo calcul_aide_personnalisee_logement_in.zone_in + val dateCouranteIn = + date_to_jsoo calcul_aide_personnalisee_logement_in.date_courante_in + end + let calcul_aide_personnalisee_logement_in_of_jsoo + (calcul_aide_personnalisee_logement_in + : calcul_aide_personnalisee_logement_in Js.t) : + CalculAidePersonnaliseeLogementIn.t = + { + mode_occupation_in = + mode_occupation_of_jsoo + calcul_aide_personnalisee_logement_in##.modeOccupationIn; + type_aide_in = + type_aides_personnelle_logement_of_jsoo + calcul_aide_personnalisee_logement_in##.typeAideIn; + informations_calcul_in = + informations_calcul_a_p_l_of_jsoo + calcul_aide_personnalisee_logement_in##.informationsCalculIn; + ressources_menage_sans_arrondi_in = + money_of_decimal @@ decimal_of_float @@ Js.float_of_number + calcul_aide_personnalisee_logement_in + ##.ressourcesMenageSansArrondiIn; + situation_familiale_in = + situation_familiale_of_jsoo + calcul_aide_personnalisee_logement_in##.situationFamilialeIn; + nombre_personnes_a_charge_in = + integer_of_int + calcul_aide_personnalisee_logement_in##.nombrePersonnesAChargeIn; + zone_in = + zone_d_habitation_of_jsoo + calcul_aide_personnalisee_logement_in##.zoneIn; + date_courante_in = + date_of_jsoo calcul_aide_personnalisee_logement_in##.dateCouranteIn + } + +class type calcul_allocation_logement_locatif_out = + object + method aideFinaleFormuleOut: Js.number Js.t Js.readonly_prop + method traitementAideFinaleOut: + (Js.number Js.t, Js.number Js.t) Js.meth_callback Js.meth + end + let calcul_allocation_logement_locatif_out_to_jsoo + (calcul_allocation_logement_locatif_out + : CalculAllocationLogementLocatifOut.t) + : calcul_allocation_logement_locatif_out Js.t = + object%js + val aideFinaleFormuleOut = + Js.number_of_float @@ money_to_float calcul_allocation_logement_locatif_out.aide_finale_formule_out + method traitementAideFinaleOut = Js.wrap_meth_callback + ( + fun input -> + Js.number_of_float @@ money_to_float (calcul_allocation_logement_locatif_out.traitement_aide_finale_out (money_of_decimal @@ decimal_of_float @@ Js.float_of_number input))) + end + let calcul_allocation_logement_locatif_out_of_jsoo + (calcul_allocation_logement_locatif_out + : calcul_allocation_logement_locatif_out Js.t) : + CalculAllocationLogementLocatifOut.t = + { + aide_finale_formule_out = + money_of_decimal @@ decimal_of_float @@ Js.float_of_number + calcul_allocation_logement_locatif_out##.aideFinaleFormuleOut; + traitement_aide_finale_out = failwith "The function 'traitement_aide_finale_out' translation isn't yet supported..." + } + +class type calcul_allocation_logement_locatif_in = + object + method loyerPrincipalIn: Js.number Js.t Js.readonly_prop + method ressourcesMenageArrondiesIn: Js.number Js.t Js.readonly_prop + method beneficiaireAideAdulteOuEnfantHandicapesIn: + bool Js.t Js.readonly_prop + method dateCouranteIn: Js.js_string Js.t Js.readonly_prop + method nombrePersonnesAChargeIn: int Js.readonly_prop + method situationFamilialeCalculAplIn: + situation_familiale_calcul_a_p_l Js.t Js.readonly_prop + method zoneIn: zone_d_habitation Js.t Js.readonly_prop + method logementEstChambreIn: bool Js.t Js.readonly_prop + method ageesOuHandicapAdultesHebergeesOnereuxParticuliersIn: + bool Js.t Js.readonly_prop + method typeAideIn: type_aides_personnelle_logement Js.t Js.readonly_prop + method colocationIn: bool Js.t Js.readonly_prop + method reductionLoyerSolidariteIn: Js.number Js.t Js.readonly_prop + method logementMeubleD8422In: bool Js.t Js.readonly_prop + method changementLogementD8424In: + changement_logement_d842_4 Js.t Js.readonly_prop + end + let calcul_allocation_logement_locatif_in_to_jsoo + (calcul_allocation_logement_locatif_in + : CalculAllocationLogementLocatifIn.t) + : calcul_allocation_logement_locatif_in Js.t = + object%js + val loyerPrincipalIn = + Js.number_of_float @@ money_to_float calcul_allocation_logement_locatif_in.loyer_principal_in + val ressourcesMenageArrondiesIn = + Js.number_of_float @@ money_to_float calcul_allocation_logement_locatif_in.ressources_menage_arrondies_in + val beneficiaireAideAdulteOuEnfantHandicapesIn = + Js.bool calcul_allocation_logement_locatif_in.beneficiaire_aide_adulte_ou_enfant_handicapes_in + val dateCouranteIn = + date_to_jsoo calcul_allocation_logement_locatif_in.date_courante_in + val nombrePersonnesAChargeIn = + integer_to_int calcul_allocation_logement_locatif_in.nombre_personnes_a_charge_in + val situationFamilialeCalculAplIn = + situation_familiale_calcul_a_p_l_to_jsoo calcul_allocation_logement_locatif_in.situation_familiale_calcul_apl_in + val zoneIn = + zone_d_habitation_to_jsoo calcul_allocation_logement_locatif_in.zone_in + val logementEstChambreIn = + Js.bool calcul_allocation_logement_locatif_in.logement_est_chambre_in + val ageesOuHandicapAdultesHebergeesOnereuxParticuliersIn = + Js.bool calcul_allocation_logement_locatif_in.agees_ou_handicap_adultes_hebergees_onereux_particuliers_in + val typeAideIn = + type_aides_personnelle_logement_to_jsoo calcul_allocation_logement_locatif_in.type_aide_in + val colocationIn = + Js.bool calcul_allocation_logement_locatif_in.colocation_in + val reductionLoyerSolidariteIn = + Js.number_of_float @@ money_to_float calcul_allocation_logement_locatif_in.reduction_loyer_solidarite_in + val logementMeubleD8422In = + Js.bool calcul_allocation_logement_locatif_in.logement_meuble_d842_2_in + val changementLogementD8424In = + changement_logement_d842_4_to_jsoo calcul_allocation_logement_locatif_in.changement_logement_d842_4_in + end + let calcul_allocation_logement_locatif_in_of_jsoo + (calcul_allocation_logement_locatif_in + : calcul_allocation_logement_locatif_in Js.t) : + CalculAllocationLogementLocatifIn.t = + { + loyer_principal_in = + money_of_decimal @@ decimal_of_float @@ Js.float_of_number + calcul_allocation_logement_locatif_in##.loyerPrincipalIn; + ressources_menage_arrondies_in = + money_of_decimal @@ decimal_of_float @@ Js.float_of_number + calcul_allocation_logement_locatif_in##.ressourcesMenageArrondiesIn; + beneficiaire_aide_adulte_ou_enfant_handicapes_in = + Js.to_bool + calcul_allocation_logement_locatif_in + ##.beneficiaireAideAdulteOuEnfantHandicapesIn; + date_courante_in = + date_of_jsoo calcul_allocation_logement_locatif_in##.dateCouranteIn; + nombre_personnes_a_charge_in = + integer_of_int + calcul_allocation_logement_locatif_in##.nombrePersonnesAChargeIn; + situation_familiale_calcul_apl_in = + situation_familiale_calcul_a_p_l_of_jsoo + calcul_allocation_logement_locatif_in + ##.situationFamilialeCalculAplIn; + zone_in = + zone_d_habitation_of_jsoo + calcul_allocation_logement_locatif_in##.zoneIn; + logement_est_chambre_in = + Js.to_bool + calcul_allocation_logement_locatif_in##.logementEstChambreIn; + agees_ou_handicap_adultes_hebergees_onereux_particuliers_in = + Js.to_bool + calcul_allocation_logement_locatif_in + ##.ageesOuHandicapAdultesHebergeesOnereuxParticuliersIn; + type_aide_in = + type_aides_personnelle_logement_of_jsoo + calcul_allocation_logement_locatif_in##.typeAideIn; + colocation_in = + Js.to_bool calcul_allocation_logement_locatif_in##.colocationIn; + reduction_loyer_solidarite_in = + money_of_decimal @@ decimal_of_float @@ Js.float_of_number + calcul_allocation_logement_locatif_in##.reductionLoyerSolidariteIn; + logement_meuble_d842_2_in = + Js.to_bool + calcul_allocation_logement_locatif_in##.logementMeubleD8422In; + changement_logement_d842_4_in = + changement_logement_d842_4_of_jsoo + calcul_allocation_logement_locatif_in##.changementLogementD8424In + } + +class type calcul_allocation_logement_accession_propriete_out = + object + method aideFinaleFormuleOut: Js.number Js.t Js.readonly_prop + method traitementAideFinaleMontantMinimalOut: + (Js.number Js.t, Js.number Js.t) Js.meth_callback Js.meth + end + let calcul_allocation_logement_accession_propriete_out_to_jsoo + (calcul_allocation_logement_accession_propriete_out + : CalculAllocationLogementAccessionProprieteOut.t) + : calcul_allocation_logement_accession_propriete_out Js.t = + object%js + val aideFinaleFormuleOut = + Js.number_of_float @@ money_to_float calcul_allocation_logement_accession_propriete_out.aide_finale_formule_out + method traitementAideFinaleMontantMinimalOut = Js.wrap_meth_callback + ( + fun input -> + Js.number_of_float @@ money_to_float (calcul_allocation_logement_accession_propriete_out.traitement_aide_finale_montant_minimal_out (money_of_decimal @@ decimal_of_float @@ Js.float_of_number input))) + end + let calcul_allocation_logement_accession_propriete_out_of_jsoo + (calcul_allocation_logement_accession_propriete_out + : calcul_allocation_logement_accession_propriete_out Js.t) : + CalculAllocationLogementAccessionProprieteOut.t = + { + aide_finale_formule_out = + money_of_decimal @@ decimal_of_float @@ Js.float_of_number + calcul_allocation_logement_accession_propriete_out + ##.aideFinaleFormuleOut; + traitement_aide_finale_montant_minimal_out = failwith "The function 'traitement_aide_finale_montant_minimal_out' translation isn't yet supported..." + } + +class type calcul_allocation_logement_accession_propriete_in = + object + method ressourcesMenageArrondiesBaseIn: Js.number Js.t Js.readonly_prop + method nombrePersonnesAChargeIn: int Js.readonly_prop + method situationFamilialeCalculAplIn: + situation_familiale_calcul_a_p_l Js.t Js.readonly_prop + method zoneIn: zone_d_habitation Js.t Js.readonly_prop + method dateCouranteIn: Js.js_string Js.t Js.readonly_prop + method mensualitePrincipaleIn: Js.number Js.t Js.readonly_prop + method situationR822111317In: bool Js.t Js.readonly_prop + method dateSignaturePretIn: Js.js_string Js.t Js.readonly_prop + method typeTravauxLogementIn: + type_travaux_logement_r842_5 Js.t Js.readonly_prop + method localHabitePremiereFoisBeneficiaireIn: bool Js.t Js.readonly_prop + method dateEntreeLogementIn: Js.js_string Js.t Js.readonly_prop + method chargesMensuellesPretIn: Js.number Js.t Js.readonly_prop + method coproprieteIn: bool Js.t Js.readonly_prop + end + let calcul_allocation_logement_accession_propriete_in_to_jsoo + (calcul_allocation_logement_accession_propriete_in + : CalculAllocationLogementAccessionProprieteIn.t) + : calcul_allocation_logement_accession_propriete_in Js.t = + object%js + val ressourcesMenageArrondiesBaseIn = + Js.number_of_float @@ money_to_float calcul_allocation_logement_accession_propriete_in.ressources_menage_arrondies_base_in + val nombrePersonnesAChargeIn = + integer_to_int calcul_allocation_logement_accession_propriete_in.nombre_personnes_a_charge_in + val situationFamilialeCalculAplIn = + situation_familiale_calcul_a_p_l_to_jsoo calcul_allocation_logement_accession_propriete_in.situation_familiale_calcul_apl_in + val zoneIn = + zone_d_habitation_to_jsoo calcul_allocation_logement_accession_propriete_in.zone_in + val dateCouranteIn = + date_to_jsoo calcul_allocation_logement_accession_propriete_in.date_courante_in + val mensualitePrincipaleIn = + Js.number_of_float @@ money_to_float calcul_allocation_logement_accession_propriete_in.mensualite_principale_in + val situationR822111317In = + Js.bool calcul_allocation_logement_accession_propriete_in.situation_r822_11_13_17_in + val dateSignaturePretIn = + date_to_jsoo calcul_allocation_logement_accession_propriete_in.date_signature_pret_in + val typeTravauxLogementIn = + type_travaux_logement_r842_5_to_jsoo calcul_allocation_logement_accession_propriete_in.type_travaux_logement_in + val localHabitePremiereFoisBeneficiaireIn = + Js.bool calcul_allocation_logement_accession_propriete_in.local_habite_premiere_fois_beneficiaire_in + val dateEntreeLogementIn = + date_to_jsoo calcul_allocation_logement_accession_propriete_in.date_entree_logement_in + val chargesMensuellesPretIn = + Js.number_of_float @@ money_to_float calcul_allocation_logement_accession_propriete_in.charges_mensuelles_pret_in + val coproprieteIn = + Js.bool calcul_allocation_logement_accession_propriete_in.copropriete_in + end + let calcul_allocation_logement_accession_propriete_in_of_jsoo + (calcul_allocation_logement_accession_propriete_in + : calcul_allocation_logement_accession_propriete_in Js.t) : + CalculAllocationLogementAccessionProprieteIn.t = + { + ressources_menage_arrondies_base_in = + money_of_decimal @@ decimal_of_float @@ Js.float_of_number + calcul_allocation_logement_accession_propriete_in + ##.ressourcesMenageArrondiesBaseIn; + nombre_personnes_a_charge_in = + integer_of_int + calcul_allocation_logement_accession_propriete_in + ##.nombrePersonnesAChargeIn; + situation_familiale_calcul_apl_in = + situation_familiale_calcul_a_p_l_of_jsoo + calcul_allocation_logement_accession_propriete_in + ##.situationFamilialeCalculAplIn; + zone_in = + zone_d_habitation_of_jsoo + calcul_allocation_logement_accession_propriete_in##.zoneIn; + date_courante_in = + date_of_jsoo + calcul_allocation_logement_accession_propriete_in##.dateCouranteIn; + mensualite_principale_in = + money_of_decimal @@ decimal_of_float @@ Js.float_of_number + calcul_allocation_logement_accession_propriete_in + ##.mensualitePrincipaleIn; + situation_r822_11_13_17_in = + Js.to_bool + calcul_allocation_logement_accession_propriete_in + ##.situationR822111317In; + date_signature_pret_in = + date_of_jsoo + calcul_allocation_logement_accession_propriete_in + ##.dateSignaturePretIn; + type_travaux_logement_in = + type_travaux_logement_r842_5_of_jsoo + calcul_allocation_logement_accession_propriete_in + ##.typeTravauxLogementIn; + local_habite_premiere_fois_beneficiaire_in = + Js.to_bool + calcul_allocation_logement_accession_propriete_in + ##.localHabitePremiereFoisBeneficiaireIn; + date_entree_logement_in = + date_of_jsoo + calcul_allocation_logement_accession_propriete_in + ##.dateEntreeLogementIn; + charges_mensuelles_pret_in = + money_of_decimal @@ decimal_of_float @@ Js.float_of_number + calcul_allocation_logement_accession_propriete_in + ##.chargesMensuellesPretIn; + copropriete_in = + Js.to_bool + calcul_allocation_logement_accession_propriete_in##.coproprieteIn + } + +class type calcul_allocation_logement_foyer_out = + object + method coefficientPriseEnChargeOut: Js.number Js.t Js.readonly_prop + method equivalenceLoyerOut: Js.number Js.t Js.readonly_prop + method montantForfaitaireChargesOut: Js.number Js.t Js.readonly_prop + method loyerMinimalOut: Js.number Js.t Js.readonly_prop + method aideFinaleFormuleOut: Js.number Js.t Js.readonly_prop + method traitementAideFinaleMontantMinimalOut: + (Js.number Js.t, Js.number Js.t) Js.meth_callback Js.meth + end + let calcul_allocation_logement_foyer_out_to_jsoo + (calcul_allocation_logement_foyer_out + : CalculAllocationLogementFoyerOut.t) + : calcul_allocation_logement_foyer_out Js.t = + object%js + val coefficientPriseEnChargeOut = + Js.number_of_float @@ decimal_to_float calcul_allocation_logement_foyer_out.coefficient_prise_en_charge_out + val equivalenceLoyerOut = + Js.number_of_float @@ money_to_float calcul_allocation_logement_foyer_out.equivalence_loyer_out + val montantForfaitaireChargesOut = + Js.number_of_float @@ money_to_float calcul_allocation_logement_foyer_out.montant_forfaitaire_charges_out + val loyerMinimalOut = + Js.number_of_float @@ money_to_float calcul_allocation_logement_foyer_out.loyer_minimal_out + val aideFinaleFormuleOut = + Js.number_of_float @@ money_to_float calcul_allocation_logement_foyer_out.aide_finale_formule_out + method traitementAideFinaleMontantMinimalOut = Js.wrap_meth_callback + ( + fun input -> + Js.number_of_float @@ money_to_float (calcul_allocation_logement_foyer_out.traitement_aide_finale_montant_minimal_out (money_of_decimal @@ decimal_of_float @@ Js.float_of_number input))) + end + let calcul_allocation_logement_foyer_out_of_jsoo + (calcul_allocation_logement_foyer_out + : calcul_allocation_logement_foyer_out Js.t) : + CalculAllocationLogementFoyerOut.t = + { + coefficient_prise_en_charge_out = + decimal_of_float @@ Js.float_of_number + calcul_allocation_logement_foyer_out##.coefficientPriseEnChargeOut; + equivalence_loyer_out = + money_of_decimal @@ decimal_of_float @@ Js.float_of_number + calcul_allocation_logement_foyer_out##.equivalenceLoyerOut; + montant_forfaitaire_charges_out = + money_of_decimal @@ decimal_of_float @@ Js.float_of_number + calcul_allocation_logement_foyer_out##.montantForfaitaireChargesOut; + loyer_minimal_out = + money_of_decimal @@ decimal_of_float @@ Js.float_of_number + calcul_allocation_logement_foyer_out##.loyerMinimalOut; + aide_finale_formule_out = + money_of_decimal @@ decimal_of_float @@ Js.float_of_number + calcul_allocation_logement_foyer_out##.aideFinaleFormuleOut; + traitement_aide_finale_montant_minimal_out = failwith "The function 'traitement_aide_finale_montant_minimal_out' translation isn't yet supported..." + } + +class type calcul_allocation_logement_foyer_in = + object + method redevanceIn: Js.number Js.t Js.readonly_prop + method modeOccupationIn: mode_occupation Js.t Js.readonly_prop + method ressourcesMenageArrondiesIn: Js.number Js.t Js.readonly_prop + method nombrePersonnesAChargeIn: int Js.readonly_prop + method situationFamilialeCalculAplIn: + situation_familiale_calcul_a_p_l Js.t Js.readonly_prop + method zoneIn: zone_d_habitation Js.t Js.readonly_prop + method dateCouranteIn: Js.js_string Js.t Js.readonly_prop + method categorieEquivalenceLoyerD84216In: + categorie_equivalence_loyer_allocation_logement_foyer Js.t Js.readonly_prop + end + let calcul_allocation_logement_foyer_in_to_jsoo + (calcul_allocation_logement_foyer_in : CalculAllocationLogementFoyerIn.t) + : calcul_allocation_logement_foyer_in Js.t = + object%js + val redevanceIn = + Js.number_of_float @@ money_to_float calcul_allocation_logement_foyer_in.redevance_in + val modeOccupationIn = + mode_occupation_to_jsoo calcul_allocation_logement_foyer_in.mode_occupation_in + val ressourcesMenageArrondiesIn = + Js.number_of_float @@ money_to_float calcul_allocation_logement_foyer_in.ressources_menage_arrondies_in + val nombrePersonnesAChargeIn = + integer_to_int calcul_allocation_logement_foyer_in.nombre_personnes_a_charge_in + val situationFamilialeCalculAplIn = + situation_familiale_calcul_a_p_l_to_jsoo calcul_allocation_logement_foyer_in.situation_familiale_calcul_apl_in + val zoneIn = + zone_d_habitation_to_jsoo calcul_allocation_logement_foyer_in.zone_in + val dateCouranteIn = + date_to_jsoo calcul_allocation_logement_foyer_in.date_courante_in + val categorieEquivalenceLoyerD84216In = + categorie_equivalence_loyer_allocation_logement_foyer_to_jsoo calcul_allocation_logement_foyer_in.categorie_equivalence_loyer_d842_16_in + end + let calcul_allocation_logement_foyer_in_of_jsoo + (calcul_allocation_logement_foyer_in + : calcul_allocation_logement_foyer_in Js.t) : + CalculAllocationLogementFoyerIn.t = + { + redevance_in = + money_of_decimal @@ decimal_of_float @@ Js.float_of_number + calcul_allocation_logement_foyer_in##.redevanceIn; + mode_occupation_in = + mode_occupation_of_jsoo + calcul_allocation_logement_foyer_in##.modeOccupationIn; + ressources_menage_arrondies_in = + money_of_decimal @@ decimal_of_float @@ Js.float_of_number + calcul_allocation_logement_foyer_in##.ressourcesMenageArrondiesIn; + nombre_personnes_a_charge_in = + integer_of_int + calcul_allocation_logement_foyer_in##.nombrePersonnesAChargeIn; + situation_familiale_calcul_apl_in = + situation_familiale_calcul_a_p_l_of_jsoo + calcul_allocation_logement_foyer_in##.situationFamilialeCalculAplIn; + zone_in = + zone_d_habitation_of_jsoo + calcul_allocation_logement_foyer_in##.zoneIn; + date_courante_in = + date_of_jsoo calcul_allocation_logement_foyer_in##.dateCouranteIn; + categorie_equivalence_loyer_d842_16_in = + categorie_equivalence_loyer_allocation_logement_foyer_of_jsoo + calcul_allocation_logement_foyer_in + ##.categorieEquivalenceLoyerD84216In + } + +class type calcul_allocation_logement_out = + object + method aideFinaleFormuleOut: Js.number Js.t Js.readonly_prop + method traitementAideFinaleOut: + (Js.number Js.t, Js.number Js.t) Js.meth_callback Js.meth + end + let calcul_allocation_logement_out_to_jsoo (calcul_allocation_logement_out + : CalculAllocationLogementOut.t) : calcul_allocation_logement_out Js.t = + object%js + val aideFinaleFormuleOut = + Js.number_of_float @@ money_to_float calcul_allocation_logement_out.aide_finale_formule_out + method traitementAideFinaleOut = Js.wrap_meth_callback + ( + fun input -> + Js.number_of_float @@ money_to_float (calcul_allocation_logement_out.traitement_aide_finale_out (money_of_decimal @@ decimal_of_float @@ Js.float_of_number input))) + end + let calcul_allocation_logement_out_of_jsoo + (calcul_allocation_logement_out : calcul_allocation_logement_out Js.t) : + CalculAllocationLogementOut.t = + { + aide_finale_formule_out = + money_of_decimal @@ decimal_of_float @@ Js.float_of_number + calcul_allocation_logement_out##.aideFinaleFormuleOut; + traitement_aide_finale_out = failwith "The function 'traitement_aide_finale_out' translation isn't yet supported..." + } + +class type calcul_allocation_logement_in = + object + method modeOccupationIn: mode_occupation Js.t Js.readonly_prop + method informationsCalculIn: + informations_calcul_a_p_l Js.t Js.readonly_prop + method ressourcesMenageSansArrondiIn: Js.number Js.t Js.readonly_prop + method situationFamilialeIn: situation_familiale Js.t Js.readonly_prop + method nombrePersonnesAChargeIn: int Js.readonly_prop + method zoneIn: zone_d_habitation Js.t Js.readonly_prop + method dateCouranteIn: Js.js_string Js.t Js.readonly_prop + method typeAideIn: type_aides_personnelle_logement Js.t Js.readonly_prop + end + let calcul_allocation_logement_in_to_jsoo (calcul_allocation_logement_in + : CalculAllocationLogementIn.t) : calcul_allocation_logement_in Js.t = + object%js + val modeOccupationIn = + mode_occupation_to_jsoo calcul_allocation_logement_in.mode_occupation_in + val informationsCalculIn = + informations_calcul_a_p_l_to_jsoo calcul_allocation_logement_in.informations_calcul_in + val ressourcesMenageSansArrondiIn = + Js.number_of_float @@ money_to_float calcul_allocation_logement_in.ressources_menage_sans_arrondi_in + val situationFamilialeIn = + situation_familiale_to_jsoo calcul_allocation_logement_in.situation_familiale_in + val nombrePersonnesAChargeIn = + integer_to_int calcul_allocation_logement_in.nombre_personnes_a_charge_in + val zoneIn = + zone_d_habitation_to_jsoo calcul_allocation_logement_in.zone_in + val dateCouranteIn = + date_to_jsoo calcul_allocation_logement_in.date_courante_in + val typeAideIn = + type_aides_personnelle_logement_to_jsoo calcul_allocation_logement_in.type_aide_in + end + let calcul_allocation_logement_in_of_jsoo + (calcul_allocation_logement_in : calcul_allocation_logement_in Js.t) : + CalculAllocationLogementIn.t = + { + mode_occupation_in = + mode_occupation_of_jsoo + calcul_allocation_logement_in##.modeOccupationIn; + informations_calcul_in = + informations_calcul_a_p_l_of_jsoo + calcul_allocation_logement_in##.informationsCalculIn; + ressources_menage_sans_arrondi_in = + money_of_decimal @@ decimal_of_float @@ Js.float_of_number + calcul_allocation_logement_in##.ressourcesMenageSansArrondiIn; + situation_familiale_in = + situation_familiale_of_jsoo + calcul_allocation_logement_in##.situationFamilialeIn; + nombre_personnes_a_charge_in = + integer_of_int + calcul_allocation_logement_in##.nombrePersonnesAChargeIn; + zone_in = + zone_d_habitation_of_jsoo calcul_allocation_logement_in##.zoneIn; + date_courante_in = + date_of_jsoo calcul_allocation_logement_in##.dateCouranteIn; + type_aide_in = + type_aides_personnelle_logement_of_jsoo + calcul_allocation_logement_in##.typeAideIn + } + +class type ouverture_droits_retraite_out = + object + method ageOuvertureDroitOut: + Runtime_jsoo.Runtime.duration Js.t Js.readonly_prop + end + let ouverture_droits_retraite_out_to_jsoo (ouverture_droits_retraite_out + : OuvertureDroitsRetraiteOut.t) : ouverture_droits_retraite_out Js.t = + object%js + val ageOuvertureDroitOut = + duration_to_jsoo ouverture_droits_retraite_out.age_ouverture_droit_out + end + let ouverture_droits_retraite_out_of_jsoo + (ouverture_droits_retraite_out : ouverture_droits_retraite_out Js.t) : + OuvertureDroitsRetraiteOut.t = + { + age_ouverture_droit_out = + duration_of_jsoo ouverture_droits_retraite_out##.ageOuvertureDroitOut + } + +class type ouverture_droits_retraite_in = + object method dateNaissanceAssureIn: Js.js_string Js.t Js.readonly_prop + end + let ouverture_droits_retraite_in_to_jsoo (ouverture_droits_retraite_in + : OuvertureDroitsRetraiteIn.t) : ouverture_droits_retraite_in Js.t = + object%js + val dateNaissanceAssureIn = + date_to_jsoo ouverture_droits_retraite_in.date_naissance_assure_in + end + let ouverture_droits_retraite_in_of_jsoo + (ouverture_droits_retraite_in : ouverture_droits_retraite_in Js.t) : + OuvertureDroitsRetraiteIn.t = + { + date_naissance_assure_in = + date_of_jsoo ouverture_droits_retraite_in##.dateNaissanceAssureIn + } + +class type impaye_depense_logement_out = + object method montantImpayeOut: Js.number Js.t Js.readonly_prop + end + let impaye_depense_logement_out_to_jsoo (impaye_depense_logement_out + : ImpayeDepenseLogementOut.t) : impaye_depense_logement_out Js.t = + object%js + val montantImpayeOut = + Js.number_of_float @@ money_to_float impaye_depense_logement_out.montant_impaye_out + end + let impaye_depense_logement_out_of_jsoo + (impaye_depense_logement_out : impaye_depense_logement_out Js.t) : + ImpayeDepenseLogementOut.t = + { + montant_impaye_out = + money_of_decimal @@ decimal_of_float @@ Js.float_of_number + impaye_depense_logement_out##.montantImpayeOut + } + +class type impaye_depense_logement_in = + object + method modeOccupationIn: mode_occupation Js.t Js.readonly_prop + method aideVerseeIn: versement_a Js.t Js.readonly_prop + method montantAplIn: Js.number Js.t Js.readonly_prop + method montantChargesIn: Js.number Js.t Js.readonly_prop + method depenseLogementIn: depense_logement Js.t Js.readonly_prop + method montantDetteIn: Js.number Js.t Js.readonly_prop + end + let impaye_depense_logement_in_to_jsoo (impaye_depense_logement_in + : ImpayeDepenseLogementIn.t) : impaye_depense_logement_in Js.t = + object%js + val modeOccupationIn = + mode_occupation_to_jsoo impaye_depense_logement_in.mode_occupation_in + val aideVerseeIn = + versement_a_to_jsoo impaye_depense_logement_in.aide_versee_in + val montantAplIn = + Js.number_of_float @@ money_to_float impaye_depense_logement_in.montant_apl_in + val montantChargesIn = + Js.number_of_float @@ money_to_float impaye_depense_logement_in.montant_charges_in + val depenseLogementIn = + depense_logement_to_jsoo impaye_depense_logement_in.depense_logement_in + val montantDetteIn = + Js.number_of_float @@ money_to_float impaye_depense_logement_in.montant_dette_in + end + let impaye_depense_logement_in_of_jsoo + (impaye_depense_logement_in : impaye_depense_logement_in Js.t) : + ImpayeDepenseLogementIn.t = + { + mode_occupation_in = + mode_occupation_of_jsoo impaye_depense_logement_in##.modeOccupationIn; + aide_versee_in = + versement_a_of_jsoo impaye_depense_logement_in##.aideVerseeIn; + montant_apl_in = + money_of_decimal @@ decimal_of_float @@ Js.float_of_number + impaye_depense_logement_in##.montantAplIn; + montant_charges_in = + money_of_decimal @@ decimal_of_float @@ Js.float_of_number + impaye_depense_logement_in##.montantChargesIn; + depense_logement_in = + depense_logement_of_jsoo + impaye_depense_logement_in##.depenseLogementIn; + montant_dette_in = + money_of_decimal @@ decimal_of_float @@ Js.float_of_number + impaye_depense_logement_in##.montantDetteIn + } + +class type calculette_aides_au_logement_out = + object + method eligibiliteOut: bool Js.t Js.readonly_prop + method aideFinaleFormuleOut: Js.number Js.t Js.readonly_prop + method traitementAideFinaleOut: + (Js.number Js.t, Js.number Js.t) Js.meth_callback Js.meth + method coefficentsEnfantsGardeAlterneePrisEnCompteOut: + Js.number Js.t Js.js_array Js.t Js.readonly_prop + end + let calculette_aides_au_logement_out_to_jsoo + (calculette_aides_au_logement_out : CalculetteAidesAuLogementOut.t) + : calculette_aides_au_logement_out Js.t = + object%js + val eligibiliteOut = + Js.bool calculette_aides_au_logement_out.eligibilite_out + val aideFinaleFormuleOut = + Js.number_of_float @@ money_to_float calculette_aides_au_logement_out.aide_finale_formule_out + method traitementAideFinaleOut = Js.wrap_meth_callback + ( + fun input -> + Js.number_of_float @@ money_to_float (calculette_aides_au_logement_out.traitement_aide_finale_out (money_of_decimal @@ decimal_of_float @@ Js.float_of_number input))) + val coefficentsEnfantsGardeAlterneePrisEnCompteOut = + Js.array @@ Array.map (fun x -> Js.number_of_float @@ decimal_to_float x) calculette_aides_au_logement_out.coefficents_enfants_garde_alternee_pris_en_compte_out + end + let calculette_aides_au_logement_out_of_jsoo + (calculette_aides_au_logement_out + : calculette_aides_au_logement_out Js.t) : + CalculetteAidesAuLogementOut.t = + { + eligibilite_out = + Js.to_bool calculette_aides_au_logement_out##.eligibiliteOut; + aide_finale_formule_out = + money_of_decimal @@ decimal_of_float @@ Js.float_of_number + calculette_aides_au_logement_out##.aideFinaleFormuleOut; + traitement_aide_finale_out = failwith "The function 'traitement_aide_finale_out' translation isn't yet supported..."; + coefficents_enfants_garde_alternee_pris_en_compte_out = + Array.map (fun x -> decimal_of_float @@ Js.float_of_number x) @@ Js.to_array + calculette_aides_au_logement_out + ##.coefficentsEnfantsGardeAlterneePrisEnCompteOut + } + +class type calculette_aides_au_logement_in = + object + method menageIn: menage Js.t Js.readonly_prop + method demandeurIn: demandeur Js.t Js.readonly_prop + method informationsCalculIn: + informations_calcul_a_p_l Js.t Js.readonly_prop + method dateCouranteIn: Js.js_string Js.t Js.readonly_prop + method ressourcesMenagePrisesEnCompteIn: Js.number Js.t Js.readonly_prop + end + let calculette_aides_au_logement_in_to_jsoo + (calculette_aides_au_logement_in : CalculetteAidesAuLogementIn.t) + : calculette_aides_au_logement_in Js.t = + object%js + val menageIn = menage_to_jsoo calculette_aides_au_logement_in.menage_in + val demandeurIn = + demandeur_to_jsoo calculette_aides_au_logement_in.demandeur_in + val informationsCalculIn = + informations_calcul_a_p_l_to_jsoo calculette_aides_au_logement_in.informations_calcul_in + val dateCouranteIn = + date_to_jsoo calculette_aides_au_logement_in.date_courante_in + val ressourcesMenagePrisesEnCompteIn = + Js.number_of_float @@ money_to_float calculette_aides_au_logement_in.ressources_menage_prises_en_compte_in + end + let calculette_aides_au_logement_in_of_jsoo + (calculette_aides_au_logement_in : calculette_aides_au_logement_in Js.t) : + CalculetteAidesAuLogementIn.t = + { + menage_in = menage_of_jsoo calculette_aides_au_logement_in##.menageIn; + demandeur_in = + demandeur_of_jsoo calculette_aides_au_logement_in##.demandeurIn; + informations_calcul_in = + informations_calcul_a_p_l_of_jsoo + calculette_aides_au_logement_in##.informationsCalculIn; + date_courante_in = + date_of_jsoo calculette_aides_au_logement_in##.dateCouranteIn; + ressources_menage_prises_en_compte_in = + money_of_decimal @@ decimal_of_float @@ Js.float_of_number + calculette_aides_au_logement_in##.ressourcesMenagePrisesEnCompteIn + } + +class type calculette_aides_au_logement_garde_alternee_out = + object + method eligibiliteOut: bool Js.t Js.readonly_prop + method aideFinaleOut: Js.number Js.t Js.readonly_prop + end + let calculette_aides_au_logement_garde_alternee_out_to_jsoo + (calculette_aides_au_logement_garde_alternee_out + : CalculetteAidesAuLogementGardeAlterneeOut.t) + : calculette_aides_au_logement_garde_alternee_out Js.t = + object%js + val eligibiliteOut = + Js.bool calculette_aides_au_logement_garde_alternee_out.eligibilite_out + val aideFinaleOut = + Js.number_of_float @@ money_to_float calculette_aides_au_logement_garde_alternee_out.aide_finale_out + end + let calculette_aides_au_logement_garde_alternee_out_of_jsoo + (calculette_aides_au_logement_garde_alternee_out + : calculette_aides_au_logement_garde_alternee_out Js.t) : + CalculetteAidesAuLogementGardeAlterneeOut.t = + { + eligibilite_out = + Js.to_bool + calculette_aides_au_logement_garde_alternee_out##.eligibiliteOut; + aide_finale_out = + money_of_decimal @@ decimal_of_float @@ Js.float_of_number + calculette_aides_au_logement_garde_alternee_out##.aideFinaleOut + } + +class type calculette_aides_au_logement_garde_alternee_in = + object + method menageIn: menage Js.t Js.readonly_prop + method demandeurIn: demandeur Js.t Js.readonly_prop + method informationsCalculIn: + informations_calcul_a_p_l Js.t Js.readonly_prop + method dateCouranteIn: Js.js_string Js.t Js.readonly_prop + method ressourcesMenagePrisesEnCompteIn: Js.number Js.t Js.readonly_prop + end + let calculette_aides_au_logement_garde_alternee_in_to_jsoo + (calculette_aides_au_logement_garde_alternee_in + : CalculetteAidesAuLogementGardeAlterneeIn.t) + : calculette_aides_au_logement_garde_alternee_in Js.t = + object%js + val menageIn = + menage_to_jsoo calculette_aides_au_logement_garde_alternee_in.menage_in + val demandeurIn = + demandeur_to_jsoo calculette_aides_au_logement_garde_alternee_in.demandeur_in + val informationsCalculIn = + informations_calcul_a_p_l_to_jsoo calculette_aides_au_logement_garde_alternee_in.informations_calcul_in + val dateCouranteIn = + date_to_jsoo calculette_aides_au_logement_garde_alternee_in.date_courante_in + val ressourcesMenagePrisesEnCompteIn = + Js.number_of_float @@ money_to_float calculette_aides_au_logement_garde_alternee_in.ressources_menage_prises_en_compte_in + end + let calculette_aides_au_logement_garde_alternee_in_of_jsoo + (calculette_aides_au_logement_garde_alternee_in + : calculette_aides_au_logement_garde_alternee_in Js.t) : + CalculetteAidesAuLogementGardeAlterneeIn.t = + { + menage_in = + menage_of_jsoo + calculette_aides_au_logement_garde_alternee_in##.menageIn; + demandeur_in = + demandeur_of_jsoo + calculette_aides_au_logement_garde_alternee_in##.demandeurIn; + informations_calcul_in = + informations_calcul_a_p_l_of_jsoo + calculette_aides_au_logement_garde_alternee_in + ##.informationsCalculIn; + date_courante_in = + date_of_jsoo + calculette_aides_au_logement_garde_alternee_in##.dateCouranteIn; + ressources_menage_prises_en_compte_in = + money_of_decimal @@ decimal_of_float @@ Js.float_of_number + calculette_aides_au_logement_garde_alternee_in + ##.ressourcesMenagePrisesEnCompteIn + } + +class type base_mensuelle_allocations_familiales_out = + object method montantOut: Js.number Js.t Js.readonly_prop + end + let base_mensuelle_allocations_familiales_out_to_jsoo + (base_mensuelle_allocations_familiales_out + : BaseMensuelleAllocationsFamilialesOut.t) + : base_mensuelle_allocations_familiales_out Js.t = + object%js + val montantOut = + Js.number_of_float @@ money_to_float base_mensuelle_allocations_familiales_out.montant_out + end + let base_mensuelle_allocations_familiales_out_of_jsoo + (base_mensuelle_allocations_familiales_out + : base_mensuelle_allocations_familiales_out Js.t) : + BaseMensuelleAllocationsFamilialesOut.t = + { + montant_out = + money_of_decimal @@ decimal_of_float @@ Js.float_of_number + base_mensuelle_allocations_familiales_out##.montantOut + } + +class type base_mensuelle_allocations_familiales_in = + object method dateCouranteIn: Js.js_string Js.t Js.readonly_prop + end + let base_mensuelle_allocations_familiales_in_to_jsoo + (base_mensuelle_allocations_familiales_in + : BaseMensuelleAllocationsFamilialesIn.t) + : base_mensuelle_allocations_familiales_in Js.t = + object%js + val dateCouranteIn = + date_to_jsoo base_mensuelle_allocations_familiales_in.date_courante_in + end + let base_mensuelle_allocations_familiales_in_of_jsoo + (base_mensuelle_allocations_familiales_in + : base_mensuelle_allocations_familiales_in Js.t) : + BaseMensuelleAllocationsFamilialesIn.t = + { + date_courante_in = + date_of_jsoo + base_mensuelle_allocations_familiales_in##.dateCouranteIn + } + +class type smic_out = + object method brutHoraireOut: Js.number Js.t Js.readonly_prop + end + let smic_out_to_jsoo (smic_out : SmicOut.t) : smic_out Js.t = + object%js + val brutHoraireOut = + Js.number_of_float @@ money_to_float smic_out.brut_horaire_out + end + let smic_out_of_jsoo (smic_out : smic_out Js.t) : SmicOut.t = + { + brut_horaire_out = + money_of_decimal @@ decimal_of_float @@ Js.float_of_number + smic_out##.brutHoraireOut + } + +class type smic_in = + object + method dateCouranteIn: Js.js_string Js.t Js.readonly_prop + method residenceIn: collectivite Js.t Js.readonly_prop + end + let smic_in_to_jsoo (smic_in : SmicIn.t) : smic_in Js.t = + object%js + val dateCouranteIn = date_to_jsoo smic_in.date_courante_in + val residenceIn = collectivite_to_jsoo smic_in.residence_in + end + let smic_in_of_jsoo (smic_in : smic_in Js.t) : SmicIn.t = + { + date_courante_in = date_of_jsoo smic_in##.dateCouranteIn; + residence_in = collectivite_of_jsoo smic_in##.residenceIn + } + +class type eligibilite_prestations_familiales_out = + object + method droitOuvertOut: + (enfant_prestations_familiales Js.t, bool Js.t) Js.meth_callback Js.meth + method conditionsHorsAgeOut: + (enfant_prestations_familiales Js.t, bool Js.t) Js.meth_callback Js.meth + method ageL51232Out: int Js.readonly_prop + method regimeOutreMerL7511Out: bool Js.t Js.readonly_prop + end + let eligibilite_prestations_familiales_out_to_jsoo + (eligibilite_prestations_familiales_out + : EligibilitePrestationsFamilialesOut.t) + : eligibilite_prestations_familiales_out Js.t = + object%js + method droitOuvertOut = Js.wrap_meth_callback + ( + fun input -> + Js.bool (eligibilite_prestations_familiales_out.droit_ouvert_out (enfant_prestations_familiales_of_jsoo input))) + method conditionsHorsAgeOut = Js.wrap_meth_callback + ( + fun input -> + Js.bool (eligibilite_prestations_familiales_out.conditions_hors_age_out (enfant_prestations_familiales_of_jsoo input))) + val ageL51232Out = + integer_to_int eligibilite_prestations_familiales_out.age_l512_3_2_out + val regimeOutreMerL7511Out = + Js.bool eligibilite_prestations_familiales_out.regime_outre_mer_l751_1_out + end + let eligibilite_prestations_familiales_out_of_jsoo + (eligibilite_prestations_familiales_out + : eligibilite_prestations_familiales_out Js.t) : + EligibilitePrestationsFamilialesOut.t = + { + droit_ouvert_out = failwith "The function 'droit_ouvert_out' translation isn't yet supported..."; + conditions_hors_age_out = failwith "The function 'conditions_hors_age_out' translation isn't yet supported..."; + age_l512_3_2_out = + integer_of_int eligibilite_prestations_familiales_out##.ageL51232Out; + regime_outre_mer_l751_1_out = + Js.to_bool + eligibilite_prestations_familiales_out##.regimeOutreMerL7511Out + } + +class type eligibilite_prestations_familiales_in = + object + method dateCouranteIn: Js.js_string Js.t Js.readonly_prop + method prestationCouranteIn: + element_prestations_familiales Js.t Js.readonly_prop + method residenceIn: collectivite Js.t Js.readonly_prop + end + let eligibilite_prestations_familiales_in_to_jsoo + (eligibilite_prestations_familiales_in + : EligibilitePrestationsFamilialesIn.t) + : eligibilite_prestations_familiales_in Js.t = + object%js + val dateCouranteIn = + date_to_jsoo eligibilite_prestations_familiales_in.date_courante_in + val prestationCouranteIn = + element_prestations_familiales_to_jsoo eligibilite_prestations_familiales_in.prestation_courante_in + val residenceIn = + collectivite_to_jsoo eligibilite_prestations_familiales_in.residence_in + end + let eligibilite_prestations_familiales_in_of_jsoo + (eligibilite_prestations_familiales_in + : eligibilite_prestations_familiales_in Js.t) : + EligibilitePrestationsFamilialesIn.t = + { + date_courante_in = + date_of_jsoo eligibilite_prestations_familiales_in##.dateCouranteIn; + prestation_courante_in = + element_prestations_familiales_of_jsoo + eligibilite_prestations_familiales_in##.prestationCouranteIn; + residence_in = + collectivite_of_jsoo + eligibilite_prestations_familiales_in##.residenceIn + } + + + + +let contributions_sociales_aides_personnelle_logement + (contributions_sociales_aides_personnelle_logement_in : contributions_sociales_aides_personnelle_logement_in Js.t) + : contributions_sociales_aides_personnelle_logement_out Js.t = + contributions_sociales_aides_personnelle_logement_in + |> contributions_sociales_aides_personnelle_logement_in_of_jsoo + |> contributions_sociales_aides_personnelle_logement + |> contributions_sociales_aides_personnelle_logement_out_to_jsoo + + +let calcul_equivalence_loyer_minimale + (calcul_equivalence_loyer_minimale_in : calcul_equivalence_loyer_minimale_in Js.t) + : calcul_equivalence_loyer_minimale_out Js.t = + calcul_equivalence_loyer_minimale_in + |> calcul_equivalence_loyer_minimale_in_of_jsoo + |> calcul_equivalence_loyer_minimale + |> calcul_equivalence_loyer_minimale_out_to_jsoo + + +let calcul_nombre_part_logement_foyer + (calcul_nombre_part_logement_foyer_in : calcul_nombre_part_logement_foyer_in Js.t) + : calcul_nombre_part_logement_foyer_out Js.t = + calcul_nombre_part_logement_foyer_in + |> calcul_nombre_part_logement_foyer_in_of_jsoo + |> calcul_nombre_part_logement_foyer + |> calcul_nombre_part_logement_foyer_out_to_jsoo + + +let calcul_nombre_parts_accession_propriete + (calcul_nombre_parts_accession_propriete_in : calcul_nombre_parts_accession_propriete_in Js.t) + : calcul_nombre_parts_accession_propriete_out Js.t = + calcul_nombre_parts_accession_propriete_in + |> calcul_nombre_parts_accession_propriete_in_of_jsoo + |> calcul_nombre_parts_accession_propriete + |> calcul_nombre_parts_accession_propriete_out_to_jsoo + + +let ouverture_droits_retraite + (ouverture_droits_retraite_in : ouverture_droits_retraite_in Js.t) + : ouverture_droits_retraite_out Js.t = + ouverture_droits_retraite_in + |> ouverture_droits_retraite_in_of_jsoo + |> ouverture_droits_retraite + |> ouverture_droits_retraite_out_to_jsoo + + +let impaye_depense_logement + (impaye_depense_logement_in : impaye_depense_logement_in Js.t) + : impaye_depense_logement_out Js.t = + impaye_depense_logement_in + |> impaye_depense_logement_in_of_jsoo + |> impaye_depense_logement + |> impaye_depense_logement_out_to_jsoo + + +let base_mensuelle_allocations_familiales + (base_mensuelle_allocations_familiales_in : base_mensuelle_allocations_familiales_in Js.t) + : base_mensuelle_allocations_familiales_out Js.t = + base_mensuelle_allocations_familiales_in + |> base_mensuelle_allocations_familiales_in_of_jsoo + |> base_mensuelle_allocations_familiales + |> base_mensuelle_allocations_familiales_out_to_jsoo + + +let smic (smic_in : smic_in Js.t) + : smic_out Js.t = + smic_in |> smic_in_of_jsoo |> smic |> smic_out_to_jsoo + + +let calcul_aide_personnalisee_logement_locatif + (calcul_aide_personnalisee_logement_locatif_in : calcul_aide_personnalisee_logement_locatif_in Js.t) + : calcul_aide_personnalisee_logement_locatif_out Js.t = + calcul_aide_personnalisee_logement_locatif_in + |> calcul_aide_personnalisee_logement_locatif_in_of_jsoo + |> calcul_aide_personnalisee_logement_locatif + |> calcul_aide_personnalisee_logement_locatif_out_to_jsoo + + +let calcul_aide_personnalisee_logement_foyer + (calcul_aide_personnalisee_logement_foyer_in : calcul_aide_personnalisee_logement_foyer_in Js.t) + : calcul_aide_personnalisee_logement_foyer_out Js.t = + calcul_aide_personnalisee_logement_foyer_in + |> calcul_aide_personnalisee_logement_foyer_in_of_jsoo + |> calcul_aide_personnalisee_logement_foyer + |> calcul_aide_personnalisee_logement_foyer_out_to_jsoo + + +let calcul_aide_personnalisee_logement_accession_propriete + (calcul_aide_personnalisee_logement_accession_propriete_in : calcul_aide_personnalisee_logement_accession_propriete_in Js.t) + : calcul_aide_personnalisee_logement_accession_propriete_out Js.t = + calcul_aide_personnalisee_logement_accession_propriete_in + |> calcul_aide_personnalisee_logement_accession_propriete_in_of_jsoo + |> calcul_aide_personnalisee_logement_accession_propriete + |> calcul_aide_personnalisee_logement_accession_propriete_out_to_jsoo + + +let eligibilite_aides_personnelle_logement + (eligibilite_aides_personnelle_logement_in : eligibilite_aides_personnelle_logement_in Js.t) + : eligibilite_aides_personnelle_logement_out Js.t = + eligibilite_aides_personnelle_logement_in + |> eligibilite_aides_personnelle_logement_in_of_jsoo + |> eligibilite_aides_personnelle_logement + |> eligibilite_aides_personnelle_logement_out_to_jsoo + + +let ressources_aides_personnelle_logement + (ressources_aides_personnelle_logement_in : ressources_aides_personnelle_logement_in Js.t) + : ressources_aides_personnelle_logement_out Js.t = + ressources_aides_personnelle_logement_in + |> ressources_aides_personnelle_logement_in_of_jsoo + |> ressources_aides_personnelle_logement + |> ressources_aides_personnelle_logement_out_to_jsoo + + +let eligibilite_prestations_familiales + (eligibilite_prestations_familiales_in : eligibilite_prestations_familiales_in Js.t) + : eligibilite_prestations_familiales_out Js.t = + eligibilite_prestations_familiales_in + |> eligibilite_prestations_familiales_in_of_jsoo + |> eligibilite_prestations_familiales + |> eligibilite_prestations_familiales_out_to_jsoo + + +let calcul_allocation_logement_locatif + (calcul_allocation_logement_locatif_in : calcul_allocation_logement_locatif_in Js.t) + : calcul_allocation_logement_locatif_out Js.t = + calcul_allocation_logement_locatif_in + |> calcul_allocation_logement_locatif_in_of_jsoo + |> calcul_allocation_logement_locatif + |> calcul_allocation_logement_locatif_out_to_jsoo + + +let calcul_allocation_logement_foyer + (calcul_allocation_logement_foyer_in : calcul_allocation_logement_foyer_in Js.t) + : calcul_allocation_logement_foyer_out Js.t = + calcul_allocation_logement_foyer_in + |> calcul_allocation_logement_foyer_in_of_jsoo + |> calcul_allocation_logement_foyer + |> calcul_allocation_logement_foyer_out_to_jsoo + + +let calcul_allocation_logement_accession_propriete + (calcul_allocation_logement_accession_propriete_in : calcul_allocation_logement_accession_propriete_in Js.t) + : calcul_allocation_logement_accession_propriete_out Js.t = + calcul_allocation_logement_accession_propriete_in + |> calcul_allocation_logement_accession_propriete_in_of_jsoo + |> calcul_allocation_logement_accession_propriete + |> calcul_allocation_logement_accession_propriete_out_to_jsoo + + +let calcul_aide_personnalisee_logement + (calcul_aide_personnalisee_logement_in : calcul_aide_personnalisee_logement_in Js.t) + : calcul_aide_personnalisee_logement_out Js.t = + calcul_aide_personnalisee_logement_in + |> calcul_aide_personnalisee_logement_in_of_jsoo + |> calcul_aide_personnalisee_logement + |> calcul_aide_personnalisee_logement_out_to_jsoo + + +let eligibilite_prime_de_demenagement + (eligibilite_prime_de_demenagement_in : eligibilite_prime_de_demenagement_in Js.t) + : eligibilite_prime_de_demenagement_out Js.t = + eligibilite_prime_de_demenagement_in + |> eligibilite_prime_de_demenagement_in_of_jsoo + |> eligibilite_prime_de_demenagement + |> eligibilite_prime_de_demenagement_out_to_jsoo + + +let eligibilite_aide_personnalisee_logement + (eligibilite_aide_personnalisee_logement_in : eligibilite_aide_personnalisee_logement_in Js.t) + : eligibilite_aide_personnalisee_logement_out Js.t = + eligibilite_aide_personnalisee_logement_in + |> eligibilite_aide_personnalisee_logement_in_of_jsoo + |> eligibilite_aide_personnalisee_logement + |> eligibilite_aide_personnalisee_logement_out_to_jsoo + + +let eligibilite_allocation_logement + (eligibilite_allocation_logement_in : eligibilite_allocation_logement_in Js.t) + : eligibilite_allocation_logement_out Js.t = + eligibilite_allocation_logement_in + |> eligibilite_allocation_logement_in_of_jsoo + |> eligibilite_allocation_logement + |> eligibilite_allocation_logement_out_to_jsoo + + +let calcul_allocation_logement + (calcul_allocation_logement_in : calcul_allocation_logement_in Js.t) + : calcul_allocation_logement_out Js.t = + calcul_allocation_logement_in + |> calcul_allocation_logement_in_of_jsoo + |> calcul_allocation_logement + |> calcul_allocation_logement_out_to_jsoo + + +let calculette_aides_au_logement + (calculette_aides_au_logement_in : calculette_aides_au_logement_in Js.t) + : calculette_aides_au_logement_out Js.t = + calculette_aides_au_logement_in + |> calculette_aides_au_logement_in_of_jsoo + |> calculette_aides_au_logement + |> calculette_aides_au_logement_out_to_jsoo + + +let calculette_aides_au_logement_garde_alternee + (calculette_aides_au_logement_garde_alternee_in : calculette_aides_au_logement_garde_alternee_in Js.t) + : calculette_aides_au_logement_garde_alternee_out Js.t = + calculette_aides_au_logement_garde_alternee_in + |> calculette_aides_au_logement_garde_alternee_in_of_jsoo + |> calculette_aides_au_logement_garde_alternee + |> calculette_aides_au_logement_garde_alternee_out_to_jsoo + + +let _ = + Js.export "AidesLogementLib" + (object%js + + method contributionsSocialesAidesPersonnelleLogement : (contributions_sociales_aides_personnelle_logement_in Js.t -> contributions_sociales_aides_personnelle_logement_out Js.t) Js.callback = + Js.wrap_callback contributions_sociales_aides_personnelle_logement + + method calculEquivalenceLoyerMinimale : (calcul_equivalence_loyer_minimale_in Js.t -> calcul_equivalence_loyer_minimale_out Js.t) Js.callback = + Js.wrap_callback calcul_equivalence_loyer_minimale + + method calculNombrePartLogementFoyer : (calcul_nombre_part_logement_foyer_in Js.t -> calcul_nombre_part_logement_foyer_out Js.t) Js.callback = + Js.wrap_callback calcul_nombre_part_logement_foyer + + method calculNombrePartsAccessionPropriete : (calcul_nombre_parts_accession_propriete_in Js.t -> calcul_nombre_parts_accession_propriete_out Js.t) Js.callback = + Js.wrap_callback calcul_nombre_parts_accession_propriete + + method ouvertureDroitsRetraite : (ouverture_droits_retraite_in Js.t -> ouverture_droits_retraite_out Js.t) Js.callback = + Js.wrap_callback ouverture_droits_retraite + + method impayeDepenseLogement : (impaye_depense_logement_in Js.t -> impaye_depense_logement_out Js.t) Js.callback = + Js.wrap_callback impaye_depense_logement + + method baseMensuelleAllocationsFamiliales : (base_mensuelle_allocations_familiales_in Js.t -> base_mensuelle_allocations_familiales_out Js.t) Js.callback = + Js.wrap_callback base_mensuelle_allocations_familiales + + method smic : (smic_in Js.t -> smic_out Js.t) Js.callback = + Js.wrap_callback smic + + method calculAidePersonnaliseeLogementLocatif : (calcul_aide_personnalisee_logement_locatif_in Js.t -> calcul_aide_personnalisee_logement_locatif_out Js.t) Js.callback = + Js.wrap_callback calcul_aide_personnalisee_logement_locatif + + method calculAidePersonnaliseeLogementFoyer : (calcul_aide_personnalisee_logement_foyer_in Js.t -> calcul_aide_personnalisee_logement_foyer_out Js.t) Js.callback = + Js.wrap_callback calcul_aide_personnalisee_logement_foyer + + method calculAidePersonnaliseeLogementAccessionPropriete : (calcul_aide_personnalisee_logement_accession_propriete_in Js.t -> calcul_aide_personnalisee_logement_accession_propriete_out Js.t) Js.callback = + Js.wrap_callback + calcul_aide_personnalisee_logement_accession_propriete + + method eligibiliteAidesPersonnelleLogement : (eligibilite_aides_personnelle_logement_in Js.t -> eligibilite_aides_personnelle_logement_out Js.t) Js.callback = + Js.wrap_callback eligibilite_aides_personnelle_logement + + method ressourcesAidesPersonnelleLogement : (ressources_aides_personnelle_logement_in Js.t -> ressources_aides_personnelle_logement_out Js.t) Js.callback = + Js.wrap_callback ressources_aides_personnelle_logement + + method eligibilitePrestationsFamiliales : (eligibilite_prestations_familiales_in Js.t -> eligibilite_prestations_familiales_out Js.t) Js.callback = + Js.wrap_callback eligibilite_prestations_familiales + + method calculAllocationLogementLocatif : (calcul_allocation_logement_locatif_in Js.t -> calcul_allocation_logement_locatif_out Js.t) Js.callback = + Js.wrap_callback calcul_allocation_logement_locatif + + method calculAllocationLogementFoyer : (calcul_allocation_logement_foyer_in Js.t -> calcul_allocation_logement_foyer_out Js.t) Js.callback = + Js.wrap_callback calcul_allocation_logement_foyer + + method calculAllocationLogementAccessionPropriete : (calcul_allocation_logement_accession_propriete_in Js.t -> calcul_allocation_logement_accession_propriete_out Js.t) Js.callback = + Js.wrap_callback calcul_allocation_logement_accession_propriete + + method calculAidePersonnaliseeLogement : (calcul_aide_personnalisee_logement_in Js.t -> calcul_aide_personnalisee_logement_out Js.t) Js.callback = + Js.wrap_callback calcul_aide_personnalisee_logement + + method eligibilitePrimeDeDemenagement : (eligibilite_prime_de_demenagement_in Js.t -> eligibilite_prime_de_demenagement_out Js.t) Js.callback = + Js.wrap_callback eligibilite_prime_de_demenagement + + method eligibiliteAidePersonnaliseeLogement : (eligibilite_aide_personnalisee_logement_in Js.t -> eligibilite_aide_personnalisee_logement_out Js.t) Js.callback = + Js.wrap_callback eligibilite_aide_personnalisee_logement + + method eligibiliteAllocationLogement : (eligibilite_allocation_logement_in Js.t -> eligibilite_allocation_logement_out Js.t) Js.callback = + Js.wrap_callback eligibilite_allocation_logement + + method calculAllocationLogement : (calcul_allocation_logement_in Js.t -> calcul_allocation_logement_out Js.t) Js.callback = + Js.wrap_callback calcul_allocation_logement + + method calculetteAidesAuLogement : (calculette_aides_au_logement_in Js.t -> calculette_aides_au_logement_out Js.t) Js.callback = + Js.wrap_callback calculette_aides_au_logement + + method calculetteAidesAuLogementGardeAlternee : (calculette_aides_au_logement_garde_alternee_in Js.t -> calculette_aides_au_logement_garde_alternee_out Js.t) Js.callback = + Js.wrap_callback calculette_aides_au_logement_garde_alternee + + end) \ No newline at end of file diff --git a/french_law/ocaml/law_source/allocations_familiales.ml b/french_law/ocaml/law_source/allocations_familiales.ml index 558964b0..9e002d7b 100644 --- a/french_law/ocaml/law_source/allocations_familiales.ml +++ b/french_law/ocaml/law_source/allocations_familiales.ml @@ -1,7819 +1,5144 @@ (** This file has been generated by the Catala compiler, do not edit! *) -open Runtime +open Runtime_ocaml.Runtime [@@@ocaml.warning "-4-26-27-32-41-42"] -type prise_en_charge = - | GardeAlterneePartageAllocations of unit - | GardeAlterneeAllocataireUnique of unit - | EffectiveEtPermanente of unit - | ServicesSociauxAllocationVerseeALaFamille of unit - | ServicesSociauxAllocationVerseeAuxServicesSociaux of unit +module PriseEnCharge = struct -let embed_prise_en_charge (x : prise_en_charge) : runtime_value = - Enum - ( ["PriseEnCharge"], - match x with - | GardeAlterneePartageAllocations x -> - "GardeAlternéePartageAllocations", embed_unit x - | GardeAlterneeAllocataireUnique x -> - "GardeAlternéeAllocataireUnique", embed_unit x - | EffectiveEtPermanente x -> "EffectiveEtPermanente", embed_unit x - | ServicesSociauxAllocationVerseeALaFamille x -> - "ServicesSociauxAllocationVerséeÀLaFamille", embed_unit x - | ServicesSociauxAllocationVerseeAuxServicesSociaux x -> - "ServicesSociauxAllocationVerséeAuxServicesSociaux", embed_unit x ) + type t = + | GardeAlterneePartageAllocations of unit + | GardeAlterneeAllocataireUnique of unit + | EffectiveEtPermanente of unit + | ServicesSociauxAllocationVerseeALaFamille of unit + | ServicesSociauxAllocationVerseeAuxServicesSociaux of unit + end +let embed_prise_en_charge (x: PriseEnCharge.t) : runtime_value = + Enum(["PriseEnCharge"], + match x with + | GardeAlterneePartageAllocations x -> + ("GardeAlternéePartageAllocations", embed_unit x) + | GardeAlterneeAllocataireUnique x -> + ("GardeAlternéeAllocataireUnique", embed_unit x) + | EffectiveEtPermanente x -> ("EffectiveEtPermanente", embed_unit x) + | ServicesSociauxAllocationVerseeALaFamille x -> + ("ServicesSociauxAllocationVerséeÀLaFamille", embed_unit x) + | ServicesSociauxAllocationVerseeAuxServicesSociaux x -> + ("ServicesSociauxAllocationVerséeAuxServicesSociaux", embed_unit x)) -type situation_obligation_scolaire = - | Avant of unit - | Pendant of unit - | Apres of unit -let embed_situation_obligation_scolaire (x : situation_obligation_scolaire) : - runtime_value = - Enum - ( ["SituationObligationScolaire"], - match x with - | Avant x -> "Avant", embed_unit x - | Pendant x -> "Pendant", embed_unit x - | Apres x -> "Après", embed_unit x ) +module SituationObligationScolaire = struct + type t = + | Avant of unit + | Pendant of unit + | Apres of unit + end +let embed_situation_obligation_scolaire (x: SituationObligationScolaire.t) + : runtime_value = + Enum(["SituationObligationScolaire"], + match x with + | Avant x -> ("Avant", embed_unit x) + | Pendant x -> ("Pendant", embed_unit x) + | Apres x -> ("Après", embed_unit x)) -type prise_en_compte = Complete of unit | Partagee of unit | Zero of unit -let embed_prise_en_compte (x : prise_en_compte) : runtime_value = - Enum - ( ["PriseEnCompte"], - match x with - | Complete x -> "Complète", embed_unit x - | Partagee x -> "Partagée", embed_unit x - | Zero x -> "Zéro", embed_unit x ) +module PriseEnCompte = struct + type t = + | Complete of unit + | Partagee of unit + | Zero of unit + end +let embed_prise_en_compte (x: PriseEnCompte.t) : runtime_value = + Enum(["PriseEnCompte"], + match x with + | Complete x -> ("Complète", embed_unit x) + | Partagee x -> ("Partagée", embed_unit x) + | Zero x -> ("Zéro", embed_unit x)) -type versement_allocations = - | Normal of unit - | AllocationVerseeAuxServicesSociaux of unit -let embed_versement_allocations (x : versement_allocations) : runtime_value = - Enum - ( ["VersementAllocations"], - match x with - | Normal x -> "Normal", embed_unit x - | AllocationVerseeAuxServicesSociaux x -> - "AllocationVerséeAuxServicesSociaux", embed_unit x ) +module VersementAllocations = struct + type t = + | Normal of unit + | AllocationVerseeAuxServicesSociaux of unit + end +let embed_versement_allocations (x: VersementAllocations.t) : runtime_value = + Enum(["VersementAllocations"], + match x with + | Normal x -> ("Normal", embed_unit x) + | AllocationVerseeAuxServicesSociaux x -> + ("AllocationVerséeAuxServicesSociaux", embed_unit x)) -type element_prestations_familiales = - | PrestationAccueilJeuneEnfant of unit - | AllocationsFamiliales of unit - | ComplementFamilial of unit - | AllocationLogement of unit - | AllocationEducationEnfantHandicape of unit - | AllocationSoutienFamilial of unit - | AllocationRentreeScolaire of unit - | AllocationJournalierePresenceParentale of unit -let embed_element_prestations_familiales (x : element_prestations_familiales) : - runtime_value = - Enum - ( ["ÉlémentPrestationsFamiliales"], - match x with - | PrestationAccueilJeuneEnfant x -> - "PrestationAccueilJeuneEnfant", embed_unit x - | AllocationsFamiliales x -> "AllocationsFamiliales", embed_unit x - | ComplementFamilial x -> "ComplémentFamilial", embed_unit x - | AllocationLogement x -> "AllocationLogement", embed_unit x - | AllocationEducationEnfantHandicape x -> - "AllocationÉducationEnfantHandicapé", embed_unit x - | AllocationSoutienFamilial x -> "AllocationSoutienFamilial", embed_unit x - | AllocationRentreeScolaire x -> "AllocationRentréeScolaire", embed_unit x - | AllocationJournalierePresenceParentale x -> - "AllocationJournalièrePresenceParentale", embed_unit x ) +module ElementPrestationsFamiliales = struct -type collectivite = - | Guadeloupe of unit - | Guyane of unit - | Martinique of unit - | LaReunion of unit - | SaintBarthelemy of unit - | SaintMartin of unit - | Metropole of unit - | SaintPierreEtMiquelon of unit - | Mayotte of unit + type t = + | PrestationAccueilJeuneEnfant of unit + | AllocationsFamiliales of unit + | ComplementFamilial of unit + | AllocationLogement of unit + | AllocationEducationEnfantHandicape of unit + | AllocationSoutienFamilial of unit + | AllocationRentreeScolaire of unit + | AllocationJournalierePresenceParentale of unit + end +let embed_element_prestations_familiales (x: ElementPrestationsFamiliales.t) + : runtime_value = + Enum(["ÉlémentPrestationsFamiliales"], + match x with + | PrestationAccueilJeuneEnfant x -> + ("PrestationAccueilJeuneEnfant", embed_unit x) + | AllocationsFamiliales x -> ("AllocationsFamiliales", embed_unit x) + | ComplementFamilial x -> ("ComplémentFamilial", embed_unit x) + | AllocationLogement x -> ("AllocationLogement", embed_unit x) + | AllocationEducationEnfantHandicape x -> + ("AllocationÉducationEnfantHandicapé", embed_unit x) + | AllocationSoutienFamilial x -> + ("AllocationSoutienFamilial", embed_unit x) + | AllocationRentreeScolaire x -> + ("AllocationRentréeScolaire", embed_unit x) + | AllocationJournalierePresenceParentale x -> + ("AllocationJournalièrePresenceParentale", embed_unit x)) + + +module Collectivite = struct + + type t = + | Guadeloupe of unit + | Guyane of unit + | Martinique of unit + | LaReunion of unit + | SaintBarthelemy of unit + | SaintMartin of unit + | Metropole of unit + | SaintPierreEtMiquelon of unit + | Mayotte of unit + end +let embed_collectivite (x: Collectivite.t) : runtime_value = + Enum(["Collectivité"], + match x with + | Guadeloupe x -> ("Guadeloupe", embed_unit x) + | Guyane x -> ("Guyane", embed_unit x) + | Martinique x -> ("Martinique", embed_unit x) + | LaReunion x -> ("LaRéunion", embed_unit x) + | SaintBarthelemy x -> ("SaintBarthélemy", embed_unit x) + | SaintMartin x -> ("SaintMartin", embed_unit x) + | Metropole x -> ("Métropole", embed_unit x) + | SaintPierreEtMiquelon x -> ("SaintPierreEtMiquelon", embed_unit x) + | Mayotte x -> ("Mayotte", embed_unit x)) -let embed_collectivite (x : collectivite) : runtime_value = - Enum - ( ["Collectivité"], - match x with - | Guadeloupe x -> "Guadeloupe", embed_unit x - | Guyane x -> "Guyane", embed_unit x - | Martinique x -> "Martinique", embed_unit x - | LaReunion x -> "LaRéunion", embed_unit x - | SaintBarthelemy x -> "SaintBarthélemy", embed_unit x - | SaintMartin x -> "SaintMartin", embed_unit x - | Metropole x -> "Métropole", embed_unit x - | SaintPierreEtMiquelon x -> "SaintPierreEtMiquelon", embed_unit x - | Mayotte x -> "Mayotte", embed_unit x ) module EnfantEntree = struct type t = { - d_identifiant : integer; - d_remuneration_mensuelle : money; - d_date_de_naissance : date; - d_prise_en_charge : prise_en_charge; - d_a_deja_ouvert_droit_aux_allocations_familiales : bool; - d_beneficie_titre_personnel_aide_personnelle_logement : bool; + d_identifiant: integer; + d_remuneration_mensuelle: money; + d_date_de_naissance: date; + d_prise_en_charge: PriseEnCharge.t; + d_a_deja_ouvert_droit_aux_allocations_familiales: bool; + d_beneficie_titre_personnel_aide_personnelle_logement: bool } end +let embed_enfant_entree (x: EnfantEntree.t) : runtime_value = + Struct(["EnfantEntrée"], + [("d_identifiant", embed_integer + x.EnfantEntree.d_identifiant); + ("d_rémuneration_mensuelle", embed_money + x.EnfantEntree.d_remuneration_mensuelle); + ("d_date_de_naissance", embed_date + x.EnfantEntree.d_date_de_naissance); + ("d_prise_en_charge", embed_prise_en_charge + x.EnfantEntree.d_prise_en_charge); + ("d_a_déjà_ouvert_droit_aux_allocations_familiales", embed_bool + x.EnfantEntree.d_a_deja_ouvert_droit_aux_allocations_familiales); + ("d_bénéficie_titre_personnel_aide_personnelle_logement", embed_bool + x.EnfantEntree.d_beneficie_titre_personnel_aide_personnelle_logement)]) -let embed_enfant_entree (x : EnfantEntree.t) : runtime_value = - Struct - ( ["EnfantEntrée"], - [ - "d_identifiant", embed_integer x.EnfantEntree.d_identifiant; - ( "d_rémuneration_mensuelle", - embed_money x.EnfantEntree.d_remuneration_mensuelle ); - "d_date_de_naissance", embed_date x.EnfantEntree.d_date_de_naissance; - ( "d_prise_en_charge", - embed_prise_en_charge x.EnfantEntree.d_prise_en_charge ); - ( "d_a_déjà_ouvert_droit_aux_allocations_familiales", - embed_bool - x.EnfantEntree.d_a_deja_ouvert_droit_aux_allocations_familiales ); - ( "d_bénéficie_titre_personnel_aide_personnelle_logement", - embed_bool - x.EnfantEntree.d_beneficie_titre_personnel_aide_personnelle_logement - ); - ] ) module Enfant = struct type t = { - identifiant : integer; - obligation_scolaire : situation_obligation_scolaire; - remuneration_mensuelle : money; - date_de_naissance : date; - age : integer; - prise_en_charge : prise_en_charge; - a_deja_ouvert_droit_aux_allocations_familiales : bool; - beneficie_titre_personnel_aide_personnelle_logement : bool; + identifiant: integer; + obligation_scolaire: SituationObligationScolaire.t; + remuneration_mensuelle: money; + date_de_naissance: date; + age: integer; + prise_en_charge: PriseEnCharge.t; + a_deja_ouvert_droit_aux_allocations_familiales: bool; + beneficie_titre_personnel_aide_personnelle_logement: bool } end +let embed_enfant (x: Enfant.t) : runtime_value = Struct(["Enfant"], + [("identifiant", embed_integer + x.Enfant.identifiant); + ("obligation_scolaire", embed_situation_obligation_scolaire + x.Enfant.obligation_scolaire); + ("rémuneration_mensuelle", embed_money + x.Enfant.remuneration_mensuelle); + ("date_de_naissance", embed_date x.Enfant.date_de_naissance); + ("âge", embed_integer x.Enfant.age); + ("prise_en_charge", embed_prise_en_charge + x.Enfant.prise_en_charge); + ("a_déjà_ouvert_droit_aux_allocations_familiales", embed_bool + x.Enfant.a_deja_ouvert_droit_aux_allocations_familiales); + ("bénéficie_titre_personnel_aide_personnelle_logement", embed_bool + x.Enfant.beneficie_titre_personnel_aide_personnelle_logement)]) -let embed_enfant (x : Enfant.t) : runtime_value = - Struct - ( ["Enfant"], - [ - "identifiant", embed_integer x.Enfant.identifiant; - ( "obligation_scolaire", - embed_situation_obligation_scolaire x.Enfant.obligation_scolaire ); - "rémuneration_mensuelle", embed_money x.Enfant.remuneration_mensuelle; - "date_de_naissance", embed_date x.Enfant.date_de_naissance; - "âge", embed_integer x.Enfant.age; - "prise_en_charge", embed_prise_en_charge x.Enfant.prise_en_charge; - ( "a_déjà_ouvert_droit_aux_allocations_familiales", - embed_bool x.Enfant.a_deja_ouvert_droit_aux_allocations_familiales ); - ( "bénéficie_titre_personnel_aide_personnelle_logement", - embed_bool - x.Enfant.beneficie_titre_personnel_aide_personnelle_logement ); - ] ) module PrestationsFamilialesOut = struct type t = { - droit_ouvert_out : Enfant.t -> bool; - conditions_hors_age_out : Enfant.t -> bool; - age_l512_3_2_out : integer; - regime_outre_mer_l751_1_out : bool; + droit_ouvert_out: Enfant.t -> bool; + conditions_hors_age_out: Enfant.t -> bool; + age_l512_3_2_out: integer; + regime_outre_mer_l751_1_out: bool } end +let embed_prestations_familiales_out (x: PrestationsFamilialesOut.t) : runtime_value = + Struct(["PrestationsFamiliales_out"], + [("droit_ouvert_out", unembeddable + x.PrestationsFamilialesOut.droit_ouvert_out); + ("conditions_hors_âge_out", unembeddable + x.PrestationsFamilialesOut.conditions_hors_age_out); + ("âge_l512_3_2_out", embed_integer + x.PrestationsFamilialesOut.age_l512_3_2_out); + ("régime_outre_mer_l751_1_out", embed_bool + x.PrestationsFamilialesOut.regime_outre_mer_l751_1_out)]) -let embed_prestations_familiales_out (x : PrestationsFamilialesOut.t) : - runtime_value = - Struct - ( ["PrestationsFamiliales_out"], - [ - ( "droit_ouvert_out", - unembeddable x.PrestationsFamilialesOut.droit_ouvert_out ); - ( "conditions_hors_âge_out", - unembeddable x.PrestationsFamilialesOut.conditions_hors_age_out ); - ( "âge_l512_3_2_out", - embed_integer x.PrestationsFamilialesOut.age_l512_3_2_out ); - ( "régime_outre_mer_l751_1_out", - embed_bool x.PrestationsFamilialesOut.regime_outre_mer_l751_1_out ); - ] ) module PrestationsFamilialesIn = struct type t = { - date_courante_in : date; - prestation_courante_in : element_prestations_familiales; - residence_in : collectivite; + date_courante_in: date; + prestation_courante_in: ElementPrestationsFamiliales.t; + residence_in: Collectivite.t } end +let embed_prestations_familiales_in (x: PrestationsFamilialesIn.t) : runtime_value = + Struct(["PrestationsFamiliales_in"], + [("date_courante_in", embed_date + x.PrestationsFamilialesIn.date_courante_in); + ("prestation_courante_in", embed_element_prestations_familiales + x.PrestationsFamilialesIn.prestation_courante_in); + ("résidence_in", embed_collectivite + x.PrestationsFamilialesIn.residence_in)]) -let embed_prestations_familiales_in (x : PrestationsFamilialesIn.t) : - runtime_value = - Struct - ( ["PrestationsFamiliales_in"], - [ - "date_courante_in", embed_date x.PrestationsFamilialesIn.date_courante_in; - ( "prestation_courante_in", - embed_element_prestations_familiales - x.PrestationsFamilialesIn.prestation_courante_in ); - ( "résidence_in", - embed_collectivite x.PrestationsFamilialesIn.residence_in ); - ] ) module AllocationFamilialesAvril2008Out = struct - type t = { age_minimum_alinea_1_l521_3_out : integer } + type t = {age_minimum_alinea_1_l521_3_out: integer} end +let embed_allocation_familiales_avril2008_out (x: AllocationFamilialesAvril2008Out.t) : runtime_value = + Struct(["AllocationFamilialesAvril2008_out"], + [("âge_minimum_alinéa_1_l521_3_out", embed_integer + x.AllocationFamilialesAvril2008Out.age_minimum_alinea_1_l521_3_out)]) -let embed_allocation_familiales_avril2008_out - (x : AllocationFamilialesAvril2008Out.t) : runtime_value = - Struct - ( ["AllocationFamilialesAvril2008_out"], - [ - ( "âge_minimum_alinéa_1_l521_3_out", - embed_integer - x.AllocationFamilialesAvril2008Out.age_minimum_alinea_1_l521_3_out ); - ] ) module AllocationFamilialesAvril2008In = struct type t = unit end +let embed_allocation_familiales_avril2008_in (_: AllocationFamilialesAvril2008In.t) : runtime_value = Unit -let embed_allocation_familiales_avril2008_in - (_ : AllocationFamilialesAvril2008In.t) : runtime_value = - Unit module EnfantLePlusAgeOut = struct - type t = { le_plus_age_out : Enfant.t } + type t = {le_plus_age_out: Enfant.t} end +let embed_enfant_le_plus_age_out (x: EnfantLePlusAgeOut.t) : runtime_value = + Struct(["EnfantLePlusÂgé_out"], + [("le_plus_âgé_out", embed_enfant x.EnfantLePlusAgeOut.le_plus_age_out)]) -let embed_enfant_le_plus_age_out (x : EnfantLePlusAgeOut.t) : runtime_value = - Struct - ( ["EnfantLePlusÂgé_out"], - ["le_plus_âgé_out", embed_enfant x.EnfantLePlusAgeOut.le_plus_age_out] ) module EnfantLePlusAgeIn = struct - type t = { enfants_in : Enfant.t array } + type t = {enfants_in: Enfant.t array} end +let embed_enfant_le_plus_age_in (x: EnfantLePlusAgeIn.t) : runtime_value = + Struct(["EnfantLePlusÂgé_in"], + [("enfants_in", embed_array (embed_enfant) x.EnfantLePlusAgeIn.enfants_in)]) -let embed_enfant_le_plus_age_in (x : EnfantLePlusAgeIn.t) : runtime_value = - Struct - ( ["EnfantLePlusÂgé_in"], - ["enfants_in", embed_array embed_enfant x.EnfantLePlusAgeIn.enfants_in] ) module AllocationsFamilialesOut = struct - type t = { montant_verse_out : money } + type t = {montant_verse_out: money} end +let embed_allocations_familiales_out (x: AllocationsFamilialesOut.t) : runtime_value = + Struct(["AllocationsFamiliales_out"], + [("montant_versé_out", embed_money + x.AllocationsFamilialesOut.montant_verse_out)]) -let embed_allocations_familiales_out (x : AllocationsFamilialesOut.t) : - runtime_value = - Struct - ( ["AllocationsFamiliales_out"], - [ - ( "montant_versé_out", - embed_money x.AllocationsFamilialesOut.montant_verse_out ); - ] ) module AllocationsFamilialesIn = struct type t = { - personne_charge_effective_permanente_est_parent_in : bool; - personne_charge_effective_permanente_remplit_titre_I_in : bool; - ressources_menage_in : money; - residence_in : collectivite; - date_courante_in : date; - enfants_a_charge_in : Enfant.t array; - avait_enfant_a_charge_avant_1er_janvier_2012_in : bool; + personne_charge_effective_permanente_est_parent_in: bool; + personne_charge_effective_permanente_remplit_titre_I_in: bool; + ressources_menage_in: money; + residence_in: Collectivite.t; + date_courante_in: date; + enfants_a_charge_in: Enfant.t array; + avait_enfant_a_charge_avant_1er_janvier_2012_in: bool } end +let embed_allocations_familiales_in (x: AllocationsFamilialesIn.t) : runtime_value = + Struct(["AllocationsFamiliales_in"], + [("personne_charge_effective_permanente_est_parent_in", embed_bool + x.AllocationsFamilialesIn.personne_charge_effective_permanente_est_parent_in); + ("personne_charge_effective_permanente_remplit_titre_I_in", embed_bool + x.AllocationsFamilialesIn.personne_charge_effective_permanente_remplit_titre_I_in); + ("ressources_ménage_in", embed_money + x.AllocationsFamilialesIn.ressources_menage_in); + ("résidence_in", embed_collectivite + x.AllocationsFamilialesIn.residence_in); + ("date_courante_in", embed_date + x.AllocationsFamilialesIn.date_courante_in); + ("enfants_à_charge_in", embed_array (embed_enfant) + x.AllocationsFamilialesIn.enfants_a_charge_in); + ("avait_enfant_à_charge_avant_1er_janvier_2012_in", embed_bool + x.AllocationsFamilialesIn.avait_enfant_a_charge_avant_1er_janvier_2012_in)]) -let embed_allocations_familiales_in (x : AllocationsFamilialesIn.t) : - runtime_value = - Struct - ( ["AllocationsFamiliales_in"], - [ - ( "personne_charge_effective_permanente_est_parent_in", - embed_bool - x - .AllocationsFamilialesIn - .personne_charge_effective_permanente_est_parent_in ); - ( "personne_charge_effective_permanente_remplit_titre_I_in", - embed_bool - x - .AllocationsFamilialesIn - .personne_charge_effective_permanente_remplit_titre_I_in ); - ( "ressources_ménage_in", - embed_money x.AllocationsFamilialesIn.ressources_menage_in ); - ( "résidence_in", - embed_collectivite x.AllocationsFamilialesIn.residence_in ); - ( "date_courante_in", - embed_date x.AllocationsFamilialesIn.date_courante_in ); - ( "enfants_à_charge_in", - embed_array embed_enfant x.AllocationsFamilialesIn.enfants_a_charge_in - ); - ( "avait_enfant_à_charge_avant_1er_janvier_2012_in", - embed_bool - x - .AllocationsFamilialesIn - .avait_enfant_a_charge_avant_1er_janvier_2012_in ); - ] ) module SmicOut = struct - type t = { brut_horaire_out : money } + type t = {brut_horaire_out: money} end +let embed_smic_out (x: SmicOut.t) : runtime_value = Struct(["Smic_out"], + [("brut_horaire_out", embed_money x.SmicOut.brut_horaire_out)]) -let embed_smic_out (x : SmicOut.t) : runtime_value = - Struct - (["Smic_out"], ["brut_horaire_out", embed_money x.SmicOut.brut_horaire_out]) module SmicIn = struct - type t = { date_courante_in : date; residence_in : collectivite } + type t = {date_courante_in: date; residence_in: Collectivite.t} end +let embed_smic_in (x: SmicIn.t) : runtime_value = Struct(["Smic_in"], + [("date_courante_in", embed_date + x.SmicIn.date_courante_in); + ("résidence_in", embed_collectivite x.SmicIn.residence_in)]) -let embed_smic_in (x : SmicIn.t) : runtime_value = - Struct - ( ["Smic_in"], - [ - "date_courante_in", embed_date x.SmicIn.date_courante_in; - "résidence_in", embed_collectivite x.SmicIn.residence_in; - ] ) module BaseMensuelleAllocationsFamilialesOut = struct - type t = { montant_out : money } + type t = {montant_out: money} end +let embed_base_mensuelle_allocations_familiales_out (x: BaseMensuelleAllocationsFamilialesOut.t) : runtime_value = + Struct(["BaseMensuelleAllocationsFamiliales_out"], + [("montant_out", embed_money + x.BaseMensuelleAllocationsFamilialesOut.montant_out)]) -let embed_base_mensuelle_allocations_familiales_out - (x : BaseMensuelleAllocationsFamilialesOut.t) : runtime_value = - Struct - ( ["BaseMensuelleAllocationsFamiliales_out"], - [ - ( "montant_out", - embed_money x.BaseMensuelleAllocationsFamilialesOut.montant_out ); - ] ) module BaseMensuelleAllocationsFamilialesIn = struct - type t = { date_courante_in : date } + type t = {date_courante_in: date} end +let embed_base_mensuelle_allocations_familiales_in (x: BaseMensuelleAllocationsFamilialesIn.t) : runtime_value = + Struct(["BaseMensuelleAllocationsFamiliales_in"], + [("date_courante_in", embed_date + x.BaseMensuelleAllocationsFamilialesIn.date_courante_in)]) -let embed_base_mensuelle_allocations_familiales_in - (x : BaseMensuelleAllocationsFamilialesIn.t) : runtime_value = - Struct - ( ["BaseMensuelleAllocationsFamiliales_in"], - [ - ( "date_courante_in", - embed_date x.BaseMensuelleAllocationsFamilialesIn.date_courante_in ); - ] ) module InterfaceAllocationsFamilialesOut = struct - type t = { i_montant_verse_out : money } + type t = {i_montant_verse_out: money} end +let embed_interface_allocations_familiales_out (x: InterfaceAllocationsFamilialesOut.t) : runtime_value = + Struct(["InterfaceAllocationsFamiliales_out"], + [("i_montant_versé_out", embed_money + x.InterfaceAllocationsFamilialesOut.i_montant_verse_out)]) -let embed_interface_allocations_familiales_out - (x : InterfaceAllocationsFamilialesOut.t) : runtime_value = - Struct - ( ["InterfaceAllocationsFamiliales_out"], - [ - ( "i_montant_versé_out", - embed_money x.InterfaceAllocationsFamilialesOut.i_montant_verse_out ); - ] ) module InterfaceAllocationsFamilialesIn = struct type t = { - i_date_courante_in : date; - i_enfants_in : EnfantEntree.t array; - i_ressources_menage_in : money; - i_residence_in : collectivite; - i_personne_charge_effective_permanente_est_parent_in : bool; - i_personne_charge_effective_permanente_remplit_titre_I_in : bool; - i_avait_enfant_a_charge_avant_1er_janvier_2012_in : bool; + i_date_courante_in: date; + i_enfants_in: EnfantEntree.t array; + i_ressources_menage_in: money; + i_residence_in: Collectivite.t; + i_personne_charge_effective_permanente_est_parent_in: bool; + i_personne_charge_effective_permanente_remplit_titre_I_in: bool; + i_avait_enfant_a_charge_avant_1er_janvier_2012_in: bool } end +let embed_interface_allocations_familiales_in (x: InterfaceAllocationsFamilialesIn.t) : runtime_value = + Struct(["InterfaceAllocationsFamiliales_in"], + [("i_date_courante_in", embed_date + x.InterfaceAllocationsFamilialesIn.i_date_courante_in); + ("i_enfants_in", embed_array (embed_enfant_entree) + x.InterfaceAllocationsFamilialesIn.i_enfants_in); + ("i_ressources_ménage_in", embed_money + x.InterfaceAllocationsFamilialesIn.i_ressources_menage_in); + ("i_résidence_in", embed_collectivite + x.InterfaceAllocationsFamilialesIn.i_residence_in); + ("i_personne_charge_effective_permanente_est_parent_in", embed_bool + x.InterfaceAllocationsFamilialesIn.i_personne_charge_effective_permanente_est_parent_in); + ("i_personne_charge_effective_permanente_remplit_titre_I_in", embed_bool + x.InterfaceAllocationsFamilialesIn.i_personne_charge_effective_permanente_remplit_titre_I_in); + ("i_avait_enfant_à_charge_avant_1er_janvier_2012_in", embed_bool + x.InterfaceAllocationsFamilialesIn.i_avait_enfant_a_charge_avant_1er_janvier_2012_in)]) -let embed_interface_allocations_familiales_in - (x : InterfaceAllocationsFamilialesIn.t) : runtime_value = - Struct - ( ["InterfaceAllocationsFamiliales_in"], - [ - ( "i_date_courante_in", - embed_date x.InterfaceAllocationsFamilialesIn.i_date_courante_in ); - ( "i_enfants_in", - embed_array embed_enfant_entree - x.InterfaceAllocationsFamilialesIn.i_enfants_in ); - ( "i_ressources_ménage_in", - embed_money x.InterfaceAllocationsFamilialesIn.i_ressources_menage_in - ); - ( "i_résidence_in", - embed_collectivite x.InterfaceAllocationsFamilialesIn.i_residence_in ); - ( "i_personne_charge_effective_permanente_est_parent_in", - embed_bool - x - .InterfaceAllocationsFamilialesIn - .i_personne_charge_effective_permanente_est_parent_in ); - ( "i_personne_charge_effective_permanente_remplit_titre_I_in", - embed_bool - x - .InterfaceAllocationsFamilialesIn - .i_personne_charge_effective_permanente_remplit_titre_I_in ); - ( "i_avait_enfant_à_charge_avant_1er_janvier_2012_in", - embed_bool - x - .InterfaceAllocationsFamilialesIn - .i_avait_enfant_a_charge_avant_1er_janvier_2012_in ); - ] ) -let allocation_familiales_avril2008 - (allocation_familiales_avril2008_in : AllocationFamilialesAvril2008In.t) : - AllocationFamilialesAvril2008Out.t = - let age_minimum_alinea_1_l521_3_ : integer = - log_variable_definition - ["AllocationFamilialesAvril2008"; "âge_minimum_alinéa_1_l521_3"] - embed_integer - (try - handle_default - [| - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./securite_sociale_R.catala_fr"; - start_line = 78; - start_column = 14; - end_line = 78; - end_column = 41; - law_headings = - [ - "Article R521-1"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et prestations \ - assimilées"; - "Partie réglementaire - Décrets en Conseil d'Etat"; - "Code de la sécurité sociale"; - ]; - } - true) - (fun (_ : _) -> integer_of_string "16")); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./prologue.catala_fr"; - start_line = 77; - start_column = 46; - end_line = 77; - end_column = 52; - law_headings = - [ - "Allocations familiales"; - "Champs d'applications"; - "Prologue"; - ]; - } - false) - (fun (_ : _) -> raise EmptyError) - with EmptyError -> - raise - (NoValueProvided - { - filename = "./prologue.catala_fr"; - start_line = 77; - start_column = 10; - end_line = 77; - end_column = 37; - law_headings = - [ - "Allocations familiales"; "Champs d'applications"; "Prologue"; - ]; - })) - in - { - AllocationFamilialesAvril2008Out.age_minimum_alinea_1_l521_3_out = - age_minimum_alinea_1_l521_3_; - } -let enfant_le_plus_age (enfant_le_plus_age_in : EnfantLePlusAgeIn.t) : - EnfantLePlusAgeOut.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 - (try - handle_default - [| - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./epilogue.catala_fr"; - start_line = 12; - start_column = 14; - end_line = 12; - end_column = 25; - law_headings = ["Règles diverses"; "Épilogue"]; - } - true) - (fun (_ : _) -> - let predicate_ : _ = - fun (potentiel_plus_age_ : _) -> - potentiel_plus_age_.Enfant.age - in - Array.fold_left - (fun (acc_ : _) (item_ : _) -> - if predicate_ acc_ >! predicate_ item_ then acc_ - else item_) - { - Enfant.identifiant = ~-!(integer_of_string "1"); - Enfant.obligation_scolaire = Pendant (); - Enfant.remuneration_mensuelle = money_of_cents_string "0"; - Enfant.date_de_naissance = date_of_numbers 1900 1 1; - Enfant.age = integer_of_string "0"; - Enfant.prise_en_charge = EffectiveEtPermanente (); - Enfant.a_deja_ouvert_droit_aux_allocations_familiales = - false; - Enfant - .beneficie_titre_personnel_aide_personnelle_logement = - false; - } - enfants_)); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./prologue.catala_fr"; - start_line = 81; - start_column = 30; - end_line = 81; - end_column = 36; - law_headings = - [ - "Allocations familiales"; - "Champs d'applications"; - "Prologue"; - ]; - } - false) - (fun (_ : _) -> raise EmptyError) - with EmptyError -> - raise - (NoValueProvided - { - filename = "./prologue.catala_fr"; - start_line = 81; - start_column = 10; - end_line = 81; - end_column = 21; - law_headings = - [ - "Allocations familiales"; "Champs d'applications"; "Prologue"; - ]; - })) - in - { EnfantLePlusAgeOut.le_plus_age_out = le_plus_age_ } -let smic (smic_in : SmicIn.t) : SmicOut.t = - let date_courante_ : date = smic_in.SmicIn.date_courante_in in - let residence_ : collectivite = smic_in.SmicIn.residence_in in - let brut_horaire_ : money = - log_variable_definition ["Smic"; "brut_horaire"] embed_money - (try - handle_default - [| - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./../smic/smic.catala_fr"; - start_line = 204; - start_column = 5; - end_line = 206; - end_column = 6; - law_headings = - [ - "Article 2"; - "Arrêté du 19 avril 2022 relatif au relèvement du \ - salaire minimum de croissance"; - "Montant du salaire minimum de croissance"; - ]; - } - (date_courante_ >=@ date_of_numbers 2022 5 1 - && date_courante_ <=@ date_of_numbers 2022 12 31 - && residence_ = Mayotte ())) - (fun (_ : _) -> money_of_cents_string "819")); - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./../smic/smic.catala_fr"; - start_line = 186; - start_column = 5; - end_line = 195; - end_column = 6; - law_headings = - [ - "Article 2"; - "Arrêté du 19 avril 2022 relatif au relèvement du \ - salaire minimum de croissance"; - "Montant du salaire minimum de croissance"; - ]; - } - (date_courante_ >=@ date_of_numbers 2022 5 1 - && date_courante_ <=@ date_of_numbers 2022 12 31 - && (residence_ = Metropole () || residence_ = Guadeloupe () - || residence_ = Guyane () || residence_ = Martinique () - || residence_ = LaReunion () - || residence_ = SaintBarthelemy () - || residence_ = SaintMartin () - || residence_ = SaintPierreEtMiquelon ()))) - (fun (_ : _) -> money_of_cents_string "1085")); - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./../smic/smic.catala_fr"; - start_line = 165; - start_column = 5; - end_line = 167; - end_column = 6; - law_headings = - [ - "Article 1"; - "Décret n° 2021-1741 du 22 décembre 2021 portant \ - relèvement du salaire minimum de croissance"; - "Montant du salaire minimum de croissance"; - ]; - } - (date_courante_ >=@ date_of_numbers 2022 1 1 - && date_courante_ <=@ date_of_numbers 2022 4 30 - && residence_ = Mayotte ())) - (fun (_ : _) -> money_of_cents_string "798")); - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./../smic/smic.catala_fr"; - start_line = 146; - start_column = 5; - end_line = 155; - end_column = 6; - law_headings = - [ - "Article 1"; - "Décret n° 2021-1741 du 22 décembre 2021 portant \ - relèvement du salaire minimum de croissance"; - "Montant du salaire minimum de croissance"; - ]; - } - (date_courante_ >=@ date_of_numbers 2022 1 1 - && date_courante_ <=@ date_of_numbers 2022 4 30 - && (residence_ = Metropole () || residence_ = Guadeloupe () - || residence_ = Guyane () || residence_ = Martinique () - || residence_ = LaReunion () - || residence_ = SaintBarthelemy () - || residence_ = SaintMartin () - || residence_ = SaintPierreEtMiquelon ()))) - (fun (_ : _) -> money_of_cents_string "1057")); - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./../smic/smic.catala_fr"; - start_line = 125; - start_column = 5; - end_line = 127; - end_column = 6; - law_headings = - [ - "Article 1"; - "Décret n° 2020-1598 du 16 décembre 2020 portant \ - relèvement du salaire minimum de croissance"; - "Montant du salaire minimum de croissance"; - ]; - } - (date_courante_ >=@ date_of_numbers 2021 1 1 - && date_courante_ <=@ date_of_numbers 2021 12 31 - && residence_ = Mayotte ())) - (fun (_ : _) -> money_of_cents_string "774")); - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./../smic/smic.catala_fr"; - start_line = 107; - start_column = 5; - end_line = 116; - end_column = 6; - law_headings = - [ - "Article 1"; - "Décret n° 2020-1598 du 16 décembre 2020 portant \ - relèvement du salaire minimum de croissance"; - "Montant du salaire minimum de croissance"; - ]; - } - (date_courante_ >=@ date_of_numbers 2021 1 1 - && date_courante_ <=@ date_of_numbers 2021 12 31 - && (residence_ = Metropole () || residence_ = Guadeloupe () - || residence_ = Guyane () || residence_ = Martinique () - || residence_ = LaReunion () - || residence_ = SaintBarthelemy () - || residence_ = SaintMartin () - || residence_ = SaintPierreEtMiquelon ()))) - (fun (_ : _) -> money_of_cents_string "1025")); - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./../smic/smic.catala_fr"; - start_line = 86; - start_column = 5; - end_line = 88; - end_column = 6; - law_headings = - [ - "Article 1"; - "Décret n° 2019-1387 du 18 décembre 2019 portant \ - relèvement du salaire minimum de croissance"; - "Montant du salaire minimum de croissance"; - ]; - } - (date_courante_ >=@ date_of_numbers 2020 1 1 - && date_courante_ <=@ date_of_numbers 2020 12 31 - && residence_ = Mayotte ())) - (fun (_ : _) -> money_of_cents_string "766")); - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./../smic/smic.catala_fr"; - start_line = 68; - start_column = 5; - end_line = 77; - end_column = 6; - law_headings = - [ - "Article 1"; - "Décret n° 2019-1387 du 18 décembre 2019 portant \ - relèvement du salaire minimum de croissance"; - "Montant du salaire minimum de croissance"; - ]; - } - (date_courante_ >=@ date_of_numbers 2020 1 1 - && date_courante_ <=@ date_of_numbers 2020 12 31 - && (residence_ = Metropole () || residence_ = Guadeloupe () - || residence_ = Guyane () || residence_ = Martinique () - || residence_ = LaReunion () - || residence_ = SaintBarthelemy () - || residence_ = SaintMartin () - || residence_ = SaintPierreEtMiquelon ()))) - (fun (_ : _) -> money_of_cents_string "1015")); - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./../smic/smic.catala_fr"; - start_line = 47; - start_column = 5; - end_line = 49; - end_column = 6; - law_headings = - [ - "Article 1"; - "Décret n° 2018-1173 du 19 décembre 2018 portant \ - relèvement du salaire minimum de croissance"; - "Montant du salaire minimum de croissance"; - ]; - } - (date_courante_ >=@ date_of_numbers 2019 1 1 - && date_courante_ <=@ date_of_numbers 2019 12 31 - && residence_ = Mayotte ())) - (fun (_ : _) -> money_of_cents_string "757")); - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./../smic/smic.catala_fr"; - start_line = 29; - start_column = 5; - end_line = 38; - end_column = 6; - law_headings = - [ - "Article 1"; - "Décret n° 2018-1173 du 19 décembre 2018 portant \ - relèvement du salaire minimum de croissance"; - "Montant du salaire minimum de croissance"; - ]; - } - (date_courante_ >=@ date_of_numbers 2019 1 1 - && date_courante_ <=@ date_of_numbers 2019 12 31 - && (residence_ = Metropole () || residence_ = Guadeloupe () - || residence_ = Guyane () || residence_ = Martinique () - || residence_ = LaReunion () - || residence_ = SaintBarthelemy () - || residence_ = SaintMartin () - || residence_ = SaintPierreEtMiquelon ()))) - (fun (_ : _) -> money_of_cents_string "1003")); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./../smic/smic.catala_fr"; - start_line = 11; - start_column = 31; - end_line = 11; - end_column = 37; - law_headings = - ["Prologue"; "Montant du salaire minimum de croissance"]; - } - false) - (fun (_ : _) -> raise EmptyError) - with EmptyError -> - raise - (NoValueProvided - { - filename = "./../smic/smic.catala_fr"; - start_line = 11; - start_column = 10; - end_line = 11; - end_column = 22; - law_headings = - ["Prologue"; "Montant du salaire minimum de croissance"]; - })) - in - { SmicOut.brut_horaire_out = brut_horaire_ } - -let base_mensuelle_allocations_familiales - (base_mensuelle_allocations_familiales_in : - BaseMensuelleAllocationsFamilialesIn.t) : - BaseMensuelleAllocationsFamilialesOut.t = - let date_courante_ : date = - base_mensuelle_allocations_familiales_in - .BaseMensuelleAllocationsFamilialesIn.date_courante_in - in - let montant_ : money = - log_variable_definition - ["BaseMensuelleAllocationsFamiliales"; "montant"] - embed_money - (try - handle_default - [| - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = - "./../base_mensuelle_allocations_familiales/bmaf.catala_fr"; - start_line = 82; - start_column = 5; - end_line = 83; - end_column = 34; - law_headings = - [ - "Instruction interministérielle n°DSS/2B/2022/82 du \ - 28 mars 2022 relative à la revalorisation au 1er \ - avril 2022 des prestations familiales servies en \ - métropole, en Guadeloupe, en Guyane, en \ - Martinique, à la Réunion, à Saint-Barthélemy, à \ - Saint-Martin et dans le département de Mayotte"; - "Montant de la base mensuelle des allocations \ - familiales"; - ]; - } - (date_courante_ >=@ date_of_numbers 2022 4 1 - && date_courante_ <@ date_of_numbers 2023 4 1)) - (fun (_ : _) -> money_of_cents_string "42228")); - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = - "./../base_mensuelle_allocations_familiales/bmaf.catala_fr"; - start_line = 64; - start_column = 5; - end_line = 65; - end_column = 34; - law_headings = - [ - "Instruction interministérielle n°DSS/2B/2021/65 du \ - 19 mars 2021 relative à la revalorisation au 1er \ - avril 2021 des prestations familiales servies en \ - métropole, en Guadeloupe, en Guyane, en \ - Martinique, à la Réunion, à Saint-Barthélemy, à \ - Saint-Martin et dans le département de Mayotte"; - "Montant de la base mensuelle des allocations \ - familiales"; - ]; - } - (date_courante_ >=@ date_of_numbers 2021 4 1 - && date_courante_ <@ date_of_numbers 2022 4 1)) - (fun (_ : _) -> money_of_cents_string "41481")); - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = - "./../base_mensuelle_allocations_familiales/bmaf.catala_fr"; - start_line = 48; - start_column = 5; - end_line = 49; - end_column = 34; - law_headings = - [ - "Instruction interministérielle no DSS/SD2B/2020/33 \ - du 18 février 2020 relative à la revalorisation au \ - 1er avril 2020 des prestations familiales servies \ - en métropole, en Guadeloupe, en Guyane, en \ - Martinique, à La Réunion, à Saint-Barthélemy, à \ - Saint-Martin et dans le département de Mayotte"; - "Montant de la base mensuelle des allocations \ - familiales"; - ]; - } - (date_courante_ >=@ date_of_numbers 2020 4 1 - && date_courante_ <@ date_of_numbers 2021 4 1)) - (fun (_ : _) -> money_of_cents_string "41440")); - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = - "./../base_mensuelle_allocations_familiales/bmaf.catala_fr"; - start_line = 28; - start_column = 5; - end_line = 29; - end_column = 34; - law_headings = - [ - "Instruction ministérielle N°DSS/SD2B/2019/65 du 25 \ - mars 2019 relative à la revalorisation au 1er \ - avril 2019 des prestations familiales servies en \ - métropole"; - "Montant de la base mensuelle des allocations \ - familiales"; - ]; - } - (date_courante_ >=@ date_of_numbers 2019 4 1 - && date_courante_ <@ date_of_numbers 2020 4 1)) - (fun (_ : _) -> money_of_cents_string "41316")); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = - "./../base_mensuelle_allocations_familiales/bmaf.catala_fr"; - start_line = 6; - start_column = 26; - end_line = 6; - end_column = 32; - law_headings = - ["Montant de la base mensuelle des allocations familiales"]; - } - false) - (fun (_ : _) -> raise EmptyError) - with EmptyError -> - raise - (NoValueProvided - { - filename = - "./../base_mensuelle_allocations_familiales/bmaf.catala_fr"; - start_line = 6; - start_column = 10; - end_line = 6; - end_column = 17; - law_headings = - ["Montant de la base mensuelle des allocations familiales"]; - })) - in - { BaseMensuelleAllocationsFamilialesOut.montant_out = montant_ } - -let prestations_familiales - (prestations_familiales_in : PrestationsFamilialesIn.t) : - PrestationsFamilialesOut.t = - let date_courante_ : date = - prestations_familiales_in.PrestationsFamilialesIn.date_courante_in - in - let prestation_courante_ : element_prestations_familiales = - prestations_familiales_in.PrestationsFamilialesIn.prestation_courante_in - in - let residence_ : collectivite = - prestations_familiales_in.PrestationsFamilialesIn.residence_in - in - let age_l512_3_2_ : integer = - log_variable_definition - ["PrestationsFamiliales"; "âge_l512_3_2"] - embed_integer - (try - handle_default - [| - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./securite_sociale_R.catala_fr"; - start_line = 21; - start_column = 14; - end_line = 21; - end_column = 26; - law_headings = - [ - "Article R512-2"; - "Chapitre 2 : Champ d'application."; - "Titre 1 : Champ d'application - Généralités"; - "Livre 5 : Prestations familiales et prestations \ - assimilées"; - "Partie réglementaire - Décrets en Conseil d'Etat"; - "Code de la sécurité sociale"; - ]; - } - true) - (fun (_ : _) -> integer_of_string "20")); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./prologue.catala_fr"; - start_line = 61; - start_column = 31; - end_line = 61; - end_column = 37; - law_headings = - [ - "Prestations familiales"; - "Champs d'applications"; - "Prologue"; - ]; - } - false) - (fun (_ : _) -> raise EmptyError) - with EmptyError -> - raise - (NoValueProvided - { - filename = "./prologue.catala_fr"; - start_line = 61; - start_column = 10; - end_line = 61; - end_column = 22; - law_headings = - [ - "Prestations familiales"; "Champs d'applications"; "Prologue"; - ]; - })) - in - let smic_dot_date_courante_ : date = +let allocation_familiales_avril2008 (allocation_familiales_avril2008_in: AllocationFamilialesAvril2008In.t) : AllocationFamilialesAvril2008Out.t = + let age_minimum_alinea_1_l521_3_: integer = (log_variable_definition + ["AllocationFamilialesAvril2008"; "âge_minimum_alinéa_1_l521_3"] + (embed_integer) ( try - log_variable_definition - ["PrestationsFamiliales"; "smic.date_courante"] - embed_date - (handle_default - [| - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./prologue.catala_fr"; - start_line = 70; - start_column = 14; - end_line = 70; - end_column = 32; - law_headings = - [ - "Prestations familiales"; - "Champs d'applications"; - "Prologue"; - ]; - } - true) - (fun (_ : _) -> date_courante_)); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./../smic/smic.catala_fr"; - start_line = 9; - start_column = 32; - end_line = 9; - end_column = 36; - law_headings = - ["Prologue"; "Montant du salaire minimum de croissance"]; - } - false) - (fun (_ : _) -> raise EmptyError)) - with EmptyError -> - raise - (NoValueProvided - { - filename = "./../smic/smic.catala_fr"; - start_line = 9; - start_column = 10; - end_line = 9; - end_column = 23; - law_headings = - ["Prologue"; "Montant du salaire minimum de croissance"]; - }) - in - let smic_dot_residence_ : collectivite = + (handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=77; start_column=10; end_line=77; end_column=37; + law_headings=["Allocations familiales"; "Champs d'applications"; + "Prologue"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/securite_sociale_R.catala_fr"; + start_line=78; start_column=14; end_line=78; end_column=41; + law_headings=["Article R521-1"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets en Conseil d'Etat"; + "Code de la sécurité sociale"]} true)) + (fun (_: _) -> integer_of_string "16")) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=77; start_column=10; end_line=77; end_column=37; + law_headings=["Allocations familiales"; "Champs d'applications"; + "Prologue"]})))) in + {AllocationFamilialesAvril2008Out.age_minimum_alinea_1_l521_3_out = + age_minimum_alinea_1_l521_3_} + +let enfant_le_plus_age (enfant_le_plus_age_in: EnfantLePlusAgeIn.t) : EnfantLePlusAgeOut.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) ( try - log_variable_definition - ["PrestationsFamiliales"; "smic.résidence"] - embed_collectivite - (handle_default - [| - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./prologue.catala_fr"; - start_line = 69; - start_column = 14; - end_line = 69; - end_column = 28; - law_headings = - [ - "Prestations familiales"; - "Champs d'applications"; - "Prologue"; - ]; - } - true) - (fun (_ : _) -> residence_)); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./../smic/smic.catala_fr"; - start_line = 10; - start_column = 28; - end_line = 10; - end_column = 40; - law_headings = - ["Prologue"; "Montant du salaire minimum de croissance"]; - } - false) - (fun (_ : _) -> raise EmptyError)) - with EmptyError -> - raise - (NoValueProvided - { - filename = "./../smic/smic.catala_fr"; - start_line = 10; - start_column = 10; - end_line = 10; - end_column = 19; - law_headings = - ["Prologue"; "Montant du salaire minimum de croissance"]; - }) - in - let result_ : SmicOut.t = - log_end_call - ["PrestationsFamiliales"; "smic"; "Smic"] - ((log_begin_call ["PrestationsFamiliales"; "smic"; "Smic"] smic) - { - SmicIn.date_courante_in = smic_dot_date_courante_; - SmicIn.residence_in = smic_dot_residence_; - }) - in - let smic_dot_brut_horaire_ : money = result_.SmicOut.brut_horaire_out in - let regime_outre_mer_l751_1_ : bool = - log_variable_definition - ["PrestationsFamiliales"; "régime_outre_mer_l751_1"] - embed_bool - (try - handle_default - [| - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./securite_sociale_L.catala_fr"; - start_line = 354; - start_column = 5; - end_line = 359; - end_column = 30; - law_headings = - [ - "Article L751-1"; - "Chapitre 1er : Généralités"; - "Titre 5 : Dispositions particulières à la \ - Guadeloupe, à la Guyane, à la Martinique, à La \ - Réunion, à Saint-Barthélemy et à Saint-Martin"; - "Livre 7 : Régimes divers - Dispositions diverses"; - "Partie législative"; - "Code de la sécurité sociale"; - ]; - } - (residence_ = Guadeloupe () || residence_ = Guyane () - || residence_ = Martinique () || residence_ = LaReunion () - || residence_ = SaintBarthelemy () - || residence_ = SaintMartin ())) - (fun (_ : _) -> true)); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./prologue.catala_fr"; - start_line = 62; - start_column = 34; - end_line = 62; - end_column = 43; - law_headings = - [ - "Prestations familiales"; - "Champs d'applications"; - "Prologue"; - ]; - } - true) - (fun (_ : _) -> false) - with EmptyError -> - raise - (NoValueProvided - { - filename = "./prologue.catala_fr"; - start_line = 62; - start_column = 10; - end_line = 62; - end_column = 33; - 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 - (try - handle_default - [| - (fun (_ : _) -> + (handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=81; start_column=10; end_line=81; end_column=21; + law_headings=["Allocations familiales"; "Champs d'applications"; + "Prologue"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/epilogue.catala_fr"; + start_line=12; start_column=14; end_line=12; end_column=25; + law_headings=["Règles diverses"; "Épilogue"]} true)) + (fun (_: _) -> + (let predicate_ : _ = + (fun (potentiel_plus_age_: _) -> + potentiel_plus_age_.Enfant.age) + in + (Array.fold_left + (fun (acc_: _) (item_: _) -> + if ((predicate_ acc_) >! (predicate_ item_)) then + acc_ else item_) + {Enfant.identifiant = (integer_of_string "-1"); + Enfant.obligation_scolaire = + (SituationObligationScolaire.Pendant ()); + Enfant.remuneration_mensuelle = (money_of_cents_string "0"); + Enfant.date_de_naissance = (date_of_numbers (1900) (1) (1)); + Enfant.age = (integer_of_string "0"); + Enfant.prise_en_charge = + (PriseEnCharge.EffectiveEtPermanente ()); + Enfant.a_deja_ouvert_droit_aux_allocations_familiales = + false; + Enfant.beneficie_titre_personnel_aide_personnelle_logement = + false} enfants_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=81; start_column=10; end_line=81; end_column=21; + law_headings=["Allocations familiales"; "Champs d'applications"; + "Prologue"]})))) in + {EnfantLePlusAgeOut.le_plus_age_out = le_plus_age_} + +let smic (smic_in: SmicIn.t) : SmicOut.t = + let date_courante_: date = smic_in.SmicIn.date_courante_in in + let residence_: Collectivite.t = smic_in.SmicIn.residence_in in + let brut_horaire_: money = (log_variable_definition + ["Smic"; "brut_horaire"] (embed_money) ( + try + (handle_default + {filename = "examples/allocations_familiales/../smic/smic.catala_fr"; + start_line=11; start_column=10; end_line=11; end_column=22; + law_headings=["Prologue"; + "Montant du salaire minimum de croissance"]} + ([|(fun (_: _) -> handle_default - [| - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./securite_sociale_R.catala_fr"; - start_line = 216; - start_column = 18; - end_line = 216; - end_column = 41; - law_headings = - [ - "Article R755-0-2"; - "Chapitre 5 : Prestations familiales et \ - prestations assimilées"; - "Titre 5 : Départements d'outre-mer"; - "Livre 7 : Régimes divers - Dispositions \ - diverses"; - "Partie réglementaire - Décrets en Conseil \ - d'Etat"; - "Code de la sécurité sociale"; - ]; - } - regime_outre_mer_l751_1_) - (fun (_ : _) -> - smic_dot_brut_horaire_ *$ decimal_of_string "0.55" - *$ decimal_of_string "169.")); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./securite_sociale_R.catala_fr"; - start_line = 31; - start_column = 14; - end_line = 31; - end_column = 30; - law_headings = - [ - "Article R512-2"; - "Chapitre 2 : Champ d'application."; - "Titre 1 : Champ d'application - Généralités"; - "Livre 5 : Prestations familiales et prestations \ - assimilées"; - "Partie réglementaire - Décrets en Conseil d'Etat"; - "Code de la sécurité sociale"; - ]; - } - true) - (fun (_ : _) -> - smic_dot_brut_horaire_ *$ decimal_of_string "0.55" - *$ decimal_of_string "169.")); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./prologue.catala_fr"; - start_line = 60; - start_column = 36; - end_line = 60; - end_column = 42; - law_headings = - [ - "Prestations familiales"; - "Champs d'applications"; - "Prologue"; - ]; - } - false) - (fun (_ : _) -> raise EmptyError) - with EmptyError -> - raise - (NoValueProvided - { - filename = "./prologue.catala_fr"; - start_line = 60; - start_column = 11; - end_line = 60; - end_column = 27; - law_headings = - [ - "Prestations familiales"; "Champs d'applications"; "Prologue"; - ]; - })) - in - let conditions_hors_age_ : Enfant.t -> bool = - log_variable_definition - ["PrestationsFamiliales"; "conditions_hors_âge"] - unembeddable - (try - fun (param_ : Enfant.t) -> - try - handle_default - [| - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./securite_sociale_L.catala_fr"; - start_line = 68; - start_column = 5; - end_line = 71; - end_column = 57; - law_headings = - [ - "Article L512-3"; - "Chapitre 2 : Champ d'application"; - "Titre 1 : Champ d'application - Généralités"; - "Livre 5 : Prestations familiales et \ - prestations assimilées"; - "Partie législative"; - "Code de la sécurité sociale"; - ]; - } - (((match param_.Enfant.obligation_scolaire with - | Avant _ -> true - | Pendant _ -> false - | Apres _ -> false) - || (match param_.Enfant.obligation_scolaire with - | Avant _ -> false - | Pendant _ -> true - | Apres _ -> false) - || - match param_.Enfant.obligation_scolaire with - | Avant _ -> false - | Pendant _ -> false - | Apres _ -> true) - && param_.Enfant.remuneration_mensuelle - <=$ plafond_l512_3_2_)) - (fun (_ : _) -> true)); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./prologue.catala_fr"; - start_line = 59; - start_column = 3; - end_line = 59; - end_column = 56; - law_headings = - [ - "Prestations familiales"; - "Champs d'applications"; - "Prologue"; - ]; - } - true) - (fun (_ : _) -> false) - with EmptyError -> - raise - (NoValueProvided - { - filename = "./prologue.catala_fr"; - start_line = 59; - start_column = 10; - end_line = 59; - end_column = 29; - law_headings = - [ - "Prestations familiales"; - "Champs d'applications"; - "Prologue"; - ]; - }) - with EmptyError -> - raise - (NoValueProvided - { - filename = "./prologue.catala_fr"; - start_line = 59; - start_column = 10; - end_line = 59; - end_column = 29; - law_headings = - [ - "Prestations familiales"; "Champs d'applications"; "Prologue"; - ]; - })) - in - let droit_ouvert_ : Enfant.t -> bool = - log_variable_definition - ["PrestationsFamiliales"; "droit_ouvert"] - unembeddable - (try - fun (param_ : Enfant.t) -> - try - handle_default - [| - (fun (_ : _) -> - handle_default - [| - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./autres_codes.catala_fr"; - start_line = 24; - start_column = 5; - end_line = 24; - end_column = 63; - law_headings = - [ - "Article L821-3"; - "Sous-section 1 : Aides personnelles au \ - logement"; - "Section 2 : Règles de non-cumul"; - "Chapitre Ier : Principes généraux"; - "Titre II : Dispositions communes aux \ - aides personnelles au logement"; - "Livre VIII : Aides personnelles au \ - logement"; + {filename = "examples/allocations_familiales/../smic/smic.catala_fr"; + start_line=11; start_column=10; + end_line=11; end_column=22; + law_headings=["Prologue"; + "Montant du salaire minimum de croissance"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/../smic/smic.catala_fr"; + start_line=29; start_column=5; + end_line=38; end_column=6; + law_headings=["Article 1"; + "Décret n° 2018-1173 du 19 décembre 2018 portant relèvement du salaire minimum de croissance"; + "Montant du salaire minimum de croissance"]} + ((date_courante_ >=@ (date_of_numbers (2019) (1) (1))) && + ((date_courante_ <=@ + (date_of_numbers (2019) (12) (31))) && + ((residence_ = (Collectivite.Metropole ())) || + ((residence_ = (Collectivite.Guadeloupe ())) || + ((residence_ = (Collectivite.Guyane ())) || + ((residence_ = + (Collectivite.Martinique ())) || + ((residence_ = + (Collectivite.LaReunion ())) || + ((residence_ = + (Collectivite.SaintBarthelemy ())) + || + ((residence_ = + (Collectivite.SaintMartin ())) + || + (residence_ = + (Collectivite.SaintPierreEtMiquelon + ()))))))))))))) + (fun (_: _) -> money_of_cents_string "1003")); + (fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/../smic/smic.catala_fr"; + start_line=11; start_column=10; + end_line=11; end_column=22; + law_headings=["Prologue"; + "Montant du salaire minimum de croissance"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/../smic/smic.catala_fr"; + start_line=47; start_column=5; + end_line=49; end_column=6; + law_headings=["Article 1"; + "Décret n° 2018-1173 du 19 décembre 2018 portant relèvement du salaire minimum de croissance"; + "Montant du salaire minimum de croissance"]} + ((date_courante_ >=@ (date_of_numbers (2019) (1) (1))) && + ((date_courante_ <=@ + (date_of_numbers (2019) (12) (31))) && + (residence_ = (Collectivite.Mayotte ())))))) + (fun (_: _) -> money_of_cents_string "757")); + (fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/../smic/smic.catala_fr"; + start_line=11; start_column=10; + end_line=11; end_column=22; + law_headings=["Prologue"; + "Montant du salaire minimum de croissance"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/../smic/smic.catala_fr"; + start_line=68; start_column=5; + end_line=77; end_column=6; + law_headings=["Article 1"; + "Décret n° 2019-1387 du 18 décembre 2019 portant relèvement du salaire minimum de croissance"; + "Montant du salaire minimum de croissance"]} + ((date_courante_ >=@ (date_of_numbers (2020) (1) (1))) && + ((date_courante_ <=@ + (date_of_numbers (2020) (12) (31))) && + ((residence_ = (Collectivite.Metropole ())) || + ((residence_ = (Collectivite.Guadeloupe ())) || + ((residence_ = (Collectivite.Guyane ())) || + ((residence_ = + (Collectivite.Martinique ())) || + ((residence_ = + (Collectivite.LaReunion ())) || + ((residence_ = + (Collectivite.SaintBarthelemy ())) + || + ((residence_ = + (Collectivite.SaintMartin ())) + || + (residence_ = + (Collectivite.SaintPierreEtMiquelon + ()))))))))))))) + (fun (_: _) -> money_of_cents_string "1015")); + (fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/../smic/smic.catala_fr"; + start_line=11; start_column=10; + end_line=11; end_column=22; + law_headings=["Prologue"; + "Montant du salaire minimum de croissance"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/../smic/smic.catala_fr"; + start_line=86; start_column=5; + end_line=88; end_column=6; + law_headings=["Article 1"; + "Décret n° 2019-1387 du 18 décembre 2019 portant relèvement du salaire minimum de croissance"; + "Montant du salaire minimum de croissance"]} + ((date_courante_ >=@ (date_of_numbers (2020) (1) (1))) && + ((date_courante_ <=@ + (date_of_numbers (2020) (12) (31))) && + (residence_ = (Collectivite.Mayotte ())))))) + (fun (_: _) -> money_of_cents_string "766")); + (fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/../smic/smic.catala_fr"; + start_line=11; start_column=10; + end_line=11; end_column=22; + law_headings=["Prologue"; + "Montant du salaire minimum de croissance"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/../smic/smic.catala_fr"; + start_line=107; start_column=5; + end_line=116; end_column=6; + law_headings=["Article 1"; + "Décret n° 2020-1598 du 16 décembre 2020 portant relèvement du salaire minimum de croissance"; + "Montant du salaire minimum de croissance"]} + ((date_courante_ >=@ (date_of_numbers (2021) (1) (1))) && + ((date_courante_ <=@ + (date_of_numbers (2021) (12) (31))) && + ((residence_ = (Collectivite.Metropole ())) || + ((residence_ = (Collectivite.Guadeloupe ())) || + ((residence_ = (Collectivite.Guyane ())) || + ((residence_ = + (Collectivite.Martinique ())) || + ((residence_ = + (Collectivite.LaReunion ())) || + ((residence_ = + (Collectivite.SaintBarthelemy ())) + || + ((residence_ = + (Collectivite.SaintMartin ())) + || + (residence_ = + (Collectivite.SaintPierreEtMiquelon + ()))))))))))))) + (fun (_: _) -> money_of_cents_string "1025")); + (fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/../smic/smic.catala_fr"; + start_line=11; start_column=10; + end_line=11; end_column=22; + law_headings=["Prologue"; + "Montant du salaire minimum de croissance"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/../smic/smic.catala_fr"; + start_line=125; start_column=5; + end_line=127; end_column=6; + law_headings=["Article 1"; + "Décret n° 2020-1598 du 16 décembre 2020 portant relèvement du salaire minimum de croissance"; + "Montant du salaire minimum de croissance"]} + ((date_courante_ >=@ (date_of_numbers (2021) (1) (1))) && + ((date_courante_ <=@ + (date_of_numbers (2021) (12) (31))) && + (residence_ = (Collectivite.Mayotte ())))))) + (fun (_: _) -> money_of_cents_string "774")); + (fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/../smic/smic.catala_fr"; + start_line=11; start_column=10; + end_line=11; end_column=22; + law_headings=["Prologue"; + "Montant du salaire minimum de croissance"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/../smic/smic.catala_fr"; + start_line=146; start_column=5; + end_line=155; end_column=6; + law_headings=["Article 1"; + "Décret n° 2021-1741 du 22 décembre 2021 portant relèvement du salaire minimum de croissance"; + "Montant du salaire minimum de croissance"]} + ((date_courante_ >=@ (date_of_numbers (2022) (1) (1))) && + ((date_courante_ <=@ (date_of_numbers (2022) (4) (30))) + && + ((residence_ = (Collectivite.Metropole ())) || + ((residence_ = (Collectivite.Guadeloupe ())) || + ((residence_ = (Collectivite.Guyane ())) || + ((residence_ = + (Collectivite.Martinique ())) || + ((residence_ = + (Collectivite.LaReunion ())) || + ((residence_ = + (Collectivite.SaintBarthelemy ())) + || + ((residence_ = + (Collectivite.SaintMartin ())) + || + (residence_ = + (Collectivite.SaintPierreEtMiquelon + ()))))))))))))) + (fun (_: _) -> money_of_cents_string "1057")); + (fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/../smic/smic.catala_fr"; + start_line=11; start_column=10; + end_line=11; end_column=22; + law_headings=["Prologue"; + "Montant du salaire minimum de croissance"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/../smic/smic.catala_fr"; + start_line=165; start_column=5; + end_line=167; end_column=6; + law_headings=["Article 1"; + "Décret n° 2021-1741 du 22 décembre 2021 portant relèvement du salaire minimum de croissance"; + "Montant du salaire minimum de croissance"]} + ((date_courante_ >=@ (date_of_numbers (2022) (1) (1))) && + ((date_courante_ <=@ (date_of_numbers (2022) (4) (30))) + && (residence_ = (Collectivite.Mayotte ())))))) + (fun (_: _) -> money_of_cents_string "798")); + (fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/../smic/smic.catala_fr"; + start_line=11; start_column=10; + end_line=11; end_column=22; + law_headings=["Prologue"; + "Montant du salaire minimum de croissance"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/../smic/smic.catala_fr"; + start_line=186; start_column=5; + end_line=195; end_column=6; + law_headings=["Article 2"; + "Arrêté du 19 avril 2022 relatif au relèvement du salaire minimum de croissance"; + "Montant du salaire minimum de croissance"]} + ((date_courante_ >=@ (date_of_numbers (2022) (5) (1))) && + ((date_courante_ <=@ + (date_of_numbers (2022) (12) (31))) && + ((residence_ = (Collectivite.Metropole ())) || + ((residence_ = (Collectivite.Guadeloupe ())) || + ((residence_ = (Collectivite.Guyane ())) || + ((residence_ = + (Collectivite.Martinique ())) || + ((residence_ = + (Collectivite.LaReunion ())) || + ((residence_ = + (Collectivite.SaintBarthelemy ())) + || + ((residence_ = + (Collectivite.SaintMartin ())) + || + (residence_ = + (Collectivite.SaintPierreEtMiquelon + ()))))))))))))) + (fun (_: _) -> money_of_cents_string "1085")); + (fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/../smic/smic.catala_fr"; + start_line=11; start_column=10; + end_line=11; end_column=22; + law_headings=["Prologue"; + "Montant du salaire minimum de croissance"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/../smic/smic.catala_fr"; + start_line=204; start_column=5; + end_line=206; end_column=6; + law_headings=["Article 2"; + "Arrêté du 19 avril 2022 relatif au relèvement du salaire minimum de croissance"; + "Montant du salaire minimum de croissance"]} + ((date_courante_ >=@ (date_of_numbers (2022) (5) (1))) && + ((date_courante_ <=@ + (date_of_numbers (2022) (12) (31))) && + (residence_ = (Collectivite.Mayotte ())))))) + (fun (_: _) -> money_of_cents_string "819"))|]) + (fun (_: _) -> false) (fun (_: _) -> raise EmptyError)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/allocations_familiales/../smic/smic.catala_fr"; + start_line=11; start_column=10; end_line=11; end_column=22; + law_headings=["Prologue"; "Montant du salaire minimum de croissance"]})))) in + {SmicOut.brut_horaire_out = brut_horaire_} + +let base_mensuelle_allocations_familiales (base_mensuelle_allocations_familiales_in: BaseMensuelleAllocationsFamilialesIn.t) : BaseMensuelleAllocationsFamilialesOut.t = + let date_courante_: date = base_mensuelle_allocations_familiales_in.BaseMensuelleAllocationsFamilialesIn.date_courante_in in + let montant_: money = (log_variable_definition + ["BaseMensuelleAllocationsFamiliales"; "montant"] (embed_money) ( + try + (handle_default + {filename = "examples/allocations_familiales/../base_mensuelle_allocations_familiales/bmaf.catala_fr"; + start_line=6; start_column=10; end_line=6; end_column=17; + law_headings=["Montant de la base mensuelle des allocations familiales"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/../base_mensuelle_allocations_familiales/bmaf.catala_fr"; + start_line=6; start_column=10; end_line=6; end_column=17; + law_headings=["Montant de la base mensuelle des allocations familiales"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/../base_mensuelle_allocations_familiales/bmaf.catala_fr"; + start_line=28; start_column=5; + end_line=29; end_column=34; + law_headings=["Instruction ministérielle N°DSS/SD2B/2019/65 du 25 mars 2019 relative à la revalorisation au 1er avril 2019 des prestations familiales servies en métropole"; + "Montant de la base mensuelle des allocations familiales"]} + ((date_courante_ >=@ (date_of_numbers (2019) (4) (1))) && + (date_courante_ <@ (date_of_numbers (2020) (4) (1)))))) + (fun (_: _) -> money_of_cents_string "41316")); + (fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/../base_mensuelle_allocations_familiales/bmaf.catala_fr"; + start_line=6; start_column=10; end_line=6; end_column=17; + law_headings=["Montant de la base mensuelle des allocations familiales"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/../base_mensuelle_allocations_familiales/bmaf.catala_fr"; + start_line=48; start_column=5; + end_line=49; end_column=34; + law_headings=["Instruction interministérielle no DSS/SD2B/2020/33 du 18 février 2020 relative à la revalorisation au 1er avril 2020 des prestations familiales servies en métropole, en Guadeloupe, en Guyane, en Martinique, à La Réunion, à Saint-Barthélemy, à Saint-Martin et dans le département de Mayotte"; + "Montant de la base mensuelle des allocations familiales"]} + ((date_courante_ >=@ (date_of_numbers (2020) (4) (1))) && + (date_courante_ <@ (date_of_numbers (2021) (4) (1)))))) + (fun (_: _) -> money_of_cents_string "41440")); + (fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/../base_mensuelle_allocations_familiales/bmaf.catala_fr"; + start_line=6; start_column=10; end_line=6; end_column=17; + law_headings=["Montant de la base mensuelle des allocations familiales"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/../base_mensuelle_allocations_familiales/bmaf.catala_fr"; + start_line=64; start_column=5; + end_line=65; end_column=34; + law_headings=["Instruction interministérielle n°DSS/2B/2021/65 du 19 mars 2021 relative à la revalorisation au 1er avril 2021 des prestations familiales servies en métropole, en Guadeloupe, en Guyane, en Martinique, à la Réunion, à Saint-Barthélemy, à Saint-Martin et dans le département de Mayotte"; + "Montant de la base mensuelle des allocations familiales"]} + ((date_courante_ >=@ (date_of_numbers (2021) (4) (1))) && + (date_courante_ <@ (date_of_numbers (2022) (4) (1)))))) + (fun (_: _) -> money_of_cents_string "41481")); + (fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/../base_mensuelle_allocations_familiales/bmaf.catala_fr"; + start_line=6; start_column=10; end_line=6; end_column=17; + law_headings=["Montant de la base mensuelle des allocations familiales"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/../base_mensuelle_allocations_familiales/bmaf.catala_fr"; + start_line=82; start_column=5; + end_line=83; end_column=34; + law_headings=["Instruction interministérielle n°DSS/2B/2022/82 du 28 mars 2022 relative à la revalorisation au 1er avril 2022 des prestations familiales servies en métropole, en Guadeloupe, en Guyane, en Martinique, à la Réunion, à Saint-Barthélemy, à Saint-Martin et dans le département de Mayotte"; + "Montant de la base mensuelle des allocations familiales"]} + ((date_courante_ >=@ (date_of_numbers (2022) (4) (1))) && + (date_courante_ <@ (date_of_numbers (2023) (4) (1)))))) + (fun (_: _) -> money_of_cents_string "42228"))|]) + (fun (_: _) -> false) (fun (_: _) -> raise EmptyError)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/allocations_familiales/../base_mensuelle_allocations_familiales/bmaf.catala_fr"; + start_line=6; start_column=10; end_line=6; end_column=17; + law_headings=["Montant de la base mensuelle des allocations familiales"]})))) in + {BaseMensuelleAllocationsFamilialesOut.montant_out = montant_} + +let prestations_familiales (prestations_familiales_in: PrestationsFamilialesIn.t) : PrestationsFamilialesOut.t = + let date_courante_: date = prestations_familiales_in.PrestationsFamilialesIn.date_courante_in in + let prestation_courante_: ElementPrestationsFamiliales.t = prestations_familiales_in.PrestationsFamilialesIn.prestation_courante_in in + let residence_: Collectivite.t = prestations_familiales_in.PrestationsFamilialesIn.residence_in in + let age_l512_3_2_: integer = (log_variable_definition + ["PrestationsFamiliales"; "âge_l512_3_2"] (embed_integer) ( + try + (handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=61; start_column=10; end_line=61; end_column=22; + law_headings=["Prestations familiales"; "Champs d'applications"; + "Prologue"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/securite_sociale_R.catala_fr"; + start_line=21; start_column=14; end_line=21; end_column=26; + law_headings=["Article R512-2"; + "Chapitre 2 : Champ d'application."; + "Titre 1 : Champ d'application - Généralités"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets en Conseil d'Etat"; + "Code de la sécurité sociale"]} true)) + (fun (_: _) -> integer_of_string "20")) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=61; start_column=10; end_line=61; end_column=22; + law_headings=["Prestations familiales"; "Champs d'applications"; + "Prologue"]})))) in + let smic_dot_date_courante_: date = + try ((log_variable_definition + ["PrestationsFamiliales"; "smic.date_courante"] (embed_date) + (handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=66; start_column=3; end_line=66; end_column=7; + law_headings=["Prestations familiales"; "Champs d'applications"; + "Prologue"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=70; start_column=14; end_line=70; end_column=32; + law_headings=["Prestations familiales"; + "Champs d'applications"; "Prologue"]} true)) + (fun (_: _) -> date_courante_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/allocations_familiales/../smic/smic.catala_fr"; + start_line=9; start_column=10; end_line=9; end_column=23; + law_headings=["Prologue"; "Montant du salaire minimum de croissance"]})) in + let smic_dot_residence_: Collectivite.t = + try ((log_variable_definition + ["PrestationsFamiliales"; "smic.résidence"] (embed_collectivite) + (handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=66; start_column=3; end_line=66; end_column=7; + law_headings=["Prestations familiales"; "Champs d'applications"; + "Prologue"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=69; start_column=14; end_line=69; end_column=28; + law_headings=["Prestations familiales"; + "Champs d'applications"; "Prologue"]} true)) + (fun (_: _) -> residence_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/allocations_familiales/../smic/smic.catala_fr"; + start_line=10; start_column=10; end_line=10; end_column=19; + law_headings=["Prologue"; "Montant du salaire minimum de croissance"]})) in + let result_: SmicOut.t = (log_end_call + ["PrestationsFamiliales"; "smic"; "Smic"] ((log_begin_call + ["PrestationsFamiliales"; "smic"; "Smic"] smic) + {SmicIn.date_courante_in = smic_dot_date_courante_; + SmicIn.residence_in = smic_dot_residence_})) in + let smic_dot_brut_horaire_: money = result_.SmicOut.brut_horaire_out in + let regime_outre_mer_l751_1_: bool = (log_variable_definition + ["PrestationsFamiliales"; "régime_outre_mer_l751_1"] (embed_bool) ( + try + (handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=62; start_column=10; end_line=62; end_column=33; + law_headings=["Prestations familiales"; "Champs d'applications"; + "Prologue"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=62; start_column=10; + end_line=62; end_column=33; + law_headings=["Prestations familiales"; + "Champs d'applications"; "Prologue"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/securite_sociale_L.catala_fr"; + start_line=354; start_column=5; + end_line=359; end_column=30; + law_headings=["Article L751-1"; + "Chapitre 1er : Généralités"; + "Titre 5 : Dispositions particulières à la Guadeloupe, à la Guyane, à la Martinique, à La Réunion, à Saint-Barthélemy et à Saint-Martin"; + "Livre 7 : Régimes divers - Dispositions diverses"; "Partie législative"; - "Code de la construction et de \ - l'habitation"; - ]; - } - param_ - .Enfant - .beneficie_titre_personnel_aide_personnelle_logement) - (fun (_ : _) -> false)); - |] - (fun (_ : _) -> true) - (fun (_ : _) -> + "Code de la sécurité sociale"]} + ((residence_ = (Collectivite.Guadeloupe ())) || + ((residence_ = (Collectivite.Guyane ())) || + ((residence_ = (Collectivite.Martinique ())) || + ((residence_ = (Collectivite.LaReunion ())) || + ((residence_ = + (Collectivite.SaintBarthelemy ())) || + (residence_ = + (Collectivite.SaintMartin ()))))))))) + (fun (_: _) -> true))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=62; start_column=10; end_line=62; end_column=33; + law_headings=["Prestations familiales"; + "Champs d'applications"; "Prologue"]} true)) + (fun (_: _) -> false)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=62; start_column=10; end_line=62; end_column=33; + 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) ( + try + (handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=60; start_column=11; end_line=60; end_column=27; + law_headings=["Prestations familiales"; "Champs d'applications"; + "Prologue"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=60; start_column=11; + end_line=60; end_column=27; + law_headings=["Prestations familiales"; + "Champs d'applications"; "Prologue"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/securite_sociale_R.catala_fr"; + start_line=216; start_column=18; + end_line=216; end_column=41; + law_headings=["Article R755-0-2"; + "Chapitre 5 : Prestations familiales et prestations assimilées"; + "Titre 5 : Départements d'outre-mer"; + "Livre 7 : Régimes divers - Dispositions diverses"; + "Partie réglementaire - Décrets en Conseil d'Etat"; + "Code de la sécurité sociale"]} + regime_outre_mer_l751_1_)) + (fun (_: _) -> + (smic_dot_brut_horaire_ *$ (decimal_of_string "0.55")) *$ + (decimal_of_string "169.")))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/securite_sociale_R.catala_fr"; + start_line=31; start_column=14; end_line=31; end_column=30; + law_headings=["Article R512-2"; + "Chapitre 2 : Champ d'application."; + "Titre 1 : Champ d'application - Généralités"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets en Conseil d'Etat"; + "Code de la sécurité sociale"]} true)) + (fun (_: _) -> + (smic_dot_brut_horaire_ *$ (decimal_of_string "0.55")) *$ + (decimal_of_string "169."))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=60; start_column=11; end_line=60; end_column=27; + law_headings=["Prestations familiales"; "Champs d'applications"; + "Prologue"]})))) in + let conditions_hors_age_: Enfant.t -> bool = (log_variable_definition + ["PrestationsFamiliales"; "conditions_hors_âge"] (unembeddable) ( + try + (fun (param_: Enfant.t) -> + try + (handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=59; start_column=10; end_line=59; end_column=29; + law_headings=["Prestations familiales"; + "Champs d'applications"; "Prologue"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=59; start_column=10; + end_line=59; end_column=29; + law_headings=["Prestations familiales"; + "Champs d'applications"; "Prologue"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/securite_sociale_L.catala_fr"; + start_line=68; start_column=5; + end_line=71; end_column=57; + law_headings=["Article L512-3"; + "Chapitre 2 : Champ d'application"; + "Titre 1 : Champ d'application - Généralités"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie législative"; + "Code de la sécurité sociale"]} + (((match (param_.Enfant.obligation_scolaire) + with + | SituationObligationScolaire.Avant _ -> true + | SituationObligationScolaire.Pendant _ -> false + | SituationObligationScolaire.Apres _ -> false) + || + ((match (param_.Enfant.obligation_scolaire) + with + | SituationObligationScolaire.Avant _ -> false + | SituationObligationScolaire.Pendant _ -> + true + | SituationObligationScolaire.Apres _ -> false) + || + (match (param_.Enfant.obligation_scolaire) + with + | SituationObligationScolaire.Avant _ -> + false + | SituationObligationScolaire.Pendant _ -> + false + | SituationObligationScolaire.Apres _ -> + true))) && + ((param_.Enfant.remuneration_mensuelle) <=$ + plafond_l512_3_2_)))) (fun (_: _) -> true))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=59; start_column=10; + end_line=59; end_column=29; + law_headings=["Prestations familiales"; + "Champs d'applications"; "Prologue"]} true)) + (fun (_: _) -> false)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=59; start_column=10; end_line=59; end_column=29; + law_headings=["Prestations familiales"; "Champs d'applications"; + "Prologue"]}))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=59; start_column=10; end_line=59; end_column=29; + law_headings=["Prestations familiales"; "Champs d'applications"; + "Prologue"]})))) in + let droit_ouvert_: Enfant.t -> bool = (log_variable_definition + ["PrestationsFamiliales"; "droit_ouvert"] (unembeddable) ( + try + (fun (param_: Enfant.t) -> + try + (handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=58; start_column=10; end_line=58; end_column=22; + law_headings=["Prestations familiales"; + "Champs d'applications"; "Prologue"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=58; start_column=10; + end_line=58; end_column=22; + law_headings=["Prestations familiales"; + "Champs d'applications"; "Prologue"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=58; start_column=10; + end_line=58; end_column=22; + law_headings=["Prestations familiales"; + "Champs d'applications"; + "Prologue"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/autres_codes.catala_fr"; + start_line=24; start_column=5; + end_line=24; end_column=63; + law_headings=["Article L821-3"; + "Sous-section 1 : Aides personnelles au logement"; + "Section 2 : Règles de non-cumul"; + "Chapitre Ier : Principes généraux"; + "Titre II : Dispositions communes aux aides personnelles au logement"; + "Livre VIII : Aides personnelles au logement"; + "Partie législative"; + "Code de la construction et de l'habitation"]} + (param_.Enfant.beneficie_titre_personnel_aide_personnelle_logement))) + (fun (_: _) -> false))|]) (fun (_: _) -> true) + (fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=58; start_column=10; + end_line=58; end_column=22; + law_headings=["Prestations familiales"; + "Champs d'applications"; + "Prologue"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=58; start_column=10; + end_line=58; end_column=22; + law_headings=["Prestations familiales"; + "Champs d'applications"; + "Prologue"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=58; start_column=10; + end_line=58; end_column=22; + law_headings=["Prestations familiales"; + "Champs d'applications"; + "Prologue"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/securite_sociale_L.catala_fr"; + start_line=60; + start_column=5; + end_line=62; end_column=32; + law_headings=["Article L512-3"; + "Chapitre 2 : Champ d'application"; + "Titre 1 : Champ d'application - Généralités"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie législative"; + "Code de la sécurité sociale"]} + ((match + (param_.Enfant.obligation_scolaire) + with + | SituationObligationScolaire.Avant _ -> + false + | SituationObligationScolaire.Pendant _ -> + false + | SituationObligationScolaire.Apres _ -> + true) && + (((param_.Enfant.remuneration_mensuelle) + <=$ plafond_l512_3_2_) + && + ((param_.Enfant.age) true))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/securite_sociale_L.catala_fr"; + start_line=49; start_column=5; + end_line=50; end_column=50; + law_headings=["Article L512-3"; + "Chapitre 2 : Champ d'application"; + "Titre 1 : Champ d'application - Généralités"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie législative"; + "Code de la sécurité sociale"]} + ((match + (param_.Enfant.obligation_scolaire) + with + | SituationObligationScolaire.Avant _ -> + true + | SituationObligationScolaire.Pendant _ -> + false + | SituationObligationScolaire.Apres _ -> + false) || + (match + (param_.Enfant.obligation_scolaire) + with + | SituationObligationScolaire.Avant _ -> + false + | SituationObligationScolaire.Pendant _ -> + true + | SituationObligationScolaire.Apres _ -> + false)))) (fun (_: _) -> true))|]) + (fun (_: _) -> false) + (fun (_: _) -> raise EmptyError)))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=58; start_column=10; + end_line=58; end_column=22; + law_headings=["Prestations familiales"; + "Champs d'applications"; "Prologue"]} true)) + (fun (_: _) -> false)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=58; start_column=10; end_line=58; end_column=22; + law_headings=["Prestations familiales"; "Champs d'applications"; + "Prologue"]}))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=58; start_column=10; end_line=58; end_column=22; + law_headings=["Prestations familiales"; "Champs d'applications"; + "Prologue"]})))) in + {PrestationsFamilialesOut.droit_ouvert_out = droit_ouvert_; + PrestationsFamilialesOut.conditions_hors_age_out = conditions_hors_age_; + PrestationsFamilialesOut.age_l512_3_2_out = age_l512_3_2_; + PrestationsFamilialesOut.regime_outre_mer_l751_1_out = + regime_outre_mer_l751_1_} + +let allocations_familiales (allocations_familiales_in: AllocationsFamilialesIn.t) : AllocationsFamilialesOut.t = + let personne_charge_effective_permanente_est_parent_: bool = allocations_familiales_in.AllocationsFamilialesIn.personne_charge_effective_permanente_est_parent_in in + let personne_charge_effective_permanente_remplit_titre__i_: bool = allocations_familiales_in.AllocationsFamilialesIn.personne_charge_effective_permanente_remplit_titre_I_in in + let ressources_menage_: money = allocations_familiales_in.AllocationsFamilialesIn.ressources_menage_in in + let residence_: Collectivite.t = allocations_familiales_in.AllocationsFamilialesIn.residence_in in + let date_courante_: date = allocations_familiales_in.AllocationsFamilialesIn.date_courante_in in + 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) ( + try + (fun (param_: Enfant.t) -> + try + (handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=98; start_column=11; end_line=98; end_column=26; + law_headings=["Allocations familiales"; + "Champs d'applications"; "Prologue"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=98; start_column=11; + end_line=98; end_column=26; + law_headings=["Allocations familiales"; + "Champs d'applications"; "Prologue"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/securite_sociale_L.catala_fr"; + start_line=214; start_column=5; + end_line=214; end_column=70; + law_headings=["Article L521-2"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie législative"; + "Code de la sécurité sociale"]} + (match (param_.Enfant.prise_en_charge) + with + | PriseEnCharge.GardeAlterneePartageAllocations _ -> + true + | PriseEnCharge.GardeAlterneeAllocataireUnique _ -> + false + | PriseEnCharge.EffectiveEtPermanente _ -> false + | PriseEnCharge.ServicesSociauxAllocationVerseeALaFamille _ -> + false + | PriseEnCharge.ServicesSociauxAllocationVerseeAuxServicesSociaux _ -> + false))) + (fun (_: _) -> PriseEnCompte.Partagee ())); + (fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=98; start_column=11; + end_line=98; end_column=26; + law_headings=["Allocations familiales"; + "Champs d'applications"; "Prologue"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/securite_sociale_L.catala_fr"; + start_line=253; start_column=5; + end_line=254; end_column=56; + law_headings=["Article L521-2"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie législative"; + "Code de la sécurité sociale"]} + (match (param_.Enfant.prise_en_charge) + with + | PriseEnCharge.GardeAlterneePartageAllocations _ -> + false + | PriseEnCharge.GardeAlterneeAllocataireUnique _ -> + false + | PriseEnCharge.EffectiveEtPermanente _ -> false + | PriseEnCharge.ServicesSociauxAllocationVerseeALaFamille _ -> + false + | PriseEnCharge.ServicesSociauxAllocationVerseeAuxServicesSociaux _ -> + true))) (fun (_: _) -> PriseEnCompte.Zero ())); + (fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=98; start_column=11; + end_line=98; end_column=26; + law_headings=["Allocations familiales"; + "Champs d'applications"; "Prologue"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=98; start_column=11; + end_line=98; end_column=26; + law_headings=["Allocations familiales"; + "Champs d'applications"; + "Prologue"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=98; start_column=11; + end_line=98; end_column=26; + law_headings=["Allocations familiales"; + "Champs d'applications"; + "Prologue"]} ( + [||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/securite_sociale_L.catala_fr"; + start_line=263; start_column=5; + end_line=264; end_column=48; + law_headings=["Article L521-2"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie législative"; + "Code de la sécurité sociale"]} + (match + (param_.Enfant.prise_en_charge) + with + | PriseEnCharge.GardeAlterneePartageAllocations _ -> + false + | PriseEnCharge.GardeAlterneeAllocataireUnique _ -> + false + | PriseEnCharge.EffectiveEtPermanente _ -> + false + | PriseEnCharge.ServicesSociauxAllocationVerseeALaFamille _ -> + true + | PriseEnCharge.ServicesSociauxAllocationVerseeAuxServicesSociaux _ -> + false))) + (fun (_: _) -> + PriseEnCompte.Complete ()))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/securite_sociale_L.catala_fr"; + start_line=204; start_column=5; + end_line=204; end_column=69; + law_headings=["Article L521-2"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie législative"; + "Code de la sécurité sociale"]} + (match (param_.Enfant.prise_en_charge) + with + | PriseEnCharge.GardeAlterneePartageAllocations _ -> + false + | PriseEnCharge.GardeAlterneeAllocataireUnique _ -> + true + | PriseEnCharge.EffectiveEtPermanente _ -> + false + | PriseEnCharge.ServicesSociauxAllocationVerseeALaFamille _ -> + false + | PriseEnCharge.ServicesSociauxAllocationVerseeAuxServicesSociaux _ -> + false))) + (fun (_: _) -> PriseEnCompte.Complete ()))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/securite_sociale_L.catala_fr"; + start_line=184; start_column=5; + end_line=184; end_column=60; + law_headings=["Article L521-2"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie législative"; + "Code de la sécurité sociale"]} + (match (param_.Enfant.prise_en_charge) + with + | PriseEnCharge.GardeAlterneePartageAllocations _ -> + false + | PriseEnCharge.GardeAlterneeAllocataireUnique _ -> + false + | PriseEnCharge.EffectiveEtPermanente _ -> true + | PriseEnCharge.ServicesSociauxAllocationVerseeALaFamille _ -> + false + | PriseEnCharge.ServicesSociauxAllocationVerseeAuxServicesSociaux _ -> + false))) + (fun (_: _) -> PriseEnCompte.Complete ()))|]) + (fun (_: _) -> false) (fun (_: _) -> raise EmptyError)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=98; start_column=11; end_line=98; end_column=26; + law_headings=["Allocations familiales"; "Champs d'applications"; + "Prologue"]}))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=98; start_column=11; end_line=98; end_column=26; + law_headings=["Allocations familiales"; "Champs d'applications"; + "Prologue"]})))) in + let versement_: Enfant.t -> VersementAllocations.t = (log_variable_definition + ["AllocationsFamiliales"; "versement"] (unembeddable) ( + try + (fun (param_: Enfant.t) -> + try + (handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=99; start_column=11; end_line=99; end_column=20; + law_headings=["Allocations familiales"; + "Champs d'applications"; "Prologue"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=99; start_column=11; + end_line=99; end_column=20; + law_headings=["Allocations familiales"; + "Champs d'applications"; "Prologue"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/securite_sociale_L.catala_fr"; + start_line=258; start_column=5; + end_line=259; end_column=56; + law_headings=["Article L521-2"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie législative"; + "Code de la sécurité sociale"]} + (match (param_.Enfant.prise_en_charge) + with + | PriseEnCharge.GardeAlterneePartageAllocations _ -> + false + | PriseEnCharge.GardeAlterneeAllocataireUnique _ -> + false + | PriseEnCharge.EffectiveEtPermanente _ -> false + | PriseEnCharge.ServicesSociauxAllocationVerseeALaFamille _ -> + false + | PriseEnCharge.ServicesSociauxAllocationVerseeAuxServicesSociaux _ -> + true))) + (fun (_: _) -> + VersementAllocations.AllocationVerseeAuxServicesSociaux + ())); + (fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=99; start_column=11; + end_line=99; end_column=20; + law_headings=["Allocations familiales"; + "Champs d'applications"; "Prologue"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=99; start_column=11; + end_line=99; end_column=20; + law_headings=["Allocations familiales"; + "Champs d'applications"; + "Prologue"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=99; start_column=11; + end_line=99; end_column=20; + law_headings=["Allocations familiales"; + "Champs d'applications"; + "Prologue"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=99; + start_column=11; + end_line=99; end_column=20; + law_headings=["Allocations familiales"; + "Champs d'applications"; + "Prologue"]} + ([||]) + (fun (_: _) -> + (log_decision_taken + {filename = "examples/allocations_familiales/securite_sociale_L.catala_fr"; + start_line=269; + start_column=5; + end_line=270; end_column=48; + law_headings=["Article L521-2"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie législative"; + "Code de la sécurité sociale"]} + (match + (param_.Enfant.prise_en_charge) + with + | PriseEnCharge.GardeAlterneePartageAllocations _ -> + false + | PriseEnCharge.GardeAlterneeAllocataireUnique _ -> + false + | PriseEnCharge.EffectiveEtPermanente _ -> + false + | PriseEnCharge.ServicesSociauxAllocationVerseeALaFamille _ -> + true + | PriseEnCharge.ServicesSociauxAllocationVerseeAuxServicesSociaux _ -> + false))) + (fun (_: _) -> + VersementAllocations.Normal + ()))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/securite_sociale_L.catala_fr"; + start_line=218; start_column=5; + end_line=218; end_column=70; + law_headings=["Article L521-2"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie législative"; + "Code de la sécurité sociale"]} + (match + (param_.Enfant.prise_en_charge) + with + | PriseEnCharge.GardeAlterneePartageAllocations _ -> + true + | PriseEnCharge.GardeAlterneeAllocataireUnique _ -> + false + | PriseEnCharge.EffectiveEtPermanente _ -> + false + | PriseEnCharge.ServicesSociauxAllocationVerseeALaFamille _ -> + false + | PriseEnCharge.ServicesSociauxAllocationVerseeAuxServicesSociaux _ -> + false))) + (fun (_: _) -> + VersementAllocations.Normal ()))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/securite_sociale_L.catala_fr"; + start_line=208; start_column=5; + end_line=208; end_column=69; + law_headings=["Article L521-2"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie législative"; + "Code de la sécurité sociale"]} + (match (param_.Enfant.prise_en_charge) + with + | PriseEnCharge.GardeAlterneePartageAllocations _ -> + false + | PriseEnCharge.GardeAlterneeAllocataireUnique _ -> + true + | PriseEnCharge.EffectiveEtPermanente _ -> + false + | PriseEnCharge.ServicesSociauxAllocationVerseeALaFamille _ -> + false + | PriseEnCharge.ServicesSociauxAllocationVerseeAuxServicesSociaux _ -> + false))) + (fun (_: _) -> VersementAllocations.Normal ()))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/securite_sociale_L.catala_fr"; + start_line=188; start_column=5; + end_line=188; end_column=60; + law_headings=["Article L521-2"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie législative"; + "Code de la sécurité sociale"]} + (match (param_.Enfant.prise_en_charge) + with + | PriseEnCharge.GardeAlterneePartageAllocations _ -> + false + | PriseEnCharge.GardeAlterneeAllocataireUnique _ -> + false + | PriseEnCharge.EffectiveEtPermanente _ -> true + | PriseEnCharge.ServicesSociauxAllocationVerseeALaFamille _ -> + false + | PriseEnCharge.ServicesSociauxAllocationVerseeAuxServicesSociaux _ -> + false))) + (fun (_: _) -> VersementAllocations.Normal ()))|]) + (fun (_: _) -> false) (fun (_: _) -> raise EmptyError)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=99; start_column=11; end_line=99; end_column=20; + law_headings=["Allocations familiales"; "Champs d'applications"; + "Prologue"]}))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=99; start_column=11; end_line=99; end_column=20; + law_headings=["Allocations familiales"; "Champs d'applications"; + "Prologue"]})))) in + let nombre_enfants_l521_1_: integer = (log_variable_definition + ["AllocationsFamiliales"; "nombre_enfants_l521_1"] (embed_integer) ( + try + (handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=146; start_column=11; end_line=146; end_column=32; + law_headings=["Allocations familiales"; "Champs d'applications"; + "Prologue"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/securite_sociale_D.catala_fr"; + start_line=291; start_column=14; end_line=291; end_column=35; + law_headings=["Article D521-2"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"]} true)) + (fun (_: _) -> integer_of_string "3")) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=146; start_column=11; end_line=146; end_column=32; + law_headings=["Allocations familiales"; "Champs d'applications"; + "Prologue"]})))) in + let nombre_enfants_alinea_2_l521_3_: integer = (log_variable_definition + ["AllocationsFamiliales"; "nombre_enfants_alinéa_2_l521_3"] + (embed_integer) ( + try + (handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=148; start_column=11; end_line=148; end_column=41; + law_headings=["Allocations familiales"; "Champs d'applications"; + "Prologue"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/securite_sociale_R.catala_fr"; + start_line=64; start_column=14; end_line=64; end_column=44; + law_headings=["Article R521-1"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets en Conseil d'Etat"; + "Code de la sécurité sociale"]} true)) + (fun (_: _) -> integer_of_string "3")) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=148; start_column=11; end_line=148; end_column=41; + law_headings=["Allocations familiales"; "Champs d'applications"; + "Prologue"]})))) in + let result_: AllocationFamilialesAvril2008Out.t = (log_end_call + ["AllocationsFamiliales"; "version_avril_2008"; + "AllocationFamilialesAvril2008"] ((log_begin_call + ["AllocationsFamiliales"; "version_avril_2008"; + "AllocationFamilialesAvril2008"] allocation_familiales_avril2008) + ())) in + let version_avril_2008_dot_age_minimum_alinea_1_l521_3_: integer = result_.AllocationFamilialesAvril2008Out.age_minimum_alinea_1_l521_3_out in + let bmaf_dot_date_courante_: date = + try ((log_variable_definition + ["AllocationsFamiliales"; "bmaf.date_courante"] (embed_date) + (handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=143; start_column=3; end_line=143; end_column=7; + law_headings=["Allocations familiales"; "Champs d'applications"; + "Prologue"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=160; start_column=14; end_line=160; end_column=32; + law_headings=["Allocations familiales"; + "Champs d'applications"; "Prologue"]} true)) + (fun (_: _) -> date_courante_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/allocations_familiales/../base_mensuelle_allocations_familiales/bmaf.catala_fr"; + start_line=5; start_column=10; end_line=5; end_column=23; + law_headings=["Montant de la base mensuelle des allocations familiales"]})) in + let result_: BaseMensuelleAllocationsFamilialesOut.t = (log_end_call + ["AllocationsFamiliales"; "bmaf"; "BaseMensuelleAllocationsFamiliales"] + ((log_begin_call + ["AllocationsFamiliales"; "bmaf"; "BaseMensuelleAllocationsFamiliales"] + base_mensuelle_allocations_familiales) + {BaseMensuelleAllocationsFamilialesIn.date_courante_in = + bmaf_dot_date_courante_})) in + let bmaf_dot_montant_: money = result_.BaseMensuelleAllocationsFamilialesOut.montant_out in + let prestations_familiales_dot_date_courante_: date = + try ((log_variable_definition + ["AllocationsFamiliales"; "prestations_familiales.date_courante"] + (embed_date) + (handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=140; start_column=3; end_line=140; end_column=25; + law_headings=["Allocations familiales"; "Champs d'applications"; + "Prologue"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=156; start_column=14; end_line=156; end_column=50; + law_headings=["Allocations familiales"; + "Champs d'applications"; "Prologue"]} true)) + (fun (_: _) -> date_courante_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=63; start_column=10; end_line=63; end_column=23; + law_headings=["Prestations familiales"; "Champs d'applications"; + "Prologue"]})) in + let prestations_familiales_dot_prestation_courante_: ElementPrestationsFamiliales.t = + try ((log_variable_definition + ["AllocationsFamiliales"; "prestations_familiales.prestation_courante"] + (embed_element_prestations_familiales) + (handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=140; start_column=3; end_line=140; end_column=25; + law_headings=["Allocations familiales"; "Champs d'applications"; + "Prologue"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=154; start_column=14; end_line=154; end_column=56; + law_headings=["Allocations familiales"; + "Champs d'applications"; "Prologue"]} true)) + (fun (_: _) -> ElementPrestationsFamiliales.AllocationsFamiliales ())))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=64; start_column=10; end_line=64; end_column=29; + law_headings=["Prestations familiales"; "Champs d'applications"; + "Prologue"]})) in + let prestations_familiales_dot_residence_: Collectivite.t = + try ((log_variable_definition + ["AllocationsFamiliales"; "prestations_familiales.résidence"] + (embed_collectivite) + (handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=140; start_column=3; end_line=140; end_column=25; + law_headings=["Allocations familiales"; "Champs d'applications"; + "Prologue"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=158; start_column=14; end_line=158; end_column=46; + law_headings=["Allocations familiales"; + "Champs d'applications"; "Prologue"]} true)) + (fun (_: _) -> residence_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=65; start_column=10; end_line=65; end_column=19; + law_headings=["Prestations familiales"; "Champs d'applications"; + "Prologue"]})) in + let result_: PrestationsFamilialesOut.t = (log_end_call + ["AllocationsFamiliales"; "prestations_familiales"; + "PrestationsFamiliales"] ((log_begin_call + ["AllocationsFamiliales"; "prestations_familiales"; + "PrestationsFamiliales"] prestations_familiales) + {PrestationsFamilialesIn.date_courante_in = + prestations_familiales_dot_date_courante_; + PrestationsFamilialesIn.prestation_courante_in = + prestations_familiales_dot_prestation_courante_; + PrestationsFamilialesIn.residence_in = + prestations_familiales_dot_residence_})) in + let prestations_familiales_dot_droit_ouvert_: Enfant.t -> bool = result_.PrestationsFamilialesOut.droit_ouvert_out in + let prestations_familiales_dot_conditions_hors_age_: Enfant.t -> bool = result_.PrestationsFamilialesOut.conditions_hors_age_out in + let prestations_familiales_dot_age_l512_3_2_: integer = result_.PrestationsFamilialesOut.age_l512_3_2_out in + let prestations_familiales_dot_regime_outre_mer_l751_1_: bool = result_.PrestationsFamilialesOut.regime_outre_mer_l751_1_out in + let enfant_le_plus_age_dot_enfants_: Enfant.t array = + try ((log_variable_definition + ["AllocationsFamiliales"; "enfant_le_plus_âgé.enfants"] + (embed_array (embed_enfant)) + (handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=142; start_column=3; end_line=142; end_column=21; + law_headings=["Allocations familiales"; "Champs d'applications"; + "Prologue"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/epilogue.catala_fr"; + start_line=33; start_column=14; end_line=33; end_column=40; + law_headings=["Règles diverses"; "Épilogue"]} true)) + (fun (_: _) -> enfants_a_charge_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=80; start_column=10; end_line=80; end_column=17; + law_headings=["Allocations familiales"; "Champs d'applications"; + "Prologue"]})) in + let result_: EnfantLePlusAgeOut.t = (log_end_call + ["AllocationsFamiliales"; "enfant_le_plus_âgé"; "EnfantLePlusÂgé"] + ((log_begin_call + ["AllocationsFamiliales"; "enfant_le_plus_âgé"; "EnfantLePlusÂgé"] + enfant_le_plus_age) + {EnfantLePlusAgeIn.enfants_in = enfant_le_plus_age_dot_enfants_})) in + let enfant_le_plus_age_dot_le_plus_age_: Enfant.t = result_.EnfantLePlusAgeOut.le_plus_age_out in + let age_minimum_alinea_1_l521_3_: Enfant.t -> integer = (log_variable_definition + ["AllocationsFamiliales"; "âge_minimum_alinéa_1_l521_3"] (unembeddable) + ( + try + (fun (param_: Enfant.t) -> + try + (handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=147; start_column=11; end_line=147; end_column=38; + law_headings=["Allocations familiales"; + "Champs d'applications"; "Prologue"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=147; start_column=11; + end_line=147; end_column=38; + law_headings=["Allocations familiales"; + "Champs d'applications"; "Prologue"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/securite_sociale_R.catala_fr"; + start_line=83; start_column=19; + end_line=83; end_column=69; + law_headings=["Article R521-1"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets en Conseil d'Etat"; + "Code de la sécurité sociale"]} + (((param_.Enfant.date_de_naissance) +@ + (duration_of_numbers (11) (0) (0))) <=@ + (date_of_numbers (2008) (4) (30))))) + (fun (_: _) -> + version_avril_2008_dot_age_minimum_alinea_1_l521_3_))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/securite_sociale_R.catala_fr"; + start_line=56; start_column=14; + end_line=56; end_column=41; + law_headings=["Article R521-1"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets en Conseil d'Etat"; + "Code de la sécurité sociale"]} true)) + (fun (_: _) -> integer_of_string "14")) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=147; start_column=11; end_line=147; end_column=38; + law_headings=["Allocations familiales"; "Champs d'applications"; + "Prologue"]}))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=147; start_column=11; end_line=147; end_column=38; + law_headings=["Allocations familiales"; "Champs d'applications"; + "Prologue"]})))) in + 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)) ( + try + (handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=96; start_column=11; end_line=96; end_column=61; + law_headings=["Allocations familiales"; "Champs d'applications"; + "Prologue"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/securite_sociale_L.catala_fr"; + start_line=75; start_column=14; end_line=75; end_column=64; + law_headings=["Article L512-3"; + "Chapitre 2 : Champ d'application"; + "Titre 1 : Champ d'application - Généralités"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie législative"; + "Code de la sécurité sociale"]} true)) + (fun (_: _) -> + array_filter + (fun (enfant_: _) -> (log_end_call + ["PrestationsFamiliales"; "droit_ouvert"] + ((log_variable_definition + ["PrestationsFamiliales"; "droit_ouvert"; "output"] + (embed_bool) ((log_begin_call + ["PrestationsFamiliales"; "droit_ouvert"] + prestations_familiales_dot_droit_ouvert_) + ((log_variable_definition + ["PrestationsFamiliales"; "droit_ouvert"; "input"] + (embed_enfant) enfant_))))))) enfants_a_charge_)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=96; start_column=11; end_line=96; end_column=61; + 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) ( + try + (fun (param_: Enfant.t) -> + try + (handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=149; start_column=11; end_line=149; end_column=33; + law_headings=["Allocations familiales"; + "Champs d'applications"; "Prologue"]} ( + [||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/epilogue.catala_fr"; + start_line=34; start_column=14; + end_line=34; end_column=36; + law_headings=["Règles diverses"; "Épilogue"]} true)) + (fun (_: _) -> enfant_le_plus_age_dot_le_plus_age_ = param_)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=149; start_column=11; end_line=149; end_column=33; + law_headings=["Allocations familiales"; "Champs d'applications"; + "Prologue"]}))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=149; start_column=11; end_line=149; end_column=33; + 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) ( + try + (handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=151; start_column=11; end_line=151; end_column=28; + law_headings=["Allocations familiales"; "Champs d'applications"; + "Prologue"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=151; start_column=11; + end_line=151; end_column=28; + law_headings=["Allocations familiales"; + "Champs d'applications"; "Prologue"]} + ([|(fun (_: _) -> handle_default - [| - (fun (_ : _) -> - handle_default - [| - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = - "./securite_sociale_L.catala_fr"; - start_line = 60; - start_column = 5; - end_line = 62; - end_column = 32; - law_headings = - [ - "Article L512-3"; - "Chapitre 2 : Champ \ - d'application"; - "Titre 1 : Champ d'application \ - - Généralités"; - "Livre 5 : Prestations \ - familiales et prestations \ - assimilées"; - "Partie législative"; - "Code de la sécurité sociale"; - ]; - } - ((match - param_.Enfant.obligation_scolaire - with - | Avant _ -> false - | Pendant _ -> false - | Apres _ -> true) - && param_.Enfant.remuneration_mensuelle - <=$ plafond_l512_3_2_ - && param_.Enfant.age true)); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./securite_sociale_L.catala_fr"; - start_line = 49; - start_column = 5; - end_line = 50; - end_column = 50; - law_headings = - [ - "Article L512-3"; - "Chapitre 2 : Champ d'application"; - "Titre 1 : Champ d'application - \ - Généralités"; - "Livre 5 : Prestations familiales et \ - prestations assimilées"; - "Partie législative"; - "Code de la sécurité sociale"; - ]; - } - ((match - param_.Enfant.obligation_scolaire - with - | Avant _ -> true - | Pendant _ -> false - | Apres _ -> false) - || - match param_.Enfant.obligation_scolaire with - | Avant _ -> false - | Pendant _ -> true - | Apres _ -> false)) - (fun (_ : _) -> true)); - |] - (fun (_ : _) -> false) - (fun (_ : _) -> raise EmptyError))); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./prologue.catala_fr"; - start_line = 58; - start_column = 3; - end_line = 58; - end_column = 49; - law_headings = - [ - "Prestations familiales"; - "Champs d'applications"; - "Prologue"; - ]; - } - true) - (fun (_ : _) -> false) - with EmptyError -> - raise - (NoValueProvided - { - filename = "./prologue.catala_fr"; - start_line = 58; - start_column = 10; - end_line = 58; - end_column = 22; - law_headings = - [ - "Prestations familiales"; - "Champs d'applications"; - "Prologue"; - ]; - }) - with EmptyError -> - raise - (NoValueProvided - { - filename = "./prologue.catala_fr"; - start_line = 58; - start_column = 10; - end_line = 58; - end_column = 22; - law_headings = - [ - "Prestations familiales"; "Champs d'applications"; "Prologue"; - ]; - })) - in - { - PrestationsFamilialesOut.droit_ouvert_out = droit_ouvert_; - PrestationsFamilialesOut.conditions_hors_age_out = conditions_hors_age_; - PrestationsFamilialesOut.age_l512_3_2_out = age_l512_3_2_; - PrestationsFamilialesOut.regime_outre_mer_l751_1_out = - regime_outre_mer_l751_1_; - } - -let allocations_familiales - (allocations_familiales_in : AllocationsFamilialesIn.t) : - AllocationsFamilialesOut.t = - let personne_charge_effective_permanente_est_parent_ : bool = - allocations_familiales_in - .AllocationsFamilialesIn - .personne_charge_effective_permanente_est_parent_in - in - let personne_charge_effective_permanente_remplit_titre__i_ : bool = - allocations_familiales_in - .AllocationsFamilialesIn - .personne_charge_effective_permanente_remplit_titre_I_in - in - let ressources_menage_ : money = - allocations_familiales_in.AllocationsFamilialesIn.ressources_menage_in - in - let residence_ : collectivite = - allocations_familiales_in.AllocationsFamilialesIn.residence_in - in - let date_courante_ : date = - allocations_familiales_in.AllocationsFamilialesIn.date_courante_in - in - 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 -> prise_en_compte = - log_variable_definition - ["AllocationsFamiliales"; "prise_en_compte"] - unembeddable - (try - fun (param_ : Enfant.t) -> - try - handle_default - [| - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./securite_sociale_L.catala_fr"; - start_line = 253; - start_column = 5; - end_line = 254; - end_column = 56; - law_headings = - [ - "Article L521-2"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et \ - prestations assimilées"; - "Partie législative"; - "Code de la sécurité sociale"; - ]; - } - (match param_.Enfant.prise_en_charge with - | GardeAlterneePartageAllocations _ -> false - | GardeAlterneeAllocataireUnique _ -> false - | EffectiveEtPermanente _ -> false - | ServicesSociauxAllocationVerseeALaFamille _ -> false - | ServicesSociauxAllocationVerseeAuxServicesSociaux _ - -> - true)) - (fun (_ : _) -> Zero ())); - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./securite_sociale_L.catala_fr"; - start_line = 214; - start_column = 5; - end_line = 214; - end_column = 70; - law_headings = - [ - "Article L521-2"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et \ - prestations assimilées"; - "Partie législative"; - "Code de la sécurité sociale"; - ]; - } - (match param_.Enfant.prise_en_charge with - | GardeAlterneePartageAllocations _ -> true - | GardeAlterneeAllocataireUnique _ -> false - | EffectiveEtPermanente _ -> false - | ServicesSociauxAllocationVerseeALaFamille _ -> false - | ServicesSociauxAllocationVerseeAuxServicesSociaux _ - -> - false)) - (fun (_ : _) -> Partagee ())); - (fun (_ : _) -> - handle_default - [| - (fun (_ : _) -> - handle_default - [| - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = - "./securite_sociale_L.catala_fr"; - start_line = 184; - start_column = 5; - end_line = 184; - end_column = 60; - law_headings = - [ - "Article L521-2"; - "Chapitre 1er : Allocations \ - familiales"; - "Titre 2 : Prestations générales \ - d'entretien"; - "Livre 5 : Prestations familiales \ - et prestations assimilées"; - "Partie législative"; - "Code de la sécurité sociale"; - ]; - } - (match param_.Enfant.prise_en_charge with - | GardeAlterneePartageAllocations _ -> - false - | GardeAlterneeAllocataireUnique _ -> false - | EffectiveEtPermanente _ -> true - | ServicesSociauxAllocationVerseeALaFamille - _ -> - false - | ServicesSociauxAllocationVerseeAuxServicesSociaux - _ -> - false)) - (fun (_ : _) -> Complete ())); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./securite_sociale_L.catala_fr"; - start_line = 204; - start_column = 5; - end_line = 204; - end_column = 69; - law_headings = - [ - "Article L521-2"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales \ - d'entretien"; - "Livre 5 : Prestations familiales et \ - prestations assimilées"; - "Partie législative"; - "Code de la sécurité sociale"; - ]; - } - (match param_.Enfant.prise_en_charge with - | GardeAlterneePartageAllocations _ -> false - | GardeAlterneeAllocataireUnique _ -> true - | EffectiveEtPermanente _ -> false - | ServicesSociauxAllocationVerseeALaFamille _ -> - false - | ServicesSociauxAllocationVerseeAuxServicesSociaux - _ -> - false)) - (fun (_ : _) -> Complete ())); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./securite_sociale_L.catala_fr"; - start_line = 263; - start_column = 5; - end_line = 264; - end_column = 48; - law_headings = - [ - "Article L521-2"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et \ - prestations assimilées"; - "Partie législative"; - "Code de la sécurité sociale"; - ]; - } - (match param_.Enfant.prise_en_charge with - | GardeAlterneePartageAllocations _ -> false - | GardeAlterneeAllocataireUnique _ -> false - | EffectiveEtPermanente _ -> false - | ServicesSociauxAllocationVerseeALaFamille _ -> true - | ServicesSociauxAllocationVerseeAuxServicesSociaux _ - -> - false)) - (fun (_ : _) -> Complete ())); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./prologue.catala_fr"; - start_line = 98; - start_column = 3; - end_line = 98; - end_column = 65; - law_headings = - [ - "Allocations familiales"; - "Champs d'applications"; - "Prologue"; - ]; - } - false) - (fun (_ : _) -> raise EmptyError) - with EmptyError -> - raise - (NoValueProvided - { - filename = "./prologue.catala_fr"; - start_line = 98; - start_column = 11; - end_line = 98; - end_column = 26; - law_headings = - [ - "Allocations familiales"; - "Champs d'applications"; - "Prologue"; - ]; - }) - with EmptyError -> - raise - (NoValueProvided - { - filename = "./prologue.catala_fr"; - start_line = 98; - start_column = 11; - end_line = 98; - end_column = 26; - law_headings = - [ - "Allocations familiales"; "Champs d'applications"; "Prologue"; - ]; - })) - in - let versement_ : Enfant.t -> versement_allocations = - log_variable_definition - ["AllocationsFamiliales"; "versement"] - unembeddable - (try - fun (param_ : Enfant.t) -> - try - handle_default - [| - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./securite_sociale_L.catala_fr"; - start_line = 258; - start_column = 5; - end_line = 259; - end_column = 56; - law_headings = - [ - "Article L521-2"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et \ - prestations assimilées"; - "Partie législative"; - "Code de la sécurité sociale"; - ]; - } - (match param_.Enfant.prise_en_charge with - | GardeAlterneePartageAllocations _ -> false - | GardeAlterneeAllocataireUnique _ -> false - | EffectiveEtPermanente _ -> false - | ServicesSociauxAllocationVerseeALaFamille _ -> false - | ServicesSociauxAllocationVerseeAuxServicesSociaux _ - -> - true)) - (fun (_ : _) -> AllocationVerseeAuxServicesSociaux ())); - (fun (_ : _) -> - handle_default - [| - (fun (_ : _) -> - handle_default - [| - (fun (_ : _) -> - handle_default - [| - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = - "./securite_sociale_L.catala_fr"; - start_line = 188; - start_column = 5; - end_line = 188; - end_column = 60; - law_headings = - [ - "Article L521-2"; - "Chapitre 1er : Allocations \ - familiales"; - "Titre 2 : Prestations \ - générales d'entretien"; - "Livre 5 : Prestations \ - familiales et prestations \ - assimilées"; - "Partie législative"; - "Code de la sécurité sociale"; - ]; - } - (match - param_.Enfant.prise_en_charge - with - | GardeAlterneePartageAllocations _ - -> - false - | GardeAlterneeAllocataireUnique _ -> - false - | EffectiveEtPermanente _ -> true - | ServicesSociauxAllocationVerseeALaFamille - _ -> - false - | ServicesSociauxAllocationVerseeAuxServicesSociaux - _ -> - false)) - (fun (_ : _) -> Normal ())); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = - "./securite_sociale_L.catala_fr"; - start_line = 208; - start_column = 5; - end_line = 208; - end_column = 69; - law_headings = - [ - "Article L521-2"; - "Chapitre 1er : Allocations \ - familiales"; - "Titre 2 : Prestations générales \ - d'entretien"; - "Livre 5 : Prestations familiales \ - et prestations assimilées"; - "Partie législative"; - "Code de la sécurité sociale"; - ]; - } - (match param_.Enfant.prise_en_charge with - | GardeAlterneePartageAllocations _ -> - false - | GardeAlterneeAllocataireUnique _ -> true - | EffectiveEtPermanente _ -> false - | ServicesSociauxAllocationVerseeALaFamille - _ -> - false - | ServicesSociauxAllocationVerseeAuxServicesSociaux - _ -> - false)) - (fun (_ : _) -> Normal ())); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./securite_sociale_L.catala_fr"; - start_line = 218; - start_column = 5; - end_line = 218; - end_column = 70; - law_headings = - [ - "Article L521-2"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales \ - d'entretien"; - "Livre 5 : Prestations familiales et \ - prestations assimilées"; - "Partie législative"; - "Code de la sécurité sociale"; - ]; - } - (match param_.Enfant.prise_en_charge with - | GardeAlterneePartageAllocations _ -> true - | GardeAlterneeAllocataireUnique _ -> false - | EffectiveEtPermanente _ -> false - | ServicesSociauxAllocationVerseeALaFamille _ -> - false - | ServicesSociauxAllocationVerseeAuxServicesSociaux - _ -> - false)) - (fun (_ : _) -> Normal ())); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./securite_sociale_L.catala_fr"; - start_line = 269; - start_column = 5; - end_line = 270; - end_column = 48; - law_headings = - [ - "Article L521-2"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et \ - prestations assimilées"; - "Partie législative"; - "Code de la sécurité sociale"; - ]; - } - (match param_.Enfant.prise_en_charge with - | GardeAlterneePartageAllocations _ -> false - | GardeAlterneeAllocataireUnique _ -> false - | EffectiveEtPermanente _ -> false - | ServicesSociauxAllocationVerseeALaFamille _ -> true - | ServicesSociauxAllocationVerseeAuxServicesSociaux _ - -> - false)) - (fun (_ : _) -> Normal ())); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./prologue.catala_fr"; - start_line = 99; - start_column = 3; - end_line = 99; - end_column = 66; - law_headings = - [ - "Allocations familiales"; - "Champs d'applications"; - "Prologue"; - ]; - } - false) - (fun (_ : _) -> raise EmptyError) - with EmptyError -> - raise - (NoValueProvided - { - filename = "./prologue.catala_fr"; - start_line = 99; - start_column = 11; - end_line = 99; - end_column = 20; - law_headings = - [ - "Allocations familiales"; - "Champs d'applications"; - "Prologue"; - ]; - }) - with EmptyError -> - raise - (NoValueProvided - { - filename = "./prologue.catala_fr"; - start_line = 99; - start_column = 11; - end_line = 99; - end_column = 20; - law_headings = - [ - "Allocations familiales"; "Champs d'applications"; "Prologue"; - ]; - })) - in - let nombre_enfants_l521_1_ : integer = - log_variable_definition - ["AllocationsFamiliales"; "nombre_enfants_l521_1"] - embed_integer - (try - handle_default - [| - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./securite_sociale_D.catala_fr"; - start_line = 291; - start_column = 14; - end_line = 291; - end_column = 35; - law_headings = - [ - "Article D521-2"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et prestations \ - assimilées"; - "Partie réglementaire - Décrets simples"; - "Code de la sécurité sociale"; - ]; - } - true) - (fun (_ : _) -> integer_of_string "3")); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./prologue.catala_fr"; - start_line = 146; - start_column = 41; - end_line = 146; - end_column = 47; - law_headings = - [ - "Allocations familiales"; - "Champs d'applications"; - "Prologue"; - ]; - } - false) - (fun (_ : _) -> raise EmptyError) - with EmptyError -> - raise - (NoValueProvided - { - filename = "./prologue.catala_fr"; - start_line = 146; - start_column = 11; - end_line = 146; - end_column = 32; - law_headings = - [ - "Allocations familiales"; "Champs d'applications"; "Prologue"; - ]; - })) - in - let nombre_enfants_alinea_2_l521_3_ : integer = - log_variable_definition - ["AllocationsFamiliales"; "nombre_enfants_alinéa_2_l521_3"] - embed_integer - (try - handle_default - [| - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./securite_sociale_R.catala_fr"; - start_line = 64; - start_column = 14; - end_line = 64; - end_column = 44; - law_headings = - [ - "Article R521-1"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et prestations \ - assimilées"; - "Partie réglementaire - Décrets en Conseil d'Etat"; - "Code de la sécurité sociale"; - ]; - } - true) - (fun (_ : _) -> integer_of_string "3")); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./prologue.catala_fr"; - start_line = 148; - start_column = 50; - end_line = 148; - end_column = 56; - law_headings = - [ - "Allocations familiales"; - "Champs d'applications"; - "Prologue"; - ]; - } - false) - (fun (_ : _) -> raise EmptyError) - with EmptyError -> - raise - (NoValueProvided - { - filename = "./prologue.catala_fr"; - start_line = 148; - start_column = 11; - end_line = 148; - end_column = 41; - law_headings = - [ - "Allocations familiales"; "Champs d'applications"; "Prologue"; - ]; - })) - in - let result_ : AllocationFamilialesAvril2008Out.t = - log_end_call - [ - "AllocationsFamiliales"; - "version_avril_2008"; - "AllocationFamilialesAvril2008"; - ] - ((log_begin_call - [ - "AllocationsFamiliales"; - "version_avril_2008"; - "AllocationFamilialesAvril2008"; - ] - allocation_familiales_avril2008) - ()) - in - let version_avril_2008_dot_age_minimum_alinea_1_l521_3_ : integer = - result_.AllocationFamilialesAvril2008Out.age_minimum_alinea_1_l521_3_out - in - let bmaf_dot_date_courante_ : date = + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=151; start_column=11; + end_line=151; end_column=28; + law_headings=["Allocations familiales"; + "Champs d'applications"; + "Prologue"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/decrets_divers.catala_fr"; + start_line=30; start_column=5; + end_line=30; end_column=69; + law_headings=["Circulaire interministérielle N° DSS/SD2B/2017/352 du 22 décembre 2017 relative à la revalorisation au 1er janvier 2018 des plafonds de ressources d’attribution de certaines prestations familiales servies en métropole, en Guadeloupe, en Guyane, en Martinique, à la Réunion, à Saint-Barthélemy, à Saint-Martin et à Mayotte"; + "Montant des plafonds de ressources"]} + ((date_courante_ >=@ + (date_of_numbers (2018) (1) (1))) && + (date_courante_ <=@ + (date_of_numbers (2018) (12) (31)))))) + (fun (_: _) -> + (money_of_cents_string "7877000") +$ + ((money_of_cents_string "562800") *$ + (decimal_of_integer + (array_length + enfants_a_charge_droit_ouvert_prestation_familiale_))))); + (fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=151; start_column=11; + end_line=151; end_column=28; + law_headings=["Allocations familiales"; + "Champs d'applications"; + "Prologue"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/decrets_divers.catala_fr"; + start_line=63; start_column=5; + end_line=63; end_column=69; + law_headings=["Instruction interministérielle n° DSS/SD2B/2018/279 du 17 décembre 2018 relative à la revalorisation au 1er janvier 2019 des plafonds de ressources d’attribution de certaines prestations familiales servies en métropole, en Guadeloupe, en Guyane, en Martinique, à la Réunion, à Saint-Barthélemy, à Saint-Martin et à Mayotte"; + "Montant des plafonds de ressources"]} + ((date_courante_ >=@ + (date_of_numbers (2019) (1) (1))) && + (date_courante_ <=@ + (date_of_numbers (2019) (12) (31)))))) + (fun (_: _) -> + (money_of_cents_string "7955800") +$ + ((money_of_cents_string "568400") *$ + (decimal_of_integer + (array_length + enfants_a_charge_droit_ouvert_prestation_familiale_))))); + (fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=151; start_column=11; + end_line=151; end_column=28; + law_headings=["Allocations familiales"; + "Champs d'applications"; + "Prologue"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/decrets_divers.catala_fr"; + start_line=96; start_column=5; + end_line=96; end_column=69; + law_headings=["Instruction interministerielle no DSS/SD2B/2019/261 du 18 décembre 2019 relative à la revalorisation au 1er janvier 2020 des plafonds de ressources d’attribution de certaines prestations familiales servies en métropole, en Guadeloupe, en Guyane, en Martinique, à La Réunion, à Saint-Barthélemy, à Saint-Martin et à Mayotte"; + "Montant des plafonds de ressources"]} + ((date_courante_ >=@ + (date_of_numbers (2020) (1) (1))) && + (date_courante_ <=@ + (date_of_numbers (2020) (12) (31)))))) + (fun (_: _) -> + (money_of_cents_string "8083100") +$ + ((money_of_cents_string "577500") *$ + (decimal_of_integer + (array_length + enfants_a_charge_droit_ouvert_prestation_familiale_))))); + (fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=151; start_column=11; + end_line=151; end_column=28; + law_headings=["Allocations familiales"; + "Champs d'applications"; + "Prologue"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/decrets_divers.catala_fr"; + start_line=132; start_column=5; + end_line=132; end_column=69; + law_headings=["Article 1"; + "Arrêté du 14 décembre 2020 relatif au montant des plafonds de ressources de certaines prestations familiales et aux tranches du barème applicable au recouvrement des indus et à la saisie des prestations"; + "Montant des plafonds de ressources"]} + ((date_courante_ >=@ + (date_of_numbers (2021) (1) (1))) && + (date_courante_ <=@ + (date_of_numbers (2021) (12) (31)))))) + (fun (_: _) -> + (money_of_cents_string "8155800") +$ + ((money_of_cents_string "582700") *$ + (decimal_of_integer + (array_length + enfants_a_charge_droit_ouvert_prestation_familiale_)))))|]) + (fun (_: _) -> false) (fun (_: _) -> raise EmptyError))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/securite_sociale_D.catala_fr"; + start_line=311; start_column=14; end_line=311; end_column=31; + law_headings=["Article D521-3"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"]} true)) + (fun (_: _) -> + (money_of_cents_string "7830000") +$ + ((money_of_cents_string "559500") *$ + (decimal_of_integer + (array_length + enfants_a_charge_droit_ouvert_prestation_familiale_))))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=151; start_column=11; end_line=151; end_column=28; + 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) ( try - log_variable_definition - ["AllocationsFamiliales"; "bmaf.date_courante"] - embed_date - (handle_default - [| - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./prologue.catala_fr"; - start_line = 160; - start_column = 14; - end_line = 160; - end_column = 32; - law_headings = - [ - "Allocations familiales"; - "Champs d'applications"; - "Prologue"; - ]; - } - true) - (fun (_ : _) -> date_courante_)); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = - "./../base_mensuelle_allocations_familiales/bmaf.catala_fr"; - start_line = 5; - start_column = 32; - end_line = 5; - end_column = 36; - law_headings = - ["Montant de la base mensuelle des allocations familiales"]; - } - false) - (fun (_ : _) -> raise EmptyError)) - with EmptyError -> - raise - (NoValueProvided - { - filename = - "./../base_mensuelle_allocations_familiales/bmaf.catala_fr"; - start_line = 5; - start_column = 10; - end_line = 5; - end_column = 23; - law_headings = - ["Montant de la base mensuelle des allocations familiales"]; - }) - in - let result_ : BaseMensuelleAllocationsFamilialesOut.t = - log_end_call - ["AllocationsFamiliales"; "bmaf"; "BaseMensuelleAllocationsFamiliales"] - ((log_begin_call - [ - "AllocationsFamiliales"; "bmaf"; "BaseMensuelleAllocationsFamiliales"; - ] - base_mensuelle_allocations_familiales) - { - BaseMensuelleAllocationsFamilialesIn.date_courante_in = - bmaf_dot_date_courante_; - }) - in - let bmaf_dot_montant_ : money = - result_.BaseMensuelleAllocationsFamilialesOut.montant_out - in - let prestations_familiales_dot_date_courante_ : date = + (handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=150; start_column=11; end_line=150; end_column=27; + law_headings=["Allocations familiales"; "Champs d'applications"; + "Prologue"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=150; start_column=11; + end_line=150; end_column=27; + law_headings=["Allocations familiales"; + "Champs d'applications"; "Prologue"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=150; start_column=11; + end_line=150; end_column=27; + law_headings=["Allocations familiales"; + "Champs d'applications"; + "Prologue"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/decrets_divers.catala_fr"; + start_line=23; start_column=5; + end_line=23; end_column=69; + law_headings=["Circulaire interministérielle N° DSS/SD2B/2017/352 du 22 décembre 2017 relative à la revalorisation au 1er janvier 2018 des plafonds de ressources d’attribution de certaines prestations familiales servies en métropole, en Guadeloupe, en Guyane, en Martinique, à la Réunion, à Saint-Barthélemy, à Saint-Martin et à Mayotte"; + "Montant des plafonds de ressources"]} + ((date_courante_ >=@ + (date_of_numbers (2018) (1) (1))) && + (date_courante_ <=@ + (date_of_numbers (2018) (12) (31)))))) + (fun (_: _) -> + (money_of_cents_string "5628600") +$ + ((money_of_cents_string "562800") *$ + (decimal_of_integer + (array_length + enfants_a_charge_droit_ouvert_prestation_familiale_))))); + (fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=150; start_column=11; + end_line=150; end_column=27; + law_headings=["Allocations familiales"; + "Champs d'applications"; + "Prologue"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/decrets_divers.catala_fr"; + start_line=56; start_column=5; + end_line=56; end_column=69; + law_headings=["Instruction interministérielle n° DSS/SD2B/2018/279 du 17 décembre 2018 relative à la revalorisation au 1er janvier 2019 des plafonds de ressources d’attribution de certaines prestations familiales servies en métropole, en Guadeloupe, en Guyane, en Martinique, à la Réunion, à Saint-Barthélemy, à Saint-Martin et à Mayotte"; + "Montant des plafonds de ressources"]} + ((date_courante_ >=@ + (date_of_numbers (2019) (1) (1))) && + (date_courante_ <=@ + (date_of_numbers (2019) (12) (31)))))) + (fun (_: _) -> + (money_of_cents_string "5684900") +$ + ((money_of_cents_string "568400") *$ + (decimal_of_integer + (array_length + enfants_a_charge_droit_ouvert_prestation_familiale_))))); + (fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=150; start_column=11; + end_line=150; end_column=27; + law_headings=["Allocations familiales"; + "Champs d'applications"; + "Prologue"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/decrets_divers.catala_fr"; + start_line=89; start_column=5; + end_line=89; end_column=69; + law_headings=["Instruction interministerielle no DSS/SD2B/2019/261 du 18 décembre 2019 relative à la revalorisation au 1er janvier 2020 des plafonds de ressources d’attribution de certaines prestations familiales servies en métropole, en Guadeloupe, en Guyane, en Martinique, à La Réunion, à Saint-Barthélemy, à Saint-Martin et à Mayotte"; + "Montant des plafonds de ressources"]} + ((date_courante_ >=@ + (date_of_numbers (2020) (1) (1))) && + (date_courante_ <=@ + (date_of_numbers (2020) (12) (31)))))) + (fun (_: _) -> + (money_of_cents_string "5775900") +$ + ((money_of_cents_string "577500") *$ + (decimal_of_integer + (array_length + enfants_a_charge_droit_ouvert_prestation_familiale_))))); + (fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=150; start_column=11; + end_line=150; end_column=27; + law_headings=["Allocations familiales"; + "Champs d'applications"; + "Prologue"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/decrets_divers.catala_fr"; + start_line=116; start_column=5; + end_line=116; end_column=69; + law_headings=["Article 1"; + "Arrêté du 14 décembre 2020 relatif au montant des plafonds de ressources de certaines prestations familiales et aux tranches du barème applicable au recouvrement des indus et à la saisie des prestations"; + "Montant des plafonds de ressources"]} + ((date_courante_ >=@ + (date_of_numbers (2021) (1) (1))) && + (date_courante_ <=@ + (date_of_numbers (2021) (12) (31)))))) + (fun (_: _) -> + (money_of_cents_string "5827900") +$ + ((money_of_cents_string "582700") *$ + (decimal_of_integer + (array_length + enfants_a_charge_droit_ouvert_prestation_familiale_)))))|]) + (fun (_: _) -> false) (fun (_: _) -> raise EmptyError))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/securite_sociale_D.catala_fr"; + start_line=301; start_column=14; end_line=301; end_column=30; + law_headings=["Article D521-3"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"]} true)) + (fun (_: _) -> + (money_of_cents_string "5595000") +$ + ((money_of_cents_string "559500") *$ + (decimal_of_integer + (array_length + enfants_a_charge_droit_ouvert_prestation_familiale_))))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=150; start_column=11; end_line=150; end_column=27; + law_headings=["Allocations familiales"; "Champs d'applications"; + "Prologue"]})))) in + let droit_ouvert_complement_: bool = (log_variable_definition + ["AllocationsFamiliales"; "droit_ouvert_complément"] (embed_bool) ( try - log_variable_definition - ["AllocationsFamiliales"; "prestations_familiales.date_courante"] - embed_date - (handle_default - [| - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./prologue.catala_fr"; - start_line = 156; - start_column = 14; - end_line = 156; - end_column = 50; - law_headings = - [ - "Allocations familiales"; - "Champs d'applications"; - "Prologue"; - ]; - } - true) - (fun (_ : _) -> date_courante_)); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./prologue.catala_fr"; - start_line = 63; - start_column = 32; - end_line = 63; - end_column = 36; - law_headings = - [ - "Prestations familiales"; - "Champs d'applications"; - "Prologue"; - ]; - } - false) - (fun (_ : _) -> raise EmptyError)) - with EmptyError -> - raise - (NoValueProvided - { - filename = "./prologue.catala_fr"; - start_line = 63; - start_column = 10; - end_line = 63; - end_column = 23; - law_headings = - ["Prestations familiales"; "Champs d'applications"; "Prologue"]; - }) - in - let prestations_familiales_dot_prestation_courante_ : - element_prestations_familiales = + (handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=133; start_column=11; end_line=133; end_column=34; + law_headings=["Allocations familiales"; "Champs d'applications"; + "Prologue"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=133; start_column=11; + end_line=133; end_column=34; + law_headings=["Allocations familiales"; + "Champs d'applications"; "Prologue"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=133; start_column=11; + end_line=133; end_column=34; + law_headings=["Allocations familiales"; + "Champs d'applications"; + "Prologue"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/securite_sociale_L.catala_fr"; + start_line=426; start_column=5; + end_line=427; end_column=71; + law_headings=["Article L755-12"; + "Chapitre 5 : Prestations familiales et prestations assimilées"; + "Titre 5 : Dispositions particulières à la Guadeloupe, à la Guyane, à la Martinique, à La Réunion, à Saint-Barthélemy et à Saint-Martin"; + "Livre 7 : Régimes divers - Dispositions diverses"; + "Partie législative"; + "Code de la sécurité sociale"]} + (prestations_familiales_dot_regime_outre_mer_l751_1_ + && + ((array_length + enfants_a_charge_droit_ouvert_prestation_familiale_) + = (integer_of_string "1"))))) + (fun (_: _) -> false))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/epilogue.catala_fr"; + start_line=31; start_column=9; + end_line=31; end_column=32; + law_headings=["Règles diverses"; "Épilogue"]} true)) + (fun (_: _) -> true))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=133; start_column=11; end_line=133; end_column=34; + law_headings=["Allocations familiales"; + "Champs d'applications"; "Prologue"]} true)) + (fun (_: _) -> false)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=133; start_column=11; end_line=133; end_column=34; + law_headings=["Allocations familiales"; "Champs d'applications"; + "Prologue"]})))) in + let droit_ouvert_forfaitaire_: Enfant.t -> bool = (log_variable_definition + ["AllocationsFamiliales"; "droit_ouvert_forfaitaire"] (unembeddable) ( try - log_variable_definition - ["AllocationsFamiliales"; "prestations_familiales.prestation_courante"] - embed_element_prestations_familiales - (handle_default - [| - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./prologue.catala_fr"; - start_line = 154; - start_column = 14; - end_line = 154; - end_column = 56; - law_headings = - [ - "Allocations familiales"; - "Champs d'applications"; - "Prologue"; - ]; - } - true) - (fun (_ : _) -> AllocationsFamiliales ())); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./prologue.catala_fr"; - start_line = 64; - start_column = 38; - end_line = 64; - end_column = 66; - law_headings = - [ - "Prestations familiales"; - "Champs d'applications"; - "Prologue"; - ]; - } - false) - (fun (_ : _) -> raise EmptyError)) - with EmptyError -> - raise - (NoValueProvided - { - filename = "./prologue.catala_fr"; - start_line = 64; - start_column = 10; - end_line = 64; - end_column = 29; - law_headings = - ["Prestations familiales"; "Champs d'applications"; "Prologue"]; - }) - in - let prestations_familiales_dot_residence_ : collectivite = - try - log_variable_definition - ["AllocationsFamiliales"; "prestations_familiales.résidence"] - embed_collectivite - (handle_default - [| - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./prologue.catala_fr"; - start_line = 158; - start_column = 14; - end_line = 158; - end_column = 46; - law_headings = - [ - "Allocations familiales"; - "Champs d'applications"; - "Prologue"; - ]; - } - true) - (fun (_ : _) -> residence_)); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./prologue.catala_fr"; - start_line = 65; - start_column = 28; - end_line = 65; - end_column = 40; - law_headings = - [ - "Prestations familiales"; - "Champs d'applications"; - "Prologue"; - ]; - } - false) - (fun (_ : _) -> raise EmptyError)) - with EmptyError -> - raise - (NoValueProvided - { - filename = "./prologue.catala_fr"; - start_line = 65; - start_column = 10; - end_line = 65; - end_column = 19; - law_headings = - ["Prestations familiales"; "Champs d'applications"; "Prologue"]; - }) - in - let result_ : PrestationsFamilialesOut.t = - log_end_call - [ - "AllocationsFamiliales"; - "prestations_familiales"; - "PrestationsFamiliales"; - ] - ((log_begin_call - [ - "AllocationsFamiliales"; - "prestations_familiales"; - "PrestationsFamiliales"; - ] - prestations_familiales) - { - PrestationsFamilialesIn.date_courante_in = - prestations_familiales_dot_date_courante_; - PrestationsFamilialesIn.prestation_courante_in = - prestations_familiales_dot_prestation_courante_; - PrestationsFamilialesIn.residence_in = - prestations_familiales_dot_residence_; - }) - in - let prestations_familiales_dot_droit_ouvert_ : Enfant.t -> bool = - result_.PrestationsFamilialesOut.droit_ouvert_out - in - let prestations_familiales_dot_conditions_hors_age_ : Enfant.t -> bool = - result_.PrestationsFamilialesOut.conditions_hors_age_out - in - let prestations_familiales_dot_age_l512_3_2_ : integer = - result_.PrestationsFamilialesOut.age_l512_3_2_out - in - let prestations_familiales_dot_regime_outre_mer_l751_1_ : bool = - result_.PrestationsFamilialesOut.regime_outre_mer_l751_1_out - in - let enfant_le_plus_age_dot_enfants_ : Enfant.t array = - try - log_variable_definition - ["AllocationsFamiliales"; "enfant_le_plus_âgé.enfants"] - (embed_array embed_enfant) - (handle_default - [| - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./epilogue.catala_fr"; - start_line = 33; - start_column = 14; - end_line = 33; - end_column = 40; - law_headings = ["Règles diverses"; "Épilogue"]; - } - true) - (fun (_ : _) -> enfants_a_charge_)); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./prologue.catala_fr"; - start_line = 80; - start_column = 26; - end_line = 80; - end_column = 43; - law_headings = - [ - "Allocations familiales"; - "Champs d'applications"; - "Prologue"; - ]; - } - false) - (fun (_ : _) -> raise EmptyError)) - with EmptyError -> - raise - (NoValueProvided - { - filename = "./prologue.catala_fr"; - start_line = 80; - start_column = 10; - end_line = 80; - end_column = 17; - law_headings = - ["Allocations familiales"; "Champs d'applications"; "Prologue"]; - }) - in - let result_ : EnfantLePlusAgeOut.t = - log_end_call - ["AllocationsFamiliales"; "enfant_le_plus_âgé"; "EnfantLePlusÂgé"] - ((log_begin_call - ["AllocationsFamiliales"; "enfant_le_plus_âgé"; "EnfantLePlusÂgé"] - enfant_le_plus_age) - { EnfantLePlusAgeIn.enfants_in = enfant_le_plus_age_dot_enfants_ }) - in - let enfant_le_plus_age_dot_le_plus_age_ : Enfant.t = - result_.EnfantLePlusAgeOut.le_plus_age_out - in - let age_minimum_alinea_1_l521_3_ : Enfant.t -> integer = - log_variable_definition - ["AllocationsFamiliales"; "âge_minimum_alinéa_1_l521_3"] - unembeddable - (try - fun (param_ : Enfant.t) -> - try - handle_default - [| - (fun (_ : _) -> - handle_default - [| - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./securite_sociale_R.catala_fr"; - start_line = 83; - start_column = 19; - end_line = 83; - end_column = 69; - law_headings = - [ - "Article R521-1"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales \ - d'entretien"; - "Livre 5 : Prestations familiales et \ - prestations assimilées"; - "Partie réglementaire - Décrets en \ - Conseil d'Etat"; - "Code de la sécurité sociale"; - ]; - } - (param_.Enfant.date_de_naissance - +@ duration_of_numbers 11 0 0 - <=@ date_of_numbers 2008 4 30)) - (fun (_ : _) -> - version_avril_2008_dot_age_minimum_alinea_1_l521_3_)); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./securite_sociale_R.catala_fr"; - start_line = 56; - start_column = 14; - end_line = 56; - end_column = 41; - law_headings = - [ - "Article R521-1"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et \ - prestations assimilées"; - "Partie réglementaire - Décrets en Conseil \ - d'Etat"; - "Code de la sécurité sociale"; - ]; - } - true) - (fun (_ : _) -> integer_of_string "14")); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./prologue.catala_fr"; - start_line = 147; - start_column = 3; - end_line = 147; - end_column = 70; - law_headings = - [ - "Allocations familiales"; - "Champs d'applications"; - "Prologue"; - ]; - } - false) - (fun (_ : _) -> raise EmptyError) - with EmptyError -> - raise - (NoValueProvided - { - filename = "./prologue.catala_fr"; - start_line = 147; - start_column = 11; - end_line = 147; - end_column = 38; - law_headings = - [ - "Allocations familiales"; - "Champs d'applications"; - "Prologue"; - ]; - }) - with EmptyError -> - raise - (NoValueProvided - { - filename = "./prologue.catala_fr"; - start_line = 147; - start_column = 11; - end_line = 147; - end_column = 38; - law_headings = - [ - "Allocations familiales"; "Champs d'applications"; "Prologue"; - ]; - })) - in - 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) - (try - handle_default - [| - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./securite_sociale_L.catala_fr"; - start_line = 75; - start_column = 14; - end_line = 75; - end_column = 64; - law_headings = - [ - "Article L512-3"; - "Chapitre 2 : Champ d'application"; - "Titre 1 : Champ d'application - Généralités"; - "Livre 5 : Prestations familiales et prestations \ - assimilées"; - "Partie législative"; - "Code de la sécurité sociale"; - ]; - } - true) - (fun (_ : _) -> - array_filter - (fun (enfant_ : _) -> - log_end_call - ["PrestationsFamiliales"; "droit_ouvert"] - (log_variable_definition - ["PrestationsFamiliales"; "droit_ouvert"; "output"] - embed_bool - ((log_begin_call - ["PrestationsFamiliales"; "droit_ouvert"] - prestations_familiales_dot_droit_ouvert_) - (log_variable_definition - [ - "PrestationsFamiliales"; - "droit_ouvert"; - "input"; - ] - embed_enfant enfant_)))) - enfants_a_charge_)); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./prologue.catala_fr"; - start_line = 97; - start_column = 13; - end_line = 97; - end_column = 30; - law_headings = - [ - "Allocations familiales"; - "Champs d'applications"; - "Prologue"; - ]; - } - false) - (fun (_ : _) -> raise EmptyError) - with EmptyError -> - raise - (NoValueProvided - { - filename = "./prologue.catala_fr"; - start_line = 96; - start_column = 11; - end_line = 96; - end_column = 61; - 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 - (try - fun (param_ : Enfant.t) -> - try - handle_default - [| - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./epilogue.catala_fr"; - start_line = 34; - start_column = 14; - end_line = 34; - end_column = 36; - law_headings = ["Règles diverses"; "Épilogue"]; - } - true) - (fun (_ : _) -> - enfant_le_plus_age_dot_le_plus_age_ = param_)); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./prologue.catala_fr"; - start_line = 149; - start_column = 3; - end_line = 149; - end_column = 66; - law_headings = - [ - "Allocations familiales"; - "Champs d'applications"; - "Prologue"; - ]; - } - false) - (fun (_ : _) -> raise EmptyError) - with EmptyError -> - raise - (NoValueProvided - { - filename = "./prologue.catala_fr"; - start_line = 149; - start_column = 11; - end_line = 149; - end_column = 33; - law_headings = - [ - "Allocations familiales"; - "Champs d'applications"; - "Prologue"; - ]; - }) - with EmptyError -> - raise - (NoValueProvided - { - filename = "./prologue.catala_fr"; - start_line = 149; - start_column = 11; - end_line = 149; - end_column = 33; - 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 - (try - handle_default - [| - (fun (_ : _) -> - handle_default - [| - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 132; - start_column = 5; - end_line = 132; - end_column = 69; - law_headings = - [ - "Article 1"; - "Arrêté du 14 décembre 2020 relatif au \ - montant des plafonds de ressources de \ - certaines prestations familiales et aux \ - tranches du barème applicable au \ - recouvrement des indus et à la saisie des \ - prestations"; - "Montant des plafonds de ressources"; - ]; - } - (date_courante_ >=@ date_of_numbers 2021 1 1 - && date_courante_ <=@ date_of_numbers 2021 12 31)) - (fun (_ : _) -> - money_of_cents_string "8155800" - +$ money_of_cents_string "582700" - *$ decimal_of_integer - (array_length - enfants_a_charge_droit_ouvert_prestation_familiale_))); - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 96; - start_column = 5; - end_line = 96; - end_column = 69; - law_headings = - [ - "Instruction interministerielle no \ - DSS/SD2B/2019/261 du 18 décembre 2019 \ - relative à la revalorisation au 1er janvier \ - 2020 des plafonds de ressources \ - d’attribution de certaines prestations \ - familiales servies en métropole, en \ - Guadeloupe, en Guyane, en Martinique, à La \ - Réunion, à Saint-Barthélemy, à Saint-Martin \ - et à Mayotte"; - "Montant des plafonds de ressources"; - ]; - } - (date_courante_ >=@ date_of_numbers 2020 1 1 - && date_courante_ <=@ date_of_numbers 2020 12 31)) - (fun (_ : _) -> - money_of_cents_string "8083100" - +$ money_of_cents_string "577500" - *$ decimal_of_integer - (array_length - enfants_a_charge_droit_ouvert_prestation_familiale_))); - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 63; - start_column = 5; - end_line = 63; - end_column = 69; - law_headings = - [ - "Instruction interministérielle n° \ - DSS/SD2B/2018/279 du 17 décembre 2018 \ - relative à la revalorisation au 1er janvier \ - 2019 des plafonds de ressources \ - d’attribution de certaines prestations \ - familiales servies en métropole, en \ - Guadeloupe, en Guyane, en Martinique, à la \ - Réunion, à Saint-Barthélemy, à Saint-Martin \ - et à Mayotte"; - "Montant des plafonds de ressources"; - ]; - } - (date_courante_ >=@ date_of_numbers 2019 1 1 - && date_courante_ <=@ date_of_numbers 2019 12 31)) - (fun (_ : _) -> - money_of_cents_string "7955800" - +$ money_of_cents_string "568400" - *$ decimal_of_integer - (array_length - enfants_a_charge_droit_ouvert_prestation_familiale_))); - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 30; - start_column = 5; - end_line = 30; - end_column = 69; - law_headings = - [ - "Circulaire interministérielle N° \ - DSS/SD2B/2017/352 du 22 décembre 2017 \ - relative à la revalorisation au 1er janvier \ - 2018 des plafonds de ressources \ - d’attribution de certaines prestations \ - familiales servies en métropole, en \ - Guadeloupe, en Guyane, en Martinique, à la \ - Réunion, à Saint-Barthélemy, à Saint-Martin \ - et à Mayotte"; - "Montant des plafonds de ressources"; - ]; - } - (date_courante_ >=@ date_of_numbers 2018 1 1 - && date_courante_ <=@ date_of_numbers 2018 12 31)) - (fun (_ : _) -> - money_of_cents_string "7877000" - +$ money_of_cents_string "562800" - *$ decimal_of_integer - (array_length - enfants_a_charge_droit_ouvert_prestation_familiale_))); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./securite_sociale_D.catala_fr"; - start_line = 311; - start_column = 14; - end_line = 311; - end_column = 31; - law_headings = - [ - "Article D521-3"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et prestations \ - assimilées"; - "Partie réglementaire - Décrets simples"; - "Code de la sécurité sociale"; - ]; - } - true) - (fun (_ : _) -> - money_of_cents_string "7830000" - +$ money_of_cents_string "559500" - *$ decimal_of_integer - (array_length - enfants_a_charge_droit_ouvert_prestation_familiale_))); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./prologue.catala_fr"; - start_line = 151; - start_column = 37; - end_line = 151; - end_column = 43; - law_headings = - [ - "Allocations familiales"; - "Champs d'applications"; - "Prologue"; - ]; - } - false) - (fun (_ : _) -> raise EmptyError) - with EmptyError -> - raise - (NoValueProvided - { - filename = "./prologue.catala_fr"; - start_line = 151; - start_column = 11; - end_line = 151; - end_column = 28; - 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 - (try - handle_default - [| - (fun (_ : _) -> - handle_default - [| - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 116; - start_column = 5; - end_line = 116; - end_column = 69; - law_headings = - [ - "Article 1"; - "Arrêté du 14 décembre 2020 relatif au \ - montant des plafonds de ressources de \ - certaines prestations familiales et aux \ - tranches du barème applicable au \ - recouvrement des indus et à la saisie des \ - prestations"; - "Montant des plafonds de ressources"; - ]; - } - (date_courante_ >=@ date_of_numbers 2021 1 1 - && date_courante_ <=@ date_of_numbers 2021 12 31)) - (fun (_ : _) -> - money_of_cents_string "5827900" - +$ money_of_cents_string "582700" - *$ decimal_of_integer - (array_length - enfants_a_charge_droit_ouvert_prestation_familiale_))); - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 89; - start_column = 5; - end_line = 89; - end_column = 69; - law_headings = - [ - "Instruction interministerielle no \ - DSS/SD2B/2019/261 du 18 décembre 2019 \ - relative à la revalorisation au 1er janvier \ - 2020 des plafonds de ressources \ - d’attribution de certaines prestations \ - familiales servies en métropole, en \ - Guadeloupe, en Guyane, en Martinique, à La \ - Réunion, à Saint-Barthélemy, à Saint-Martin \ - et à Mayotte"; - "Montant des plafonds de ressources"; - ]; - } - (date_courante_ >=@ date_of_numbers 2020 1 1 - && date_courante_ <=@ date_of_numbers 2020 12 31)) - (fun (_ : _) -> - money_of_cents_string "5775900" - +$ money_of_cents_string "577500" - *$ decimal_of_integer - (array_length - enfants_a_charge_droit_ouvert_prestation_familiale_))); - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 56; - start_column = 5; - end_line = 56; - end_column = 69; - law_headings = - [ - "Instruction interministérielle n° \ - DSS/SD2B/2018/279 du 17 décembre 2018 \ - relative à la revalorisation au 1er janvier \ - 2019 des plafonds de ressources \ - d’attribution de certaines prestations \ - familiales servies en métropole, en \ - Guadeloupe, en Guyane, en Martinique, à la \ - Réunion, à Saint-Barthélemy, à Saint-Martin \ - et à Mayotte"; - "Montant des plafonds de ressources"; - ]; - } - (date_courante_ >=@ date_of_numbers 2019 1 1 - && date_courante_ <=@ date_of_numbers 2019 12 31)) - (fun (_ : _) -> - money_of_cents_string "5684900" - +$ money_of_cents_string "568400" - *$ decimal_of_integer - (array_length - enfants_a_charge_droit_ouvert_prestation_familiale_))); - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 23; - start_column = 5; - end_line = 23; - end_column = 69; - law_headings = - [ - "Circulaire interministérielle N° \ - DSS/SD2B/2017/352 du 22 décembre 2017 \ - relative à la revalorisation au 1er janvier \ - 2018 des plafonds de ressources \ - d’attribution de certaines prestations \ - familiales servies en métropole, en \ - Guadeloupe, en Guyane, en Martinique, à la \ - Réunion, à Saint-Barthélemy, à Saint-Martin \ - et à Mayotte"; - "Montant des plafonds de ressources"; - ]; - } - (date_courante_ >=@ date_of_numbers 2018 1 1 - && date_courante_ <=@ date_of_numbers 2018 12 31)) - (fun (_ : _) -> - money_of_cents_string "5628600" - +$ money_of_cents_string "562800" - *$ decimal_of_integer - (array_length - enfants_a_charge_droit_ouvert_prestation_familiale_))); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./securite_sociale_D.catala_fr"; - start_line = 301; - start_column = 14; - end_line = 301; - end_column = 30; - law_headings = - [ - "Article D521-3"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et prestations \ - assimilées"; - "Partie réglementaire - Décrets simples"; - "Code de la sécurité sociale"; - ]; - } - true) - (fun (_ : _) -> - money_of_cents_string "5595000" - +$ money_of_cents_string "559500" - *$ decimal_of_integer - (array_length - enfants_a_charge_droit_ouvert_prestation_familiale_))); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./prologue.catala_fr"; - start_line = 150; - start_column = 36; - end_line = 150; - end_column = 42; - law_headings = - [ - "Allocations familiales"; - "Champs d'applications"; - "Prologue"; - ]; - } - false) - (fun (_ : _) -> raise EmptyError) - with EmptyError -> - raise - (NoValueProvided - { - filename = "./prologue.catala_fr"; - start_line = 150; - start_column = 11; - end_line = 150; - end_column = 27; - law_headings = - [ - "Allocations familiales"; "Champs d'applications"; "Prologue"; - ]; - })) - in - let droit_ouvert_complement_ : bool = - log_variable_definition - ["AllocationsFamiliales"; "droit_ouvert_complément"] - embed_bool - (try - handle_default - [| - (fun (_ : _) -> - handle_default - [| - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./securite_sociale_L.catala_fr"; - start_line = 426; - start_column = 5; - end_line = 427; - end_column = 71; - law_headings = - [ - "Article L755-12"; - "Chapitre 5 : Prestations familiales et \ - prestations assimilées"; - "Titre 5 : Dispositions particulières à la \ - Guadeloupe, à la Guyane, à la Martinique, à \ - La Réunion, à Saint-Barthélemy et à \ - Saint-Martin"; - "Livre 7 : Régimes divers - Dispositions \ - diverses"; - "Partie législative"; - "Code de la sécurité sociale"; - ]; - } - (prestations_familiales_dot_regime_outre_mer_l751_1_ - && array_length - enfants_a_charge_droit_ouvert_prestation_familiale_ - = integer_of_string "1")) - (fun (_ : _) -> false)); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./epilogue.catala_fr"; - start_line = 31; - start_column = 9; - end_line = 31; - end_column = 32; - law_headings = ["Règles diverses"; "Épilogue"]; - } - true) - (fun (_ : _) -> true)); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./prologue.catala_fr"; - start_line = 133; - start_column = 35; - end_line = 133; - end_column = 44; - law_headings = - [ - "Allocations familiales"; - "Champs d'applications"; - "Prologue"; - ]; - } - true) - (fun (_ : _) -> false) - with EmptyError -> - raise - (NoValueProvided - { - filename = "./prologue.catala_fr"; - start_line = 133; - start_column = 11; - end_line = 133; - end_column = 34; - law_headings = - [ - "Allocations familiales"; "Champs d'applications"; "Prologue"; - ]; - })) - in - let droit_ouvert_forfaitaire_ : Enfant.t -> bool = - log_variable_definition - ["AllocationsFamiliales"; "droit_ouvert_forfaitaire"] - unembeddable - (try - fun (param_ : Enfant.t) -> - try - handle_default - [| - (fun (_ : _) -> - handle_default - [| - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./securite_sociale_L.catala_fr"; - start_line = 420; - start_column = 6; - end_line = 421; - end_column = 72; - law_headings = - [ - "Article L755-12"; - "Chapitre 5 : Prestations familiales et \ - prestations assimilées"; - "Titre 5 : Dispositions particulières à \ - la Guadeloupe, à la Guyane, à la \ - Martinique, à La Réunion, à \ - Saint-Barthélemy et à Saint-Martin"; - "Livre 7 : Régimes divers - Dispositions \ - diverses"; - "Partie législative"; - "Code de la sécurité sociale"; - ]; - } - (prestations_familiales_dot_regime_outre_mer_l751_1_ - && array_length - enfants_a_charge_droit_ouvert_prestation_familiale_ - = integer_of_string "1")) - (fun (_ : _) -> false)); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./securite_sociale_L.catala_fr"; - start_line = 119; - start_column = 5; - end_line = 125; - end_column = 59; - law_headings = - [ - "Article L521-1"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et \ - prestations assimilées"; - "Partie législative"; - "Code de la sécurité sociale"; - ]; - } - (array_length enfants_a_charge_ - >=! nombre_enfants_alinea_2_l521_3_ - && param_.Enfant.age - = prestations_familiales_dot_age_l512_3_2_ - && param_ - .Enfant - .a_deja_ouvert_droit_aux_allocations_familiales - && log_end_call - ["PrestationsFamiliales"; "conditions_hors_âge"] - (log_variable_definition - [ - "PrestationsFamiliales"; - "conditions_hors_âge"; - "output"; - ] - embed_bool - ((log_begin_call - [ - "PrestationsFamiliales"; - "conditions_hors_âge"; - ] - prestations_familiales_dot_conditions_hors_age_) - (log_variable_definition - [ - "PrestationsFamiliales"; - "conditions_hors_âge"; - "input"; - ] - embed_enfant param_))))) - (fun (_ : _) -> true)); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./prologue.catala_fr"; - start_line = 121; - start_column = 3; - end_line = 121; - end_column = 62; - law_headings = - [ - "Allocations familiales"; - "Champs d'applications"; - "Prologue"; - ]; - } - true) - (fun (_ : _) -> false) - with EmptyError -> - raise - (NoValueProvided - { - filename = "./prologue.catala_fr"; - start_line = 121; - start_column = 11; - end_line = 121; - end_column = 35; - law_headings = - [ - "Allocations familiales"; - "Champs d'applications"; - "Prologue"; - ]; - }) - with EmptyError -> - raise - (NoValueProvided - { - filename = "./prologue.catala_fr"; - start_line = 121; - start_column = 11; - end_line = 121; - end_column = 35; - law_headings = - [ - "Allocations familiales"; "Champs d'applications"; "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 - (try - handle_default - [| - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 195; - start_column = 14; - end_line = 195; - end_column = 67; - law_headings = - [ - "Article 7"; - "Décret n°2002-423 du 29 mars 2002 relatif aux \ - prestations familiales à Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - ]; - } - true) - (fun (_ : _) -> - if - array_length - enfants_a_charge_droit_ouvert_prestation_familiale_ - >! integer_of_string "3" - then - bmaf_dot_montant_ *$ decimal_of_string "0.0463" - *$ decimal_of_integer - (array_length - enfants_a_charge_droit_ouvert_prestation_familiale_ - -! integer_of_string "3") - else money_of_cents_string "0")); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./prologue.catala_fr"; - start_line = 118; - start_column = 73; - end_line = 118; - end_column = 79; - law_headings = - [ - "Allocations familiales"; - "Champs d'applications"; - "Prologue"; - ]; - } - false) - (fun (_ : _) -> raise EmptyError) - with EmptyError -> - raise - (NoValueProvided - { - filename = "./prologue.catala_fr"; - start_line = 118; - start_column = 11; - end_line = 118; - end_column = 64; - law_headings = - [ - "Allocations familiales"; "Champs d'applications"; "Prologue"; - ]; - })) - in - let montant_initial_base_troisieme_enfant_mayotte_ : money = - log_variable_definition - ["AllocationsFamiliales"; "montant_initial_base_troisième_enfant_mayotte"] - embed_money - (try - handle_default - [| - (fun (_ : _) -> - handle_default - [| - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 472; - start_column = 5; - end_line = 472; - end_column = 69; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 relatif \ - aux prestations familiales à Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - ]; - } - (residence_ = Mayotte () - && date_courante_ >=@ date_of_numbers 2020 1 1 - && date_courante_ <=@ date_of_numbers 2020 12 31)) - (fun (_ : _) -> - if - array_length - enfants_a_charge_droit_ouvert_prestation_familiale_ - >! integer_of_string "2" - then bmaf_dot_montant_ *$ decimal_of_string "0.143" - else money_of_cents_string "0")); - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 465; - start_column = 5; - end_line = 465; - end_column = 69; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 relatif \ - aux prestations familiales à Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - ]; - } - (residence_ = Mayotte () - && date_courante_ >=@ date_of_numbers 2019 1 1 - && date_courante_ <=@ date_of_numbers 2019 12 31)) - (fun (_ : _) -> - if - array_length - enfants_a_charge_droit_ouvert_prestation_familiale_ - >! integer_of_string "2" - then bmaf_dot_montant_ *$ decimal_of_string "0.1259" - else money_of_cents_string "0")); - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 458; - start_column = 5; - end_line = 458; - end_column = 69; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 relatif \ - aux prestations familiales à Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - ]; - } - (residence_ = Mayotte () - && date_courante_ >=@ date_of_numbers 2018 1 1 - && date_courante_ <=@ date_of_numbers 2018 12 31)) - (fun (_ : _) -> - if - array_length - enfants_a_charge_droit_ouvert_prestation_familiale_ - >! integer_of_string "2" - then bmaf_dot_montant_ *$ decimal_of_string "0.1089" - else money_of_cents_string "0")); - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 451; - start_column = 5; - end_line = 451; - end_column = 69; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 relatif \ - aux prestations familiales à Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - ]; - } - (residence_ = Mayotte () - && date_courante_ >=@ date_of_numbers 2017 1 1 - && date_courante_ <=@ date_of_numbers 2017 12 31)) - (fun (_ : _) -> - if - array_length - enfants_a_charge_droit_ouvert_prestation_familiale_ - >! integer_of_string "2" - then bmaf_dot_montant_ *$ decimal_of_string "0.0918" - else money_of_cents_string "0")); - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 444; - start_column = 5; - end_line = 444; - end_column = 69; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 relatif \ - aux prestations familiales à Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - ]; - } - (residence_ = Mayotte () - && date_courante_ >=@ date_of_numbers 2016 1 1 - && date_courante_ <=@ date_of_numbers 2016 12 31)) - (fun (_ : _) -> - if - array_length - enfants_a_charge_droit_ouvert_prestation_familiale_ - >! integer_of_string "2" - then bmaf_dot_montant_ *$ decimal_of_string "0.0842" - else money_of_cents_string "0")); - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 437; - start_column = 5; - end_line = 437; - end_column = 69; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 relatif \ - aux prestations familiales à Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - ]; - } - (residence_ = Mayotte () - && date_courante_ >=@ date_of_numbers 2015 1 1 - && date_courante_ <=@ date_of_numbers 2015 12 31)) - (fun (_ : _) -> - if - array_length - enfants_a_charge_droit_ouvert_prestation_familiale_ - >! integer_of_string "2" - then bmaf_dot_montant_ *$ decimal_of_string "0.0766" - else money_of_cents_string "0")); - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 430; - start_column = 5; - end_line = 430; - end_column = 69; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 relatif \ - aux prestations familiales à Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - ]; - } - (residence_ = Mayotte () - && date_courante_ >=@ date_of_numbers 2014 1 1 - && date_courante_ <=@ date_of_numbers 2014 12 31)) - (fun (_ : _) -> - if - array_length - enfants_a_charge_droit_ouvert_prestation_familiale_ - >! integer_of_string "2" - then bmaf_dot_montant_ *$ decimal_of_string "0.069" - else money_of_cents_string "0")); - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 423; - start_column = 5; - end_line = 423; - end_column = 69; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 relatif \ - aux prestations familiales à Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - ]; - } - (residence_ = Mayotte () - && date_courante_ >=@ date_of_numbers 2013 1 1 - && date_courante_ <=@ date_of_numbers 2013 12 31)) - (fun (_ : _) -> - if - array_length - enfants_a_charge_droit_ouvert_prestation_familiale_ - >! integer_of_string "2" - then bmaf_dot_montant_ *$ decimal_of_string "0.0615" - else money_of_cents_string "0")); - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 416; - start_column = 5; - end_line = 416; - end_column = 69; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 relatif \ - aux prestations familiales à Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - ]; - } - (residence_ = Mayotte () - && date_courante_ >=@ date_of_numbers 2012 1 1 - && date_courante_ <=@ date_of_numbers 2012 12 31)) - (fun (_ : _) -> - if - array_length - enfants_a_charge_droit_ouvert_prestation_familiale_ - >! integer_of_string "2" - then bmaf_dot_montant_ *$ decimal_of_string "0.0539" - else money_of_cents_string "0")); - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 409; - start_column = 5; - end_line = 409; - end_column = 69; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 relatif \ - aux prestations familiales à Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - ]; - } - (residence_ = Mayotte () - && date_courante_ >=@ date_of_numbers 2011 1 1 - && date_courante_ <=@ date_of_numbers 2011 12 31)) - (fun (_ : _) -> - if - array_length - enfants_a_charge_droit_ouvert_prestation_familiale_ - >! integer_of_string "2" - then bmaf_dot_montant_ *$ decimal_of_string "0.0463" - else money_of_cents_string "0")); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 186; - start_column = 14; - end_line = 186; - end_column = 59; - law_headings = - [ - "Article 7"; - "Décret n°2002-423 du 29 mars 2002 relatif aux \ - prestations familiales à Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - ]; - } - true) - (fun (_ : _) -> - if - array_length - enfants_a_charge_droit_ouvert_prestation_familiale_ - >! integer_of_string "2" - then bmaf_dot_montant_ *$ decimal_of_string "0.16" - else money_of_cents_string "0")); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./prologue.catala_fr"; - start_line = 117; - start_column = 65; - end_line = 117; - end_column = 71; - law_headings = - [ - "Allocations familiales"; - "Champs d'applications"; - "Prologue"; - ]; - } - false) - (fun (_ : _) -> raise EmptyError) - with EmptyError -> - raise - (NoValueProvided - { - filename = "./prologue.catala_fr"; - start_line = 117; - start_column = 11; - end_line = 117; - end_column = 56; - law_headings = - [ - "Allocations familiales"; "Champs d'applications"; "Prologue"; - ]; - })) - in - let nombre_total_enfants_ : decimal = - log_variable_definition - ["AllocationsFamiliales"; "nombre_total_enfants"] - embed_decimal - (try - handle_default - [| - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./securite_sociale_R.catala_fr"; - start_line = 162; - start_column = 14; - end_line = 162; - end_column = 34; - law_headings = - [ - "Article R521-3"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et prestations \ - assimilées"; - "Partie réglementaire - Décrets en Conseil d'Etat"; - "Code de la sécurité sociale"; - ]; - } - true) - (fun (_ : _) -> - decimal_of_integer - (array_length - enfants_a_charge_droit_ouvert_prestation_familiale_))); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./prologue.catala_fr"; - start_line = 111; - start_column = 40; - end_line = 111; - end_column = 47; - law_headings = - [ - "Allocations familiales"; - "Champs d'applications"; - "Prologue"; - ]; - } - false) - (fun (_ : _) -> raise EmptyError) - with EmptyError -> - raise - (NoValueProvided - { - filename = "./prologue.catala_fr"; - start_line = 111; - start_column = 11; - end_line = 111; - end_column = 31; - law_headings = - [ - "Allocations familiales"; "Champs d'applications"; "Prologue"; - ]; - })) - in - let nombre_moyen_enfants_ : decimal = - log_variable_definition - ["AllocationsFamiliales"; "nombre_moyen_enfants"] - embed_decimal - (try - handle_default - [| - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./securite_sociale_R.catala_fr"; - start_line = 142; - start_column = 14; - end_line = 142; - end_column = 34; - law_headings = - [ - "Article R521-3"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et prestations \ - assimilées"; - "Partie réglementaire - Décrets en Conseil d'Etat"; - "Code de la sécurité sociale"; - ]; - } - true) - (fun (_ : _) -> - Array.fold_left - (fun (acc_ : decimal) (enfant_ : _) -> - acc_ - +& - match - log_end_call - ["AllocationsFamiliales"; "prise_en_compte"] - (log_variable_definition - [ - "AllocationsFamiliales"; - "prise_en_compte"; - "output"; - ] - embed_prise_en_compte - ((log_begin_call - ["AllocationsFamiliales"; "prise_en_compte"] - prise_en_compte_) - (log_variable_definition - [ - "AllocationsFamiliales"; - "prise_en_compte"; - "input"; - ] - embed_enfant enfant_))) - with - | Complete _ -> decimal_of_string "1." - | Partagee _ -> decimal_of_string "0.5" - | Zero _ -> decimal_of_string "0.") - (decimal_of_string "0.") - enfants_a_charge_droit_ouvert_prestation_familiale_)); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./prologue.catala_fr"; - start_line = 110; - start_column = 40; - end_line = 110; - end_column = 47; - law_headings = - [ - "Allocations familiales"; - "Champs d'applications"; - "Prologue"; - ]; - } - false) - (fun (_ : _) -> raise EmptyError) - with EmptyError -> - raise - (NoValueProvided - { - filename = "./prologue.catala_fr"; - start_line = 110; - start_column = 11; - end_line = 110; - end_column = 31; - law_headings = - [ - "Allocations familiales"; "Champs d'applications"; "Prologue"; - ]; - })) - in - let montant_initial_base_premier_enfant_ : money = - log_variable_definition - ["AllocationsFamiliales"; "montant_initial_base_premier_enfant"] - embed_money - (try - handle_default - [| - (fun (_ : _) -> - handle_default - [| - (fun (_ : _) -> - handle_default - [| - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 330; - start_column = 5; - end_line = 330; - end_column = 49; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 \ - relatif aux prestations familiales à \ - Mayotte"; - "Dispositions spéciales relatives à \ - Mayotte"; - ]; - } - (residence_ = Mayotte () - && avait_enfant_a_charge_avant_1er_janvier_2012_ - )) - (fun (_ : _) -> - if - array_length - enfants_a_charge_droit_ouvert_prestation_familiale_ - >! integer_of_string "0" - then money_of_cents_string "5728" - else money_of_cents_string "0")); - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 322; - start_column = 5; - end_line = 323; - end_column = 53; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 \ - relatif aux prestations familiales à \ - Mayotte"; - "Dispositions spéciales relatives à \ - Mayotte"; - ]; - } - (residence_ = Mayotte () - && date_courante_ >=@ date_of_numbers 2020 1 1 - && date_courante_ - <=@ date_of_numbers 2020 12 31 - && not - avait_enfant_a_charge_avant_1er_janvier_2012_ - )) - (fun (_ : _) -> - if - array_length - enfants_a_charge_droit_ouvert_prestation_familiale_ - >! integer_of_string "0" - then - bmaf_dot_montant_ *$ decimal_of_string "0.0717" - else money_of_cents_string "0")); - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 314; - start_column = 5; - end_line = 315; - end_column = 53; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 \ - relatif aux prestations familiales à \ - Mayotte"; - "Dispositions spéciales relatives à \ - Mayotte"; - ]; - } - (residence_ = Mayotte () - && date_courante_ >=@ date_of_numbers 2019 1 1 - && date_courante_ - <=@ date_of_numbers 2019 12 31 - && not - avait_enfant_a_charge_avant_1er_janvier_2012_ - )) - (fun (_ : _) -> - if - array_length - enfants_a_charge_droit_ouvert_prestation_familiale_ - >! integer_of_string "0" - then - bmaf_dot_montant_ *$ decimal_of_string "0.0847" - else money_of_cents_string "0")); - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 306; - start_column = 5; - end_line = 307; - end_column = 53; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 \ - relatif aux prestations familiales à \ - Mayotte"; - "Dispositions spéciales relatives à \ - Mayotte"; - ]; - } - (residence_ = Mayotte () - && date_courante_ >=@ date_of_numbers 2018 1 1 - && date_courante_ - <=@ date_of_numbers 2018 12 31 - && not - avait_enfant_a_charge_avant_1er_janvier_2012_ - )) - (fun (_ : _) -> - if - array_length - enfants_a_charge_droit_ouvert_prestation_familiale_ - >! integer_of_string "0" - then - bmaf_dot_montant_ *$ decimal_of_string "0.0976" - else money_of_cents_string "0")); - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 298; - start_column = 5; - end_line = 299; - end_column = 53; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 \ - relatif aux prestations familiales à \ - Mayotte"; - "Dispositions spéciales relatives à \ - Mayotte"; - ]; - } - (residence_ = Mayotte () - && date_courante_ >=@ date_of_numbers 2017 1 1 - && date_courante_ - <=@ date_of_numbers 2017 12 31 - && not - avait_enfant_a_charge_avant_1er_janvier_2012_ - )) - (fun (_ : _) -> - if - array_length - enfants_a_charge_droit_ouvert_prestation_familiale_ - >! integer_of_string "0" - then - bmaf_dot_montant_ *$ decimal_of_string "0.1105" - else money_of_cents_string "0")); - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 290; - start_column = 5; - end_line = 291; - end_column = 53; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 \ - relatif aux prestations familiales à \ - Mayotte"; - "Dispositions spéciales relatives à \ - Mayotte"; - ]; - } - (residence_ = Mayotte () - && date_courante_ >=@ date_of_numbers 2016 1 1 - && date_courante_ - <=@ date_of_numbers 2016 12 31 - && not - avait_enfant_a_charge_avant_1er_janvier_2012_ - )) - (fun (_ : _) -> - if - array_length - enfants_a_charge_droit_ouvert_prestation_familiale_ - >! integer_of_string "0" - then - bmaf_dot_montant_ *$ decimal_of_string "0.1163" - else money_of_cents_string "0")); - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 282; - start_column = 5; - end_line = 283; - end_column = 53; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 \ - relatif aux prestations familiales à \ - Mayotte"; - "Dispositions spéciales relatives à \ - Mayotte"; - ]; - } - (residence_ = Mayotte () - && date_courante_ >=@ date_of_numbers 2015 1 1 - && date_courante_ - <=@ date_of_numbers 2015 12 31 - && not - avait_enfant_a_charge_avant_1er_janvier_2012_ - )) - (fun (_ : _) -> - if - array_length - enfants_a_charge_droit_ouvert_prestation_familiale_ - >! integer_of_string "0" - then - bmaf_dot_montant_ *$ decimal_of_string "0.122" - else money_of_cents_string "0")); - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 274; - start_column = 5; - end_line = 275; - end_column = 53; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 \ - relatif aux prestations familiales à \ - Mayotte"; - "Dispositions spéciales relatives à \ - Mayotte"; - ]; - } - (residence_ = Mayotte () - && date_courante_ >=@ date_of_numbers 2014 1 1 - && date_courante_ - <=@ date_of_numbers 2014 12 31 - && not - avait_enfant_a_charge_avant_1er_janvier_2012_ - )) - (fun (_ : _) -> - if - array_length - enfants_a_charge_droit_ouvert_prestation_familiale_ - >! integer_of_string "0" - then - bmaf_dot_montant_ *$ decimal_of_string "0.1278" - else money_of_cents_string "0")); - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 266; - start_column = 5; - end_line = 267; - end_column = 53; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 \ - relatif aux prestations familiales à \ - Mayotte"; - "Dispositions spéciales relatives à \ - Mayotte"; - ]; - } - (residence_ = Mayotte () - && date_courante_ >=@ date_of_numbers 2013 1 1 - && date_courante_ - <=@ date_of_numbers 2013 12 31 - && not - avait_enfant_a_charge_avant_1er_janvier_2012_ - )) - (fun (_ : _) -> - if - array_length - enfants_a_charge_droit_ouvert_prestation_familiale_ - >! integer_of_string "0" - then - bmaf_dot_montant_ *$ decimal_of_string "0.1335" - else money_of_cents_string "0")); - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 258; - start_column = 5; - end_line = 259; - end_column = 53; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 \ - relatif aux prestations familiales à \ - Mayotte"; - "Dispositions spéciales relatives à \ - Mayotte"; - ]; - } - (residence_ = Mayotte () - && date_courante_ >=@ date_of_numbers 2012 1 1 - && date_courante_ - <=@ date_of_numbers 2012 12 31 - && not - avait_enfant_a_charge_avant_1er_janvier_2012_ - )) - (fun (_ : _) -> - if - array_length - enfants_a_charge_droit_ouvert_prestation_familiale_ - >! integer_of_string "0" - then - bmaf_dot_montant_ *$ decimal_of_string "0.1393" - else money_of_cents_string "0")); - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 250; - start_column = 5; - end_line = 251; - end_column = 53; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 \ - relatif aux prestations familiales à \ - Mayotte"; - "Dispositions spéciales relatives à \ - Mayotte"; - ]; - } - (residence_ = Mayotte () - && date_courante_ >=@ date_of_numbers 2011 1 1 - && date_courante_ - <=@ date_of_numbers 2011 12 31 - && not - avait_enfant_a_charge_avant_1er_janvier_2012_ - )) - (fun (_ : _) -> - if - array_length - enfants_a_charge_droit_ouvert_prestation_familiale_ - >! integer_of_string "0" - then - bmaf_dot_montant_ *$ decimal_of_string "0.145" - else money_of_cents_string "0")); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 167; - start_column = 14; - end_line = 167; - end_column = 49; - law_headings = - [ - "Article 7"; - "Décret n°2002-423 du 29 mars 2002 relatif \ - aux prestations familiales à Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - ]; - } - (residence_ = Mayotte ())) - (fun (_ : _) -> - if - array_length - enfants_a_charge_droit_ouvert_prestation_familiale_ - >! integer_of_string "0" - then bmaf_dot_montant_ *$ decimal_of_string "0.0588" - else money_of_cents_string "0")); - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./securite_sociale_D.catala_fr"; - start_line = 362; - start_column = 5; - end_line = 363; - end_column = 71; - law_headings = - [ - "Article D755-5"; - "Chapitre 5 : Prestations familiales et \ - prestations assimilées"; - "Titre 5 : Départements d'outre-mer"; - "Livre 7 : Régimes divers - Dispositions \ - diverses"; - "Partie réglementaire - Décrets simples"; - "Code de la sécurité sociale"; - ]; - } - (prestations_familiales_dot_regime_outre_mer_l751_1_ - && array_length - enfants_a_charge_droit_ouvert_prestation_familiale_ - = integer_of_string "1")) - (fun (_ : _) -> - bmaf_dot_montant_ *$ decimal_of_string "0.0588")); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./securite_sociale_D.catala_fr"; - start_line = 359; - start_column = 29; - end_line = 359; - end_column = 64; - law_headings = - [ - "Article D755-5"; - "Chapitre 5 : Prestations familiales et prestations \ - assimilées"; - "Titre 5 : Départements d'outre-mer"; - "Livre 7 : Régimes divers - Dispositions diverses"; - "Partie réglementaire - Décrets simples"; - "Code de la sécurité sociale"; - ]; - } - true) - (fun (_ : _) -> money_of_cents_string "0")); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./prologue.catala_fr"; - start_line = 106; - start_column = 55; - end_line = 106; - end_column = 61; - law_headings = - [ - "Allocations familiales"; - "Champs d'applications"; - "Prologue"; - ]; - } - false) - (fun (_ : _) -> raise EmptyError) - with EmptyError -> - raise - (NoValueProvided - { - filename = "./prologue.catala_fr"; - start_line = 106; - start_column = 11; - end_line = 106; - end_column = 46; - law_headings = - [ - "Allocations familiales"; "Champs d'applications"; "Prologue"; - ]; - })) - in - let droit_ouvert_base_ : bool = - log_variable_definition - ["AllocationsFamiliales"; "droit_ouvert_base"] - embed_bool - (try - handle_default - [| - (fun (_ : _) -> - handle_default - [| - (fun (_ : _) -> - handle_default - [| - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./securite_sociale_L.catala_fr"; - start_line = 406; - start_column = 5; - end_line = 407; - end_column = 72; - law_headings = - [ - "Article L755-12"; - "Chapitre 5 : Prestations familiales et \ - prestations assimilées"; - "Titre 5 : Dispositions particulières à \ - la Guadeloupe, à la Guyane, à la \ - Martinique, à La Réunion, à \ - Saint-Barthélemy et à Saint-Martin"; - "Livre 7 : Régimes divers - \ - Dispositions diverses"; - "Partie législative"; - "Code de la sécurité sociale"; - ]; - } + (fun (param_: Enfant.t) -> + try + (handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=121; start_column=11; end_line=121; end_column=35; + law_headings=["Allocations familiales"; + "Champs d'applications"; "Prologue"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=121; start_column=11; + end_line=121; end_column=35; + law_headings=["Allocations familiales"; + "Champs d'applications"; "Prologue"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=121; start_column=11; + end_line=121; end_column=35; + law_headings=["Allocations familiales"; + "Champs d'applications"; + "Prologue"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/securite_sociale_L.catala_fr"; + start_line=420; start_column=6; + end_line=421; end_column=72; + law_headings=["Article L755-12"; + "Chapitre 5 : Prestations familiales et prestations assimilées"; + "Titre 5 : Dispositions particulières à la Guadeloupe, à la Guyane, à la Martinique, à La Réunion, à Saint-Barthélemy et à Saint-Martin"; + "Livre 7 : Régimes divers - Dispositions diverses"; + "Partie législative"; + "Code de la sécurité sociale"]} (prestations_familiales_dot_regime_outre_mer_l751_1_ - && array_length - enfants_a_charge_droit_ouvert_prestation_familiale_ - >=! integer_of_string "1")) - (fun (_ : _) -> true)); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 159; - start_column = 6; - end_line = 159; - end_column = 71; - law_headings = - [ - "Article 7"; - "Décret n°2002-423 du 29 mars 2002 relatif \ - aux prestations familiales à Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - ]; - } - (residence_ = Mayotte () - && array_length - enfants_a_charge_droit_ouvert_prestation_familiale_ - >=! integer_of_string "1")) - (fun (_ : _) -> true)); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./securite_sociale_L.catala_fr"; - start_line = 101; - start_column = 5; - end_line = 101; - end_column = 70; - law_headings = - [ - "Article L521-1"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et prestations \ - assimilées"; - "Partie législative"; - "Code de la sécurité sociale"; - ]; - } - (array_length - enfants_a_charge_droit_ouvert_prestation_familiale_ - >=! integer_of_string "2")) - (fun (_ : _) -> true)); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./prologue.catala_fr"; - start_line = 104; - start_column = 29; - end_line = 104; - end_column = 38; - law_headings = - [ - "Allocations familiales"; - "Champs d'applications"; - "Prologue"; - ]; - } - true) - (fun (_ : _) -> false) - with EmptyError -> - raise - (NoValueProvided - { - filename = "./prologue.catala_fr"; - start_line = 104; - start_column = 11; - end_line = 104; - end_column = 28; - law_headings = - [ - "Allocations familiales"; "Champs d'applications"; "Prologue"; - ]; - })) - in - let droit_ouvert_majoration_ : Enfant.t -> bool = - log_variable_definition - ["AllocationsFamiliales"; "droit_ouvert_majoration"] - unembeddable - (try - fun (param_ : Enfant.t) -> - try - handle_default - [| - (fun (_ : _) -> - handle_default - [| - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./securite_sociale_L.catala_fr"; - start_line = 313; - start_column = 5; - end_line = 315; - end_column = 58; - law_headings = - [ - "Article L521-3"; + && + ((array_length + enfants_a_charge_droit_ouvert_prestation_familiale_) + = (integer_of_string "1"))))) + (fun (_: _) -> false))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/securite_sociale_L.catala_fr"; + start_line=119; start_column=5; + end_line=125; end_column=59; + law_headings=["Article L521-1"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie législative"; + "Code de la sécurité sociale"]} + (((array_length enfants_a_charge_) >=! + nombre_enfants_alinea_2_l521_3_) && + (((param_.Enfant.age) = + prestations_familiales_dot_age_l512_3_2_) && + ((param_.Enfant.a_deja_ouvert_droit_aux_allocations_familiales) + && ((log_end_call + ["PrestationsFamiliales"; + "conditions_hors_âge"] + ((log_variable_definition + ["PrestationsFamiliales"; + "conditions_hors_âge"; "output"] + (embed_bool) ((log_begin_call + ["PrestationsFamiliales"; + "conditions_hors_âge"] + prestations_familiales_dot_conditions_hors_age_) + ((log_variable_definition + ["PrestationsFamiliales"; + "conditions_hors_âge"; "input"] + (embed_enfant) param_)))))))))))) + (fun (_: _) -> true))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=121; start_column=11; + end_line=121; end_column=35; + law_headings=["Allocations familiales"; + "Champs d'applications"; "Prologue"]} true)) + (fun (_: _) -> false)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=121; start_column=11; end_line=121; end_column=35; + law_headings=["Allocations familiales"; "Champs d'applications"; + "Prologue"]}))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=121; start_column=11; end_line=121; end_column=35; + law_headings=["Allocations familiales"; "Champs d'applications"; + "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) + ( + try + (handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=118; start_column=11; end_line=118; end_column=64; + law_headings=["Allocations familiales"; "Champs d'applications"; + "Prologue"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/decrets_divers.catala_fr"; + start_line=195; start_column=14; end_line=195; end_column=67; + law_headings=["Article 7"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte"; + "Dispositions spéciales relatives à Mayotte"]} + true)) + (fun (_: _) -> + if + ((array_length + enfants_a_charge_droit_ouvert_prestation_familiale_) >! + (integer_of_string "3")) then + ((bmaf_dot_montant_ *$ (decimal_of_string "0.0463")) *$ + (decimal_of_integer + ((array_length + enfants_a_charge_droit_ouvert_prestation_familiale_) + -! (integer_of_string "3")))) else + (money_of_cents_string "0"))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=118; start_column=11; end_line=118; end_column=64; + law_headings=["Allocations familiales"; "Champs d'applications"; + "Prologue"]})))) in + let montant_initial_base_troisieme_enfant_mayotte_: money = (log_variable_definition + ["AllocationsFamiliales"; + "montant_initial_base_troisième_enfant_mayotte"] (embed_money) ( + try + (handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=117; start_column=11; end_line=117; end_column=56; + law_headings=["Allocations familiales"; "Champs d'applications"; + "Prologue"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=117; start_column=11; + end_line=117; end_column=56; + law_headings=["Allocations familiales"; + "Champs d'applications"; "Prologue"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=117; start_column=11; + end_line=117; end_column=56; + law_headings=["Allocations familiales"; + "Champs d'applications"; + "Prologue"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/decrets_divers.catala_fr"; + start_line=409; start_column=5; + end_line=409; end_column=69; + law_headings=["Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte"; + "Dispositions spéciales relatives à Mayotte"]} + ((residence_ = (Collectivite.Mayotte ())) && + ((date_courante_ >=@ + (date_of_numbers (2011) (1) (1))) && + (date_courante_ <=@ + (date_of_numbers (2011) (12) (31))))))) + (fun (_: _) -> + if + ((array_length + enfants_a_charge_droit_ouvert_prestation_familiale_) + >! (integer_of_string "2")) then + (bmaf_dot_montant_ *$ + (decimal_of_string "0.0463")) else + (money_of_cents_string "0"))); + (fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=117; start_column=11; + end_line=117; end_column=56; + law_headings=["Allocations familiales"; + "Champs d'applications"; + "Prologue"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/decrets_divers.catala_fr"; + start_line=416; start_column=5; + end_line=416; end_column=69; + law_headings=["Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte"; + "Dispositions spéciales relatives à Mayotte"]} + ((residence_ = (Collectivite.Mayotte ())) && + ((date_courante_ >=@ + (date_of_numbers (2012) (1) (1))) && + (date_courante_ <=@ + (date_of_numbers (2012) (12) (31))))))) + (fun (_: _) -> + if + ((array_length + enfants_a_charge_droit_ouvert_prestation_familiale_) + >! (integer_of_string "2")) then + (bmaf_dot_montant_ *$ + (decimal_of_string "0.0539")) else + (money_of_cents_string "0"))); + (fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=117; start_column=11; + end_line=117; end_column=56; + law_headings=["Allocations familiales"; + "Champs d'applications"; + "Prologue"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/decrets_divers.catala_fr"; + start_line=423; start_column=5; + end_line=423; end_column=69; + law_headings=["Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte"; + "Dispositions spéciales relatives à Mayotte"]} + ((residence_ = (Collectivite.Mayotte ())) && + ((date_courante_ >=@ + (date_of_numbers (2013) (1) (1))) && + (date_courante_ <=@ + (date_of_numbers (2013) (12) (31))))))) + (fun (_: _) -> + if + ((array_length + enfants_a_charge_droit_ouvert_prestation_familiale_) + >! (integer_of_string "2")) then + (bmaf_dot_montant_ *$ + (decimal_of_string "0.0615")) else + (money_of_cents_string "0"))); + (fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=117; start_column=11; + end_line=117; end_column=56; + law_headings=["Allocations familiales"; + "Champs d'applications"; + "Prologue"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/decrets_divers.catala_fr"; + start_line=430; start_column=5; + end_line=430; end_column=69; + law_headings=["Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte"; + "Dispositions spéciales relatives à Mayotte"]} + ((residence_ = (Collectivite.Mayotte ())) && + ((date_courante_ >=@ + (date_of_numbers (2014) (1) (1))) && + (date_courante_ <=@ + (date_of_numbers (2014) (12) (31))))))) + (fun (_: _) -> + if + ((array_length + enfants_a_charge_droit_ouvert_prestation_familiale_) + >! (integer_of_string "2")) then + (bmaf_dot_montant_ *$ + (decimal_of_string "0.069")) else + (money_of_cents_string "0"))); + (fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=117; start_column=11; + end_line=117; end_column=56; + law_headings=["Allocations familiales"; + "Champs d'applications"; + "Prologue"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/decrets_divers.catala_fr"; + start_line=437; start_column=5; + end_line=437; end_column=69; + law_headings=["Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte"; + "Dispositions spéciales relatives à Mayotte"]} + ((residence_ = (Collectivite.Mayotte ())) && + ((date_courante_ >=@ + (date_of_numbers (2015) (1) (1))) && + (date_courante_ <=@ + (date_of_numbers (2015) (12) (31))))))) + (fun (_: _) -> + if + ((array_length + enfants_a_charge_droit_ouvert_prestation_familiale_) + >! (integer_of_string "2")) then + (bmaf_dot_montant_ *$ + (decimal_of_string "0.0766")) else + (money_of_cents_string "0"))); + (fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=117; start_column=11; + end_line=117; end_column=56; + law_headings=["Allocations familiales"; + "Champs d'applications"; + "Prologue"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/decrets_divers.catala_fr"; + start_line=444; start_column=5; + end_line=444; end_column=69; + law_headings=["Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte"; + "Dispositions spéciales relatives à Mayotte"]} + ((residence_ = (Collectivite.Mayotte ())) && + ((date_courante_ >=@ + (date_of_numbers (2016) (1) (1))) && + (date_courante_ <=@ + (date_of_numbers (2016) (12) (31))))))) + (fun (_: _) -> + if + ((array_length + enfants_a_charge_droit_ouvert_prestation_familiale_) + >! (integer_of_string "2")) then + (bmaf_dot_montant_ *$ + (decimal_of_string "0.0842")) else + (money_of_cents_string "0"))); + (fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=117; start_column=11; + end_line=117; end_column=56; + law_headings=["Allocations familiales"; + "Champs d'applications"; + "Prologue"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/decrets_divers.catala_fr"; + start_line=451; start_column=5; + end_line=451; end_column=69; + law_headings=["Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte"; + "Dispositions spéciales relatives à Mayotte"]} + ((residence_ = (Collectivite.Mayotte ())) && + ((date_courante_ >=@ + (date_of_numbers (2017) (1) (1))) && + (date_courante_ <=@ + (date_of_numbers (2017) (12) (31))))))) + (fun (_: _) -> + if + ((array_length + enfants_a_charge_droit_ouvert_prestation_familiale_) + >! (integer_of_string "2")) then + (bmaf_dot_montant_ *$ + (decimal_of_string "0.0918")) else + (money_of_cents_string "0"))); + (fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=117; start_column=11; + end_line=117; end_column=56; + law_headings=["Allocations familiales"; + "Champs d'applications"; + "Prologue"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/decrets_divers.catala_fr"; + start_line=458; start_column=5; + end_line=458; end_column=69; + law_headings=["Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte"; + "Dispositions spéciales relatives à Mayotte"]} + ((residence_ = (Collectivite.Mayotte ())) && + ((date_courante_ >=@ + (date_of_numbers (2018) (1) (1))) && + (date_courante_ <=@ + (date_of_numbers (2018) (12) (31))))))) + (fun (_: _) -> + if + ((array_length + enfants_a_charge_droit_ouvert_prestation_familiale_) + >! (integer_of_string "2")) then + (bmaf_dot_montant_ *$ + (decimal_of_string "0.1089")) else + (money_of_cents_string "0"))); + (fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=117; start_column=11; + end_line=117; end_column=56; + law_headings=["Allocations familiales"; + "Champs d'applications"; + "Prologue"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/decrets_divers.catala_fr"; + start_line=465; start_column=5; + end_line=465; end_column=69; + law_headings=["Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte"; + "Dispositions spéciales relatives à Mayotte"]} + ((residence_ = (Collectivite.Mayotte ())) && + ((date_courante_ >=@ + (date_of_numbers (2019) (1) (1))) && + (date_courante_ <=@ + (date_of_numbers (2019) (12) (31))))))) + (fun (_: _) -> + if + ((array_length + enfants_a_charge_droit_ouvert_prestation_familiale_) + >! (integer_of_string "2")) then + (bmaf_dot_montant_ *$ + (decimal_of_string "0.1259")) else + (money_of_cents_string "0"))); + (fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=117; start_column=11; + end_line=117; end_column=56; + law_headings=["Allocations familiales"; + "Champs d'applications"; + "Prologue"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/decrets_divers.catala_fr"; + start_line=472; start_column=5; + end_line=472; end_column=69; + law_headings=["Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte"; + "Dispositions spéciales relatives à Mayotte"]} + ((residence_ = (Collectivite.Mayotte ())) && + ((date_courante_ >=@ + (date_of_numbers (2020) (1) (1))) && + (date_courante_ <=@ + (date_of_numbers (2020) (12) (31))))))) + (fun (_: _) -> + if + ((array_length + enfants_a_charge_droit_ouvert_prestation_familiale_) + >! (integer_of_string "2")) then + (bmaf_dot_montant_ *$ + (decimal_of_string "0.143")) else + (money_of_cents_string "0")))|]) + (fun (_: _) -> false) (fun (_: _) -> raise EmptyError))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/decrets_divers.catala_fr"; + start_line=186; start_column=14; end_line=186; end_column=59; + law_headings=["Article 7"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte"; + "Dispositions spéciales relatives à Mayotte"]} + true)) + (fun (_: _) -> + if + ((array_length + enfants_a_charge_droit_ouvert_prestation_familiale_) >! + (integer_of_string "2")) then + (bmaf_dot_montant_ *$ (decimal_of_string "0.16")) else + (money_of_cents_string "0"))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=117; start_column=11; end_line=117; end_column=56; + law_headings=["Allocations familiales"; "Champs d'applications"; + "Prologue"]})))) in + let nombre_total_enfants_: decimal = (log_variable_definition + ["AllocationsFamiliales"; "nombre_total_enfants"] (embed_decimal) ( + try + (handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=111; start_column=11; end_line=111; end_column=31; + law_headings=["Allocations familiales"; "Champs d'applications"; + "Prologue"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/securite_sociale_R.catala_fr"; + start_line=162; start_column=14; end_line=162; end_column=34; + law_headings=["Article R521-3"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets en Conseil d'Etat"; + "Code de la sécurité sociale"]} true)) + (fun (_: _) -> + decimal_of_integer + (array_length + enfants_a_charge_droit_ouvert_prestation_familiale_))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=111; start_column=11; end_line=111; end_column=31; + law_headings=["Allocations familiales"; "Champs d'applications"; + "Prologue"]})))) in + let nombre_moyen_enfants_: decimal = (log_variable_definition + ["AllocationsFamiliales"; "nombre_moyen_enfants"] (embed_decimal) ( + try + (handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=110; start_column=11; end_line=110; end_column=31; + law_headings=["Allocations familiales"; "Champs d'applications"; + "Prologue"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/securite_sociale_R.catala_fr"; + start_line=142; start_column=14; end_line=142; end_column=34; + law_headings=["Article R521-3"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets en Conseil d'Etat"; + "Code de la sécurité sociale"]} true)) + (fun (_: _) -> + Array.fold_left + (fun (acc_: decimal) (enfant_: _) -> + acc_ +& + (match ((log_end_call + ["AllocationsFamiliales"; "prise_en_compte"] + ((log_variable_definition + ["AllocationsFamiliales"; "prise_en_compte"; "output"] + (embed_prise_en_compte) ((log_begin_call + ["AllocationsFamiliales"; "prise_en_compte"] + prise_en_compte_) ((log_variable_definition + ["AllocationsFamiliales"; "prise_en_compte"; "input"] + (embed_enfant) enfant_))))))) + with + | PriseEnCompte.Complete _ -> (decimal_of_string "1.") + | PriseEnCompte.Partagee _ -> (decimal_of_string "0.5") + | PriseEnCompte.Zero _ -> (decimal_of_string "0."))) + (decimal_of_string "0.") + enfants_a_charge_droit_ouvert_prestation_familiale_)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=110; start_column=11; end_line=110; end_column=31; + law_headings=["Allocations familiales"; "Champs d'applications"; + "Prologue"]})))) in + let montant_initial_base_premier_enfant_: money = (log_variable_definition + ["AllocationsFamiliales"; "montant_initial_base_premier_enfant"] + (embed_money) ( + try + (handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=106; start_column=11; end_line=106; end_column=46; + law_headings=["Allocations familiales"; "Champs d'applications"; + "Prologue"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=106; start_column=11; + end_line=106; end_column=46; + law_headings=["Allocations familiales"; + "Champs d'applications"; "Prologue"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=106; start_column=11; + end_line=106; end_column=46; + law_headings=["Allocations familiales"; + "Champs d'applications"; + "Prologue"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=106; start_column=11; + end_line=106; end_column=46; + law_headings=["Allocations familiales"; + "Champs d'applications"; + "Prologue"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/decrets_divers.catala_fr"; + start_line=250; start_column=5; + end_line=251; end_column=53; + law_headings=["Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte"; + "Dispositions spéciales relatives à Mayotte"]} + ((residence_ = (Collectivite.Mayotte ())) + && + ((date_courante_ >=@ + (date_of_numbers (2011) (1) (1))) + && + ((date_courante_ <=@ + (date_of_numbers (2011) (12) (31))) + && + (not + avait_enfant_a_charge_avant_1er_janvier_2012_)))))) + (fun (_: _) -> + if + ((array_length + enfants_a_charge_droit_ouvert_prestation_familiale_) + >! (integer_of_string "0")) then + (bmaf_dot_montant_ *$ + (decimal_of_string "0.145")) else + (money_of_cents_string "0"))); + (fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=106; start_column=11; + end_line=106; end_column=46; + law_headings=["Allocations familiales"; + "Champs d'applications"; + "Prologue"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/decrets_divers.catala_fr"; + start_line=258; start_column=5; + end_line=259; end_column=53; + law_headings=["Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte"; + "Dispositions spéciales relatives à Mayotte"]} + ((residence_ = (Collectivite.Mayotte ())) + && + ((date_courante_ >=@ + (date_of_numbers (2012) (1) (1))) + && + ((date_courante_ <=@ + (date_of_numbers (2012) (12) (31))) + && + (not + avait_enfant_a_charge_avant_1er_janvier_2012_)))))) + (fun (_: _) -> + if + ((array_length + enfants_a_charge_droit_ouvert_prestation_familiale_) + >! (integer_of_string "0")) then + (bmaf_dot_montant_ *$ + (decimal_of_string "0.1393")) else + (money_of_cents_string "0"))); + (fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=106; start_column=11; + end_line=106; end_column=46; + law_headings=["Allocations familiales"; + "Champs d'applications"; + "Prologue"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/decrets_divers.catala_fr"; + start_line=266; start_column=5; + end_line=267; end_column=53; + law_headings=["Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte"; + "Dispositions spéciales relatives à Mayotte"]} + ((residence_ = (Collectivite.Mayotte ())) + && + ((date_courante_ >=@ + (date_of_numbers (2013) (1) (1))) + && + ((date_courante_ <=@ + (date_of_numbers (2013) (12) (31))) + && + (not + avait_enfant_a_charge_avant_1er_janvier_2012_)))))) + (fun (_: _) -> + if + ((array_length + enfants_a_charge_droit_ouvert_prestation_familiale_) + >! (integer_of_string "0")) then + (bmaf_dot_montant_ *$ + (decimal_of_string "0.1335")) else + (money_of_cents_string "0"))); + (fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=106; start_column=11; + end_line=106; end_column=46; + law_headings=["Allocations familiales"; + "Champs d'applications"; + "Prologue"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/decrets_divers.catala_fr"; + start_line=274; start_column=5; + end_line=275; end_column=53; + law_headings=["Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte"; + "Dispositions spéciales relatives à Mayotte"]} + ((residence_ = (Collectivite.Mayotte ())) + && + ((date_courante_ >=@ + (date_of_numbers (2014) (1) (1))) + && + ((date_courante_ <=@ + (date_of_numbers (2014) (12) (31))) + && + (not + avait_enfant_a_charge_avant_1er_janvier_2012_)))))) + (fun (_: _) -> + if + ((array_length + enfants_a_charge_droit_ouvert_prestation_familiale_) + >! (integer_of_string "0")) then + (bmaf_dot_montant_ *$ + (decimal_of_string "0.1278")) else + (money_of_cents_string "0"))); + (fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=106; start_column=11; + end_line=106; end_column=46; + law_headings=["Allocations familiales"; + "Champs d'applications"; + "Prologue"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/decrets_divers.catala_fr"; + start_line=282; start_column=5; + end_line=283; end_column=53; + law_headings=["Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte"; + "Dispositions spéciales relatives à Mayotte"]} + ((residence_ = (Collectivite.Mayotte ())) + && + ((date_courante_ >=@ + (date_of_numbers (2015) (1) (1))) + && + ((date_courante_ <=@ + (date_of_numbers (2015) (12) (31))) + && + (not + avait_enfant_a_charge_avant_1er_janvier_2012_)))))) + (fun (_: _) -> + if + ((array_length + enfants_a_charge_droit_ouvert_prestation_familiale_) + >! (integer_of_string "0")) then + (bmaf_dot_montant_ *$ + (decimal_of_string "0.122")) else + (money_of_cents_string "0"))); + (fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=106; start_column=11; + end_line=106; end_column=46; + law_headings=["Allocations familiales"; + "Champs d'applications"; + "Prologue"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/decrets_divers.catala_fr"; + start_line=290; start_column=5; + end_line=291; end_column=53; + law_headings=["Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte"; + "Dispositions spéciales relatives à Mayotte"]} + ((residence_ = (Collectivite.Mayotte ())) + && + ((date_courante_ >=@ + (date_of_numbers (2016) (1) (1))) + && + ((date_courante_ <=@ + (date_of_numbers (2016) (12) (31))) + && + (not + avait_enfant_a_charge_avant_1er_janvier_2012_)))))) + (fun (_: _) -> + if + ((array_length + enfants_a_charge_droit_ouvert_prestation_familiale_) + >! (integer_of_string "0")) then + (bmaf_dot_montant_ *$ + (decimal_of_string "0.1163")) else + (money_of_cents_string "0"))); + (fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=106; start_column=11; + end_line=106; end_column=46; + law_headings=["Allocations familiales"; + "Champs d'applications"; + "Prologue"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/decrets_divers.catala_fr"; + start_line=298; start_column=5; + end_line=299; end_column=53; + law_headings=["Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte"; + "Dispositions spéciales relatives à Mayotte"]} + ((residence_ = (Collectivite.Mayotte ())) + && + ((date_courante_ >=@ + (date_of_numbers (2017) (1) (1))) + && + ((date_courante_ <=@ + (date_of_numbers (2017) (12) (31))) + && + (not + avait_enfant_a_charge_avant_1er_janvier_2012_)))))) + (fun (_: _) -> + if + ((array_length + enfants_a_charge_droit_ouvert_prestation_familiale_) + >! (integer_of_string "0")) then + (bmaf_dot_montant_ *$ + (decimal_of_string "0.1105")) else + (money_of_cents_string "0"))); + (fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=106; start_column=11; + end_line=106; end_column=46; + law_headings=["Allocations familiales"; + "Champs d'applications"; + "Prologue"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/decrets_divers.catala_fr"; + start_line=306; start_column=5; + end_line=307; end_column=53; + law_headings=["Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte"; + "Dispositions spéciales relatives à Mayotte"]} + ((residence_ = (Collectivite.Mayotte ())) + && + ((date_courante_ >=@ + (date_of_numbers (2018) (1) (1))) + && + ((date_courante_ <=@ + (date_of_numbers (2018) (12) (31))) + && + (not + avait_enfant_a_charge_avant_1er_janvier_2012_)))))) + (fun (_: _) -> + if + ((array_length + enfants_a_charge_droit_ouvert_prestation_familiale_) + >! (integer_of_string "0")) then + (bmaf_dot_montant_ *$ + (decimal_of_string "0.0976")) else + (money_of_cents_string "0"))); + (fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=106; start_column=11; + end_line=106; end_column=46; + law_headings=["Allocations familiales"; + "Champs d'applications"; + "Prologue"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/decrets_divers.catala_fr"; + start_line=314; start_column=5; + end_line=315; end_column=53; + law_headings=["Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte"; + "Dispositions spéciales relatives à Mayotte"]} + ((residence_ = (Collectivite.Mayotte ())) + && + ((date_courante_ >=@ + (date_of_numbers (2019) (1) (1))) + && + ((date_courante_ <=@ + (date_of_numbers (2019) (12) (31))) + && + (not + avait_enfant_a_charge_avant_1er_janvier_2012_)))))) + (fun (_: _) -> + if + ((array_length + enfants_a_charge_droit_ouvert_prestation_familiale_) + >! (integer_of_string "0")) then + (bmaf_dot_montant_ *$ + (decimal_of_string "0.0847")) else + (money_of_cents_string "0"))); + (fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=106; start_column=11; + end_line=106; end_column=46; + law_headings=["Allocations familiales"; + "Champs d'applications"; + "Prologue"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/decrets_divers.catala_fr"; + start_line=322; start_column=5; + end_line=323; end_column=53; + law_headings=["Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte"; + "Dispositions spéciales relatives à Mayotte"]} + ((residence_ = (Collectivite.Mayotte ())) + && + ((date_courante_ >=@ + (date_of_numbers (2020) (1) (1))) + && + ((date_courante_ <=@ + (date_of_numbers (2020) (12) (31))) + && + (not + avait_enfant_a_charge_avant_1er_janvier_2012_)))))) + (fun (_: _) -> + if + ((array_length + enfants_a_charge_droit_ouvert_prestation_familiale_) + >! (integer_of_string "0")) then + (bmaf_dot_montant_ *$ + (decimal_of_string "0.0717")) else + (money_of_cents_string "0"))); + (fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=106; start_column=11; + end_line=106; end_column=46; + law_headings=["Allocations familiales"; + "Champs d'applications"; + "Prologue"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/decrets_divers.catala_fr"; + start_line=330; start_column=5; + end_line=330; end_column=49; + law_headings=["Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte"; + "Dispositions spéciales relatives à Mayotte"]} + ((residence_ = (Collectivite.Mayotte ())) + && + avait_enfant_a_charge_avant_1er_janvier_2012_))) + (fun (_: _) -> + if + ((array_length + enfants_a_charge_droit_ouvert_prestation_familiale_) + >! (integer_of_string "0")) then + (money_of_cents_string "5728") else + (money_of_cents_string "0")))|]) + (fun (_: _) -> false) + (fun (_: _) -> raise EmptyError))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/decrets_divers.catala_fr"; + start_line=167; start_column=14; + end_line=167; end_column=49; + law_headings=["Article 7"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte"; + "Dispositions spéciales relatives à Mayotte"]} + (residence_ = (Collectivite.Mayotte ())))) + (fun (_: _) -> + if + ((array_length + enfants_a_charge_droit_ouvert_prestation_familiale_) + >! (integer_of_string "0")) then + (bmaf_dot_montant_ *$ (decimal_of_string "0.0588")) + else (money_of_cents_string "0"))); + (fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=106; start_column=11; + end_line=106; end_column=46; + law_headings=["Allocations familiales"; + "Champs d'applications"; "Prologue"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/securite_sociale_D.catala_fr"; + start_line=362; start_column=5; + end_line=363; end_column=71; + law_headings=["Article D755-5"; + "Chapitre 5 : Prestations familiales et prestations assimilées"; + "Titre 5 : Départements d'outre-mer"; + "Livre 7 : Régimes divers - Dispositions diverses"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"]} + (prestations_familiales_dot_regime_outre_mer_l751_1_ && + ((array_length + enfants_a_charge_droit_ouvert_prestation_familiale_) + = (integer_of_string "1"))))) + (fun (_: _) -> + bmaf_dot_montant_ *$ (decimal_of_string "0.0588")))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/securite_sociale_D.catala_fr"; + start_line=359; start_column=29; end_line=359; end_column=64; + law_headings=["Article D755-5"; + "Chapitre 5 : Prestations familiales et prestations assimilées"; + "Titre 5 : Départements d'outre-mer"; + "Livre 7 : Régimes divers - Dispositions diverses"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"]} true)) + (fun (_: _) -> money_of_cents_string "0")) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=106; start_column=11; end_line=106; end_column=46; + law_headings=["Allocations familiales"; "Champs d'applications"; + "Prologue"]})))) in + let droit_ouvert_base_: bool = (log_variable_definition + ["AllocationsFamiliales"; "droit_ouvert_base"] (embed_bool) ( + try + (handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=104; start_column=11; end_line=104; end_column=28; + law_headings=["Allocations familiales"; "Champs d'applications"; + "Prologue"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=104; start_column=11; + end_line=104; end_column=28; + law_headings=["Allocations familiales"; + "Champs d'applications"; "Prologue"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=104; start_column=11; + end_line=104; end_column=28; + law_headings=["Allocations familiales"; + "Champs d'applications"; + "Prologue"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=104; start_column=11; + end_line=104; end_column=28; + law_headings=["Allocations familiales"; + "Champs d'applications"; + "Prologue"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=104; start_column=11; + end_line=104; end_column=28; + law_headings=["Allocations familiales"; + "Champs d'applications"; + "Prologue"]} ( + [||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/decrets_divers.catala_fr"; + start_line=159; start_column=6; + end_line=159; end_column=71; + law_headings=["Article 7"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte"; + "Dispositions spéciales relatives à Mayotte"]} + ((residence_ = + (Collectivite.Mayotte ())) && + ((array_length + enfants_a_charge_droit_ouvert_prestation_familiale_) + >=! (integer_of_string "1"))))) + (fun (_: _) -> true))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/securite_sociale_L.catala_fr"; + start_line=406; start_column=5; + end_line=407; end_column=72; + law_headings=["Article L755-12"; + "Chapitre 5 : Prestations familiales et prestations assimilées"; + "Titre 5 : Dispositions particulières à la Guadeloupe, à la Guyane, à la Martinique, à La Réunion, à Saint-Barthélemy et à Saint-Martin"; + "Livre 7 : Régimes divers - Dispositions diverses"; + "Partie législative"; + "Code de la sécurité sociale"]} + (prestations_familiales_dot_regime_outre_mer_l751_1_ + && + ((array_length + enfants_a_charge_droit_ouvert_prestation_familiale_) + >=! (integer_of_string "1"))))) + (fun (_: _) -> true))|]) + (fun (_: _) -> false) + (fun (_: _) -> raise EmptyError))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/securite_sociale_L.catala_fr"; + start_line=101; start_column=5; + end_line=101; end_column=70; + law_headings=["Article L521-1"; "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales \ - d'entretien"; - "Livre 5 : Prestations familiales et \ - prestations assimilées"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; "Partie législative"; - "Code de la sécurité sociale"; - ]; - } - (array_length - enfants_a_charge_droit_ouvert_prestation_familiale_ - >=! nombre_enfants_alinea_2_l521_3_ - && param_.Enfant.age - >=! log_end_call - [ - "AllocationsFamiliales"; - "âge_minimum_alinéa_1_l521_3"; - ] - (log_variable_definition - [ - "AllocationsFamiliales"; - "âge_minimum_alinéa_1_l521_3"; - "output"; - ] - embed_integer - ((log_begin_call - [ - "AllocationsFamiliales"; - "âge_minimum_alinéa_1_l521_3"; - ] - age_minimum_alinea_1_l521_3_) - (log_variable_definition - [ - "AllocationsFamiliales"; - "âge_minimum_alinéa_1_l521_3"; - "input"; - ] - embed_enfant param_))))) - (fun (_ : _) -> true)); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./securite_sociale_L.catala_fr"; - start_line = 299; - start_column = 5; - end_line = 300; - end_column = 58; - law_headings = - [ - "Article L521-3"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et \ - prestations assimilées"; - "Partie législative"; - "Code de la sécurité sociale"; - ]; - } - ((not - (log_end_call - [ - "AllocationsFamiliales"; - "est_enfant_le_plus_âgé"; - ] - (log_variable_definition - [ - "AllocationsFamiliales"; - "est_enfant_le_plus_âgé"; - "output"; - ] - 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é"; - "input"; - ] - embed_enfant param_))))) - && param_.Enfant.age - >=! log_end_call - [ - "AllocationsFamiliales"; - "âge_minimum_alinéa_1_l521_3"; - ] - (log_variable_definition - [ - "AllocationsFamiliales"; - "âge_minimum_alinéa_1_l521_3"; - "output"; - ] - embed_integer - ((log_begin_call - [ - "AllocationsFamiliales"; - "âge_minimum_alinéa_1_l521_3"; - ] - age_minimum_alinea_1_l521_3_) - (log_variable_definition - [ - "AllocationsFamiliales"; - "âge_minimum_alinéa_1_l521_3"; - "input"; - ] - embed_enfant param_))))) - (fun (_ : _) -> true)); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./prologue.catala_fr"; - start_line = 126; - start_column = 3; - end_line = 126; - end_column = 61; - law_headings = - [ - "Allocations familiales"; - "Champs d'applications"; - "Prologue"; - ]; - } - true) - (fun (_ : _) -> false) - with EmptyError -> - raise - (NoValueProvided - { - filename = "./prologue.catala_fr"; - start_line = 126; - start_column = 11; - end_line = 126; - end_column = 34; - law_headings = - [ - "Allocations familiales"; - "Champs d'applications"; - "Prologue"; - ]; - }) - with EmptyError -> - raise - (NoValueProvided - { - filename = "./prologue.catala_fr"; - start_line = 126; - start_column = 11; - end_line = 126; - end_column = 34; - law_headings = - [ - "Allocations familiales"; "Champs d'applications"; "Prologue"; - ]; - })) - in - let complement_degressif_ : money -> money = - log_variable_definition - ["AllocationsFamiliales"; "complément_dégressif"] - unembeddable - (try - fun (param_ : money) -> - try - handle_default - [| - (fun (_ : _) -> - handle_default - [| - (fun (_ : _) -> - handle_default - [| - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = - "./securite_sociale_D.catala_fr"; - start_line = 165; - start_column = 5; - end_line = 166; - end_column = 68; - law_headings = - [ - "Article D521-1"; - "Chapitre 1er : Allocations \ - familiales"; - "Titre 2 : Prestations générales \ - d'entretien"; - "Livre 5 : Prestations familiales \ - et prestations assimilées"; - "Partie réglementaire - Décrets \ - simples"; - "Code de la sécurité sociale"; - ]; - } - (ressources_menage_ >$ plafond__i_d521_3_ - && ressources_menage_ - <=$ plafond__i_d521_3_ - +$ param_ *$ decimal_of_string "12." - )) - (fun (_ : _) -> - (plafond__i_d521_3_ - +$ (param_ *$ decimal_of_string "12.") - -$ ressources_menage_) - *$ (decimal_of_string "1." - /& decimal_of_string "12."))); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./securite_sociale_D.catala_fr"; - start_line = 173; - start_column = 5; - end_line = 174; - end_column = 68; - law_headings = - [ - "Article D521-1"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales \ - d'entretien"; - "Livre 5 : Prestations familiales et \ - prestations assimilées"; - "Partie réglementaire - Décrets simples"; - "Code de la sécurité sociale"; - ]; - } - (ressources_menage_ >$ plafond__i_i_d521_3_ - && ressources_menage_ - <=$ plafond__i_i_d521_3_ - +$ (param_ *$ decimal_of_string "12."))) - (fun (_ : _) -> - (plafond__i_i_d521_3_ - +$ (param_ *$ decimal_of_string "12.") - -$ ressources_menage_) - *$ (decimal_of_string "1." - /& decimal_of_string "12."))); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./securite_sociale_D.catala_fr"; - start_line = 179; - start_column = 14; - end_line = 179; - end_column = 34; - law_headings = - [ - "Article D521-1"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et \ - prestations assimilées"; - "Partie réglementaire - Décrets simples"; - "Code de la sécurité sociale"; - ]; - } - true) - (fun (_ : _) -> money_of_cents_string "0")); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./prologue.catala_fr"; - start_line = 135; - start_column = 3; - end_line = 135; - end_column = 63; - law_headings = - [ - "Allocations familiales"; - "Champs d'applications"; - "Prologue"; - ]; - } - false) - (fun (_ : _) -> raise EmptyError) - with EmptyError -> - raise - (NoValueProvided - { - filename = "./prologue.catala_fr"; - start_line = 135; - start_column = 11; - end_line = 135; - end_column = 31; - law_headings = - [ - "Allocations familiales"; - "Champs d'applications"; - "Prologue"; - ]; - }) - with EmptyError -> - raise - (NoValueProvided - { - filename = "./prologue.catala_fr"; - start_line = 135; - start_column = 11; - end_line = 135; - end_column = 31; - law_headings = - [ - "Allocations familiales"; "Champs d'applications"; "Prologue"; - ]; - })) - in - let montant_verse_forfaitaire_par_enfant_ : money = - log_variable_definition - ["AllocationsFamiliales"; "montant_versé_forfaitaire_par_enfant"] - embed_money - (try - handle_default - [| - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./securite_sociale_D.catala_fr"; - start_line = 246; - start_column = 5; - end_line = 246; - end_column = 43; - law_headings = - [ - "Article D521-2"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et prestations \ - assimilées"; - "Partie réglementaire - Décrets simples"; - "Code de la sécurité sociale"; - ]; - } - (ressources_menage_ >$ plafond__i_i_d521_3_)) - (fun (_ : _) -> - bmaf_dot_montant_ *$ decimal_of_string "0.05059")); - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./securite_sociale_D.catala_fr"; - start_line = 232; - start_column = 5; - end_line = 233; - end_column = 46; - law_headings = - [ - "Article D521-2"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et prestations \ - assimilées"; - "Partie réglementaire - Décrets simples"; - "Code de la sécurité sociale"; - ]; - } - (ressources_menage_ >$ plafond__i_d521_3_ - && ressources_menage_ <=$ plafond__i_i_d521_3_)) - (fun (_ : _) -> - bmaf_dot_montant_ *$ decimal_of_string "0.10117")); - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./securite_sociale_D.catala_fr"; - start_line = 218; - start_column = 5; - end_line = 218; - end_column = 43; - law_headings = - [ - "Article D521-2"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et prestations \ - assimilées"; - "Partie réglementaire - Décrets simples"; - "Code de la sécurité sociale"; - ]; - } - (ressources_menage_ <=$ plafond__i_d521_3_)) - (fun (_ : _) -> - bmaf_dot_montant_ *$ decimal_of_string "0.20234")); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./prologue.catala_fr"; - start_line = 122; - start_column = 56; - end_line = 122; - end_column = 62; - law_headings = - [ - "Allocations familiales"; - "Champs d'applications"; - "Prologue"; - ]; - } - false) - (fun (_ : _) -> raise EmptyError) - with EmptyError -> - raise - (NoValueProvided - { - filename = "./prologue.catala_fr"; - start_line = 122; - start_column = 11; - end_line = 122; - end_column = 47; - law_headings = - [ - "Allocations familiales"; "Champs d'applications"; "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 - (try - handle_default - [| - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./securite_sociale_D.catala_fr"; - start_line = 122; - start_column = 14; - end_line = 122; - end_column = 59; - law_headings = - [ - "Article D521-1"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et prestations \ - assimilées"; - "Partie réglementaire - Décrets simples"; - "Code de la sécurité sociale"; - ]; - } - (ressources_menage_ >$ plafond__i_i_d521_3_)) - (fun (_ : _) -> - if - array_length - enfants_a_charge_droit_ouvert_prestation_familiale_ - >! integer_of_string "2" - then - bmaf_dot_montant_ *$ decimal_of_string "0.1025" - *$ decimal_of_integer - (array_length - enfants_a_charge_droit_ouvert_prestation_familiale_ - -! integer_of_string "2") - else money_of_cents_string "0")); - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./securite_sociale_D.catala_fr"; - start_line = 84; - start_column = 14; - end_line = 84; - end_column = 59; - law_headings = - [ - "Article D521-1"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et prestations \ - assimilées"; - "Partie réglementaire - Décrets simples"; - "Code de la sécurité sociale"; - ]; - } - (ressources_menage_ >$ plafond__i_d521_3_ - && ressources_menage_ <=$ plafond__i_i_d521_3_)) - (fun (_ : _) -> - if - array_length - enfants_a_charge_droit_ouvert_prestation_familiale_ - >! integer_of_string "2" - then - bmaf_dot_montant_ *$ decimal_of_string "0.205" - *$ decimal_of_integer - (array_length - enfants_a_charge_droit_ouvert_prestation_familiale_ - -! integer_of_string "2") - else money_of_cents_string "0")); - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./securite_sociale_D.catala_fr"; - start_line = 43; - start_column = 14; - end_line = 43; - end_column = 59; - law_headings = - [ - "Article D521-1"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et prestations \ - assimilées"; - "Partie réglementaire - Décrets simples"; - "Code de la sécurité sociale"; - ]; - } - (ressources_menage_ <=$ plafond__i_d521_3_)) - (fun (_ : _) -> - if - array_length - enfants_a_charge_droit_ouvert_prestation_familiale_ - >! integer_of_string "2" - then - bmaf_dot_montant_ *$ decimal_of_string "0.41" - *$ decimal_of_integer - (array_length - enfants_a_charge_droit_ouvert_prestation_familiale_ - -! integer_of_string "2") - else money_of_cents_string "0")); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./prologue.catala_fr"; - start_line = 108; - start_column = 65; - end_line = 108; - end_column = 71; - law_headings = - [ - "Allocations familiales"; - "Champs d'applications"; - "Prologue"; - ]; - } - false) - (fun (_ : _) -> raise EmptyError) - with EmptyError -> - raise - (NoValueProvided - { - filename = "./prologue.catala_fr"; - start_line = 108; - start_column = 11; - end_line = 108; - end_column = 56; - law_headings = - [ - "Allocations familiales"; "Champs d'applications"; "Prologue"; - ]; - })) - in - let montant_initial_base_deuxieme_enfant_ : money = - log_variable_definition - ["AllocationsFamiliales"; "montant_initial_base_deuxième_enfant"] - embed_money - (try - handle_default - [| - (fun (_ : _) -> + "Code de la sécurité sociale"]} + ((array_length + enfants_a_charge_droit_ouvert_prestation_familiale_) + >=! (integer_of_string "2")))) (fun (_: _) -> true))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=104; start_column=11; end_line=104; end_column=28; + law_headings=["Allocations familiales"; + "Champs d'applications"; "Prologue"]} true)) + (fun (_: _) -> false)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=104; start_column=11; end_line=104; end_column=28; + law_headings=["Allocations familiales"; "Champs d'applications"; + "Prologue"]})))) in + let droit_ouvert_majoration_: Enfant.t -> bool = (log_variable_definition + ["AllocationsFamiliales"; "droit_ouvert_majoration"] (unembeddable) ( + try + (fun (param_: Enfant.t) -> + try + (handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=126; start_column=11; end_line=126; end_column=34; + law_headings=["Allocations familiales"; + "Champs d'applications"; "Prologue"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=126; start_column=11; + end_line=126; end_column=34; + law_headings=["Allocations familiales"; + "Champs d'applications"; "Prologue"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=126; start_column=11; + end_line=126; end_column=34; + law_headings=["Allocations familiales"; + "Champs d'applications"; + "Prologue"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/securite_sociale_L.catala_fr"; + start_line=313; start_column=5; + end_line=315; end_column=58; + law_headings=["Article L521-3"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie législative"; + "Code de la sécurité sociale"]} + (((array_length + enfants_a_charge_droit_ouvert_prestation_familiale_) + >=! nombre_enfants_alinea_2_l521_3_) && + ((param_.Enfant.age) >=! ((log_end_call + ["AllocationsFamiliales"; + "âge_minimum_alinéa_1_l521_3"] + ((log_variable_definition + ["AllocationsFamiliales"; + "âge_minimum_alinéa_1_l521_3"; + "output"] (embed_integer) + ((log_begin_call + ["AllocationsFamiliales"; + "âge_minimum_alinéa_1_l521_3"] + age_minimum_alinea_1_l521_3_) + ((log_variable_definition + ["AllocationsFamiliales"; + "âge_minimum_alinéa_1_l521_3"; + "input"] (embed_enfant) + param_))))))))))) (fun (_: _) -> true))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/securite_sociale_L.catala_fr"; + start_line=299; start_column=5; + end_line=300; end_column=58; + law_headings=["Article L521-3"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie législative"; + "Code de la sécurité sociale"]} + ((not ((log_end_call + ["AllocationsFamiliales"; + "est_enfant_le_plus_âgé"] + ((log_variable_definition + ["AllocationsFamiliales"; + "est_enfant_le_plus_âgé"; "output"] + (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é"; "input"] + (embed_enfant) param_)))))))) && + ((param_.Enfant.age) >=! ((log_end_call + ["AllocationsFamiliales"; + "âge_minimum_alinéa_1_l521_3"] + ((log_variable_definition + ["AllocationsFamiliales"; + "âge_minimum_alinéa_1_l521_3"; "output"] + (embed_integer) ((log_begin_call + ["AllocationsFamiliales"; + "âge_minimum_alinéa_1_l521_3"] + age_minimum_alinea_1_l521_3_) + ((log_variable_definition + ["AllocationsFamiliales"; + "âge_minimum_alinéa_1_l521_3"; "input"] + (embed_enfant) param_))))))))))) + (fun (_: _) -> true))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=126; start_column=11; + end_line=126; end_column=34; + law_headings=["Allocations familiales"; + "Champs d'applications"; "Prologue"]} true)) + (fun (_: _) -> false)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=126; start_column=11; end_line=126; end_column=34; + law_headings=["Allocations familiales"; "Champs d'applications"; + "Prologue"]}))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=126; start_column=11; end_line=126; end_column=34; + law_headings=["Allocations familiales"; "Champs d'applications"; + "Prologue"]})))) in + let complement_degressif_: money -> money = (log_variable_definition + ["AllocationsFamiliales"; "complément_dégressif"] (unembeddable) ( + try + (fun (param_: money) -> + try + (handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=135; start_column=11; end_line=135; end_column=31; + law_headings=["Allocations familiales"; + "Champs d'applications"; "Prologue"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=135; start_column=11; + end_line=135; end_column=31; + law_headings=["Allocations familiales"; + "Champs d'applications"; "Prologue"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=135; start_column=11; + end_line=135; end_column=31; + law_headings=["Allocations familiales"; + "Champs d'applications"; + "Prologue"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=135; start_column=11; + end_line=135; end_column=31; + law_headings=["Allocations familiales"; + "Champs d'applications"; + "Prologue"]} ( + [||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/securite_sociale_D.catala_fr"; + start_line=173; start_column=5; + end_line=174; end_column=68; + law_headings=["Article D521-1"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"]} + ((ressources_menage_ >$ + plafond__i_i_d521_3_) && + (ressources_menage_ <=$ + (plafond__i_i_d521_3_ +$ + (param_ *$ + (decimal_of_string "12."))))))) + (fun (_: _) -> + ((plafond__i_i_d521_3_ +$ + (param_ *$ + (decimal_of_string "12."))) + -$ ressources_menage_) *$ + ((decimal_of_string "1.") /& + (decimal_of_string "12."))))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/securite_sociale_D.catala_fr"; + start_line=165; start_column=5; + end_line=166; end_column=68; + law_headings=["Article D521-1"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"]} + ((ressources_menage_ >$ plafond__i_d521_3_) + && + (ressources_menage_ <=$ + (plafond__i_d521_3_ +$ + (param_ *$ + (decimal_of_string "12."))))))) + (fun (_: _) -> + ((plafond__i_d521_3_ +$ + (param_ *$ (decimal_of_string "12."))) + -$ ressources_menage_) *$ + ((decimal_of_string "1.") /& + (decimal_of_string "12."))))|]) + (fun (_: _) -> false) (fun (_: _) -> raise EmptyError))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/securite_sociale_D.catala_fr"; + start_line=179; start_column=14; + end_line=179; end_column=34; + law_headings=["Article D521-1"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"]} true)) + (fun (_: _) -> money_of_cents_string "0")) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=135; start_column=11; end_line=135; end_column=31; + law_headings=["Allocations familiales"; "Champs d'applications"; + "Prologue"]}))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=135; start_column=11; end_line=135; end_column=31; + law_headings=["Allocations familiales"; "Champs d'applications"; + "Prologue"]})))) in + let montant_verse_forfaitaire_par_enfant_: money = (log_variable_definition + ["AllocationsFamiliales"; "montant_versé_forfaitaire_par_enfant"] + (embed_money) ( + try + (handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=122; start_column=11; end_line=122; end_column=47; + law_headings=["Allocations familiales"; "Champs d'applications"; + "Prologue"]} + ([|(fun (_: _) -> handle_default - [| - (fun (_ : _) -> - handle_default - [| - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 401; - start_column = 5; - end_line = 401; - end_column = 69; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 \ - relatif aux prestations familiales à \ - Mayotte"; - "Dispositions spéciales relatives à \ - Mayotte"; - ]; - } - (residence_ = Mayotte () - && date_courante_ >=@ date_of_numbers 2020 1 1 - && date_courante_ - <=@ date_of_numbers 2020 12 31)) - (fun (_ : _) -> - if - array_length - enfants_a_charge_droit_ouvert_prestation_familiale_ - >! integer_of_string "1" - then - bmaf_dot_montant_ *$ decimal_of_string "0.3068" - else money_of_cents_string "0")); - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 394; - start_column = 5; - end_line = 394; - end_column = 69; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 \ - relatif aux prestations familiales à \ - Mayotte"; - "Dispositions spéciales relatives à \ - Mayotte"; - ]; - } - (residence_ = Mayotte () - && date_courante_ >=@ date_of_numbers 2019 1 1 - && date_courante_ - <=@ date_of_numbers 2019 12 31)) - (fun (_ : _) -> - if - array_length - enfants_a_charge_droit_ouvert_prestation_familiale_ - >! integer_of_string "1" - then - bmaf_dot_montant_ *$ decimal_of_string "0.2936" - else money_of_cents_string "0")); - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 387; - start_column = 5; - end_line = 387; - end_column = 69; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 \ - relatif aux prestations familiales à \ - Mayotte"; - "Dispositions spéciales relatives à \ - Mayotte"; - ]; - } - (residence_ = Mayotte () - && date_courante_ >=@ date_of_numbers 2018 1 1 - && date_courante_ - <=@ date_of_numbers 2018 12 31)) - (fun (_ : _) -> - if - array_length - enfants_a_charge_droit_ouvert_prestation_familiale_ - >! integer_of_string "1" - then - bmaf_dot_montant_ *$ decimal_of_string "0.2804" - else money_of_cents_string "0")); - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 380; - start_column = 5; - end_line = 380; - end_column = 69; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 \ - relatif aux prestations familiales à \ - Mayotte"; - "Dispositions spéciales relatives à \ - Mayotte"; - ]; - } - (residence_ = Mayotte () - && date_courante_ >=@ date_of_numbers 2017 1 1 - && date_courante_ - <=@ date_of_numbers 2017 12 31)) - (fun (_ : _) -> - if - array_length - enfants_a_charge_droit_ouvert_prestation_familiale_ - >! integer_of_string "1" - then - bmaf_dot_montant_ *$ decimal_of_string "0.2672" - else money_of_cents_string "0")); - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 373; - start_column = 5; - end_line = 373; - end_column = 69; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 \ - relatif aux prestations familiales à \ - Mayotte"; - "Dispositions spéciales relatives à \ - Mayotte"; - ]; - } - (residence_ = Mayotte () - && date_courante_ >=@ date_of_numbers 2016 1 1 - && date_courante_ - <=@ date_of_numbers 2016 12 31)) - (fun (_ : _) -> - if - array_length - enfants_a_charge_droit_ouvert_prestation_familiale_ - >! integer_of_string "1" - then - bmaf_dot_montant_ *$ decimal_of_string "0.2613" - else money_of_cents_string "0")); - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 366; - start_column = 5; - end_line = 366; - end_column = 69; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 \ - relatif aux prestations familiales à \ - Mayotte"; - "Dispositions spéciales relatives à \ - Mayotte"; - ]; - } - (residence_ = Mayotte () - && date_courante_ >=@ date_of_numbers 2015 1 1 - && date_courante_ - <=@ date_of_numbers 2015 12 31)) - (fun (_ : _) -> - if - array_length - enfants_a_charge_droit_ouvert_prestation_familiale_ - >! integer_of_string "1" - then - bmaf_dot_montant_ *$ decimal_of_string "0.2555" - else money_of_cents_string "0")); - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 359; - start_column = 5; - end_line = 359; - end_column = 69; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 \ - relatif aux prestations familiales à \ - Mayotte"; - "Dispositions spéciales relatives à \ - Mayotte"; - ]; - } - (residence_ = Mayotte () - && date_courante_ >=@ date_of_numbers 2014 1 1 - && date_courante_ - <=@ date_of_numbers 2014 12 31)) - (fun (_ : _) -> - if - array_length - enfants_a_charge_droit_ouvert_prestation_familiale_ - >! integer_of_string "1" - then - bmaf_dot_montant_ *$ decimal_of_string "0.2496" - else money_of_cents_string "0")); - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 352; - start_column = 5; - end_line = 352; - end_column = 69; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 \ - relatif aux prestations familiales à \ - Mayotte"; - "Dispositions spéciales relatives à \ - Mayotte"; - ]; - } - (residence_ = Mayotte () - && date_courante_ >=@ date_of_numbers 2013 1 1 - && date_courante_ - <=@ date_of_numbers 2013 12 31)) - (fun (_ : _) -> - if - array_length - enfants_a_charge_droit_ouvert_prestation_familiale_ - >! integer_of_string "1" - then - bmaf_dot_montant_ *$ decimal_of_string "0.2437" - else money_of_cents_string "0")); - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 345; - start_column = 5; - end_line = 345; - end_column = 69; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 \ - relatif aux prestations familiales à \ - Mayotte"; - "Dispositions spéciales relatives à \ - Mayotte"; - ]; - } - (residence_ = Mayotte () - && date_courante_ >=@ date_of_numbers 2012 1 1 - && date_courante_ - <=@ date_of_numbers 2012 12 31)) - (fun (_ : _) -> - if - array_length - enfants_a_charge_droit_ouvert_prestation_familiale_ - >! integer_of_string "1" - then - bmaf_dot_montant_ *$ decimal_of_string "0.2379" - else money_of_cents_string "0")); - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 338; - start_column = 5; - end_line = 338; - end_column = 69; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 \ - relatif aux prestations familiales à \ - Mayotte"; - "Dispositions spéciales relatives à \ - Mayotte"; - ]; - } - (residence_ = Mayotte () - && date_courante_ >=@ date_of_numbers 2011 1 1 - && date_courante_ - <=@ date_of_numbers 2011 12 31)) - (fun (_ : _) -> - if - array_length - enfants_a_charge_droit_ouvert_prestation_familiale_ - >! integer_of_string "1" - then - bmaf_dot_montant_ *$ decimal_of_string "0.232" - else money_of_cents_string "0")); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 177; - start_column = 14; - end_line = 177; - end_column = 50; - law_headings = - [ - "Article 7"; - "Décret n°2002-423 du 29 mars 2002 relatif \ - aux prestations familiales à Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - ]; - } - (residence_ = Mayotte ())) - (fun (_ : _) -> - if - array_length - enfants_a_charge_droit_ouvert_prestation_familiale_ - >! integer_of_string "1" - then bmaf_dot_montant_ *$ decimal_of_string "0.32" - else money_of_cents_string "0")); - |] - (fun (_ : _) -> true) - (fun (_ : _) -> - handle_default - [| - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./securite_sociale_D.catala_fr"; - start_line = 38; - start_column = 14; - end_line = 38; - end_column = 50; - law_headings = - [ - "Article D521-1"; + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=122; start_column=11; + end_line=122; end_column=47; + law_headings=["Allocations familiales"; + "Champs d'applications"; "Prologue"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/securite_sociale_D.catala_fr"; + start_line=218; start_column=5; + end_line=218; end_column=43; + law_headings=["Article D521-2"; "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales \ - d'entretien"; - "Livre 5 : Prestations familiales et \ - prestations assimilées"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; "Partie réglementaire - Décrets simples"; - "Code de la sécurité sociale"; - ]; - } - (ressources_menage_ <=$ plafond__i_d521_3_)) - (fun (_ : _) -> - if - array_length - enfants_a_charge_droit_ouvert_prestation_familiale_ - >! integer_of_string "1" - then bmaf_dot_montant_ *$ decimal_of_string "0.32" - else money_of_cents_string "0")); - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./securite_sociale_D.catala_fr"; - start_line = 79; - start_column = 14; - end_line = 79; - end_column = 50; - law_headings = - [ - "Article D521-1"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales \ - d'entretien"; - "Livre 5 : Prestations familiales et \ - prestations assimilées"; - "Partie réglementaire - Décrets simples"; - "Code de la sécurité sociale"; - ]; - } - (ressources_menage_ >$ plafond__i_d521_3_ - && ressources_menage_ <=$ plafond__i_i_d521_3_)) - (fun (_ : _) -> - if - array_length - enfants_a_charge_droit_ouvert_prestation_familiale_ - >! integer_of_string "1" - then bmaf_dot_montant_ *$ decimal_of_string "0.16" - else money_of_cents_string "0")); - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./securite_sociale_D.catala_fr"; - start_line = 117; - start_column = 14; - end_line = 117; - end_column = 50; - law_headings = - [ - "Article D521-1"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales \ - d'entretien"; - "Livre 5 : Prestations familiales et \ - prestations assimilées"; - "Partie réglementaire - Décrets simples"; - "Code de la sécurité sociale"; - ]; - } - (ressources_menage_ >$ plafond__i_i_d521_3_)) - (fun (_ : _) -> - if - array_length - enfants_a_charge_droit_ouvert_prestation_familiale_ - >! integer_of_string "1" - then bmaf_dot_montant_ *$ decimal_of_string "0.08" - else money_of_cents_string "0")); - |] - (fun (_ : _) -> false) - (fun (_ : _) -> raise EmptyError))); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./prologue.catala_fr"; - start_line = 107; - start_column = 56; - end_line = 107; - end_column = 62; - law_headings = - [ - "Allocations familiales"; - "Champs d'applications"; - "Prologue"; - ]; - } - false) - (fun (_ : _) -> raise EmptyError) - with EmptyError -> - raise - (NoValueProvided - { - filename = "./prologue.catala_fr"; - start_line = 107; - start_column = 11; - end_line = 107; - end_column = 47; - 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 - (try - handle_default - [| - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./securite_sociale_R.catala_fr"; - start_line = 128; - start_column = 14; - end_line = 128; - end_column = 41; - law_headings = - [ - "Article R521-3"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et prestations \ - assimilées"; - "Partie réglementaire - Décrets en Conseil d'Etat"; - "Code de la sécurité sociale"; - ]; - } - true) - (fun (_ : _) -> - if nombre_total_enfants_ = decimal_of_string "0." then - decimal_of_string "0." - else nombre_moyen_enfants_ /& nombre_total_enfants_)); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./prologue.catala_fr"; - start_line = 109; - start_column = 47; - end_line = 109; - end_column = 54; - law_headings = - [ - "Allocations familiales"; - "Champs d'applications"; - "Prologue"; - ]; - } - false) - (fun (_ : _) -> raise EmptyError) - with EmptyError -> - raise - (NoValueProvided - { - filename = "./prologue.catala_fr"; - start_line = 109; - start_column = 11; - end_line = 109; - end_column = 38; - law_headings = - [ - "Allocations familiales"; "Champs d'applications"; "Prologue"; - ]; - })) - in - let montant_initial_metropole_majoration_ : Enfant.t -> money = - log_variable_definition - ["AllocationsFamiliales"; "montant_initial_métropole_majoration"] - unembeddable - (try - fun (param_ : Enfant.t) -> - try - handle_default - [| - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./epilogue.catala_fr"; - start_line = 28; - start_column = 5; - end_line = 28; - end_column = 44; - law_headings = ["Règles diverses"; "Épilogue"]; - } - (not - (log_end_call - [ - "AllocationsFamiliales"; - "droit_ouvert_majoration"; - ] - (log_variable_definition - [ - "AllocationsFamiliales"; - "droit_ouvert_majoration"; - "output"; - ] - embed_bool - ((log_begin_call - [ - "AllocationsFamiliales"; - "droit_ouvert_majoration"; - ] - droit_ouvert_majoration_) - (log_variable_definition - [ - "AllocationsFamiliales"; - "droit_ouvert_majoration"; - "input"; - ] - embed_enfant param_)))))) - (fun (_ : _) -> money_of_cents_string "0")); - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./securite_sociale_D.catala_fr"; - start_line = 138; - start_column = 5; - end_line = 138; - end_column = 38; - law_headings = - [ - "Article D521-1"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et \ - prestations assimilées"; - "Partie réglementaire - Décrets simples"; - "Code de la sécurité sociale"; - ]; - } - (ressources_menage_ >$ plafond__i_i_d521_3_ - && log_end_call - [ - "AllocationsFamiliales"; - "droit_ouvert_majoration"; - ] - (log_variable_definition - [ - "AllocationsFamiliales"; - "droit_ouvert_majoration"; - "output"; - ] - embed_bool - ((log_begin_call - [ - "AllocationsFamiliales"; - "droit_ouvert_majoration"; - ] - droit_ouvert_majoration_) - (log_variable_definition - [ - "AllocationsFamiliales"; - "droit_ouvert_majoration"; - "input"; - ] - embed_enfant param_))))) - (fun (_ : _) -> - bmaf_dot_montant_ *$ decimal_of_string "0.04")); - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./securite_sociale_D.catala_fr"; - start_line = 101; - start_column = 5; - end_line = 101; - end_column = 38; - law_headings = - [ - "Article D521-1"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et \ - prestations assimilées"; - "Partie réglementaire - Décrets simples"; - "Code de la sécurité sociale"; - ]; - } - ((ressources_menage_ >$ plafond__i_d521_3_ - && ressources_menage_ <=$ plafond__i_i_d521_3_) - && log_end_call - [ - "AllocationsFamiliales"; - "droit_ouvert_majoration"; - ] - (log_variable_definition - [ - "AllocationsFamiliales"; - "droit_ouvert_majoration"; - "output"; - ] - embed_bool - ((log_begin_call - [ - "AllocationsFamiliales"; - "droit_ouvert_majoration"; - ] - droit_ouvert_majoration_) - (log_variable_definition - [ - "AllocationsFamiliales"; - "droit_ouvert_majoration"; - "input"; - ] - embed_enfant param_))))) - (fun (_ : _) -> - bmaf_dot_montant_ *$ decimal_of_string "0.08")); - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./securite_sociale_D.catala_fr"; - start_line = 60; - start_column = 5; - end_line = 60; - end_column = 38; - law_headings = - [ - "Article D521-1"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et \ - prestations assimilées"; - "Partie réglementaire - Décrets simples"; - "Code de la sécurité sociale"; - ]; - } - (ressources_menage_ <=$ plafond__i_d521_3_ - && log_end_call - [ - "AllocationsFamiliales"; - "droit_ouvert_majoration"; - ] - (log_variable_definition - [ - "AllocationsFamiliales"; - "droit_ouvert_majoration"; - "output"; - ] - embed_bool - ((log_begin_call - [ - "AllocationsFamiliales"; - "droit_ouvert_majoration"; - ] - droit_ouvert_majoration_) - (log_variable_definition - [ - "AllocationsFamiliales"; - "droit_ouvert_majoration"; - "input"; - ] - embed_enfant param_))))) - (fun (_ : _) -> - bmaf_dot_montant_ *$ decimal_of_string "0.16")); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./prologue.catala_fr"; - start_line = 127; - start_column = 3; - end_line = 127; - end_column = 79; - law_headings = - [ - "Allocations familiales"; - "Champs d'applications"; - "Prologue"; - ]; - } - false) - (fun (_ : _) -> raise EmptyError) - with EmptyError -> - raise - (NoValueProvided - { - filename = "./prologue.catala_fr"; - start_line = 127; - start_column = 11; - end_line = 127; - end_column = 47; - law_headings = - [ - "Allocations familiales"; - "Champs d'applications"; - "Prologue"; - ]; - }) - with EmptyError -> - raise - (NoValueProvided - { - filename = "./prologue.catala_fr"; - start_line = 127; - start_column = 11; - end_line = 127; - end_column = 47; - law_headings = - [ - "Allocations familiales"; "Champs d'applications"; "Prologue"; - ]; - })) - in - let montant_verse_forfaitaire_ : money = - log_variable_definition - ["AllocationsFamiliales"; "montant_versé_forfaitaire"] - embed_money - (try - handle_default - [| - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./securite_sociale_D.catala_fr"; - start_line = 197; - start_column = 14; - end_line = 197; - end_column = 39; - law_headings = - [ - "Article D521-2"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et prestations \ - assimilées"; - "Partie réglementaire - Décrets simples"; - "Code de la sécurité sociale"; - ]; - } - true) - (fun (_ : _) -> - montant_verse_forfaitaire_par_enfant_ - *$ decimal_of_integer - (Array.fold_left - (fun (acc_ : integer) (enfant_ : _) -> - if - log_end_call - [ - "AllocationsFamiliales"; - "droit_ouvert_forfaitaire"; - ] - (log_variable_definition - [ - "AllocationsFamiliales"; - "droit_ouvert_forfaitaire"; - "output"; - ] - embed_bool - ((log_begin_call - [ - "AllocationsFamiliales"; - "droit_ouvert_forfaitaire"; - ] - droit_ouvert_forfaitaire_) - (log_variable_definition - [ - "AllocationsFamiliales"; - "droit_ouvert_forfaitaire"; - "input"; - ] - embed_enfant enfant_))) - then acc_ +! integer_of_string "1" - else acc_) - (integer_of_string "0") enfants_a_charge_))); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./prologue.catala_fr"; - start_line = 123; - start_column = 45; - end_line = 123; - end_column = 51; - law_headings = - [ - "Allocations familiales"; - "Champs d'applications"; - "Prologue"; - ]; - } - false) - (fun (_ : _) -> raise EmptyError) - with EmptyError -> - raise - (NoValueProvided - { - filename = "./prologue.catala_fr"; - start_line = 123; - start_column = 11; - end_line = 123; - end_column = 36; - law_headings = - [ - "Allocations familiales"; "Champs d'applications"; "Prologue"; - ]; - })) - in - let montant_initial_base_ : money = - log_variable_definition - ["AllocationsFamiliales"; "montant_initial_base"] - embed_money - (try - handle_default - [| - (fun (_ : _) -> + "Code de la sécurité sociale"]} + (ressources_menage_ <=$ plafond__i_d521_3_))) + (fun (_: _) -> + bmaf_dot_montant_ *$ (decimal_of_string "0.20234"))); + (fun (_: _) -> handle_default - [| - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 151; - start_column = 24; - end_line = 151; - end_column = 44; - law_headings = - [ - "Article 7"; - "Décret n°2002-423 du 29 mars 2002 relatif \ - aux prestations familiales à Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - ]; - } - (residence_ = Mayotte ())) - (fun (_ : _) -> - montant_initial_base_premier_enfant_ - +$ montant_initial_base_deuxieme_enfant_ - +$ montant_initial_base_troisieme_enfant_mayotte_ - +$ montant_initial_base_quatrieme_enfant_et_plus_mayotte_)); - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./securite_sociale_D.catala_fr"; - start_line = 353; - start_column = 5; - end_line = 354; - end_column = 69; - law_headings = - [ - "Article D755-5"; - "Chapitre 5 : Prestations familiales et \ - prestations assimilées"; - "Titre 5 : Départements d'outre-mer"; - "Livre 7 : Régimes divers - Dispositions \ - diverses"; - "Partie réglementaire - Décrets simples"; - "Code de la sécurité sociale"; - ]; - } - (prestations_familiales_dot_regime_outre_mer_l751_1_ - && array_length - enfants_a_charge_droit_ouvert_prestation_familiale_ - = integer_of_string "1")) - (fun (_ : _) -> montant_initial_base_premier_enfant_)); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./securite_sociale_D.catala_fr"; - start_line = 18; - start_column = 14; - end_line = 18; - end_column = 34; - law_headings = - [ - "Article D521-1"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et prestations \ - assimilées"; - "Partie réglementaire - Décrets simples"; - "Code de la sécurité sociale"; - ]; - } - true) - (fun (_ : _) -> - montant_initial_base_deuxieme_enfant_ - +$ montant_initial_base_troisieme_enfant_et_plus_)); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./prologue.catala_fr"; - start_line = 105; - start_column = 40; - end_line = 105; - end_column = 46; - law_headings = - [ - "Allocations familiales"; - "Champs d'applications"; - "Prologue"; - ]; - } - false) - (fun (_ : _) -> raise EmptyError) - with EmptyError -> - raise - (NoValueProvided - { - filename = "./prologue.catala_fr"; - start_line = 105; - start_column = 11; - end_line = 105; - end_column = 31; - law_headings = - [ - "Allocations familiales"; "Champs d'applications"; "Prologue"; - ]; - })) - in - let montant_initial_majoration_ : Enfant.t -> money = - log_variable_definition - ["AllocationsFamiliales"; "montant_initial_majoration"] - unembeddable - (try - fun (param_ : Enfant.t) -> - try - handle_default - [| - (fun (_ : _) -> - handle_default - [| - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./securite_sociale_D.catala_fr"; - start_line = 385; - start_column = 5; - end_line = 388; - end_column = 23; - law_headings = - [ - "Article D755-5"; - "Chapitre 5 : Prestations familiales et \ - prestations assimilées"; - "Titre 5 : Départements d'outre-mer"; - "Livre 7 : Régimes divers - Dispositions \ - diverses"; + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=122; start_column=11; + end_line=122; end_column=47; + law_headings=["Allocations familiales"; + "Champs d'applications"; "Prologue"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/securite_sociale_D.catala_fr"; + start_line=232; start_column=5; + end_line=233; end_column=46; + law_headings=["Article D521-2"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; "Partie réglementaire - Décrets simples"; - "Code de la sécurité sociale"; - ]; - } - (log_end_call - [ - "AllocationsFamiliales"; - "droit_ouvert_majoration"; - ] - (log_variable_definition - [ - "AllocationsFamiliales"; - "droit_ouvert_majoration"; - "output"; - ] - embed_bool - ((log_begin_call - [ - "AllocationsFamiliales"; - "droit_ouvert_majoration"; - ] - droit_ouvert_majoration_) - (log_variable_definition - [ - "AllocationsFamiliales"; - "droit_ouvert_majoration"; - "input"; - ] - embed_enfant param_))) - && prestations_familiales_dot_regime_outre_mer_l751_1_ - && array_length - enfants_a_charge_droit_ouvert_prestation_familiale_ - = integer_of_string "1" - && param_.Enfant.age >=! integer_of_string "16")) - (fun (_ : _) -> - bmaf_dot_montant_ *$ decimal_of_string "0.0567")); - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./securite_sociale_D.catala_fr"; - start_line = 376; - start_column = 5; - end_line = 379; - end_column = 42; - law_headings = - [ - "Article D755-5"; - "Chapitre 5 : Prestations familiales et \ - prestations assimilées"; - "Titre 5 : Départements d'outre-mer"; - "Livre 7 : Régimes divers - Dispositions \ - diverses"; - "Partie réglementaire - Décrets simples"; - "Code de la sécurité sociale"; - ]; - } - (log_end_call - [ - "AllocationsFamiliales"; - "droit_ouvert_majoration"; - ] - (log_variable_definition - [ - "AllocationsFamiliales"; - "droit_ouvert_majoration"; - "output"; - ] - embed_bool - ((log_begin_call - [ - "AllocationsFamiliales"; - "droit_ouvert_majoration"; - ] - droit_ouvert_majoration_) - (log_variable_definition - [ - "AllocationsFamiliales"; - "droit_ouvert_majoration"; - "input"; - ] - embed_enfant param_))) - && prestations_familiales_dot_regime_outre_mer_l751_1_ - && array_length - enfants_a_charge_droit_ouvert_prestation_familiale_ - = integer_of_string "1" - && param_.Enfant.age >=! integer_of_string "11" - && param_.Enfant.age - bmaf_dot_montant_ *$ decimal_of_string "0.0369")); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./securite_sociale_D.catala_fr"; - start_line = 22; - start_column = 14; - end_line = 22; - end_column = 40; - law_headings = - [ - "Article D521-1"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et \ - prestations assimilées"; - "Partie réglementaire - Décrets simples"; - "Code de la sécurité sociale"; - ]; - } - true) - (fun (_ : _) -> - log_end_call - [ - "AllocationsFamiliales"; - "montant_initial_métropole_majoration"; - ] - (log_variable_definition - [ - "AllocationsFamiliales"; - "montant_initial_métropole_majoration"; - "output"; - ] - embed_money - ((log_begin_call - [ - "AllocationsFamiliales"; - "montant_initial_métropole_majoration"; - ] - montant_initial_metropole_majoration_) - (log_variable_definition - [ - "AllocationsFamiliales"; - "montant_initial_métropole_majoration"; - "input"; - ] - embed_enfant param_))))); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./prologue.catala_fr"; - start_line = 128; - start_column = 3; - end_line = 128; - end_column = 69; - law_headings = - [ - "Allocations familiales"; - "Champs d'applications"; - "Prologue"; - ]; - } - false) - (fun (_ : _) -> raise EmptyError) - with EmptyError -> - raise - (NoValueProvided - { - filename = "./prologue.catala_fr"; - start_line = 128; - start_column = 11; - end_line = 128; - end_column = 37; - law_headings = - [ - "Allocations familiales"; - "Champs d'applications"; - "Prologue"; - ]; - }) - with EmptyError -> - raise - (NoValueProvided - { - filename = "./prologue.catala_fr"; - start_line = 128; - start_column = 11; - end_line = 128; - end_column = 37; - law_headings = - [ - "Allocations familiales"; "Champs d'applications"; "Prologue"; - ]; - })) - in - let montant_verse_complement_pour_forfaitaire_ : money = - log_variable_definition - ["AllocationsFamiliales"; "montant_versé_complément_pour_forfaitaire"] - embed_money - (try - handle_default - [| - (fun (_ : _) -> + "Code de la sécurité sociale"]} + ((ressources_menage_ >$ plafond__i_d521_3_) && + (ressources_menage_ <=$ plafond__i_i_d521_3_)))) + (fun (_: _) -> + bmaf_dot_montant_ *$ (decimal_of_string "0.10117"))); + (fun (_: _) -> handle_default - [| - (fun (_ : _) -> - handle_default - [| - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./securite_sociale_D.catala_fr"; - start_line = 265; - start_column = 5; - end_line = 267; - end_column = 42; - law_headings = - [ - "Article D521-2"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales \ - d'entretien"; - "Livre 5 : Prestations familiales et \ - prestations assimilées"; - "Partie réglementaire - Décrets simples"; - "Code de la sécurité sociale"; - ]; - } - (ressources_menage_ >$ plafond__i_d521_3_ - && ressources_menage_ - <=$ plafond__i_d521_3_ - +$ montant_verse_forfaitaire_ - *$ decimal_of_string "12.")) - (fun (_ : _) -> - (plafond__i_d521_3_ - +$ montant_verse_forfaitaire_ - *$ decimal_of_string "12." - -$ ressources_menage_) - *$ (decimal_of_string "1." - /& decimal_of_string "12."))); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./securite_sociale_D.catala_fr"; - start_line = 275; - start_column = 5; - end_line = 277; - end_column = 41; - law_headings = - [ - "Article D521-2"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et \ - prestations assimilées"; - "Partie réglementaire - Décrets simples"; - "Code de la sécurité sociale"; - ]; - } - (ressources_menage_ >$ plafond__i_i_d521_3_ - && ressources_menage_ - <=$ plafond__i_i_d521_3_ - +$ montant_verse_forfaitaire_ - *$ decimal_of_string "12.")) - (fun (_ : _) -> - (plafond__i_i_d521_3_ - +$ montant_verse_forfaitaire_ - *$ decimal_of_string "12." - -$ ressources_menage_) - *$ (decimal_of_string "1." /& decimal_of_string "12."))); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./securite_sociale_D.catala_fr"; - start_line = 283; - start_column = 14; - end_line = 283; - end_column = 55; - law_headings = - [ - "Article D521-2"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et prestations \ - assimilées"; - "Partie réglementaire - Décrets simples"; - "Code de la sécurité sociale"; - ]; - } - true) - (fun (_ : _) -> money_of_cents_string "0")); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./prologue.catala_fr"; - start_line = 137; - start_column = 61; - end_line = 137; - end_column = 67; - law_headings = - [ - "Allocations familiales"; - "Champs d'applications"; - "Prologue"; - ]; - } - false) - (fun (_ : _) -> raise EmptyError) - with EmptyError -> - raise - (NoValueProvided - { - filename = "./prologue.catala_fr"; - start_line = 137; - start_column = 11; - end_line = 137; - end_column = 52; - law_headings = - [ - "Allocations familiales"; "Champs d'applications"; "Prologue"; - ]; - })) - in - let montant_avec_garde_alternee_base_ : money = - log_variable_definition - ["AllocationsFamiliales"; "montant_avec_garde_alternée_base"] - embed_money - (try - handle_default - [| - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./securite_sociale_R.catala_fr"; - start_line = 125; - start_column = 14; - end_line = 125; - end_column = 46; - law_headings = - [ - "Article R521-3"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et prestations \ - assimilées"; - "Partie réglementaire - Décrets en Conseil d'Etat"; - "Code de la sécurité sociale"; - ]; - } - true) - (fun (_ : _) -> - montant_initial_base_ *$ rapport_enfants_total_moyen_)); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./prologue.catala_fr"; - start_line = 112; - start_column = 52; - end_line = 112; - end_column = 58; - law_headings = - [ - "Allocations familiales"; - "Champs d'applications"; - "Prologue"; - ]; - } - false) - (fun (_ : _) -> raise EmptyError) - with EmptyError -> - raise - (NoValueProvided - { - filename = "./prologue.catala_fr"; - start_line = 112; - start_column = 11; - end_line = 112; - end_column = 43; - law_headings = - [ - "Allocations familiales"; "Champs d'applications"; "Prologue"; - ]; - })) - in - let montant_avec_garde_alternee_majoration_ : Enfant.t -> money = - log_variable_definition - ["AllocationsFamiliales"; "montant_avec_garde_alternée_majoration"] - unembeddable - (try - fun (param_ : Enfant.t) -> - try - handle_default - [| - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./securite_sociale_R.catala_fr"; - start_line = 187; - start_column = 5; - end_line = 187; - end_column = 43; - law_headings = - [ - "Article R521-4"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et \ - prestations assimilées"; - "Partie réglementaire - Décrets en Conseil \ - d'Etat"; - "Code de la sécurité sociale"; - ]; - } - true) - (fun (_ : _) -> - log_end_call - ["AllocationsFamiliales"; "montant_initial_majoration"] - (log_variable_definition - [ - "AllocationsFamiliales"; - "montant_initial_majoration"; - "output"; - ] - embed_money - ((log_begin_call - [ - "AllocationsFamiliales"; - "montant_initial_majoration"; - ] - montant_initial_majoration_) - (log_variable_definition - [ - "AllocationsFamiliales"; - "montant_initial_majoration"; - "input"; - ] - embed_enfant param_))) - *$ - match - log_end_call - ["AllocationsFamiliales"; "prise_en_compte"] - (log_variable_definition - [ - "AllocationsFamiliales"; - "prise_en_compte"; - "output"; - ] - embed_prise_en_compte - ((log_begin_call - ["AllocationsFamiliales"; "prise_en_compte"] - prise_en_compte_) - (log_variable_definition - [ - "AllocationsFamiliales"; - "prise_en_compte"; - "input"; - ] - embed_enfant param_))) - with - | Complete _ -> decimal_of_string "1." - | Partagee _ -> decimal_of_string "0.5" - | Zero _ -> decimal_of_string "0.")); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./prologue.catala_fr"; - start_line = 129; - start_column = 3; - end_line = 129; - end_column = 81; - law_headings = - [ - "Allocations familiales"; - "Champs d'applications"; - "Prologue"; - ]; - } - false) - (fun (_ : _) -> raise EmptyError) - with EmptyError -> - raise - (NoValueProvided - { - filename = "./prologue.catala_fr"; - start_line = 129; - start_column = 11; - end_line = 129; - end_column = 49; - law_headings = - [ - "Allocations familiales"; - "Champs d'applications"; - "Prologue"; - ]; - }) - with EmptyError -> - raise - (NoValueProvided - { - filename = "./prologue.catala_fr"; - start_line = 129; - start_column = 11; - end_line = 129; - end_column = 49; - law_headings = - [ - "Allocations familiales"; "Champs d'applications"; "Prologue"; - ]; - })) - in - let montant_verse_base_ : money = - log_variable_definition - ["AllocationsFamiliales"; "montant_versé_base"] - embed_money - (try - handle_default - [| - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./epilogue.catala_fr"; - start_line = 37; - start_column = 14; - end_line = 37; - end_column = 32; - law_headings = ["Règles diverses"; "Épilogue"]; - } - true) - (fun (_ : _) -> - if droit_ouvert_base_ then montant_avec_garde_alternee_base_ - else money_of_cents_string "0")); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./prologue.catala_fr"; - start_line = 113; - start_column = 38; - end_line = 113; - end_column = 44; - law_headings = - [ - "Allocations familiales"; - "Champs d'applications"; - "Prologue"; - ]; - } - false) - (fun (_ : _) -> raise EmptyError) - with EmptyError -> - raise - (NoValueProvided - { - filename = "./prologue.catala_fr"; - start_line = 113; - start_column = 11; - end_line = 113; - end_column = 29; - law_headings = - [ - "Allocations familiales"; "Champs d'applications"; "Prologue"; - ]; - })) - in - let montant_verse_majoration_ : money = - log_variable_definition - ["AllocationsFamiliales"; "montant_versé_majoration"] - embed_money - (try - handle_default - [| - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./epilogue.catala_fr"; - start_line = 39; - start_column = 14; - end_line = 39; - end_column = 38; - law_headings = ["Règles diverses"; "Épilogue"]; - } - true) - (fun (_ : _) -> - if droit_ouvert_base_ then - Array.fold_left - (fun (acc_ : money) (enfant_ : _) -> - acc_ - +$ log_end_call - [ - "AllocationsFamiliales"; - "montant_avec_garde_alternée_majoration"; - ] - (log_variable_definition - [ - "AllocationsFamiliales"; - "montant_avec_garde_alternée_majoration"; - "output"; - ] - 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"; - "input"; - ] - embed_enfant enfant_)))) - (money_of_cents_string "0") - enfants_a_charge_ - else money_of_cents_string "0")); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./prologue.catala_fr"; - start_line = 130; - start_column = 44; - end_line = 130; - end_column = 50; - law_headings = - [ - "Allocations familiales"; - "Champs d'applications"; - "Prologue"; - ]; - } - false) - (fun (_ : _) -> raise EmptyError) - with EmptyError -> - raise - (NoValueProvided - { - filename = "./prologue.catala_fr"; - start_line = 130; - start_column = 11; - end_line = 130; - end_column = 35; - law_headings = - [ - "Allocations familiales"; "Champs d'applications"; "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 - (try - handle_default - [| - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./securite_sociale_D.catala_fr"; - start_line = 187; - start_column = 14; - end_line = 187; - end_column = 61; - law_headings = - [ - "Article D521-1"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et prestations \ - assimilées"; - "Partie réglementaire - Décrets simples"; - "Code de la sécurité sociale"; - ]; - } - true) - (fun (_ : _) -> - montant_verse_base_ +$ montant_verse_majoration_)); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./prologue.catala_fr"; - start_line = 134; - start_column = 67; - end_line = 134; - end_column = 73; - law_headings = - [ - "Allocations familiales"; - "Champs d'applications"; - "Prologue"; - ]; - } - false) - (fun (_ : _) -> raise EmptyError) - with EmptyError -> - raise - (NoValueProvided - { - filename = "./prologue.catala_fr"; - start_line = 134; - start_column = 11; - end_line = 134; - end_column = 58; - law_headings = - [ - "Allocations familiales"; "Champs d'applications"; "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 - (try - handle_default - [| - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./securite_sociale_D.catala_fr"; - start_line = 181; - start_column = 14; - end_line = 181; - end_column = 62; - law_headings = - [ - "Article D521-1"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et prestations \ - assimilées"; - "Partie réglementaire - Décrets simples"; - "Code de la sécurité sociale"; - ]; - } - true) - (fun (_ : _) -> - if droit_ouvert_complement_ then - log_end_call - ["AllocationsFamiliales"; "complément_dégressif"] - (log_variable_definition - [ - "AllocationsFamiliales"; - "complément_dégressif"; - "output"; - ] - embed_money - ((log_begin_call - ["AllocationsFamiliales"; "complément_dégressif"] - complement_degressif_) - (log_variable_definition - [ - "AllocationsFamiliales"; - "complément_dégressif"; - "input"; - ] - embed_money - montant_base_complement_pour_base_et_majoration_))) - else money_of_cents_string "0")); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./prologue.catala_fr"; - start_line = 136; - start_column = 68; - end_line = 136; - end_column = 74; - law_headings = - [ - "Allocations familiales"; - "Champs d'applications"; - "Prologue"; - ]; - } - false) - (fun (_ : _) -> raise EmptyError) - with EmptyError -> - raise - (NoValueProvided - { - filename = "./prologue.catala_fr"; - start_line = 136; - start_column = 11; - end_line = 136; - end_column = 59; - law_headings = - [ - "Allocations familiales"; "Champs d'applications"; "Prologue"; - ]; - })) - in - let montant_verse_ : money = - log_variable_definition - ["AllocationsFamiliales"; "montant_versé"] - embed_money - (try - handle_default - [| - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./epilogue.catala_fr"; - start_line = 45; - start_column = 14; - end_line = 45; - end_column = 27; - law_headings = ["Règles diverses"; "Épilogue"]; - } - true) - (fun (_ : _) -> - if droit_ouvert_base_ then - montant_verse_base_ +$ montant_verse_majoration_ - +$ montant_verse_forfaitaire_ - +$ montant_verse_complement_pour_base_et_majoration_ - +$ montant_verse_complement_pour_forfaitaire_ - else money_of_cents_string "0")); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./prologue.catala_fr"; - start_line = 101; - start_column = 32; - end_line = 101; - end_column = 38; - law_headings = - [ - "Allocations familiales"; - "Champs d'applications"; - "Prologue"; - ]; - } - false) - (fun (_ : _) -> raise EmptyError) - with EmptyError -> - raise - (NoValueProvided - { - filename = "./prologue.catala_fr"; - start_line = 101; - start_column = 10; - end_line = 101; - end_column = 23; - law_headings = - [ - "Allocations familiales"; "Champs d'applications"; "Prologue"; - ]; - })) - in - let (_ : unit) = - if - try - personne_charge_effective_permanente_est_parent_ - || (not personne_charge_effective_permanente_est_parent_) - && personne_charge_effective_permanente_remplit_titre__i_ - with EmptyError -> - raise - (NoValueProvided - { - filename = "./securite_sociale_L.catala_fr"; - start_line = 230; - start_column = 5; - end_line = 234; - end_column = 6; - law_headings = - [ - "Article L521-2"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et prestations assimilées"; - "Partie législative"; - "Code de la sécurité sociale"; - ]; - }) - then () - else raise AssertionFailed - in - { AllocationsFamilialesOut.montant_verse_out = montant_verse_ } + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=122; start_column=11; + end_line=122; end_column=47; + law_headings=["Allocations familiales"; + "Champs d'applications"; "Prologue"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/securite_sociale_D.catala_fr"; + start_line=246; start_column=5; + end_line=246; end_column=43; + law_headings=["Article D521-2"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"]} + (ressources_menage_ >$ plafond__i_i_d521_3_))) + (fun (_: _) -> + bmaf_dot_montant_ *$ (decimal_of_string "0.05059")))|]) + (fun (_: _) -> false) (fun (_: _) -> raise EmptyError)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=122; start_column=11; end_line=122; end_column=47; + law_headings=["Allocations familiales"; "Champs d'applications"; + "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) ( + try + (handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=108; start_column=11; end_line=108; end_column=56; + law_headings=["Allocations familiales"; "Champs d'applications"; + "Prologue"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=108; start_column=11; + end_line=108; end_column=56; + law_headings=["Allocations familiales"; + "Champs d'applications"; "Prologue"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/securite_sociale_D.catala_fr"; + start_line=43; start_column=14; + end_line=43; end_column=59; + law_headings=["Article D521-1"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"]} + (ressources_menage_ <=$ plafond__i_d521_3_))) + (fun (_: _) -> + if + ((array_length + enfants_a_charge_droit_ouvert_prestation_familiale_) + >! (integer_of_string "2")) then + ((bmaf_dot_montant_ *$ (decimal_of_string "0.41")) *$ + (decimal_of_integer + ((array_length + enfants_a_charge_droit_ouvert_prestation_familiale_) + -! (integer_of_string "2")))) else + (money_of_cents_string "0"))); + (fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=108; start_column=11; + end_line=108; end_column=56; + law_headings=["Allocations familiales"; + "Champs d'applications"; "Prologue"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/securite_sociale_D.catala_fr"; + start_line=84; start_column=14; + end_line=84; end_column=59; + law_headings=["Article D521-1"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"]} + ((ressources_menage_ >$ plafond__i_d521_3_) && + (ressources_menage_ <=$ plafond__i_i_d521_3_)))) + (fun (_: _) -> + if + ((array_length + enfants_a_charge_droit_ouvert_prestation_familiale_) + >! (integer_of_string "2")) then + ((bmaf_dot_montant_ *$ (decimal_of_string "0.205")) *$ + (decimal_of_integer + ((array_length + enfants_a_charge_droit_ouvert_prestation_familiale_) + -! (integer_of_string "2")))) else + (money_of_cents_string "0"))); + (fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=108; start_column=11; + end_line=108; end_column=56; + law_headings=["Allocations familiales"; + "Champs d'applications"; "Prologue"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/securite_sociale_D.catala_fr"; + start_line=122; start_column=14; + end_line=122; end_column=59; + law_headings=["Article D521-1"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"]} + (ressources_menage_ >$ plafond__i_i_d521_3_))) + (fun (_: _) -> + if + ((array_length + enfants_a_charge_droit_ouvert_prestation_familiale_) + >! (integer_of_string "2")) then + ((bmaf_dot_montant_ *$ (decimal_of_string "0.1025")) *$ + (decimal_of_integer + ((array_length + enfants_a_charge_droit_ouvert_prestation_familiale_) + -! (integer_of_string "2")))) else + (money_of_cents_string "0")))|]) (fun (_: _) -> false) + (fun (_: _) -> raise EmptyError)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=108; start_column=11; end_line=108; end_column=56; + law_headings=["Allocations familiales"; "Champs d'applications"; + "Prologue"]})))) in + let montant_initial_base_deuxieme_enfant_: money = (log_variable_definition + ["AllocationsFamiliales"; "montant_initial_base_deuxième_enfant"] + (embed_money) ( + try + (handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=107; start_column=11; end_line=107; end_column=47; + law_headings=["Allocations familiales"; "Champs d'applications"; + "Prologue"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=107; start_column=11; + end_line=107; end_column=47; + law_headings=["Allocations familiales"; + "Champs d'applications"; "Prologue"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=107; start_column=11; + end_line=107; end_column=47; + law_headings=["Allocations familiales"; + "Champs d'applications"; + "Prologue"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=107; start_column=11; + end_line=107; end_column=47; + law_headings=["Allocations familiales"; + "Champs d'applications"; + "Prologue"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/decrets_divers.catala_fr"; + start_line=338; start_column=5; + end_line=338; end_column=69; + law_headings=["Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte"; + "Dispositions spéciales relatives à Mayotte"]} + ((residence_ = (Collectivite.Mayotte ())) + && + ((date_courante_ >=@ + (date_of_numbers (2011) (1) (1))) + && + (date_courante_ <=@ + (date_of_numbers (2011) (12) (31))))))) + (fun (_: _) -> + if + ((array_length + enfants_a_charge_droit_ouvert_prestation_familiale_) + >! (integer_of_string "1")) then + (bmaf_dot_montant_ *$ + (decimal_of_string "0.232")) else + (money_of_cents_string "0"))); + (fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=107; start_column=11; + end_line=107; end_column=47; + law_headings=["Allocations familiales"; + "Champs d'applications"; + "Prologue"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/decrets_divers.catala_fr"; + start_line=345; start_column=5; + end_line=345; end_column=69; + law_headings=["Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte"; + "Dispositions spéciales relatives à Mayotte"]} + ((residence_ = (Collectivite.Mayotte ())) + && + ((date_courante_ >=@ + (date_of_numbers (2012) (1) (1))) + && + (date_courante_ <=@ + (date_of_numbers (2012) (12) (31))))))) + (fun (_: _) -> + if + ((array_length + enfants_a_charge_droit_ouvert_prestation_familiale_) + >! (integer_of_string "1")) then + (bmaf_dot_montant_ *$ + (decimal_of_string "0.2379")) else + (money_of_cents_string "0"))); + (fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=107; start_column=11; + end_line=107; end_column=47; + law_headings=["Allocations familiales"; + "Champs d'applications"; + "Prologue"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/decrets_divers.catala_fr"; + start_line=352; start_column=5; + end_line=352; end_column=69; + law_headings=["Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte"; + "Dispositions spéciales relatives à Mayotte"]} + ((residence_ = (Collectivite.Mayotte ())) + && + ((date_courante_ >=@ + (date_of_numbers (2013) (1) (1))) + && + (date_courante_ <=@ + (date_of_numbers (2013) (12) (31))))))) + (fun (_: _) -> + if + ((array_length + enfants_a_charge_droit_ouvert_prestation_familiale_) + >! (integer_of_string "1")) then + (bmaf_dot_montant_ *$ + (decimal_of_string "0.2437")) else + (money_of_cents_string "0"))); + (fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=107; start_column=11; + end_line=107; end_column=47; + law_headings=["Allocations familiales"; + "Champs d'applications"; + "Prologue"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/decrets_divers.catala_fr"; + start_line=359; start_column=5; + end_line=359; end_column=69; + law_headings=["Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte"; + "Dispositions spéciales relatives à Mayotte"]} + ((residence_ = (Collectivite.Mayotte ())) + && + ((date_courante_ >=@ + (date_of_numbers (2014) (1) (1))) + && + (date_courante_ <=@ + (date_of_numbers (2014) (12) (31))))))) + (fun (_: _) -> + if + ((array_length + enfants_a_charge_droit_ouvert_prestation_familiale_) + >! (integer_of_string "1")) then + (bmaf_dot_montant_ *$ + (decimal_of_string "0.2496")) else + (money_of_cents_string "0"))); + (fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=107; start_column=11; + end_line=107; end_column=47; + law_headings=["Allocations familiales"; + "Champs d'applications"; + "Prologue"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/decrets_divers.catala_fr"; + start_line=366; start_column=5; + end_line=366; end_column=69; + law_headings=["Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte"; + "Dispositions spéciales relatives à Mayotte"]} + ((residence_ = (Collectivite.Mayotte ())) + && + ((date_courante_ >=@ + (date_of_numbers (2015) (1) (1))) + && + (date_courante_ <=@ + (date_of_numbers (2015) (12) (31))))))) + (fun (_: _) -> + if + ((array_length + enfants_a_charge_droit_ouvert_prestation_familiale_) + >! (integer_of_string "1")) then + (bmaf_dot_montant_ *$ + (decimal_of_string "0.2555")) else + (money_of_cents_string "0"))); + (fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=107; start_column=11; + end_line=107; end_column=47; + law_headings=["Allocations familiales"; + "Champs d'applications"; + "Prologue"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/decrets_divers.catala_fr"; + start_line=373; start_column=5; + end_line=373; end_column=69; + law_headings=["Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte"; + "Dispositions spéciales relatives à Mayotte"]} + ((residence_ = (Collectivite.Mayotte ())) + && + ((date_courante_ >=@ + (date_of_numbers (2016) (1) (1))) + && + (date_courante_ <=@ + (date_of_numbers (2016) (12) (31))))))) + (fun (_: _) -> + if + ((array_length + enfants_a_charge_droit_ouvert_prestation_familiale_) + >! (integer_of_string "1")) then + (bmaf_dot_montant_ *$ + (decimal_of_string "0.2613")) else + (money_of_cents_string "0"))); + (fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=107; start_column=11; + end_line=107; end_column=47; + law_headings=["Allocations familiales"; + "Champs d'applications"; + "Prologue"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/decrets_divers.catala_fr"; + start_line=380; start_column=5; + end_line=380; end_column=69; + law_headings=["Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte"; + "Dispositions spéciales relatives à Mayotte"]} + ((residence_ = (Collectivite.Mayotte ())) + && + ((date_courante_ >=@ + (date_of_numbers (2017) (1) (1))) + && + (date_courante_ <=@ + (date_of_numbers (2017) (12) (31))))))) + (fun (_: _) -> + if + ((array_length + enfants_a_charge_droit_ouvert_prestation_familiale_) + >! (integer_of_string "1")) then + (bmaf_dot_montant_ *$ + (decimal_of_string "0.2672")) else + (money_of_cents_string "0"))); + (fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=107; start_column=11; + end_line=107; end_column=47; + law_headings=["Allocations familiales"; + "Champs d'applications"; + "Prologue"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/decrets_divers.catala_fr"; + start_line=387; start_column=5; + end_line=387; end_column=69; + law_headings=["Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte"; + "Dispositions spéciales relatives à Mayotte"]} + ((residence_ = (Collectivite.Mayotte ())) + && + ((date_courante_ >=@ + (date_of_numbers (2018) (1) (1))) + && + (date_courante_ <=@ + (date_of_numbers (2018) (12) (31))))))) + (fun (_: _) -> + if + ((array_length + enfants_a_charge_droit_ouvert_prestation_familiale_) + >! (integer_of_string "1")) then + (bmaf_dot_montant_ *$ + (decimal_of_string "0.2804")) else + (money_of_cents_string "0"))); + (fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=107; start_column=11; + end_line=107; end_column=47; + law_headings=["Allocations familiales"; + "Champs d'applications"; + "Prologue"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/decrets_divers.catala_fr"; + start_line=394; start_column=5; + end_line=394; end_column=69; + law_headings=["Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte"; + "Dispositions spéciales relatives à Mayotte"]} + ((residence_ = (Collectivite.Mayotte ())) + && + ((date_courante_ >=@ + (date_of_numbers (2019) (1) (1))) + && + (date_courante_ <=@ + (date_of_numbers (2019) (12) (31))))))) + (fun (_: _) -> + if + ((array_length + enfants_a_charge_droit_ouvert_prestation_familiale_) + >! (integer_of_string "1")) then + (bmaf_dot_montant_ *$ + (decimal_of_string "0.2936")) else + (money_of_cents_string "0"))); + (fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=107; start_column=11; + end_line=107; end_column=47; + law_headings=["Allocations familiales"; + "Champs d'applications"; + "Prologue"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/decrets_divers.catala_fr"; + start_line=401; start_column=5; + end_line=401; end_column=69; + law_headings=["Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte"; + "Dispositions spéciales relatives à Mayotte"]} + ((residence_ = (Collectivite.Mayotte ())) + && + ((date_courante_ >=@ + (date_of_numbers (2020) (1) (1))) + && + (date_courante_ <=@ + (date_of_numbers (2020) (12) (31))))))) + (fun (_: _) -> + if + ((array_length + enfants_a_charge_droit_ouvert_prestation_familiale_) + >! (integer_of_string "1")) then + (bmaf_dot_montant_ *$ + (decimal_of_string "0.3068")) else + (money_of_cents_string "0")))|]) + (fun (_: _) -> false) + (fun (_: _) -> raise EmptyError))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/decrets_divers.catala_fr"; + start_line=177; start_column=14; + end_line=177; end_column=50; + law_headings=["Article 7"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte"; + "Dispositions spéciales relatives à Mayotte"]} + (residence_ = (Collectivite.Mayotte ())))) + (fun (_: _) -> + if + ((array_length + enfants_a_charge_droit_ouvert_prestation_familiale_) + >! (integer_of_string "1")) then + (bmaf_dot_montant_ *$ (decimal_of_string "0.32")) else + (money_of_cents_string "0")))|]) (fun (_: _) -> true) + (fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=107; start_column=11; end_line=107; end_column=47; + law_headings=["Allocations familiales"; + "Champs d'applications"; "Prologue"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=107; start_column=11; + end_line=107; end_column=47; + law_headings=["Allocations familiales"; + "Champs d'applications"; "Prologue"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/securite_sociale_D.catala_fr"; + start_line=38; start_column=14; + end_line=38; end_column=50; + law_headings=["Article D521-1"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"]} + (ressources_menage_ <=$ plafond__i_d521_3_))) + (fun (_: _) -> + if + ((array_length + enfants_a_charge_droit_ouvert_prestation_familiale_) + >! (integer_of_string "1")) then + (bmaf_dot_montant_ *$ (decimal_of_string "0.32")) + else (money_of_cents_string "0"))); + (fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=107; start_column=11; + end_line=107; end_column=47; + law_headings=["Allocations familiales"; + "Champs d'applications"; "Prologue"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/securite_sociale_D.catala_fr"; + start_line=79; start_column=14; + end_line=79; end_column=50; + law_headings=["Article D521-1"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"]} + ((ressources_menage_ >$ plafond__i_d521_3_) && + (ressources_menage_ <=$ plafond__i_i_d521_3_)))) + (fun (_: _) -> + if + ((array_length + enfants_a_charge_droit_ouvert_prestation_familiale_) + >! (integer_of_string "1")) then + (bmaf_dot_montant_ *$ (decimal_of_string "0.16")) + else (money_of_cents_string "0"))); + (fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=107; start_column=11; + end_line=107; end_column=47; + law_headings=["Allocations familiales"; + "Champs d'applications"; "Prologue"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/securite_sociale_D.catala_fr"; + start_line=117; start_column=14; + end_line=117; end_column=50; + law_headings=["Article D521-1"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"]} + (ressources_menage_ >$ plafond__i_i_d521_3_))) + (fun (_: _) -> + if + ((array_length + enfants_a_charge_droit_ouvert_prestation_familiale_) + >! (integer_of_string "1")) then + (bmaf_dot_montant_ *$ (decimal_of_string "0.08")) + else (money_of_cents_string "0")))|]) + (fun (_: _) -> false) (fun (_: _) -> raise EmptyError))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=107; start_column=11; end_line=107; end_column=47; + 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) + ( + try + (handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=109; start_column=11; end_line=109; end_column=38; + law_headings=["Allocations familiales"; "Champs d'applications"; + "Prologue"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/securite_sociale_R.catala_fr"; + start_line=128; start_column=14; end_line=128; end_column=41; + law_headings=["Article R521-3"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets en Conseil d'Etat"; + "Code de la sécurité sociale"]} true)) + (fun (_: _) -> + if (nombre_total_enfants_ = (decimal_of_string "0.")) then + (decimal_of_string "0.") else + (nombre_moyen_enfants_ /& nombre_total_enfants_))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=109; start_column=11; end_line=109; end_column=38; + law_headings=["Allocations familiales"; "Champs d'applications"; + "Prologue"]})))) in + let montant_initial_metropole_majoration_: Enfant.t -> money = (log_variable_definition + ["AllocationsFamiliales"; "montant_initial_métropole_majoration"] + (unembeddable) ( + try + (fun (param_: Enfant.t) -> + try + (handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=127; start_column=11; end_line=127; end_column=47; + law_headings=["Allocations familiales"; + "Champs d'applications"; "Prologue"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=127; start_column=11; + end_line=127; end_column=47; + law_headings=["Allocations familiales"; + "Champs d'applications"; "Prologue"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/securite_sociale_D.catala_fr"; + start_line=60; start_column=5; + end_line=60; end_column=38; + law_headings=["Article D521-1"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"]} + ((ressources_menage_ <=$ plafond__i_d521_3_) && + ((log_end_call + ["AllocationsFamiliales"; + "droit_ouvert_majoration"] + ((log_variable_definition + ["AllocationsFamiliales"; + "droit_ouvert_majoration"; "output"] + (embed_bool) ((log_begin_call + ["AllocationsFamiliales"; + "droit_ouvert_majoration"] + droit_ouvert_majoration_) + ((log_variable_definition + ["AllocationsFamiliales"; + "droit_ouvert_majoration"; "input"] + (embed_enfant) param_)))))))))) + (fun (_: _) -> + bmaf_dot_montant_ *$ (decimal_of_string "0.16"))); + (fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=127; start_column=11; + end_line=127; end_column=47; + law_headings=["Allocations familiales"; + "Champs d'applications"; "Prologue"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/securite_sociale_D.catala_fr"; + start_line=101; start_column=5; + end_line=101; end_column=38; + law_headings=["Article D521-1"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"]} + (((ressources_menage_ >$ plafond__i_d521_3_) && + (ressources_menage_ <=$ plafond__i_i_d521_3_)) + && ((log_end_call + ["AllocationsFamiliales"; + "droit_ouvert_majoration"] + ((log_variable_definition + ["AllocationsFamiliales"; + "droit_ouvert_majoration"; "output"] + (embed_bool) ((log_begin_call + ["AllocationsFamiliales"; + "droit_ouvert_majoration"] + droit_ouvert_majoration_) + ((log_variable_definition + ["AllocationsFamiliales"; + "droit_ouvert_majoration"; "input"] + (embed_enfant) param_)))))))))) + (fun (_: _) -> + bmaf_dot_montant_ *$ (decimal_of_string "0.08"))); + (fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=127; start_column=11; + end_line=127; end_column=47; + law_headings=["Allocations familiales"; + "Champs d'applications"; "Prologue"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/securite_sociale_D.catala_fr"; + start_line=138; start_column=5; + end_line=138; end_column=38; + law_headings=["Article D521-1"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"]} + ((ressources_menage_ >$ plafond__i_i_d521_3_) && + ((log_end_call + ["AllocationsFamiliales"; + "droit_ouvert_majoration"] + ((log_variable_definition + ["AllocationsFamiliales"; + "droit_ouvert_majoration"; "output"] + (embed_bool) ((log_begin_call + ["AllocationsFamiliales"; + "droit_ouvert_majoration"] + droit_ouvert_majoration_) + ((log_variable_definition + ["AllocationsFamiliales"; + "droit_ouvert_majoration"; "input"] + (embed_enfant) param_)))))))))) + (fun (_: _) -> + bmaf_dot_montant_ *$ (decimal_of_string "0.04"))); + (fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=127; start_column=11; + end_line=127; end_column=47; + law_headings=["Allocations familiales"; + "Champs d'applications"; "Prologue"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/epilogue.catala_fr"; + start_line=28; start_column=5; + end_line=28; end_column=44; + law_headings=["Règles diverses"; "Épilogue"]} + (not ((log_end_call + ["AllocationsFamiliales"; + "droit_ouvert_majoration"] + ((log_variable_definition + ["AllocationsFamiliales"; + "droit_ouvert_majoration"; "output"] + (embed_bool) ((log_begin_call + ["AllocationsFamiliales"; + "droit_ouvert_majoration"] + droit_ouvert_majoration_) + ((log_variable_definition + ["AllocationsFamiliales"; + "droit_ouvert_majoration"; "input"] + (embed_enfant) param_)))))))))) + (fun (_: _) -> money_of_cents_string "0"))|]) + (fun (_: _) -> false) (fun (_: _) -> raise EmptyError)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=127; start_column=11; end_line=127; end_column=47; + law_headings=["Allocations familiales"; "Champs d'applications"; + "Prologue"]}))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=127; start_column=11; end_line=127; end_column=47; + law_headings=["Allocations familiales"; "Champs d'applications"; + "Prologue"]})))) in + let montant_verse_forfaitaire_: money = (log_variable_definition + ["AllocationsFamiliales"; "montant_versé_forfaitaire"] (embed_money) ( + try + (handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=123; start_column=11; end_line=123; end_column=36; + law_headings=["Allocations familiales"; "Champs d'applications"; + "Prologue"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/securite_sociale_D.catala_fr"; + start_line=197; start_column=14; end_line=197; end_column=39; + law_headings=["Article D521-2"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"]} true)) + (fun (_: _) -> + montant_verse_forfaitaire_par_enfant_ *$ + (decimal_of_integer + (Array.fold_left + (fun (acc_: integer) (enfant_: _) -> + if + ((log_end_call + ["AllocationsFamiliales"; + "droit_ouvert_forfaitaire"] + ((log_variable_definition + ["AllocationsFamiliales"; + "droit_ouvert_forfaitaire"; "output"] + (embed_bool) ((log_begin_call + ["AllocationsFamiliales"; + "droit_ouvert_forfaitaire"] + droit_ouvert_forfaitaire_) + ((log_variable_definition + ["AllocationsFamiliales"; + "droit_ouvert_forfaitaire"; "input"] + (embed_enfant) enfant_))))))) then + (acc_ +! (integer_of_string "1")) else acc_) + (integer_of_string "0") enfants_a_charge_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=123; start_column=11; end_line=123; end_column=36; + law_headings=["Allocations familiales"; "Champs d'applications"; + "Prologue"]})))) in + let montant_initial_base_: money = (log_variable_definition + ["AllocationsFamiliales"; "montant_initial_base"] (embed_money) ( + try + (handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=105; start_column=11; end_line=105; end_column=31; + law_headings=["Allocations familiales"; "Champs d'applications"; + "Prologue"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=105; start_column=11; + end_line=105; end_column=31; + law_headings=["Allocations familiales"; + "Champs d'applications"; "Prologue"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=105; start_column=11; + end_line=105; end_column=31; + law_headings=["Allocations familiales"; + "Champs d'applications"; + "Prologue"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/securite_sociale_D.catala_fr"; + start_line=353; start_column=5; + end_line=354; end_column=69; + law_headings=["Article D755-5"; + "Chapitre 5 : Prestations familiales et prestations assimilées"; + "Titre 5 : Départements d'outre-mer"; + "Livre 7 : Régimes divers - Dispositions diverses"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"]} + (prestations_familiales_dot_regime_outre_mer_l751_1_ + && + ((array_length + enfants_a_charge_droit_ouvert_prestation_familiale_) + = (integer_of_string "1"))))) + (fun (_: _) -> montant_initial_base_premier_enfant_)); + (fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=105; start_column=11; + end_line=105; end_column=31; + law_headings=["Allocations familiales"; + "Champs d'applications"; + "Prologue"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/decrets_divers.catala_fr"; + start_line=151; start_column=24; + end_line=151; end_column=44; + law_headings=["Article 7"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte"; + "Dispositions spéciales relatives à Mayotte"]} + (residence_ = (Collectivite.Mayotte ())))) + (fun (_: _) -> + ((montant_initial_base_premier_enfant_ +$ + montant_initial_base_deuxieme_enfant_) +$ + montant_initial_base_troisieme_enfant_mayotte_) + +$ + montant_initial_base_quatrieme_enfant_et_plus_mayotte_))|]) + (fun (_: _) -> false) (fun (_: _) -> raise EmptyError))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/securite_sociale_D.catala_fr"; + start_line=18; start_column=14; end_line=18; end_column=34; + law_headings=["Article D521-1"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"]} true)) + (fun (_: _) -> + montant_initial_base_deuxieme_enfant_ +$ + montant_initial_base_troisieme_enfant_et_plus_)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=105; start_column=11; end_line=105; end_column=31; + law_headings=["Allocations familiales"; "Champs d'applications"; + "Prologue"]})))) in + let montant_initial_majoration_: Enfant.t -> money = (log_variable_definition + ["AllocationsFamiliales"; "montant_initial_majoration"] (unembeddable) ( + try + (fun (param_: Enfant.t) -> + try + (handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=128; start_column=11; end_line=128; end_column=37; + law_headings=["Allocations familiales"; + "Champs d'applications"; "Prologue"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=128; start_column=11; + end_line=128; end_column=37; + law_headings=["Allocations familiales"; + "Champs d'applications"; "Prologue"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=128; start_column=11; + end_line=128; end_column=37; + law_headings=["Allocations familiales"; + "Champs d'applications"; + "Prologue"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/securite_sociale_D.catala_fr"; + start_line=376; start_column=5; + end_line=379; end_column=42; + law_headings=["Article D755-5"; + "Chapitre 5 : Prestations familiales et prestations assimilées"; + "Titre 5 : Départements d'outre-mer"; + "Livre 7 : Régimes divers - Dispositions diverses"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"]} + (((log_end_call + ["AllocationsFamiliales"; + "droit_ouvert_majoration"] + ((log_variable_definition + ["AllocationsFamiliales"; + "droit_ouvert_majoration"; "output"] + (embed_bool) ((log_begin_call + ["AllocationsFamiliales"; + "droit_ouvert_majoration"] + droit_ouvert_majoration_) + ((log_variable_definition + ["AllocationsFamiliales"; + "droit_ouvert_majoration"; "input"] + (embed_enfant) param_))))))) && + (prestations_familiales_dot_regime_outre_mer_l751_1_ + && + (((array_length + enfants_a_charge_droit_ouvert_prestation_familiale_) + = (integer_of_string "1")) && + (((param_.Enfant.age) >=! + (integer_of_string "11")) && + ((param_.Enfant.age) + bmaf_dot_montant_ *$ + (decimal_of_string "0.0369"))); + (fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=128; start_column=11; + end_line=128; end_column=37; + law_headings=["Allocations familiales"; + "Champs d'applications"; + "Prologue"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/securite_sociale_D.catala_fr"; + start_line=385; start_column=5; + end_line=388; end_column=23; + law_headings=["Article D755-5"; + "Chapitre 5 : Prestations familiales et prestations assimilées"; + "Titre 5 : Départements d'outre-mer"; + "Livre 7 : Régimes divers - Dispositions diverses"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"]} + (((log_end_call + ["AllocationsFamiliales"; + "droit_ouvert_majoration"] + ((log_variable_definition + ["AllocationsFamiliales"; + "droit_ouvert_majoration"; "output"] + (embed_bool) ((log_begin_call + ["AllocationsFamiliales"; + "droit_ouvert_majoration"] + droit_ouvert_majoration_) + ((log_variable_definition + ["AllocationsFamiliales"; + "droit_ouvert_majoration"; "input"] + (embed_enfant) param_))))))) && + (prestations_familiales_dot_regime_outre_mer_l751_1_ + && + (((array_length + enfants_a_charge_droit_ouvert_prestation_familiale_) + = (integer_of_string "1")) && + ((param_.Enfant.age) >=! + (integer_of_string "16"))))))) + (fun (_: _) -> + bmaf_dot_montant_ *$ + (decimal_of_string "0.0567")))|]) + (fun (_: _) -> false) (fun (_: _) -> raise EmptyError))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/securite_sociale_D.catala_fr"; + start_line=22; start_column=14; + end_line=22; end_column=40; + law_headings=["Article D521-1"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"]} true)) + (fun (_: _) -> (log_end_call + ["AllocationsFamiliales"; + "montant_initial_métropole_majoration"] + ((log_variable_definition + ["AllocationsFamiliales"; + "montant_initial_métropole_majoration"; "output"] + (embed_money) ((log_begin_call + ["AllocationsFamiliales"; + "montant_initial_métropole_majoration"] + montant_initial_metropole_majoration_) + ((log_variable_definition + ["AllocationsFamiliales"; + "montant_initial_métropole_majoration"; "input"] + (embed_enfant) param_)))))))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=128; start_column=11; end_line=128; end_column=37; + law_headings=["Allocations familiales"; "Champs d'applications"; + "Prologue"]}))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=128; start_column=11; end_line=128; end_column=37; + law_headings=["Allocations familiales"; "Champs d'applications"; + "Prologue"]})))) in + let montant_verse_complement_pour_forfaitaire_: money = (log_variable_definition + ["AllocationsFamiliales"; "montant_versé_complément_pour_forfaitaire"] + (embed_money) ( + try + (handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=137; start_column=11; end_line=137; end_column=52; + law_headings=["Allocations familiales"; "Champs d'applications"; + "Prologue"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=137; start_column=11; + end_line=137; end_column=52; + law_headings=["Allocations familiales"; + "Champs d'applications"; "Prologue"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=137; start_column=11; + end_line=137; end_column=52; + law_headings=["Allocations familiales"; + "Champs d'applications"; + "Prologue"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=137; start_column=11; + end_line=137; end_column=52; + law_headings=["Allocations familiales"; + "Champs d'applications"; + "Prologue"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/securite_sociale_D.catala_fr"; + start_line=275; start_column=5; + end_line=277; end_column=41; + law_headings=["Article D521-2"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"]} + ((ressources_menage_ >$ + plafond__i_i_d521_3_) && + (ressources_menage_ <=$ + (plafond__i_i_d521_3_ +$ + (montant_verse_forfaitaire_ *$ + (decimal_of_string "12."))))))) + (fun (_: _) -> + ((plafond__i_i_d521_3_ +$ + (montant_verse_forfaitaire_ *$ + (decimal_of_string "12."))) -$ + ressources_menage_) *$ + ((decimal_of_string "1.") /& + (decimal_of_string "12."))))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/securite_sociale_D.catala_fr"; + start_line=265; start_column=5; + end_line=267; end_column=42; + law_headings=["Article D521-2"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"]} + ((ressources_menage_ >$ plafond__i_d521_3_) && + (ressources_menage_ <=$ + (plafond__i_d521_3_ +$ + (montant_verse_forfaitaire_ *$ + (decimal_of_string "12."))))))) + (fun (_: _) -> + ((plafond__i_d521_3_ +$ + (montant_verse_forfaitaire_ *$ + (decimal_of_string "12."))) -$ + ressources_menage_) *$ + ((decimal_of_string "1.") /& + (decimal_of_string "12."))))|]) + (fun (_: _) -> false) (fun (_: _) -> raise EmptyError))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/securite_sociale_D.catala_fr"; + start_line=283; start_column=14; end_line=283; end_column=55; + law_headings=["Article D521-2"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"]} true)) + (fun (_: _) -> money_of_cents_string "0")) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=137; start_column=11; end_line=137; end_column=52; + law_headings=["Allocations familiales"; "Champs d'applications"; + "Prologue"]})))) in + let montant_avec_garde_alternee_base_: money = (log_variable_definition + ["AllocationsFamiliales"; "montant_avec_garde_alternée_base"] + (embed_money) ( + try + (handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=112; start_column=11; end_line=112; end_column=43; + law_headings=["Allocations familiales"; "Champs d'applications"; + "Prologue"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/securite_sociale_R.catala_fr"; + start_line=125; start_column=14; end_line=125; end_column=46; + law_headings=["Article R521-3"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets en Conseil d'Etat"; + "Code de la sécurité sociale"]} true)) + (fun (_: _) -> montant_initial_base_ *$ rapport_enfants_total_moyen_)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=112; start_column=11; end_line=112; end_column=43; + law_headings=["Allocations familiales"; "Champs d'applications"; + "Prologue"]})))) in + let montant_avec_garde_alternee_majoration_: Enfant.t -> money = (log_variable_definition + ["AllocationsFamiliales"; "montant_avec_garde_alternée_majoration"] + (unembeddable) ( + try + (fun (param_: Enfant.t) -> + try + (handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=129; start_column=11; end_line=129; end_column=49; + law_headings=["Allocations familiales"; + "Champs d'applications"; "Prologue"]} ( + [||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/securite_sociale_R.catala_fr"; + start_line=187; start_column=5; + end_line=187; end_column=43; + law_headings=["Article R521-4"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets en Conseil d'Etat"; + "Code de la sécurité sociale"]} true)) + (fun (_: _) -> + ((log_end_call + ["AllocationsFamiliales"; "montant_initial_majoration"] + ((log_variable_definition + ["AllocationsFamiliales"; "montant_initial_majoration"; + "output"] (embed_money) ((log_begin_call + ["AllocationsFamiliales"; "montant_initial_majoration"] + montant_initial_majoration_) ((log_variable_definition + ["AllocationsFamiliales"; "montant_initial_majoration"; + "input"] (embed_enfant) param_))))))) *$ + (match ((log_end_call + ["AllocationsFamiliales"; "prise_en_compte"] + ((log_variable_definition + ["AllocationsFamiliales"; "prise_en_compte"; "output"] + (embed_prise_en_compte) ((log_begin_call + ["AllocationsFamiliales"; "prise_en_compte"] + prise_en_compte_) ((log_variable_definition + ["AllocationsFamiliales"; "prise_en_compte"; "input"] + (embed_enfant) param_))))))) + with + | PriseEnCompte.Complete _ -> (decimal_of_string "1.") + | PriseEnCompte.Partagee _ -> (decimal_of_string "0.5") + | PriseEnCompte.Zero _ -> (decimal_of_string "0.")))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=129; start_column=11; end_line=129; end_column=49; + law_headings=["Allocations familiales"; "Champs d'applications"; + "Prologue"]}))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=129; start_column=11; end_line=129; end_column=49; + law_headings=["Allocations familiales"; "Champs d'applications"; + "Prologue"]})))) in + let montant_verse_base_: money = (log_variable_definition + ["AllocationsFamiliales"; "montant_versé_base"] (embed_money) ( + try + (handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=113; start_column=11; end_line=113; end_column=29; + law_headings=["Allocations familiales"; "Champs d'applications"; + "Prologue"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/epilogue.catala_fr"; + start_line=37; start_column=14; end_line=37; end_column=32; + law_headings=["Règles diverses"; "Épilogue"]} true)) + (fun (_: _) -> + if droit_ouvert_base_ then montant_avec_garde_alternee_base_ + else (money_of_cents_string "0"))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=113; start_column=11; end_line=113; end_column=29; + law_headings=["Allocations familiales"; "Champs d'applications"; + "Prologue"]})))) in + let montant_verse_majoration_: money = (log_variable_definition + ["AllocationsFamiliales"; "montant_versé_majoration"] (embed_money) ( + try + (handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=130; start_column=11; end_line=130; end_column=35; + law_headings=["Allocations familiales"; "Champs d'applications"; + "Prologue"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/epilogue.catala_fr"; + start_line=39; start_column=14; end_line=39; end_column=38; + law_headings=["Règles diverses"; "Épilogue"]} true)) + (fun (_: _) -> + if droit_ouvert_base_ then + (Array.fold_left + (fun (acc_: money) (enfant_: _) -> + acc_ +$ ((log_end_call + ["AllocationsFamiliales"; + "montant_avec_garde_alternée_majoration"] + ((log_variable_definition + ["AllocationsFamiliales"; + "montant_avec_garde_alternée_majoration"; "output"] + (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"; "input"] + (embed_enfant) enfant_)))))))) (money_of_cents_string + "0") enfants_a_charge_) else (money_of_cents_string "0"))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=130; start_column=11; end_line=130; end_column=35; + law_headings=["Allocations familiales"; "Champs d'applications"; + "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) ( + try + (handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=134; start_column=11; end_line=134; end_column=58; + law_headings=["Allocations familiales"; "Champs d'applications"; + "Prologue"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/securite_sociale_D.catala_fr"; + start_line=187; start_column=14; end_line=187; end_column=61; + law_headings=["Article D521-1"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"]} true)) + (fun (_: _) -> montant_verse_base_ +$ montant_verse_majoration_)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=134; start_column=11; end_line=134; end_column=58; + law_headings=["Allocations familiales"; "Champs d'applications"; + "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) ( + try + (handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=136; start_column=11; end_line=136; end_column=59; + law_headings=["Allocations familiales"; "Champs d'applications"; + "Prologue"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/securite_sociale_D.catala_fr"; + start_line=181; start_column=14; end_line=181; end_column=62; + law_headings=["Article D521-1"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"]} true)) + (fun (_: _) -> + if droit_ouvert_complement_ then + ((log_end_call + ["AllocationsFamiliales"; "complément_dégressif"] + ((log_variable_definition + ["AllocationsFamiliales"; "complément_dégressif"; "output"] + (embed_money) ((log_begin_call + ["AllocationsFamiliales"; "complément_dégressif"] + complement_degressif_) ((log_variable_definition + ["AllocationsFamiliales"; "complément_dégressif"; "input"] + (embed_money) + montant_base_complement_pour_base_et_majoration_))))))) else + (money_of_cents_string "0"))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=136; start_column=11; end_line=136; end_column=59; + law_headings=["Allocations familiales"; "Champs d'applications"; + "Prologue"]})))) in + let montant_verse_: money = (log_variable_definition + ["AllocationsFamiliales"; "montant_versé"] (embed_money) ( + try + (handle_default + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=101; start_column=10; end_line=101; end_column=23; + law_headings=["Allocations familiales"; "Champs d'applications"; + "Prologue"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/epilogue.catala_fr"; + start_line=45; start_column=14; end_line=45; end_column=27; + law_headings=["Règles diverses"; "Épilogue"]} true)) + (fun (_: _) -> + if droit_ouvert_base_ then + ((((montant_verse_base_ +$ montant_verse_majoration_) +$ + montant_verse_forfaitaire_) +$ + montant_verse_complement_pour_base_et_majoration_) +$ + montant_verse_complement_pour_forfaitaire_) else + (money_of_cents_string "0"))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=101; start_column=10; end_line=101; end_column=23; + law_headings=["Allocations familiales"; "Champs d'applications"; + "Prologue"]})))) in + let _: unit = if ( + try + (personne_charge_effective_permanente_est_parent_ || + ((not personne_charge_effective_permanente_est_parent_) + && + personne_charge_effective_permanente_remplit_titre__i_)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/allocations_familiales/securite_sociale_L.catala_fr"; + start_line=230; start_column=5; + end_line=234; end_column=6; + law_headings=["Article L521-2"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie législative"; + "Code de la sécurité sociale"]}))) + then () else + raise (AssertionFailed {filename = "examples/allocations_familiales/securite_sociale_L.catala_fr"; + start_line=230; start_column=5; + end_line=234; end_column=6; + law_headings=["Article L521-2"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie législative"; + "Code de la sécurité sociale"]}) in + {AllocationsFamilialesOut.montant_verse_out = montant_verse_} -let interface_allocations_familiales - (interface_allocations_familiales_in : InterfaceAllocationsFamilialesIn.t) : - InterfaceAllocationsFamilialesOut.t = - let i_date_courante_ : date = - interface_allocations_familiales_in - .InterfaceAllocationsFamilialesIn.i_date_courante_in - in - let i_enfants_ : EnfantEntree.t array = - interface_allocations_familiales_in - .InterfaceAllocationsFamilialesIn.i_enfants_in - in - let i_ressources_menage_ : money = - interface_allocations_familiales_in - .InterfaceAllocationsFamilialesIn.i_ressources_menage_in - in - let i_residence_ : collectivite = - interface_allocations_familiales_in - .InterfaceAllocationsFamilialesIn.i_residence_in - in - let i_personne_charge_effective_permanente_est_parent_ : bool = - interface_allocations_familiales_in - .InterfaceAllocationsFamilialesIn - .i_personne_charge_effective_permanente_est_parent_in - in - let i_personne_charge_effective_permanente_remplit_titre__i_ : bool = - interface_allocations_familiales_in - .InterfaceAllocationsFamilialesIn - .i_personne_charge_effective_permanente_remplit_titre_I_in - in - 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) - (try - handle_default - [| - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./epilogue.catala_fr"; - start_line = 117; - start_column = 14; - end_line = 117; - end_column = 30; - law_headings = - [ - "Article L131-1"; "Interface du programme"; "Épilogue"; - ]; - } - true) - (fun (_ : _) -> - Array.map - (fun (enfant_ : _) -> - { - Enfant.identifiant = enfant_.EnfantEntree.d_identifiant; - Enfant.obligation_scolaire = - (if - enfant_.EnfantEntree.d_date_de_naissance - +@ duration_of_numbers 3 0 0 - >=@ i_date_courante_ - then Avant () - else if - enfant_.EnfantEntree.d_date_de_naissance - +@ duration_of_numbers 16 0 0 - >=@ i_date_courante_ - then Pendant () - else Apres ()); - Enfant.remuneration_mensuelle = - enfant_.EnfantEntree.d_remuneration_mensuelle; - Enfant.date_de_naissance = - enfant_.EnfantEntree.d_date_de_naissance; - Enfant.age = - year_of_date - (date_of_numbers 0 1 1 - +@ (i_date_courante_ - -@ enfant_.EnfantEntree.d_date_de_naissance)); - Enfant.prise_en_charge = - enfant_.EnfantEntree.d_prise_en_charge; - Enfant.a_deja_ouvert_droit_aux_allocations_familiales = - enfant_ - .EnfantEntree - .d_a_deja_ouvert_droit_aux_allocations_familiales; - Enfant - .beneficie_titre_personnel_aide_personnelle_logement = - enfant_ - .EnfantEntree - .d_beneficie_titre_personnel_aide_personnelle_logement; - }) - i_enfants_)); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./epilogue.catala_fr"; - start_line = 76; - start_column = 36; - end_line = 76; - end_column = 53; - law_headings = ["Interface du programme"; "Épilogue"]; - } - false) - (fun (_ : _) -> raise EmptyError) - with EmptyError -> - raise - (NoValueProvided - { - filename = "./epilogue.catala_fr"; - start_line = 76; - start_column = 11; - end_line = 76; - end_column = 27; - law_headings = ["Interface du programme"; "Épilogue"]; - })) - in - let allocations_familiales_dot_personne_charge_effective_permanente_est_parent_ - : bool = +let interface_allocations_familiales (interface_allocations_familiales_in: InterfaceAllocationsFamilialesIn.t) : InterfaceAllocationsFamilialesOut.t = + let i_date_courante_: date = interface_allocations_familiales_in.InterfaceAllocationsFamilialesIn.i_date_courante_in in + let i_enfants_: EnfantEntree.t array = interface_allocations_familiales_in.InterfaceAllocationsFamilialesIn.i_enfants_in in + let i_ressources_menage_: money = interface_allocations_familiales_in.InterfaceAllocationsFamilialesIn.i_ressources_menage_in in + let i_residence_: Collectivite.t = interface_allocations_familiales_in.InterfaceAllocationsFamilialesIn.i_residence_in in + let i_personne_charge_effective_permanente_est_parent_: bool = interface_allocations_familiales_in.InterfaceAllocationsFamilialesIn.i_personne_charge_effective_permanente_est_parent_in in + let i_personne_charge_effective_permanente_remplit_titre__i_: bool = interface_allocations_familiales_in.InterfaceAllocationsFamilialesIn.i_personne_charge_effective_permanente_remplit_titre_I_in in + 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)) ( try - log_variable_definition - [ - "InterfaceAllocationsFamiliales"; - "allocations_familiales.personne_charge_effective_permanente_est_parent"; - ] - embed_bool - (handle_default - [| - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./epilogue.catala_fr"; - start_line = 93; - start_column = 18; - end_line = 93; - end_column = 67; - law_headings = ["Interface du programme"; "Épilogue"]; - } - i_personne_charge_effective_permanente_est_parent_) - (fun (_ : _) -> true)); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./prologue.catala_fr"; - start_line = 86; - start_column = 58; - end_line = 86; - end_column = 67; - law_headings = - [ - "Allocations familiales"; - "Champs d'applications"; - "Prologue"; - ]; - } - true) - (fun (_ : _) -> false)) - with EmptyError -> - raise - (NoValueProvided - { - filename = "./prologue.catala_fr"; - start_line = 86; - start_column = 10; - end_line = 86; - end_column = 57; - law_headings = - ["Allocations familiales"; "Champs d'applications"; "Prologue"]; - }) - in - let allocations_familiales_dot_personne_charge_effective_permanente_remplit_titre__i_ - : bool = + (handle_default + {filename = "examples/allocations_familiales/epilogue.catala_fr"; + start_line=76; start_column=11; end_line=76; end_column=27; + law_headings=["Interface du programme"; "Épilogue"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/epilogue.catala_fr"; + start_line=117; start_column=14; end_line=117; end_column=30; + law_headings=["Article L131-1"; "Interface du programme"; + "Épilogue"]} true)) + (fun (_: _) -> + Array.map + (fun (enfant_: _) -> + {Enfant.identifiant = (enfant_.EnfantEntree.d_identifiant); + Enfant.obligation_scolaire = + ( if + (((enfant_.EnfantEntree.d_date_de_naissance) +@ + (duration_of_numbers (3) (0) (0))) >=@ + i_date_courante_) then + (SituationObligationScolaire.Avant ()) else + ( if + (((enfant_.EnfantEntree.d_date_de_naissance) +@ + (duration_of_numbers (16) (0) (0))) >=@ + i_date_courante_) then + (SituationObligationScolaire.Pendant ()) else + (SituationObligationScolaire.Apres ()))); + Enfant.remuneration_mensuelle = + (enfant_.EnfantEntree.d_remuneration_mensuelle); + Enfant.date_de_naissance = + (enfant_.EnfantEntree.d_date_de_naissance); + Enfant.age = + (year_of_date + ((date_of_numbers (0) (1) (1)) +@ + (i_date_courante_ -@ + (enfant_.EnfantEntree.d_date_de_naissance)))); + Enfant.prise_en_charge = + (enfant_.EnfantEntree.d_prise_en_charge); + Enfant.a_deja_ouvert_droit_aux_allocations_familiales = + (enfant_.EnfantEntree.d_a_deja_ouvert_droit_aux_allocations_familiales); + Enfant.beneficie_titre_personnel_aide_personnelle_logement = + (enfant_.EnfantEntree.d_beneficie_titre_personnel_aide_personnelle_logement)}) + i_enfants_)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/allocations_familiales/epilogue.catala_fr"; + start_line=76; start_column=11; end_line=76; end_column=27; + law_headings=["Interface du programme"; "Épilogue"]})))) in + let allocations_familiales_dot_personne_charge_effective_permanente_est_parent_: bool = + try ((log_variable_definition + ["InterfaceAllocationsFamiliales"; + "allocations_familiales.personne_charge_effective_permanente_est_parent"] + (embed_bool) + (handle_default + {filename = "examples/allocations_familiales/epilogue.catala_fr"; + start_line=77; start_column=3; end_line=77; end_column=25; + law_headings=["Interface du programme"; "Épilogue"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/epilogue.catala_fr"; + start_line=77; start_column=3; end_line=77; end_column=25; + law_headings=["Interface du programme"; "Épilogue"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/epilogue.catala_fr"; + start_line=93; start_column=18; + end_line=93; end_column=67; + law_headings=["Interface du programme"; "Épilogue"]} + i_personne_charge_effective_permanente_est_parent_)) + (fun (_: _) -> true))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/epilogue.catala_fr"; + start_line=77; start_column=3; end_line=77; end_column=25; + law_headings=["Interface du programme"; "Épilogue"]} true)) + (fun (_: _) -> false)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=86; start_column=10; end_line=86; end_column=57; + law_headings=["Allocations familiales"; "Champs d'applications"; + "Prologue"]})) in + let allocations_familiales_dot_personne_charge_effective_permanente_remplit_titre__i_: bool = + try ((log_variable_definition + ["InterfaceAllocationsFamiliales"; + "allocations_familiales.personne_charge_effective_permanente_remplit_titre_I"] + (embed_bool) + (handle_default + {filename = "examples/allocations_familiales/epilogue.catala_fr"; + start_line=77; start_column=3; end_line=77; end_column=25; + law_headings=["Interface du programme"; "Épilogue"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/epilogue.catala_fr"; + start_line=77; start_column=3; end_line=77; end_column=25; + law_headings=["Interface du programme"; "Épilogue"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/epilogue.catala_fr"; + start_line=97; start_column=18; + end_line=97; end_column=72; + law_headings=["Interface du programme"; "Épilogue"]} + i_personne_charge_effective_permanente_remplit_titre__i_)) + (fun (_: _) -> true))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/epilogue.catala_fr"; + start_line=77; start_column=3; end_line=77; end_column=25; + law_headings=["Interface du programme"; "Épilogue"]} true)) + (fun (_: _) -> false)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=87; start_column=10; end_line=87; end_column=62; + law_headings=["Allocations familiales"; "Champs d'applications"; + "Prologue"]})) in + let allocations_familiales_dot_ressources_menage_: money = + try ((log_variable_definition + ["InterfaceAllocationsFamiliales"; + "allocations_familiales.ressources_ménage"] (embed_money) + (handle_default + {filename = "examples/allocations_familiales/epilogue.catala_fr"; + start_line=77; start_column=3; end_line=77; end_column=25; + law_headings=["Interface du programme"; "Épilogue"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/epilogue.catala_fr"; + start_line=88; start_column=14; end_line=88; end_column=54; + law_headings=["Interface du programme"; "Épilogue"]} true)) + (fun (_: _) -> i_ressources_menage_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=88; start_column=10; end_line=88; end_column=27; + law_headings=["Allocations familiales"; "Champs d'applications"; + "Prologue"]})) in + let allocations_familiales_dot_residence_: Collectivite.t = + try ((log_variable_definition + ["InterfaceAllocationsFamiliales"; "allocations_familiales.résidence"] + (embed_collectivite) + (handle_default + {filename = "examples/allocations_familiales/epilogue.catala_fr"; + start_line=77; start_column=3; end_line=77; end_column=25; + law_headings=["Interface du programme"; "Épilogue"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/epilogue.catala_fr"; + start_line=89; start_column=14; end_line=89; end_column=46; + law_headings=["Interface du programme"; "Épilogue"]} true)) + (fun (_: _) -> i_residence_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=89; start_column=10; end_line=89; end_column=19; + law_headings=["Allocations familiales"; "Champs d'applications"; + "Prologue"]})) in + let allocations_familiales_dot_date_courante_: date = + try ((log_variable_definition + ["InterfaceAllocationsFamiliales"; + "allocations_familiales.date_courante"] (embed_date) + (handle_default + {filename = "examples/allocations_familiales/epilogue.catala_fr"; + start_line=77; start_column=3; end_line=77; end_column=25; + law_headings=["Interface du programme"; "Épilogue"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/epilogue.catala_fr"; + start_line=86; start_column=14; end_line=86; end_column=50; + law_headings=["Interface du programme"; "Épilogue"]} true)) + (fun (_: _) -> i_date_courante_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=92; start_column=10; end_line=92; end_column=23; + law_headings=["Allocations familiales"; "Champs d'applications"; + "Prologue"]})) in + let allocations_familiales_dot_enfants_a_charge_: Enfant.t array = + try ((log_variable_definition + ["InterfaceAllocationsFamiliales"; + "allocations_familiales.enfants_à_charge"] + (embed_array (embed_enfant)) + (handle_default + {filename = "examples/allocations_familiales/epilogue.catala_fr"; + start_line=77; start_column=3; end_line=77; end_column=25; + law_headings=["Interface du programme"; "Épilogue"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/epilogue.catala_fr"; + start_line=87; start_column=14; end_line=87; end_column=53; + law_headings=["Interface du programme"; "Épilogue"]} true)) + (fun (_: _) -> enfants_a_charge_)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=95; start_column=10; end_line=95; end_column=26; + law_headings=["Allocations familiales"; "Champs d'applications"; + "Prologue"]})) in + let allocations_familiales_dot_avait_enfant_a_charge_avant_1er_janvier_2012_: bool = + try ((log_variable_definition + ["InterfaceAllocationsFamiliales"; + "allocations_familiales.avait_enfant_à_charge_avant_1er_janvier_2012"] + (embed_bool) + (handle_default + {filename = "examples/allocations_familiales/epilogue.catala_fr"; + start_line=77; start_column=3; end_line=77; end_column=25; + law_headings=["Interface du programme"; "Épilogue"]} + ([|(fun (_: _) -> + handle_default + {filename = "examples/allocations_familiales/epilogue.catala_fr"; + start_line=77; start_column=3; end_line=77; end_column=25; + law_headings=["Interface du programme"; "Épilogue"]} + ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/epilogue.catala_fr"; + start_line=101; start_column=18; + end_line=101; end_column=64; + law_headings=["Interface du programme"; "Épilogue"]} + i_avait_enfant_a_charge_avant_1er_janvier_2012_)) + (fun (_: _) -> true))|]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/epilogue.catala_fr"; + start_line=77; start_column=3; end_line=77; end_column=25; + law_headings=["Interface du programme"; "Épilogue"]} true)) + (fun (_: _) -> false)))) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/allocations_familiales/prologue.catala_fr"; + start_line=116; start_column=10; end_line=116; end_column=54; + law_headings=["Allocations familiales"; "Champs d'applications"; + "Prologue"]})) in + let result_: AllocationsFamilialesOut.t = (log_end_call + ["InterfaceAllocationsFamiliales"; "allocations_familiales"; + "AllocationsFamiliales"] ((log_begin_call + ["InterfaceAllocationsFamiliales"; "allocations_familiales"; + "AllocationsFamiliales"] allocations_familiales) + {AllocationsFamilialesIn.personne_charge_effective_permanente_est_parent_in = + allocations_familiales_dot_personne_charge_effective_permanente_est_parent_; + AllocationsFamilialesIn.personne_charge_effective_permanente_remplit_titre_I_in = + allocations_familiales_dot_personne_charge_effective_permanente_remplit_titre__i_; + AllocationsFamilialesIn.ressources_menage_in = + allocations_familiales_dot_ressources_menage_; + AllocationsFamilialesIn.residence_in = + allocations_familiales_dot_residence_; + AllocationsFamilialesIn.date_courante_in = + allocations_familiales_dot_date_courante_; + AllocationsFamilialesIn.enfants_a_charge_in = + allocations_familiales_dot_enfants_a_charge_; + AllocationsFamilialesIn.avait_enfant_a_charge_avant_1er_janvier_2012_in = + allocations_familiales_dot_avait_enfant_a_charge_avant_1er_janvier_2012_})) in + let allocations_familiales_dot_montant_verse_: money = result_.AllocationsFamilialesOut.montant_verse_out in + let i_montant_verse_: money = (log_variable_definition + ["InterfaceAllocationsFamiliales"; "i_montant_versé"] (embed_money) ( try - log_variable_definition - [ - "InterfaceAllocationsFamiliales"; - "allocations_familiales.personne_charge_effective_permanente_remplit_titre_I"; - ] - embed_bool - (handle_default - [| - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./epilogue.catala_fr"; - start_line = 97; - start_column = 18; - end_line = 97; - end_column = 72; - law_headings = ["Interface du programme"; "Épilogue"]; - } - i_personne_charge_effective_permanente_remplit_titre__i_) - (fun (_ : _) -> true)); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./prologue.catala_fr"; - start_line = 87; - start_column = 63; - end_line = 87; - end_column = 72; - law_headings = - [ - "Allocations familiales"; - "Champs d'applications"; - "Prologue"; - ]; - } - true) - (fun (_ : _) -> false)) - with EmptyError -> - raise - (NoValueProvided - { - filename = "./prologue.catala_fr"; - start_line = 87; - start_column = 10; - end_line = 87; - end_column = 62; - law_headings = - ["Allocations familiales"; "Champs d'applications"; "Prologue"]; - }) - in - let allocations_familiales_dot_ressources_menage_ : money = - try - log_variable_definition - [ - "InterfaceAllocationsFamiliales"; - "allocations_familiales.ressources_ménage"; - ] - embed_money - (handle_default - [| - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./epilogue.catala_fr"; - start_line = 88; - start_column = 14; - end_line = 88; - end_column = 54; - law_headings = ["Interface du programme"; "Épilogue"]; - } - true) - (fun (_ : _) -> i_ressources_menage_)); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./prologue.catala_fr"; - start_line = 88; - start_column = 36; - end_line = 88; - end_column = 42; - law_headings = - [ - "Allocations familiales"; - "Champs d'applications"; - "Prologue"; - ]; - } - false) - (fun (_ : _) -> raise EmptyError)) - with EmptyError -> - raise - (NoValueProvided - { - filename = "./prologue.catala_fr"; - start_line = 88; - start_column = 10; - end_line = 88; - end_column = 27; - law_headings = - ["Allocations familiales"; "Champs d'applications"; "Prologue"]; - }) - in - let allocations_familiales_dot_residence_ : collectivite = - try - log_variable_definition - ["InterfaceAllocationsFamiliales"; "allocations_familiales.résidence"] - embed_collectivite - (handle_default - [| - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./epilogue.catala_fr"; - start_line = 89; - start_column = 14; - end_line = 89; - end_column = 46; - law_headings = ["Interface du programme"; "Épilogue"]; - } - true) - (fun (_ : _) -> i_residence_)); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./prologue.catala_fr"; - start_line = 89; - start_column = 28; - end_line = 89; - end_column = 40; - law_headings = - [ - "Allocations familiales"; - "Champs d'applications"; - "Prologue"; - ]; - } - false) - (fun (_ : _) -> raise EmptyError)) - with EmptyError -> - raise - (NoValueProvided - { - filename = "./prologue.catala_fr"; - start_line = 89; - start_column = 10; - end_line = 89; - end_column = 19; - law_headings = - ["Allocations familiales"; "Champs d'applications"; "Prologue"]; - }) - in - let allocations_familiales_dot_date_courante_ : date = - try - log_variable_definition - [ - "InterfaceAllocationsFamiliales"; - "allocations_familiales.date_courante"; - ] - embed_date - (handle_default - [| - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./epilogue.catala_fr"; - start_line = 86; - start_column = 14; - end_line = 86; - end_column = 50; - law_headings = ["Interface du programme"; "Épilogue"]; - } - true) - (fun (_ : _) -> i_date_courante_)); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./prologue.catala_fr"; - start_line = 92; - start_column = 32; - end_line = 92; - end_column = 36; - law_headings = - [ - "Allocations familiales"; - "Champs d'applications"; - "Prologue"; - ]; - } - false) - (fun (_ : _) -> raise EmptyError)) - with EmptyError -> - raise - (NoValueProvided - { - filename = "./prologue.catala_fr"; - start_line = 92; - start_column = 10; - end_line = 92; - end_column = 23; - law_headings = - ["Allocations familiales"; "Champs d'applications"; "Prologue"]; - }) - in - let allocations_familiales_dot_enfants_a_charge_ : Enfant.t array = - try - log_variable_definition - [ - "InterfaceAllocationsFamiliales"; - "allocations_familiales.enfants_à_charge"; - ] - (embed_array embed_enfant) - (handle_default - [| - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./epilogue.catala_fr"; - start_line = 87; - start_column = 14; - end_line = 87; - end_column = 53; - law_headings = ["Interface du programme"; "Épilogue"]; - } - true) - (fun (_ : _) -> enfants_a_charge_)); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./prologue.catala_fr"; - start_line = 95; - start_column = 35; - end_line = 95; - end_column = 52; - law_headings = - [ - "Allocations familiales"; - "Champs d'applications"; - "Prologue"; - ]; - } - false) - (fun (_ : _) -> raise EmptyError)) - with EmptyError -> - raise - (NoValueProvided - { - filename = "./prologue.catala_fr"; - start_line = 95; - start_column = 10; - end_line = 95; - end_column = 26; - law_headings = - ["Allocations familiales"; "Champs d'applications"; "Prologue"]; - }) - in - let allocations_familiales_dot_avait_enfant_a_charge_avant_1er_janvier_2012_ : - bool = - try - log_variable_definition - [ - "InterfaceAllocationsFamiliales"; - "allocations_familiales.avait_enfant_à_charge_avant_1er_janvier_2012"; - ] - embed_bool - (handle_default - [| - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./epilogue.catala_fr"; - start_line = 101; - start_column = 18; - end_line = 101; - end_column = 64; - law_headings = ["Interface du programme"; "Épilogue"]; - } - i_avait_enfant_a_charge_avant_1er_janvier_2012_) - (fun (_ : _) -> true)); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./prologue.catala_fr"; - start_line = 116; - start_column = 55; - end_line = 116; - end_column = 64; - law_headings = - [ - "Allocations familiales"; - "Champs d'applications"; - "Prologue"; - ]; - } - true) - (fun (_ : _) -> false)) - with EmptyError -> - raise - (NoValueProvided - { - filename = "./prologue.catala_fr"; - start_line = 116; - start_column = 10; - end_line = 116; - end_column = 54; - law_headings = - ["Allocations familiales"; "Champs d'applications"; "Prologue"]; - }) - in - let result_ : AllocationsFamilialesOut.t = - log_end_call - [ - "InterfaceAllocationsFamiliales"; - "allocations_familiales"; - "AllocationsFamiliales"; - ] - ((log_begin_call - [ - "InterfaceAllocationsFamiliales"; - "allocations_familiales"; - "AllocationsFamiliales"; - ] - allocations_familiales) - { - AllocationsFamilialesIn - .personne_charge_effective_permanente_est_parent_in = - allocations_familiales_dot_personne_charge_effective_permanente_est_parent_; - AllocationsFamilialesIn - .personne_charge_effective_permanente_remplit_titre_I_in = - allocations_familiales_dot_personne_charge_effective_permanente_remplit_titre__i_; - AllocationsFamilialesIn.ressources_menage_in = - allocations_familiales_dot_ressources_menage_; - AllocationsFamilialesIn.residence_in = - allocations_familiales_dot_residence_; - AllocationsFamilialesIn.date_courante_in = - allocations_familiales_dot_date_courante_; - AllocationsFamilialesIn.enfants_a_charge_in = - allocations_familiales_dot_enfants_a_charge_; - AllocationsFamilialesIn - .avait_enfant_a_charge_avant_1er_janvier_2012_in = - allocations_familiales_dot_avait_enfant_a_charge_avant_1er_janvier_2012_; - }) - in - let allocations_familiales_dot_montant_verse_ : money = - result_.AllocationsFamilialesOut.montant_verse_out - in - let i_montant_verse_ : money = - log_variable_definition - ["InterfaceAllocationsFamiliales"; "i_montant_versé"] - embed_money - (try - handle_default - [| - (fun (_ : _) -> - handle_default [||] - (fun (_ : _) -> - log_decision_taken - { - filename = "./epilogue.catala_fr"; - start_line = 90; - start_column = 14; - end_line = 90; - end_column = 29; - law_headings = ["Interface du programme"; "Épilogue"]; - } - true) - (fun (_ : _) -> allocations_familiales_dot_montant_verse_)); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./epilogue.catala_fr"; - start_line = 80; - start_column = 34; - end_line = 80; - end_column = 40; - law_headings = ["Interface du programme"; "Épilogue"]; - } - false) - (fun (_ : _) -> raise EmptyError) - with EmptyError -> - raise - (NoValueProvided - { - filename = "./epilogue.catala_fr"; - start_line = 80; - start_column = 10; - end_line = 80; - end_column = 25; - law_headings = ["Interface du programme"; "Épilogue"]; - })) - in - { InterfaceAllocationsFamilialesOut.i_montant_verse_out = i_montant_verse_ } + (handle_default + {filename = "examples/allocations_familiales/epilogue.catala_fr"; + start_line=80; start_column=10; end_line=80; end_column=25; + law_headings=["Interface du programme"; "Épilogue"]} ([||]) + (fun (_: _) -> (log_decision_taken + {filename = "examples/allocations_familiales/epilogue.catala_fr"; + start_line=90; start_column=14; end_line=90; end_column=29; + law_headings=["Interface du programme"; "Épilogue"]} true)) + (fun (_: _) -> allocations_familiales_dot_montant_verse_)) + with + EmptyError -> (raise (NoValueProvided + {filename = "examples/allocations_familiales/epilogue.catala_fr"; + start_line=80; start_column=10; end_line=80; end_column=25; + law_headings=["Interface du programme"; "Épilogue"]})))) in + {InterfaceAllocationsFamilialesOut.i_montant_verse_out = i_montant_verse_} diff --git a/french_law/ocaml/law_source/allocations_familiales.mli b/french_law/ocaml/law_source/allocations_familiales.mli deleted file mode 100644 index 827bd5a0..00000000 --- a/french_law/ocaml/law_source/allocations_familiales.mli +++ /dev/null @@ -1,93 +0,0 @@ -(* This file is part of the French law library, a collection of functions for - computing French taxes and benefits derived from Catala programs. Copyright - (C) 2021 Inria, contributor: Denis Merigoux - - Licensed under the Apache License, Version 2.0 (the "License"); you may not - use this file except in compliance with the License. You may obtain a copy of - the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - License for the specific language governing permissions and limitations under - the License. *) - -open Runtime - -type prise_en_charge = - | GardeAlterneePartageAllocations of unit - | GardeAlterneeAllocataireUnique of unit - | EffectiveEtPermanente of unit - | ServicesSociauxAllocationVerseeALaFamille of unit - | ServicesSociauxAllocationVerseeAuxServicesSociaux of unit - -type situation_obligation_scolaire = - | Avant of unit - | Pendant of unit - | Apres of unit - -type collectivite = - | Guadeloupe of unit - | Guyane of unit - | Martinique of unit - | LaReunion of unit - | SaintBarthelemy of unit - | SaintMartin of unit - | Metropole of unit - | SaintPierreEtMiquelon of unit - | Mayotte of unit - -type element_prestations_familiales = - | PrestationAccueilJeuneEnfant of unit - | AllocationsFamiliales of unit - | ComplementFamilial of unit - | AllocationLogement of unit - | AllocationEducationEnfantHandicape of unit - | AllocationSoutienFamilial of unit - | AllocationRentreeScolaire of unit - | AllocationJournalierePresenceParentale of unit - -module EnfantEntree : sig - type t = { - d_identifiant : integer; - d_remuneration_mensuelle : money; - d_date_de_naissance : date; - d_prise_en_charge : prise_en_charge; - d_a_deja_ouvert_droit_aux_allocations_familiales : bool; - d_beneficie_titre_personnel_aide_personnelle_logement : bool; - } -end - -module Enfant : sig - type t = { - identifiant : integer; - obligation_scolaire : situation_obligation_scolaire; - remuneration_mensuelle : money; - date_de_naissance : date; - age : integer; - prise_en_charge : prise_en_charge; - a_deja_ouvert_droit_aux_allocations_familiales : bool; - beneficie_titre_personnel_aide_personnelle_logement : bool; - } -end - -module InterfaceAllocationsFamilialesOut : sig - type t = { i_montant_verse_out : money } -end - -module InterfaceAllocationsFamilialesIn : sig - type t = { - i_date_courante_in : date; - i_enfants_in : EnfantEntree.t array; - i_ressources_menage_in : money; - i_residence_in : collectivite; - i_personne_charge_effective_permanente_est_parent_in : bool; - i_personne_charge_effective_permanente_remplit_titre_I_in : bool; - i_avait_enfant_a_charge_avant_1er_janvier_2012_in : bool; - } -end - -val interface_allocations_familiales : - InterfaceAllocationsFamilialesIn.t -> InterfaceAllocationsFamilialesOut.t diff --git a/french_law/ocaml/law_source/allocations_familiales_api_web.ml b/french_law/ocaml/law_source/allocations_familiales_api_web.ml new file mode 100644 index 00000000..ea87aa28 --- /dev/null +++ b/french_law/ocaml/law_source/allocations_familiales_api_web.ml @@ -0,0 +1,871 @@ +(** This file has been generated by the Catala compiler, do not edit! *) + +open Runtime_ocaml.Runtime +open Runtime_jsoo.Runtime +open Js_of_ocaml +open Allocations_familiales + +[@@@ocaml.warning "-4-26-27-32-41-42"] + +(* Generated API *) + +class type prise_en_charge = + object + method kind : + Js.js_string Js.t Js.readonly_prop + (** Expects one of: + - "GardeAlterneePartageAllocations" + - "GardeAlterneeAllocataireUnique" + - "EffectiveEtPermanente" + - "ServicesSociauxAllocationVerseeALaFamille" + - "ServicesSociauxAllocationVerseeAuxServicesSociaux" *) + + method payload : Js.Unsafe.any Js.t Js.readonly_prop + end + +let prise_en_charge_to_jsoo : PriseEnCharge.t -> prise_en_charge Js.t + = function + | GardeAlterneePartageAllocations arg -> object%js + val kind = Js.string "GardeAlterneePartageAllocations" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | GardeAlterneeAllocataireUnique arg -> object%js + val kind = Js.string "GardeAlterneeAllocataireUnique" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | EffectiveEtPermanente arg -> object%js + val kind = Js.string "EffectiveEtPermanente" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | ServicesSociauxAllocationVerseeALaFamille arg -> object%js + val kind = Js.string "ServicesSociauxAllocationVerseeALaFamille" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | ServicesSociauxAllocationVerseeAuxServicesSociaux arg -> object%js + val kind = Js.string "ServicesSociauxAllocationVerseeAuxServicesSociaux" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + +let prise_en_charge_of_jsoo (prise_en_charge : prise_en_charge Js.t) + : PriseEnCharge.t = + match prise_en_charge##.kind |> Js.to_string with + | "GardeAlterneePartageAllocations" -> + PriseEnCharge.GardeAlterneePartageAllocations () + | "GardeAlterneeAllocataireUnique" -> + PriseEnCharge.GardeAlterneeAllocataireUnique () + | "EffectiveEtPermanente" -> PriseEnCharge.EffectiveEtPermanente () + | "ServicesSociauxAllocationVerseeALaFamille" -> + PriseEnCharge.ServicesSociauxAllocationVerseeALaFamille () + | "ServicesSociauxAllocationVerseeAuxServicesSociaux" -> + PriseEnCharge.ServicesSociauxAllocationVerseeAuxServicesSociaux () + | cons -> + failwith + (Printf.sprintf + "Unexpected '%s' kind for the enumeration 'PriseEnCharge.t'" cons) + + +class type situation_obligation_scolaire = + object + method kind : + Js.js_string Js.t Js.readonly_prop + (** Expects one of: + - "Avant" + - "Pendant" + - "Apres" *) + + method payload : Js.Unsafe.any Js.t Js.readonly_prop + end + +let situation_obligation_scolaire_to_jsoo + : SituationObligationScolaire.t -> situation_obligation_scolaire Js.t + = function + | Avant arg -> object%js + val kind = Js.string "Avant" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | Pendant arg -> object%js + val kind = Js.string "Pendant" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | Apres arg -> object%js + val kind = Js.string "Apres" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + +let situation_obligation_scolaire_of_jsoo + (situation_obligation_scolaire : situation_obligation_scolaire Js.t) + : SituationObligationScolaire.t = + match situation_obligation_scolaire##.kind |> Js.to_string with + | "Avant" -> SituationObligationScolaire.Avant () + | "Pendant" -> SituationObligationScolaire.Pendant () + | "Apres" -> SituationObligationScolaire.Apres () + | cons -> + failwith + (Printf.sprintf + "Unexpected '%s' kind for the enumeration 'SituationObligationScolaire.t'" + cons) + + +class type prise_en_compte = + object + method kind : + Js.js_string Js.t Js.readonly_prop + (** Expects one of: + - "Complete" + - "Partagee" + - "Zero" *) + + method payload : Js.Unsafe.any Js.t Js.readonly_prop + end + +let prise_en_compte_to_jsoo : PriseEnCompte.t -> prise_en_compte Js.t + = function + | Complete arg -> object%js + val kind = Js.string "Complete" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | Partagee arg -> object%js + val kind = Js.string "Partagee" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | Zero arg -> object%js + val kind = Js.string "Zero" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + +let prise_en_compte_of_jsoo (prise_en_compte : prise_en_compte Js.t) + : PriseEnCompte.t = + match prise_en_compte##.kind |> Js.to_string with + | "Complete" -> PriseEnCompte.Complete () + | "Partagee" -> PriseEnCompte.Partagee () + | "Zero" -> PriseEnCompte.Zero () + | cons -> + failwith + (Printf.sprintf + "Unexpected '%s' kind for the enumeration 'PriseEnCompte.t'" cons) + + +class type versement_allocations = + object + method kind : + Js.js_string Js.t Js.readonly_prop + (** Expects one of: + - "Normal" + - "AllocationVerseeAuxServicesSociaux" *) + + method payload : Js.Unsafe.any Js.t Js.readonly_prop + end + +let versement_allocations_to_jsoo + : VersementAllocations.t -> versement_allocations Js.t + = function + | Normal arg -> object%js + val kind = Js.string "Normal" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | AllocationVerseeAuxServicesSociaux arg -> object%js + val kind = Js.string "AllocationVerseeAuxServicesSociaux" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + +let versement_allocations_of_jsoo + (versement_allocations : versement_allocations Js.t) + : VersementAllocations.t = + match versement_allocations##.kind |> Js.to_string with + | "Normal" -> VersementAllocations.Normal () + | "AllocationVerseeAuxServicesSociaux" -> + VersementAllocations.AllocationVerseeAuxServicesSociaux () + | cons -> + failwith + (Printf.sprintf + "Unexpected '%s' kind for the enumeration 'VersementAllocations.t'" + cons) + + +class type element_prestations_familiales = + object + method kind : + Js.js_string Js.t Js.readonly_prop + (** Expects one of: + - "PrestationAccueilJeuneEnfant" + - "AllocationsFamiliales" + - "ComplementFamilial" + - "AllocationLogement" + - "AllocationEducationEnfantHandicape" + - "AllocationSoutienFamilial" + - "AllocationRentreeScolaire" + - "AllocationJournalierePresenceParentale" *) + + method payload : Js.Unsafe.any Js.t Js.readonly_prop + end + +let element_prestations_familiales_to_jsoo + : ElementPrestationsFamiliales.t -> element_prestations_familiales Js.t + = function + | PrestationAccueilJeuneEnfant arg -> object%js + val kind = Js.string "PrestationAccueilJeuneEnfant" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | AllocationsFamiliales arg -> object%js + val kind = Js.string "AllocationsFamiliales" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | ComplementFamilial arg -> object%js + val kind = Js.string "ComplementFamilial" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | AllocationLogement arg -> object%js + val kind = Js.string "AllocationLogement" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | AllocationEducationEnfantHandicape arg -> object%js + val kind = Js.string "AllocationEducationEnfantHandicape" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | AllocationSoutienFamilial arg -> object%js + val kind = Js.string "AllocationSoutienFamilial" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | AllocationRentreeScolaire arg -> object%js + val kind = Js.string "AllocationRentreeScolaire" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | AllocationJournalierePresenceParentale arg -> object%js + val kind = Js.string "AllocationJournalierePresenceParentale" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + +let element_prestations_familiales_of_jsoo + (element_prestations_familiales : element_prestations_familiales Js.t) + : ElementPrestationsFamiliales.t = + match element_prestations_familiales##.kind |> Js.to_string with + | "PrestationAccueilJeuneEnfant" -> + ElementPrestationsFamiliales.PrestationAccueilJeuneEnfant () + | "AllocationsFamiliales" -> + ElementPrestationsFamiliales.AllocationsFamiliales () + | "ComplementFamilial" -> + ElementPrestationsFamiliales.ComplementFamilial () + | "AllocationLogement" -> + ElementPrestationsFamiliales.AllocationLogement () + | "AllocationEducationEnfantHandicape" -> + ElementPrestationsFamiliales.AllocationEducationEnfantHandicape () + | "AllocationSoutienFamilial" -> + ElementPrestationsFamiliales.AllocationSoutienFamilial () + | "AllocationRentreeScolaire" -> + ElementPrestationsFamiliales.AllocationRentreeScolaire () + | "AllocationJournalierePresenceParentale" -> + ElementPrestationsFamiliales.AllocationJournalierePresenceParentale () + | cons -> + failwith + (Printf.sprintf + "Unexpected '%s' kind for the enumeration 'ElementPrestationsFamiliales.t'" + cons) + + +class type collectivite = + object + method kind : + Js.js_string Js.t Js.readonly_prop + (** Expects one of: + - "Guadeloupe" + - "Guyane" + - "Martinique" + - "LaReunion" + - "SaintBarthelemy" + - "SaintMartin" + - "Metropole" + - "SaintPierreEtMiquelon" + - "Mayotte" *) + + method payload : Js.Unsafe.any Js.t Js.readonly_prop + end + +let collectivite_to_jsoo : Collectivite.t -> collectivite Js.t + = function + | Guadeloupe arg -> object%js + val kind = Js.string "Guadeloupe" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | Guyane arg -> object%js + val kind = Js.string "Guyane" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | Martinique arg -> object%js + val kind = Js.string "Martinique" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | LaReunion arg -> object%js + val kind = Js.string "LaReunion" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | SaintBarthelemy arg -> object%js + val kind = Js.string "SaintBarthelemy" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | SaintMartin arg -> object%js + val kind = Js.string "SaintMartin" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | Metropole arg -> object%js + val kind = Js.string "Metropole" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | SaintPierreEtMiquelon arg -> object%js + val kind = Js.string "SaintPierreEtMiquelon" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + | Mayotte arg -> object%js + val kind = Js.string "Mayotte" + val payload = Js.Unsafe.coerce (Js.Unsafe.inject ( arg)) + end + +let collectivite_of_jsoo (collectivite : collectivite Js.t) + : Collectivite.t = + match collectivite##.kind |> Js.to_string with + | "Guadeloupe" -> Collectivite.Guadeloupe () + | "Guyane" -> Collectivite.Guyane () + | "Martinique" -> Collectivite.Martinique () + | "LaReunion" -> Collectivite.LaReunion () + | "SaintBarthelemy" -> Collectivite.SaintBarthelemy () + | "SaintMartin" -> Collectivite.SaintMartin () + | "Metropole" -> Collectivite.Metropole () + | "SaintPierreEtMiquelon" -> Collectivite.SaintPierreEtMiquelon () + | "Mayotte" -> Collectivite.Mayotte () + | cons -> + failwith + (Printf.sprintf + "Unexpected '%s' kind for the enumeration 'Collectivite.t'" cons) + + +class type enfant_entree = + object + method dIdentifiant: int Js.readonly_prop + method dRemunerationMensuelle: Js.number Js.t Js.readonly_prop + method dDateDeNaissance: Js.js_string Js.t Js.readonly_prop + method dPriseEnCharge: prise_en_charge Js.t Js.readonly_prop + method dADejaOuvertDroitAuxAllocationsFamiliales: + bool Js.t Js.readonly_prop + method dBeneficieTitrePersonnelAidePersonnelleLogement: + bool Js.t Js.readonly_prop + end + let enfant_entree_to_jsoo (enfant_entree : EnfantEntree.t) + : enfant_entree Js.t = + object%js + val dIdentifiant = integer_to_int enfant_entree.d_identifiant + val dRemunerationMensuelle = + Js.number_of_float @@ money_to_float enfant_entree.d_remuneration_mensuelle + val dDateDeNaissance = date_to_jsoo enfant_entree.d_date_de_naissance + val dPriseEnCharge = + prise_en_charge_to_jsoo enfant_entree.d_prise_en_charge + val dADejaOuvertDroitAuxAllocationsFamiliales = + Js.bool enfant_entree.d_a_deja_ouvert_droit_aux_allocations_familiales + val dBeneficieTitrePersonnelAidePersonnelleLogement = + Js.bool enfant_entree.d_beneficie_titre_personnel_aide_personnelle_logement + end + let enfant_entree_of_jsoo (enfant_entree : enfant_entree Js.t) : + EnfantEntree.t = + { + d_identifiant = integer_of_int enfant_entree##.dIdentifiant; + d_remuneration_mensuelle = + money_of_decimal @@ decimal_of_float @@ Js.float_of_number + enfant_entree##.dRemunerationMensuelle; + d_date_de_naissance = date_of_jsoo enfant_entree##.dDateDeNaissance; + d_prise_en_charge = + prise_en_charge_of_jsoo enfant_entree##.dPriseEnCharge; + d_a_deja_ouvert_droit_aux_allocations_familiales = + Js.to_bool enfant_entree##.dADejaOuvertDroitAuxAllocationsFamiliales; + d_beneficie_titre_personnel_aide_personnelle_logement = + Js.to_bool + enfant_entree##.dBeneficieTitrePersonnelAidePersonnelleLogement + } + +class type enfant = + object + method identifiant: int Js.readonly_prop + method obligationScolaire: + situation_obligation_scolaire Js.t Js.readonly_prop + method remunerationMensuelle: Js.number Js.t Js.readonly_prop + method dateDeNaissance: Js.js_string Js.t Js.readonly_prop + method age: int Js.readonly_prop + method priseEnCharge: prise_en_charge Js.t Js.readonly_prop + method aDejaOuvertDroitAuxAllocationsFamiliales: + bool Js.t Js.readonly_prop + method beneficieTitrePersonnelAidePersonnelleLogement: + bool Js.t Js.readonly_prop + end + let enfant_to_jsoo (enfant : Enfant.t) : enfant Js.t = + object%js + val identifiant = integer_to_int enfant.identifiant + val obligationScolaire = + situation_obligation_scolaire_to_jsoo enfant.obligation_scolaire + val remunerationMensuelle = + Js.number_of_float @@ money_to_float enfant.remuneration_mensuelle + val dateDeNaissance = date_to_jsoo enfant.date_de_naissance + val age = integer_to_int enfant.age + val priseEnCharge = prise_en_charge_to_jsoo enfant.prise_en_charge + val aDejaOuvertDroitAuxAllocationsFamiliales = + Js.bool enfant.a_deja_ouvert_droit_aux_allocations_familiales + val beneficieTitrePersonnelAidePersonnelleLogement = + Js.bool enfant.beneficie_titre_personnel_aide_personnelle_logement + end + let enfant_of_jsoo (enfant : enfant Js.t) : Enfant.t = + { + identifiant = integer_of_int enfant##.identifiant; + obligation_scolaire = + situation_obligation_scolaire_of_jsoo enfant##.obligationScolaire; + remuneration_mensuelle = + money_of_decimal @@ decimal_of_float @@ Js.float_of_number + enfant##.remunerationMensuelle; + date_de_naissance = date_of_jsoo enfant##.dateDeNaissance; + age = integer_of_int enfant##.age; + prise_en_charge = prise_en_charge_of_jsoo enfant##.priseEnCharge; + a_deja_ouvert_droit_aux_allocations_familiales = + Js.to_bool enfant##.aDejaOuvertDroitAuxAllocationsFamiliales; + beneficie_titre_personnel_aide_personnelle_logement = + Js.to_bool enfant##.beneficieTitrePersonnelAidePersonnelleLogement + } + +class type prestations_familiales_out = + object + method droitOuvertOut: (enfant Js.t, bool Js.t) Js.meth_callback Js.meth + method conditionsHorsAgeOut: + (enfant Js.t, bool Js.t) Js.meth_callback Js.meth + method ageL51232Out: int Js.readonly_prop + method regimeOutreMerL7511Out: bool Js.t Js.readonly_prop + end + let prestations_familiales_out_to_jsoo (prestations_familiales_out + : PrestationsFamilialesOut.t) : prestations_familiales_out Js.t = + object%js + method droitOuvertOut = Js.wrap_meth_callback + ( + fun input -> + Js.bool (prestations_familiales_out.droit_ouvert_out (enfant_of_jsoo input))) + method conditionsHorsAgeOut = Js.wrap_meth_callback + ( + fun input -> + Js.bool (prestations_familiales_out.conditions_hors_age_out (enfant_of_jsoo input))) + val ageL51232Out = + integer_to_int prestations_familiales_out.age_l512_3_2_out + val regimeOutreMerL7511Out = + Js.bool prestations_familiales_out.regime_outre_mer_l751_1_out + end + let prestations_familiales_out_of_jsoo + (prestations_familiales_out : prestations_familiales_out Js.t) : + PrestationsFamilialesOut.t = + { + droit_ouvert_out = failwith "The function 'droit_ouvert_out' translation isn't yet supported..."; + conditions_hors_age_out = failwith "The function 'conditions_hors_age_out' translation isn't yet supported..."; + age_l512_3_2_out = + integer_of_int prestations_familiales_out##.ageL51232Out; + regime_outre_mer_l751_1_out = + Js.to_bool prestations_familiales_out##.regimeOutreMerL7511Out + } + +class type prestations_familiales_in = + object + method dateCouranteIn: Js.js_string Js.t Js.readonly_prop + method prestationCouranteIn: + element_prestations_familiales Js.t Js.readonly_prop + method residenceIn: collectivite Js.t Js.readonly_prop + end + let prestations_familiales_in_to_jsoo (prestations_familiales_in + : PrestationsFamilialesIn.t) : prestations_familiales_in Js.t = + object%js + val dateCouranteIn = + date_to_jsoo prestations_familiales_in.date_courante_in + val prestationCouranteIn = + element_prestations_familiales_to_jsoo prestations_familiales_in.prestation_courante_in + val residenceIn = + collectivite_to_jsoo prestations_familiales_in.residence_in + end + let prestations_familiales_in_of_jsoo + (prestations_familiales_in : prestations_familiales_in Js.t) : + PrestationsFamilialesIn.t = + { + date_courante_in = + date_of_jsoo prestations_familiales_in##.dateCouranteIn; + prestation_courante_in = + element_prestations_familiales_of_jsoo + prestations_familiales_in##.prestationCouranteIn; + residence_in = + collectivite_of_jsoo prestations_familiales_in##.residenceIn + } + +class type allocation_familiales_avril2008_out = + object method ageMinimumAlinea1L5213Out: int Js.readonly_prop + end + let allocation_familiales_avril2008_out_to_jsoo + (allocation_familiales_avril2008_out + : AllocationFamilialesAvril2008Out.t) + : allocation_familiales_avril2008_out Js.t = + object%js + val ageMinimumAlinea1L5213Out = + integer_to_int allocation_familiales_avril2008_out.age_minimum_alinea_1_l521_3_out + end + let allocation_familiales_avril2008_out_of_jsoo + (allocation_familiales_avril2008_out + : allocation_familiales_avril2008_out Js.t) : + AllocationFamilialesAvril2008Out.t = + { + age_minimum_alinea_1_l521_3_out = + integer_of_int + allocation_familiales_avril2008_out##.ageMinimumAlinea1L5213Out + } + +class type allocation_familiales_avril2008_in = +object end +let allocation_familiales_avril2008_in_to_jsoo (_ : AllocationFamilialesAvril2008In.t) : allocation_familiales_avril2008_in Js.t = object%js end +let allocation_familiales_avril2008_in_of_jsoo (_ : allocation_familiales_avril2008_in Js.t) : AllocationFamilialesAvril2008In.t = () +class type enfant_le_plus_age_out = + object method lePlusAgeOut: enfant Js.t Js.readonly_prop + end + let enfant_le_plus_age_out_to_jsoo (enfant_le_plus_age_out + : EnfantLePlusAgeOut.t) : enfant_le_plus_age_out Js.t = + object%js + val lePlusAgeOut = + enfant_to_jsoo enfant_le_plus_age_out.le_plus_age_out + end + let enfant_le_plus_age_out_of_jsoo + (enfant_le_plus_age_out : enfant_le_plus_age_out Js.t) : + EnfantLePlusAgeOut.t = + {le_plus_age_out = enfant_of_jsoo enfant_le_plus_age_out##.lePlusAgeOut + } + +class type enfant_le_plus_age_in = + object method enfantsIn: enfant Js.t Js.js_array Js.t Js.readonly_prop + end + let enfant_le_plus_age_in_to_jsoo (enfant_le_plus_age_in + : EnfantLePlusAgeIn.t) : enfant_le_plus_age_in Js.t = + object%js + val enfantsIn = + Js.array @@ Array.map (fun x -> enfant_to_jsoo x) enfant_le_plus_age_in.enfants_in + end + let enfant_le_plus_age_in_of_jsoo + (enfant_le_plus_age_in : enfant_le_plus_age_in Js.t) : + EnfantLePlusAgeIn.t = + { + enfants_in = + Array.map (fun x -> enfant_of_jsoo x) @@ Js.to_array + enfant_le_plus_age_in##.enfantsIn + } + +class type allocations_familiales_out = + object method montantVerseOut: Js.number Js.t Js.readonly_prop + end + let allocations_familiales_out_to_jsoo (allocations_familiales_out + : AllocationsFamilialesOut.t) : allocations_familiales_out Js.t = + object%js + val montantVerseOut = + Js.number_of_float @@ money_to_float allocations_familiales_out.montant_verse_out + end + let allocations_familiales_out_of_jsoo + (allocations_familiales_out : allocations_familiales_out Js.t) : + AllocationsFamilialesOut.t = + { + montant_verse_out = + money_of_decimal @@ decimal_of_float @@ Js.float_of_number + allocations_familiales_out##.montantVerseOut + } + +class type allocations_familiales_in = + object + method personneChargeEffectivePermanenteEstParentIn: + bool Js.t Js.readonly_prop + method personneChargeEffectivePermanenteRemplitTitreIIn: + bool Js.t Js.readonly_prop + method ressourcesMenageIn: Js.number Js.t Js.readonly_prop + method residenceIn: collectivite Js.t Js.readonly_prop + method dateCouranteIn: Js.js_string Js.t Js.readonly_prop + method enfantsAChargeIn: enfant Js.t Js.js_array Js.t Js.readonly_prop + method avaitEnfantAChargeAvant1erJanvier2012In: + bool Js.t Js.readonly_prop + end + let allocations_familiales_in_to_jsoo (allocations_familiales_in + : AllocationsFamilialesIn.t) : allocations_familiales_in Js.t = + object%js + val personneChargeEffectivePermanenteEstParentIn = + Js.bool allocations_familiales_in.personne_charge_effective_permanente_est_parent_in + val personneChargeEffectivePermanenteRemplitTitreIIn = + Js.bool allocations_familiales_in.personne_charge_effective_permanente_remplit_titre_I_in + val ressourcesMenageIn = + Js.number_of_float @@ money_to_float allocations_familiales_in.ressources_menage_in + val residenceIn = + collectivite_to_jsoo allocations_familiales_in.residence_in + val dateCouranteIn = + date_to_jsoo allocations_familiales_in.date_courante_in + val enfantsAChargeIn = + Js.array @@ Array.map (fun x -> enfant_to_jsoo x) allocations_familiales_in.enfants_a_charge_in + val avaitEnfantAChargeAvant1erJanvier2012In = + Js.bool allocations_familiales_in.avait_enfant_a_charge_avant_1er_janvier_2012_in + end + let allocations_familiales_in_of_jsoo + (allocations_familiales_in : allocations_familiales_in Js.t) : + AllocationsFamilialesIn.t = + { + personne_charge_effective_permanente_est_parent_in = + Js.to_bool + allocations_familiales_in + ##.personneChargeEffectivePermanenteEstParentIn; + personne_charge_effective_permanente_remplit_titre_I_in = + Js.to_bool + allocations_familiales_in + ##.personneChargeEffectivePermanenteRemplitTitreIIn; + ressources_menage_in = + money_of_decimal @@ decimal_of_float @@ Js.float_of_number + allocations_familiales_in##.ressourcesMenageIn; + residence_in = + collectivite_of_jsoo allocations_familiales_in##.residenceIn; + date_courante_in = + date_of_jsoo allocations_familiales_in##.dateCouranteIn; + enfants_a_charge_in = + Array.map (fun x -> enfant_of_jsoo x) @@ Js.to_array + allocations_familiales_in##.enfantsAChargeIn; + avait_enfant_a_charge_avant_1er_janvier_2012_in = + Js.to_bool + allocations_familiales_in##.avaitEnfantAChargeAvant1erJanvier2012In + } + +class type smic_out = + object method brutHoraireOut: Js.number Js.t Js.readonly_prop + end + let smic_out_to_jsoo (smic_out : SmicOut.t) : smic_out Js.t = + object%js + val brutHoraireOut = + Js.number_of_float @@ money_to_float smic_out.brut_horaire_out + end + let smic_out_of_jsoo (smic_out : smic_out Js.t) : SmicOut.t = + { + brut_horaire_out = + money_of_decimal @@ decimal_of_float @@ Js.float_of_number + smic_out##.brutHoraireOut + } + +class type smic_in = + object + method dateCouranteIn: Js.js_string Js.t Js.readonly_prop + method residenceIn: collectivite Js.t Js.readonly_prop + end + let smic_in_to_jsoo (smic_in : SmicIn.t) : smic_in Js.t = + object%js + val dateCouranteIn = date_to_jsoo smic_in.date_courante_in + val residenceIn = collectivite_to_jsoo smic_in.residence_in + end + let smic_in_of_jsoo (smic_in : smic_in Js.t) : SmicIn.t = + { + date_courante_in = date_of_jsoo smic_in##.dateCouranteIn; + residence_in = collectivite_of_jsoo smic_in##.residenceIn + } + +class type base_mensuelle_allocations_familiales_out = + object method montantOut: Js.number Js.t Js.readonly_prop + end + let base_mensuelle_allocations_familiales_out_to_jsoo + (base_mensuelle_allocations_familiales_out + : BaseMensuelleAllocationsFamilialesOut.t) + : base_mensuelle_allocations_familiales_out Js.t = + object%js + val montantOut = + Js.number_of_float @@ money_to_float base_mensuelle_allocations_familiales_out.montant_out + end + let base_mensuelle_allocations_familiales_out_of_jsoo + (base_mensuelle_allocations_familiales_out + : base_mensuelle_allocations_familiales_out Js.t) : + BaseMensuelleAllocationsFamilialesOut.t = + { + montant_out = + money_of_decimal @@ decimal_of_float @@ Js.float_of_number + base_mensuelle_allocations_familiales_out##.montantOut + } + +class type base_mensuelle_allocations_familiales_in = + object method dateCouranteIn: Js.js_string Js.t Js.readonly_prop + end + let base_mensuelle_allocations_familiales_in_to_jsoo + (base_mensuelle_allocations_familiales_in + : BaseMensuelleAllocationsFamilialesIn.t) + : base_mensuelle_allocations_familiales_in Js.t = + object%js + val dateCouranteIn = + date_to_jsoo base_mensuelle_allocations_familiales_in.date_courante_in + end + let base_mensuelle_allocations_familiales_in_of_jsoo + (base_mensuelle_allocations_familiales_in + : base_mensuelle_allocations_familiales_in Js.t) : + BaseMensuelleAllocationsFamilialesIn.t = + { + date_courante_in = + date_of_jsoo + base_mensuelle_allocations_familiales_in##.dateCouranteIn + } + +class type interface_allocations_familiales_out = + object method iMontantVerseOut: Js.number Js.t Js.readonly_prop + end + let interface_allocations_familiales_out_to_jsoo + (interface_allocations_familiales_out + : InterfaceAllocationsFamilialesOut.t) + : interface_allocations_familiales_out Js.t = + object%js + val iMontantVerseOut = + Js.number_of_float @@ money_to_float interface_allocations_familiales_out.i_montant_verse_out + end + let interface_allocations_familiales_out_of_jsoo + (interface_allocations_familiales_out + : interface_allocations_familiales_out Js.t) : + InterfaceAllocationsFamilialesOut.t = + { + i_montant_verse_out = + money_of_decimal @@ decimal_of_float @@ Js.float_of_number + interface_allocations_familiales_out##.iMontantVerseOut + } + +class type interface_allocations_familiales_in = + object + method iDateCouranteIn: Js.js_string Js.t Js.readonly_prop + method iEnfantsIn: enfant_entree Js.t Js.js_array Js.t Js.readonly_prop + method iRessourcesMenageIn: Js.number Js.t Js.readonly_prop + method iResidenceIn: collectivite Js.t Js.readonly_prop + method iPersonneChargeEffectivePermanenteEstParentIn: + bool Js.t Js.readonly_prop + method iPersonneChargeEffectivePermanenteRemplitTitreIIn: + bool Js.t Js.readonly_prop + method iAvaitEnfantAChargeAvant1erJanvier2012In: + bool Js.t Js.readonly_prop + end + let interface_allocations_familiales_in_to_jsoo + (interface_allocations_familiales_in + : InterfaceAllocationsFamilialesIn.t) + : interface_allocations_familiales_in Js.t = + object%js + val iDateCouranteIn = + date_to_jsoo interface_allocations_familiales_in.i_date_courante_in + val iEnfantsIn = + Js.array @@ Array.map (fun x -> enfant_entree_to_jsoo x) interface_allocations_familiales_in.i_enfants_in + val iRessourcesMenageIn = + Js.number_of_float @@ money_to_float interface_allocations_familiales_in.i_ressources_menage_in + val iResidenceIn = + collectivite_to_jsoo interface_allocations_familiales_in.i_residence_in + val iPersonneChargeEffectivePermanenteEstParentIn = + Js.bool interface_allocations_familiales_in.i_personne_charge_effective_permanente_est_parent_in + val iPersonneChargeEffectivePermanenteRemplitTitreIIn = + Js.bool interface_allocations_familiales_in.i_personne_charge_effective_permanente_remplit_titre_I_in + val iAvaitEnfantAChargeAvant1erJanvier2012In = + Js.bool interface_allocations_familiales_in.i_avait_enfant_a_charge_avant_1er_janvier_2012_in + end + let interface_allocations_familiales_in_of_jsoo + (interface_allocations_familiales_in + : interface_allocations_familiales_in Js.t) : + InterfaceAllocationsFamilialesIn.t = + { + i_date_courante_in = + date_of_jsoo interface_allocations_familiales_in##.iDateCouranteIn; + i_enfants_in = + Array.map (fun x -> enfant_entree_of_jsoo x) @@ Js.to_array + interface_allocations_familiales_in##.iEnfantsIn; + i_ressources_menage_in = + money_of_decimal @@ decimal_of_float @@ Js.float_of_number + interface_allocations_familiales_in##.iRessourcesMenageIn; + i_residence_in = + collectivite_of_jsoo + interface_allocations_familiales_in##.iResidenceIn; + i_personne_charge_effective_permanente_est_parent_in = + Js.to_bool + interface_allocations_familiales_in + ##.iPersonneChargeEffectivePermanenteEstParentIn; + i_personne_charge_effective_permanente_remplit_titre_I_in = + Js.to_bool + interface_allocations_familiales_in + ##.iPersonneChargeEffectivePermanenteRemplitTitreIIn; + i_avait_enfant_a_charge_avant_1er_janvier_2012_in = + Js.to_bool + interface_allocations_familiales_in + ##.iAvaitEnfantAChargeAvant1erJanvier2012In + } + + + + +let allocation_familiales_avril2008 + (allocation_familiales_avril2008_in : allocation_familiales_avril2008_in Js.t) + : allocation_familiales_avril2008_out Js.t = + allocation_familiales_avril2008_in + |> allocation_familiales_avril2008_in_of_jsoo + |> allocation_familiales_avril2008 + |> allocation_familiales_avril2008_out_to_jsoo + + +let enfant_le_plus_age (enfant_le_plus_age_in : enfant_le_plus_age_in Js.t) + : enfant_le_plus_age_out Js.t = + enfant_le_plus_age_in + |> enfant_le_plus_age_in_of_jsoo + |> enfant_le_plus_age + |> enfant_le_plus_age_out_to_jsoo + + +let smic (smic_in : smic_in Js.t) + : smic_out Js.t = + smic_in |> smic_in_of_jsoo |> smic |> smic_out_to_jsoo + + +let base_mensuelle_allocations_familiales + (base_mensuelle_allocations_familiales_in : base_mensuelle_allocations_familiales_in Js.t) + : base_mensuelle_allocations_familiales_out Js.t = + base_mensuelle_allocations_familiales_in + |> base_mensuelle_allocations_familiales_in_of_jsoo + |> base_mensuelle_allocations_familiales + |> base_mensuelle_allocations_familiales_out_to_jsoo + + +let prestations_familiales + (prestations_familiales_in : prestations_familiales_in Js.t) + : prestations_familiales_out Js.t = + prestations_familiales_in + |> prestations_familiales_in_of_jsoo + |> prestations_familiales + |> prestations_familiales_out_to_jsoo + + +let allocations_familiales + (allocations_familiales_in : allocations_familiales_in Js.t) + : allocations_familiales_out Js.t = + allocations_familiales_in + |> allocations_familiales_in_of_jsoo + |> allocations_familiales + |> allocations_familiales_out_to_jsoo + + +let interface_allocations_familiales + (interface_allocations_familiales_in : interface_allocations_familiales_in Js.t) + : interface_allocations_familiales_out Js.t = + interface_allocations_familiales_in + |> interface_allocations_familiales_in_of_jsoo + |> interface_allocations_familiales + |> interface_allocations_familiales_out_to_jsoo + + +let _ = + Js.export "AllocationsFamilialesLib" + (object%js + + method allocationFamilialesAvril2008 : (allocation_familiales_avril2008_in Js.t -> allocation_familiales_avril2008_out Js.t) Js.callback = + Js.wrap_callback allocation_familiales_avril2008 + + method enfantLePlusAge : (enfant_le_plus_age_in Js.t -> enfant_le_plus_age_out Js.t) Js.callback = + Js.wrap_callback enfant_le_plus_age + + method smic : (smic_in Js.t -> smic_out Js.t) Js.callback = + Js.wrap_callback smic + + method baseMensuelleAllocationsFamiliales : (base_mensuelle_allocations_familiales_in Js.t -> base_mensuelle_allocations_familiales_out Js.t) Js.callback = + Js.wrap_callback base_mensuelle_allocations_familiales + + method prestationsFamiliales : (prestations_familiales_in Js.t -> prestations_familiales_out Js.t) Js.callback = + Js.wrap_callback prestations_familiales + + method allocationsFamiliales : (allocations_familiales_in Js.t -> allocations_familiales_out Js.t) Js.callback = + Js.wrap_callback allocations_familiales + + method interfaceAllocationsFamiliales : (interface_allocations_familiales_in Js.t -> interface_allocations_familiales_out Js.t) Js.callback = + Js.wrap_callback interface_allocations_familiales + + end) \ No newline at end of file diff --git a/french_law/ocaml/law_source/dune b/french_law/ocaml/law_source/dune index fa72e0fd..ccc022e7 100644 --- a/french_law/ocaml/law_source/dune +++ b/french_law/ocaml/law_source/dune @@ -1,4 +1,30 @@ (library (name law_source) (public_name french_law.law_source) - (libraries catala.runtime)) + (preprocess + (pps js_of_ocaml-ppx)) + (libraries catala.runtime_ocaml catala.runtime_jsoo js_of_ocaml)) + +(rule + (target allocations_familiales.ml) + (mode promote) + (action + (copy ../../../examples/allocations_familiales/%{target} %{target}))) + +(rule + (target allocations_familiales_api_web.ml) + (mode promote) + (action + (copy ../../../examples/allocations_familiales/%{target} %{target}))) + +(rule + (target aides_logement.ml) + (mode promote) + (action + (copy ../../../examples/aides_logement/%{target} %{target}))) + +(rule + (target aides_logement_api_web.ml) + (mode promote) + (action + (copy ../../../examples/aides_logement/%{target} %{target}))) diff --git a/french_law/ocaml/law_source/unit_tests/.gitignore b/french_law/ocaml/law_source/unit_tests/.gitignore deleted file mode 100644 index d252851b..00000000 --- a/french_law/ocaml/law_source/unit_tests/.gitignore +++ /dev/null @@ -1 +0,0 @@ -tests_allocations_familiales.ml \ No newline at end of file diff --git a/french_law/ocaml/law_source/unit_tests/dune b/french_law/ocaml/law_source/unit_tests/dune index 91228d1b..cb7cc2a4 100644 --- a/french_law/ocaml/law_source/unit_tests/dune +++ b/french_law/ocaml/law_source/unit_tests/dune @@ -1,4 +1,7 @@ (executable (name run_tests) (modes native) - (libraries catala.runtime ANSITerminal)) + (libraries catala.runtime_ocaml ANSITerminal)) + +(copy_files# + ../../../../examples/allocations_familiales/tests/tests_allocations_familiales.ml) diff --git a/french_law/ocaml/law_source/unit_tests/run_tests.ml b/french_law/ocaml/law_source/unit_tests/run_tests.ml index 5d9a211e..95099278 100644 --- a/french_law/ocaml/law_source/unit_tests/run_tests.ml +++ b/french_law/ocaml/law_source/unit_tests/run_tests.ml @@ -6,7 +6,7 @@ let try_test msg test = Format.printf "%s %s\n" (ANSITerminal.sprintf [ANSITerminal.green] "PASS") (ANSITerminal.sprintf [ANSITerminal.magenta] msg) - with Runtime.AssertionFailed -> + with Runtime_ocaml.Runtime.AssertionFailed _ -> failure := true; Format.printf "%s %s\n" (ANSITerminal.sprintf [ANSITerminal.red] "FAIL") diff --git a/french_law/python/Makefile b/french_law/python/Makefile index 95c1dff8..e8acded3 100644 --- a/french_law/python/Makefile +++ b/french_law/python/Makefile @@ -1,4 +1,7 @@ -SOURCES=../../runtimes/python/catala/src/catala/runtime.py src/allocations_familiales.py main.py src/api.py +SOURCES=../../runtimes/python/catala/src/catala/runtime.py \ + src/allocations_familiales.py \ + src/aides_logement.py \ + main.py src/api.py dependencies: pip install -r requirements.txt @@ -13,4 +16,4 @@ bench: python main.py bench show_log: - python main.py show_log \ No newline at end of file + python main.py show_log diff --git a/french_law/python/setup_env.sh b/french_law/python/setup_env.sh index 63c3ef83..3cb9092c 100755 --- a/french_law/python/setup_env.sh +++ b/french_law/python/setup_env.sh @@ -1,7 +1,8 @@ -#! /usr/bin/env bash -set -euo pipefail +#! /usr/bin/env sh + +set -eu cd "$(dirname "$0")" python3 -m venv env -source env/bin/activate +. env/bin/activate make dependencies diff --git a/french_law/python/src/aides_logement.py b/french_law/python/src/aides_logement.py new file mode 100644 index 00000000..18b8a1b5 --- /dev/null +++ b/french_law/python/src/aides_logement.py @@ -0,0 +1,19697 @@ +# This file has been generated by the Catala compiler, do not edit! + +from catala.runtime import * +from typing import Any, List, Callable, Tuple +from enum import Enum + +class TypeBailleur_Code(Enum): + BailleurSocial = 0 + BailleurPrive = 1 + +class TypeBailleur: + def __init__(self, code: TypeBailleur_Code, value: Any) -> None: + self.code = code + self.value = value + + + def __eq__(self, other: object) -> bool: + if isinstance(other, TypeBailleur): + return self.code == other.code and self.value == other.value + else: + return False + + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "{}({})".format(self.code, self.value) + +class TypePret_Code(Enum): + D331_32 = 0 + D331_63_64 = 1 + D331_59_8 = 2 + D331_76_1 = 3 + Autre = 4 + +class TypePret: + def __init__(self, code: TypePret_Code, value: Any) -> None: + self.code = code + self.value = value + + + def __eq__(self, other: object) -> bool: + if isinstance(other, TypePret): + return self.code == other.code and self.value == other.value + else: + return False + + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "{}({})".format(self.code, self.value) + +class TitulairePret_Code(Enum): + Demandeur = 0 + VendeurQuandDemandeurAContratLocationAccession = 1 + +class TitulairePret: + def __init__(self, code: TitulairePret_Code, value: Any) -> None: + self.code = code + self.value = value + + + def __eq__(self, other: object) -> bool: + if isinstance(other, TitulairePret): + return self.code == other.code and self.value == other.value + else: + return False + + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "{}({})".format(self.code, self.value) + +class TypeTravauxLogementD83215_Code(Enum): + TravauxPourAcquisitionD832_15_1 = 0 + TravauxSurLogementDejaAcquisD832_15_2 = 1 + PasDeTravaux = 2 + +class TypeTravauxLogementD83215: + def __init__(self, code: TypeTravauxLogementD83215_Code, value: Any) -> None: + self.code = code + self.value = value + + + def __eq__(self, other: object) -> bool: + if isinstance(other, TypeTravauxLogementD83215): + return self.code == other.code and self.value == other.value + else: + return False + + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "{}({})".format(self.code, self.value) + +class TypeTravauxLogementR8425_Code(Enum): + ObjectifDecenceLogement = 0 + PrevuDansListeR321_15 = 1 + AgrandirOuRendreHabitableD331_63 = 2 + PasDeTravaux = 3 + +class TypeTravauxLogementR8425: + def __init__(self, code: TypeTravauxLogementR8425_Code, value: Any) -> None: + self.code = code + self.value = value + + + def __eq__(self, other: object) -> bool: + if isinstance(other, TypeTravauxLogementR8425): + return self.code == other.code and self.value == other.value + else: + return False + + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "{}({})".format(self.code, self.value) + +class AmelioreParOccupant_Code(Enum): + Oui = 0 + Non = 1 + +class AmelioreParOccupant: + def __init__(self, code: AmelioreParOccupant_Code, value: Any) -> None: + self.code = code + self.value = value + + + def __eq__(self, other: object) -> bool: + if isinstance(other, AmelioreParOccupant): + return self.code == other.code and self.value == other.value + else: + return False + + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "{}({})".format(self.code, self.value) + +class LimiteTranche_Code(Enum): + Revenu = 0 + Infini = 1 + +class LimiteTranche: + def __init__(self, code: LimiteTranche_Code, value: Any) -> None: + self.code = code + self.value = value + + + def __eq__(self, other: object) -> bool: + if isinstance(other, LimiteTranche): + return self.code == other.code and self.value == other.value + else: + return False + + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "{}({})".format(self.code, self.value) + +class LimiteTrancheDecimal_Code(Enum): + Revenu = 0 + Infini = 1 + +class LimiteTrancheDecimal: + def __init__(self, code: LimiteTrancheDecimal_Code, value: Any) -> None: + self.code = code + self.value = value + + + def __eq__(self, other: object) -> bool: + if isinstance(other, LimiteTrancheDecimal): + return self.code == other.code and self.value == other.value + else: + return False + + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "{}({})".format(self.code, self.value) + +class PrestationRecue_Code(Enum): + AllocationsFamiliales = 0 + ComplementFamilial = 1 + AllocationJeuneEnfant = 2 + AllocationSoutienFamilial = 3 + AllocationSoutienEnfantHandicape = 4 + AllocationAdulteHandicape = 5 + +class PrestationRecue: + def __init__(self, code: PrestationRecue_Code, value: Any) -> None: + self.code = code + self.value = value + + + def __eq__(self, other: object) -> bool: + if isinstance(other, PrestationRecue): + return self.code == other.code and self.value == other.value + else: + return False + + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "{}({})".format(self.code, self.value) + +class TypeContratTravail_Code(Enum): + CDI = 0 + Autres = 1 + +class TypeContratTravail: + def __init__(self, code: TypeContratTravail_Code, value: Any) -> None: + self.code = code + self.value = value + + + def __eq__(self, other: object) -> bool: + if isinstance(other, TypeContratTravail): + return self.code == other.code and self.value == other.value + else: + return False + + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "{}({})".format(self.code, self.value) + +class ParentOuAutre_Code(Enum): + DemandeurOuConjointOuParentOuViaPartsSocietes = 0 + Autre = 1 + +class ParentOuAutre: + def __init__(self, code: ParentOuAutre_Code, value: Any) -> None: + self.code = code + self.value = value + + + def __eq__(self, other: object) -> bool: + if isinstance(other, ParentOuAutre): + return self.code == other.code and self.value == other.value + else: + return False + + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "{}({})".format(self.code, self.value) + +class SituationGardeAlternee_Code(Enum): + PasDeGardeAlternee = 0 + GardeAlterneeCoefficientPriseEnCharge = 1 + +class SituationGardeAlternee: + def __init__(self, code: SituationGardeAlternee_Code, value: Any) -> None: + self.code = code + self.value = value + + + def __eq__(self, other: object) -> bool: + if isinstance(other, SituationGardeAlternee): + return self.code == other.code and self.value == other.value + else: + return False + + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "{}({})".format(self.code, self.value) + +class Parente_Code(Enum): + Ascendant = 0 + Descendant = 1 + CollateralDeuxiemeTroisiemeDegre = 2 + +class Parente: + def __init__(self, code: Parente_Code, value: Any) -> None: + self.code = code + self.value = value + + + def __eq__(self, other: object) -> bool: + if isinstance(other, Parente): + return self.code == other.code and self.value == other.value + else: + return False + + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "{}({})".format(self.code, self.value) + +class DateDeNaissanceOuMoisDeGrossesse_Code(Enum): + DateDeNaissance = 0 + AvantPremierJourMoisCivilTroisiemeMoisDeGrossesse = 1 + ApresPremierJourMoisCivilTroisiemeMoisDeGrossesse = 2 + +class DateDeNaissanceOuMoisDeGrossesse: + def __init__(self, code: DateDeNaissanceOuMoisDeGrossesse_Code, value: Any) -> None: + self.code = code + self.value = value + + + def __eq__(self, other: object) -> bool: + if isinstance(other, DateDeNaissanceOuMoisDeGrossesse): + return self.code == other.code and self.value == other.value + else: + return False + + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "{}({})".format(self.code, self.value) + +class Nationalite_Code(Enum): + Francaise = 0 + Etrangere = 1 + +class Nationalite: + def __init__(self, code: Nationalite_Code, value: Any) -> None: + self.code = code + self.value = value + + + def __eq__(self, other: object) -> bool: + if isinstance(other, Nationalite): + return self.code == other.code and self.value == other.value + else: + return False + + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "{}({})".format(self.code, self.value) + +class ZoneDHabitation_Code(Enum): + Zone1 = 0 + Zone2 = 1 + Zone3 = 2 + +class ZoneDHabitation: + def __init__(self, code: ZoneDHabitation_Code, value: Any) -> None: + self.code = code + self.value = value + + + def __eq__(self, other: object) -> bool: + if isinstance(other, ZoneDHabitation): + return self.code == other.code and self.value == other.value + else: + return False + + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "{}({})".format(self.code, self.value) + +class CategorieCalculAPL_Code(Enum): + Location = 0 + AccessionPropriete = 1 + LogementFoyer = 2 + +class CategorieCalculAPL: + def __init__(self, code: CategorieCalculAPL_Code, value: Any) -> None: + self.code = code + self.value = value + + + def __eq__(self, other: object) -> bool: + if isinstance(other, CategorieCalculAPL): + return self.code == other.code and self.value == other.value + else: + return False + + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "{}({})".format(self.code, self.value) + +class PaiementLogementDistinctProfessionnel_Code(Enum): + OuiAvecLoyerOuCharges = 0 + Non = 1 + +class PaiementLogementDistinctProfessionnel: + def __init__(self, code: PaiementLogementDistinctProfessionnel_Code, value: Any) -> None: + self.code = code + self.value = value + + + def __eq__(self, other: object) -> bool: + if isinstance(other, PaiementLogementDistinctProfessionnel): + return self.code == other.code and self.value == other.value + else: + return False + + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "{}({})".format(self.code, self.value) + +class VersementA_Code(Enum): + Bailleur = 0 + Beneficiaire = 1 + EtablissementHabilite = 2 + +class VersementA: + def __init__(self, code: VersementA_Code, value: Any) -> None: + self.code = code + self.value = value + + + def __eq__(self, other: object) -> bool: + if isinstance(other, VersementA): + return self.code == other.code and self.value == other.value + else: + return False + + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "{}({})".format(self.code, self.value) + +class DepenseLogement_Code(Enum): + TotalAnnuelEcheances = 0 + Mensualite = 1 + Loyer = 2 + +class DepenseLogement: + def __init__(self, code: DepenseLogement_Code, value: Any) -> None: + self.code = code + self.value = value + + + def __eq__(self, other: object) -> bool: + if isinstance(other, DepenseLogement): + return self.code == other.code and self.value == other.value + else: + return False + + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "{}({})".format(self.code, self.value) + +class ModeOccupationImpaye_Code(Enum): + ImpayeLoyer = 0 + ImpayePret = 1 + +class ModeOccupationImpaye: + def __init__(self, code: ModeOccupationImpaye_Code, value: Any) -> None: + self.code = code + self.value = value + + + def __eq__(self, other: object) -> bool: + if isinstance(other, ModeOccupationImpaye): + return self.code == other.code and self.value == other.value + else: + return False + + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "{}({})".format(self.code, self.value) + +class EligibiliteAllocationLogement_Code(Enum): + PasEligible = 0 + AllocationLogementFamiliale = 1 + AllocationLogementSociale = 2 + +class EligibiliteAllocationLogement: + def __init__(self, code: EligibiliteAllocationLogement_Code, value: Any) -> None: + self.code = code + self.value = value + + + def __eq__(self, other: object) -> bool: + if isinstance(other, EligibiliteAllocationLogement): + return self.code == other.code and self.value == other.value + else: + return False + + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "{}({})".format(self.code, self.value) + +class TypeAidesPersonnelleLogement_Code(Enum): + AidePersonnaliseeLogement = 0 + AllocationLogementFamiliale = 1 + AllocationLogementSociale = 2 + +class TypeAidesPersonnelleLogement: + def __init__(self, code: TypeAidesPersonnelleLogement_Code, value: Any) -> None: + self.code = code + self.value = value + + + def __eq__(self, other: object) -> bool: + if isinstance(other, TypeAidesPersonnelleLogement): + return self.code == other.code and self.value == other.value + else: + return False + + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "{}({})".format(self.code, self.value) + +class SituationFamiliale_Code(Enum): + Celibataire = 0 + Maries = 1 + Pacses = 2 + Concubins = 3 + CelibataireSepareDeFait = 4 + ConcubinageDontSepareDeFait = 5 + +class SituationFamiliale: + def __init__(self, code: SituationFamiliale_Code, value: Any) -> None: + self.code = code + self.value = value + + + def __eq__(self, other: object) -> bool: + if isinstance(other, SituationFamiliale): + return self.code == other.code and self.value == other.value + else: + return False + + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "{}({})".format(self.code, self.value) + +class PriseEnCharge_Code(Enum): + EffectiveEtPermanente = 0 + ResidenceAlterneeAllocataireUnique = 1 + ResidenceAlterneeAllocationsPartagee = 2 + +class PriseEnCharge: + def __init__(self, code: PriseEnCharge_Code, value: Any) -> None: + self.code = code + self.value = value + + + def __eq__(self, other: object) -> bool: + if isinstance(other, PriseEnCharge): + return self.code == other.code and self.value == other.value + else: + return False + + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "{}({})".format(self.code, self.value) + +class TypeLogementFoyer_Code(Enum): + LogementPersonnesAgeesOuHandicapees = 0 + ResidenceSociale = 1 + FoyerJeunesTrvailleursOuMigrantsConventionneL353_2Avant1995 = 2 + Autre = 3 + +class TypeLogementFoyer: + def __init__(self, code: TypeLogementFoyer_Code, value: Any) -> None: + self.code = code + self.value = value + + + def __eq__(self, other: object) -> bool: + if isinstance(other, TypeLogementFoyer): + return self.code == other.code and self.value == other.value + else: + return False + + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "{}({})".format(self.code, self.value) + +class CategorieEquivalenceLoyerAllocationLogementFoyer_Code(Enum): + EtudiantLogeEnChambre = 0 + EtudiantLogeEnChambreRehabilitee = 1 + PersonnesAgeesSelon3DeD842_16 = 2 + AutresPersonnes = 3 + +class CategorieEquivalenceLoyerAllocationLogementFoyer: + def __init__(self, code: CategorieEquivalenceLoyerAllocationLogementFoyer_Code, value: Any) -> None: + self.code = code + self.value = value + + + def __eq__(self, other: object) -> bool: + if isinstance(other, CategorieEquivalenceLoyerAllocationLogementFoyer): + return self.code == other.code and self.value == other.value + else: + return False + + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "{}({})".format(self.code, self.value) + +class SituationFamilialeCalculAPL_Code(Enum): + PersonneSeule = 0 + Couple = 1 + +class SituationFamilialeCalculAPL: + def __init__(self, code: SituationFamilialeCalculAPL_Code, value: Any) -> None: + self.code = code + self.value = value + + + def __eq__(self, other: object) -> bool: + if isinstance(other, SituationFamilialeCalculAPL): + return self.code == other.code and self.value == other.value + else: + return False + + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "{}({})".format(self.code, self.value) + +class Collectivite_Code(Enum): + Guadeloupe = 0 + Guyane = 1 + Martinique = 2 + LaReunion = 3 + SaintBarthelemy = 4 + SaintMartin = 5 + Metropole = 6 + SaintPierreEtMiquelon = 7 + Mayotte = 8 + +class Collectivite: + def __init__(self, code: Collectivite_Code, value: Any) -> None: + self.code = code + self.value = value + + + def __eq__(self, other: object) -> bool: + if isinstance(other, Collectivite): + return self.code == other.code and self.value == other.value + else: + return False + + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "{}({})".format(self.code, self.value) + +class PriseEnChargeEnfant_Code(Enum): + GardeAlterneePartageAllocations = 0 + GardeAlterneeAllocataireUnique = 1 + EffectiveEtPermanente = 2 + ServicesSociauxAllocationVerseeALaFamille = 3 + ServicesSociauxAllocationVerseeAuxServicesSociaux = 4 + +class PriseEnChargeEnfant: + def __init__(self, code: PriseEnChargeEnfant_Code, value: Any) -> None: + self.code = code + self.value = value + + + def __eq__(self, other: object) -> bool: + if isinstance(other, PriseEnChargeEnfant): + return self.code == other.code and self.value == other.value + else: + return False + + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "{}({})".format(self.code, self.value) + +class SituationObligationScolaire_Code(Enum): + Avant = 0 + Pendant = 1 + Apres = 2 + +class SituationObligationScolaire: + def __init__(self, code: SituationObligationScolaire_Code, value: Any) -> None: + self.code = code + self.value = value + + + def __eq__(self, other: object) -> bool: + if isinstance(other, SituationObligationScolaire): + return self.code == other.code and self.value == other.value + else: + return False + + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "{}({})".format(self.code, self.value) + +class ElementPrestationsFamiliales_Code(Enum): + PrestationAccueilJeuneEnfant = 0 + AllocationsFamiliales = 1 + ComplementFamilial = 2 + AllocationLogement = 3 + AllocationEducationEnfantHandicape = 4 + AllocationSoutienFamilial = 5 + AllocationRentreeScolaire = 6 + AllocationJournalierePresenceParentale = 7 + +class ElementPrestationsFamiliales: + def __init__(self, code: ElementPrestationsFamiliales_Code, value: Any) -> None: + self.code = code + self.value = value + + + def __eq__(self, other: object) -> bool: + if isinstance(other, ElementPrestationsFamiliales): + return self.code == other.code and self.value == other.value + else: + return False + + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "{}({})".format(self.code, self.value) + +class PersonneSousLocation: + def __init__(self, age_personne_sous_location: Integer, conforme_article_l442_1: bool) -> None: + self.age_personne_sous_location = age_personne_sous_location + self.conforme_article_l442_1 = conforme_article_l442_1 + + def __eq__(self, other: object) -> bool: + if isinstance(other, PersonneSousLocation): + return (self.age_personne_sous_location == other.age_personne_sous_location and + self.conforme_article_l442_1 == other.conforme_article_l442_1) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "PersonneSousLocation(age_personne_sous_location={},conforme_article_l442_1={})".format(self.age_personne_sous_location, + self.conforme_article_l442_1) + +class Patrimoine: + def __init__(self, produisant_revenu_periode_r822_3_3_r822_4: Money, ne_produisant_pas_revenu_periode_r822_3_3_r822_4: Money) -> None: + self.produisant_revenu_periode_r822_3_3_r822_4 = produisant_revenu_periode_r822_3_3_r822_4 + self.ne_produisant_pas_revenu_periode_r822_3_3_r822_4 = ne_produisant_pas_revenu_periode_r822_3_3_r822_4 + + def __eq__(self, other: object) -> bool: + if isinstance(other, Patrimoine): + return (self.produisant_revenu_periode_r822_3_3_r822_4 == other.produisant_revenu_periode_r822_3_3_r822_4 and + self.ne_produisant_pas_revenu_periode_r822_3_3_r822_4 == other.ne_produisant_pas_revenu_periode_r822_3_3_r822_4) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "Patrimoine(produisant_revenu_periode_r822_3_3_r822_4={},ne_produisant_pas_revenu_periode_r822_3_3_r822_4={})".format(self.produisant_revenu_periode_r822_3_3_r822_4, + self.ne_produisant_pas_revenu_periode_r822_3_3_r822_4) + +class PersonneVivantHabituellementAuFoyer: + def __init__(self, duree_residence_durant_periode_r_822_3_1_superieure_a_6_mois: bool, ressources: Money) -> None: + self.duree_residence_durant_periode_r_822_3_1_superieure_a_6_mois = duree_residence_durant_periode_r_822_3_1_superieure_a_6_mois + self.ressources = ressources + + def __eq__(self, other: object) -> bool: + if isinstance(other, PersonneVivantHabituellementAuFoyer): + return (self.duree_residence_durant_periode_r_822_3_1_superieure_a_6_mois == other.duree_residence_durant_periode_r_822_3_1_superieure_a_6_mois and + self.ressources == other.ressources) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "PersonneVivantHabituellementAuFoyer(duree_residence_durant_periode_r_822_3_1_superieure_a_6_mois={},ressources={})".format(self.duree_residence_durant_periode_r_822_3_1_superieure_a_6_mois, + self.ressources) + +class InfosChangementLogementD8424: + def __init__(self, ancien_loyer_principal: Money, ancienne_allocation_logement: Money) -> None: + self.ancien_loyer_principal = ancien_loyer_principal + self.ancienne_allocation_logement = ancienne_allocation_logement + + def __eq__(self, other: object) -> bool: + if isinstance(other, InfosChangementLogementD8424): + return (self.ancien_loyer_principal == other.ancien_loyer_principal and + self.ancienne_allocation_logement == other.ancienne_allocation_logement) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "InfosChangementLogementD8424(ancien_loyer_principal={},ancienne_allocation_logement={})".format(self.ancien_loyer_principal, + self.ancienne_allocation_logement) + +class Bailleur: + def __init__(self, type_bailleur: TypeBailleur, respecte_convention_titre_V: bool, respecte_convention_titre_II: bool, construit_ameliore_conditions_l831_1_4: bool, acquisition_aides_etat_pret_titre_II_ou_livre_III: bool) -> None: + self.type_bailleur = type_bailleur + self.respecte_convention_titre_V = respecte_convention_titre_V + self.respecte_convention_titre_II = respecte_convention_titre_II + self.construit_ameliore_conditions_l831_1_4 = construit_ameliore_conditions_l831_1_4 + self.acquisition_aides_etat_pret_titre_II_ou_livre_III = acquisition_aides_etat_pret_titre_II_ou_livre_III + + def __eq__(self, other: object) -> bool: + if isinstance(other, Bailleur): + return (self.type_bailleur == other.type_bailleur and + self.respecte_convention_titre_V == other.respecte_convention_titre_V and + self.respecte_convention_titre_II == other.respecte_convention_titre_II and + self.construit_ameliore_conditions_l831_1_4 == other.construit_ameliore_conditions_l831_1_4 and + self.acquisition_aides_etat_pret_titre_II_ou_livre_III == other.acquisition_aides_etat_pret_titre_II_ou_livre_III) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "Bailleur(type_bailleur={},respecte_convention_titre_V={},respecte_convention_titre_II={},construit_ameliore_conditions_l831_1_4={},acquisition_aides_etat_pret_titre_II_ou_livre_III={})".format(self.type_bailleur, + self.respecte_convention_titre_V, + self.respecte_convention_titre_II, + self.construit_ameliore_conditions_l831_1_4, + self.acquisition_aides_etat_pret_titre_II_ou_livre_III) + +class Pret: + def __init__(self, type_pret: TypePret, date_signature: Date, titulaire_pret: TitulairePret) -> None: + self.type_pret = type_pret + self.date_signature = date_signature + self.titulaire_pret = titulaire_pret + + def __eq__(self, other: object) -> bool: + if isinstance(other, Pret): + return (self.type_pret == other.type_pret and + self.date_signature == other.date_signature and + self.titulaire_pret == other.titulaire_pret) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "Pret(type_pret={},date_signature={},titulaire_pret={})".format(self.type_pret, + self.date_signature, self.titulaire_pret) + +class NeufOuAncien_Code(Enum): + Neuf = 0 + Ancien = 1 + +class NeufOuAncien: + def __init__(self, code: NeufOuAncien_Code, value: Any) -> None: + self.code = code + self.value = value + + + def __eq__(self, other: object) -> bool: + if isinstance(other, NeufOuAncien): + return self.code == other.code and self.value == other.value + else: + return False + + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "{}({})".format(self.code, self.value) + +class TrancheRevenu: + def __init__(self, haut: LimiteTranche, bas: Money, taux: Decimal) -> None: + self.haut = haut + self.bas = bas + self.taux = taux + + def __eq__(self, other: object) -> bool: + if isinstance(other, TrancheRevenu): + return (self.haut == other.haut and self.bas == other.bas and + self.taux == other.taux) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "TrancheRevenu(haut={},bas={},taux={})".format(self.haut, + self.bas, self.taux) + +class TrancheRevenuDecimal: + def __init__(self, haut: LimiteTrancheDecimal, bas: Decimal, taux: Decimal) -> None: + self.haut = haut + self.bas = bas + self.taux = taux + + def __eq__(self, other: object) -> bool: + if isinstance(other, TrancheRevenuDecimal): + return (self.haut == other.haut and self.bas == other.bas and + self.taux == other.taux) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "TrancheRevenuDecimal(haut={},bas={},taux={})".format(self.haut, + self.bas, self.taux) + +class AutrePersonneACharge: + def __init__(self, date_naissance: Date, ressources: Money, ascendant_descendant_collateral_deuxieme_troisieme_degre: bool, parente: Parente, incapacite_80_pourcent_ou_restriction_emploi: bool, beneficiaire_l161_19_l351_8_l643_3_secu: bool, titulaire_allocation_personne_agee: bool) -> None: + self.date_naissance = date_naissance + self.ressources = ressources + self.ascendant_descendant_collateral_deuxieme_troisieme_degre = ascendant_descendant_collateral_deuxieme_troisieme_degre + self.parente = parente + self.incapacite_80_pourcent_ou_restriction_emploi = incapacite_80_pourcent_ou_restriction_emploi + self.beneficiaire_l161_19_l351_8_l643_3_secu = beneficiaire_l161_19_l351_8_l643_3_secu + self.titulaire_allocation_personne_agee = titulaire_allocation_personne_agee + + def __eq__(self, other: object) -> bool: + if isinstance(other, AutrePersonneACharge): + return (self.date_naissance == other.date_naissance and + self.ressources == other.ressources and + self.ascendant_descendant_collateral_deuxieme_troisieme_degre == other.ascendant_descendant_collateral_deuxieme_troisieme_degre and + self.parente == other.parente and + self.incapacite_80_pourcent_ou_restriction_emploi == other.incapacite_80_pourcent_ou_restriction_emploi and + self.beneficiaire_l161_19_l351_8_l643_3_secu == other.beneficiaire_l161_19_l351_8_l643_3_secu and + self.titulaire_allocation_personne_agee == other.titulaire_allocation_personne_agee) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "AutrePersonneACharge(date_naissance={},ressources={},ascendant_descendant_collateral_deuxieme_troisieme_degre={},parente={},incapacite_80_pourcent_ou_restriction_emploi={},beneficiaire_l161_19_l351_8_l643_3_secu={},titulaire_allocation_personne_agee={})".format(self.date_naissance, + self.ressources, + self.ascendant_descendant_collateral_deuxieme_troisieme_degre, + self.parente, self.incapacite_80_pourcent_ou_restriction_emploi, + self.beneficiaire_l161_19_l351_8_l643_3_secu, + self.titulaire_allocation_personne_agee) + +class DateNaissanceTroisiemeOuDernierPlusEnfant_Code(Enum): + MoinsDeTroisEnfants = 0 + PlusDeTroisEnfants = 1 + +class DateNaissanceTroisiemeOuDernierPlusEnfant: + def __init__(self, code: DateNaissanceTroisiemeOuDernierPlusEnfant_Code, value: Any) -> None: + self.code = code + self.value = value + + + def __eq__(self, other: object) -> bool: + if isinstance(other, DateNaissanceTroisiemeOuDernierPlusEnfant): + return self.code == other.code and self.value == other.value + else: + return False + + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "{}({})".format(self.code, self.value) + +class InformationsCalculAPLLogementFoyer: + def __init__(self, redevance: Money, categorie_equivalence_loyer_d842_16: CategorieEquivalenceLoyerAllocationLogementFoyer) -> None: + self.redevance = redevance + self.categorie_equivalence_loyer_d842_16 = categorie_equivalence_loyer_d842_16 + + def __eq__(self, other: object) -> bool: + if isinstance(other, InformationsCalculAPLLogementFoyer): + return (self.redevance == other.redevance and + self.categorie_equivalence_loyer_d842_16 == other.categorie_equivalence_loyer_d842_16) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "InformationsCalculAPLLogementFoyer(redevance={},categorie_equivalence_loyer_d842_16={})".format(self.redevance, + self.categorie_equivalence_loyer_d842_16) + +class EnfantPrestationsFamiliales: + def __init__(self, identifiant: Integer, obligation_scolaire: SituationObligationScolaire, remuneration_mensuelle: Money, date_de_naissance: Date, age: Integer, prise_en_charge: PriseEnChargeEnfant, a_deja_ouvert_droit_aux_allocations_familiales: bool, beneficie_titre_personnel_aide_personnelle_logement: bool) -> None: + self.identifiant = identifiant + self.obligation_scolaire = obligation_scolaire + self.remuneration_mensuelle = remuneration_mensuelle + self.date_de_naissance = date_de_naissance + self.age = age + self.prise_en_charge = prise_en_charge + self.a_deja_ouvert_droit_aux_allocations_familiales = a_deja_ouvert_droit_aux_allocations_familiales + self.beneficie_titre_personnel_aide_personnelle_logement = beneficie_titre_personnel_aide_personnelle_logement + + def __eq__(self, other: object) -> bool: + if isinstance(other, EnfantPrestationsFamiliales): + return (self.identifiant == other.identifiant and + self.obligation_scolaire == other.obligation_scolaire and + self.remuneration_mensuelle == other.remuneration_mensuelle and + self.date_de_naissance == other.date_de_naissance and + self.age == other.age and + self.prise_en_charge == other.prise_en_charge and + self.a_deja_ouvert_droit_aux_allocations_familiales == other.a_deja_ouvert_droit_aux_allocations_familiales and + self.beneficie_titre_personnel_aide_personnelle_logement == other.beneficie_titre_personnel_aide_personnelle_logement) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "EnfantPrestationsFamiliales(identifiant={},obligation_scolaire={},remuneration_mensuelle={},date_de_naissance={},age={},prise_en_charge={},a_deja_ouvert_droit_aux_allocations_familiales={},beneficie_titre_personnel_aide_personnelle_logement={})".format(self.identifiant, + self.obligation_scolaire, self.remuneration_mensuelle, + self.date_de_naissance, self.age, self.prise_en_charge, + self.a_deja_ouvert_droit_aux_allocations_familiales, + self.beneficie_titre_personnel_aide_personnelle_logement) + +class EnfantACharge: + def __init__(self, identifiant: Integer, beneficie_titre_personnel_aide_personnelle_logement: bool, a_deja_ouvert_droit_aux_allocations_familiales: bool, date_de_naissance: Date, remuneration_mensuelle: Money, obligation_scolaire: SituationObligationScolaire, prise_en_charge: PriseEnCharge, age: Integer, situation_garde_alternee: SituationGardeAlternee) -> None: + self.identifiant = identifiant + self.beneficie_titre_personnel_aide_personnelle_logement = beneficie_titre_personnel_aide_personnelle_logement + self.a_deja_ouvert_droit_aux_allocations_familiales = a_deja_ouvert_droit_aux_allocations_familiales + self.date_de_naissance = date_de_naissance + self.remuneration_mensuelle = remuneration_mensuelle + self.obligation_scolaire = obligation_scolaire + self.prise_en_charge = prise_en_charge + self.age = age + self.situation_garde_alternee = situation_garde_alternee + + def __eq__(self, other: object) -> bool: + if isinstance(other, EnfantACharge): + return (self.identifiant == other.identifiant and + self.beneficie_titre_personnel_aide_personnelle_logement == other.beneficie_titre_personnel_aide_personnelle_logement and + self.a_deja_ouvert_droit_aux_allocations_familiales == other.a_deja_ouvert_droit_aux_allocations_familiales and + self.date_de_naissance == other.date_de_naissance and + self.remuneration_mensuelle == other.remuneration_mensuelle and + self.obligation_scolaire == other.obligation_scolaire and + self.prise_en_charge == other.prise_en_charge and + self.age == other.age and + self.situation_garde_alternee == other.situation_garde_alternee) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "EnfantACharge(identifiant={},beneficie_titre_personnel_aide_personnelle_logement={},a_deja_ouvert_droit_aux_allocations_familiales={},date_de_naissance={},remuneration_mensuelle={},obligation_scolaire={},prise_en_charge={},age={},situation_garde_alternee={})".format(self.identifiant, + self.beneficie_titre_personnel_aide_personnelle_logement, + self.a_deja_ouvert_droit_aux_allocations_familiales, + self.date_de_naissance, self.remuneration_mensuelle, + self.obligation_scolaire, self.prise_en_charge, self.age, + self.situation_garde_alternee) + +class LoueOuSousLoueADesTiers_Code(Enum): + Non = 0 + Oui = 1 + +class LoueOuSousLoueADesTiers: + def __init__(self, code: LoueOuSousLoueADesTiers_Code, value: Any) -> None: + self.code = code + self.value = value + + + def __eq__(self, other: object) -> bool: + if isinstance(other, LoueOuSousLoueADesTiers): + return self.code == other.code and self.value == other.value + else: + return False + + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "{}({})".format(self.code, self.value) + +class Demandeur: + def __init__(self, satisfait_conditions_l512_2_code_securite_sociale: bool, age_demandeur: Integer, date_naissance: Date, contrat_de_travail: TypeContratTravail, nationalite: Nationalite, patrimoine: Patrimoine, personne_hebergee_centre_soin_l_L162_22_3_securite_sociale: bool) -> None: + self.satisfait_conditions_l512_2_code_securite_sociale = satisfait_conditions_l512_2_code_securite_sociale + self.age_demandeur = age_demandeur + self.date_naissance = date_naissance + self.contrat_de_travail = contrat_de_travail + self.nationalite = nationalite + self.patrimoine = patrimoine + self.personne_hebergee_centre_soin_l_L162_22_3_securite_sociale = personne_hebergee_centre_soin_l_L162_22_3_securite_sociale + + def __eq__(self, other: object) -> bool: + if isinstance(other, Demandeur): + return (self.satisfait_conditions_l512_2_code_securite_sociale == other.satisfait_conditions_l512_2_code_securite_sociale and + self.age_demandeur == other.age_demandeur and + self.date_naissance == other.date_naissance and + self.contrat_de_travail == other.contrat_de_travail and + self.nationalite == other.nationalite and + self.patrimoine == other.patrimoine and + self.personne_hebergee_centre_soin_l_L162_22_3_securite_sociale == other.personne_hebergee_centre_soin_l_L162_22_3_securite_sociale) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "Demandeur(satisfait_conditions_l512_2_code_securite_sociale={},age_demandeur={},date_naissance={},contrat_de_travail={},nationalite={},patrimoine={},personne_hebergee_centre_soin_l_L162_22_3_securite_sociale={})".format(self.satisfait_conditions_l512_2_code_securite_sociale, + self.age_demandeur, self.date_naissance, self.contrat_de_travail, + self.nationalite, self.patrimoine, + self.personne_hebergee_centre_soin_l_L162_22_3_securite_sociale) + +class ChangementLogementD8424_Code(Enum): + Changement = 0 + PasDeChangement = 1 + +class ChangementLogementD8424: + def __init__(self, code: ChangementLogementD8424_Code, value: Any) -> None: + self.code = code + self.value = value + + + def __eq__(self, other: object) -> bool: + if isinstance(other, ChangementLogementD8424): + return self.code == other.code and self.value == other.value + else: + return False + + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "{}({})".format(self.code, self.value) + +class Location: + def __init__(self, bailleur: Bailleur) -> None: + self.bailleur = bailleur + + def __eq__(self, other: object) -> bool: + if isinstance(other, Location): + return (self.bailleur == other.bailleur) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "Location(bailleur={})".format(self.bailleur) + +class Proprietaire: + def __init__(self, pret: Pret) -> None: + self.pret = pret + + def __eq__(self, other: object) -> bool: + if isinstance(other, Proprietaire): + return (self.pret == other.pret) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "Proprietaire(pret={})".format(self.pret) + +class InformationsCalculAPLAccessionPropriete: + def __init__(self, mensualite_principale: Money, charges_mensuelles_pret: Money, date_signature_pret: Date, date_entree_logement: Date, type_travaux_logement_d832_15: TypeTravauxLogementD83215, type_travaux_logement_r842_5: TypeTravauxLogementR8425, local_habite_premiere_fois_beneficiaire: bool, copropriete: bool, situation_r822_11_13_17: bool, type_pret: TypePret, anciennete_logement: NeufOuAncien) -> None: + self.mensualite_principale = mensualite_principale + self.charges_mensuelles_pret = charges_mensuelles_pret + self.date_signature_pret = date_signature_pret + self.date_entree_logement = date_entree_logement + self.type_travaux_logement_d832_15 = type_travaux_logement_d832_15 + self.type_travaux_logement_r842_5 = type_travaux_logement_r842_5 + self.local_habite_premiere_fois_beneficiaire = local_habite_premiere_fois_beneficiaire + self.copropriete = copropriete + self.situation_r822_11_13_17 = situation_r822_11_13_17 + self.type_pret = type_pret + self.anciennete_logement = anciennete_logement + + def __eq__(self, other: object) -> bool: + if isinstance(other, InformationsCalculAPLAccessionPropriete): + return (self.mensualite_principale == other.mensualite_principale and + self.charges_mensuelles_pret == other.charges_mensuelles_pret and + self.date_signature_pret == other.date_signature_pret and + self.date_entree_logement == other.date_entree_logement and + self.type_travaux_logement_d832_15 == other.type_travaux_logement_d832_15 and + self.type_travaux_logement_r842_5 == other.type_travaux_logement_r842_5 and + self.local_habite_premiere_fois_beneficiaire == other.local_habite_premiere_fois_beneficiaire and + self.copropriete == other.copropriete and + self.situation_r822_11_13_17 == other.situation_r822_11_13_17 and + self.type_pret == other.type_pret and + self.anciennete_logement == other.anciennete_logement) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "InformationsCalculAPLAccessionPropriete(mensualite_principale={},charges_mensuelles_pret={},date_signature_pret={},date_entree_logement={},type_travaux_logement_d832_15={},type_travaux_logement_r842_5={},local_habite_premiere_fois_beneficiaire={},copropriete={},situation_r822_11_13_17={},type_pret={},anciennete_logement={})".format(self.mensualite_principale, + self.charges_mensuelles_pret, self.date_signature_pret, + self.date_entree_logement, self.type_travaux_logement_d832_15, + self.type_travaux_logement_r842_5, + self.local_habite_premiere_fois_beneficiaire, self.copropriete, + self.situation_r822_11_13_17, self.type_pret, + self.anciennete_logement) + +class PersonneACharge_Code(Enum): + EnfantACharge = 0 + AutrePersonneACharge = 1 + +class PersonneACharge: + def __init__(self, code: PersonneACharge_Code, value: Any) -> None: + self.code = code + self.value = value + + + def __eq__(self, other: object) -> bool: + if isinstance(other, PersonneACharge): + return self.code == other.code and self.value == other.value + else: + return False + + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "{}({})".format(self.code, self.value) + +class InformationsCalculAPLLocatif: + def __init__(self, loyer_principal: Money, beneficiaire_aide_adulte_ou_enfant_handicapes: bool, logement_est_chambre: bool, colocation: bool, agees_ou_handicap_adultes_hebergees_onereux_particuliers: bool, reduction_loyer_solidarite: Money, logement_meuble_d842_2: bool, changement_logement_d842_4: ChangementLogementD8424) -> None: + self.loyer_principal = loyer_principal + self.beneficiaire_aide_adulte_ou_enfant_handicapes = beneficiaire_aide_adulte_ou_enfant_handicapes + self.logement_est_chambre = logement_est_chambre + self.colocation = colocation + self.agees_ou_handicap_adultes_hebergees_onereux_particuliers = agees_ou_handicap_adultes_hebergees_onereux_particuliers + self.reduction_loyer_solidarite = reduction_loyer_solidarite + self.logement_meuble_d842_2 = logement_meuble_d842_2 + self.changement_logement_d842_4 = changement_logement_d842_4 + + def __eq__(self, other: object) -> bool: + if isinstance(other, InformationsCalculAPLLocatif): + return (self.loyer_principal == other.loyer_principal and + self.beneficiaire_aide_adulte_ou_enfant_handicapes == other.beneficiaire_aide_adulte_ou_enfant_handicapes and + self.logement_est_chambre == other.logement_est_chambre and + self.colocation == other.colocation and + self.agees_ou_handicap_adultes_hebergees_onereux_particuliers == other.agees_ou_handicap_adultes_hebergees_onereux_particuliers and + self.reduction_loyer_solidarite == other.reduction_loyer_solidarite and + self.logement_meuble_d842_2 == other.logement_meuble_d842_2 and + self.changement_logement_d842_4 == other.changement_logement_d842_4) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "InformationsCalculAPLLocatif(loyer_principal={},beneficiaire_aide_adulte_ou_enfant_handicapes={},logement_est_chambre={},colocation={},agees_ou_handicap_adultes_hebergees_onereux_particuliers={},reduction_loyer_solidarite={},logement_meuble_d842_2={},changement_logement_d842_4={})".format(self.loyer_principal, + self.beneficiaire_aide_adulte_ou_enfant_handicapes, + self.logement_est_chambre, self.colocation, + self.agees_ou_handicap_adultes_hebergees_onereux_particuliers, + self.reduction_loyer_solidarite, self.logement_meuble_d842_2, + self.changement_logement_d842_4) + +class LogementFoyer: + def __init__(self, type: TypeLogementFoyer, date_conventionnement: Date, location: Location, remplit_conditions_r832_21: bool, construit_application_loi_1957_12_III: bool) -> None: + self.type = type + self.date_conventionnement = date_conventionnement + self.location = location + self.remplit_conditions_r832_21 = remplit_conditions_r832_21 + self.construit_application_loi_1957_12_III = construit_application_loi_1957_12_III + + def __eq__(self, other: object) -> bool: + if isinstance(other, LogementFoyer): + return (self.type == other.type and + self.date_conventionnement == other.date_conventionnement and + self.location == other.location and + self.remplit_conditions_r832_21 == other.remplit_conditions_r832_21 and + self.construit_application_loi_1957_12_III == other.construit_application_loi_1957_12_III) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "LogementFoyer(type={},date_conventionnement={},location={},remplit_conditions_r832_21={},construit_application_loi_1957_12_III={})".format(self.type, + self.date_conventionnement, self.location, + self.remplit_conditions_r832_21, + self.construit_application_loi_1957_12_III) + +class InformationsCalculAPL_Code(Enum): + InfosLocatif = 0 + InfosLogementFoyer = 1 + InfosAccessionPropriete = 2 + +class InformationsCalculAPL: + def __init__(self, code: InformationsCalculAPL_Code, value: Any) -> None: + self.code = code + self.value = value + + + def __eq__(self, other: object) -> bool: + if isinstance(other, InformationsCalculAPL): + return self.code == other.code and self.value == other.value + else: + return False + + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "{}({})".format(self.code, self.value) + +class ModeOccupation_Code(Enum): + Locataire = 0 + ResidentLogementFoyer = 1 + AccessionProprieteLocalUsageExclusifHabitation = 2 + SousLocataire = 3 + LocationAccession = 4 + +class ModeOccupation: + def __init__(self, code: ModeOccupation_Code, value: Any) -> None: + self.code = code + self.value = value + + + def __eq__(self, other: object) -> bool: + if isinstance(other, ModeOccupation): + return self.code == other.code and self.value == other.value + else: + return False + + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "{}({})".format(self.code, self.value) + +class Logement: + def __init__(self, residence_principale: bool, est_ehpad_ou_maison_autonomie_l313_12_asf: bool, mode_occupation: ModeOccupation, proprietaire: ParentOuAutre, loue_ou_sous_loue_a_des_tiers: LoueOuSousLoueADesTiers, usufruit: ParentOuAutre, logement_decent_l89_462: bool, surface_m_carres: Integer, est_ancien_l831_2: bool, situe_commune_desequilibre_l831_2: bool, zone: ZoneDHabitation) -> None: + self.residence_principale = residence_principale + self.est_ehpad_ou_maison_autonomie_l313_12_asf = est_ehpad_ou_maison_autonomie_l313_12_asf + self.mode_occupation = mode_occupation + self.proprietaire = proprietaire + self.loue_ou_sous_loue_a_des_tiers = loue_ou_sous_loue_a_des_tiers + self.usufruit = usufruit + self.logement_decent_l89_462 = logement_decent_l89_462 + self.surface_m_carres = surface_m_carres + self.est_ancien_l831_2 = est_ancien_l831_2 + self.situe_commune_desequilibre_l831_2 = situe_commune_desequilibre_l831_2 + self.zone = zone + + def __eq__(self, other: object) -> bool: + if isinstance(other, Logement): + return (self.residence_principale == other.residence_principale and + self.est_ehpad_ou_maison_autonomie_l313_12_asf == other.est_ehpad_ou_maison_autonomie_l313_12_asf and + self.mode_occupation == other.mode_occupation and + self.proprietaire == other.proprietaire and + self.loue_ou_sous_loue_a_des_tiers == other.loue_ou_sous_loue_a_des_tiers and + self.usufruit == other.usufruit and + self.logement_decent_l89_462 == other.logement_decent_l89_462 and + self.surface_m_carres == other.surface_m_carres and + self.est_ancien_l831_2 == other.est_ancien_l831_2 and + self.situe_commune_desequilibre_l831_2 == other.situe_commune_desequilibre_l831_2 and + self.zone == other.zone) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "Logement(residence_principale={},est_ehpad_ou_maison_autonomie_l313_12_asf={},mode_occupation={},proprietaire={},loue_ou_sous_loue_a_des_tiers={},usufruit={},logement_decent_l89_462={},surface_m_carres={},est_ancien_l831_2={},situe_commune_desequilibre_l831_2={},zone={})".format(self.residence_principale, + self.est_ehpad_ou_maison_autonomie_l313_12_asf, + self.mode_occupation, self.proprietaire, + self.loue_ou_sous_loue_a_des_tiers, self.usufruit, + self.logement_decent_l89_462, self.surface_m_carres, + self.est_ancien_l831_2, self.situe_commune_desequilibre_l831_2, + self.zone) + +class Menage: + def __init__(self, prestations_recues: List[PrestationRecue], logement: Logement, personnes_a_charge: List[PersonneACharge], nombre_autres_occupants_logement: Integer, situation_familiale: SituationFamiliale, condition_rattache_foyer_fiscal_parent_ifi: bool, nombre_enfants_a_naitre_apres_troisieme_mois_grossesse: Integer, enfant_a_naitre_apres_quatrieme_mois_grossesse: bool, date_naissance_troisieme_enfant_ou_dernier_si_plus: DateNaissanceTroisiemeOuDernierPlusEnfant) -> None: + self.prestations_recues = prestations_recues + self.logement = logement + self.personnes_a_charge = personnes_a_charge + self.nombre_autres_occupants_logement = nombre_autres_occupants_logement + self.situation_familiale = situation_familiale + self.condition_rattache_foyer_fiscal_parent_ifi = condition_rattache_foyer_fiscal_parent_ifi + self.nombre_enfants_a_naitre_apres_troisieme_mois_grossesse = nombre_enfants_a_naitre_apres_troisieme_mois_grossesse + self.enfant_a_naitre_apres_quatrieme_mois_grossesse = enfant_a_naitre_apres_quatrieme_mois_grossesse + self.date_naissance_troisieme_enfant_ou_dernier_si_plus = date_naissance_troisieme_enfant_ou_dernier_si_plus + + def __eq__(self, other: object) -> bool: + if isinstance(other, Menage): + return (self.prestations_recues == other.prestations_recues and + self.logement == other.logement and + self.personnes_a_charge == other.personnes_a_charge and + self.nombre_autres_occupants_logement == other.nombre_autres_occupants_logement and + self.situation_familiale == other.situation_familiale and + self.condition_rattache_foyer_fiscal_parent_ifi == other.condition_rattache_foyer_fiscal_parent_ifi and + self.nombre_enfants_a_naitre_apres_troisieme_mois_grossesse == other.nombre_enfants_a_naitre_apres_troisieme_mois_grossesse and + self.enfant_a_naitre_apres_quatrieme_mois_grossesse == other.enfant_a_naitre_apres_quatrieme_mois_grossesse and + self.date_naissance_troisieme_enfant_ou_dernier_si_plus == other.date_naissance_troisieme_enfant_ou_dernier_si_plus) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "Menage(prestations_recues={},logement={},personnes_a_charge={},nombre_autres_occupants_logement={},situation_familiale={},condition_rattache_foyer_fiscal_parent_ifi={},nombre_enfants_a_naitre_apres_troisieme_mois_grossesse={},enfant_a_naitre_apres_quatrieme_mois_grossesse={},date_naissance_troisieme_enfant_ou_dernier_si_plus={})".format(self.prestations_recues, + self.logement, self.personnes_a_charge, + self.nombre_autres_occupants_logement, self.situation_familiale, + self.condition_rattache_foyer_fiscal_parent_ifi, + self.nombre_enfants_a_naitre_apres_troisieme_mois_grossesse, + self.enfant_a_naitre_apres_quatrieme_mois_grossesse, + self.date_naissance_troisieme_enfant_ou_dernier_si_plus) + +class EligibiliteAidesPersonnelleLogementOut: + def __init__(self, date_courante_out: Date, eligibilite_out: bool, nombre_personnes_a_charge_prises_en_compte_out: Integer, coefficents_enfants_garde_alternee_pris_en_compte_out: List[Decimal], condition_2_r823_4_out: Callable[[PersonneACharge], bool]) -> None: + self.date_courante_out = date_courante_out + self.eligibilite_out = eligibilite_out + self.nombre_personnes_a_charge_prises_en_compte_out = nombre_personnes_a_charge_prises_en_compte_out + self.coefficents_enfants_garde_alternee_pris_en_compte_out = coefficents_enfants_garde_alternee_pris_en_compte_out + self.condition_2_r823_4_out = condition_2_r823_4_out + + def __eq__(self, other: object) -> bool: + if isinstance(other, EligibiliteAidesPersonnelleLogementOut): + return (self.date_courante_out == other.date_courante_out and + self.eligibilite_out == other.eligibilite_out and + self.nombre_personnes_a_charge_prises_en_compte_out == other.nombre_personnes_a_charge_prises_en_compte_out and + self.coefficents_enfants_garde_alternee_pris_en_compte_out == other.coefficents_enfants_garde_alternee_pris_en_compte_out and + self.condition_2_r823_4_out == other.condition_2_r823_4_out) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "EligibiliteAidesPersonnelleLogementOut(date_courante_out={},eligibilite_out={},nombre_personnes_a_charge_prises_en_compte_out={},coefficents_enfants_garde_alternee_pris_en_compte_out={},condition_2_r823_4_out={})".format(self.date_courante_out, + self.eligibilite_out, + self.nombre_personnes_a_charge_prises_en_compte_out, + self.coefficents_enfants_garde_alternee_pris_en_compte_out, + self.condition_2_r823_4_out) + +class EligibiliteAidesPersonnelleLogementIn: + def __init__(self, menage_in: Menage, demandeur_in: Demandeur, date_courante_in: Date, condition_logement_residence_principale_in: Callable[[Unit], bool], condition_logement_surface_in: Callable[[Unit], bool]) -> None: + self.menage_in = menage_in + self.demandeur_in = demandeur_in + self.date_courante_in = date_courante_in + self.condition_logement_residence_principale_in = condition_logement_residence_principale_in + self.condition_logement_surface_in = condition_logement_surface_in + + def __eq__(self, other: object) -> bool: + if isinstance(other, EligibiliteAidesPersonnelleLogementIn): + return (self.menage_in == other.menage_in and + self.demandeur_in == other.demandeur_in and + self.date_courante_in == other.date_courante_in and + self.condition_logement_residence_principale_in == other.condition_logement_residence_principale_in and + self.condition_logement_surface_in == other.condition_logement_surface_in) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "EligibiliteAidesPersonnelleLogementIn(menage_in={},demandeur_in={},date_courante_in={},condition_logement_residence_principale_in={},condition_logement_surface_in={})".format(self.menage_in, + self.demandeur_in, self.date_courante_in, + self.condition_logement_residence_principale_in, + self.condition_logement_surface_in) + +class EligibiliteAidePersonnaliseeLogementOut: + def __init__(self, date_courante_out: Date, eligibilite_out: bool, nombre_personnes_a_charge_prises_en_compte_out: Integer, coefficents_enfants_garde_alternee_pris_en_compte_out: List[Decimal]) -> None: + self.date_courante_out = date_courante_out + self.eligibilite_out = eligibilite_out + self.nombre_personnes_a_charge_prises_en_compte_out = nombre_personnes_a_charge_prises_en_compte_out + self.coefficents_enfants_garde_alternee_pris_en_compte_out = coefficents_enfants_garde_alternee_pris_en_compte_out + + def __eq__(self, other: object) -> bool: + if isinstance(other, EligibiliteAidePersonnaliseeLogementOut): + return (self.date_courante_out == other.date_courante_out and + self.eligibilite_out == other.eligibilite_out and + self.nombre_personnes_a_charge_prises_en_compte_out == other.nombre_personnes_a_charge_prises_en_compte_out and + self.coefficents_enfants_garde_alternee_pris_en_compte_out == other.coefficents_enfants_garde_alternee_pris_en_compte_out) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "EligibiliteAidePersonnaliseeLogementOut(date_courante_out={},eligibilite_out={},nombre_personnes_a_charge_prises_en_compte_out={},coefficents_enfants_garde_alternee_pris_en_compte_out={})".format(self.date_courante_out, + self.eligibilite_out, + self.nombre_personnes_a_charge_prises_en_compte_out, + self.coefficents_enfants_garde_alternee_pris_en_compte_out) + +class EligibiliteAidePersonnaliseeLogementIn: + def __init__(self, menage_in: Menage, demandeur_in: Demandeur, date_courante_in: Date) -> None: + self.menage_in = menage_in + self.demandeur_in = demandeur_in + self.date_courante_in = date_courante_in + + def __eq__(self, other: object) -> bool: + if isinstance(other, EligibiliteAidePersonnaliseeLogementIn): + return (self.menage_in == other.menage_in and + self.demandeur_in == other.demandeur_in and + self.date_courante_in == other.date_courante_in) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "EligibiliteAidePersonnaliseeLogementIn(menage_in={},demandeur_in={},date_courante_in={})".format(self.menage_in, + self.demandeur_in, self.date_courante_in) + +class EligibiliteAllocationLogementOut: + def __init__(self, eligibilite_avec_condition_logement_out: EligibiliteAllocationLogement, nombre_personnes_a_charge_prises_en_compte_out: Integer, coefficents_enfants_garde_alternee_pris_en_compte_out: List[Decimal]) -> None: + self.eligibilite_avec_condition_logement_out = eligibilite_avec_condition_logement_out + self.nombre_personnes_a_charge_prises_en_compte_out = nombre_personnes_a_charge_prises_en_compte_out + self.coefficents_enfants_garde_alternee_pris_en_compte_out = coefficents_enfants_garde_alternee_pris_en_compte_out + + def __eq__(self, other: object) -> bool: + if isinstance(other, EligibiliteAllocationLogementOut): + return (self.eligibilite_avec_condition_logement_out == other.eligibilite_avec_condition_logement_out and + self.nombre_personnes_a_charge_prises_en_compte_out == other.nombre_personnes_a_charge_prises_en_compte_out and + self.coefficents_enfants_garde_alternee_pris_en_compte_out == other.coefficents_enfants_garde_alternee_pris_en_compte_out) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "EligibiliteAllocationLogementOut(eligibilite_avec_condition_logement_out={},nombre_personnes_a_charge_prises_en_compte_out={},coefficents_enfants_garde_alternee_pris_en_compte_out={})".format(self.eligibilite_avec_condition_logement_out, + self.nombre_personnes_a_charge_prises_en_compte_out, + self.coefficents_enfants_garde_alternee_pris_en_compte_out) + +class EligibiliteAllocationLogementIn: + def __init__(self, date_courante_in: Date, menage_in: Menage, demandeur_in: Demandeur, beneficie_aide_personnalisee_logement_in: bool, informations_calcul_in: InformationsCalculAPL) -> None: + self.date_courante_in = date_courante_in + self.menage_in = menage_in + self.demandeur_in = demandeur_in + self.beneficie_aide_personnalisee_logement_in = beneficie_aide_personnalisee_logement_in + self.informations_calcul_in = informations_calcul_in + + def __eq__(self, other: object) -> bool: + if isinstance(other, EligibiliteAllocationLogementIn): + return (self.date_courante_in == other.date_courante_in and + self.menage_in == other.menage_in and + self.demandeur_in == other.demandeur_in and + self.beneficie_aide_personnalisee_logement_in == other.beneficie_aide_personnalisee_logement_in and + self.informations_calcul_in == other.informations_calcul_in) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "EligibiliteAllocationLogementIn(date_courante_in={},menage_in={},demandeur_in={},beneficie_aide_personnalisee_logement_in={},informations_calcul_in={})".format(self.date_courante_in, + self.menage_in, self.demandeur_in, + self.beneficie_aide_personnalisee_logement_in, + self.informations_calcul_in) + +class EligibilitePrimeDeDemenagementOut: + def __init__(self, montant_prime_demenagement_out: Money) -> None: + self.montant_prime_demenagement_out = montant_prime_demenagement_out + + def __eq__(self, other: object) -> bool: + if isinstance(other, EligibilitePrimeDeDemenagementOut): + return (self.montant_prime_demenagement_out == other.montant_prime_demenagement_out) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "EligibilitePrimeDeDemenagementOut(montant_prime_demenagement_out={})".format(self.montant_prime_demenagement_out) + +class EligibilitePrimeDeDemenagementIn: + def __init__(self, date_emmenagement_in: Date, menage_in: Menage, demandeur_in: Demandeur, date_courante_in: Date, depenses_justifiees_reellement_engagees_in: Money) -> None: + self.date_emmenagement_in = date_emmenagement_in + self.menage_in = menage_in + self.demandeur_in = demandeur_in + self.date_courante_in = date_courante_in + self.depenses_justifiees_reellement_engagees_in = depenses_justifiees_reellement_engagees_in + + def __eq__(self, other: object) -> bool: + if isinstance(other, EligibilitePrimeDeDemenagementIn): + return (self.date_emmenagement_in == other.date_emmenagement_in and + self.menage_in == other.menage_in and + self.demandeur_in == other.demandeur_in and + self.date_courante_in == other.date_courante_in and + self.depenses_justifiees_reellement_engagees_in == other.depenses_justifiees_reellement_engagees_in) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "EligibilitePrimeDeDemenagementIn(date_emmenagement_in={},menage_in={},demandeur_in={},date_courante_in={},depenses_justifiees_reellement_engagees_in={})".format(self.date_emmenagement_in, + self.menage_in, self.demandeur_in, self.date_courante_in, + self.depenses_justifiees_reellement_engagees_in) + +class RessourcesAidesPersonnelleLogementOut: + def __init__(self, ressources_prises_en_compte_out: Money) -> None: + self.ressources_prises_en_compte_out = ressources_prises_en_compte_out + + def __eq__(self, other: object) -> bool: + if isinstance(other, RessourcesAidesPersonnelleLogementOut): + return (self.ressources_prises_en_compte_out == other.ressources_prises_en_compte_out) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "RessourcesAidesPersonnelleLogementOut(ressources_prises_en_compte_out={})".format(self.ressources_prises_en_compte_out) + +class RessourcesAidesPersonnelleLogementIn: + def __init__(self, ressources_demandeur_in: Money, ressources_conjoint_in: Money, personnes_vivant_habituellement_foyer_in: List[PersonneVivantHabituellementAuFoyer], demandeur_exerce_activite_remuneree_in: bool, conjoint_exerce_activite_remuneree_in: bool, personnes_a_charge_in: List[PersonneACharge], situation_familiale_in: SituationFamiliale, mode_occupation_in: ModeOccupation, condition_age_bourse_enseignement_superieur_in: bool, demandeur_poursuit_des_etudes_in: bool, date_demande_ou_reexamen_droit_in: Date, paiement_logement_distinct_professionnel_in: PaiementLogementDistinctProfessionnel, ressources_menage_arrondies_base_in: Money) -> None: + self.ressources_demandeur_in = ressources_demandeur_in + self.ressources_conjoint_in = ressources_conjoint_in + self.personnes_vivant_habituellement_foyer_in = personnes_vivant_habituellement_foyer_in + self.demandeur_exerce_activite_remuneree_in = demandeur_exerce_activite_remuneree_in + self.conjoint_exerce_activite_remuneree_in = conjoint_exerce_activite_remuneree_in + self.personnes_a_charge_in = personnes_a_charge_in + self.situation_familiale_in = situation_familiale_in + self.mode_occupation_in = mode_occupation_in + self.condition_age_bourse_enseignement_superieur_in = condition_age_bourse_enseignement_superieur_in + self.demandeur_poursuit_des_etudes_in = demandeur_poursuit_des_etudes_in + self.date_demande_ou_reexamen_droit_in = date_demande_ou_reexamen_droit_in + self.paiement_logement_distinct_professionnel_in = paiement_logement_distinct_professionnel_in + self.ressources_menage_arrondies_base_in = ressources_menage_arrondies_base_in + + def __eq__(self, other: object) -> bool: + if isinstance(other, RessourcesAidesPersonnelleLogementIn): + return (self.ressources_demandeur_in == other.ressources_demandeur_in and + self.ressources_conjoint_in == other.ressources_conjoint_in and + self.personnes_vivant_habituellement_foyer_in == other.personnes_vivant_habituellement_foyer_in and + self.demandeur_exerce_activite_remuneree_in == other.demandeur_exerce_activite_remuneree_in and + self.conjoint_exerce_activite_remuneree_in == other.conjoint_exerce_activite_remuneree_in and + self.personnes_a_charge_in == other.personnes_a_charge_in and + self.situation_familiale_in == other.situation_familiale_in and + self.mode_occupation_in == other.mode_occupation_in and + self.condition_age_bourse_enseignement_superieur_in == other.condition_age_bourse_enseignement_superieur_in and + self.demandeur_poursuit_des_etudes_in == other.demandeur_poursuit_des_etudes_in and + self.date_demande_ou_reexamen_droit_in == other.date_demande_ou_reexamen_droit_in and + self.paiement_logement_distinct_professionnel_in == other.paiement_logement_distinct_professionnel_in and + self.ressources_menage_arrondies_base_in == other.ressources_menage_arrondies_base_in) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "RessourcesAidesPersonnelleLogementIn(ressources_demandeur_in={},ressources_conjoint_in={},personnes_vivant_habituellement_foyer_in={},demandeur_exerce_activite_remuneree_in={},conjoint_exerce_activite_remuneree_in={},personnes_a_charge_in={},situation_familiale_in={},mode_occupation_in={},condition_age_bourse_enseignement_superieur_in={},demandeur_poursuit_des_etudes_in={},date_demande_ou_reexamen_droit_in={},paiement_logement_distinct_professionnel_in={},ressources_menage_arrondies_base_in={})".format(self.ressources_demandeur_in, + self.ressources_conjoint_in, + self.personnes_vivant_habituellement_foyer_in, + self.demandeur_exerce_activite_remuneree_in, + self.conjoint_exerce_activite_remuneree_in, + self.personnes_a_charge_in, self.situation_familiale_in, + self.mode_occupation_in, + self.condition_age_bourse_enseignement_superieur_in, + self.demandeur_poursuit_des_etudes_in, + self.date_demande_ou_reexamen_droit_in, + self.paiement_logement_distinct_professionnel_in, + self.ressources_menage_arrondies_base_in) + +class ContributionsSocialesAidesPersonnelleLogementOut: + def __init__(self, montant_out: Callable[[Money], Money]) -> None: + self.montant_out = montant_out + + def __eq__(self, other: object) -> bool: + if isinstance(other, ContributionsSocialesAidesPersonnelleLogementOut): + return (self.montant_out == other.montant_out) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "ContributionsSocialesAidesPersonnelleLogementOut(montant_out={})".format(self.montant_out) + +class ContributionsSocialesAidesPersonnelleLogementIn: + def __init__(self, date_courante_in: Date) -> None: + self.date_courante_in = date_courante_in + + def __eq__(self, other: object) -> bool: + if isinstance(other, ContributionsSocialesAidesPersonnelleLogementIn): + return (self.date_courante_in == other.date_courante_in) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "ContributionsSocialesAidesPersonnelleLogementIn(date_courante_in={})".format(self.date_courante_in) + +class CalculAidePersonnaliseeLogementLocatifOut: + def __init__(self, montant_forfaitaire_charges_d823_16_out: Money, plafond_loyer_d823_16_2_out: Money, participation_minimale_out: Money, taux_composition_familiale_out: Decimal, participation_personnelle_out: Money, aide_finale_formule_out: Money, traitement_aide_finale_montant_minimal_out: Callable[[Money], Money]) -> None: + self.montant_forfaitaire_charges_d823_16_out = montant_forfaitaire_charges_d823_16_out + self.plafond_loyer_d823_16_2_out = plafond_loyer_d823_16_2_out + self.participation_minimale_out = participation_minimale_out + self.taux_composition_familiale_out = taux_composition_familiale_out + self.participation_personnelle_out = participation_personnelle_out + self.aide_finale_formule_out = aide_finale_formule_out + self.traitement_aide_finale_montant_minimal_out = traitement_aide_finale_montant_minimal_out + + def __eq__(self, other: object) -> bool: + if isinstance(other, CalculAidePersonnaliseeLogementLocatifOut): + return (self.montant_forfaitaire_charges_d823_16_out == other.montant_forfaitaire_charges_d823_16_out and + self.plafond_loyer_d823_16_2_out == other.plafond_loyer_d823_16_2_out and + self.participation_minimale_out == other.participation_minimale_out and + self.taux_composition_familiale_out == other.taux_composition_familiale_out and + self.participation_personnelle_out == other.participation_personnelle_out and + self.aide_finale_formule_out == other.aide_finale_formule_out and + self.traitement_aide_finale_montant_minimal_out == other.traitement_aide_finale_montant_minimal_out) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "CalculAidePersonnaliseeLogementLocatifOut(montant_forfaitaire_charges_d823_16_out={},plafond_loyer_d823_16_2_out={},participation_minimale_out={},taux_composition_familiale_out={},participation_personnelle_out={},aide_finale_formule_out={},traitement_aide_finale_montant_minimal_out={})".format(self.montant_forfaitaire_charges_d823_16_out, + self.plafond_loyer_d823_16_2_out, + self.participation_minimale_out, + self.taux_composition_familiale_out, + self.participation_personnelle_out, self.aide_finale_formule_out, + self.traitement_aide_finale_montant_minimal_out) + +class CalculAidePersonnaliseeLogementLocatifIn: + def __init__(self, loyer_principal_in: Money, ressources_menage_arrondies_in: Money, beneficiaire_aide_adulte_ou_enfant_handicapes_in: bool, date_courante_in: Date, nombre_personnes_a_charge_in: Integer, situation_familiale_calcul_apl_in: SituationFamilialeCalculAPL, zone_in: ZoneDHabitation, logement_est_chambre_in: bool, agees_ou_handicap_adultes_hebergees_onereux_particuliers_in: bool, type_aide_in: TypeAidesPersonnelleLogement, colocation_in: bool, reduction_loyer_solidarite_in: Money) -> None: + self.loyer_principal_in = loyer_principal_in + self.ressources_menage_arrondies_in = ressources_menage_arrondies_in + self.beneficiaire_aide_adulte_ou_enfant_handicapes_in = beneficiaire_aide_adulte_ou_enfant_handicapes_in + self.date_courante_in = date_courante_in + self.nombre_personnes_a_charge_in = nombre_personnes_a_charge_in + self.situation_familiale_calcul_apl_in = situation_familiale_calcul_apl_in + self.zone_in = zone_in + self.logement_est_chambre_in = logement_est_chambre_in + self.agees_ou_handicap_adultes_hebergees_onereux_particuliers_in = agees_ou_handicap_adultes_hebergees_onereux_particuliers_in + self.type_aide_in = type_aide_in + self.colocation_in = colocation_in + self.reduction_loyer_solidarite_in = reduction_loyer_solidarite_in + + def __eq__(self, other: object) -> bool: + if isinstance(other, CalculAidePersonnaliseeLogementLocatifIn): + return (self.loyer_principal_in == other.loyer_principal_in and + self.ressources_menage_arrondies_in == other.ressources_menage_arrondies_in and + self.beneficiaire_aide_adulte_ou_enfant_handicapes_in == other.beneficiaire_aide_adulte_ou_enfant_handicapes_in and + self.date_courante_in == other.date_courante_in and + self.nombre_personnes_a_charge_in == other.nombre_personnes_a_charge_in and + self.situation_familiale_calcul_apl_in == other.situation_familiale_calcul_apl_in and + self.zone_in == other.zone_in and + self.logement_est_chambre_in == other.logement_est_chambre_in and + self.agees_ou_handicap_adultes_hebergees_onereux_particuliers_in == other.agees_ou_handicap_adultes_hebergees_onereux_particuliers_in and + self.type_aide_in == other.type_aide_in and + self.colocation_in == other.colocation_in and + self.reduction_loyer_solidarite_in == other.reduction_loyer_solidarite_in) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "CalculAidePersonnaliseeLogementLocatifIn(loyer_principal_in={},ressources_menage_arrondies_in={},beneficiaire_aide_adulte_ou_enfant_handicapes_in={},date_courante_in={},nombre_personnes_a_charge_in={},situation_familiale_calcul_apl_in={},zone_in={},logement_est_chambre_in={},agees_ou_handicap_adultes_hebergees_onereux_particuliers_in={},type_aide_in={},colocation_in={},reduction_loyer_solidarite_in={})".format(self.loyer_principal_in, + self.ressources_menage_arrondies_in, + self.beneficiaire_aide_adulte_ou_enfant_handicapes_in, + self.date_courante_in, self.nombre_personnes_a_charge_in, + self.situation_familiale_calcul_apl_in, self.zone_in, + self.logement_est_chambre_in, + self.agees_ou_handicap_adultes_hebergees_onereux_particuliers_in, + self.type_aide_in, self.colocation_in, + self.reduction_loyer_solidarite_in) + +class CalculEquivalenceLoyerMinimaleOut: + def __init__(self, montant_out: Money) -> None: + self.montant_out = montant_out + + def __eq__(self, other: object) -> bool: + if isinstance(other, CalculEquivalenceLoyerMinimaleOut): + return (self.montant_out == other.montant_out) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "CalculEquivalenceLoyerMinimaleOut(montant_out={})".format(self.montant_out) + +class CalculEquivalenceLoyerMinimaleIn: + def __init__(self, ressources_menage_arrondies_in: Money, condition_2_du_832_25_in: bool, n_nombre_parts_d832_25_in: Decimal) -> None: + self.ressources_menage_arrondies_in = ressources_menage_arrondies_in + self.condition_2_du_832_25_in = condition_2_du_832_25_in + self.n_nombre_parts_d832_25_in = n_nombre_parts_d832_25_in + + def __eq__(self, other: object) -> bool: + if isinstance(other, CalculEquivalenceLoyerMinimaleIn): + return (self.ressources_menage_arrondies_in == other.ressources_menage_arrondies_in and + self.condition_2_du_832_25_in == other.condition_2_du_832_25_in and + self.n_nombre_parts_d832_25_in == other.n_nombre_parts_d832_25_in) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "CalculEquivalenceLoyerMinimaleIn(ressources_menage_arrondies_in={},condition_2_du_832_25_in={},n_nombre_parts_d832_25_in={})".format(self.ressources_menage_arrondies_in, + self.condition_2_du_832_25_in, self.n_nombre_parts_d832_25_in) + +class CalculNombrePartLogementFoyerOut: + def __init__(self, n_nombre_parts_d832_25_out: Decimal) -> None: + self.n_nombre_parts_d832_25_out = n_nombre_parts_d832_25_out + + def __eq__(self, other: object) -> bool: + if isinstance(other, CalculNombrePartLogementFoyerOut): + return (self.n_nombre_parts_d832_25_out == other.n_nombre_parts_d832_25_out) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "CalculNombrePartLogementFoyerOut(n_nombre_parts_d832_25_out={})".format(self.n_nombre_parts_d832_25_out) + +class CalculNombrePartLogementFoyerIn: + def __init__(self, condition_2_du_832_25_in: bool, nombre_personnes_a_charge_in: Integer, situation_familiale_calcul_apl_in: SituationFamilialeCalculAPL) -> None: + self.condition_2_du_832_25_in = condition_2_du_832_25_in + self.nombre_personnes_a_charge_in = nombre_personnes_a_charge_in + self.situation_familiale_calcul_apl_in = situation_familiale_calcul_apl_in + + def __eq__(self, other: object) -> bool: + if isinstance(other, CalculNombrePartLogementFoyerIn): + return (self.condition_2_du_832_25_in == other.condition_2_du_832_25_in and + self.nombre_personnes_a_charge_in == other.nombre_personnes_a_charge_in and + self.situation_familiale_calcul_apl_in == other.situation_familiale_calcul_apl_in) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "CalculNombrePartLogementFoyerIn(condition_2_du_832_25_in={},nombre_personnes_a_charge_in={},situation_familiale_calcul_apl_in={})".format(self.condition_2_du_832_25_in, + self.nombre_personnes_a_charge_in, + self.situation_familiale_calcul_apl_in) + +class CalculAidePersonnaliseeLogementFoyerOut: + def __init__(self, coefficient_multiplicateur_d832_25_out: Money, coefficient_r_d832_25_out: Money, n_nombre_parts_d832_25_out: Decimal, equivalence_loyer_eligible_out: Money, plafond_equivalence_loyer_eligible_out: Money, equivalence_loyer_minimale_out: Money, coefficient_prise_en_charge_d832_25_seuil_out: Decimal, aide_finale_formule_out: Money, traitement_aide_finale_montant_minimal_out: Callable[[Money], Money]) -> None: + self.coefficient_multiplicateur_d832_25_out = coefficient_multiplicateur_d832_25_out + self.coefficient_r_d832_25_out = coefficient_r_d832_25_out + self.n_nombre_parts_d832_25_out = n_nombre_parts_d832_25_out + self.equivalence_loyer_eligible_out = equivalence_loyer_eligible_out + self.plafond_equivalence_loyer_eligible_out = plafond_equivalence_loyer_eligible_out + self.equivalence_loyer_minimale_out = equivalence_loyer_minimale_out + self.coefficient_prise_en_charge_d832_25_seuil_out = coefficient_prise_en_charge_d832_25_seuil_out + self.aide_finale_formule_out = aide_finale_formule_out + self.traitement_aide_finale_montant_minimal_out = traitement_aide_finale_montant_minimal_out + + def __eq__(self, other: object) -> bool: + if isinstance(other, CalculAidePersonnaliseeLogementFoyerOut): + return (self.coefficient_multiplicateur_d832_25_out == other.coefficient_multiplicateur_d832_25_out and + self.coefficient_r_d832_25_out == other.coefficient_r_d832_25_out and + self.n_nombre_parts_d832_25_out == other.n_nombre_parts_d832_25_out and + self.equivalence_loyer_eligible_out == other.equivalence_loyer_eligible_out and + self.plafond_equivalence_loyer_eligible_out == other.plafond_equivalence_loyer_eligible_out and + self.equivalence_loyer_minimale_out == other.equivalence_loyer_minimale_out and + self.coefficient_prise_en_charge_d832_25_seuil_out == other.coefficient_prise_en_charge_d832_25_seuil_out and + self.aide_finale_formule_out == other.aide_finale_formule_out and + self.traitement_aide_finale_montant_minimal_out == other.traitement_aide_finale_montant_minimal_out) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "CalculAidePersonnaliseeLogementFoyerOut(coefficient_multiplicateur_d832_25_out={},coefficient_r_d832_25_out={},n_nombre_parts_d832_25_out={},equivalence_loyer_eligible_out={},plafond_equivalence_loyer_eligible_out={},equivalence_loyer_minimale_out={},coefficient_prise_en_charge_d832_25_seuil_out={},aide_finale_formule_out={},traitement_aide_finale_montant_minimal_out={})".format(self.coefficient_multiplicateur_d832_25_out, + self.coefficient_r_d832_25_out, self.n_nombre_parts_d832_25_out, + self.equivalence_loyer_eligible_out, + self.plafond_equivalence_loyer_eligible_out, + self.equivalence_loyer_minimale_out, + self.coefficient_prise_en_charge_d832_25_seuil_out, + self.aide_finale_formule_out, + self.traitement_aide_finale_montant_minimal_out) + +class CalculAidePersonnaliseeLogementFoyerIn: + def __init__(self, mode_occupation_in: ModeOccupation, ressources_menage_arrondies_in: Money, nombre_personnes_a_charge_in: Integer, situation_familiale_calcul_apl_in: SituationFamilialeCalculAPL, zone_in: ZoneDHabitation, date_courante_in: Date, redevance_in: Money, condition_2_du_832_25_in: Callable[[Unit], bool], n_nombre_parts_d832_25_in: Callable[[Unit], Decimal]) -> None: + self.mode_occupation_in = mode_occupation_in + self.ressources_menage_arrondies_in = ressources_menage_arrondies_in + self.nombre_personnes_a_charge_in = nombre_personnes_a_charge_in + self.situation_familiale_calcul_apl_in = situation_familiale_calcul_apl_in + self.zone_in = zone_in + self.date_courante_in = date_courante_in + self.redevance_in = redevance_in + self.condition_2_du_832_25_in = condition_2_du_832_25_in + self.n_nombre_parts_d832_25_in = n_nombre_parts_d832_25_in + + def __eq__(self, other: object) -> bool: + if isinstance(other, CalculAidePersonnaliseeLogementFoyerIn): + return (self.mode_occupation_in == other.mode_occupation_in and + self.ressources_menage_arrondies_in == other.ressources_menage_arrondies_in and + self.nombre_personnes_a_charge_in == other.nombre_personnes_a_charge_in and + self.situation_familiale_calcul_apl_in == other.situation_familiale_calcul_apl_in and + self.zone_in == other.zone_in and + self.date_courante_in == other.date_courante_in and + self.redevance_in == other.redevance_in and + self.condition_2_du_832_25_in == other.condition_2_du_832_25_in and + self.n_nombre_parts_d832_25_in == other.n_nombre_parts_d832_25_in) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "CalculAidePersonnaliseeLogementFoyerIn(mode_occupation_in={},ressources_menage_arrondies_in={},nombre_personnes_a_charge_in={},situation_familiale_calcul_apl_in={},zone_in={},date_courante_in={},redevance_in={},condition_2_du_832_25_in={},n_nombre_parts_d832_25_in={})".format(self.mode_occupation_in, + self.ressources_menage_arrondies_in, + self.nombre_personnes_a_charge_in, + self.situation_familiale_calcul_apl_in, self.zone_in, + self.date_courante_in, self.redevance_in, + self.condition_2_du_832_25_in, self.n_nombre_parts_d832_25_in) + +class CalculNombrePartsAccessionProprieteOut: + def __init__(self, n_nombre_parts_d832_11_out: Decimal) -> None: + self.n_nombre_parts_d832_11_out = n_nombre_parts_d832_11_out + + def __eq__(self, other: object) -> bool: + if isinstance(other, CalculNombrePartsAccessionProprieteOut): + return (self.n_nombre_parts_d832_11_out == other.n_nombre_parts_d832_11_out) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "CalculNombrePartsAccessionProprieteOut(n_nombre_parts_d832_11_out={})".format(self.n_nombre_parts_d832_11_out) + +class CalculNombrePartsAccessionProprieteIn: + def __init__(self, nombre_personnes_a_charge_in: Integer, situation_familiale_calcul_apl_in: SituationFamilialeCalculAPL) -> None: + self.nombre_personnes_a_charge_in = nombre_personnes_a_charge_in + self.situation_familiale_calcul_apl_in = situation_familiale_calcul_apl_in + + def __eq__(self, other: object) -> bool: + if isinstance(other, CalculNombrePartsAccessionProprieteIn): + return (self.nombre_personnes_a_charge_in == other.nombre_personnes_a_charge_in and + self.situation_familiale_calcul_apl_in == other.situation_familiale_calcul_apl_in) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "CalculNombrePartsAccessionProprieteIn(nombre_personnes_a_charge_in={},situation_familiale_calcul_apl_in={})".format(self.nombre_personnes_a_charge_in, + self.situation_familiale_calcul_apl_in) + +class CalculAidePersonnaliseeLogementAccessionProprieteOut: + def __init__(self, mensualite_eligible_out: Money, mensualite_minimale_out: Money, coefficient_prise_en_charge_d832_10_seuil_out: Decimal, aide_finale_formule_out: Money, traitement_aide_finale_montant_minimal_out: Callable[[Money], Money]) -> None: + self.mensualite_eligible_out = mensualite_eligible_out + self.mensualite_minimale_out = mensualite_minimale_out + self.coefficient_prise_en_charge_d832_10_seuil_out = coefficient_prise_en_charge_d832_10_seuil_out + self.aide_finale_formule_out = aide_finale_formule_out + self.traitement_aide_finale_montant_minimal_out = traitement_aide_finale_montant_minimal_out + + def __eq__(self, other: object) -> bool: + if isinstance(other, CalculAidePersonnaliseeLogementAccessionProprieteOut): + return (self.mensualite_eligible_out == other.mensualite_eligible_out and + self.mensualite_minimale_out == other.mensualite_minimale_out and + self.coefficient_prise_en_charge_d832_10_seuil_out == other.coefficient_prise_en_charge_d832_10_seuil_out and + self.aide_finale_formule_out == other.aide_finale_formule_out and + self.traitement_aide_finale_montant_minimal_out == other.traitement_aide_finale_montant_minimal_out) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "CalculAidePersonnaliseeLogementAccessionProprieteOut(mensualite_eligible_out={},mensualite_minimale_out={},coefficient_prise_en_charge_d832_10_seuil_out={},aide_finale_formule_out={},traitement_aide_finale_montant_minimal_out={})".format(self.mensualite_eligible_out, + self.mensualite_minimale_out, + self.coefficient_prise_en_charge_d832_10_seuil_out, + self.aide_finale_formule_out, + self.traitement_aide_finale_montant_minimal_out) + +class CalculAidePersonnaliseeLogementAccessionProprieteIn: + def __init__(self, mensualite_principale_in: Money, ressources_menage_arrondies_in: Money, nombre_personnes_a_charge_in: Integer, situation_familiale_calcul_apl_in: SituationFamilialeCalculAPL, type_travaux_logement_in: TypeTravauxLogementD83215, date_signature_pret_in: Date, local_habite_premiere_fois_beneficiaire_in: bool, date_entree_logement_in: Date, copropriete_in: bool, situation_r822_11_13_17_in: bool, zone_in: ZoneDHabitation, type_pret_in: TypePret, anciennete_logement_in: NeufOuAncien, date_courante_in: Date) -> None: + self.mensualite_principale_in = mensualite_principale_in + self.ressources_menage_arrondies_in = ressources_menage_arrondies_in + self.nombre_personnes_a_charge_in = nombre_personnes_a_charge_in + self.situation_familiale_calcul_apl_in = situation_familiale_calcul_apl_in + self.type_travaux_logement_in = type_travaux_logement_in + self.date_signature_pret_in = date_signature_pret_in + self.local_habite_premiere_fois_beneficiaire_in = local_habite_premiere_fois_beneficiaire_in + self.date_entree_logement_in = date_entree_logement_in + self.copropriete_in = copropriete_in + self.situation_r822_11_13_17_in = situation_r822_11_13_17_in + self.zone_in = zone_in + self.type_pret_in = type_pret_in + self.anciennete_logement_in = anciennete_logement_in + self.date_courante_in = date_courante_in + + def __eq__(self, other: object) -> bool: + if isinstance(other, CalculAidePersonnaliseeLogementAccessionProprieteIn): + return (self.mensualite_principale_in == other.mensualite_principale_in and + self.ressources_menage_arrondies_in == other.ressources_menage_arrondies_in and + self.nombre_personnes_a_charge_in == other.nombre_personnes_a_charge_in and + self.situation_familiale_calcul_apl_in == other.situation_familiale_calcul_apl_in and + self.type_travaux_logement_in == other.type_travaux_logement_in and + self.date_signature_pret_in == other.date_signature_pret_in and + self.local_habite_premiere_fois_beneficiaire_in == other.local_habite_premiere_fois_beneficiaire_in and + self.date_entree_logement_in == other.date_entree_logement_in and + self.copropriete_in == other.copropriete_in and + self.situation_r822_11_13_17_in == other.situation_r822_11_13_17_in and + self.zone_in == other.zone_in and + self.type_pret_in == other.type_pret_in and + self.anciennete_logement_in == other.anciennete_logement_in and + self.date_courante_in == other.date_courante_in) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "CalculAidePersonnaliseeLogementAccessionProprieteIn(mensualite_principale_in={},ressources_menage_arrondies_in={},nombre_personnes_a_charge_in={},situation_familiale_calcul_apl_in={},type_travaux_logement_in={},date_signature_pret_in={},local_habite_premiere_fois_beneficiaire_in={},date_entree_logement_in={},copropriete_in={},situation_r822_11_13_17_in={},zone_in={},type_pret_in={},anciennete_logement_in={},date_courante_in={})".format(self.mensualite_principale_in, + self.ressources_menage_arrondies_in, + self.nombre_personnes_a_charge_in, + self.situation_familiale_calcul_apl_in, + self.type_travaux_logement_in, self.date_signature_pret_in, + self.local_habite_premiere_fois_beneficiaire_in, + self.date_entree_logement_in, self.copropriete_in, + self.situation_r822_11_13_17_in, self.zone_in, self.type_pret_in, + self.anciennete_logement_in, self.date_courante_in) + +class CalculAidePersonnaliseeLogementOut: + def __init__(self, aide_finale_formule_out: Money, traitement_aide_finale_out: Callable[[Money], Money]) -> None: + self.aide_finale_formule_out = aide_finale_formule_out + self.traitement_aide_finale_out = traitement_aide_finale_out + + def __eq__(self, other: object) -> bool: + if isinstance(other, CalculAidePersonnaliseeLogementOut): + return (self.aide_finale_formule_out == other.aide_finale_formule_out and + self.traitement_aide_finale_out == other.traitement_aide_finale_out) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "CalculAidePersonnaliseeLogementOut(aide_finale_formule_out={},traitement_aide_finale_out={})".format(self.aide_finale_formule_out, + self.traitement_aide_finale_out) + +class CalculAidePersonnaliseeLogementIn: + def __init__(self, mode_occupation_in: ModeOccupation, type_aide_in: TypeAidesPersonnelleLogement, informations_calcul_in: InformationsCalculAPL, ressources_menage_sans_arrondi_in: Money, situation_familiale_in: SituationFamiliale, nombre_personnes_a_charge_in: Integer, zone_in: ZoneDHabitation, date_courante_in: Date) -> None: + self.mode_occupation_in = mode_occupation_in + self.type_aide_in = type_aide_in + self.informations_calcul_in = informations_calcul_in + self.ressources_menage_sans_arrondi_in = ressources_menage_sans_arrondi_in + self.situation_familiale_in = situation_familiale_in + self.nombre_personnes_a_charge_in = nombre_personnes_a_charge_in + self.zone_in = zone_in + self.date_courante_in = date_courante_in + + def __eq__(self, other: object) -> bool: + if isinstance(other, CalculAidePersonnaliseeLogementIn): + return (self.mode_occupation_in == other.mode_occupation_in and + self.type_aide_in == other.type_aide_in and + self.informations_calcul_in == other.informations_calcul_in and + self.ressources_menage_sans_arrondi_in == other.ressources_menage_sans_arrondi_in and + self.situation_familiale_in == other.situation_familiale_in and + self.nombre_personnes_a_charge_in == other.nombre_personnes_a_charge_in and + self.zone_in == other.zone_in and + self.date_courante_in == other.date_courante_in) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "CalculAidePersonnaliseeLogementIn(mode_occupation_in={},type_aide_in={},informations_calcul_in={},ressources_menage_sans_arrondi_in={},situation_familiale_in={},nombre_personnes_a_charge_in={},zone_in={},date_courante_in={})".format(self.mode_occupation_in, + self.type_aide_in, self.informations_calcul_in, + self.ressources_menage_sans_arrondi_in, + self.situation_familiale_in, self.nombre_personnes_a_charge_in, + self.zone_in, self.date_courante_in) + +class CalculAllocationLogementLocatifOut: + def __init__(self, aide_finale_formule_out: Money, traitement_aide_finale_out: Callable[[Money], Money]) -> None: + self.aide_finale_formule_out = aide_finale_formule_out + self.traitement_aide_finale_out = traitement_aide_finale_out + + def __eq__(self, other: object) -> bool: + if isinstance(other, CalculAllocationLogementLocatifOut): + return (self.aide_finale_formule_out == other.aide_finale_formule_out and + self.traitement_aide_finale_out == other.traitement_aide_finale_out) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "CalculAllocationLogementLocatifOut(aide_finale_formule_out={},traitement_aide_finale_out={})".format(self.aide_finale_formule_out, + self.traitement_aide_finale_out) + +class CalculAllocationLogementLocatifIn: + def __init__(self, loyer_principal_in: Money, ressources_menage_arrondies_in: Money, beneficiaire_aide_adulte_ou_enfant_handicapes_in: bool, date_courante_in: Date, nombre_personnes_a_charge_in: Integer, situation_familiale_calcul_apl_in: SituationFamilialeCalculAPL, zone_in: ZoneDHabitation, logement_est_chambre_in: bool, agees_ou_handicap_adultes_hebergees_onereux_particuliers_in: bool, type_aide_in: TypeAidesPersonnelleLogement, colocation_in: bool, reduction_loyer_solidarite_in: Money, logement_meuble_d842_2_in: bool, changement_logement_d842_4_in: ChangementLogementD8424) -> None: + self.loyer_principal_in = loyer_principal_in + self.ressources_menage_arrondies_in = ressources_menage_arrondies_in + self.beneficiaire_aide_adulte_ou_enfant_handicapes_in = beneficiaire_aide_adulte_ou_enfant_handicapes_in + self.date_courante_in = date_courante_in + self.nombre_personnes_a_charge_in = nombre_personnes_a_charge_in + self.situation_familiale_calcul_apl_in = situation_familiale_calcul_apl_in + self.zone_in = zone_in + self.logement_est_chambre_in = logement_est_chambre_in + self.agees_ou_handicap_adultes_hebergees_onereux_particuliers_in = agees_ou_handicap_adultes_hebergees_onereux_particuliers_in + self.type_aide_in = type_aide_in + self.colocation_in = colocation_in + self.reduction_loyer_solidarite_in = reduction_loyer_solidarite_in + self.logement_meuble_d842_2_in = logement_meuble_d842_2_in + self.changement_logement_d842_4_in = changement_logement_d842_4_in + + def __eq__(self, other: object) -> bool: + if isinstance(other, CalculAllocationLogementLocatifIn): + return (self.loyer_principal_in == other.loyer_principal_in and + self.ressources_menage_arrondies_in == other.ressources_menage_arrondies_in and + self.beneficiaire_aide_adulte_ou_enfant_handicapes_in == other.beneficiaire_aide_adulte_ou_enfant_handicapes_in and + self.date_courante_in == other.date_courante_in and + self.nombre_personnes_a_charge_in == other.nombre_personnes_a_charge_in and + self.situation_familiale_calcul_apl_in == other.situation_familiale_calcul_apl_in and + self.zone_in == other.zone_in and + self.logement_est_chambre_in == other.logement_est_chambre_in and + self.agees_ou_handicap_adultes_hebergees_onereux_particuliers_in == other.agees_ou_handicap_adultes_hebergees_onereux_particuliers_in and + self.type_aide_in == other.type_aide_in and + self.colocation_in == other.colocation_in and + self.reduction_loyer_solidarite_in == other.reduction_loyer_solidarite_in and + self.logement_meuble_d842_2_in == other.logement_meuble_d842_2_in and + self.changement_logement_d842_4_in == other.changement_logement_d842_4_in) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "CalculAllocationLogementLocatifIn(loyer_principal_in={},ressources_menage_arrondies_in={},beneficiaire_aide_adulte_ou_enfant_handicapes_in={},date_courante_in={},nombre_personnes_a_charge_in={},situation_familiale_calcul_apl_in={},zone_in={},logement_est_chambre_in={},agees_ou_handicap_adultes_hebergees_onereux_particuliers_in={},type_aide_in={},colocation_in={},reduction_loyer_solidarite_in={},logement_meuble_d842_2_in={},changement_logement_d842_4_in={})".format(self.loyer_principal_in, + self.ressources_menage_arrondies_in, + self.beneficiaire_aide_adulte_ou_enfant_handicapes_in, + self.date_courante_in, self.nombre_personnes_a_charge_in, + self.situation_familiale_calcul_apl_in, self.zone_in, + self.logement_est_chambre_in, + self.agees_ou_handicap_adultes_hebergees_onereux_particuliers_in, + self.type_aide_in, self.colocation_in, + self.reduction_loyer_solidarite_in, + self.logement_meuble_d842_2_in, + self.changement_logement_d842_4_in) + +class CalculAllocationLogementAccessionProprieteOut: + def __init__(self, aide_finale_formule_out: Money, traitement_aide_finale_montant_minimal_out: Callable[[Money], Money]) -> None: + self.aide_finale_formule_out = aide_finale_formule_out + self.traitement_aide_finale_montant_minimal_out = traitement_aide_finale_montant_minimal_out + + def __eq__(self, other: object) -> bool: + if isinstance(other, CalculAllocationLogementAccessionProprieteOut): + return (self.aide_finale_formule_out == other.aide_finale_formule_out and + self.traitement_aide_finale_montant_minimal_out == other.traitement_aide_finale_montant_minimal_out) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "CalculAllocationLogementAccessionProprieteOut(aide_finale_formule_out={},traitement_aide_finale_montant_minimal_out={})".format(self.aide_finale_formule_out, + self.traitement_aide_finale_montant_minimal_out) + +class CalculAllocationLogementAccessionProprieteIn: + def __init__(self, ressources_menage_arrondies_base_in: Money, nombre_personnes_a_charge_in: Integer, situation_familiale_calcul_apl_in: SituationFamilialeCalculAPL, zone_in: ZoneDHabitation, date_courante_in: Date, mensualite_principale_in: Money, situation_r822_11_13_17_in: bool, date_signature_pret_in: Date, type_travaux_logement_in: TypeTravauxLogementR8425, local_habite_premiere_fois_beneficiaire_in: bool, date_entree_logement_in: Date, charges_mensuelles_pret_in: Money, copropriete_in: bool) -> None: + self.ressources_menage_arrondies_base_in = ressources_menage_arrondies_base_in + self.nombre_personnes_a_charge_in = nombre_personnes_a_charge_in + self.situation_familiale_calcul_apl_in = situation_familiale_calcul_apl_in + self.zone_in = zone_in + self.date_courante_in = date_courante_in + self.mensualite_principale_in = mensualite_principale_in + self.situation_r822_11_13_17_in = situation_r822_11_13_17_in + self.date_signature_pret_in = date_signature_pret_in + self.type_travaux_logement_in = type_travaux_logement_in + self.local_habite_premiere_fois_beneficiaire_in = local_habite_premiere_fois_beneficiaire_in + self.date_entree_logement_in = date_entree_logement_in + self.charges_mensuelles_pret_in = charges_mensuelles_pret_in + self.copropriete_in = copropriete_in + + def __eq__(self, other: object) -> bool: + if isinstance(other, CalculAllocationLogementAccessionProprieteIn): + return (self.ressources_menage_arrondies_base_in == other.ressources_menage_arrondies_base_in and + self.nombre_personnes_a_charge_in == other.nombre_personnes_a_charge_in and + self.situation_familiale_calcul_apl_in == other.situation_familiale_calcul_apl_in and + self.zone_in == other.zone_in and + self.date_courante_in == other.date_courante_in and + self.mensualite_principale_in == other.mensualite_principale_in and + self.situation_r822_11_13_17_in == other.situation_r822_11_13_17_in and + self.date_signature_pret_in == other.date_signature_pret_in and + self.type_travaux_logement_in == other.type_travaux_logement_in and + self.local_habite_premiere_fois_beneficiaire_in == other.local_habite_premiere_fois_beneficiaire_in and + self.date_entree_logement_in == other.date_entree_logement_in and + self.charges_mensuelles_pret_in == other.charges_mensuelles_pret_in and + self.copropriete_in == other.copropriete_in) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "CalculAllocationLogementAccessionProprieteIn(ressources_menage_arrondies_base_in={},nombre_personnes_a_charge_in={},situation_familiale_calcul_apl_in={},zone_in={},date_courante_in={},mensualite_principale_in={},situation_r822_11_13_17_in={},date_signature_pret_in={},type_travaux_logement_in={},local_habite_premiere_fois_beneficiaire_in={},date_entree_logement_in={},charges_mensuelles_pret_in={},copropriete_in={})".format(self.ressources_menage_arrondies_base_in, + self.nombre_personnes_a_charge_in, + self.situation_familiale_calcul_apl_in, self.zone_in, + self.date_courante_in, self.mensualite_principale_in, + self.situation_r822_11_13_17_in, self.date_signature_pret_in, + self.type_travaux_logement_in, + self.local_habite_premiere_fois_beneficiaire_in, + self.date_entree_logement_in, self.charges_mensuelles_pret_in, + self.copropriete_in) + +class CalculAllocationLogementFoyerOut: + def __init__(self, coefficient_prise_en_charge_out: Decimal, equivalence_loyer_out: Money, montant_forfaitaire_charges_out: Money, loyer_minimal_out: Money, aide_finale_formule_out: Money, traitement_aide_finale_montant_minimal_out: Callable[[Money], Money]) -> None: + self.coefficient_prise_en_charge_out = coefficient_prise_en_charge_out + self.equivalence_loyer_out = equivalence_loyer_out + self.montant_forfaitaire_charges_out = montant_forfaitaire_charges_out + self.loyer_minimal_out = loyer_minimal_out + self.aide_finale_formule_out = aide_finale_formule_out + self.traitement_aide_finale_montant_minimal_out = traitement_aide_finale_montant_minimal_out + + def __eq__(self, other: object) -> bool: + if isinstance(other, CalculAllocationLogementFoyerOut): + return (self.coefficient_prise_en_charge_out == other.coefficient_prise_en_charge_out and + self.equivalence_loyer_out == other.equivalence_loyer_out and + self.montant_forfaitaire_charges_out == other.montant_forfaitaire_charges_out and + self.loyer_minimal_out == other.loyer_minimal_out and + self.aide_finale_formule_out == other.aide_finale_formule_out and + self.traitement_aide_finale_montant_minimal_out == other.traitement_aide_finale_montant_minimal_out) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "CalculAllocationLogementFoyerOut(coefficient_prise_en_charge_out={},equivalence_loyer_out={},montant_forfaitaire_charges_out={},loyer_minimal_out={},aide_finale_formule_out={},traitement_aide_finale_montant_minimal_out={})".format(self.coefficient_prise_en_charge_out, + self.equivalence_loyer_out, self.montant_forfaitaire_charges_out, + self.loyer_minimal_out, self.aide_finale_formule_out, + self.traitement_aide_finale_montant_minimal_out) + +class CalculAllocationLogementFoyerIn: + def __init__(self, redevance_in: Money, mode_occupation_in: ModeOccupation, ressources_menage_arrondies_in: Money, nombre_personnes_a_charge_in: Integer, situation_familiale_calcul_apl_in: SituationFamilialeCalculAPL, zone_in: ZoneDHabitation, date_courante_in: Date, categorie_equivalence_loyer_d842_16_in: CategorieEquivalenceLoyerAllocationLogementFoyer) -> None: + self.redevance_in = redevance_in + self.mode_occupation_in = mode_occupation_in + self.ressources_menage_arrondies_in = ressources_menage_arrondies_in + self.nombre_personnes_a_charge_in = nombre_personnes_a_charge_in + self.situation_familiale_calcul_apl_in = situation_familiale_calcul_apl_in + self.zone_in = zone_in + self.date_courante_in = date_courante_in + self.categorie_equivalence_loyer_d842_16_in = categorie_equivalence_loyer_d842_16_in + + def __eq__(self, other: object) -> bool: + if isinstance(other, CalculAllocationLogementFoyerIn): + return (self.redevance_in == other.redevance_in and + self.mode_occupation_in == other.mode_occupation_in and + self.ressources_menage_arrondies_in == other.ressources_menage_arrondies_in and + self.nombre_personnes_a_charge_in == other.nombre_personnes_a_charge_in and + self.situation_familiale_calcul_apl_in == other.situation_familiale_calcul_apl_in and + self.zone_in == other.zone_in and + self.date_courante_in == other.date_courante_in and + self.categorie_equivalence_loyer_d842_16_in == other.categorie_equivalence_loyer_d842_16_in) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "CalculAllocationLogementFoyerIn(redevance_in={},mode_occupation_in={},ressources_menage_arrondies_in={},nombre_personnes_a_charge_in={},situation_familiale_calcul_apl_in={},zone_in={},date_courante_in={},categorie_equivalence_loyer_d842_16_in={})".format(self.redevance_in, + self.mode_occupation_in, self.ressources_menage_arrondies_in, + self.nombre_personnes_a_charge_in, + self.situation_familiale_calcul_apl_in, self.zone_in, + self.date_courante_in, + self.categorie_equivalence_loyer_d842_16_in) + +class CalculAllocationLogementOut: + def __init__(self, aide_finale_formule_out: Money, traitement_aide_finale_out: Callable[[Money], Money]) -> None: + self.aide_finale_formule_out = aide_finale_formule_out + self.traitement_aide_finale_out = traitement_aide_finale_out + + def __eq__(self, other: object) -> bool: + if isinstance(other, CalculAllocationLogementOut): + return (self.aide_finale_formule_out == other.aide_finale_formule_out and + self.traitement_aide_finale_out == other.traitement_aide_finale_out) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "CalculAllocationLogementOut(aide_finale_formule_out={},traitement_aide_finale_out={})".format(self.aide_finale_formule_out, + self.traitement_aide_finale_out) + +class CalculAllocationLogementIn: + def __init__(self, mode_occupation_in: ModeOccupation, informations_calcul_in: InformationsCalculAPL, ressources_menage_sans_arrondi_in: Money, situation_familiale_in: SituationFamiliale, nombre_personnes_a_charge_in: Integer, zone_in: ZoneDHabitation, date_courante_in: Date, type_aide_in: TypeAidesPersonnelleLogement) -> None: + self.mode_occupation_in = mode_occupation_in + self.informations_calcul_in = informations_calcul_in + self.ressources_menage_sans_arrondi_in = ressources_menage_sans_arrondi_in + self.situation_familiale_in = situation_familiale_in + self.nombre_personnes_a_charge_in = nombre_personnes_a_charge_in + self.zone_in = zone_in + self.date_courante_in = date_courante_in + self.type_aide_in = type_aide_in + + def __eq__(self, other: object) -> bool: + if isinstance(other, CalculAllocationLogementIn): + return (self.mode_occupation_in == other.mode_occupation_in and + self.informations_calcul_in == other.informations_calcul_in and + self.ressources_menage_sans_arrondi_in == other.ressources_menage_sans_arrondi_in and + self.situation_familiale_in == other.situation_familiale_in and + self.nombre_personnes_a_charge_in == other.nombre_personnes_a_charge_in and + self.zone_in == other.zone_in and + self.date_courante_in == other.date_courante_in and + self.type_aide_in == other.type_aide_in) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "CalculAllocationLogementIn(mode_occupation_in={},informations_calcul_in={},ressources_menage_sans_arrondi_in={},situation_familiale_in={},nombre_personnes_a_charge_in={},zone_in={},date_courante_in={},type_aide_in={})".format(self.mode_occupation_in, + self.informations_calcul_in, + self.ressources_menage_sans_arrondi_in, + self.situation_familiale_in, self.nombre_personnes_a_charge_in, + self.zone_in, self.date_courante_in, self.type_aide_in) + +class OuvertureDroitsRetraiteOut: + def __init__(self, age_ouverture_droit_out: Duration) -> None: + self.age_ouverture_droit_out = age_ouverture_droit_out + + def __eq__(self, other: object) -> bool: + if isinstance(other, OuvertureDroitsRetraiteOut): + return (self.age_ouverture_droit_out == other.age_ouverture_droit_out) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "OuvertureDroitsRetraiteOut(age_ouverture_droit_out={})".format(self.age_ouverture_droit_out) + +class OuvertureDroitsRetraiteIn: + def __init__(self, date_naissance_assure_in: Date) -> None: + self.date_naissance_assure_in = date_naissance_assure_in + + def __eq__(self, other: object) -> bool: + if isinstance(other, OuvertureDroitsRetraiteIn): + return (self.date_naissance_assure_in == other.date_naissance_assure_in) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "OuvertureDroitsRetraiteIn(date_naissance_assure_in={})".format(self.date_naissance_assure_in) + +class ImpayeDepenseLogementOut: + def __init__(self, montant_impaye_out: Money) -> None: + self.montant_impaye_out = montant_impaye_out + + def __eq__(self, other: object) -> bool: + if isinstance(other, ImpayeDepenseLogementOut): + return (self.montant_impaye_out == other.montant_impaye_out) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "ImpayeDepenseLogementOut(montant_impaye_out={})".format(self.montant_impaye_out) + +class ImpayeDepenseLogementIn: + def __init__(self, mode_occupation_in: ModeOccupation, aide_versee_in: VersementA, montant_apl_in: Money, montant_charges_in: Money, depense_logement_in: DepenseLogement, montant_dette_in: Money) -> None: + self.mode_occupation_in = mode_occupation_in + self.aide_versee_in = aide_versee_in + self.montant_apl_in = montant_apl_in + self.montant_charges_in = montant_charges_in + self.depense_logement_in = depense_logement_in + self.montant_dette_in = montant_dette_in + + def __eq__(self, other: object) -> bool: + if isinstance(other, ImpayeDepenseLogementIn): + return (self.mode_occupation_in == other.mode_occupation_in and + self.aide_versee_in == other.aide_versee_in and + self.montant_apl_in == other.montant_apl_in and + self.montant_charges_in == other.montant_charges_in and + self.depense_logement_in == other.depense_logement_in and + self.montant_dette_in == other.montant_dette_in) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "ImpayeDepenseLogementIn(mode_occupation_in={},aide_versee_in={},montant_apl_in={},montant_charges_in={},depense_logement_in={},montant_dette_in={})".format(self.mode_occupation_in, + self.aide_versee_in, self.montant_apl_in, + self.montant_charges_in, self.depense_logement_in, + self.montant_dette_in) + +class CalculetteAidesAuLogementOut: + def __init__(self, eligibilite_out: bool, aide_finale_formule_out: Money, traitement_aide_finale_out: Callable[[Money], Money], coefficents_enfants_garde_alternee_pris_en_compte_out: List[Decimal]) -> None: + self.eligibilite_out = eligibilite_out + self.aide_finale_formule_out = aide_finale_formule_out + self.traitement_aide_finale_out = traitement_aide_finale_out + self.coefficents_enfants_garde_alternee_pris_en_compte_out = coefficents_enfants_garde_alternee_pris_en_compte_out + + def __eq__(self, other: object) -> bool: + if isinstance(other, CalculetteAidesAuLogementOut): + return (self.eligibilite_out == other.eligibilite_out and + self.aide_finale_formule_out == other.aide_finale_formule_out and + self.traitement_aide_finale_out == other.traitement_aide_finale_out and + self.coefficents_enfants_garde_alternee_pris_en_compte_out == other.coefficents_enfants_garde_alternee_pris_en_compte_out) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "CalculetteAidesAuLogementOut(eligibilite_out={},aide_finale_formule_out={},traitement_aide_finale_out={},coefficents_enfants_garde_alternee_pris_en_compte_out={})".format(self.eligibilite_out, + self.aide_finale_formule_out, self.traitement_aide_finale_out, + self.coefficents_enfants_garde_alternee_pris_en_compte_out) + +class CalculetteAidesAuLogementIn: + def __init__(self, menage_in: Menage, demandeur_in: Demandeur, informations_calcul_in: InformationsCalculAPL, date_courante_in: Date, ressources_menage_prises_en_compte_in: Money) -> None: + self.menage_in = menage_in + self.demandeur_in = demandeur_in + self.informations_calcul_in = informations_calcul_in + self.date_courante_in = date_courante_in + self.ressources_menage_prises_en_compte_in = ressources_menage_prises_en_compte_in + + def __eq__(self, other: object) -> bool: + if isinstance(other, CalculetteAidesAuLogementIn): + return (self.menage_in == other.menage_in and + self.demandeur_in == other.demandeur_in and + self.informations_calcul_in == other.informations_calcul_in and + self.date_courante_in == other.date_courante_in and + self.ressources_menage_prises_en_compte_in == other.ressources_menage_prises_en_compte_in) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "CalculetteAidesAuLogementIn(menage_in={},demandeur_in={},informations_calcul_in={},date_courante_in={},ressources_menage_prises_en_compte_in={})".format(self.menage_in, + self.demandeur_in, self.informations_calcul_in, + self.date_courante_in, + self.ressources_menage_prises_en_compte_in) + +class CalculetteAidesAuLogementGardeAlterneeOut: + def __init__(self, eligibilite_out: bool, aide_finale_out: Money) -> None: + self.eligibilite_out = eligibilite_out + self.aide_finale_out = aide_finale_out + + def __eq__(self, other: object) -> bool: + if isinstance(other, CalculetteAidesAuLogementGardeAlterneeOut): + return (self.eligibilite_out == other.eligibilite_out and + self.aide_finale_out == other.aide_finale_out) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "CalculetteAidesAuLogementGardeAlterneeOut(eligibilite_out={},aide_finale_out={})".format(self.eligibilite_out, + self.aide_finale_out) + +class CalculetteAidesAuLogementGardeAlterneeIn: + def __init__(self, menage_in: Menage, demandeur_in: Demandeur, informations_calcul_in: InformationsCalculAPL, date_courante_in: Date, ressources_menage_prises_en_compte_in: Money) -> None: + self.menage_in = menage_in + self.demandeur_in = demandeur_in + self.informations_calcul_in = informations_calcul_in + self.date_courante_in = date_courante_in + self.ressources_menage_prises_en_compte_in = ressources_menage_prises_en_compte_in + + def __eq__(self, other: object) -> bool: + if isinstance(other, CalculetteAidesAuLogementGardeAlterneeIn): + return (self.menage_in == other.menage_in and + self.demandeur_in == other.demandeur_in and + self.informations_calcul_in == other.informations_calcul_in and + self.date_courante_in == other.date_courante_in and + self.ressources_menage_prises_en_compte_in == other.ressources_menage_prises_en_compte_in) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "CalculetteAidesAuLogementGardeAlterneeIn(menage_in={},demandeur_in={},informations_calcul_in={},date_courante_in={},ressources_menage_prises_en_compte_in={})".format(self.menage_in, + self.demandeur_in, self.informations_calcul_in, + self.date_courante_in, + self.ressources_menage_prises_en_compte_in) + +class BaseMensuelleAllocationsFamilialesOut: + def __init__(self, montant_out: Money) -> None: + self.montant_out = montant_out + + def __eq__(self, other: object) -> bool: + if isinstance(other, BaseMensuelleAllocationsFamilialesOut): + return (self.montant_out == other.montant_out) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "BaseMensuelleAllocationsFamilialesOut(montant_out={})".format(self.montant_out) + +class BaseMensuelleAllocationsFamilialesIn: + def __init__(self, date_courante_in: Date) -> None: + self.date_courante_in = date_courante_in + + def __eq__(self, other: object) -> bool: + if isinstance(other, BaseMensuelleAllocationsFamilialesIn): + return (self.date_courante_in == other.date_courante_in) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "BaseMensuelleAllocationsFamilialesIn(date_courante_in={})".format(self.date_courante_in) + +class SmicOut: + def __init__(self, brut_horaire_out: Money) -> None: + self.brut_horaire_out = brut_horaire_out + + def __eq__(self, other: object) -> bool: + if isinstance(other, SmicOut): + return (self.brut_horaire_out == other.brut_horaire_out) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "SmicOut(brut_horaire_out={})".format(self.brut_horaire_out) + +class SmicIn: + def __init__(self, date_courante_in: Date, residence_in: Collectivite) -> None: + self.date_courante_in = date_courante_in + self.residence_in = residence_in + + def __eq__(self, other: object) -> bool: + if isinstance(other, SmicIn): + return (self.date_courante_in == other.date_courante_in and + self.residence_in == other.residence_in) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "SmicIn(date_courante_in={},residence_in={})".format(self.date_courante_in, + self.residence_in) + +class EligibilitePrestationsFamilialesOut: + def __init__(self, droit_ouvert_out: Callable[[EnfantPrestationsFamiliales], bool], conditions_hors_age_out: Callable[[EnfantPrestationsFamiliales], bool], age_l512_3_2_out: Integer, regime_outre_mer_l751_1_out: bool) -> None: + self.droit_ouvert_out = droit_ouvert_out + self.conditions_hors_age_out = conditions_hors_age_out + self.age_l512_3_2_out = age_l512_3_2_out + self.regime_outre_mer_l751_1_out = regime_outre_mer_l751_1_out + + def __eq__(self, other: object) -> bool: + if isinstance(other, EligibilitePrestationsFamilialesOut): + return (self.droit_ouvert_out == other.droit_ouvert_out and + self.conditions_hors_age_out == other.conditions_hors_age_out and + self.age_l512_3_2_out == other.age_l512_3_2_out and + self.regime_outre_mer_l751_1_out == other.regime_outre_mer_l751_1_out) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "EligibilitePrestationsFamilialesOut(droit_ouvert_out={},conditions_hors_age_out={},age_l512_3_2_out={},regime_outre_mer_l751_1_out={})".format(self.droit_ouvert_out, + self.conditions_hors_age_out, self.age_l512_3_2_out, + self.regime_outre_mer_l751_1_out) + +class EligibilitePrestationsFamilialesIn: + def __init__(self, date_courante_in: Date, prestation_courante_in: ElementPrestationsFamiliales, residence_in: Collectivite) -> None: + self.date_courante_in = date_courante_in + self.prestation_courante_in = prestation_courante_in + self.residence_in = residence_in + + def __eq__(self, other: object) -> bool: + if isinstance(other, EligibilitePrestationsFamilialesIn): + return (self.date_courante_in == other.date_courante_in and + self.prestation_courante_in == other.prestation_courante_in and + self.residence_in == other.residence_in) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "EligibilitePrestationsFamilialesIn(date_courante_in={},prestation_courante_in={},residence_in={})".format(self.date_courante_in, + self.prestation_courante_in, self.residence_in) + + + +def contributions_sociales_aides_personnelle_logement(contributions_sociales_aides_personnelle_logement_in:ContributionsSocialesAidesPersonnelleLogementIn): + date_courante = contributions_sociales_aides_personnelle_logement_in.date_courante_in + try: + temp_exonere_csg = True + except EmptyError: + temp_exonere_csg = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=547, start_column=11, + end_line=547, end_column=22, + law_headings=["Calcul des contributions sociales s'appliquant aux aides personnelles au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + exonere_csg = temp_exonere_csg + try: + if (date_courante >= + date_of_numbers(2020,1,1)): + temp_taux_crds = decimal_of_string("0.005") + else: + temp_taux_crds = dead_value + raise EmptyError + except EmptyError: + temp_taux_crds = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=546, start_column=11, + end_line=546, end_column=20, + law_headings=["Calcul des contributions sociales s'appliquant aux aides personnelles au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + taux_crds = temp_taux_crds + try: + def temp_montant(param:Money): + try: + if (date_courante >= + date_of_numbers(2018,9,1)): + return (param * taux_crds) + else: + raise EmptyError + except EmptyError: + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=549, + start_column=10, + end_line=549, + end_column=17, + law_headings=["Calcul des contributions sociales s'appliquant aux aides personnelles au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + except EmptyError: + temp_montant = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=549, start_column=10, + end_line=549, end_column=17, + law_headings=["Calcul des contributions sociales s'appliquant aux aides personnelles au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + montant = temp_montant + try: + temp__ = exonere_csg + except EmptyError: + temp__ = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/autres_sources.catala_fr", + start_line=104, start_column=13, + end_line=104, end_column=24, + law_headings=["Article 14", + "Chapitre II : Des contributions pour le remboursement de la dette sociale.", + "Ordonnance n° 96-50 du 24 janvier 1996 relative au remboursement de la dette sociale"])) + if not (temp__): + raise AssertionFailure(SourcePosition(filename="examples/aides_logement/autres_sources.catala_fr", + start_line=104, + start_column=13, end_line=104, + end_column=24, + law_headings=["Article 14", + "Chapitre II : Des contributions pour le remboursement de la dette sociale.", + "Ordonnance n° 96-50 du 24 janvier 1996 relative au remboursement de la dette sociale"])) + return ContributionsSocialesAidesPersonnelleLogementOut(montant_out = montant) + +def calcul_equivalence_loyer_minimale(calcul_equivalence_loyer_minimale_in:CalculEquivalenceLoyerMinimaleIn): + ressources_menage_arrondies = calcul_equivalence_loyer_minimale_in.ressources_menage_arrondies_in + condition_2_du_832_25 = calcul_equivalence_loyer_minimale_in.condition_2_du_832_25_in + n_nombre_parts_d832_25 = calcul_equivalence_loyer_minimale_in.n_nombre_parts_d832_25_in + try: + if condition_2_du_832_25: + temp_montant_forfaitaire_d832_26 = money_of_cents_string("7632") + else: + temp_montant_forfaitaire_d832_26 = money_of_cents_string("4557") + except EmptyError: + temp_montant_forfaitaire_d832_26 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=620, start_column=11, + end_line=620, end_column=38, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + montant_forfaitaire_d832_26 = temp_montant_forfaitaire_d832_26 + try: + try: + if condition_2_du_832_25: + temp_tranches_revenus_d832_26 = [TrancheRevenu(haut = LimiteTranche(LimiteTranche_Code.Revenu, + money_of_cents_string("142303")), + bas = money_of_cents_string("0"), + taux = decimal_of_string("0.")), + TrancheRevenu(haut = LimiteTranche(LimiteTranche_Code.Revenu, + money_of_cents_string("204761")), + bas = money_of_cents_string("142303"), + taux = decimal_of_string("0.024")), + TrancheRevenu(haut = LimiteTranche(LimiteTranche_Code.Revenu, + money_of_cents_string("262985")), + bas = money_of_cents_string("204761"), + taux = decimal_of_string("0.208")), + TrancheRevenu(haut = LimiteTranche(LimiteTranche_Code.Revenu, + money_of_cents_string("409505")), + bas = money_of_cents_string("262985"), + taux = decimal_of_string("0.232")), + TrancheRevenu(haut = LimiteTranche(LimiteTranche_Code.Infini, + Unit()), bas = money_of_cents_string("409505"), + taux = decimal_of_string("0.328"))] + else: + temp_tranches_revenus_d832_26 = dead_value + raise EmptyError + except EmptyError: + temp_tranches_revenus_d832_26 = [TrancheRevenu(haut = LimiteTranche(LimiteTranche_Code.Revenu, + money_of_cents_string("194810")), + bas = money_of_cents_string("0"), + taux = decimal_of_string("0.04")), + TrancheRevenu(haut = LimiteTranche(LimiteTranche_Code.Revenu, + money_of_cents_string("267871")), + bas = money_of_cents_string("194810"), + taux = decimal_of_string("0.104")), + TrancheRevenu(haut = LimiteTranche(LimiteTranche_Code.Revenu, + money_of_cents_string("389618")), + bas = money_of_cents_string("267871"), + taux = decimal_of_string("0.216")), + TrancheRevenu(haut = LimiteTranche(LimiteTranche_Code.Revenu, + money_of_cents_string("535744")), + bas = money_of_cents_string("389618"), + taux = decimal_of_string("0.264")), + TrancheRevenu(haut = LimiteTranche(LimiteTranche_Code.Revenu, + money_of_cents_string("633129")), + bas = money_of_cents_string("535744"), + taux = decimal_of_string("0.32")), + TrancheRevenu(haut = LimiteTranche(LimiteTranche_Code.Infini, + Unit()), bas = money_of_cents_string("633129"), + taux = decimal_of_string("0.48"))] + except EmptyError: + temp_tranches_revenus_d832_26 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=617, start_column=11, + end_line=617, end_column=35, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + tranches_revenus_d832_26 = temp_tranches_revenus_d832_26 + try: + def temp_tranches_revenus_d832_26_multipliees(tranche:Any): + match_arg = tranche.haut + if match_arg.code == LimiteTranche_Code.Revenu: + tranche_haut = match_arg.value + temp_tranches_revenus_d832_26_multipliees_1 = LimiteTrancheDecimal(LimiteTrancheDecimal_Code.Revenu, + (decimal_of_money(tranche_haut) * + n_nombre_parts_d832_25)) + elif match_arg.code == LimiteTranche_Code.Infini: + _ = match_arg.value + temp_tranches_revenus_d832_26_multipliees_1 = LimiteTrancheDecimal(LimiteTrancheDecimal_Code.Infini, + Unit()) + return TrancheRevenuDecimal(haut = temp_tranches_revenus_d832_26_multipliees_1, + bas = (decimal_of_money(tranche.bas) * + n_nombre_parts_d832_25), taux = tranche.taux) + temp_tranches_revenus_d832_26_multipliees_2 = list_map(temp_tranches_revenus_d832_26_multipliees, + tranches_revenus_d832_26) + except EmptyError: + temp_tranches_revenus_d832_26_multipliees_2 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=618, start_column=11, + end_line=618, end_column=47, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + tranches_revenus_d832_26_multipliees = temp_tranches_revenus_d832_26_multipliees_2 + try: + try: + if condition_2_du_832_25: + def temp_montant_1(acc:Decimal, tranche_1:Any): + if (decimal_of_money(ressources_menage_arrondies) <= + tranche_1.bas): + temp_montant_2 = decimal_of_string("0.") + else: + match_arg_1 = tranche_1.haut + if match_arg_1.code == LimiteTrancheDecimal_Code.Revenu: + tranche_haut_1 = match_arg_1.value + if (decimal_of_money(ressources_menage_arrondies) >= + tranche_haut_1): + temp_montant_2 = ((tranche_haut_1 - + tranche_1.bas) * tranche_1.taux) + else: + temp_montant_2 = ((decimal_of_money(ressources_menage_arrondies) - + tranche_1.bas) * tranche_1.taux) + elif match_arg_1.code == LimiteTrancheDecimal_Code.Infini: + _ = match_arg_1.value + temp_montant_2 = ((decimal_of_money(ressources_menage_arrondies) - + tranche_1.bas) * tranche_1.taux) + return (acc + temp_montant_2) + temp_montant_3 = money_of_decimal(((list_fold_left(temp_montant_1, + decimal_of_string("0."), + tranches_revenus_d832_26_multipliees) + + decimal_of_money(montant_forfaitaire_d832_26)) / + decimal_of_string("12."))) + else: + temp_montant_3 = dead_value + raise EmptyError + except EmptyError: + def temp_montant_4(acc_1:Decimal, tranche_2:Any): + if (decimal_of_money(ressources_menage_arrondies) <= + tranche_2.bas): + temp_montant_5 = decimal_of_string("0.") + else: + match_arg_2 = tranche_2.haut + if match_arg_2.code == LimiteTrancheDecimal_Code.Revenu: + tranche_haut_2 = match_arg_2.value + if (decimal_of_money(ressources_menage_arrondies) >= + tranche_haut_2): + temp_montant_5 = ((tranche_haut_2 - + tranche_2.bas) * tranche_2.taux) + else: + temp_montant_5 = ((decimal_of_money(ressources_menage_arrondies) - + tranche_2.bas) * tranche_2.taux) + elif match_arg_2.code == LimiteTrancheDecimal_Code.Infini: + _ = match_arg_2.value + temp_montant_5 = ((decimal_of_money(ressources_menage_arrondies) - + tranche_2.bas) * tranche_2.taux) + return (acc_1 + temp_montant_5) + temp_montant_3 = money_of_decimal(((list_fold_left(temp_montant_4, + decimal_of_string("0."), + tranches_revenus_d832_26_multipliees) + + (decimal_of_money(montant_forfaitaire_d832_26) * + n_nombre_parts_d832_25)) / decimal_of_string("12."))) + except EmptyError: + temp_montant_3 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=622, start_column=10, + end_line=622, end_column=17, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + montant_1 = temp_montant_3 + return CalculEquivalenceLoyerMinimaleOut(montant_out = montant_1) + +def calcul_nombre_part_logement_foyer(calcul_nombre_part_logement_foyer_in:CalculNombrePartLogementFoyerIn): + condition_2_du_832_25_1 = calcul_nombre_part_logement_foyer_in.condition_2_du_832_25_in + nombre_personnes_a_charge = calcul_nombre_part_logement_foyer_in.nombre_personnes_a_charge_in + situation_familiale_calcul_apl = calcul_nombre_part_logement_foyer_in.situation_familiale_calcul_apl_in + try: + try: + if condition_2_du_832_25_1: + if (nombre_personnes_a_charge == + integer_of_string("0")): + match_arg_3 = situation_familiale_calcul_apl + if match_arg_3.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_3.value + temp_n_nombre_parts_d832_25 = decimal_of_string("1.2") + elif match_arg_3.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_3.value + temp_n_nombre_parts_d832_25 = decimal_of_string("1.5") + else: + if (nombre_personnes_a_charge == + integer_of_string("1")): + temp_n_nombre_parts_d832_25 = decimal_of_string("2.5") + else: + if (nombre_personnes_a_charge == + integer_of_string("2")): + temp_n_nombre_parts_d832_25 = decimal_of_string("3.") + else: + if (nombre_personnes_a_charge == + integer_of_string("3")): + temp_n_nombre_parts_d832_25 = decimal_of_string("3.7") + else: + if (nombre_personnes_a_charge == + integer_of_string("4")): + temp_n_nombre_parts_d832_25 = decimal_of_string("4.3") + else: + temp_n_nombre_parts_d832_25 = (decimal_of_string("4.3") + + (decimal_of_string("0.5") * + decimal_of_integer((nombre_personnes_a_charge - + integer_of_string("4"))))) + else: + temp_n_nombre_parts_d832_25 = dead_value + raise EmptyError + except EmptyError: + if (nombre_personnes_a_charge == + integer_of_string("0")): + match_arg_4 = situation_familiale_calcul_apl + if match_arg_4.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_4.value + temp_n_nombre_parts_d832_25 = decimal_of_string("1.4") + elif match_arg_4.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_4.value + temp_n_nombre_parts_d832_25 = decimal_of_string("1.8") + else: + if (nombre_personnes_a_charge == + integer_of_string("1")): + temp_n_nombre_parts_d832_25 = decimal_of_string("2.5") + else: + if (nombre_personnes_a_charge == + integer_of_string("2")): + temp_n_nombre_parts_d832_25 = decimal_of_string("3.") + else: + if (nombre_personnes_a_charge == + integer_of_string("3")): + temp_n_nombre_parts_d832_25 = decimal_of_string("3.7") + else: + if (nombre_personnes_a_charge == + integer_of_string("4")): + temp_n_nombre_parts_d832_25 = decimal_of_string("4.3") + else: + temp_n_nombre_parts_d832_25 = (decimal_of_string("4.3") + + (decimal_of_string("0.5") * + decimal_of_integer((nombre_personnes_a_charge - + integer_of_string("4"))))) + except EmptyError: + temp_n_nombre_parts_d832_25 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=629, start_column=10, + end_line=629, end_column=32, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + n_nombre_parts_d832_25_1 = temp_n_nombre_parts_d832_25 + return CalculNombrePartLogementFoyerOut(n_nombre_parts_d832_25_out = n_nombre_parts_d832_25_1) + +def calcul_nombre_parts_accession_propriete(calcul_nombre_parts_accession_propriete_in:CalculNombrePartsAccessionProprieteIn): + nombre_personnes_a_charge_1 = calcul_nombre_parts_accession_propriete_in.nombre_personnes_a_charge_in + situation_familiale_calcul_apl_1 = calcul_nombre_parts_accession_propriete_in.situation_familiale_calcul_apl_in + try: + if (nombre_personnes_a_charge_1 == + integer_of_string("0")): + match_arg_5 = situation_familiale_calcul_apl_1 + if match_arg_5.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_5.value + temp_n_nombre_parts_d832_11 = decimal_of_string("1.4") + elif match_arg_5.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_5.value + temp_n_nombre_parts_d832_11 = decimal_of_string("1.8") + else: + if (nombre_personnes_a_charge_1 == + integer_of_string("1")): + temp_n_nombre_parts_d832_11 = decimal_of_string("2.5") + else: + if (nombre_personnes_a_charge_1 == + integer_of_string("2")): + temp_n_nombre_parts_d832_11 = decimal_of_string("3.") + else: + if (nombre_personnes_a_charge_1 == + integer_of_string("3")): + temp_n_nombre_parts_d832_11 = decimal_of_string("3.7") + else: + if (nombre_personnes_a_charge_1 == + integer_of_string("4")): + temp_n_nombre_parts_d832_11 = decimal_of_string("4.3") + else: + temp_n_nombre_parts_d832_11 = (decimal_of_string("4.3") + + (decimal_of_string("0.5") * + decimal_of_integer((nombre_personnes_a_charge_1 - + integer_of_string("4"))))) + except EmptyError: + temp_n_nombre_parts_d832_11 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=684, start_column=10, + end_line=684, end_column=32, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + n_nombre_parts_d832_11 = temp_n_nombre_parts_d832_11 + return CalculNombrePartsAccessionProprieteOut(n_nombre_parts_d832_11_out = n_nombre_parts_d832_11) + +def ouverture_droits_retraite(ouverture_droits_retraite_in:OuvertureDroitsRetraiteIn): + date_naissance_assure = ouverture_droits_retraite_in.date_naissance_assure_in + try: + def temp_age_ouverture_droit(_:Any): + raise EmptyError + def temp_age_ouverture_droit_1(_:Any): + return False + def temp_age_ouverture_droit_2(_:Any): + if (year_of_date(date_naissance_assure) == + integer_of_string("1954")): + return (duration_of_numbers(61,0,0) + + duration_of_numbers(0,7,0)) + else: + raise EmptyError + def temp_age_ouverture_droit_3(_:Any): + if (year_of_date(date_naissance_assure) == + integer_of_string("1953")): + return (duration_of_numbers(61,0,0) + + duration_of_numbers(0,2,0)) + else: + raise EmptyError + def temp_age_ouverture_droit_4(_:Any): + if (year_of_date(date_naissance_assure) == + integer_of_string("1952")): + return (duration_of_numbers(60,0,0) + + duration_of_numbers(0,9,0)) + else: + raise EmptyError + def temp_age_ouverture_droit_5(_:Any): + if ((date_naissance_assure >= date_of_numbers(1951,7,1)) and + (date_naissance_assure <= + date_of_numbers(1951,12,31))): + return (duration_of_numbers(60,0,0) + + duration_of_numbers(0,4,0)) + else: + raise EmptyError + def temp_age_ouverture_droit_6(_:Any): + if (date_naissance_assure < + date_of_numbers(1951,7,1)): + return duration_of_numbers(60,0,0) + else: + raise EmptyError + def temp_age_ouverture_droit_7(_:Any): + if (date_naissance_assure >= + date_of_numbers(1955,1,1)): + return duration_of_numbers(62,0,0) + else: + raise EmptyError + temp_age_ouverture_droit_8 = handle_default(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=1033, + start_column=10, + end_line=1033, end_column=29, + law_headings=["Date d'ouverture des droits à la retraite", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"]), [temp_age_ouverture_droit_7, + temp_age_ouverture_droit_6, + temp_age_ouverture_droit_5, + temp_age_ouverture_droit_4, + temp_age_ouverture_droit_3, + temp_age_ouverture_droit_2], + temp_age_ouverture_droit_1, + temp_age_ouverture_droit) + except EmptyError: + temp_age_ouverture_droit_8 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=1033, + start_column=10, end_line=1033, + end_column=29, + law_headings=["Date d'ouverture des droits à la retraite", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + age_ouverture_droit = temp_age_ouverture_droit_8 + return OuvertureDroitsRetraiteOut(age_ouverture_droit_out = age_ouverture_droit) + +def impaye_depense_logement(impaye_depense_logement_in:ImpayeDepenseLogementIn): + mode_occupation = impaye_depense_logement_in.mode_occupation_in + aide_versee = impaye_depense_logement_in.aide_versee_in + montant_apl = impaye_depense_logement_in.montant_apl_in + montant_charges = impaye_depense_logement_in.montant_charges_in + depense_logement = impaye_depense_logement_in.depense_logement_in + montant_dette = impaye_depense_logement_in.montant_dette_in + try: + match_arg_6 = mode_occupation + if match_arg_6.code == ModeOccupation_Code.Locataire: + _ = match_arg_6.value + temp_mode_occupation_impaye = ModeOccupationImpaye(ModeOccupationImpaye_Code.ImpayeLoyer, + Unit()) + elif match_arg_6.code == ModeOccupation_Code.ResidentLogementFoyer: + _ = match_arg_6.value + temp_mode_occupation_impaye = ModeOccupationImpaye(ModeOccupationImpaye_Code.ImpayePret, + Unit()) + elif match_arg_6.code == ModeOccupation_Code.AccessionProprieteLocalUsageExclusifHabitation: + _ = match_arg_6.value + temp_mode_occupation_impaye = ModeOccupationImpaye(ModeOccupationImpaye_Code.ImpayePret, + Unit()) + elif match_arg_6.code == ModeOccupation_Code.SousLocataire: + _ = match_arg_6.value + temp_mode_occupation_impaye = ModeOccupationImpaye(ModeOccupationImpaye_Code.ImpayeLoyer, + Unit()) + elif match_arg_6.code == ModeOccupation_Code.LocationAccession: + _ = match_arg_6.value + temp_mode_occupation_impaye = ModeOccupationImpaye(ModeOccupationImpaye_Code.ImpayeLoyer, + Unit()) + except EmptyError: + temp_mode_occupation_impaye = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=1049, + start_column=11, end_line=1049, + end_column=33, + law_headings=["Quantification des impayés de dépense de logement", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + mode_occupation_impaye = temp_mode_occupation_impaye + try: + try: + match_arg_7 = mode_occupation_impaye + if match_arg_7.code == ModeOccupationImpaye_Code.ImpayeLoyer: + _ = match_arg_7.value + temp_depense_logement_brute = False + elif match_arg_7.code == ModeOccupationImpaye_Code.ImpayePret: + _ = match_arg_7.value + temp_depense_logement_brute = True + if temp_depense_logement_brute: + temp_depense_logement_brute_1 = depense_logement + else: + temp_depense_logement_brute_1 = dead_value + raise EmptyError + except EmptyError: + match_arg_8 = mode_occupation_impaye + if match_arg_8.code == ModeOccupationImpaye_Code.ImpayeLoyer: + _ = match_arg_8.value + temp_depense_logement_brute_2 = True + elif match_arg_8.code == ModeOccupationImpaye_Code.ImpayePret: + _ = match_arg_8.value + temp_depense_logement_brute_2 = False + if temp_depense_logement_brute_2: + temp_depense_logement_brute_1 = depense_logement + else: + temp_depense_logement_brute_1 = dead_value + raise EmptyError + except EmptyError: + temp_depense_logement_brute_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=1050, + start_column=11, end_line=1050, + end_column=33, + law_headings=["Quantification des impayés de dépense de logement", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + depense_logement_brute = temp_depense_logement_brute_1 + try: + def temp_depense_logement_nette(_:Any): + raise EmptyError + def temp_depense_logement_nette_1(_:Any): + return False + def temp_depense_logement_nette_2(_:Any): + match_arg_9 = mode_occupation_impaye + if match_arg_9.code == ModeOccupationImpaye_Code.ImpayeLoyer: + _ = match_arg_9.value + temp_depense_logement_nette_3 = False + elif match_arg_9.code == ModeOccupationImpaye_Code.ImpayePret: + _ = match_arg_9.value + temp_depense_logement_nette_3 = True + if temp_depense_logement_nette_3: + match_arg_10 = depense_logement + if match_arg_10.code == DepenseLogement_Code.TotalAnnuelEcheances: + total_echeances = match_arg_10.value + return DepenseLogement(DepenseLogement_Code.TotalAnnuelEcheances, + (total_echeances - (montant_apl * + decimal_of_string("12.")))) + elif match_arg_10.code == DepenseLogement_Code.Mensualite: + mensualite = match_arg_10.value + return DepenseLogement(DepenseLogement_Code.Mensualite, + (mensualite - montant_apl)) + elif match_arg_10.code == DepenseLogement_Code.Loyer: + loyer = match_arg_10.value + return DepenseLogement(DepenseLogement_Code.Loyer, loyer) + else: + raise EmptyError + def temp_depense_logement_nette_4(_:Any): + match_arg_11 = mode_occupation_impaye + if match_arg_11.code == ModeOccupationImpaye_Code.ImpayeLoyer: + _ = match_arg_11.value + temp_depense_logement_nette_5 = True + elif match_arg_11.code == ModeOccupationImpaye_Code.ImpayePret: + _ = match_arg_11.value + temp_depense_logement_nette_5 = False + if temp_depense_logement_nette_5: + match_arg_12 = depense_logement_brute + if match_arg_12.code == DepenseLogement_Code.TotalAnnuelEcheances: + total = match_arg_12.value + return DepenseLogement(DepenseLogement_Code.TotalAnnuelEcheances, + total) + elif match_arg_12.code == DepenseLogement_Code.Mensualite: + mensualite_1 = match_arg_12.value + return DepenseLogement(DepenseLogement_Code.Mensualite, + mensualite_1) + elif match_arg_12.code == DepenseLogement_Code.Loyer: + montant_loyer = match_arg_12.value + return DepenseLogement(DepenseLogement_Code.Loyer, + (montant_loyer - montant_apl)) + else: + raise EmptyError + temp_depense_logement_nette_6 = handle_default(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=1051, + start_column=11, + end_line=1051, end_column=33, + law_headings=["Quantification des impayés de dépense de logement", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"]), [temp_depense_logement_nette_4, + temp_depense_logement_nette_2], + temp_depense_logement_nette_1, + temp_depense_logement_nette) + except EmptyError: + temp_depense_logement_nette_6 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=1051, + start_column=11, end_line=1051, + end_column=33, + law_headings=["Quantification des impayés de dépense de logement", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + depense_logement_nette = temp_depense_logement_nette_6 + try: + def temp_seuil_impaye_depense_de_logement(_:Any): + raise EmptyError + def temp_seuil_impaye_depense_de_logement_1(_:Any): + return False + def temp_seuil_impaye_depense_de_logement_2(_:Any): + try: + match_arg_13 = aide_versee + if match_arg_13.code == VersementA_Code.Bailleur: + _ = match_arg_13.value + temp_seuil_impaye_depense_de_logement_3 = False + elif match_arg_13.code == VersementA_Code.Beneficiaire: + _ = match_arg_13.value + temp_seuil_impaye_depense_de_logement_3 = False + elif match_arg_13.code == VersementA_Code.EtablissementHabilite: + _ = match_arg_13.value + temp_seuil_impaye_depense_de_logement_3 = True + match_arg_14 = mode_occupation_impaye + if match_arg_14.code == ModeOccupationImpaye_Code.ImpayeLoyer: + _ = match_arg_14.value + temp_seuil_impaye_depense_de_logement_4 = False + elif match_arg_14.code == ModeOccupationImpaye_Code.ImpayePret: + _ = match_arg_14.value + temp_seuil_impaye_depense_de_logement_4 = True + if (temp_seuil_impaye_depense_de_logement_4 and + temp_seuil_impaye_depense_de_logement_3): + match_arg_15 = depense_logement_nette + if match_arg_15.code == DepenseLogement_Code.TotalAnnuelEcheances: + echeance_pret_nette = match_arg_15.value + return (echeance_pret_nette * + (decimal_of_string("1.") / + decimal_of_string("6."))) + elif match_arg_15.code == DepenseLogement_Code.Mensualite: + mensualite_nette = match_arg_15.value + return (mensualite_nette * decimal_of_string("2.")) + elif match_arg_15.code == DepenseLogement_Code.Loyer: + _ = match_arg_15.value + return money_of_cents_string("0") + else: + raise EmptyError + except EmptyError: + match_arg_16 = aide_versee + if match_arg_16.code == VersementA_Code.Bailleur: + _ = match_arg_16.value + temp_seuil_impaye_depense_de_logement_5 = False + elif match_arg_16.code == VersementA_Code.Beneficiaire: + _ = match_arg_16.value + temp_seuil_impaye_depense_de_logement_5 = True + elif match_arg_16.code == VersementA_Code.EtablissementHabilite: + _ = match_arg_16.value + temp_seuil_impaye_depense_de_logement_5 = False + match_arg_17 = mode_occupation_impaye + if match_arg_17.code == ModeOccupationImpaye_Code.ImpayeLoyer: + _ = match_arg_17.value + temp_seuil_impaye_depense_de_logement_6 = False + elif match_arg_17.code == ModeOccupationImpaye_Code.ImpayePret: + _ = match_arg_17.value + temp_seuil_impaye_depense_de_logement_6 = True + if (temp_seuil_impaye_depense_de_logement_6 and + temp_seuil_impaye_depense_de_logement_5): + match_arg_18 = depense_logement_brute + if match_arg_18.code == DepenseLogement_Code.TotalAnnuelEcheances: + echeance_pret_brute = match_arg_18.value + return (echeance_pret_brute * + (decimal_of_string("1.") / + decimal_of_string("6."))) + elif match_arg_18.code == DepenseLogement_Code.Mensualite: + mensualite_brute = match_arg_18.value + return (mensualite_brute * decimal_of_string("2.")) + elif match_arg_18.code == DepenseLogement_Code.Loyer: + _ = match_arg_18.value + return money_of_cents_string("0") + else: + raise EmptyError + def temp_seuil_impaye_depense_de_logement_7(_:Any): + try: + match_arg_19 = aide_versee + if match_arg_19.code == VersementA_Code.Bailleur: + _ = match_arg_19.value + temp_seuil_impaye_depense_de_logement_8 = True + elif match_arg_19.code == VersementA_Code.Beneficiaire: + _ = match_arg_19.value + temp_seuil_impaye_depense_de_logement_8 = False + elif match_arg_19.code == VersementA_Code.EtablissementHabilite: + _ = match_arg_19.value + temp_seuil_impaye_depense_de_logement_8 = False + match_arg_20 = mode_occupation_impaye + if match_arg_20.code == ModeOccupationImpaye_Code.ImpayeLoyer: + _ = match_arg_20.value + temp_seuil_impaye_depense_de_logement_9 = True + elif match_arg_20.code == ModeOccupationImpaye_Code.ImpayePret: + _ = match_arg_20.value + temp_seuil_impaye_depense_de_logement_9 = False + if (temp_seuil_impaye_depense_de_logement_9 and + temp_seuil_impaye_depense_de_logement_8): + match_arg_21 = depense_logement_nette + if match_arg_21.code == DepenseLogement_Code.TotalAnnuelEcheances: + _ = match_arg_21.value + return money_of_cents_string("0") + elif match_arg_21.code == DepenseLogement_Code.Mensualite: + _ = match_arg_21.value + return money_of_cents_string("0") + elif match_arg_21.code == DepenseLogement_Code.Loyer: + loyer_net = match_arg_21.value + return ((loyer_net + montant_charges) * + decimal_of_string("2.")) + else: + raise EmptyError + except EmptyError: + match_arg_22 = aide_versee + if match_arg_22.code == VersementA_Code.Bailleur: + _ = match_arg_22.value + temp_seuil_impaye_depense_de_logement_10 = False + elif match_arg_22.code == VersementA_Code.Beneficiaire: + _ = match_arg_22.value + temp_seuil_impaye_depense_de_logement_10 = True + elif match_arg_22.code == VersementA_Code.EtablissementHabilite: + _ = match_arg_22.value + temp_seuil_impaye_depense_de_logement_10 = False + match_arg_23 = mode_occupation_impaye + if match_arg_23.code == ModeOccupationImpaye_Code.ImpayeLoyer: + _ = match_arg_23.value + temp_seuil_impaye_depense_de_logement_11 = True + elif match_arg_23.code == ModeOccupationImpaye_Code.ImpayePret: + _ = match_arg_23.value + temp_seuil_impaye_depense_de_logement_11 = False + if (temp_seuil_impaye_depense_de_logement_11 and + temp_seuil_impaye_depense_de_logement_10): + match_arg_24 = depense_logement_brute + if match_arg_24.code == DepenseLogement_Code.TotalAnnuelEcheances: + _ = match_arg_24.value + return money_of_cents_string("0") + elif match_arg_24.code == DepenseLogement_Code.Mensualite: + _ = match_arg_24.value + return money_of_cents_string("0") + elif match_arg_24.code == DepenseLogement_Code.Loyer: + loyer_brut = match_arg_24.value + return ((loyer_brut + montant_charges) * + decimal_of_string("2.")) + else: + raise EmptyError + temp_seuil_impaye_depense_de_logement_12 = handle_default(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=1048, + start_column=11, + end_line=1048, end_column=43, + law_headings=["Quantification des impayés de dépense de logement", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"]), [temp_seuil_impaye_depense_de_logement_7, + temp_seuil_impaye_depense_de_logement_2], + temp_seuil_impaye_depense_de_logement_1, + temp_seuil_impaye_depense_de_logement) + except EmptyError: + temp_seuil_impaye_depense_de_logement_12 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=1048, + start_column=11, end_line=1048, + end_column=43, + law_headings=["Quantification des impayés de dépense de logement", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + seuil_impaye_depense_de_logement = temp_seuil_impaye_depense_de_logement_12 + try: + try: + match_arg_25 = mode_occupation_impaye + if match_arg_25.code == ModeOccupationImpaye_Code.ImpayeLoyer: + _ = match_arg_25.value + temp_montant_impaye = False + elif match_arg_25.code == ModeOccupationImpaye_Code.ImpayePret: + _ = match_arg_25.value + temp_montant_impaye = True + if temp_montant_impaye: + if (montant_dette >= + seuil_impaye_depense_de_logement): + temp_montant_impaye_1 = montant_dette + else: + temp_montant_impaye_1 = money_of_cents_string("0") + else: + temp_montant_impaye_1 = dead_value + raise EmptyError + except EmptyError: + match_arg_26 = mode_occupation_impaye + if match_arg_26.code == ModeOccupationImpaye_Code.ImpayeLoyer: + _ = match_arg_26.value + temp_montant_impaye_2 = True + elif match_arg_26.code == ModeOccupationImpaye_Code.ImpayePret: + _ = match_arg_26.value + temp_montant_impaye_2 = False + if temp_montant_impaye_2: + if (montant_dette >= + seuil_impaye_depense_de_logement): + temp_montant_impaye_1 = montant_dette + else: + temp_montant_impaye_1 = money_of_cents_string("0") + else: + temp_montant_impaye_1 = dead_value + raise EmptyError + except EmptyError: + temp_montant_impaye_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=1053, + start_column=10, end_line=1053, + end_column=24, + law_headings=["Quantification des impayés de dépense de logement", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + montant_impaye = temp_montant_impaye_1 + return ImpayeDepenseLogementOut(montant_impaye_out = montant_impaye) + +def base_mensuelle_allocations_familiales(base_mensuelle_allocations_familiales_in:BaseMensuelleAllocationsFamilialesIn): + date_courante_1 = base_mensuelle_allocations_familiales_in.date_courante_in + try: + def temp_montant_6(_:Any): + raise EmptyError + def temp_montant_7(_:Any): + return False + def temp_montant_8(_:Any): + if ((date_courante_1 >= date_of_numbers(2022,4,1)) and + (date_courante_1 < + date_of_numbers(2023,4,1))): + return money_of_cents_string("42228") + else: + raise EmptyError + def temp_montant_9(_:Any): + if ((date_courante_1 >= date_of_numbers(2021,4,1)) and + (date_courante_1 < + date_of_numbers(2022,4,1))): + return money_of_cents_string("41481") + else: + raise EmptyError + def temp_montant_10(_:Any): + if ((date_courante_1 >= date_of_numbers(2020,4,1)) and + (date_courante_1 < + date_of_numbers(2021,4,1))): + return money_of_cents_string("41440") + else: + raise EmptyError + def temp_montant_11(_:Any): + if ((date_courante_1 >= date_of_numbers(2019,4,1)) and + (date_courante_1 < + date_of_numbers(2020,4,1))): + return money_of_cents_string("41316") + else: + raise EmptyError + temp_montant_12 = handle_default(SourcePosition(filename="examples/aides_logement/../base_mensuelle_allocations_familiales/bmaf.catala_fr", + start_line=6, start_column=10, + end_line=6, end_column=17, + law_headings=["Montant de la base mensuelle des allocations familiales"]), [temp_montant_11, + temp_montant_10, temp_montant_9, + temp_montant_8], temp_montant_7, + temp_montant_6) + except EmptyError: + temp_montant_12 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/../base_mensuelle_allocations_familiales/bmaf.catala_fr", + start_line=6, start_column=10, + end_line=6, end_column=17, + law_headings=["Montant de la base mensuelle des allocations familiales"])) + montant_2 = temp_montant_12 + return BaseMensuelleAllocationsFamilialesOut(montant_out = montant_2) + +def smic(smic_in:SmicIn): + date_courante_2 = smic_in.date_courante_in + residence = smic_in.residence_in + try: + def temp_brut_horaire(_:Any): + raise EmptyError + def temp_brut_horaire_1(_:Any): + return False + def temp_brut_horaire_2(_:Any): + if ((date_courante_2 >= date_of_numbers(2022,5,1)) and + ((date_courante_2 <= date_of_numbers(2022,12,31)) and + (residence == Collectivite(Collectivite_Code.Mayotte, + Unit())))): + return money_of_cents_string("819") + else: + raise EmptyError + def temp_brut_horaire_3(_:Any): + if ((date_courante_2 >= date_of_numbers(2022,5,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 + ((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 money_of_cents_string("1085") + else: + raise EmptyError + def temp_brut_horaire_4(_:Any): + if ((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 money_of_cents_string("798") + else: + raise EmptyError + def temp_brut_horaire_5(_:Any): + if ((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 + ((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 money_of_cents_string("1057") + else: + raise EmptyError + def temp_brut_horaire_6(_:Any): + if ((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 money_of_cents_string("774") + else: + raise EmptyError + def temp_brut_horaire_7(_:Any): + if ((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 + ((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 money_of_cents_string("1025") + else: + raise EmptyError + def temp_brut_horaire_8(_:Any): + if ((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 money_of_cents_string("766") + else: + raise EmptyError + def temp_brut_horaire_9(_:Any): + if ((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 + ((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 money_of_cents_string("1015") + else: + raise EmptyError + def temp_brut_horaire_10(_:Any): + if ((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 money_of_cents_string("757") + else: + raise EmptyError + def temp_brut_horaire_11(_:Any): + if ((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 money_of_cents_string("1003") + else: + raise EmptyError + temp_brut_horaire_12 = handle_default(SourcePosition(filename="examples/aides_logement/../prestations_familiales/../smic/smic.catala_fr", + start_line=11, start_column=10, + end_line=11, end_column=22, + law_headings=["Prologue", + "Montant du salaire minimum de croissance"]), [temp_brut_horaire_11, + temp_brut_horaire_10, + temp_brut_horaire_9, + temp_brut_horaire_8, + temp_brut_horaire_7, + temp_brut_horaire_6, + temp_brut_horaire_5, + temp_brut_horaire_4, + temp_brut_horaire_3, + temp_brut_horaire_2], + temp_brut_horaire_1, + temp_brut_horaire) + except EmptyError: + temp_brut_horaire_12 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/../prestations_familiales/../smic/smic.catala_fr", + start_line=11, start_column=10, + end_line=11, end_column=22, + law_headings=["Prologue", + "Montant du salaire minimum de croissance"])) + brut_horaire = temp_brut_horaire_12 + return SmicOut(brut_horaire_out = brut_horaire) + +def calcul_aide_personnalisee_logement_locatif(calcul_aide_personnalisee_logement_locatif_in:CalculAidePersonnaliseeLogementLocatifIn): + loyer_principal = calcul_aide_personnalisee_logement_locatif_in.loyer_principal_in + ressources_menage_arrondies_1 = calcul_aide_personnalisee_logement_locatif_in.ressources_menage_arrondies_in + beneficiaire_aide_adulte_ou_enfant_handicapes = calcul_aide_personnalisee_logement_locatif_in.beneficiaire_aide_adulte_ou_enfant_handicapes_in + date_courante_3 = calcul_aide_personnalisee_logement_locatif_in.date_courante_in + nombre_personnes_a_charge_2 = calcul_aide_personnalisee_logement_locatif_in.nombre_personnes_a_charge_in + situation_familiale_calcul_apl_2 = calcul_aide_personnalisee_logement_locatif_in.situation_familiale_calcul_apl_in + zone = calcul_aide_personnalisee_logement_locatif_in.zone_in + logement_est_chambre = calcul_aide_personnalisee_logement_locatif_in.logement_est_chambre_in + agees_ou_handicap_adultes_hebergees_onereux_particuliers = calcul_aide_personnalisee_logement_locatif_in.agees_ou_handicap_adultes_hebergees_onereux_particuliers_in + type_aide = calcul_aide_personnalisee_logement_locatif_in.type_aide_in + colocation = calcul_aide_personnalisee_logement_locatif_in.colocation_in + reduction_loyer_solidarite = calcul_aide_personnalisee_logement_locatif_in.reduction_loyer_solidarite_in + try: + temp_fraction_l832_3 = decimal_of_string("0.98") + except EmptyError: + temp_fraction_l832_3 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=579, start_column=11, + end_line=579, end_column=26, + law_headings=["Secteur locatif", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + fraction_l832_3 = temp_fraction_l832_3 + try: + temp_montant_forfaitaire_d823_16 = money_of_cents_string("500") + except EmptyError: + temp_montant_forfaitaire_d823_16 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=582, start_column=11, + end_line=582, end_column=38, + law_headings=["Secteur locatif", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + montant_forfaitaire_d823_16 = temp_montant_forfaitaire_d823_16 + try: + temp_contributions_sociales_dot_date_courante = date_courante_3 + except EmptyError: + temp_contributions_sociales_dot_date_courante = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=544, start_column=10, + end_line=544, end_column=23, + law_headings=["Calcul des contributions sociales s'appliquant aux aides personnelles au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + contributions_sociales_dot_date_courante = temp_contributions_sociales_dot_date_courante + result = contributions_sociales_aides_personnelle_logement(ContributionsSocialesAidesPersonnelleLogementIn(date_courante_in = contributions_sociales_dot_date_courante)) + contributions_sociales_dot_montant = result.montant_out + try: + try: + if ((date_courante_3 >= date_of_numbers(2020,10,1)) and + (date_courante_3 < + date_of_numbers(2021,10,1))): + if (nombre_personnes_a_charge_2 == + integer_of_string("0")): + match_arg_27 = situation_familiale_calcul_apl_2 + if match_arg_27.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_27.value + temp_taux_composition_familiale = decimal_of_string("0.0283") + elif match_arg_27.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_27.value + temp_taux_composition_familiale = decimal_of_string("0.0315") + else: + if (nombre_personnes_a_charge_2 == + integer_of_string("1")): + temp_taux_composition_familiale = decimal_of_string("0.027") + else: + if (nombre_personnes_a_charge_2 == + integer_of_string("2")): + temp_taux_composition_familiale = decimal_of_string("0.0238") + else: + if (nombre_personnes_a_charge_2 == + integer_of_string("3")): + temp_taux_composition_familiale = decimal_of_string("0.0201") + else: + if (nombre_personnes_a_charge_2 == + integer_of_string("4")): + temp_taux_composition_familiale = decimal_of_string("0.0185") + else: + if (nombre_personnes_a_charge_2 == + integer_of_string("5")): + temp_taux_composition_familiale = decimal_of_string("0.0179") + else: + if (nombre_personnes_a_charge_2 == + integer_of_string("6")): + temp_taux_composition_familiale = decimal_of_string("0.0173") + else: + temp_taux_composition_familiale = (decimal_of_string("0.0173") - + (decimal_of_string("0.0006") * + decimal_of_integer((nombre_personnes_a_charge_2 - + integer_of_string("6"))))) + else: + temp_taux_composition_familiale = dead_value + raise EmptyError + except EmptyError: + if (date_courante_3 >= + date_of_numbers(2021,10,1)): + if (nombre_personnes_a_charge_2 == + integer_of_string("0")): + match_arg_28 = situation_familiale_calcul_apl_2 + if match_arg_28.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_28.value + temp_taux_composition_familiale = decimal_of_string("0.0283") + elif match_arg_28.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_28.value + temp_taux_composition_familiale = decimal_of_string("0.0315") + else: + if (nombre_personnes_a_charge_2 == + integer_of_string("1")): + temp_taux_composition_familiale = decimal_of_string("0.027") + else: + if (nombre_personnes_a_charge_2 == + integer_of_string("2")): + temp_taux_composition_familiale = decimal_of_string("0.0238") + else: + if (nombre_personnes_a_charge_2 == + integer_of_string("3")): + temp_taux_composition_familiale = decimal_of_string("0.0201") + else: + if (nombre_personnes_a_charge_2 == + integer_of_string("4")): + temp_taux_composition_familiale = decimal_of_string("0.0185") + else: + if (nombre_personnes_a_charge_2 == + integer_of_string("5")): + temp_taux_composition_familiale = decimal_of_string("0.0179") + else: + if (nombre_personnes_a_charge_2 == + integer_of_string("6")): + temp_taux_composition_familiale = decimal_of_string("0.0173") + else: + temp_taux_composition_familiale = (decimal_of_string("0.0173") - + (decimal_of_string("0.0006") * + decimal_of_integer((nombre_personnes_a_charge_2 - + integer_of_string("6"))))) + else: + temp_taux_composition_familiale = dead_value + raise EmptyError + except EmptyError: + temp_taux_composition_familiale = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=590, start_column=10, + end_line=590, end_column=36, + law_headings=["Secteur locatif", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + taux_composition_familiale = temp_taux_composition_familiale + try: + def temp_abattement_forfaitaire_d823_17(_:Any): + raise EmptyError + def temp_abattement_forfaitaire_d823_17_1(_:Any): + return False + def temp_abattement_forfaitaire_d823_17_2(_:Any): + if ((date_courante_3 < date_of_numbers(2022,1,1)) and + (date_courante_3 >= + date_of_numbers(2020,1,1))): + if (nombre_personnes_a_charge_2 == + integer_of_string("0")): + match_arg_29 = situation_familiale_calcul_apl_2 + if match_arg_29.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_29.value + return money_of_cents_string("458800") + elif match_arg_29.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_29.value + return money_of_cents_string("657200") + else: + if (nombre_personnes_a_charge_2 == + integer_of_string("1")): + return money_of_cents_string("783900") + else: + if (nombre_personnes_a_charge_2 == + integer_of_string("2")): + return money_of_cents_string("801500") + else: + if (nombre_personnes_a_charge_2 == + integer_of_string("3")): + return money_of_cents_string("832200") + else: + if (nombre_personnes_a_charge_2 == + integer_of_string("4")): + return money_of_cents_string("863100") + else: + if (nombre_personnes_a_charge_2 == + integer_of_string("5")): + return money_of_cents_string("893800") + else: + if (nombre_personnes_a_charge_2 == + integer_of_string("6")): + return money_of_cents_string("924600") + else: + return (money_of_cents_string("924600") + + (money_of_cents_string("30500") * + decimal_of_integer((nombre_personnes_a_charge_2 - + integer_of_string("6"))))) + else: + raise EmptyError + def temp_abattement_forfaitaire_d823_17_3(_:Any): + if (date_courante_3 >= + date_of_numbers(2022,1,1)): + if (nombre_personnes_a_charge_2 == + integer_of_string("0")): + match_arg_30 = situation_familiale_calcul_apl_2 + if match_arg_30.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_30.value + return money_of_cents_string("468300") + elif match_arg_30.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_30.value + return money_of_cents_string("670900") + else: + if (nombre_personnes_a_charge_2 == + integer_of_string("1")): + return money_of_cents_string("800200") + else: + if (nombre_personnes_a_charge_2 == + integer_of_string("2")): + return money_of_cents_string("819200") + else: + if (nombre_personnes_a_charge_2 == + integer_of_string("3")): + return money_of_cents_string("849500") + else: + if (nombre_personnes_a_charge_2 == + integer_of_string("4")): + return money_of_cents_string("881100") + else: + if (nombre_personnes_a_charge_2 == + integer_of_string("5")): + return money_of_cents_string("912400") + else: + if (nombre_personnes_a_charge_2 == + integer_of_string("6")): + return money_of_cents_string("943900") + else: + return (money_of_cents_string("943900") + + (money_of_cents_string("31100") * + decimal_of_integer((nombre_personnes_a_charge_2 - + integer_of_string("6"))))) + else: + raise EmptyError + temp_abattement_forfaitaire_d823_17_4 = handle_default(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=584, + start_column=11, + end_line=584, end_column=41, + law_headings=["Secteur locatif", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"]), [temp_abattement_forfaitaire_d823_17_3, + temp_abattement_forfaitaire_d823_17_2], + temp_abattement_forfaitaire_d823_17_1, + temp_abattement_forfaitaire_d823_17) + except EmptyError: + temp_abattement_forfaitaire_d823_17_4 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=584, start_column=11, + end_line=584, end_column=41, + law_headings=["Secteur locatif", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + abattement_forfaitaire_d823_17 = temp_abattement_forfaitaire_d823_17_4 + try: + def temp_loyer_reference(_:Any): + raise EmptyError + def temp_loyer_reference_1(_:Any): + return False + def temp_loyer_reference_2(_:Any): + if ((date_courante_3 >= date_of_numbers(2020,10,1)) and + (date_courante_3 < + date_of_numbers(2021,10,1))): + if (nombre_personnes_a_charge_2 == + integer_of_string("0")): + match_arg_31 = situation_familiale_calcul_apl_2 + if match_arg_31.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_31.value + return money_of_cents_string("25869") + elif match_arg_31.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_31.value + return money_of_cents_string("31664") + else: + return (money_of_cents_string("35630") + + (money_of_cents_string("5186") * + decimal_of_integer((nombre_personnes_a_charge_2 - + integer_of_string("1"))))) + else: + raise EmptyError + def temp_loyer_reference_3(_:Any): + if (date_courante_3 >= + date_of_numbers(2021,10,1)): + if (nombre_personnes_a_charge_2 == + integer_of_string("0")): + match_arg_32 = situation_familiale_calcul_apl_2 + if match_arg_32.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_32.value + return money_of_cents_string("25978") + elif match_arg_32.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_32.value + return money_of_cents_string("31797") + else: + return (money_of_cents_string("35780") + + (money_of_cents_string("5208") * + decimal_of_integer((nombre_personnes_a_charge_2 - + integer_of_string("1"))))) + else: + raise EmptyError + temp_loyer_reference_4 = handle_default(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=578, + start_column=11, + end_line=578, end_column=26, + law_headings=["Secteur locatif", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"]), [temp_loyer_reference_3, + temp_loyer_reference_2], + temp_loyer_reference_1, + temp_loyer_reference) + except EmptyError: + temp_loyer_reference_4 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=578, start_column=11, + end_line=578, end_column=26, + law_headings=["Secteur locatif", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + loyer_reference = temp_loyer_reference_4 + try: + match_arg_33 = type_aide + if match_arg_33.code == TypeAidesPersonnelleLogement_Code.AidePersonnaliseeLogement: + _ = match_arg_33.value + temp_montant_minimal_aide_d823_16 = money_of_cents_string("0") + elif match_arg_33.code == TypeAidesPersonnelleLogement_Code.AllocationLogementFamiliale: + _ = match_arg_33.value + temp_montant_minimal_aide_d823_16 = money_of_cents_string("1000") + elif match_arg_33.code == TypeAidesPersonnelleLogement_Code.AllocationLogementSociale: + _ = match_arg_33.value + temp_montant_minimal_aide_d823_16 = money_of_cents_string("1000") + except EmptyError: + temp_montant_minimal_aide_d823_16 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=583, start_column=11, + end_line=583, end_column=39, + law_headings=["Secteur locatif", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + montant_minimal_aide_d823_16 = temp_montant_minimal_aide_d823_16 + try: + def temp_plafond_loyer_d823_16_2(_:Any): + def temp_plafond_loyer_d823_16_2_1(_:Any): + raise EmptyError + def temp_plafond_loyer_d823_16_2_2(_:Any): + return False + def temp_plafond_loyer_d823_16_2_3(_:Any): + if (((date_courante_3 < date_of_numbers(2021,10,1)) and + (date_courante_3 >= date_of_numbers(2020,10,1))) and + (nombre_personnes_a_charge_2 >= + integer_of_string("1"))): + match_arg_34 = zone + if match_arg_34.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_34.value + return (money_of_cents_string("40460") + + (money_of_cents_string("5870") * + decimal_of_integer((nombre_personnes_a_charge_2 - + integer_of_string("1"))))) + elif match_arg_34.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_34.value + return (money_of_cents_string("35630") + + (money_of_cents_string("5186") * + decimal_of_integer((nombre_personnes_a_charge_2 - + integer_of_string("1"))))) + elif match_arg_34.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_34.value + return (money_of_cents_string("32956") + + (money_of_cents_string("4723") * + decimal_of_integer((nombre_personnes_a_charge_2 - + integer_of_string("1"))))) + else: + raise EmptyError + def temp_plafond_loyer_d823_16_2_4(_:Any): + match_arg_35 = situation_familiale_calcul_apl_2 + if match_arg_35.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_35.value + temp_plafond_loyer_d823_16_2_5 = False + elif match_arg_35.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_35.value + temp_plafond_loyer_d823_16_2_5 = True + if (((date_courante_3 < date_of_numbers(2021,10,1)) and + (date_courante_3 >= date_of_numbers(2020,10,1))) and + (temp_plafond_loyer_d823_16_2_5 and + (nombre_personnes_a_charge_2 == + integer_of_string("0")))): + match_arg_36 = zone + if match_arg_36.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_36.value + return money_of_cents_string("35799") + elif match_arg_36.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_36.value + return money_of_cents_string("31664") + elif match_arg_36.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_36.value + return money_of_cents_string("29392") + else: + raise EmptyError + def temp_plafond_loyer_d823_16_2_6(_:Any): + match_arg_37 = situation_familiale_calcul_apl_2 + if match_arg_37.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_37.value + temp_plafond_loyer_d823_16_2_7 = True + elif match_arg_37.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_37.value + temp_plafond_loyer_d823_16_2_7 = False + if (((date_courante_3 < date_of_numbers(2021,10,1)) and + (date_courante_3 >= date_of_numbers(2020,10,1))) and + (temp_plafond_loyer_d823_16_2_7 and + (nombre_personnes_a_charge_2 == + integer_of_string("0")))): + match_arg_38 = zone + if match_arg_38.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_38.value + return money_of_cents_string("29682") + elif match_arg_38.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_38.value + return money_of_cents_string("25859") + elif match_arg_38.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_38.value + return money_of_cents_string("24246") + else: + raise EmptyError + def temp_plafond_loyer_d823_16_2_8(_:Any): + if ((date_courante_3 >= date_of_numbers(2021,10,1)) and + (nombre_personnes_a_charge_2 >= + integer_of_string("1"))): + match_arg_39 = zone + if match_arg_39.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_39.value + return (money_of_cents_string("40630") + + (money_of_cents_string("5895") * + decimal_of_integer((nombre_personnes_a_charge_2 - + integer_of_string("1"))))) + elif match_arg_39.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_39.value + return (money_of_cents_string("35780") + + (money_of_cents_string("5208") * + decimal_of_integer((nombre_personnes_a_charge_2 - + integer_of_string("1"))))) + elif match_arg_39.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_39.value + return (money_of_cents_string("33094") + + (money_of_cents_string("4743") * + decimal_of_integer((nombre_personnes_a_charge_2 - + integer_of_string("1"))))) + else: + raise EmptyError + def temp_plafond_loyer_d823_16_2_9(_:Any): + match_arg_40 = situation_familiale_calcul_apl_2 + if match_arg_40.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_40.value + temp_plafond_loyer_d823_16_2_10 = False + elif match_arg_40.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_40.value + temp_plafond_loyer_d823_16_2_10 = True + if ((date_courante_3 >= date_of_numbers(2021,10,1)) and + (temp_plafond_loyer_d823_16_2_10 and + (nombre_personnes_a_charge_2 == + integer_of_string("0")))): + match_arg_41 = zone + if match_arg_41.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_41.value + return money_of_cents_string("35949") + elif match_arg_41.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_41.value + return money_of_cents_string("31797") + elif match_arg_41.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_41.value + return money_of_cents_string("29515") + else: + raise EmptyError + def temp_plafond_loyer_d823_16_2_11(_:Any): + match_arg_42 = situation_familiale_calcul_apl_2 + if match_arg_42.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_42.value + temp_plafond_loyer_d823_16_2_12 = True + elif match_arg_42.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_42.value + temp_plafond_loyer_d823_16_2_12 = False + if ((date_courante_3 >= date_of_numbers(2021,10,1)) and + (temp_plafond_loyer_d823_16_2_12 and + (nombre_personnes_a_charge_2 == + integer_of_string("0")))): + match_arg_43 = zone + if match_arg_43.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_43.value + return money_of_cents_string("29807") + elif match_arg_43.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_43.value + return money_of_cents_string("25978") + elif match_arg_43.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_43.value + return money_of_cents_string("24348") + else: + raise EmptyError + return handle_default(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=588, start_column=10, + end_line=588, end_column=33, + law_headings=["Secteur locatif", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"]), [temp_plafond_loyer_d823_16_2_11, + temp_plafond_loyer_d823_16_2_9, + temp_plafond_loyer_d823_16_2_8, + temp_plafond_loyer_d823_16_2_6, + temp_plafond_loyer_d823_16_2_4, + temp_plafond_loyer_d823_16_2_3], + temp_plafond_loyer_d823_16_2_2, + temp_plafond_loyer_d823_16_2_1) + def temp_plafond_loyer_d823_16_2_13(_:Any): + return True + def temp_plafond_loyer_d823_16_2_14(_:Any): + try: + def temp_plafond_loyer_d823_16_2_15(_:Any): + raise EmptyError + def temp_plafond_loyer_d823_16_2_16(_:Any): + return False + def temp_plafond_loyer_d823_16_2_17(_:Any): + if (((date_courante_3 < date_of_numbers(2021,10,1)) and + ((date_courante_3 >= date_of_numbers(2020,10,1)) and + logement_est_chambre)) and + agees_ou_handicap_adultes_hebergees_onereux_particuliers): + match_arg_44 = zone + if match_arg_44.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_44.value + return money_of_cents_string("22262") + elif match_arg_44.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_44.value + return money_of_cents_string("19402") + elif match_arg_44.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_44.value + return money_of_cents_string("18185") + else: + raise EmptyError + def temp_plafond_loyer_d823_16_2_18(_:Any): + if (((date_courante_3 >= date_of_numbers(2021,10,1)) and + logement_est_chambre) and + agees_ou_handicap_adultes_hebergees_onereux_particuliers): + match_arg_45 = zone + if match_arg_45.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_45.value + return money_of_cents_string("22355") + elif match_arg_45.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_45.value + return money_of_cents_string("19484") + elif match_arg_45.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_45.value + return money_of_cents_string("18261") + else: + raise EmptyError + return handle_default(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=588, start_column=10, + end_line=588, end_column=33, + law_headings=["Secteur locatif", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"]), [temp_plafond_loyer_d823_16_2_18, + temp_plafond_loyer_d823_16_2_17], + temp_plafond_loyer_d823_16_2_16, + temp_plafond_loyer_d823_16_2_15) + except EmptyError: + def temp_plafond_loyer_d823_16_2_19(_:Any): + raise EmptyError + def temp_plafond_loyer_d823_16_2_20(_:Any): + return False + def temp_plafond_loyer_d823_16_2_21(_:Any): + if ((date_courante_3 < date_of_numbers(2021,10,1)) and + ((date_courante_3 >= date_of_numbers(2020,10,1)) and + logement_est_chambre)): + match_arg_46 = zone + if match_arg_46.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_46.value + return money_of_cents_string("26714") + elif match_arg_46.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_46.value + return money_of_cents_string("23282") + elif match_arg_46.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_46.value + return money_of_cents_string("21821") + else: + raise EmptyError + def temp_plafond_loyer_d823_16_2_22(_:Any): + if ((date_courante_3 >= date_of_numbers(2021,10,1)) and + logement_est_chambre): + match_arg_47 = zone + if match_arg_47.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_47.value + return money_of_cents_string("26826") + elif match_arg_47.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_47.value + return money_of_cents_string("23380") + elif match_arg_47.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_47.value + return money_of_cents_string("21913") + else: + raise EmptyError + return handle_default(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=588, start_column=10, + end_line=588, end_column=33, + law_headings=["Secteur locatif", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"]), [temp_plafond_loyer_d823_16_2_22, + temp_plafond_loyer_d823_16_2_21], + temp_plafond_loyer_d823_16_2_20, + temp_plafond_loyer_d823_16_2_19) + def temp_plafond_loyer_d823_16_2_23(_:Any): + def temp_plafond_loyer_d823_16_2_24(_:Any): + raise EmptyError + def temp_plafond_loyer_d823_16_2_25(_:Any): + return False + def temp_plafond_loyer_d823_16_2_26(_:Any): + if (((date_courante_3 < date_of_numbers(2021,10,1)) and + ((date_courante_3 >= date_of_numbers(2020,10,1)) and + colocation)) and (nombre_personnes_a_charge_2 >= + integer_of_string("1"))): + match_arg_48 = zone + if match_arg_48.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_48.value + return (money_of_cents_string("30345") + + (money_of_cents_string("4403") * + decimal_of_integer((nombre_personnes_a_charge_2 - + integer_of_string("1"))))) + elif match_arg_48.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_48.value + return (money_of_cents_string("26723") + + (money_of_cents_string("3890") * + decimal_of_integer((nombre_personnes_a_charge_2 - + integer_of_string("1"))))) + elif match_arg_48.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_48.value + return (money_of_cents_string("24717") + + (money_of_cents_string("3542") * + decimal_of_integer((nombre_personnes_a_charge_2 - + integer_of_string("1"))))) + else: + raise EmptyError + def temp_plafond_loyer_d823_16_2_27(_:Any): + match_arg_49 = situation_familiale_calcul_apl_2 + if match_arg_49.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_49.value + temp_plafond_loyer_d823_16_2_28 = False + elif match_arg_49.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_49.value + temp_plafond_loyer_d823_16_2_28 = True + if (((date_courante_3 < date_of_numbers(2021,10,1)) and + ((date_courante_3 >= date_of_numbers(2020,10,1)) and + colocation)) and (temp_plafond_loyer_d823_16_2_28 and + (nombre_personnes_a_charge_2 == + integer_of_string("0")))): + match_arg_50 = zone + if match_arg_50.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_50.value + return money_of_cents_string("26849") + elif match_arg_50.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_50.value + return money_of_cents_string("23748") + elif match_arg_50.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_50.value + return money_of_cents_string("22044") + else: + raise EmptyError + def temp_plafond_loyer_d823_16_2_29(_:Any): + match_arg_51 = situation_familiale_calcul_apl_2 + if match_arg_51.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_51.value + temp_plafond_loyer_d823_16_2_30 = True + elif match_arg_51.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_51.value + temp_plafond_loyer_d823_16_2_30 = False + if (((date_courante_3 < date_of_numbers(2021,10,1)) and + ((date_courante_3 >= date_of_numbers(2020,10,1)) and + colocation)) and (temp_plafond_loyer_d823_16_2_30 and + (nombre_personnes_a_charge_2 == + integer_of_string("0")))): + match_arg_52 = zone + if match_arg_52.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_52.value + return money_of_cents_string("22262") + elif match_arg_52.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_52.value + return money_of_cents_string("19402") + elif match_arg_52.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_52.value + return money_of_cents_string("18185") + else: + raise EmptyError + def temp_plafond_loyer_d823_16_2_31(_:Any): + if (((date_courante_3 >= date_of_numbers(2021,10,1)) and + colocation) and (nombre_personnes_a_charge_2 >= + integer_of_string("1"))): + match_arg_53 = zone + if match_arg_53.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_53.value + return (money_of_cents_string("30473") + + (money_of_cents_string("4421") * + decimal_of_integer((nombre_personnes_a_charge_2 - + integer_of_string("1"))))) + elif match_arg_53.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_53.value + return (money_of_cents_string("26835") + + (money_of_cents_string("3906") * + decimal_of_integer((nombre_personnes_a_charge_2 - + integer_of_string("1"))))) + elif match_arg_53.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_53.value + return (money_of_cents_string("24821") + + (money_of_cents_string("3557") * + decimal_of_integer((nombre_personnes_a_charge_2 - + integer_of_string("1"))))) + else: + raise EmptyError + def temp_plafond_loyer_d823_16_2_32(_:Any): + match_arg_54 = situation_familiale_calcul_apl_2 + if match_arg_54.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_54.value + temp_plafond_loyer_d823_16_2_33 = False + elif match_arg_54.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_54.value + temp_plafond_loyer_d823_16_2_33 = True + if (((date_courante_3 >= date_of_numbers(2021,10,1)) and + colocation) and (temp_plafond_loyer_d823_16_2_33 and + (nombre_personnes_a_charge_2 == + integer_of_string("0")))): + match_arg_55 = zone + if match_arg_55.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_55.value + return money_of_cents_string("26962") + elif match_arg_55.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_55.value + return money_of_cents_string("23848") + elif match_arg_55.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_55.value + return money_of_cents_string("22136") + else: + raise EmptyError + def temp_plafond_loyer_d823_16_2_34(_:Any): + match_arg_56 = situation_familiale_calcul_apl_2 + if match_arg_56.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_56.value + temp_plafond_loyer_d823_16_2_35 = True + elif match_arg_56.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_56.value + temp_plafond_loyer_d823_16_2_35 = False + if (((date_courante_3 >= date_of_numbers(2021,10,1)) and + colocation) and (temp_plafond_loyer_d823_16_2_35 and + (nombre_personnes_a_charge_2 == + integer_of_string("0")))): + match_arg_57 = zone + if match_arg_57.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_57.value + return money_of_cents_string("22355") + elif match_arg_57.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_57.value + return money_of_cents_string("19484") + elif match_arg_57.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_57.value + return money_of_cents_string("18261") + else: + raise EmptyError + return handle_default(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=588, start_column=10, + end_line=588, end_column=33, + law_headings=["Secteur locatif", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"]), [temp_plafond_loyer_d823_16_2_34, + temp_plafond_loyer_d823_16_2_32, + temp_plafond_loyer_d823_16_2_31, + temp_plafond_loyer_d823_16_2_29, + temp_plafond_loyer_d823_16_2_27, + temp_plafond_loyer_d823_16_2_26], + temp_plafond_loyer_d823_16_2_25, + temp_plafond_loyer_d823_16_2_24) + temp_plafond_loyer_d823_16_2_36 = handle_default(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=588, + start_column=10, + end_line=588, end_column=33, + law_headings=["Secteur locatif", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"]), [temp_plafond_loyer_d823_16_2_23, + temp_plafond_loyer_d823_16_2_14], + temp_plafond_loyer_d823_16_2_13, + temp_plafond_loyer_d823_16_2) + except EmptyError: + temp_plafond_loyer_d823_16_2_36 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=588, start_column=10, + end_line=588, end_column=33, + law_headings=["Secteur locatif", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + plafond_loyer_d823_16_2 = temp_plafond_loyer_d823_16_2_36 + try: + try: + def temp_montant_forfaitaire_charges_d823_16(_:Any): + raise EmptyError + def temp_montant_forfaitaire_charges_d823_16_1(_:Any): + return False + def temp_montant_forfaitaire_charges_d823_16_2(_:Any): + if ((date_courante_3 < date_of_numbers(2021,10,1)) and + ((date_courante_3 >= date_of_numbers(2020,10,1)) and + colocation)): + match_arg_58 = situation_familiale_calcul_apl_2 + if match_arg_58.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_58.value + temp_montant_forfaitaire_charges_d823_16_3 = money_of_cents_string("2699") + elif match_arg_58.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_58.value + temp_montant_forfaitaire_charges_d823_16_3 = money_of_cents_string("5399") + return (temp_montant_forfaitaire_charges_d823_16_3 + + (money_of_cents_string("1224") * + decimal_of_integer(nombre_personnes_a_charge_2))) + else: + raise EmptyError + def temp_montant_forfaitaire_charges_d823_16_4(_:Any): + if ((date_courante_3 >= date_of_numbers(2021,10,1)) and + colocation): + match_arg_59 = situation_familiale_calcul_apl_2 + if match_arg_59.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_59.value + temp_montant_forfaitaire_charges_d823_16_5 = money_of_cents_string("2710") + elif match_arg_59.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_59.value + temp_montant_forfaitaire_charges_d823_16_5 = money_of_cents_string("5422") + return (temp_montant_forfaitaire_charges_d823_16_5 + + (money_of_cents_string("1229") * + decimal_of_integer(nombre_personnes_a_charge_2))) + else: + raise EmptyError + temp_montant_forfaitaire_charges_d823_16_6 = handle_default( + SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=587, start_column=10, end_line=587, end_column=45, + law_headings=["Secteur locatif", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"]), [temp_montant_forfaitaire_charges_d823_16_4, + temp_montant_forfaitaire_charges_d823_16_2], + temp_montant_forfaitaire_charges_d823_16_1, + temp_montant_forfaitaire_charges_d823_16) + except EmptyError: + def temp_montant_forfaitaire_charges_d823_16_7(_:Any): + raise EmptyError + def temp_montant_forfaitaire_charges_d823_16_8(_:Any): + return False + def temp_montant_forfaitaire_charges_d823_16_9(_:Any): + if ((date_courante_3 < date_of_numbers(2021,10,1)) and + (date_courante_3 >= + date_of_numbers(2020,10,1))): + return (money_of_cents_string("5399") + + (money_of_cents_string("1224") * + decimal_of_integer(nombre_personnes_a_charge_2))) + else: + raise EmptyError + def temp_montant_forfaitaire_charges_d823_16_10(_:Any): + if (date_courante_3 >= + date_of_numbers(2021,10,1)): + return (money_of_cents_string("5422") + + (money_of_cents_string("1229") * + decimal_of_integer(nombre_personnes_a_charge_2))) + else: + raise EmptyError + temp_montant_forfaitaire_charges_d823_16_6 = handle_default( + SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=587, start_column=10, end_line=587, end_column=45, + law_headings=["Secteur locatif", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"]), [temp_montant_forfaitaire_charges_d823_16_10, + temp_montant_forfaitaire_charges_d823_16_9], + temp_montant_forfaitaire_charges_d823_16_8, + temp_montant_forfaitaire_charges_d823_16_7) + except EmptyError: + temp_montant_forfaitaire_charges_d823_16_6 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=587, start_column=10, + end_line=587, end_column=45, + law_headings=["Secteur locatif", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + montant_forfaitaire_charges_d823_16 = temp_montant_forfaitaire_charges_d823_16_6 + try: + match_arg_60 = zone + if match_arg_60.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_60.value + temp_plafond_suppression_d823_16 = (plafond_loyer_d823_16_2 * + decimal_of_string("4.")) + elif match_arg_60.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_60.value + temp_plafond_suppression_d823_16 = (plafond_loyer_d823_16_2 * + decimal_of_string("3.1")) + elif match_arg_60.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_60.value + temp_plafond_suppression_d823_16 = (plafond_loyer_d823_16_2 * + decimal_of_string("3.1")) + except EmptyError: + temp_plafond_suppression_d823_16 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=581, start_column=11, + end_line=581, end_column=38, + law_headings=["Secteur locatif", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + plafond_suppression_d823_16 = temp_plafond_suppression_d823_16 + try: + match_arg_61 = zone + if match_arg_61.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_61.value + temp_plafond_degressivite_d823_16 = (plafond_loyer_d823_16_2 * + decimal_of_string("3.4")) + elif match_arg_61.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_61.value + temp_plafond_degressivite_d823_16 = (plafond_loyer_d823_16_2 * + decimal_of_string("2.5")) + elif match_arg_61.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_61.value + temp_plafond_degressivite_d823_16 = (plafond_loyer_d823_16_2 * + decimal_of_string("2.5")) + except EmptyError: + temp_plafond_degressivite_d823_16 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=580, start_column=11, + end_line=580, end_column=39, + law_headings=["Secteur locatif", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + plafond_degressivite_d823_16 = temp_plafond_degressivite_d823_16 + try: + if (loyer_principal > + plafond_loyer_d823_16_2): + temp_loyer_eligible = plafond_loyer_d823_16_2 + else: + temp_loyer_eligible = loyer_principal + except EmptyError: + temp_loyer_eligible = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=573, start_column=11, + end_line=573, end_column=25, + law_headings=["Secteur locatif", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + loyer_eligible = temp_loyer_eligible + try: + def temp_traitement_aide_finale_diminue(param_1:Money): + try: + try: + if beneficiaire_aide_adulte_ou_enfant_handicapes: + return param_1 + else: + raise EmptyError + except EmptyError: + if (loyer_principal > + plafond_suppression_d823_16): + return money_of_cents_string("0") + else: + if (loyer_principal > + plafond_degressivite_d823_16): + return (param_1 - (param_1 * ((loyer_principal - + plafond_degressivite_d823_16) / + (plafond_suppression_d823_16 - + plafond_degressivite_d823_16)))) + else: + return param_1 + except EmptyError: + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=599, + start_column=10, + end_line=599, + end_column=17, + law_headings=["Secteur locatif", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + except EmptyError: + temp_traitement_aide_finale_diminue = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=599, start_column=10, + end_line=599, end_column=17, + law_headings=["Secteur locatif", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + traitement_aide_finale_diminue = temp_traitement_aide_finale_diminue + try: + def temp_participation_minimale(_:Any): + raise EmptyError + def temp_participation_minimale_1(_:Any): + return False + def temp_participation_minimale_2(_:Any): + if ((date_courante_3 < date_of_numbers(2021,10,1)) and + (date_courante_3 >= + date_of_numbers(2020,10,1))): + if (((loyer_eligible + montant_forfaitaire_charges_d823_16) * + decimal_of_string("0.085")) >= + money_of_cents_string("3524")): + return ((loyer_eligible + + montant_forfaitaire_charges_d823_16) * + decimal_of_string("0.085")) + else: + return money_of_cents_string("3524") + else: + raise EmptyError + def temp_participation_minimale_3(_:Any): + if (date_courante_3 >= + date_of_numbers(2021,10,1)): + if (((loyer_eligible + montant_forfaitaire_charges_d823_16) * + decimal_of_string("0.085")) >= + money_of_cents_string("3539")): + return ((loyer_eligible + + montant_forfaitaire_charges_d823_16) * + decimal_of_string("0.085")) + else: + return money_of_cents_string("3539") + else: + raise EmptyError + temp_participation_minimale_4 = handle_default(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=589, + start_column=10, + end_line=589, end_column=32, + law_headings=["Secteur locatif", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"]), [temp_participation_minimale_3, + temp_participation_minimale_2], + temp_participation_minimale_1, + temp_participation_minimale) + except EmptyError: + temp_participation_minimale_4 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=589, start_column=10, + end_line=589, end_column=32, + law_headings=["Secteur locatif", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + participation_minimale = temp_participation_minimale_4 + try: + try: + if ((date_courante_3 >= date_of_numbers(2020,10,1)) and + (date_courante_3 < + date_of_numbers(2021,10,1))): + temp_rapport_loyers = (decimal_round(((loyer_eligible / + loyer_reference) * decimal_of_string("100."))) / + decimal_of_string("100.")) + else: + temp_rapport_loyers = dead_value + raise EmptyError + except EmptyError: + if (date_courante_3 >= + date_of_numbers(2021,10,1)): + temp_rapport_loyers = (decimal_round(((loyer_eligible / + loyer_reference) * decimal_of_string("100."))) / + decimal_of_string("100.")) + else: + temp_rapport_loyers = dead_value + raise EmptyError + except EmptyError: + temp_rapport_loyers = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=577, start_column=11, + end_line=577, end_column=25, + law_headings=["Secteur locatif", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + rapport_loyers = temp_rapport_loyers + try: + def temp_traitement_aide_finale_minoration_forfaitaire(param_2:Money): + try: + if ((traitement_aide_finale_diminue(param_2) - + montant_forfaitaire_d823_16) >= + money_of_cents_string("0")): + return (traitement_aide_finale_diminue(param_2) - + montant_forfaitaire_d823_16) + else: + return money_of_cents_string("0") + except EmptyError: + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=600, + start_column=10, + end_line=600, + end_column=32, + law_headings=["Secteur locatif", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + except EmptyError: + temp_traitement_aide_finale_minoration_forfaitaire = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=600, start_column=10, + end_line=600, end_column=32, + law_headings=["Secteur locatif", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + traitement_aide_finale_minoration_forfaitaire = temp_traitement_aide_finale_minoration_forfaitaire + try: + try: + if ((date_courante_3 >= date_of_numbers(2020,10,1)) and + (date_courante_3 < + date_of_numbers(2021,10,1))): + if (rapport_loyers < + decimal_of_string("0.45")): + temp_taux_loyer_eligible_formule = decimal_of_string("0.") + else: + if ((rapport_loyers >= decimal_of_string("0.45")) and + (rapport_loyers < + decimal_of_string("0.75"))): + temp_taux_loyer_eligible_formule = (decimal_of_string("0.0045") * + (rapport_loyers - decimal_of_string("0.0045"))) + else: + if (rapport_loyers >= + decimal_of_string("0.75")): + temp_taux_loyer_eligible_formule = ((decimal_of_string("0.0045") * + decimal_of_string("0.3")) + + (decimal_of_string("0.0068") * + (rapport_loyers - + decimal_of_string("0.75")))) + else: + temp_taux_loyer_eligible_formule = decimal_of_string("0.") + else: + temp_taux_loyer_eligible_formule = dead_value + raise EmptyError + except EmptyError: + if (date_courante_3 >= + date_of_numbers(2021,10,1)): + if (rapport_loyers < + decimal_of_string("0.45")): + temp_taux_loyer_eligible_formule = decimal_of_string("0.") + else: + if ((rapport_loyers >= decimal_of_string("0.45")) and + (rapport_loyers < + decimal_of_string("0.75"))): + temp_taux_loyer_eligible_formule = (decimal_of_string("0.0045") * + (rapport_loyers - decimal_of_string("0.0045"))) + else: + if (rapport_loyers >= + decimal_of_string("0.75")): + temp_taux_loyer_eligible_formule = ((decimal_of_string("0.0045") * + decimal_of_string("0.3")) + + (decimal_of_string("0.0068") * + (rapport_loyers - + decimal_of_string("0.75")))) + else: + temp_taux_loyer_eligible_formule = decimal_of_string("0.") + else: + temp_taux_loyer_eligible_formule = dead_value + raise EmptyError + except EmptyError: + temp_taux_loyer_eligible_formule = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=575, start_column=10, + end_line=575, end_column=17, + law_headings=["Secteur locatif", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + taux_loyer_eligible_formule = temp_taux_loyer_eligible_formule + try: + def temp_traitement_aide_finale_contributions_sociales_arrondi(param_3:Money): + try: + if ((money_round(((traitement_aide_finale_minoration_forfaitaire( + param_3) - + contributions_sociales_dot_montant(traitement_aide_finale_minoration_forfaitaire( + param_3))) - + money_of_cents_string("50"))) + + contributions_sociales_dot_montant(traitement_aide_finale_minoration_forfaitaire( + param_3))) >= + money_of_cents_string("0")): + return (money_round(((traitement_aide_finale_minoration_forfaitaire( + param_3) - + contributions_sociales_dot_montant(traitement_aide_finale_minoration_forfaitaire( + param_3))) - + money_of_cents_string("50"))) + + contributions_sociales_dot_montant(traitement_aide_finale_minoration_forfaitaire( + param_3))) + else: + return money_of_cents_string("0") + except EmptyError: + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=601, + start_column=10, + end_line=601, + end_column=40, + law_headings=["Secteur locatif", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + except EmptyError: + temp_traitement_aide_finale_contributions_sociales_arrondi = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=601, start_column=10, + end_line=601, end_column=40, + law_headings=["Secteur locatif", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + traitement_aide_finale_contributions_sociales_arrondi = temp_traitement_aide_finale_contributions_sociales_arrondi + try: + try: + if ((date_courante_3 >= date_of_numbers(2020,10,1)) and + (date_courante_3 < + date_of_numbers(2021,10,1))): + temp_taux_loyer_eligible_arrondi = (decimal_round((taux_loyer_eligible_formule * + decimal_of_string("100000."))) / + decimal_of_string("100000.")) + else: + temp_taux_loyer_eligible_arrondi = dead_value + raise EmptyError + except EmptyError: + if (date_courante_3 >= + date_of_numbers(2021,10,1)): + temp_taux_loyer_eligible_arrondi = (decimal_round((taux_loyer_eligible_formule * + decimal_of_string("100000."))) / + decimal_of_string("100000.")) + else: + temp_taux_loyer_eligible_arrondi = dead_value + raise EmptyError + except EmptyError: + temp_taux_loyer_eligible_arrondi = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=576, start_column=10, + end_line=576, end_column=17, + law_headings=["Secteur locatif", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + taux_loyer_eligible_arrondi = temp_taux_loyer_eligible_arrondi + try: + def temp_traitement_aide_finale_reduction_loyer_solidarite(param_4:Money): + try: + if ((traitement_aide_finale_contributions_sociales_arrondi( + param_4) - (reduction_loyer_solidarite * + fraction_l832_3)) >= + money_of_cents_string("0")): + return (traitement_aide_finale_contributions_sociales_arrondi( + param_4) - (reduction_loyer_solidarite * + fraction_l832_3)) + else: + return money_of_cents_string("0") + except EmptyError: + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=602, + start_column=10, + end_line=602, + end_column=36, + law_headings=["Secteur locatif", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + except EmptyError: + temp_traitement_aide_finale_reduction_loyer_solidarite = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=602, start_column=10, + end_line=602, end_column=36, + law_headings=["Secteur locatif", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + traitement_aide_finale_reduction_loyer_solidarite = temp_traitement_aide_finale_reduction_loyer_solidarite + try: + temp_taux_prise_compte_ressources = (taux_composition_familiale + + taux_loyer_eligible_arrondi) + except EmptyError: + temp_taux_prise_compte_ressources = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=585, start_column=11, + end_line=585, end_column=39, + law_headings=["Secteur locatif", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + taux_prise_compte_ressources = temp_taux_prise_compte_ressources + try: + def temp_traitement_aide_finale_montant_minimal(param_5:Money): + try: + if (traitement_aide_finale_reduction_loyer_solidarite( + param_5) < + montant_minimal_aide_d823_16): + return money_of_cents_string("0") + else: + return traitement_aide_finale_reduction_loyer_solidarite( + param_5) + except EmptyError: + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=603, + start_column=10, + end_line=603, + end_column=25, + law_headings=["Secteur locatif", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + except EmptyError: + temp_traitement_aide_finale_montant_minimal = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=603, start_column=10, + end_line=603, end_column=25, + law_headings=["Secteur locatif", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + traitement_aide_finale_montant_minimal = temp_traitement_aide_finale_montant_minimal + try: + temp_participation_personnelle = (participation_minimale + + ((ressources_menage_arrondies_1 - + abattement_forfaitaire_d823_17) * taux_prise_compte_ressources)) + except EmptyError: + temp_participation_personnelle = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=591, start_column=10, + end_line=591, end_column=35, + law_headings=["Secteur locatif", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + participation_personnelle = temp_participation_personnelle + try: + if (((loyer_eligible + montant_forfaitaire_charges_d823_16) - + participation_personnelle) < + money_of_cents_string("0")): + temp_aide_finale_formule = money_of_cents_string("0") + else: + temp_aide_finale_formule = ((loyer_eligible + + montant_forfaitaire_charges_d823_16) - + participation_personnelle) + except EmptyError: + temp_aide_finale_formule = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=596, start_column=10, + end_line=596, end_column=29, + law_headings=["Secteur locatif", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + aide_finale_formule = temp_aide_finale_formule + try: + temp___1 = (plafond_degressivite_d823_16 >= + (plafond_loyer_d823_16_2 * decimal_of_string("2.5"))) + except EmptyError: + temp___1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", + start_line=1929, + start_column=13, end_line=1929, + end_column=76, + law_headings=["Article D823-16", + "Sous-section 2 : Calcul de l'aide en secteur locatif", + "Section 1 : Calcul, liquidation et versement des aides", + "Chapitre III : Modalités de liquidation et de versement", + "Titre II : Dispositions communes aux aides personnelles au logement", + "Livre VIII : Aides personnelles au logement", + "Partie réglementaire", + "Code de la construction et de l'habitation"])) + if not (temp___1): + raise AssertionFailure(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", + start_line=1929, + start_column=13, end_line=1929, + end_column=76, + law_headings=["Article D823-16", + "Sous-section 2 : Calcul de l'aide en secteur locatif", + "Section 1 : Calcul, liquidation et versement des aides", + "Chapitre III : Modalités de liquidation et de versement", + "Titre II : Dispositions communes aux aides personnelles au logement", + "Livre VIII : Aides personnelles au logement", + "Partie réglementaire", + "Code de la construction et de l'habitation"])) + try: + temp___2 = ((fraction_l832_3 >= decimal_of_string("0.9")) and + (fraction_l832_3 <= decimal_of_string("0.98"))) + except EmptyError: + temp___2 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_legislatif.catala_fr", + start_line=833, start_column=13, + end_line=833, end_column=63, + law_headings=["Article L832-3", + "Chapitre Ier : Champ d'application", + "Titre III : Aide personnalisée au logement", + "Livre VIII : Aides personnelles au logement", + "Partie législative", + "Code de la construction et de l'habitation"])) + if not (temp___2): + raise AssertionFailure(SourcePosition(filename="examples/aides_logement/code_construction_legislatif.catala_fr", + start_line=833, + start_column=13, end_line=833, + end_column=63, + law_headings=["Article L832-3", + "Chapitre Ier : Champ d'application", + "Titre III : Aide personnalisée au logement", + "Livre VIII : Aides personnelles au logement", + "Partie législative", + "Code de la construction et de l'habitation"])) + return CalculAidePersonnaliseeLogementLocatifOut(montant_forfaitaire_charges_d823_16_out = montant_forfaitaire_charges_d823_16, + plafond_loyer_d823_16_2_out = plafond_loyer_d823_16_2, + participation_minimale_out = participation_minimale, + taux_composition_familiale_out = taux_composition_familiale, + participation_personnelle_out = participation_personnelle, + aide_finale_formule_out = aide_finale_formule, + traitement_aide_finale_montant_minimal_out = traitement_aide_finale_montant_minimal) + +def calcul_aide_personnalisee_logement_foyer(calcul_aide_personnalisee_logement_foyer_in:CalculAidePersonnaliseeLogementFoyerIn): + mode_occupation_1 = calcul_aide_personnalisee_logement_foyer_in.mode_occupation_in + ressources_menage_arrondies_2 = calcul_aide_personnalisee_logement_foyer_in.ressources_menage_arrondies_in + nombre_personnes_a_charge_3 = calcul_aide_personnalisee_logement_foyer_in.nombre_personnes_a_charge_in + situation_familiale_calcul_apl_3 = calcul_aide_personnalisee_logement_foyer_in.situation_familiale_calcul_apl_in + zone_1 = calcul_aide_personnalisee_logement_foyer_in.zone_in + date_courante_4 = calcul_aide_personnalisee_logement_foyer_in.date_courante_in + redevance = calcul_aide_personnalisee_logement_foyer_in.redevance_in + condition_2_du_832_25_2 = calcul_aide_personnalisee_logement_foyer_in.condition_2_du_832_25_in + n_nombre_parts_d832_25_2 = calcul_aide_personnalisee_logement_foyer_in.n_nombre_parts_d832_25_in + try: + temp_coefficient_r_d832_25 = money_of_cents_string("121726") + except EmptyError: + temp_coefficient_r_d832_25 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=643, start_column=10, + end_line=643, end_column=31, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + coefficient_r_d832_25 = temp_coefficient_r_d832_25 + try: + temp_montant_forfaitaire_d832_24 = money_of_cents_string("500") + except EmptyError: + temp_montant_forfaitaire_d832_24 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=650, start_column=11, + end_line=650, end_column=38, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + montant_forfaitaire_d832_24 = temp_montant_forfaitaire_d832_24 + try: + temp_montant_minimal_aide_d823_24 = money_of_cents_string("1000") + except EmptyError: + temp_montant_minimal_aide_d823_24 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=652, start_column=11, + end_line=652, end_column=39, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + montant_minimal_aide_d823_24 = temp_montant_minimal_aide_d823_24 + try: + try: + temp_condition_2_du_832_25 = condition_2_du_832_25_2(Unit()) + except EmptyError: + match_arg_62 = mode_occupation_1 + if match_arg_62.code == ModeOccupation_Code.Locataire: + _ = match_arg_62.value + temp_condition_2_du_832_25 = False + elif match_arg_62.code == ModeOccupation_Code.ResidentLogementFoyer: + logement_foyer = match_arg_62.value + match_arg_63 = logement_foyer.type + if match_arg_63.code == TypeLogementFoyer_Code.LogementPersonnesAgeesOuHandicapees: + _ = match_arg_63.value + temp_condition_2_du_832_25 = False + elif match_arg_63.code == TypeLogementFoyer_Code.ResidenceSociale: + _ = match_arg_63.value + temp_condition_2_du_832_25 = (logement_foyer.date_conventionnement >= + date_of_numbers(1994,12,31)) + elif match_arg_63.code == TypeLogementFoyer_Code.FoyerJeunesTrvailleursOuMigrantsConventionneL353_2Avant1995: + _ = match_arg_63.value + temp_condition_2_du_832_25 = (logement_foyer.date_conventionnement >= + date_of_numbers(1990,9,30)) + elif match_arg_63.code == TypeLogementFoyer_Code.Autre: + _ = match_arg_63.value + temp_condition_2_du_832_25 = False + elif match_arg_62.code == ModeOccupation_Code.AccessionProprieteLocalUsageExclusifHabitation: + _ = match_arg_62.value + temp_condition_2_du_832_25 = False + elif match_arg_62.code == ModeOccupation_Code.SousLocataire: + _ = match_arg_62.value + temp_condition_2_du_832_25 = False + elif match_arg_62.code == ModeOccupation_Code.LocationAccession: + _ = match_arg_62.value + temp_condition_2_du_832_25 = False + except EmptyError: + temp_condition_2_du_832_25 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=640, start_column=12, + end_line=640, end_column=33, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + condition_2_du_832_25_3 = temp_condition_2_du_832_25 + try: + temp_contributions_sociales_dot_date_courante_1 = date_courante_4 + except EmptyError: + temp_contributions_sociales_dot_date_courante_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=544, start_column=10, + end_line=544, end_column=23, + law_headings=["Calcul des contributions sociales s'appliquant aux aides personnelles au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + contributions_sociales_dot_date_courante_1 = temp_contributions_sociales_dot_date_courante_1 + result_1 = contributions_sociales_aides_personnelle_logement(ContributionsSocialesAidesPersonnelleLogementIn(date_courante_in = contributions_sociales_dot_date_courante_1)) + contributions_sociales_dot_montant_1 = result_1.montant_out + try: + def temp_plafond_equivalence_loyer_eligible(_:Any): + raise EmptyError + def temp_plafond_equivalence_loyer_eligible_1(_:Any): + return False + def temp_plafond_equivalence_loyer_eligible_2(_:Any): + if ((date_courante_4 < date_of_numbers(2021,10,1)) and + (date_courante_4 >= + date_of_numbers(2020,10,1))): + match_arg_64 = zone_1 + if match_arg_64.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_64.value + if (nombre_personnes_a_charge_3 == + integer_of_string("0")): + match_arg_65 = situation_familiale_calcul_apl_3 + if match_arg_65.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_65.value + return money_of_cents_string("44443") + elif match_arg_65.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_65.value + return money_of_cents_string("52101") + else: + if (nombre_personnes_a_charge_3 == + integer_of_string("1")): + return money_of_cents_string("55555") + else: + if (nombre_personnes_a_charge_3 == + integer_of_string("2")): + return money_of_cents_string("59454") + else: + if (nombre_personnes_a_charge_3 == + integer_of_string("3")): + return money_of_cents_string("63369") + else: + return (money_of_cents_string("68350") + + (money_of_cents_string("7089") * + decimal_of_integer((nombre_personnes_a_charge_3 - + integer_of_string("4"))))) + elif match_arg_64.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_64.value + if (nombre_personnes_a_charge_3 == + integer_of_string("0")): + match_arg_66 = situation_familiale_calcul_apl_3 + if match_arg_66.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_66.value + return money_of_cents_string("40643") + elif match_arg_66.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_66.value + return money_of_cents_string("47433") + else: + if (nombre_personnes_a_charge_3 == + integer_of_string("1")): + return money_of_cents_string("50575") + else: + if (nombre_personnes_a_charge_3 == + integer_of_string("2")): + return money_of_cents_string("54138") + else: + if (nombre_personnes_a_charge_3 == + integer_of_string("3")): + return money_of_cents_string("57687") + else: + return (money_of_cents_string("61469") + + (money_of_cents_string("6407") * + decimal_of_integer((nombre_personnes_a_charge_3 - + integer_of_string("4"))))) + elif match_arg_64.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_64.value + if (nombre_personnes_a_charge_3 == + integer_of_string("0")): + match_arg_67 = situation_familiale_calcul_apl_3 + if match_arg_67.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_67.value + return money_of_cents_string("38578") + elif match_arg_67.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_67.value + return money_of_cents_string("44869") + else: + if (nombre_personnes_a_charge_3 == + integer_of_string("1")): + return money_of_cents_string("47602") + else: + if (nombre_personnes_a_charge_3 == + integer_of_string("2")): + return money_of_cents_string("50744") + else: + if (nombre_personnes_a_charge_3 == + integer_of_string("3")): + return money_of_cents_string("53884") + else: + return (money_of_cents_string("57416") + + (money_of_cents_string("5946") * + decimal_of_integer((nombre_personnes_a_charge_3 - + integer_of_string("4"))))) + else: + raise EmptyError + def temp_plafond_equivalence_loyer_eligible_3(_:Any): + if (date_courante_4 >= + date_of_numbers(2021,10,1)): + match_arg_68 = zone_1 + if match_arg_68.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_68.value + if (nombre_personnes_a_charge_3 == + integer_of_string("0")): + match_arg_69 = situation_familiale_calcul_apl_3 + if match_arg_69.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_69.value + return money_of_cents_string("44630") + elif match_arg_69.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_69.value + return money_of_cents_string("52321") + else: + if (nombre_personnes_a_charge_3 == + integer_of_string("1")): + return money_of_cents_string("55788") + else: + if (nombre_personnes_a_charge_3 == + integer_of_string("2")): + return money_of_cents_string("59704") + else: + if (nombre_personnes_a_charge_3 == + integer_of_string("3")): + return money_of_cents_string("63635") + else: + return (money_of_cents_string("68637") + + (money_of_cents_string("7119") * + decimal_of_integer((nombre_personnes_a_charge_3 - + integer_of_string("4"))))) + elif match_arg_68.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_68.value + if (nombre_personnes_a_charge_3 == + integer_of_string("0")): + match_arg_70 = situation_familiale_calcul_apl_3 + if match_arg_70.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_70.value + return money_of_cents_string("40814") + elif match_arg_70.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_70.value + return money_of_cents_string("47632") + else: + if (nombre_personnes_a_charge_3 == + integer_of_string("1")): + return money_of_cents_string("50787") + else: + if (nombre_personnes_a_charge_3 == + integer_of_string("2")): + return money_of_cents_string("54365") + else: + if (nombre_personnes_a_charge_3 == + integer_of_string("3")): + return money_of_cents_string("57929") + else: + return (money_of_cents_string("61727") + + (money_of_cents_string("6434") * + decimal_of_integer((nombre_personnes_a_charge_3 - + integer_of_string("4"))))) + elif match_arg_68.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_68.value + if (nombre_personnes_a_charge_3 == + integer_of_string("0")): + match_arg_71 = situation_familiale_calcul_apl_3 + if match_arg_71.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_71.value + return money_of_cents_string("38740") + elif match_arg_71.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_71.value + return money_of_cents_string("45057") + else: + if (nombre_personnes_a_charge_3 == + integer_of_string("1")): + return money_of_cents_string("47802") + else: + if (nombre_personnes_a_charge_3 == + integer_of_string("2")): + return money_of_cents_string("50957") + else: + if (nombre_personnes_a_charge_3 == + integer_of_string("3")): + return money_of_cents_string("54110") + else: + return (money_of_cents_string("57657") + + (money_of_cents_string("5971") * + decimal_of_integer((nombre_personnes_a_charge_3 - + integer_of_string("4"))))) + else: + raise EmptyError + temp_plafond_equivalence_loyer_eligible_4 = handle_default(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=646, + start_column=10, + end_line=646, end_column=44, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"]), [temp_plafond_equivalence_loyer_eligible_3, + temp_plafond_equivalence_loyer_eligible_2], + temp_plafond_equivalence_loyer_eligible_1, + temp_plafond_equivalence_loyer_eligible) + except EmptyError: + temp_plafond_equivalence_loyer_eligible_4 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=646, start_column=10, + end_line=646, end_column=44, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + plafond_equivalence_loyer_eligible = temp_plafond_equivalence_loyer_eligible_4 + try: + def temp_traitement_aide_finale_minoration_forfaitaire_1(param_6:Money): + try: + if ((param_6 - montant_forfaitaire_d832_24) >= + money_of_cents_string("0")): + return (param_6 - montant_forfaitaire_d832_24) + else: + return money_of_cents_string("0") + except EmptyError: + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=668, + start_column=10, + end_line=668, + end_column=32, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + except EmptyError: + temp_traitement_aide_finale_minoration_forfaitaire_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=668, start_column=10, + end_line=668, end_column=32, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + traitement_aide_finale_minoration_forfaitaire_1 = temp_traitement_aide_finale_minoration_forfaitaire_1 + try: + temp_calcul_nombre_parts_dot_condition_2_du_832_25 = condition_2_du_832_25_3 + except EmptyError: + temp_calcul_nombre_parts_dot_condition_2_du_832_25 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=625, start_column=10, + end_line=625, end_column=31, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + calcul_nombre_parts_dot_condition_2_du_832_25 = temp_calcul_nombre_parts_dot_condition_2_du_832_25 + try: + temp_calcul_nombre_parts_dot_nombre_personnes_a_charge = nombre_personnes_a_charge_3 + except EmptyError: + temp_calcul_nombre_parts_dot_nombre_personnes_a_charge = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=626, start_column=10, + end_line=626, end_column=35, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + calcul_nombre_parts_dot_nombre_personnes_a_charge = temp_calcul_nombre_parts_dot_nombre_personnes_a_charge + try: + temp_calcul_nombre_parts_dot_situation_familiale_calcul_apl = situation_familiale_calcul_apl_3 + except EmptyError: + temp_calcul_nombre_parts_dot_situation_familiale_calcul_apl = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=627, start_column=10, + end_line=627, end_column=40, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + calcul_nombre_parts_dot_situation_familiale_calcul_apl = temp_calcul_nombre_parts_dot_situation_familiale_calcul_apl + result_2 = calcul_nombre_part_logement_foyer(CalculNombrePartLogementFoyerIn(condition_2_du_832_25_in = calcul_nombre_parts_dot_condition_2_du_832_25, + nombre_personnes_a_charge_in = calcul_nombre_parts_dot_nombre_personnes_a_charge, + situation_familiale_calcul_apl_in = calcul_nombre_parts_dot_situation_familiale_calcul_apl)) + calcul_nombre_parts_dot_n_nombre_parts_d832_25 = result_2.n_nombre_parts_d832_25_out + try: + if condition_2_du_832_25_3: + temp_montant_forfaitaire_d832_27 = money_of_cents_string("1500") + else: + temp_montant_forfaitaire_d832_27 = money_of_cents_string("2668") + except EmptyError: + temp_montant_forfaitaire_d832_27 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=651, start_column=11, + end_line=651, end_column=38, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + montant_forfaitaire_d832_27 = temp_montant_forfaitaire_d832_27 + try: + if condition_2_du_832_25_3: + temp_coefficient_multiplicateur_d832_25 = money_of_cents_string("2142091") + else: + temp_coefficient_multiplicateur_d832_25 = money_of_cents_string("1339340") + except EmptyError: + temp_coefficient_multiplicateur_d832_25 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=642, start_column=10, + end_line=642, end_column=44, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + coefficient_multiplicateur_d832_25 = temp_coefficient_multiplicateur_d832_25 + try: + if (redevance >= + plafond_equivalence_loyer_eligible): + temp_equivalence_loyer_eligible = plafond_equivalence_loyer_eligible + else: + temp_equivalence_loyer_eligible = redevance + except EmptyError: + temp_equivalence_loyer_eligible = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=645, start_column=10, + end_line=645, end_column=36, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + equivalence_loyer_eligible = temp_equivalence_loyer_eligible + try: + try: + temp_n_nombre_parts_d832_25_1 = n_nombre_parts_d832_25_2(Unit()) + except EmptyError: + temp_n_nombre_parts_d832_25_1 = calcul_nombre_parts_dot_n_nombre_parts_d832_25 + except EmptyError: + temp_n_nombre_parts_d832_25_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=644, start_column=19, + end_line=644, end_column=41, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + n_nombre_parts_d832_25_3 = temp_n_nombre_parts_d832_25_1 + try: + def temp_depense_nette_minimale_d832_27(param_7:Money): + try: + return (equivalence_loyer_eligible - param_7) + except EmptyError: + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=649, + start_column=11, + end_line=649, + end_column=41, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + except EmptyError: + temp_depense_nette_minimale_d832_27 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=649, start_column=11, + end_line=649, end_column=41, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + depense_nette_minimale_d832_27 = temp_depense_nette_minimale_d832_27 + try: + temp_calcul_equivalence_loyer_minimale_dot_ressources_menage_arrondies = ressources_menage_arrondies_2 + except EmptyError: + temp_calcul_equivalence_loyer_minimale_dot_ressources_menage_arrondies = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=613, start_column=10, + end_line=613, end_column=37, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + calcul_equivalence_loyer_minimale_dot_ressources_menage_arrondies = temp_calcul_equivalence_loyer_minimale_dot_ressources_menage_arrondies + try: + temp_calcul_equivalence_loyer_minimale_dot_condition_2_du_832_25 = condition_2_du_832_25_3 + except EmptyError: + temp_calcul_equivalence_loyer_minimale_dot_condition_2_du_832_25 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=614, start_column=10, + end_line=614, end_column=31, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + calcul_equivalence_loyer_minimale_dot_condition_2_du_832_25 = temp_calcul_equivalence_loyer_minimale_dot_condition_2_du_832_25 + try: + temp_calcul_equivalence_loyer_minimale_dot_n_nombre_parts_d832_25 = n_nombre_parts_d832_25_3 + except EmptyError: + temp_calcul_equivalence_loyer_minimale_dot_n_nombre_parts_d832_25 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=615, start_column=10, + end_line=615, end_column=32, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + calcul_equivalence_loyer_minimale_dot_n_nombre_parts_d832_25 = temp_calcul_equivalence_loyer_minimale_dot_n_nombre_parts_d832_25 + result_3 = calcul_equivalence_loyer_minimale(CalculEquivalenceLoyerMinimaleIn(ressources_menage_arrondies_in = calcul_equivalence_loyer_minimale_dot_ressources_menage_arrondies, + condition_2_du_832_25_in = calcul_equivalence_loyer_minimale_dot_condition_2_du_832_25, + n_nombre_parts_d832_25_in = calcul_equivalence_loyer_minimale_dot_n_nombre_parts_d832_25)) + calcul_equivalence_loyer_minimale_dot_montant = result_3.montant_out + try: + try: + if condition_2_du_832_25_3: + temp_coefficient_prise_en_charge_d832_25_formule = (decimal_of_string("0.9") - + (ressources_menage_arrondies_2 / + (coefficient_multiplicateur_d832_25 * + n_nombre_parts_d832_25_3))) + else: + temp_coefficient_prise_en_charge_d832_25_formule = dead_value + raise EmptyError + except EmptyError: + temp_coefficient_prise_en_charge_d832_25_formule = (decimal_of_string("0.95") - + ((ressources_menage_arrondies_2 - (coefficient_r_d832_25 * + n_nombre_parts_d832_25_3)) / + (coefficient_multiplicateur_d832_25 * + n_nombre_parts_d832_25_3))) + except EmptyError: + temp_coefficient_prise_en_charge_d832_25_formule = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=662, start_column=10, + end_line=662, end_column=17, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + coefficient_prise_en_charge_d832_25_formule = temp_coefficient_prise_en_charge_d832_25_formule + try: + def temp_abattement_depense_nette_minimale_d832_27(param_8:Money): + try: + if (depense_nette_minimale_d832_27(param_8) <= + montant_forfaitaire_d832_27): + return (montant_forfaitaire_d832_27 - + depense_nette_minimale_d832_27(param_8)) + else: + return money_of_cents_string("0") + except EmptyError: + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=647, + start_column=11, + end_line=647, + end_column=52, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + except EmptyError: + temp_abattement_depense_nette_minimale_d832_27 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=647, start_column=11, + end_line=647, end_column=52, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + abattement_depense_nette_minimale_d832_27 = temp_abattement_depense_nette_minimale_d832_27 + try: + temp_equivalence_loyer_minimale = calcul_equivalence_loyer_minimale_dot_montant + except EmptyError: + temp_equivalence_loyer_minimale = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=653, start_column=10, + end_line=653, end_column=36, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + equivalence_loyer_minimale = temp_equivalence_loyer_minimale + try: + try: + if condition_2_du_832_25_3: + temp_coefficient_prise_en_charge_d832_25_arrondi = (decimal_round(((coefficient_prise_en_charge_d832_25_formule - + decimal_of_string("0.005")) * + decimal_of_string("100."))) / decimal_of_string("100.")) + else: + temp_coefficient_prise_en_charge_d832_25_arrondi = dead_value + raise EmptyError + except EmptyError: + temp_coefficient_prise_en_charge_d832_25_arrondi = (decimal_round(((coefficient_prise_en_charge_d832_25_formule - + decimal_of_string("0.005")) * decimal_of_string("100."))) / + decimal_of_string("100.")) + except EmptyError: + temp_coefficient_prise_en_charge_d832_25_arrondi = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=663, start_column=10, + end_line=663, end_column=17, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + coefficient_prise_en_charge_d832_25_arrondi = temp_coefficient_prise_en_charge_d832_25_arrondi + try: + def temp_traitement_aide_finale_abattement(param_9:Money): + try: + if ((traitement_aide_finale_minoration_forfaitaire_1( + param_9) - + abattement_depense_nette_minimale_d832_27(traitement_aide_finale_minoration_forfaitaire_1( + param_9))) >= + money_of_cents_string("0")): + return (traitement_aide_finale_minoration_forfaitaire_1( + param_9) - + abattement_depense_nette_minimale_d832_27(traitement_aide_finale_minoration_forfaitaire_1( + param_9))) + else: + return money_of_cents_string("0") + except EmptyError: + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=669, + start_column=10, + end_line=669, + end_column=20, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + except EmptyError: + temp_traitement_aide_finale_abattement = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=669, start_column=10, + end_line=669, end_column=20, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + traitement_aide_finale_abattement = temp_traitement_aide_finale_abattement + try: + try: + if condition_2_du_832_25_3: + if (coefficient_prise_en_charge_d832_25_arrondi >= + decimal_of_string("0.9")): + temp_coefficient_prise_en_charge_d832_25_seuil = decimal_of_string("0.9") + else: + temp_coefficient_prise_en_charge_d832_25_seuil = coefficient_prise_en_charge_d832_25_arrondi + else: + temp_coefficient_prise_en_charge_d832_25_seuil = dead_value + raise EmptyError + except EmptyError: + if (coefficient_prise_en_charge_d832_25_arrondi >= + decimal_of_string("0.95")): + temp_coefficient_prise_en_charge_d832_25_seuil = decimal_of_string("0.95") + else: + temp_coefficient_prise_en_charge_d832_25_seuil = coefficient_prise_en_charge_d832_25_arrondi + except EmptyError: + temp_coefficient_prise_en_charge_d832_25_seuil = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=664, start_column=10, + end_line=664, end_column=15, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + coefficient_prise_en_charge_d832_25_seuil = temp_coefficient_prise_en_charge_d832_25_seuil + try: + def temp_traitement_aide_finale_contributions_sociales_arrondi_1(param_10:Money): + try: + if ((money_round(((traitement_aide_finale_abattement( + param_10) - + contributions_sociales_dot_montant_1(traitement_aide_finale_abattement( + param_10))) - + money_of_cents_string("50"))) + + contributions_sociales_dot_montant_1(traitement_aide_finale_abattement( + param_10))) >= + money_of_cents_string("0")): + return (money_round(((traitement_aide_finale_abattement( + param_10) - + contributions_sociales_dot_montant_1(traitement_aide_finale_abattement( + param_10))) - + money_of_cents_string("50"))) + + contributions_sociales_dot_montant_1(traitement_aide_finale_abattement( + param_10))) + else: + return money_of_cents_string("0") + except EmptyError: + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=670, + start_column=10, + end_line=670, + end_column=40, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + except EmptyError: + temp_traitement_aide_finale_contributions_sociales_arrondi_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=670, start_column=10, + end_line=670, end_column=40, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + traitement_aide_finale_contributions_sociales_arrondi_1 = temp_traitement_aide_finale_contributions_sociales_arrondi_1 + try: + if (((equivalence_loyer_eligible - equivalence_loyer_minimale) * + coefficient_prise_en_charge_d832_25_seuil) < + money_of_cents_string("0")): + temp_aide_finale_formule_1 = money_of_cents_string("0") + else: + temp_aide_finale_formule_1 = ((equivalence_loyer_eligible - + equivalence_loyer_minimale) * + coefficient_prise_en_charge_d832_25_seuil) + except EmptyError: + temp_aide_finale_formule_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=666, start_column=10, + end_line=666, end_column=29, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + aide_finale_formule_1 = temp_aide_finale_formule_1 + try: + def temp_traitement_aide_finale_montant_minimal_1(param_11:Money): + try: + if (traitement_aide_finale_contributions_sociales_arrondi_1( + param_11) < + montant_minimal_aide_d823_24): + return money_of_cents_string("0") + else: + return traitement_aide_finale_contributions_sociales_arrondi_1( + param_11) + except EmptyError: + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=671, + start_column=10, + end_line=671, + end_column=25, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + except EmptyError: + temp_traitement_aide_finale_montant_minimal_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=671, start_column=10, + end_line=671, end_column=25, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + traitement_aide_finale_montant_minimal_1 = temp_traitement_aide_finale_montant_minimal_1 + return CalculAidePersonnaliseeLogementFoyerOut(coefficient_multiplicateur_d832_25_out = coefficient_multiplicateur_d832_25, + coefficient_r_d832_25_out = coefficient_r_d832_25, + n_nombre_parts_d832_25_out = n_nombre_parts_d832_25_3, + equivalence_loyer_eligible_out = equivalence_loyer_eligible, + plafond_equivalence_loyer_eligible_out = plafond_equivalence_loyer_eligible, + equivalence_loyer_minimale_out = equivalence_loyer_minimale, + coefficient_prise_en_charge_d832_25_seuil_out = coefficient_prise_en_charge_d832_25_seuil, + aide_finale_formule_out = aide_finale_formule_1, + traitement_aide_finale_montant_minimal_out = traitement_aide_finale_montant_minimal_1) + +def calcul_aide_personnalisee_logement_accession_propriete(calcul_aide_personnalisee_logement_accession_propriete_in:CalculAidePersonnaliseeLogementAccessionProprieteIn): + mensualite_principale = calcul_aide_personnalisee_logement_accession_propriete_in.mensualite_principale_in + ressources_menage_arrondies_3 = calcul_aide_personnalisee_logement_accession_propriete_in.ressources_menage_arrondies_in + nombre_personnes_a_charge_4 = calcul_aide_personnalisee_logement_accession_propriete_in.nombre_personnes_a_charge_in + situation_familiale_calcul_apl_4 = calcul_aide_personnalisee_logement_accession_propriete_in.situation_familiale_calcul_apl_in + type_travaux_logement = calcul_aide_personnalisee_logement_accession_propriete_in.type_travaux_logement_in + date_signature_pret = calcul_aide_personnalisee_logement_accession_propriete_in.date_signature_pret_in + local_habite_premiere_fois_beneficiaire = calcul_aide_personnalisee_logement_accession_propriete_in.local_habite_premiere_fois_beneficiaire_in + date_entree_logement = calcul_aide_personnalisee_logement_accession_propriete_in.date_entree_logement_in + copropriete = calcul_aide_personnalisee_logement_accession_propriete_in.copropriete_in + situation_r822_11_13_17 = calcul_aide_personnalisee_logement_accession_propriete_in.situation_r822_11_13_17_in + zone_2 = calcul_aide_personnalisee_logement_accession_propriete_in.zone_in + type_pret = calcul_aide_personnalisee_logement_accession_propriete_in.type_pret_in + anciennete_logement = calcul_aide_personnalisee_logement_accession_propriete_in.anciennete_logement_in + date_courante_5 = calcul_aide_personnalisee_logement_accession_propriete_in.date_courante_in + try: + temp_montant_forfaitaire_d832_10 = money_of_cents_string("500") + except EmptyError: + temp_montant_forfaitaire_d832_10 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=720, start_column=11, + end_line=720, end_column=38, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + montant_forfaitaire_d832_10 = temp_montant_forfaitaire_d832_10 + try: + temp_montant_minimal_aide_d832_10 = money_of_cents_string("1000") + except EmptyError: + temp_montant_minimal_aide_d832_10 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=721, start_column=11, + end_line=721, end_column=39, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + montant_minimal_aide_d832_10 = temp_montant_minimal_aide_d832_10 + try: + temp_coefficient_multiplicateur_d832_11 = money_of_cents_string("2211133") + except EmptyError: + temp_coefficient_multiplicateur_d832_11 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=723, start_column=11, + end_line=723, end_column=45, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + coefficient_multiplicateur_d832_11 = temp_coefficient_multiplicateur_d832_11 + try: + temp_coefficient_multiplicateur_d832_18 = decimal_of_string("16.25") + except EmptyError: + temp_coefficient_multiplicateur_d832_18 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=724, start_column=11, + end_line=724, end_column=45, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + coefficient_multiplicateur_d832_18 = temp_coefficient_multiplicateur_d832_18 + try: + temp_montant_limite_tranches_d832_15_1 = money_of_cents_string("560085") + except EmptyError: + temp_montant_limite_tranches_d832_15_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=725, start_column=11, + end_line=725, end_column=44, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + montant_limite_tranches_d832_15_1 = temp_montant_limite_tranches_d832_15_1 + try: + temp_taux_tranche_inferieure_d832_15_1 = decimal_of_string("0.208") + except EmptyError: + temp_taux_tranche_inferieure_d832_15_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=726, start_column=11, + end_line=726, end_column=44, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + taux_tranche_inferieure_d832_15_1 = temp_taux_tranche_inferieure_d832_15_1 + try: + temp_taux_tranche_superieure_d832_15_1 = decimal_of_string("0.416") + except EmptyError: + temp_taux_tranche_superieure_d832_15_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=727, start_column=11, + end_line=727, end_column=44, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + taux_tranche_superieure_d832_15_1 = temp_taux_tranche_superieure_d832_15_1 + try: + temp_taux_francs_vers_euros = (decimal_of_string("1.") / + decimal_of_string("6.55957")) + except EmptyError: + temp_taux_francs_vers_euros = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=728, start_column=11, + end_line=728, end_column=33, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + taux_francs_vers_euros = temp_taux_francs_vers_euros + try: + temp_calcul_nombre_parts_dot_nombre_personnes_a_charge_1 = nombre_personnes_a_charge_4 + except EmptyError: + temp_calcul_nombre_parts_dot_nombre_personnes_a_charge_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=681, start_column=10, + end_line=681, end_column=35, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + calcul_nombre_parts_dot_nombre_personnes_a_charge_1 = temp_calcul_nombre_parts_dot_nombre_personnes_a_charge_1 + try: + temp_calcul_nombre_parts_dot_situation_familiale_calcul_apl_1 = situation_familiale_calcul_apl_4 + except EmptyError: + temp_calcul_nombre_parts_dot_situation_familiale_calcul_apl_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=682, start_column=10, + end_line=682, end_column=40, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + calcul_nombre_parts_dot_situation_familiale_calcul_apl_1 = temp_calcul_nombre_parts_dot_situation_familiale_calcul_apl_1 + result_4 = calcul_nombre_parts_accession_propriete(CalculNombrePartsAccessionProprieteIn(nombre_personnes_a_charge_in = calcul_nombre_parts_dot_nombre_personnes_a_charge_1, + situation_familiale_calcul_apl_in = calcul_nombre_parts_dot_situation_familiale_calcul_apl_1)) + calcul_nombre_parts_dot_n_nombre_parts_d832_11 = result_4.n_nombre_parts_d832_11_out + try: + match_arg_72 = anciennete_logement + if match_arg_72.code == NeufOuAncien_Code.Neuf: + _ = match_arg_72.value + if (date_signature_pret <= + date_of_numbers(1998,10,1)): + temp_coefficient_multiplicateur_d832_17_3 = decimal_of_string("0.0226") + else: + temp_coefficient_multiplicateur_d832_17_3 = decimal_of_string("0.0234") + elif match_arg_72.code == NeufOuAncien_Code.Ancien: + ameliore_par_occupant = match_arg_72.value + match_arg_73 = ameliore_par_occupant + if match_arg_73.code == AmelioreParOccupant_Code.Oui: + _ = match_arg_73.value + temp_coefficient_multiplicateur_d832_17_3 = decimal_of_string("0.0172") + elif match_arg_73.code == AmelioreParOccupant_Code.Non: + _ = match_arg_73.value + if (date_signature_pret <= + date_of_numbers(1998,10,1)): + temp_coefficient_multiplicateur_d832_17_3 = decimal_of_string("0.0226") + else: + temp_coefficient_multiplicateur_d832_17_3 = decimal_of_string("0.0234") + except EmptyError: + temp_coefficient_multiplicateur_d832_17_3 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=722, start_column=11, + end_line=722, end_column=47, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + coefficient_multiplicateur_d832_17_3 = temp_coefficient_multiplicateur_d832_17_3 + try: + temp_contributions_sociales_dot_date_courante_2 = date_courante_5 + except EmptyError: + temp_contributions_sociales_dot_date_courante_2 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=544, start_column=10, + end_line=544, end_column=23, + law_headings=["Calcul des contributions sociales s'appliquant aux aides personnelles au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + contributions_sociales_dot_date_courante_2 = temp_contributions_sociales_dot_date_courante_2 + result_5 = contributions_sociales_aides_personnelle_logement(ContributionsSocialesAidesPersonnelleLogementIn(date_courante_in = contributions_sociales_dot_date_courante_2)) + contributions_sociales_dot_montant_2 = result_5.montant_out + try: + try: + def temp_montant_forfaitaire_charges_d832_10(_:Any): + raise EmptyError + def temp_montant_forfaitaire_charges_d832_10_1(_:Any): + return False + def temp_montant_forfaitaire_charges_d832_10_2(_:Any): + if (((date_courante_5 < date_of_numbers(2021,10,1)) and + (date_courante_5 >= date_of_numbers(2020,10,1))) and + copropriete): + match_arg_74 = situation_familiale_calcul_apl_4 + if match_arg_74.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_74.value + temp_montant_forfaitaire_charges_d832_10_3 = money_of_cents_string("2699") + elif match_arg_74.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_74.value + temp_montant_forfaitaire_charges_d832_10_3 = money_of_cents_string("5399") + return (temp_montant_forfaitaire_charges_d832_10_3 + + (money_of_cents_string("1224") * + decimal_of_integer(nombre_personnes_a_charge_4))) + else: + raise EmptyError + def temp_montant_forfaitaire_charges_d832_10_4(_:Any): + if ((date_courante_5 >= date_of_numbers(2021,10,1)) and + copropriete): + match_arg_75 = situation_familiale_calcul_apl_4 + if match_arg_75.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_75.value + temp_montant_forfaitaire_charges_d832_10_5 = money_of_cents_string("2710") + elif match_arg_75.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_75.value + temp_montant_forfaitaire_charges_d832_10_5 = money_of_cents_string("5422") + return (temp_montant_forfaitaire_charges_d832_10_5 + + (money_of_cents_string("1229") * + decimal_of_integer(nombre_personnes_a_charge_4))) + else: + raise EmptyError + temp_montant_forfaitaire_charges_d832_10_6 = handle_default( + SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=719, start_column=11, end_line=719, end_column=46, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"]), [temp_montant_forfaitaire_charges_d832_10_4, + temp_montant_forfaitaire_charges_d832_10_2], + temp_montant_forfaitaire_charges_d832_10_1, + temp_montant_forfaitaire_charges_d832_10) + except EmptyError: + def temp_montant_forfaitaire_charges_d832_10_7(_:Any): + raise EmptyError + def temp_montant_forfaitaire_charges_d832_10_8(_:Any): + return False + def temp_montant_forfaitaire_charges_d832_10_9(_:Any): + if ((date_courante_5 < date_of_numbers(2021,10,1)) and + (date_courante_5 >= + date_of_numbers(2020,10,1))): + return (money_of_cents_string("5399") + + (money_of_cents_string("1224") * + decimal_of_integer(nombre_personnes_a_charge_4))) + else: + raise EmptyError + def temp_montant_forfaitaire_charges_d832_10_10(_:Any): + if (date_courante_5 >= + date_of_numbers(2021,10,1)): + return (money_of_cents_string("5422") + + (money_of_cents_string("1229") * + decimal_of_integer(nombre_personnes_a_charge_4))) + else: + raise EmptyError + temp_montant_forfaitaire_charges_d832_10_6 = handle_default( + SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=719, start_column=11, end_line=719, end_column=46, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"]), [temp_montant_forfaitaire_charges_d832_10_10, + temp_montant_forfaitaire_charges_d832_10_9], + temp_montant_forfaitaire_charges_d832_10_8, + temp_montant_forfaitaire_charges_d832_10_7) + except EmptyError: + temp_montant_forfaitaire_charges_d832_10_6 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=719, start_column=11, + end_line=719, end_column=46, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + montant_forfaitaire_charges_d832_10 = temp_montant_forfaitaire_charges_d832_10_6 + try: + def temp_traitement_aide_finale_minoration_forfaitaire_2(param_12:Money): + try: + if ((param_12 - montant_forfaitaire_d832_10) >= + money_of_cents_string("0")): + return (param_12 - montant_forfaitaire_d832_10) + else: + return money_of_cents_string("0") + except EmptyError: + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=738, + start_column=10, + end_line=738, + end_column=32, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + except EmptyError: + temp_traitement_aide_finale_minoration_forfaitaire_2 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=738, start_column=10, + end_line=738, end_column=32, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + traitement_aide_finale_minoration_forfaitaire_2 = temp_traitement_aide_finale_minoration_forfaitaire_2 + try: + try: + if situation_r822_11_13_17: + temp_ressources_menage_avec_d832_18 = ressources_menage_arrondies_3 + else: + temp_ressources_menage_avec_d832_18 = dead_value + raise EmptyError + except EmptyError: + if (ressources_menage_arrondies_3 <= (mensualite_principale * + coefficient_multiplicateur_d832_18)): + temp_ressources_menage_avec_d832_18 = (mensualite_principale * + coefficient_multiplicateur_d832_18) + else: + temp_ressources_menage_avec_d832_18 = ressources_menage_arrondies_3 + except EmptyError: + temp_ressources_menage_avec_d832_18 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=718, start_column=11, + end_line=718, end_column=41, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + ressources_menage_avec_d832_18 = temp_ressources_menage_avec_d832_18 + try: + def temp_calcul_plafond_mensualite_d832_10_3(param_13:Date): + try: + def temp_calcul_plafond_mensualite_d832_10_3_1(_:Any): + raise EmptyError + def temp_calcul_plafond_mensualite_d832_10_3_2(_:Any): + return False + def temp_calcul_plafond_mensualite_d832_10_3_3(_:Any): + match_arg_76 = type_pret + if match_arg_76.code == TypePret_Code.D331_32: + _ = match_arg_76.value + temp_calcul_plafond_mensualite_d832_10_3_4 = False + elif match_arg_76.code == TypePret_Code.D331_63_64: + _ = match_arg_76.value + temp_calcul_plafond_mensualite_d832_10_3_4 = True + elif match_arg_76.code == TypePret_Code.D331_59_8: + _ = match_arg_76.value + temp_calcul_plafond_mensualite_d832_10_3_4 = False + elif match_arg_76.code == TypePret_Code.D331_76_1: + _ = match_arg_76.value + temp_calcul_plafond_mensualite_d832_10_3_4 = False + elif match_arg_76.code == TypePret_Code.Autre: + _ = match_arg_76.value + temp_calcul_plafond_mensualite_d832_10_3_4 = False + match_arg_77 = anciennete_logement + if match_arg_77.code == NeufOuAncien_Code.Neuf: + _ = match_arg_77.value + temp_calcul_plafond_mensualite_d832_10_3_5 = False + elif match_arg_77.code == NeufOuAncien_Code.Ancien: + _ = match_arg_77.value + temp_calcul_plafond_mensualite_d832_10_3_5 = True + if ((param_13 >= date_of_numbers(2019,9,30)) and + (temp_calcul_plafond_mensualite_d832_10_3_5 and + temp_calcul_plafond_mensualite_d832_10_3_4)): + match_arg_78 = zone_2 + if match_arg_78.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_78.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_79 = situation_familiale_calcul_apl_4 + if match_arg_79.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_79.value + return money_of_cents_string("29986") + elif match_arg_79.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_79.value + return money_of_cents_string("36187") + else: + return (money_of_cents_string("42386") + + (money_of_cents_string("6201") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_78.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_78.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_80 = situation_familiale_calcul_apl_4 + if match_arg_80.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_80.value + return money_of_cents_string("26730") + elif match_arg_80.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_80.value + return money_of_cents_string("32193") + else: + return (money_of_cents_string("37656") + + (money_of_cents_string("5463") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_78.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_78.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_81 = situation_familiale_calcul_apl_4 + if match_arg_81.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_81.value + return money_of_cents_string("24964") + elif match_arg_81.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_81.value + return money_of_cents_string("29948") + else: + return (money_of_cents_string("34934") + + (money_of_cents_string("4986") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + else: + raise EmptyError + def temp_calcul_plafond_mensualite_d832_10_3_6(_:Any): + match_arg_82 = type_pret + if match_arg_82.code == TypePret_Code.D331_32: + _ = match_arg_82.value + temp_calcul_plafond_mensualite_d832_10_3_7 = False + elif match_arg_82.code == TypePret_Code.D331_63_64: + _ = match_arg_82.value + temp_calcul_plafond_mensualite_d832_10_3_7 = True + elif match_arg_82.code == TypePret_Code.D331_59_8: + _ = match_arg_82.value + temp_calcul_plafond_mensualite_d832_10_3_7 = False + elif match_arg_82.code == TypePret_Code.D331_76_1: + _ = match_arg_82.value + temp_calcul_plafond_mensualite_d832_10_3_7 = False + elif match_arg_82.code == TypePret_Code.Autre: + _ = match_arg_82.value + temp_calcul_plafond_mensualite_d832_10_3_7 = False + match_arg_83 = anciennete_logement + if match_arg_83.code == NeufOuAncien_Code.Neuf: + _ = match_arg_83.value + temp_calcul_plafond_mensualite_d832_10_3_8 = True + elif match_arg_83.code == NeufOuAncien_Code.Ancien: + _ = match_arg_83.value + temp_calcul_plafond_mensualite_d832_10_3_8 = False + if ((param_13 >= date_of_numbers(2019,9,30)) and + (temp_calcul_plafond_mensualite_d832_10_3_8 and + temp_calcul_plafond_mensualite_d832_10_3_7)): + match_arg_84 = zone_2 + if match_arg_84.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_84.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_85 = situation_familiale_calcul_apl_4 + if match_arg_85.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_85.value + return money_of_cents_string("37252") + elif match_arg_85.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_85.value + return money_of_cents_string("44941") + else: + return (money_of_cents_string("52629") + + (money_of_cents_string("7687") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_84.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_84.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_86 = situation_familiale_calcul_apl_4 + if match_arg_86.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_86.value + return money_of_cents_string("33244") + elif match_arg_86.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_86.value + return money_of_cents_string("40013") + else: + return (money_of_cents_string("46783") + + (money_of_cents_string("6768") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_84.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_84.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_87 = situation_familiale_calcul_apl_4 + if match_arg_87.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_87.value + return money_of_cents_string("31036") + elif match_arg_87.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_87.value + return money_of_cents_string("37215") + else: + return (money_of_cents_string("43394") + + (money_of_cents_string("6179") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + else: + raise EmptyError + def temp_calcul_plafond_mensualite_d832_10_3_9(_:Any): + match_arg_88 = type_pret + if match_arg_88.code == TypePret_Code.D331_32: + _ = match_arg_88.value + temp_calcul_plafond_mensualite_d832_10_3_10 = False + elif match_arg_88.code == TypePret_Code.D331_63_64: + _ = match_arg_88.value + temp_calcul_plafond_mensualite_d832_10_3_10 = True + elif match_arg_88.code == TypePret_Code.D331_59_8: + _ = match_arg_88.value + temp_calcul_plafond_mensualite_d832_10_3_10 = False + elif match_arg_88.code == TypePret_Code.D331_76_1: + _ = match_arg_88.value + temp_calcul_plafond_mensualite_d832_10_3_10 = False + elif match_arg_88.code == TypePret_Code.Autre: + _ = match_arg_88.value + temp_calcul_plafond_mensualite_d832_10_3_10 = False + match_arg_89 = anciennete_logement + if match_arg_89.code == NeufOuAncien_Code.Neuf: + _ = match_arg_89.value + temp_calcul_plafond_mensualite_d832_10_3_11 = False + elif match_arg_89.code == NeufOuAncien_Code.Ancien: + _ = match_arg_89.value + temp_calcul_plafond_mensualite_d832_10_3_11 = True + if ((param_13 >= date_of_numbers(2017,9,30)) and + ((param_13 < date_of_numbers(2019,9,30)) and + (temp_calcul_plafond_mensualite_d832_10_3_11 and + temp_calcul_plafond_mensualite_d832_10_3_10))): + match_arg_90 = zone_2 + if match_arg_90.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_90.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_91 = situation_familiale_calcul_apl_4 + if match_arg_91.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_91.value + return money_of_cents_string("29897") + elif match_arg_91.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_91.value + return money_of_cents_string("36079") + else: + return (money_of_cents_string("42260") + + (money_of_cents_string("6182") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_90.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_90.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_92 = situation_familiale_calcul_apl_4 + if match_arg_92.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_92.value + return money_of_cents_string("26650") + elif match_arg_92.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_92.value + return money_of_cents_string("32097") + else: + return (money_of_cents_string("37543") + + (money_of_cents_string("5447") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_90.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_90.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_93 = situation_familiale_calcul_apl_4 + if match_arg_93.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_93.value + return money_of_cents_string("24889") + elif match_arg_93.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_93.value + return money_of_cents_string("29858") + else: + return (money_of_cents_string("34829") + + (money_of_cents_string("4971") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + else: + raise EmptyError + def temp_calcul_plafond_mensualite_d832_10_3_12(_:Any): + match_arg_94 = type_pret + if match_arg_94.code == TypePret_Code.D331_32: + _ = match_arg_94.value + temp_calcul_plafond_mensualite_d832_10_3_13 = False + elif match_arg_94.code == TypePret_Code.D331_63_64: + _ = match_arg_94.value + temp_calcul_plafond_mensualite_d832_10_3_13 = True + elif match_arg_94.code == TypePret_Code.D331_59_8: + _ = match_arg_94.value + temp_calcul_plafond_mensualite_d832_10_3_13 = False + elif match_arg_94.code == TypePret_Code.D331_76_1: + _ = match_arg_94.value + temp_calcul_plafond_mensualite_d832_10_3_13 = False + elif match_arg_94.code == TypePret_Code.Autre: + _ = match_arg_94.value + temp_calcul_plafond_mensualite_d832_10_3_13 = False + match_arg_95 = anciennete_logement + if match_arg_95.code == NeufOuAncien_Code.Neuf: + _ = match_arg_95.value + temp_calcul_plafond_mensualite_d832_10_3_14 = True + elif match_arg_95.code == NeufOuAncien_Code.Ancien: + _ = match_arg_95.value + temp_calcul_plafond_mensualite_d832_10_3_14 = False + if ((param_13 >= date_of_numbers(2017,9,30)) and + ((param_13 < date_of_numbers(2019,9,30)) and + (temp_calcul_plafond_mensualite_d832_10_3_14 and + temp_calcul_plafond_mensualite_d832_10_3_13))): + match_arg_96 = zone_2 + if match_arg_96.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_96.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_97 = situation_familiale_calcul_apl_4 + if match_arg_97.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_97.value + return money_of_cents_string("37140") + elif match_arg_97.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_97.value + return money_of_cents_string("44807") + else: + return (money_of_cents_string("52472") + + (money_of_cents_string("7664") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_96.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_96.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_98 = situation_familiale_calcul_apl_4 + if match_arg_98.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_98.value + return money_of_cents_string("33145") + elif match_arg_98.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_98.value + return money_of_cents_string("39893") + else: + return (money_of_cents_string("46643") + + (money_of_cents_string("6748") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_96.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_96.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_99 = situation_familiale_calcul_apl_4 + if match_arg_99.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_99.value + return money_of_cents_string("30943") + elif match_arg_99.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_99.value + return money_of_cents_string("37103") + else: + return (money_of_cents_string("43264") + + (money_of_cents_string("6161") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + else: + raise EmptyError + def temp_calcul_plafond_mensualite_d832_10_3_15(_:Any): + match_arg_100 = type_pret + if match_arg_100.code == TypePret_Code.D331_32: + _ = match_arg_100.value + temp_calcul_plafond_mensualite_d832_10_3_16 = False + elif match_arg_100.code == TypePret_Code.D331_63_64: + _ = match_arg_100.value + temp_calcul_plafond_mensualite_d832_10_3_16 = True + elif match_arg_100.code == TypePret_Code.D331_59_8: + _ = match_arg_100.value + temp_calcul_plafond_mensualite_d832_10_3_16 = False + elif match_arg_100.code == TypePret_Code.D331_76_1: + _ = match_arg_100.value + temp_calcul_plafond_mensualite_d832_10_3_16 = False + elif match_arg_100.code == TypePret_Code.Autre: + _ = match_arg_100.value + temp_calcul_plafond_mensualite_d832_10_3_16 = False + match_arg_101 = anciennete_logement + if match_arg_101.code == NeufOuAncien_Code.Neuf: + _ = match_arg_101.value + temp_calcul_plafond_mensualite_d832_10_3_17 = False + elif match_arg_101.code == NeufOuAncien_Code.Ancien: + _ = match_arg_101.value + temp_calcul_plafond_mensualite_d832_10_3_17 = True + if ((param_13 >= date_of_numbers(2015,9,30)) and + ((param_13 < date_of_numbers(2017,9,30)) and + (temp_calcul_plafond_mensualite_d832_10_3_17 and + temp_calcul_plafond_mensualite_d832_10_3_16))): + match_arg_102 = zone_2 + if match_arg_102.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_102.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_103 = situation_familiale_calcul_apl_4 + if match_arg_103.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_103.value + return money_of_cents_string("29674") + elif match_arg_103.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_103.value + return money_of_cents_string("35810") + else: + return (money_of_cents_string("41945") + + (money_of_cents_string("6136") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_102.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_102.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_104 = situation_familiale_calcul_apl_4 + if match_arg_104.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_104.value + return money_of_cents_string("26452") + elif match_arg_104.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_104.value + return money_of_cents_string("31858") + else: + return (money_of_cents_string("37264") + + (money_of_cents_string("5406") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_102.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_102.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_105 = situation_familiale_calcul_apl_4 + if match_arg_105.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_105.value + return money_of_cents_string("24704") + elif match_arg_105.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_105.value + return money_of_cents_string("29636") + else: + return (money_of_cents_string("34570") + + (money_of_cents_string("4934") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + else: + raise EmptyError + def temp_calcul_plafond_mensualite_d832_10_3_18(_:Any): + match_arg_106 = type_pret + if match_arg_106.code == TypePret_Code.D331_32: + _ = match_arg_106.value + temp_calcul_plafond_mensualite_d832_10_3_19 = False + elif match_arg_106.code == TypePret_Code.D331_63_64: + _ = match_arg_106.value + temp_calcul_plafond_mensualite_d832_10_3_19 = True + elif match_arg_106.code == TypePret_Code.D331_59_8: + _ = match_arg_106.value + temp_calcul_plafond_mensualite_d832_10_3_19 = False + elif match_arg_106.code == TypePret_Code.D331_76_1: + _ = match_arg_106.value + temp_calcul_plafond_mensualite_d832_10_3_19 = False + elif match_arg_106.code == TypePret_Code.Autre: + _ = match_arg_106.value + temp_calcul_plafond_mensualite_d832_10_3_19 = False + match_arg_107 = anciennete_logement + if match_arg_107.code == NeufOuAncien_Code.Neuf: + _ = match_arg_107.value + temp_calcul_plafond_mensualite_d832_10_3_20 = True + elif match_arg_107.code == NeufOuAncien_Code.Ancien: + _ = match_arg_107.value + temp_calcul_plafond_mensualite_d832_10_3_20 = False + if ((param_13 >= date_of_numbers(2015,9,30)) and + ((param_13 < date_of_numbers(2017,9,30)) and + (temp_calcul_plafond_mensualite_d832_10_3_20 and + temp_calcul_plafond_mensualite_d832_10_3_19))): + match_arg_108 = zone_2 + if match_arg_108.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_108.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_109 = situation_familiale_calcul_apl_4 + if match_arg_109.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_109.value + return money_of_cents_string("36864") + elif match_arg_109.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_109.value + return money_of_cents_string("44473") + else: + return (money_of_cents_string("52081") + + (money_of_cents_string("7607") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_108.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_108.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_110 = situation_familiale_calcul_apl_4 + if match_arg_110.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_110.value + return money_of_cents_string("32898") + elif match_arg_110.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_110.value + return money_of_cents_string("39596") + else: + return (money_of_cents_string("46296") + + (money_of_cents_string("6698") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_108.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_108.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_111 = situation_familiale_calcul_apl_4 + if match_arg_111.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_111.value + return money_of_cents_string("30713") + elif match_arg_111.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_111.value + return money_of_cents_string("36827") + else: + return (money_of_cents_string("42942") + + (money_of_cents_string("6115") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + else: + raise EmptyError + def temp_calcul_plafond_mensualite_d832_10_3_21(_:Any): + match_arg_112 = type_pret + if match_arg_112.code == TypePret_Code.D331_32: + _ = match_arg_112.value + temp_calcul_plafond_mensualite_d832_10_3_22 = False + elif match_arg_112.code == TypePret_Code.D331_63_64: + _ = match_arg_112.value + temp_calcul_plafond_mensualite_d832_10_3_22 = True + elif match_arg_112.code == TypePret_Code.D331_59_8: + _ = match_arg_112.value + temp_calcul_plafond_mensualite_d832_10_3_22 = False + elif match_arg_112.code == TypePret_Code.D331_76_1: + _ = match_arg_112.value + temp_calcul_plafond_mensualite_d832_10_3_22 = False + elif match_arg_112.code == TypePret_Code.Autre: + _ = match_arg_112.value + temp_calcul_plafond_mensualite_d832_10_3_22 = False + match_arg_113 = anciennete_logement + if match_arg_113.code == NeufOuAncien_Code.Neuf: + _ = match_arg_113.value + temp_calcul_plafond_mensualite_d832_10_3_23 = False + elif match_arg_113.code == NeufOuAncien_Code.Ancien: + _ = match_arg_113.value + temp_calcul_plafond_mensualite_d832_10_3_23 = True + if ((param_13 >= date_of_numbers(2014,9,30)) and + ((param_13 < date_of_numbers(2015,9,30)) and + (temp_calcul_plafond_mensualite_d832_10_3_23 and + temp_calcul_plafond_mensualite_d832_10_3_22))): + match_arg_114 = zone_2 + if match_arg_114.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_114.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_115 = situation_familiale_calcul_apl_4 + if match_arg_115.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_115.value + return money_of_cents_string("29650") + elif match_arg_115.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_115.value + return money_of_cents_string("35781") + else: + return (money_of_cents_string("41911") + + (money_of_cents_string("6131") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_114.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_114.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_116 = situation_familiale_calcul_apl_4 + if match_arg_116.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_116.value + return money_of_cents_string("26431") + elif match_arg_116.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_116.value + return money_of_cents_string("31833") + else: + return (money_of_cents_string("37234") + + (money_of_cents_string("5402") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_114.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_114.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_117 = situation_familiale_calcul_apl_4 + if match_arg_117.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_117.value + return money_of_cents_string("24684") + elif match_arg_117.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_117.value + return money_of_cents_string("29612") + else: + return (money_of_cents_string("34542") + + (money_of_cents_string("4930") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + else: + raise EmptyError + def temp_calcul_plafond_mensualite_d832_10_3_24(_:Any): + match_arg_118 = type_pret + if match_arg_118.code == TypePret_Code.D331_32: + _ = match_arg_118.value + temp_calcul_plafond_mensualite_d832_10_3_25 = False + elif match_arg_118.code == TypePret_Code.D331_63_64: + _ = match_arg_118.value + temp_calcul_plafond_mensualite_d832_10_3_25 = True + elif match_arg_118.code == TypePret_Code.D331_59_8: + _ = match_arg_118.value + temp_calcul_plafond_mensualite_d832_10_3_25 = False + elif match_arg_118.code == TypePret_Code.D331_76_1: + _ = match_arg_118.value + temp_calcul_plafond_mensualite_d832_10_3_25 = False + elif match_arg_118.code == TypePret_Code.Autre: + _ = match_arg_118.value + temp_calcul_plafond_mensualite_d832_10_3_25 = False + match_arg_119 = anciennete_logement + if match_arg_119.code == NeufOuAncien_Code.Neuf: + _ = match_arg_119.value + temp_calcul_plafond_mensualite_d832_10_3_26 = True + elif match_arg_119.code == NeufOuAncien_Code.Ancien: + _ = match_arg_119.value + temp_calcul_plafond_mensualite_d832_10_3_26 = False + if ((param_13 >= date_of_numbers(2014,9,30)) and + ((param_13 < date_of_numbers(2015,9,30)) and + (temp_calcul_plafond_mensualite_d832_10_3_26 and + temp_calcul_plafond_mensualite_d832_10_3_25))): + match_arg_120 = zone_2 + if match_arg_120.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_120.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_121 = situation_familiale_calcul_apl_4 + if match_arg_121.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_121.value + return money_of_cents_string("36835") + elif match_arg_121.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_121.value + return money_of_cents_string("44437") + else: + return (money_of_cents_string("52039") + + (money_of_cents_string("7601") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_120.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_120.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_122 = situation_familiale_calcul_apl_4 + if match_arg_122.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_122.value + return money_of_cents_string("32872") + elif match_arg_122.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_122.value + return money_of_cents_string("39564") + else: + return (money_of_cents_string("46259") + + (money_of_cents_string("6693") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_120.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_120.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_123 = situation_familiale_calcul_apl_4 + if match_arg_123.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_123.value + return money_of_cents_string("30688") + elif match_arg_123.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_123.value + return money_of_cents_string("36798") + else: + return (money_of_cents_string("42908") + + (money_of_cents_string("6110") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + else: + raise EmptyError + def temp_calcul_plafond_mensualite_d832_10_3_27(_:Any): + match_arg_124 = type_pret + if match_arg_124.code == TypePret_Code.D331_32: + _ = match_arg_124.value + temp_calcul_plafond_mensualite_d832_10_3_28 = False + elif match_arg_124.code == TypePret_Code.D331_63_64: + _ = match_arg_124.value + temp_calcul_plafond_mensualite_d832_10_3_28 = True + elif match_arg_124.code == TypePret_Code.D331_59_8: + _ = match_arg_124.value + temp_calcul_plafond_mensualite_d832_10_3_28 = False + elif match_arg_124.code == TypePret_Code.D331_76_1: + _ = match_arg_124.value + temp_calcul_plafond_mensualite_d832_10_3_28 = False + elif match_arg_124.code == TypePret_Code.Autre: + _ = match_arg_124.value + temp_calcul_plafond_mensualite_d832_10_3_28 = False + match_arg_125 = anciennete_logement + if match_arg_125.code == NeufOuAncien_Code.Neuf: + _ = match_arg_125.value + temp_calcul_plafond_mensualite_d832_10_3_29 = False + elif match_arg_125.code == NeufOuAncien_Code.Ancien: + _ = match_arg_125.value + temp_calcul_plafond_mensualite_d832_10_3_29 = True + if ((param_13 >= date_of_numbers(2012,12,31)) and + ((param_13 < date_of_numbers(2014,9,30)) and + (temp_calcul_plafond_mensualite_d832_10_3_29 and + temp_calcul_plafond_mensualite_d832_10_3_28))): + match_arg_126 = zone_2 + if match_arg_126.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_126.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_127 = situation_familiale_calcul_apl_4 + if match_arg_127.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_127.value + return money_of_cents_string("29482") + elif match_arg_127.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_127.value + return money_of_cents_string("35578") + else: + return (money_of_cents_string("41673") + + (money_of_cents_string("6096") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_126.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_126.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_128 = situation_familiale_calcul_apl_4 + if match_arg_128.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_128.value + return money_of_cents_string("26281") + elif match_arg_128.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_128.value + return money_of_cents_string("31653") + else: + return (money_of_cents_string("37023") + + (money_of_cents_string("5371") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_126.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_126.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_129 = situation_familiale_calcul_apl_4 + if match_arg_129.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_129.value + return money_of_cents_string("24544") + elif match_arg_129.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_129.value + return money_of_cents_string("29444") + else: + return (money_of_cents_string("34346") + + (money_of_cents_string("4902") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + else: + raise EmptyError + def temp_calcul_plafond_mensualite_d832_10_3_30(_:Any): + match_arg_130 = type_pret + if match_arg_130.code == TypePret_Code.D331_32: + _ = match_arg_130.value + temp_calcul_plafond_mensualite_d832_10_3_31 = False + elif match_arg_130.code == TypePret_Code.D331_63_64: + _ = match_arg_130.value + temp_calcul_plafond_mensualite_d832_10_3_31 = True + elif match_arg_130.code == TypePret_Code.D331_59_8: + _ = match_arg_130.value + temp_calcul_plafond_mensualite_d832_10_3_31 = False + elif match_arg_130.code == TypePret_Code.D331_76_1: + _ = match_arg_130.value + temp_calcul_plafond_mensualite_d832_10_3_31 = False + elif match_arg_130.code == TypePret_Code.Autre: + _ = match_arg_130.value + temp_calcul_plafond_mensualite_d832_10_3_31 = False + match_arg_131 = anciennete_logement + if match_arg_131.code == NeufOuAncien_Code.Neuf: + _ = match_arg_131.value + temp_calcul_plafond_mensualite_d832_10_3_32 = True + elif match_arg_131.code == NeufOuAncien_Code.Ancien: + _ = match_arg_131.value + temp_calcul_plafond_mensualite_d832_10_3_32 = False + if ((param_13 >= date_of_numbers(2012,12,31)) and + ((param_13 < date_of_numbers(2014,9,30)) and + (temp_calcul_plafond_mensualite_d832_10_3_32 and + temp_calcul_plafond_mensualite_d832_10_3_31))): + match_arg_132 = zone_2 + if match_arg_132.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_132.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_133 = situation_familiale_calcul_apl_4 + if match_arg_133.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_133.value + return money_of_cents_string("36626") + elif match_arg_133.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_133.value + return money_of_cents_string("44185") + else: + return (money_of_cents_string("51744") + + (money_of_cents_string("7558") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_132.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_132.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_134 = situation_familiale_calcul_apl_4 + if match_arg_134.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_134.value + return money_of_cents_string("32686") + elif match_arg_134.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_134.value + return money_of_cents_string("39340") + else: + return (money_of_cents_string("45997") + + (money_of_cents_string("6655") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_132.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_132.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_135 = situation_familiale_calcul_apl_4 + if match_arg_135.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_135.value + return money_of_cents_string("30514") + elif match_arg_135.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_135.value + return money_of_cents_string("36589") + else: + return (money_of_cents_string("42665") + + (money_of_cents_string("6075") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + else: + raise EmptyError + def temp_calcul_plafond_mensualite_d832_10_3_33(_:Any): + match_arg_136 = type_pret + if match_arg_136.code == TypePret_Code.D331_32: + _ = match_arg_136.value + temp_calcul_plafond_mensualite_d832_10_3_34 = False + elif match_arg_136.code == TypePret_Code.D331_63_64: + _ = match_arg_136.value + temp_calcul_plafond_mensualite_d832_10_3_34 = True + elif match_arg_136.code == TypePret_Code.D331_59_8: + _ = match_arg_136.value + temp_calcul_plafond_mensualite_d832_10_3_34 = False + elif match_arg_136.code == TypePret_Code.D331_76_1: + _ = match_arg_136.value + temp_calcul_plafond_mensualite_d832_10_3_34 = False + elif match_arg_136.code == TypePret_Code.Autre: + _ = match_arg_136.value + temp_calcul_plafond_mensualite_d832_10_3_34 = False + match_arg_137 = anciennete_logement + if match_arg_137.code == NeufOuAncien_Code.Neuf: + _ = match_arg_137.value + temp_calcul_plafond_mensualite_d832_10_3_35 = False + elif match_arg_137.code == NeufOuAncien_Code.Ancien: + _ = match_arg_137.value + temp_calcul_plafond_mensualite_d832_10_3_35 = True + if ((param_13 >= date_of_numbers(2011,12,31)) and + ((param_13 < date_of_numbers(2012,12,31)) and + (temp_calcul_plafond_mensualite_d832_10_3_35 and + temp_calcul_plafond_mensualite_d832_10_3_34))): + match_arg_138 = zone_2 + if match_arg_138.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_138.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_139 = situation_familiale_calcul_apl_4 + if match_arg_139.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_139.value + return money_of_cents_string("28861") + elif match_arg_139.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_139.value + return money_of_cents_string("34829") + else: + return (money_of_cents_string("40796") + + (money_of_cents_string("5968") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_138.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_138.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_140 = situation_familiale_calcul_apl_4 + if match_arg_140.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_140.value + return money_of_cents_string("25728") + elif match_arg_140.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_140.value + return money_of_cents_string("30987") + else: + return (money_of_cents_string("36244") + + (money_of_cents_string("5258") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_138.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_138.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_141 = situation_familiale_calcul_apl_4 + if match_arg_141.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_141.value + return money_of_cents_string("24027") + elif match_arg_141.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_141.value + return money_of_cents_string("28824") + else: + return (money_of_cents_string("33623") + + (money_of_cents_string("4799") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + else: + raise EmptyError + def temp_calcul_plafond_mensualite_d832_10_3_36(_:Any): + match_arg_142 = type_pret + if match_arg_142.code == TypePret_Code.D331_32: + _ = match_arg_142.value + temp_calcul_plafond_mensualite_d832_10_3_37 = False + elif match_arg_142.code == TypePret_Code.D331_63_64: + _ = match_arg_142.value + temp_calcul_plafond_mensualite_d832_10_3_37 = True + elif match_arg_142.code == TypePret_Code.D331_59_8: + _ = match_arg_142.value + temp_calcul_plafond_mensualite_d832_10_3_37 = False + elif match_arg_142.code == TypePret_Code.D331_76_1: + _ = match_arg_142.value + temp_calcul_plafond_mensualite_d832_10_3_37 = False + elif match_arg_142.code == TypePret_Code.Autre: + _ = match_arg_142.value + temp_calcul_plafond_mensualite_d832_10_3_37 = False + match_arg_143 = anciennete_logement + if match_arg_143.code == NeufOuAncien_Code.Neuf: + _ = match_arg_143.value + temp_calcul_plafond_mensualite_d832_10_3_38 = True + elif match_arg_143.code == NeufOuAncien_Code.Ancien: + _ = match_arg_143.value + temp_calcul_plafond_mensualite_d832_10_3_38 = False + if ((param_13 >= date_of_numbers(2011,12,31)) and + ((param_13 < date_of_numbers(2012,12,31)) and + (temp_calcul_plafond_mensualite_d832_10_3_38 and + temp_calcul_plafond_mensualite_d832_10_3_37))): + match_arg_144 = zone_2 + if match_arg_144.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_144.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_145 = situation_familiale_calcul_apl_4 + if match_arg_145.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_145.value + return money_of_cents_string("35855") + elif match_arg_145.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_145.value + return money_of_cents_string("43255") + else: + return (money_of_cents_string("50655") + + (money_of_cents_string("7399") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_144.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_144.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_146 = situation_familiale_calcul_apl_4 + if match_arg_146.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_146.value + return money_of_cents_string("31998") + elif match_arg_146.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_146.value + return money_of_cents_string("38512") + else: + return (money_of_cents_string("45029") + + (money_of_cents_string("6515") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_144.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_144.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_147 = situation_familiale_calcul_apl_4 + if match_arg_147.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_147.value + return money_of_cents_string("29872") + elif match_arg_147.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_147.value + return money_of_cents_string("35819") + else: + return (money_of_cents_string("41767") + + (money_of_cents_string("5947") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + else: + raise EmptyError + def temp_calcul_plafond_mensualite_d832_10_3_39(_:Any): + match_arg_148 = type_pret + if match_arg_148.code == TypePret_Code.D331_32: + _ = match_arg_148.value + temp_calcul_plafond_mensualite_d832_10_3_40 = False + elif match_arg_148.code == TypePret_Code.D331_63_64: + _ = match_arg_148.value + temp_calcul_plafond_mensualite_d832_10_3_40 = True + elif match_arg_148.code == TypePret_Code.D331_59_8: + _ = match_arg_148.value + temp_calcul_plafond_mensualite_d832_10_3_40 = False + elif match_arg_148.code == TypePret_Code.D331_76_1: + _ = match_arg_148.value + temp_calcul_plafond_mensualite_d832_10_3_40 = False + elif match_arg_148.code == TypePret_Code.Autre: + _ = match_arg_148.value + temp_calcul_plafond_mensualite_d832_10_3_40 = False + match_arg_149 = anciennete_logement + if match_arg_149.code == NeufOuAncien_Code.Neuf: + _ = match_arg_149.value + temp_calcul_plafond_mensualite_d832_10_3_41 = False + elif match_arg_149.code == NeufOuAncien_Code.Ancien: + _ = match_arg_149.value + temp_calcul_plafond_mensualite_d832_10_3_41 = True + if ((param_13 >= date_of_numbers(2010,12,31)) and + ((param_13 < date_of_numbers(2011,12,31)) and + (temp_calcul_plafond_mensualite_d832_10_3_41 and + temp_calcul_plafond_mensualite_d832_10_3_40))): + match_arg_150 = zone_2 + if match_arg_150.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_150.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_151 = situation_familiale_calcul_apl_4 + if match_arg_151.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_151.value + return money_of_cents_string("28575") + elif match_arg_151.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_151.value + return money_of_cents_string("34484") + else: + return (money_of_cents_string("40392") + + (money_of_cents_string("5909") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_150.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_150.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_152 = situation_familiale_calcul_apl_4 + if match_arg_152.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_152.value + return money_of_cents_string("25473") + elif match_arg_152.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_152.value + return money_of_cents_string("30680") + else: + return (money_of_cents_string("35885") + + (money_of_cents_string("5206") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_150.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_150.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_153 = situation_familiale_calcul_apl_4 + if match_arg_153.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_153.value + return money_of_cents_string("23789") + elif match_arg_153.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_153.value + return money_of_cents_string("28539") + else: + return (money_of_cents_string("33290") + + (money_of_cents_string("4751") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + else: + raise EmptyError + def temp_calcul_plafond_mensualite_d832_10_3_42(_:Any): + match_arg_154 = type_pret + if match_arg_154.code == TypePret_Code.D331_32: + _ = match_arg_154.value + temp_calcul_plafond_mensualite_d832_10_3_43 = False + elif match_arg_154.code == TypePret_Code.D331_63_64: + _ = match_arg_154.value + temp_calcul_plafond_mensualite_d832_10_3_43 = True + elif match_arg_154.code == TypePret_Code.D331_59_8: + _ = match_arg_154.value + temp_calcul_plafond_mensualite_d832_10_3_43 = False + elif match_arg_154.code == TypePret_Code.D331_76_1: + _ = match_arg_154.value + temp_calcul_plafond_mensualite_d832_10_3_43 = False + elif match_arg_154.code == TypePret_Code.Autre: + _ = match_arg_154.value + temp_calcul_plafond_mensualite_d832_10_3_43 = False + match_arg_155 = anciennete_logement + if match_arg_155.code == NeufOuAncien_Code.Neuf: + _ = match_arg_155.value + temp_calcul_plafond_mensualite_d832_10_3_44 = True + elif match_arg_155.code == NeufOuAncien_Code.Ancien: + _ = match_arg_155.value + temp_calcul_plafond_mensualite_d832_10_3_44 = False + if ((param_13 >= date_of_numbers(2010,12,31)) and + ((param_13 < date_of_numbers(2011,12,31)) and + (temp_calcul_plafond_mensualite_d832_10_3_44 and + temp_calcul_plafond_mensualite_d832_10_3_43))): + match_arg_156 = zone_2 + if match_arg_156.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_156.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_157 = situation_familiale_calcul_apl_4 + if match_arg_157.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_157.value + return money_of_cents_string("35500") + elif match_arg_157.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_157.value + return money_of_cents_string("42827") + else: + return (money_of_cents_string("50153") + + (money_of_cents_string("7326") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_156.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_156.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_158 = situation_familiale_calcul_apl_4 + if match_arg_158.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_158.value + return money_of_cents_string("31681") + elif match_arg_158.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_158.value + return money_of_cents_string("38131") + else: + return (money_of_cents_string("44583") + + (money_of_cents_string("6450") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_156.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_156.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_159 = situation_familiale_calcul_apl_4 + if match_arg_159.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_159.value + return money_of_cents_string("29576") + elif match_arg_159.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_159.value + return money_of_cents_string("35464") + else: + return (money_of_cents_string("41353") + + (money_of_cents_string("5888") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + else: + raise EmptyError + def temp_calcul_plafond_mensualite_d832_10_3_45(_:Any): + match_arg_160 = type_pret + if match_arg_160.code == TypePret_Code.D331_32: + _ = match_arg_160.value + temp_calcul_plafond_mensualite_d832_10_3_46 = False + elif match_arg_160.code == TypePret_Code.D331_63_64: + _ = match_arg_160.value + temp_calcul_plafond_mensualite_d832_10_3_46 = True + elif match_arg_160.code == TypePret_Code.D331_59_8: + _ = match_arg_160.value + temp_calcul_plafond_mensualite_d832_10_3_46 = False + elif match_arg_160.code == TypePret_Code.D331_76_1: + _ = match_arg_160.value + temp_calcul_plafond_mensualite_d832_10_3_46 = False + elif match_arg_160.code == TypePret_Code.Autre: + _ = match_arg_160.value + temp_calcul_plafond_mensualite_d832_10_3_46 = False + match_arg_161 = anciennete_logement + if match_arg_161.code == NeufOuAncien_Code.Neuf: + _ = match_arg_161.value + temp_calcul_plafond_mensualite_d832_10_3_47 = False + elif match_arg_161.code == NeufOuAncien_Code.Ancien: + _ = match_arg_161.value + temp_calcul_plafond_mensualite_d832_10_3_47 = True + if ((param_13 >= date_of_numbers(2009,12,31)) and + ((param_13 < date_of_numbers(2010,12,31)) and + (temp_calcul_plafond_mensualite_d832_10_3_47 and + temp_calcul_plafond_mensualite_d832_10_3_46))): + match_arg_162 = zone_2 + if match_arg_162.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_162.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_163 = situation_familiale_calcul_apl_4 + if match_arg_163.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_163.value + return money_of_cents_string("28264") + elif match_arg_163.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_163.value + return money_of_cents_string("34109") + else: + return (money_of_cents_string("39953") + + (money_of_cents_string("5845") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_162.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_162.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_164 = situation_familiale_calcul_apl_4 + if match_arg_164.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_164.value + return money_of_cents_string("25196") + elif match_arg_164.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_164.value + return money_of_cents_string("30346") + else: + return (money_of_cents_string("35495") + + (money_of_cents_string("5149") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_162.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_162.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_165 = situation_familiale_calcul_apl_4 + if match_arg_165.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_165.value + return money_of_cents_string("23530") + elif match_arg_165.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_165.value + return money_of_cents_string("28228") + else: + return (money_of_cents_string("32928") + + (money_of_cents_string("4699") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + else: + raise EmptyError + def temp_calcul_plafond_mensualite_d832_10_3_48(_:Any): + match_arg_166 = type_pret + if match_arg_166.code == TypePret_Code.D331_32: + _ = match_arg_166.value + temp_calcul_plafond_mensualite_d832_10_3_49 = False + elif match_arg_166.code == TypePret_Code.D331_63_64: + _ = match_arg_166.value + temp_calcul_plafond_mensualite_d832_10_3_49 = True + elif match_arg_166.code == TypePret_Code.D331_59_8: + _ = match_arg_166.value + temp_calcul_plafond_mensualite_d832_10_3_49 = False + elif match_arg_166.code == TypePret_Code.D331_76_1: + _ = match_arg_166.value + temp_calcul_plafond_mensualite_d832_10_3_49 = False + elif match_arg_166.code == TypePret_Code.Autre: + _ = match_arg_166.value + temp_calcul_plafond_mensualite_d832_10_3_49 = False + match_arg_167 = anciennete_logement + if match_arg_167.code == NeufOuAncien_Code.Neuf: + _ = match_arg_167.value + temp_calcul_plafond_mensualite_d832_10_3_50 = True + elif match_arg_167.code == NeufOuAncien_Code.Ancien: + _ = match_arg_167.value + temp_calcul_plafond_mensualite_d832_10_3_50 = False + if ((param_13 >= date_of_numbers(2009,12,31)) and + ((param_13 < date_of_numbers(2010,12,31)) and + (temp_calcul_plafond_mensualite_d832_10_3_50 and + temp_calcul_plafond_mensualite_d832_10_3_49))): + match_arg_168 = zone_2 + if match_arg_168.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_168.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_169 = situation_familiale_calcul_apl_4 + if match_arg_169.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_169.value + return money_of_cents_string("35114") + elif match_arg_169.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_169.value + return money_of_cents_string("42361") + else: + return (money_of_cents_string("49607") + + (money_of_cents_string("7246") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_168.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_168.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_170 = situation_familiale_calcul_apl_4 + if match_arg_170.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_170.value + return money_of_cents_string("31336") + elif match_arg_170.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_170.value + return money_of_cents_string("37716") + else: + return (money_of_cents_string("44098") + + (money_of_cents_string("6380") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_168.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_168.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_171 = situation_familiale_calcul_apl_4 + if match_arg_171.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_171.value + return money_of_cents_string("29254") + elif match_arg_171.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_171.value + return money_of_cents_string("35078") + else: + return (money_of_cents_string("40903") + + (money_of_cents_string("5824") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + else: + raise EmptyError + def temp_calcul_plafond_mensualite_d832_10_3_51(_:Any): + match_arg_172 = type_pret + if match_arg_172.code == TypePret_Code.D331_32: + _ = match_arg_172.value + temp_calcul_plafond_mensualite_d832_10_3_52 = False + elif match_arg_172.code == TypePret_Code.D331_63_64: + _ = match_arg_172.value + temp_calcul_plafond_mensualite_d832_10_3_52 = True + elif match_arg_172.code == TypePret_Code.D331_59_8: + _ = match_arg_172.value + temp_calcul_plafond_mensualite_d832_10_3_52 = False + elif match_arg_172.code == TypePret_Code.D331_76_1: + _ = match_arg_172.value + temp_calcul_plafond_mensualite_d832_10_3_52 = False + elif match_arg_172.code == TypePret_Code.Autre: + _ = match_arg_172.value + temp_calcul_plafond_mensualite_d832_10_3_52 = False + match_arg_173 = anciennete_logement + if match_arg_173.code == NeufOuAncien_Code.Neuf: + _ = match_arg_173.value + temp_calcul_plafond_mensualite_d832_10_3_53 = False + elif match_arg_173.code == NeufOuAncien_Code.Ancien: + _ = match_arg_173.value + temp_calcul_plafond_mensualite_d832_10_3_53 = True + if ((param_13 >= date_of_numbers(2008,12,31)) and + ((param_13 < date_of_numbers(2009,12,31)) and + (temp_calcul_plafond_mensualite_d832_10_3_53 and + temp_calcul_plafond_mensualite_d832_10_3_52))): + match_arg_174 = zone_2 + if match_arg_174.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_174.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_175 = situation_familiale_calcul_apl_4 + if match_arg_175.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_175.value + return money_of_cents_string("28174") + elif match_arg_175.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_175.value + return money_of_cents_string("34000") + else: + return (money_of_cents_string("39826") + + (money_of_cents_string("5826") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_174.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_174.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_176 = situation_familiale_calcul_apl_4 + if match_arg_176.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_176.value + return money_of_cents_string("25116") + elif match_arg_176.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_176.value + return money_of_cents_string("30249") + else: + return (money_of_cents_string("35382") + + (money_of_cents_string("5133") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_174.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_174.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_177 = situation_familiale_calcul_apl_4 + if match_arg_177.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_177.value + return money_of_cents_string("23455") + elif match_arg_177.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_177.value + return money_of_cents_string("28138") + else: + return (money_of_cents_string("32823") + + (money_of_cents_string("4684") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + else: + raise EmptyError + def temp_calcul_plafond_mensualite_d832_10_3_54(_:Any): + match_arg_178 = type_pret + if match_arg_178.code == TypePret_Code.D331_32: + _ = match_arg_178.value + temp_calcul_plafond_mensualite_d832_10_3_55 = False + elif match_arg_178.code == TypePret_Code.D331_63_64: + _ = match_arg_178.value + temp_calcul_plafond_mensualite_d832_10_3_55 = True + elif match_arg_178.code == TypePret_Code.D331_59_8: + _ = match_arg_178.value + temp_calcul_plafond_mensualite_d832_10_3_55 = False + elif match_arg_178.code == TypePret_Code.D331_76_1: + _ = match_arg_178.value + temp_calcul_plafond_mensualite_d832_10_3_55 = False + elif match_arg_178.code == TypePret_Code.Autre: + _ = match_arg_178.value + temp_calcul_plafond_mensualite_d832_10_3_55 = False + match_arg_179 = anciennete_logement + if match_arg_179.code == NeufOuAncien_Code.Neuf: + _ = match_arg_179.value + temp_calcul_plafond_mensualite_d832_10_3_56 = True + elif match_arg_179.code == NeufOuAncien_Code.Ancien: + _ = match_arg_179.value + temp_calcul_plafond_mensualite_d832_10_3_56 = False + if ((param_13 >= date_of_numbers(2008,12,31)) and + ((param_13 < date_of_numbers(2009,12,31)) and + (temp_calcul_plafond_mensualite_d832_10_3_56 and + temp_calcul_plafond_mensualite_d832_10_3_55))): + match_arg_180 = zone_2 + if match_arg_180.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_180.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_181 = situation_familiale_calcul_apl_4 + if match_arg_181.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_181.value + return money_of_cents_string("35002") + elif match_arg_181.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_181.value + return money_of_cents_string("42226") + else: + return (money_of_cents_string("49449") + + (money_of_cents_string("7223") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_180.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_180.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_182 = situation_familiale_calcul_apl_4 + if match_arg_182.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_182.value + return money_of_cents_string("31236") + elif match_arg_182.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_182.value + return money_of_cents_string("37596") + else: + return (money_of_cents_string("43957") + + (money_of_cents_string("6360") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_180.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_180.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_183 = situation_familiale_calcul_apl_4 + if match_arg_183.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_183.value + return money_of_cents_string("29161") + elif match_arg_183.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_183.value + return money_of_cents_string("34966") + else: + return (money_of_cents_string("40773") + + (money_of_cents_string("5805") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + else: + raise EmptyError + def temp_calcul_plafond_mensualite_d832_10_3_57(_:Any): + match_arg_184 = type_pret + if match_arg_184.code == TypePret_Code.D331_32: + _ = match_arg_184.value + temp_calcul_plafond_mensualite_d832_10_3_58 = False + elif match_arg_184.code == TypePret_Code.D331_63_64: + _ = match_arg_184.value + temp_calcul_plafond_mensualite_d832_10_3_58 = True + elif match_arg_184.code == TypePret_Code.D331_59_8: + _ = match_arg_184.value + temp_calcul_plafond_mensualite_d832_10_3_58 = False + elif match_arg_184.code == TypePret_Code.D331_76_1: + _ = match_arg_184.value + temp_calcul_plafond_mensualite_d832_10_3_58 = False + elif match_arg_184.code == TypePret_Code.Autre: + _ = match_arg_184.value + temp_calcul_plafond_mensualite_d832_10_3_58 = False + match_arg_185 = anciennete_logement + if match_arg_185.code == NeufOuAncien_Code.Neuf: + _ = match_arg_185.value + temp_calcul_plafond_mensualite_d832_10_3_59 = False + elif match_arg_185.code == NeufOuAncien_Code.Ancien: + _ = match_arg_185.value + temp_calcul_plafond_mensualite_d832_10_3_59 = True + if ((param_13 >= date_of_numbers(2007,12,31)) and + ((param_13 < date_of_numbers(2008,12,31)) and + (temp_calcul_plafond_mensualite_d832_10_3_59 and + temp_calcul_plafond_mensualite_d832_10_3_58))): + match_arg_186 = zone_2 + if match_arg_186.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_186.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_187 = situation_familiale_calcul_apl_4 + if match_arg_187.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_187.value + return money_of_cents_string("27367") + elif match_arg_187.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_187.value + return money_of_cents_string("33026") + else: + return (money_of_cents_string("38685") + + (money_of_cents_string("5659") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_186.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_186.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_188 = situation_familiale_calcul_apl_4 + if match_arg_188.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_188.value + return money_of_cents_string("24396") + elif match_arg_188.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_188.value + return money_of_cents_string("29382") + else: + return (money_of_cents_string("34368") + + (money_of_cents_string("4986") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_186.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_186.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_189 = situation_familiale_calcul_apl_4 + if match_arg_189.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_189.value + return money_of_cents_string("22783") + elif match_arg_189.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_189.value + return money_of_cents_string("27332") + else: + return (money_of_cents_string("31882") + + (money_of_cents_string("4550") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + else: + raise EmptyError + def temp_calcul_plafond_mensualite_d832_10_3_60(_:Any): + match_arg_190 = type_pret + if match_arg_190.code == TypePret_Code.D331_32: + _ = match_arg_190.value + temp_calcul_plafond_mensualite_d832_10_3_61 = False + elif match_arg_190.code == TypePret_Code.D331_63_64: + _ = match_arg_190.value + temp_calcul_plafond_mensualite_d832_10_3_61 = True + elif match_arg_190.code == TypePret_Code.D331_59_8: + _ = match_arg_190.value + temp_calcul_plafond_mensualite_d832_10_3_61 = False + elif match_arg_190.code == TypePret_Code.D331_76_1: + _ = match_arg_190.value + temp_calcul_plafond_mensualite_d832_10_3_61 = False + elif match_arg_190.code == TypePret_Code.Autre: + _ = match_arg_190.value + temp_calcul_plafond_mensualite_d832_10_3_61 = False + match_arg_191 = anciennete_logement + if match_arg_191.code == NeufOuAncien_Code.Neuf: + _ = match_arg_191.value + temp_calcul_plafond_mensualite_d832_10_3_62 = True + elif match_arg_191.code == NeufOuAncien_Code.Ancien: + _ = match_arg_191.value + temp_calcul_plafond_mensualite_d832_10_3_62 = False + if ((param_13 >= date_of_numbers(2007,12,31)) and + ((param_13 < date_of_numbers(2008,12,31)) and + (temp_calcul_plafond_mensualite_d832_10_3_62 and + temp_calcul_plafond_mensualite_d832_10_3_61))): + match_arg_192 = zone_2 + if match_arg_192.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_192.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_193 = situation_familiale_calcul_apl_4 + if match_arg_193.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_193.value + return money_of_cents_string("33999") + elif match_arg_193.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_193.value + return money_of_cents_string("41016") + else: + return (money_of_cents_string("48032") + + (money_of_cents_string("7016") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_192.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_192.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_194 = situation_familiale_calcul_apl_4 + if match_arg_194.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_194.value + return money_of_cents_string("30341") + elif match_arg_194.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_194.value + return money_of_cents_string("36519") + else: + return (money_of_cents_string("42697") + + (money_of_cents_string("6178") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_192.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_192.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_195 = situation_familiale_calcul_apl_4 + if match_arg_195.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_195.value + return money_of_cents_string("28325") + elif match_arg_195.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_195.value + return money_of_cents_string("33964") + else: + return (money_of_cents_string("39605") + + (money_of_cents_string("5639") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + else: + raise EmptyError + def temp_calcul_plafond_mensualite_d832_10_3_63(_:Any): + match_arg_196 = type_pret + if match_arg_196.code == TypePret_Code.D331_32: + _ = match_arg_196.value + temp_calcul_plafond_mensualite_d832_10_3_64 = False + elif match_arg_196.code == TypePret_Code.D331_63_64: + _ = match_arg_196.value + temp_calcul_plafond_mensualite_d832_10_3_64 = True + elif match_arg_196.code == TypePret_Code.D331_59_8: + _ = match_arg_196.value + temp_calcul_plafond_mensualite_d832_10_3_64 = False + elif match_arg_196.code == TypePret_Code.D331_76_1: + _ = match_arg_196.value + temp_calcul_plafond_mensualite_d832_10_3_64 = False + elif match_arg_196.code == TypePret_Code.Autre: + _ = match_arg_196.value + temp_calcul_plafond_mensualite_d832_10_3_64 = False + match_arg_197 = anciennete_logement + if match_arg_197.code == NeufOuAncien_Code.Neuf: + _ = match_arg_197.value + temp_calcul_plafond_mensualite_d832_10_3_65 = False + elif match_arg_197.code == NeufOuAncien_Code.Ancien: + _ = match_arg_197.value + temp_calcul_plafond_mensualite_d832_10_3_65 = True + if ((param_13 >= date_of_numbers(2006,12,31)) and + ((param_13 < date_of_numbers(2007,12,31)) and + (temp_calcul_plafond_mensualite_d832_10_3_65 and + temp_calcul_plafond_mensualite_d832_10_3_64))): + match_arg_198 = zone_2 + if match_arg_198.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_198.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_199 = situation_familiale_calcul_apl_4 + if match_arg_199.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_199.value + return money_of_cents_string("26632") + elif match_arg_199.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_199.value + return money_of_cents_string("32139") + else: + return (money_of_cents_string("37646") + + (money_of_cents_string("5507") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_198.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_198.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_200 = situation_familiale_calcul_apl_4 + if match_arg_200.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_200.value + return money_of_cents_string("23741") + elif match_arg_200.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_200.value + return money_of_cents_string("28593") + else: + return (money_of_cents_string("33445") + + (money_of_cents_string("4852") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_198.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_198.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_201 = situation_familiale_calcul_apl_4 + if match_arg_201.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_201.value + return money_of_cents_string("22171") + elif match_arg_201.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_201.value + return money_of_cents_string("36598") + else: + return (money_of_cents_string("31026") + + (money_of_cents_string("4428") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + else: + raise EmptyError + def temp_calcul_plafond_mensualite_d832_10_3_66(_:Any): + match_arg_202 = type_pret + if match_arg_202.code == TypePret_Code.D331_32: + _ = match_arg_202.value + temp_calcul_plafond_mensualite_d832_10_3_67 = False + elif match_arg_202.code == TypePret_Code.D331_63_64: + _ = match_arg_202.value + temp_calcul_plafond_mensualite_d832_10_3_67 = True + elif match_arg_202.code == TypePret_Code.D331_59_8: + _ = match_arg_202.value + temp_calcul_plafond_mensualite_d832_10_3_67 = False + elif match_arg_202.code == TypePret_Code.D331_76_1: + _ = match_arg_202.value + temp_calcul_plafond_mensualite_d832_10_3_67 = False + elif match_arg_202.code == TypePret_Code.Autre: + _ = match_arg_202.value + temp_calcul_plafond_mensualite_d832_10_3_67 = False + match_arg_203 = anciennete_logement + if match_arg_203.code == NeufOuAncien_Code.Neuf: + _ = match_arg_203.value + temp_calcul_plafond_mensualite_d832_10_3_68 = True + elif match_arg_203.code == NeufOuAncien_Code.Ancien: + _ = match_arg_203.value + temp_calcul_plafond_mensualite_d832_10_3_68 = False + if ((param_13 >= date_of_numbers(2006,12,31)) and + ((param_13 < date_of_numbers(2007,12,31)) and + (temp_calcul_plafond_mensualite_d832_10_3_68 and + temp_calcul_plafond_mensualite_d832_10_3_67))): + match_arg_204 = zone_2 + if match_arg_204.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_204.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_205 = situation_familiale_calcul_apl_4 + if match_arg_205.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_205.value + return money_of_cents_string("33026") + elif match_arg_205.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_205.value + return money_of_cents_string("39914") + else: + return (money_of_cents_string("46742") + + (money_of_cents_string("6828") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_204.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_204.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_206 = situation_familiale_calcul_apl_4 + if match_arg_206.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_206.value + return money_of_cents_string("29526") + elif match_arg_206.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_206.value + return money_of_cents_string("35538") + else: + return (money_of_cents_string("41550") + + (money_of_cents_string("6012") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_204.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_204.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_207 = situation_familiale_calcul_apl_4 + if match_arg_207.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_207.value + return money_of_cents_string("27564") + elif match_arg_207.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_207.value + return money_of_cents_string("33052") + else: + return (money_of_cents_string("38541") + + (money_of_cents_string("5488") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + else: + raise EmptyError + def temp_calcul_plafond_mensualite_d832_10_3_69(_:Any): + match_arg_208 = type_pret + if match_arg_208.code == TypePret_Code.D331_32: + _ = match_arg_208.value + temp_calcul_plafond_mensualite_d832_10_3_70 = False + elif match_arg_208.code == TypePret_Code.D331_63_64: + _ = match_arg_208.value + temp_calcul_plafond_mensualite_d832_10_3_70 = True + elif match_arg_208.code == TypePret_Code.D331_59_8: + _ = match_arg_208.value + temp_calcul_plafond_mensualite_d832_10_3_70 = False + elif match_arg_208.code == TypePret_Code.D331_76_1: + _ = match_arg_208.value + temp_calcul_plafond_mensualite_d832_10_3_70 = False + elif match_arg_208.code == TypePret_Code.Autre: + _ = match_arg_208.value + temp_calcul_plafond_mensualite_d832_10_3_70 = False + match_arg_209 = anciennete_logement + if match_arg_209.code == NeufOuAncien_Code.Neuf: + _ = match_arg_209.value + temp_calcul_plafond_mensualite_d832_10_3_71 = False + elif match_arg_209.code == NeufOuAncien_Code.Ancien: + _ = match_arg_209.value + temp_calcul_plafond_mensualite_d832_10_3_71 = True + if ((param_13 >= date_of_numbers(2005,8,31)) and + ((param_13 < date_of_numbers(2006,12,31)) and + (temp_calcul_plafond_mensualite_d832_10_3_71 and + temp_calcul_plafond_mensualite_d832_10_3_70))): + match_arg_210 = zone_2 + if match_arg_210.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_210.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_211 = situation_familiale_calcul_apl_4 + if match_arg_211.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_211.value + return money_of_cents_string("25907") + elif match_arg_211.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_211.value + return money_of_cents_string("31264") + else: + return (money_of_cents_string("36621") + + (money_of_cents_string("5357") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_210.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_210.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_212 = situation_familiale_calcul_apl_4 + if match_arg_212.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_212.value + return money_of_cents_string("23094") + elif match_arg_212.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_212.value + return money_of_cents_string("27814") + else: + return (money_of_cents_string("32534") + + (money_of_cents_string("4720") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_210.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_210.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_213 = situation_familiale_calcul_apl_4 + if match_arg_213.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_213.value + return money_of_cents_string("21567") + elif match_arg_213.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_213.value + return money_of_cents_string("25874") + else: + return (money_of_cents_string("30881") + + (money_of_cents_string("4307") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + else: + raise EmptyError + def temp_calcul_plafond_mensualite_d832_10_3_72(_:Any): + match_arg_214 = type_pret + if match_arg_214.code == TypePret_Code.D331_32: + _ = match_arg_214.value + temp_calcul_plafond_mensualite_d832_10_3_73 = False + elif match_arg_214.code == TypePret_Code.D331_63_64: + _ = match_arg_214.value + temp_calcul_plafond_mensualite_d832_10_3_73 = True + elif match_arg_214.code == TypePret_Code.D331_59_8: + _ = match_arg_214.value + temp_calcul_plafond_mensualite_d832_10_3_73 = False + elif match_arg_214.code == TypePret_Code.D331_76_1: + _ = match_arg_214.value + temp_calcul_plafond_mensualite_d832_10_3_73 = False + elif match_arg_214.code == TypePret_Code.Autre: + _ = match_arg_214.value + temp_calcul_plafond_mensualite_d832_10_3_73 = False + match_arg_215 = anciennete_logement + if match_arg_215.code == NeufOuAncien_Code.Neuf: + _ = match_arg_215.value + temp_calcul_plafond_mensualite_d832_10_3_74 = True + elif match_arg_215.code == NeufOuAncien_Code.Ancien: + _ = match_arg_215.value + temp_calcul_plafond_mensualite_d832_10_3_74 = False + if ((param_13 >= date_of_numbers(2005,8,31)) and + ((param_13 < date_of_numbers(2006,12,31)) and + (temp_calcul_plafond_mensualite_d832_10_3_74 and + temp_calcul_plafond_mensualite_d832_10_3_73))): + match_arg_216 = zone_2 + if match_arg_216.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_216.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_217 = situation_familiale_calcul_apl_4 + if match_arg_217.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_217.value + return money_of_cents_string("32185") + elif match_arg_217.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_217.value + return money_of_cents_string("38827") + else: + return (money_of_cents_string("45469") + + (money_of_cents_string("6642") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_216.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_216.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_218 = situation_familiale_calcul_apl_4 + if match_arg_218.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_218.value + return money_of_cents_string("28722") + elif match_arg_218.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_218.value + return money_of_cents_string("34570") + else: + return (money_of_cents_string("40418") + + (money_of_cents_string("5848") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_216.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_216.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_219 = situation_familiale_calcul_apl_4 + if match_arg_219.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_219.value + return money_of_cents_string("26813") + elif match_arg_219.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_219.value + return money_of_cents_string("32152") + else: + return (money_of_cents_string("37491") + + (money_of_cents_string("5339") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + else: + raise EmptyError + def temp_calcul_plafond_mensualite_d832_10_3_75(_:Any): + match_arg_220 = type_pret + if match_arg_220.code == TypePret_Code.D331_32: + _ = match_arg_220.value + temp_calcul_plafond_mensualite_d832_10_3_76 = False + elif match_arg_220.code == TypePret_Code.D331_63_64: + _ = match_arg_220.value + temp_calcul_plafond_mensualite_d832_10_3_76 = True + elif match_arg_220.code == TypePret_Code.D331_59_8: + _ = match_arg_220.value + temp_calcul_plafond_mensualite_d832_10_3_76 = False + elif match_arg_220.code == TypePret_Code.D331_76_1: + _ = match_arg_220.value + temp_calcul_plafond_mensualite_d832_10_3_76 = False + elif match_arg_220.code == TypePret_Code.Autre: + _ = match_arg_220.value + temp_calcul_plafond_mensualite_d832_10_3_76 = False + match_arg_221 = anciennete_logement + if match_arg_221.code == NeufOuAncien_Code.Neuf: + _ = match_arg_221.value + temp_calcul_plafond_mensualite_d832_10_3_77 = False + elif match_arg_221.code == NeufOuAncien_Code.Ancien: + _ = match_arg_221.value + temp_calcul_plafond_mensualite_d832_10_3_77 = True + if ((param_13 >= date_of_numbers(2003,6,30)) and + ((param_13 < date_of_numbers(2005,8,31)) and + (temp_calcul_plafond_mensualite_d832_10_3_77 and + temp_calcul_plafond_mensualite_d832_10_3_76))): + match_arg_222 = zone_2 + if match_arg_222.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_222.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_223 = situation_familiale_calcul_apl_4 + if match_arg_223.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_223.value + return money_of_cents_string("25449") + elif match_arg_223.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_223.value + return money_of_cents_string("30711") + else: + return (money_of_cents_string("35973") + + (money_of_cents_string("5262") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_222.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_222.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_224 = situation_familiale_calcul_apl_4 + if match_arg_224.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_224.value + return money_of_cents_string("22686") + elif match_arg_224.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_224.value + return money_of_cents_string("27323") + else: + return (money_of_cents_string("31960") + + (money_of_cents_string("4637") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_222.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_222.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_225 = situation_familiale_calcul_apl_4 + if match_arg_225.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_225.value + return money_of_cents_string("21186") + elif match_arg_225.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_225.value + return money_of_cents_string("25417") + else: + return (money_of_cents_string("26948") + + (money_of_cents_string("4231") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + else: + raise EmptyError + def temp_calcul_plafond_mensualite_d832_10_3_78(_:Any): + match_arg_226 = type_pret + if match_arg_226.code == TypePret_Code.D331_32: + _ = match_arg_226.value + temp_calcul_plafond_mensualite_d832_10_3_79 = False + elif match_arg_226.code == TypePret_Code.D331_63_64: + _ = match_arg_226.value + temp_calcul_plafond_mensualite_d832_10_3_79 = True + elif match_arg_226.code == TypePret_Code.D331_59_8: + _ = match_arg_226.value + temp_calcul_plafond_mensualite_d832_10_3_79 = False + elif match_arg_226.code == TypePret_Code.D331_76_1: + _ = match_arg_226.value + temp_calcul_plafond_mensualite_d832_10_3_79 = False + elif match_arg_226.code == TypePret_Code.Autre: + _ = match_arg_226.value + temp_calcul_plafond_mensualite_d832_10_3_79 = False + match_arg_227 = anciennete_logement + if match_arg_227.code == NeufOuAncien_Code.Neuf: + _ = match_arg_227.value + temp_calcul_plafond_mensualite_d832_10_3_80 = True + elif match_arg_227.code == NeufOuAncien_Code.Ancien: + _ = match_arg_227.value + temp_calcul_plafond_mensualite_d832_10_3_80 = False + if ((param_13 >= date_of_numbers(2003,6,30)) and + ((param_13 < date_of_numbers(2005,8,31)) and + (temp_calcul_plafond_mensualite_d832_10_3_80 and + temp_calcul_plafond_mensualite_d832_10_3_79))): + match_arg_228 = zone_2 + if match_arg_228.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_228.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_229 = situation_familiale_calcul_apl_4 + if match_arg_229.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_229.value + return money_of_cents_string("31616") + elif match_arg_229.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_229.value + return money_of_cents_string("38141") + else: + return (money_of_cents_string("44666") + + (money_of_cents_string("6525") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_228.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_228.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_230 = situation_familiale_calcul_apl_4 + if match_arg_230.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_230.value + return money_of_cents_string("28214") + elif match_arg_230.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_230.value + return money_of_cents_string("33959") + else: + return (money_of_cents_string("39704") + + (money_of_cents_string("5745") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_228.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_228.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_231 = situation_familiale_calcul_apl_4 + if match_arg_231.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_231.value + return money_of_cents_string("26339") + elif match_arg_231.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_231.value + return money_of_cents_string("31584") + else: + return (money_of_cents_string("36829") + + (money_of_cents_string("5245") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + else: + raise EmptyError + def temp_calcul_plafond_mensualite_d832_10_3_81(_:Any): + match_arg_232 = type_pret + if match_arg_232.code == TypePret_Code.D331_32: + _ = match_arg_232.value + temp_calcul_plafond_mensualite_d832_10_3_82 = False + elif match_arg_232.code == TypePret_Code.D331_63_64: + _ = match_arg_232.value + temp_calcul_plafond_mensualite_d832_10_3_82 = True + elif match_arg_232.code == TypePret_Code.D331_59_8: + _ = match_arg_232.value + temp_calcul_plafond_mensualite_d832_10_3_82 = False + elif match_arg_232.code == TypePret_Code.D331_76_1: + _ = match_arg_232.value + temp_calcul_plafond_mensualite_d832_10_3_82 = False + elif match_arg_232.code == TypePret_Code.Autre: + _ = match_arg_232.value + temp_calcul_plafond_mensualite_d832_10_3_82 = False + match_arg_233 = anciennete_logement + if match_arg_233.code == NeufOuAncien_Code.Neuf: + _ = match_arg_233.value + temp_calcul_plafond_mensualite_d832_10_3_83 = False + elif match_arg_233.code == NeufOuAncien_Code.Ancien: + _ = match_arg_233.value + temp_calcul_plafond_mensualite_d832_10_3_83 = True + if ((param_13 >= date_of_numbers(2002,6,30)) and + ((param_13 < date_of_numbers(2003,6,30)) and + (temp_calcul_plafond_mensualite_d832_10_3_83 and + temp_calcul_plafond_mensualite_d832_10_3_82))): + match_arg_234 = zone_2 + if match_arg_234.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_234.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_235 = situation_familiale_calcul_apl_4 + if match_arg_235.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_235.value + return money_of_cents_string("25147") + elif match_arg_235.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_235.value + return money_of_cents_string("30347") + else: + return (money_of_cents_string("35547") + + (money_of_cents_string("5200") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_234.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_234.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_236 = situation_familiale_calcul_apl_4 + if match_arg_236.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_236.value + return money_of_cents_string("22417") + elif match_arg_236.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_236.value + return money_of_cents_string("26999") + else: + return (money_of_cents_string("31581") + + (money_of_cents_string("4582") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_234.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_234.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_237 = situation_familiale_calcul_apl_4 + if match_arg_237.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_237.value + return money_of_cents_string("20935") + elif match_arg_237.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_237.value + return money_of_cents_string("25116") + else: + return (money_of_cents_string("29297") + + (money_of_cents_string("4181") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + else: + raise EmptyError + def temp_calcul_plafond_mensualite_d832_10_3_84(_:Any): + match_arg_238 = type_pret + if match_arg_238.code == TypePret_Code.D331_32: + _ = match_arg_238.value + temp_calcul_plafond_mensualite_d832_10_3_85 = False + elif match_arg_238.code == TypePret_Code.D331_63_64: + _ = match_arg_238.value + temp_calcul_plafond_mensualite_d832_10_3_85 = True + elif match_arg_238.code == TypePret_Code.D331_59_8: + _ = match_arg_238.value + temp_calcul_plafond_mensualite_d832_10_3_85 = False + elif match_arg_238.code == TypePret_Code.D331_76_1: + _ = match_arg_238.value + temp_calcul_plafond_mensualite_d832_10_3_85 = False + elif match_arg_238.code == TypePret_Code.Autre: + _ = match_arg_238.value + temp_calcul_plafond_mensualite_d832_10_3_85 = False + match_arg_239 = anciennete_logement + if match_arg_239.code == NeufOuAncien_Code.Neuf: + _ = match_arg_239.value + temp_calcul_plafond_mensualite_d832_10_3_86 = True + elif match_arg_239.code == NeufOuAncien_Code.Ancien: + _ = match_arg_239.value + temp_calcul_plafond_mensualite_d832_10_3_86 = False + if ((param_13 >= date_of_numbers(2002,6,30)) and + ((param_13 < date_of_numbers(2003,6,30)) and + (temp_calcul_plafond_mensualite_d832_10_3_86 and + temp_calcul_plafond_mensualite_d832_10_3_85))): + match_arg_240 = zone_2 + if match_arg_240.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_240.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_241 = situation_familiale_calcul_apl_4 + if match_arg_241.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_241.value + return money_of_cents_string("31241") + elif match_arg_241.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_241.value + return money_of_cents_string("37689") + else: + return (money_of_cents_string("44137") + + (money_of_cents_string("6448") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_240.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_240.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_242 = situation_familiale_calcul_apl_4 + if match_arg_242.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_242.value + return money_of_cents_string("27879") + elif match_arg_242.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_242.value + return money_of_cents_string("33556") + else: + return (money_of_cents_string("39233") + + (money_of_cents_string("5677") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_240.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_240.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_243 = situation_familiale_calcul_apl_4 + if match_arg_243.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_243.value + return money_of_cents_string("26027") + elif match_arg_243.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_243.value + return money_of_cents_string("31210") + else: + return (money_of_cents_string("36393") + + (money_of_cents_string("5183") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + else: + raise EmptyError + def temp_calcul_plafond_mensualite_d832_10_3_87(_:Any): + match_arg_244 = type_pret + if match_arg_244.code == TypePret_Code.D331_32: + _ = match_arg_244.value + temp_calcul_plafond_mensualite_d832_10_3_88 = False + elif match_arg_244.code == TypePret_Code.D331_63_64: + _ = match_arg_244.value + temp_calcul_plafond_mensualite_d832_10_3_88 = True + elif match_arg_244.code == TypePret_Code.D331_59_8: + _ = match_arg_244.value + temp_calcul_plafond_mensualite_d832_10_3_88 = False + elif match_arg_244.code == TypePret_Code.D331_76_1: + _ = match_arg_244.value + temp_calcul_plafond_mensualite_d832_10_3_88 = False + elif match_arg_244.code == TypePret_Code.Autre: + _ = match_arg_244.value + temp_calcul_plafond_mensualite_d832_10_3_88 = False + match_arg_245 = anciennete_logement + if match_arg_245.code == NeufOuAncien_Code.Neuf: + _ = match_arg_245.value + temp_calcul_plafond_mensualite_d832_10_3_89 = False + elif match_arg_245.code == NeufOuAncien_Code.Ancien: + _ = match_arg_245.value + temp_calcul_plafond_mensualite_d832_10_3_89 = True + if ((param_13 >= date_of_numbers(2002,1,1)) and + ((param_13 < date_of_numbers(2002,6,30)) and + (temp_calcul_plafond_mensualite_d832_10_3_89 and + temp_calcul_plafond_mensualite_d832_10_3_88))): + match_arg_246 = zone_2 + if match_arg_246.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_246.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_247 = situation_familiale_calcul_apl_4 + if match_arg_247.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_247.value + return money_of_cents_string("24849") + elif match_arg_247.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_247.value + return money_of_cents_string("29987") + else: + return (money_of_cents_string("35125") + + (money_of_cents_string("5138") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_246.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_246.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_248 = situation_familiale_calcul_apl_4 + if match_arg_248.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_248.value + return money_of_cents_string("22151") + elif match_arg_248.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_248.value + return money_of_cents_string("26679") + else: + return (money_of_cents_string("31207") + + (money_of_cents_string("4528") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_246.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_246.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_249 = situation_familiale_calcul_apl_4 + if match_arg_249.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_249.value + return money_of_cents_string("20687") + elif match_arg_249.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_249.value + return money_of_cents_string("24818") + else: + return (money_of_cents_string("28949") + + (money_of_cents_string("4131") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + else: + raise EmptyError + def temp_calcul_plafond_mensualite_d832_10_3_90(_:Any): + match_arg_250 = type_pret + if match_arg_250.code == TypePret_Code.D331_32: + _ = match_arg_250.value + temp_calcul_plafond_mensualite_d832_10_3_91 = False + elif match_arg_250.code == TypePret_Code.D331_63_64: + _ = match_arg_250.value + temp_calcul_plafond_mensualite_d832_10_3_91 = True + elif match_arg_250.code == TypePret_Code.D331_59_8: + _ = match_arg_250.value + temp_calcul_plafond_mensualite_d832_10_3_91 = False + elif match_arg_250.code == TypePret_Code.D331_76_1: + _ = match_arg_250.value + temp_calcul_plafond_mensualite_d832_10_3_91 = False + elif match_arg_250.code == TypePret_Code.Autre: + _ = match_arg_250.value + temp_calcul_plafond_mensualite_d832_10_3_91 = False + match_arg_251 = anciennete_logement + if match_arg_251.code == NeufOuAncien_Code.Neuf: + _ = match_arg_251.value + temp_calcul_plafond_mensualite_d832_10_3_92 = False + elif match_arg_251.code == NeufOuAncien_Code.Ancien: + _ = match_arg_251.value + temp_calcul_plafond_mensualite_d832_10_3_92 = True + if ((param_13 >= date_of_numbers(2001,7,1)) and + ((param_13 < date_of_numbers(2001,12,31)) and + (temp_calcul_plafond_mensualite_d832_10_3_92 and + temp_calcul_plafond_mensualite_d832_10_3_91))): + match_arg_252 = zone_2 + if match_arg_252.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_252.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_253 = situation_familiale_calcul_apl_4 + if match_arg_253.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_253.value + temp_calcul_plafond_mensualite_d832_10_3_93 = money_of_cents_string("163000") + elif match_arg_253.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_253.value + temp_calcul_plafond_mensualite_d832_10_3_93 = money_of_cents_string("196700") + else: + temp_calcul_plafond_mensualite_d832_10_3_93 = (money_of_cents_string("230400") + + (money_of_cents_string("33700") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_252.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_252.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_254 = situation_familiale_calcul_apl_4 + if match_arg_254.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_254.value + temp_calcul_plafond_mensualite_d832_10_3_93 = money_of_cents_string("145300") + elif match_arg_254.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_254.value + temp_calcul_plafond_mensualite_d832_10_3_93 = money_of_cents_string("175000") + else: + temp_calcul_plafond_mensualite_d832_10_3_93 = (money_of_cents_string("204700") + + (money_of_cents_string("29700") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_252.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_252.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_255 = situation_familiale_calcul_apl_4 + if match_arg_255.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_255.value + temp_calcul_plafond_mensualite_d832_10_3_93 = money_of_cents_string("135700") + elif match_arg_255.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_255.value + temp_calcul_plafond_mensualite_d832_10_3_93 = money_of_cents_string("162800") + else: + temp_calcul_plafond_mensualite_d832_10_3_93 = (money_of_cents_string("189900") + + (money_of_cents_string("27100") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + return (temp_calcul_plafond_mensualite_d832_10_3_93 * + taux_francs_vers_euros) + else: + raise EmptyError + def temp_calcul_plafond_mensualite_d832_10_3_94(_:Any): + match_arg_256 = type_pret + if match_arg_256.code == TypePret_Code.D331_32: + _ = match_arg_256.value + temp_calcul_plafond_mensualite_d832_10_3_95 = False + elif match_arg_256.code == TypePret_Code.D331_63_64: + _ = match_arg_256.value + temp_calcul_plafond_mensualite_d832_10_3_95 = True + elif match_arg_256.code == TypePret_Code.D331_59_8: + _ = match_arg_256.value + temp_calcul_plafond_mensualite_d832_10_3_95 = False + elif match_arg_256.code == TypePret_Code.D331_76_1: + _ = match_arg_256.value + temp_calcul_plafond_mensualite_d832_10_3_95 = False + elif match_arg_256.code == TypePret_Code.Autre: + _ = match_arg_256.value + temp_calcul_plafond_mensualite_d832_10_3_95 = False + match_arg_257 = anciennete_logement + if match_arg_257.code == NeufOuAncien_Code.Neuf: + _ = match_arg_257.value + temp_calcul_plafond_mensualite_d832_10_3_96 = True + elif match_arg_257.code == NeufOuAncien_Code.Ancien: + _ = match_arg_257.value + temp_calcul_plafond_mensualite_d832_10_3_96 = False + if ((param_13 >= date_of_numbers(2002,1,1)) and + ((param_13 < date_of_numbers(2002,6,30)) and + (temp_calcul_plafond_mensualite_d832_10_3_96 and + temp_calcul_plafond_mensualite_d832_10_3_95))): + match_arg_258 = zone_2 + if match_arg_258.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_258.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_259 = situation_familiale_calcul_apl_4 + if match_arg_259.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_259.value + return money_of_cents_string("30871") + elif match_arg_259.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_259.value + return money_of_cents_string("37243") + else: + return (money_of_cents_string("43615") + + (money_of_cents_string("6372") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_258.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_258.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_260 = situation_familiale_calcul_apl_4 + if match_arg_260.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_260.value + return money_of_cents_string("27548") + elif match_arg_260.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_260.value + return money_of_cents_string("33148") + else: + return (money_of_cents_string("38768") + + (money_of_cents_string("5610") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_258.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_258.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_261 = situation_familiale_calcul_apl_4 + if match_arg_261.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_261.value + return money_of_cents_string("25718") + elif match_arg_261.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_261.value + return money_of_cents_string("30840") + else: + return (money_of_cents_string("35962") + + (money_of_cents_string("5122") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + else: + raise EmptyError + def temp_calcul_plafond_mensualite_d832_10_3_97(_:Any): + match_arg_262 = type_pret + if match_arg_262.code == TypePret_Code.D331_32: + _ = match_arg_262.value + temp_calcul_plafond_mensualite_d832_10_3_98 = False + elif match_arg_262.code == TypePret_Code.D331_63_64: + _ = match_arg_262.value + temp_calcul_plafond_mensualite_d832_10_3_98 = True + elif match_arg_262.code == TypePret_Code.D331_59_8: + _ = match_arg_262.value + temp_calcul_plafond_mensualite_d832_10_3_98 = False + elif match_arg_262.code == TypePret_Code.D331_76_1: + _ = match_arg_262.value + temp_calcul_plafond_mensualite_d832_10_3_98 = False + elif match_arg_262.code == TypePret_Code.Autre: + _ = match_arg_262.value + temp_calcul_plafond_mensualite_d832_10_3_98 = False + match_arg_263 = anciennete_logement + if match_arg_263.code == NeufOuAncien_Code.Neuf: + _ = match_arg_263.value + temp_calcul_plafond_mensualite_d832_10_3_99 = True + elif match_arg_263.code == NeufOuAncien_Code.Ancien: + _ = match_arg_263.value + temp_calcul_plafond_mensualite_d832_10_3_99 = False + if ((param_13 >= date_of_numbers(2001,7,1)) and + ((param_13 < date_of_numbers(2001,12,31)) and + (temp_calcul_plafond_mensualite_d832_10_3_99 and + temp_calcul_plafond_mensualite_d832_10_3_98))): + match_arg_264 = zone_2 + if match_arg_264.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_264.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_265 = situation_familiale_calcul_apl_4 + if match_arg_265.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_265.value + temp_calcul_plafond_mensualite_d832_10_3_100 = money_of_cents_string("202500") + elif match_arg_265.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_265.value + temp_calcul_plafond_mensualite_d832_10_3_100 = money_of_cents_string("244300") + else: + temp_calcul_plafond_mensualite_d832_10_3_100 = (money_of_cents_string("286100") + + (money_of_cents_string("41800") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_264.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_264.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_266 = situation_familiale_calcul_apl_4 + if match_arg_266.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_266.value + temp_calcul_plafond_mensualite_d832_10_3_100 = money_of_cents_string("180700") + elif match_arg_266.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_266.value + temp_calcul_plafond_mensualite_d832_10_3_100 = money_of_cents_string("217500") + else: + temp_calcul_plafond_mensualite_d832_10_3_100 = (money_of_cents_string("254300") + + (money_of_cents_string("36800") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_264.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_264.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_267 = situation_familiale_calcul_apl_4 + if match_arg_267.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_267.value + temp_calcul_plafond_mensualite_d832_10_3_100 = money_of_cents_string("168700") + elif match_arg_267.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_267.value + temp_calcul_plafond_mensualite_d832_10_3_100 = money_of_cents_string("202300") + else: + temp_calcul_plafond_mensualite_d832_10_3_100 = (money_of_cents_string("235900") + + (money_of_cents_string("33600") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + return (temp_calcul_plafond_mensualite_d832_10_3_100 * + taux_francs_vers_euros) + else: + raise EmptyError + def temp_calcul_plafond_mensualite_d832_10_3_101(_:Any): + match_arg_268 = type_pret + if match_arg_268.code == TypePret_Code.D331_32: + _ = match_arg_268.value + temp_calcul_plafond_mensualite_d832_10_3_102 = False + elif match_arg_268.code == TypePret_Code.D331_63_64: + _ = match_arg_268.value + temp_calcul_plafond_mensualite_d832_10_3_102 = True + elif match_arg_268.code == TypePret_Code.D331_59_8: + _ = match_arg_268.value + temp_calcul_plafond_mensualite_d832_10_3_102 = False + elif match_arg_268.code == TypePret_Code.D331_76_1: + _ = match_arg_268.value + temp_calcul_plafond_mensualite_d832_10_3_102 = False + elif match_arg_268.code == TypePret_Code.Autre: + _ = match_arg_268.value + temp_calcul_plafond_mensualite_d832_10_3_102 = False + match_arg_269 = anciennete_logement + if match_arg_269.code == NeufOuAncien_Code.Neuf: + _ = match_arg_269.value + temp_calcul_plafond_mensualite_d832_10_3_103 = False + elif match_arg_269.code == NeufOuAncien_Code.Ancien: + _ = match_arg_269.value + temp_calcul_plafond_mensualite_d832_10_3_103 = True + if ((param_13 >= date_of_numbers(2000,6,30)) and + ((param_13 <= date_of_numbers(2001,6,30)) and + (temp_calcul_plafond_mensualite_d832_10_3_103 and + temp_calcul_plafond_mensualite_d832_10_3_102))): + match_arg_270 = zone_2 + if match_arg_270.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_270.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_271 = situation_familiale_calcul_apl_4 + if match_arg_271.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_271.value + temp_calcul_plafond_mensualite_d832_10_3_104 = money_of_cents_string("161100") + elif match_arg_271.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_271.value + temp_calcul_plafond_mensualite_d832_10_3_104 = money_of_cents_string("194400") + else: + temp_calcul_plafond_mensualite_d832_10_3_104 = (money_of_cents_string("227700") + + (money_of_cents_string("33300") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_270.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_270.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_272 = situation_familiale_calcul_apl_4 + if match_arg_272.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_272.value + temp_calcul_plafond_mensualite_d832_10_3_104 = money_of_cents_string("143600") + elif match_arg_272.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_272.value + temp_calcul_plafond_mensualite_d832_10_3_104 = money_of_cents_string("172900") + else: + temp_calcul_plafond_mensualite_d832_10_3_104 = (money_of_cents_string("202200") + + (money_of_cents_string("29300") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_270.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_270.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_273 = situation_familiale_calcul_apl_4 + if match_arg_273.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_273.value + temp_calcul_plafond_mensualite_d832_10_3_104 = money_of_cents_string("134100") + elif match_arg_273.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_273.value + temp_calcul_plafond_mensualite_d832_10_3_104 = money_of_cents_string("160900") + else: + temp_calcul_plafond_mensualite_d832_10_3_104 = (money_of_cents_string("187700") + + (money_of_cents_string("26800") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + return (temp_calcul_plafond_mensualite_d832_10_3_104 * + taux_francs_vers_euros) + else: + raise EmptyError + def temp_calcul_plafond_mensualite_d832_10_3_105(_:Any): + match_arg_274 = type_pret + if match_arg_274.code == TypePret_Code.D331_32: + _ = match_arg_274.value + temp_calcul_plafond_mensualite_d832_10_3_106 = False + elif match_arg_274.code == TypePret_Code.D331_63_64: + _ = match_arg_274.value + temp_calcul_plafond_mensualite_d832_10_3_106 = True + elif match_arg_274.code == TypePret_Code.D331_59_8: + _ = match_arg_274.value + temp_calcul_plafond_mensualite_d832_10_3_106 = False + elif match_arg_274.code == TypePret_Code.D331_76_1: + _ = match_arg_274.value + temp_calcul_plafond_mensualite_d832_10_3_106 = False + elif match_arg_274.code == TypePret_Code.Autre: + _ = match_arg_274.value + temp_calcul_plafond_mensualite_d832_10_3_106 = False + match_arg_275 = anciennete_logement + if match_arg_275.code == NeufOuAncien_Code.Neuf: + _ = match_arg_275.value + temp_calcul_plafond_mensualite_d832_10_3_107 = True + elif match_arg_275.code == NeufOuAncien_Code.Ancien: + _ = match_arg_275.value + temp_calcul_plafond_mensualite_d832_10_3_107 = False + if ((param_13 >= date_of_numbers(2000,6,30)) and + ((param_13 <= date_of_numbers(2001,6,30)) and + (temp_calcul_plafond_mensualite_d832_10_3_107 and + temp_calcul_plafond_mensualite_d832_10_3_106))): + match_arg_276 = zone_2 + if match_arg_276.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_276.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_277 = situation_familiale_calcul_apl_4 + if match_arg_277.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_277.value + temp_calcul_plafond_mensualite_d832_10_3_108 = money_of_cents_string("200100") + elif match_arg_277.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_277.value + temp_calcul_plafond_mensualite_d832_10_3_108 = money_of_cents_string("141400") + else: + temp_calcul_plafond_mensualite_d832_10_3_108 = (money_of_cents_string("282700") + + (money_of_cents_string("41300") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_276.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_276.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_278 = situation_familiale_calcul_apl_4 + if match_arg_278.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_278.value + temp_calcul_plafond_mensualite_d832_10_3_108 = money_of_cents_string("178600") + elif match_arg_278.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_278.value + temp_calcul_plafond_mensualite_d832_10_3_108 = money_of_cents_string("215000") + else: + temp_calcul_plafond_mensualite_d832_10_3_108 = (money_of_cents_string("251400") + + (money_of_cents_string("36400") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_276.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_276.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_279 = situation_familiale_calcul_apl_4 + if match_arg_279.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_279.value + temp_calcul_plafond_mensualite_d832_10_3_108 = money_of_cents_string("166700") + elif match_arg_279.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_279.value + temp_calcul_plafond_mensualite_d832_10_3_108 = money_of_cents_string("199900") + else: + temp_calcul_plafond_mensualite_d832_10_3_108 = (money_of_cents_string("233100") + + (money_of_cents_string("33200") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + return (temp_calcul_plafond_mensualite_d832_10_3_108 * + taux_francs_vers_euros) + else: + raise EmptyError + def temp_calcul_plafond_mensualite_d832_10_3_109(_:Any): + match_arg_280 = type_pret + if match_arg_280.code == TypePret_Code.D331_32: + _ = match_arg_280.value + temp_calcul_plafond_mensualite_d832_10_3_110 = False + elif match_arg_280.code == TypePret_Code.D331_63_64: + _ = match_arg_280.value + temp_calcul_plafond_mensualite_d832_10_3_110 = True + elif match_arg_280.code == TypePret_Code.D331_59_8: + _ = match_arg_280.value + temp_calcul_plafond_mensualite_d832_10_3_110 = False + elif match_arg_280.code == TypePret_Code.D331_76_1: + _ = match_arg_280.value + temp_calcul_plafond_mensualite_d832_10_3_110 = False + elif match_arg_280.code == TypePret_Code.Autre: + _ = match_arg_280.value + temp_calcul_plafond_mensualite_d832_10_3_110 = False + match_arg_281 = anciennete_logement + if match_arg_281.code == NeufOuAncien_Code.Neuf: + _ = match_arg_281.value + temp_calcul_plafond_mensualite_d832_10_3_111 = False + elif match_arg_281.code == NeufOuAncien_Code.Ancien: + _ = match_arg_281.value + temp_calcul_plafond_mensualite_d832_10_3_111 = True + if ((param_13 >= date_of_numbers(1994,11,27)) and + ((param_13 < date_of_numbers(2000,6,30)) and + (temp_calcul_plafond_mensualite_d832_10_3_111 and + temp_calcul_plafond_mensualite_d832_10_3_110))): + match_arg_282 = zone_2 + if match_arg_282.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_282.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_283 = situation_familiale_calcul_apl_4 + if match_arg_283.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_283.value + temp_calcul_plafond_mensualite_d832_10_3_112 = money_of_cents_string("159500") + elif match_arg_283.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_283.value + temp_calcul_plafond_mensualite_d832_10_3_112 = money_of_cents_string("192500") + else: + temp_calcul_plafond_mensualite_d832_10_3_112 = (money_of_cents_string("225500") + + (money_of_cents_string("33000") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_282.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_282.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_284 = situation_familiale_calcul_apl_4 + if match_arg_284.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_284.value + temp_calcul_plafond_mensualite_d832_10_3_112 = money_of_cents_string("142200") + elif match_arg_284.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_284.value + temp_calcul_plafond_mensualite_d832_10_3_112 = money_of_cents_string("171200") + else: + temp_calcul_plafond_mensualite_d832_10_3_112 = (money_of_cents_string("200200") + + (money_of_cents_string("29000") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_282.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_282.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_285 = situation_familiale_calcul_apl_4 + if match_arg_285.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_285.value + temp_calcul_plafond_mensualite_d832_10_3_112 = money_of_cents_string("132800") + elif match_arg_285.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_285.value + temp_calcul_plafond_mensualite_d832_10_3_112 = money_of_cents_string("159300") + else: + temp_calcul_plafond_mensualite_d832_10_3_112 = (money_of_cents_string("185800") + + (money_of_cents_string("26500") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + return (temp_calcul_plafond_mensualite_d832_10_3_112 * + taux_francs_vers_euros) + else: + raise EmptyError + def temp_calcul_plafond_mensualite_d832_10_3_113(_:Any): + match_arg_286 = type_pret + if match_arg_286.code == TypePret_Code.D331_32: + _ = match_arg_286.value + temp_calcul_plafond_mensualite_d832_10_3_114 = False + elif match_arg_286.code == TypePret_Code.D331_63_64: + _ = match_arg_286.value + temp_calcul_plafond_mensualite_d832_10_3_114 = True + elif match_arg_286.code == TypePret_Code.D331_59_8: + _ = match_arg_286.value + temp_calcul_plafond_mensualite_d832_10_3_114 = False + elif match_arg_286.code == TypePret_Code.D331_76_1: + _ = match_arg_286.value + temp_calcul_plafond_mensualite_d832_10_3_114 = False + elif match_arg_286.code == TypePret_Code.Autre: + _ = match_arg_286.value + temp_calcul_plafond_mensualite_d832_10_3_114 = False + match_arg_287 = anciennete_logement + if match_arg_287.code == NeufOuAncien_Code.Neuf: + _ = match_arg_287.value + temp_calcul_plafond_mensualite_d832_10_3_115 = True + elif match_arg_287.code == NeufOuAncien_Code.Ancien: + _ = match_arg_287.value + temp_calcul_plafond_mensualite_d832_10_3_115 = False + if ((param_13 >= date_of_numbers(1994,11,27)) and + ((param_13 < date_of_numbers(2000,6,30)) and + (temp_calcul_plafond_mensualite_d832_10_3_115 and + temp_calcul_plafond_mensualite_d832_10_3_114))): + match_arg_288 = zone_2 + if match_arg_288.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_288.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_289 = situation_familiale_calcul_apl_4 + if match_arg_289.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_289.value + temp_calcul_plafond_mensualite_d832_10_3_116 = money_of_cents_string("198100") + elif match_arg_289.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_289.value + temp_calcul_plafond_mensualite_d832_10_3_116 = money_of_cents_string("239000") + else: + temp_calcul_plafond_mensualite_d832_10_3_116 = (money_of_cents_string("279900") + + (money_of_cents_string("40900") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_288.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_288.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_290 = situation_familiale_calcul_apl_4 + if match_arg_290.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_290.value + temp_calcul_plafond_mensualite_d832_10_3_116 = money_of_cents_string("176800") + elif match_arg_290.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_290.value + temp_calcul_plafond_mensualite_d832_10_3_116 = money_of_cents_string("212800") + else: + temp_calcul_plafond_mensualite_d832_10_3_116 = (money_of_cents_string("248800") + + (money_of_cents_string("36000") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_288.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_288.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_291 = situation_familiale_calcul_apl_4 + if match_arg_291.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_291.value + temp_calcul_plafond_mensualite_d832_10_3_116 = money_of_cents_string("165000") + elif match_arg_291.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_291.value + temp_calcul_plafond_mensualite_d832_10_3_116 = money_of_cents_string("197900") + else: + temp_calcul_plafond_mensualite_d832_10_3_116 = (money_of_cents_string("230800") + + (money_of_cents_string("32900") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + return (temp_calcul_plafond_mensualite_d832_10_3_116 * + taux_francs_vers_euros) + else: + raise EmptyError + def temp_calcul_plafond_mensualite_d832_10_3_117(_:Any): + match_arg_292 = type_pret + if match_arg_292.code == TypePret_Code.D331_32: + _ = match_arg_292.value + temp_calcul_plafond_mensualite_d832_10_3_118 = False + elif match_arg_292.code == TypePret_Code.D331_63_64: + _ = match_arg_292.value + temp_calcul_plafond_mensualite_d832_10_3_118 = True + elif match_arg_292.code == TypePret_Code.D331_59_8: + _ = match_arg_292.value + temp_calcul_plafond_mensualite_d832_10_3_118 = False + elif match_arg_292.code == TypePret_Code.D331_76_1: + _ = match_arg_292.value + temp_calcul_plafond_mensualite_d832_10_3_118 = False + elif match_arg_292.code == TypePret_Code.Autre: + _ = match_arg_292.value + temp_calcul_plafond_mensualite_d832_10_3_118 = False + match_arg_293 = anciennete_logement + if match_arg_293.code == NeufOuAncien_Code.Neuf: + _ = match_arg_293.value + temp_calcul_plafond_mensualite_d832_10_3_119 = False + elif match_arg_293.code == NeufOuAncien_Code.Ancien: + ameliore_par_occupant_1 = match_arg_293.value + match_arg_294 = ameliore_par_occupant_1 + if match_arg_294.code == AmelioreParOccupant_Code.Oui: + _ = match_arg_294.value + temp_calcul_plafond_mensualite_d832_10_3_119 = True + elif match_arg_294.code == AmelioreParOccupant_Code.Non: + _ = match_arg_294.value + temp_calcul_plafond_mensualite_d832_10_3_119 = False + if ((param_13 >= date_of_numbers(1992,6,30)) and + ((param_13 < date_of_numbers(1994,11,27)) and + (temp_calcul_plafond_mensualite_d832_10_3_119 and + temp_calcul_plafond_mensualite_d832_10_3_118))): + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_295 = situation_familiale_calcul_apl_4 + if match_arg_295.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_295.value + temp_calcul_plafond_mensualite_d832_10_3_120 = money_of_cents_string("86900") + elif match_arg_295.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_295.value + temp_calcul_plafond_mensualite_d832_10_3_120 = money_of_cents_string("97100") + else: + temp_calcul_plafond_mensualite_d832_10_3_120 = (money_of_cents_string("107300") + + (money_of_cents_string("10200") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + return (temp_calcul_plafond_mensualite_d832_10_3_120 * + taux_francs_vers_euros) + else: + raise EmptyError + def temp_calcul_plafond_mensualite_d832_10_3_121(_:Any): + match_arg_296 = type_pret + if match_arg_296.code == TypePret_Code.D331_32: + _ = match_arg_296.value + temp_calcul_plafond_mensualite_d832_10_3_122 = False + elif match_arg_296.code == TypePret_Code.D331_63_64: + _ = match_arg_296.value + temp_calcul_plafond_mensualite_d832_10_3_122 = True + elif match_arg_296.code == TypePret_Code.D331_59_8: + _ = match_arg_296.value + temp_calcul_plafond_mensualite_d832_10_3_122 = False + elif match_arg_296.code == TypePret_Code.D331_76_1: + _ = match_arg_296.value + temp_calcul_plafond_mensualite_d832_10_3_122 = False + elif match_arg_296.code == TypePret_Code.Autre: + _ = match_arg_296.value + temp_calcul_plafond_mensualite_d832_10_3_122 = False + match_arg_297 = anciennete_logement + if match_arg_297.code == NeufOuAncien_Code.Neuf: + _ = match_arg_297.value + temp_calcul_plafond_mensualite_d832_10_3_123 = False + elif match_arg_297.code == NeufOuAncien_Code.Ancien: + ameliore_par_occupant_2 = match_arg_297.value + match_arg_298 = ameliore_par_occupant_2 + if match_arg_298.code == AmelioreParOccupant_Code.Oui: + _ = match_arg_298.value + temp_calcul_plafond_mensualite_d832_10_3_123 = False + elif match_arg_298.code == AmelioreParOccupant_Code.Non: + _ = match_arg_298.value + temp_calcul_plafond_mensualite_d832_10_3_123 = True + if ((param_13 >= date_of_numbers(1992,6,30)) and + ((param_13 < date_of_numbers(1994,11,27)) and + (temp_calcul_plafond_mensualite_d832_10_3_123 and + temp_calcul_plafond_mensualite_d832_10_3_122))): + match_arg_299 = zone_2 + if match_arg_299.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_299.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_300 = situation_familiale_calcul_apl_4 + if match_arg_300.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_300.value + temp_calcul_plafond_mensualite_d832_10_3_124 = money_of_cents_string("167800") + elif match_arg_300.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_300.value + temp_calcul_plafond_mensualite_d832_10_3_124 = money_of_cents_string("202500") + else: + temp_calcul_plafond_mensualite_d832_10_3_124 = (money_of_cents_string("237200") + + (money_of_cents_string("34700") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_299.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_299.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_301 = situation_familiale_calcul_apl_4 + if match_arg_301.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_301.value + temp_calcul_plafond_mensualite_d832_10_3_124 = money_of_cents_string("149600") + elif match_arg_301.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_301.value + temp_calcul_plafond_mensualite_d832_10_3_124 = money_of_cents_string("223900") + else: + temp_calcul_plafond_mensualite_d832_10_3_124 = (money_of_cents_string("261800") + + (money_of_cents_string("37900") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_299.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_299.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_302 = situation_familiale_calcul_apl_4 + if match_arg_302.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_302.value + temp_calcul_plafond_mensualite_d832_10_3_124 = money_of_cents_string("139700") + elif match_arg_302.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_302.value + temp_calcul_plafond_mensualite_d832_10_3_124 = money_of_cents_string("208200") + else: + temp_calcul_plafond_mensualite_d832_10_3_124 = (money_of_cents_string("242800") + + (money_of_cents_string("34600") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + return (temp_calcul_plafond_mensualite_d832_10_3_124 * + taux_francs_vers_euros) + else: + raise EmptyError + def temp_calcul_plafond_mensualite_d832_10_3_125(_:Any): + match_arg_303 = type_pret + if match_arg_303.code == TypePret_Code.D331_32: + _ = match_arg_303.value + temp_calcul_plafond_mensualite_d832_10_3_126 = False + elif match_arg_303.code == TypePret_Code.D331_63_64: + _ = match_arg_303.value + temp_calcul_plafond_mensualite_d832_10_3_126 = True + elif match_arg_303.code == TypePret_Code.D331_59_8: + _ = match_arg_303.value + temp_calcul_plafond_mensualite_d832_10_3_126 = False + elif match_arg_303.code == TypePret_Code.D331_76_1: + _ = match_arg_303.value + temp_calcul_plafond_mensualite_d832_10_3_126 = False + elif match_arg_303.code == TypePret_Code.Autre: + _ = match_arg_303.value + temp_calcul_plafond_mensualite_d832_10_3_126 = False + match_arg_304 = anciennete_logement + if match_arg_304.code == NeufOuAncien_Code.Neuf: + _ = match_arg_304.value + temp_calcul_plafond_mensualite_d832_10_3_127 = True + elif match_arg_304.code == NeufOuAncien_Code.Ancien: + _ = match_arg_304.value + temp_calcul_plafond_mensualite_d832_10_3_127 = False + if ((param_13 >= date_of_numbers(1992,6,30)) and + ((param_13 < date_of_numbers(1994,11,27)) and + (temp_calcul_plafond_mensualite_d832_10_3_127 and + temp_calcul_plafond_mensualite_d832_10_3_126))): + match_arg_305 = zone_2 + if match_arg_305.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_305.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_306 = situation_familiale_calcul_apl_4 + if match_arg_306.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_306.value + temp_calcul_plafond_mensualite_d832_10_3_128 = money_of_cents_string("208500") + elif match_arg_306.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_306.value + temp_calcul_plafond_mensualite_d832_10_3_128 = money_of_cents_string("251500") + else: + temp_calcul_plafond_mensualite_d832_10_3_128 = (money_of_cents_string("294500") + + (money_of_cents_string("43000") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_305.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_305.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_307 = situation_familiale_calcul_apl_4 + if match_arg_307.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_307.value + temp_calcul_plafond_mensualite_d832_10_3_128 = money_of_cents_string("186000") + elif match_arg_307.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_307.value + temp_calcul_plafond_mensualite_d832_10_3_128 = money_of_cents_string("223900") + else: + temp_calcul_plafond_mensualite_d832_10_3_128 = (money_of_cents_string("261800") + + (money_of_cents_string("37900") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_305.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_305.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_308 = situation_familiale_calcul_apl_4 + if match_arg_308.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_308.value + temp_calcul_plafond_mensualite_d832_10_3_128 = money_of_cents_string("173600") + elif match_arg_308.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_308.value + temp_calcul_plafond_mensualite_d832_10_3_128 = money_of_cents_string("208200") + else: + temp_calcul_plafond_mensualite_d832_10_3_128 = (money_of_cents_string("242800") + + (money_of_cents_string("34600") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + return (temp_calcul_plafond_mensualite_d832_10_3_128 * + taux_francs_vers_euros) + else: + raise EmptyError + def temp_calcul_plafond_mensualite_d832_10_3_129(_:Any): + match_arg_309 = type_pret + if match_arg_309.code == TypePret_Code.D331_32: + _ = match_arg_309.value + temp_calcul_plafond_mensualite_d832_10_3_130 = True + elif match_arg_309.code == TypePret_Code.D331_63_64: + _ = match_arg_309.value + temp_calcul_plafond_mensualite_d832_10_3_130 = False + elif match_arg_309.code == TypePret_Code.D331_59_8: + _ = match_arg_309.value + temp_calcul_plafond_mensualite_d832_10_3_130 = False + elif match_arg_309.code == TypePret_Code.D331_76_1: + _ = match_arg_309.value + temp_calcul_plafond_mensualite_d832_10_3_130 = False + elif match_arg_309.code == TypePret_Code.Autre: + _ = match_arg_309.value + temp_calcul_plafond_mensualite_d832_10_3_130 = False + match_arg_310 = anciennete_logement + if match_arg_310.code == NeufOuAncien_Code.Neuf: + _ = match_arg_310.value + temp_calcul_plafond_mensualite_d832_10_3_131 = False + elif match_arg_310.code == NeufOuAncien_Code.Ancien: + _ = match_arg_310.value + temp_calcul_plafond_mensualite_d832_10_3_131 = True + if ((param_13 >= date_of_numbers(1994,11,27)) and + (temp_calcul_plafond_mensualite_d832_10_3_131 and + temp_calcul_plafond_mensualite_d832_10_3_130)): + match_arg_311 = zone_2 + if match_arg_311.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_311.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_312 = situation_familiale_calcul_apl_4 + if match_arg_312.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_312.value + temp_calcul_plafond_mensualite_d832_10_3_132 = money_of_cents_string("148100") + elif match_arg_312.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_312.value + temp_calcul_plafond_mensualite_d832_10_3_132 = money_of_cents_string("178700") + else: + temp_calcul_plafond_mensualite_d832_10_3_132 = (money_of_cents_string("209300") + + (money_of_cents_string("30600") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_311.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_311.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_313 = situation_familiale_calcul_apl_4 + if match_arg_313.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_313.value + temp_calcul_plafond_mensualite_d832_10_3_132 = money_of_cents_string("132000") + elif match_arg_313.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_313.value + temp_calcul_plafond_mensualite_d832_10_3_132 = money_of_cents_string("158900") + else: + temp_calcul_plafond_mensualite_d832_10_3_132 = (money_of_cents_string("185800") + + (money_of_cents_string("26900") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_311.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_311.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_314 = situation_familiale_calcul_apl_4 + if match_arg_314.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_314.value + temp_calcul_plafond_mensualite_d832_10_3_132 = money_of_cents_string("123300") + elif match_arg_314.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_314.value + temp_calcul_plafond_mensualite_d832_10_3_132 = money_of_cents_string("147900") + else: + temp_calcul_plafond_mensualite_d832_10_3_132 = (money_of_cents_string("172500") + + (money_of_cents_string("24600") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + return (temp_calcul_plafond_mensualite_d832_10_3_132 * + taux_francs_vers_euros) + else: + raise EmptyError + def temp_calcul_plafond_mensualite_d832_10_3_133(_:Any): + match_arg_315 = type_pret + if match_arg_315.code == TypePret_Code.D331_32: + _ = match_arg_315.value + temp_calcul_plafond_mensualite_d832_10_3_134 = True + elif match_arg_315.code == TypePret_Code.D331_63_64: + _ = match_arg_315.value + temp_calcul_plafond_mensualite_d832_10_3_134 = False + elif match_arg_315.code == TypePret_Code.D331_59_8: + _ = match_arg_315.value + temp_calcul_plafond_mensualite_d832_10_3_134 = False + elif match_arg_315.code == TypePret_Code.D331_76_1: + _ = match_arg_315.value + temp_calcul_plafond_mensualite_d832_10_3_134 = False + elif match_arg_315.code == TypePret_Code.Autre: + _ = match_arg_315.value + temp_calcul_plafond_mensualite_d832_10_3_134 = False + match_arg_316 = anciennete_logement + if match_arg_316.code == NeufOuAncien_Code.Neuf: + _ = match_arg_316.value + temp_calcul_plafond_mensualite_d832_10_3_135 = True + elif match_arg_316.code == NeufOuAncien_Code.Ancien: + _ = match_arg_316.value + temp_calcul_plafond_mensualite_d832_10_3_135 = False + if ((param_13 >= date_of_numbers(1994,11,27)) and + (temp_calcul_plafond_mensualite_d832_10_3_135 and + temp_calcul_plafond_mensualite_d832_10_3_134)): + match_arg_317 = zone_2 + if match_arg_317.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_317.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_318 = situation_familiale_calcul_apl_4 + if match_arg_318.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_318.value + temp_calcul_plafond_mensualite_d832_10_3_136 = money_of_cents_string("184000") + elif match_arg_318.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_318.value + temp_calcul_plafond_mensualite_d832_10_3_136 = money_of_cents_string("220000") + else: + temp_calcul_plafond_mensualite_d832_10_3_136 = (money_of_cents_string("260000") + + (money_of_cents_string("38000") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_317.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_317.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_319 = situation_familiale_calcul_apl_4 + if match_arg_319.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_319.value + temp_calcul_plafond_mensualite_d832_10_3_136 = money_of_cents_string("164200") + elif match_arg_319.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_319.value + temp_calcul_plafond_mensualite_d832_10_3_136 = money_of_cents_string("197700") + else: + temp_calcul_plafond_mensualite_d832_10_3_136 = (money_of_cents_string("231200") + + (money_of_cents_string("33500") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_317.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_317.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_320 = situation_familiale_calcul_apl_4 + if match_arg_320.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_320.value + temp_calcul_plafond_mensualite_d832_10_3_136 = money_of_cents_string("153200") + elif match_arg_320.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_320.value + temp_calcul_plafond_mensualite_d832_10_3_136 = money_of_cents_string("183700") + else: + temp_calcul_plafond_mensualite_d832_10_3_136 = (money_of_cents_string("214200") + + (money_of_cents_string("30500") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + return (temp_calcul_plafond_mensualite_d832_10_3_136 * + taux_francs_vers_euros) + else: + raise EmptyError + def temp_calcul_plafond_mensualite_d832_10_3_137(_:Any): + match_arg_321 = type_pret + if match_arg_321.code == TypePret_Code.D331_32: + _ = match_arg_321.value + temp_calcul_plafond_mensualite_d832_10_3_138 = True + elif match_arg_321.code == TypePret_Code.D331_63_64: + _ = match_arg_321.value + temp_calcul_plafond_mensualite_d832_10_3_138 = False + elif match_arg_321.code == TypePret_Code.D331_59_8: + _ = match_arg_321.value + temp_calcul_plafond_mensualite_d832_10_3_138 = False + elif match_arg_321.code == TypePret_Code.D331_76_1: + _ = match_arg_321.value + temp_calcul_plafond_mensualite_d832_10_3_138 = False + elif match_arg_321.code == TypePret_Code.Autre: + _ = match_arg_321.value + temp_calcul_plafond_mensualite_d832_10_3_138 = False + match_arg_322 = anciennete_logement + if match_arg_322.code == NeufOuAncien_Code.Neuf: + _ = match_arg_322.value + temp_calcul_plafond_mensualite_d832_10_3_139 = False + elif match_arg_322.code == NeufOuAncien_Code.Ancien: + _ = match_arg_322.value + temp_calcul_plafond_mensualite_d832_10_3_139 = True + if ((param_13 >= date_of_numbers(1992,6,30)) and + ((param_13 < date_of_numbers(1994,11,27)) and + (temp_calcul_plafond_mensualite_d832_10_3_139 and + temp_calcul_plafond_mensualite_d832_10_3_138))): + match_arg_323 = zone_2 + if match_arg_323.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_323.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_324 = situation_familiale_calcul_apl_4 + if match_arg_324.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_324.value + temp_calcul_plafond_mensualite_d832_10_3_140 = money_of_cents_string("167800") + elif match_arg_324.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_324.value + temp_calcul_plafond_mensualite_d832_10_3_140 = money_of_cents_string("202500") + else: + temp_calcul_plafond_mensualite_d832_10_3_140 = (money_of_cents_string("237200") + + (money_of_cents_string("37400") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_323.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_323.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_325 = situation_familiale_calcul_apl_4 + if match_arg_325.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_325.value + temp_calcul_plafond_mensualite_d832_10_3_140 = money_of_cents_string("146900") + elif match_arg_325.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_325.value + temp_calcul_plafond_mensualite_d832_10_3_140 = money_of_cents_string("180100") + else: + temp_calcul_plafond_mensualite_d832_10_3_140 = (money_of_cents_string("210600") + + (money_of_cents_string("30500") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_323.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_323.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_326 = situation_familiale_calcul_apl_4 + if match_arg_326.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_326.value + temp_calcul_plafond_mensualite_d832_10_3_140 = money_of_cents_string("139700") + elif match_arg_326.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_326.value + temp_calcul_plafond_mensualite_d832_10_3_140 = money_of_cents_string("167600") + else: + temp_calcul_plafond_mensualite_d832_10_3_140 = (money_of_cents_string("195500") + + (money_of_cents_string("27900") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + return (temp_calcul_plafond_mensualite_d832_10_3_140 * + taux_francs_vers_euros) + else: + raise EmptyError + def temp_calcul_plafond_mensualite_d832_10_3_141(_:Any): + match_arg_327 = type_pret + if match_arg_327.code == TypePret_Code.D331_32: + _ = match_arg_327.value + temp_calcul_plafond_mensualite_d832_10_3_142 = True + elif match_arg_327.code == TypePret_Code.D331_63_64: + _ = match_arg_327.value + temp_calcul_plafond_mensualite_d832_10_3_142 = False + elif match_arg_327.code == TypePret_Code.D331_59_8: + _ = match_arg_327.value + temp_calcul_plafond_mensualite_d832_10_3_142 = False + elif match_arg_327.code == TypePret_Code.D331_76_1: + _ = match_arg_327.value + temp_calcul_plafond_mensualite_d832_10_3_142 = False + elif match_arg_327.code == TypePret_Code.Autre: + _ = match_arg_327.value + temp_calcul_plafond_mensualite_d832_10_3_142 = False + match_arg_328 = anciennete_logement + if match_arg_328.code == NeufOuAncien_Code.Neuf: + _ = match_arg_328.value + temp_calcul_plafond_mensualite_d832_10_3_143 = True + elif match_arg_328.code == NeufOuAncien_Code.Ancien: + _ = match_arg_328.value + temp_calcul_plafond_mensualite_d832_10_3_143 = False + if ((param_13 >= date_of_numbers(1992,6,30)) and + ((param_13 < date_of_numbers(1994,11,27)) and + (temp_calcul_plafond_mensualite_d832_10_3_143 and + temp_calcul_plafond_mensualite_d832_10_3_142))): + match_arg_329 = zone_2 + if match_arg_329.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_329.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_330 = situation_familiale_calcul_apl_4 + if match_arg_330.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_330.value + temp_calcul_plafond_mensualite_d832_10_3_144 = money_of_cents_string("208500") + elif match_arg_330.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_330.value + temp_calcul_plafond_mensualite_d832_10_3_144 = money_of_cents_string("251500") + else: + temp_calcul_plafond_mensualite_d832_10_3_144 = (money_of_cents_string("294500") + + (money_of_cents_string("43000") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_329.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_329.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_331 = situation_familiale_calcul_apl_4 + if match_arg_331.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_331.value + temp_calcul_plafond_mensualite_d832_10_3_144 = money_of_cents_string("186000") + elif match_arg_331.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_331.value + temp_calcul_plafond_mensualite_d832_10_3_144 = money_of_cents_string("223900") + else: + temp_calcul_plafond_mensualite_d832_10_3_144 = (money_of_cents_string("261800") + + (money_of_cents_string("37900") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + elif match_arg_329.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_329.value + if (nombre_personnes_a_charge_4 == + integer_of_string("0")): + match_arg_332 = situation_familiale_calcul_apl_4 + if match_arg_332.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_332.value + temp_calcul_plafond_mensualite_d832_10_3_144 = money_of_cents_string("173600") + elif match_arg_332.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_332.value + temp_calcul_plafond_mensualite_d832_10_3_144 = money_of_cents_string("208200") + else: + temp_calcul_plafond_mensualite_d832_10_3_144 = (money_of_cents_string("242800") + + (money_of_cents_string("35600") * + decimal_of_integer((nombre_personnes_a_charge_4 - + integer_of_string("1"))))) + return (temp_calcul_plafond_mensualite_d832_10_3_144 * + taux_francs_vers_euros) + else: + raise EmptyError + return handle_default(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=709, start_column=11, + end_line=709, end_column=46, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"]), [temp_calcul_plafond_mensualite_d832_10_3_141, + temp_calcul_plafond_mensualite_d832_10_3_137, + temp_calcul_plafond_mensualite_d832_10_3_133, + temp_calcul_plafond_mensualite_d832_10_3_129, + temp_calcul_plafond_mensualite_d832_10_3_125, + temp_calcul_plafond_mensualite_d832_10_3_121, + temp_calcul_plafond_mensualite_d832_10_3_117, + temp_calcul_plafond_mensualite_d832_10_3_113, + temp_calcul_plafond_mensualite_d832_10_3_109, + temp_calcul_plafond_mensualite_d832_10_3_105, + temp_calcul_plafond_mensualite_d832_10_3_101, + temp_calcul_plafond_mensualite_d832_10_3_97, + temp_calcul_plafond_mensualite_d832_10_3_94, + temp_calcul_plafond_mensualite_d832_10_3_90, + temp_calcul_plafond_mensualite_d832_10_3_87, + temp_calcul_plafond_mensualite_d832_10_3_84, + temp_calcul_plafond_mensualite_d832_10_3_81, + temp_calcul_plafond_mensualite_d832_10_3_78, + temp_calcul_plafond_mensualite_d832_10_3_75, + temp_calcul_plafond_mensualite_d832_10_3_72, + temp_calcul_plafond_mensualite_d832_10_3_69, + temp_calcul_plafond_mensualite_d832_10_3_66, + temp_calcul_plafond_mensualite_d832_10_3_63, + temp_calcul_plafond_mensualite_d832_10_3_60, + temp_calcul_plafond_mensualite_d832_10_3_57, + temp_calcul_plafond_mensualite_d832_10_3_54, + temp_calcul_plafond_mensualite_d832_10_3_51, + temp_calcul_plafond_mensualite_d832_10_3_48, + temp_calcul_plafond_mensualite_d832_10_3_45, + temp_calcul_plafond_mensualite_d832_10_3_42, + temp_calcul_plafond_mensualite_d832_10_3_39, + temp_calcul_plafond_mensualite_d832_10_3_36, + temp_calcul_plafond_mensualite_d832_10_3_33, + temp_calcul_plafond_mensualite_d832_10_3_30, + temp_calcul_plafond_mensualite_d832_10_3_27, + temp_calcul_plafond_mensualite_d832_10_3_24, + temp_calcul_plafond_mensualite_d832_10_3_21, + temp_calcul_plafond_mensualite_d832_10_3_18, + temp_calcul_plafond_mensualite_d832_10_3_15, + temp_calcul_plafond_mensualite_d832_10_3_12, + temp_calcul_plafond_mensualite_d832_10_3_9, + temp_calcul_plafond_mensualite_d832_10_3_6, + temp_calcul_plafond_mensualite_d832_10_3_3], + temp_calcul_plafond_mensualite_d832_10_3_2, + temp_calcul_plafond_mensualite_d832_10_3_1) + except EmptyError: + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=709, + start_column=11, + end_line=709, + end_column=46, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + except EmptyError: + temp_calcul_plafond_mensualite_d832_10_3 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=709, start_column=11, + end_line=709, end_column=46, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + calcul_plafond_mensualite_d832_10_3 = temp_calcul_plafond_mensualite_d832_10_3 + try: + temp_n_nombre_parts_d832_11_1 = calcul_nombre_parts_dot_n_nombre_parts_d832_11 + except EmptyError: + temp_n_nombre_parts_d832_11_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=710, start_column=11, + end_line=710, end_column=33, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + n_nombre_parts_d832_11_1 = temp_n_nombre_parts_d832_11_1 + try: + def temp_depense_nette_minimale_d832_10(param_14:Money): + try: + try: + if (date_signature_pret >= + date_of_numbers(1999,6,30)): + return ((mensualite_principale + + montant_forfaitaire_charges_d832_10) - param_14) + else: + raise EmptyError + except EmptyError: + return (mensualite_principale - param_14) + except EmptyError: + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=715, + start_column=11, + end_line=715, + end_column=41, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + except EmptyError: + temp_depense_nette_minimale_d832_10 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=715, start_column=11, + end_line=715, end_column=41, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + depense_nette_minimale_d832_10 = temp_depense_nette_minimale_d832_10 + try: + try: + if local_habite_premiere_fois_beneficiaire: + if (calcul_plafond_mensualite_d832_10_3(date_signature_pret) < + calcul_plafond_mensualite_d832_10_3(date_entree_logement)): + temp_plafond_mensualite_d832_10_3_base = calcul_plafond_mensualite_d832_10_3( + date_entree_logement) + else: + temp_plafond_mensualite_d832_10_3_base = calcul_plafond_mensualite_d832_10_3( + date_signature_pret) + else: + temp_plafond_mensualite_d832_10_3_base = dead_value + raise EmptyError + except EmptyError: + temp_plafond_mensualite_d832_10_3_base = calcul_plafond_mensualite_d832_10_3( + date_signature_pret) + except EmptyError: + temp_plafond_mensualite_d832_10_3_base = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=707, start_column=10, + end_line=707, end_column=14, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + plafond_mensualite_d832_10_3_base = temp_plafond_mensualite_d832_10_3_base + try: + temp_calcul_equivalence_loyer_minimale_dot_ressources_menage_arrondies_1 = ressources_menage_arrondies_3 + except EmptyError: + temp_calcul_equivalence_loyer_minimale_dot_ressources_menage_arrondies_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=613, start_column=10, + end_line=613, end_column=37, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + calcul_equivalence_loyer_minimale_dot_ressources_menage_arrondies_1 = temp_calcul_equivalence_loyer_minimale_dot_ressources_menage_arrondies_1 + try: + temp_calcul_equivalence_loyer_minimale_dot_condition_2_du_832_25_1 = False + except EmptyError: + temp_calcul_equivalence_loyer_minimale_dot_condition_2_du_832_25_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=614, start_column=10, + end_line=614, end_column=31, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + calcul_equivalence_loyer_minimale_dot_condition_2_du_832_25_1 = temp_calcul_equivalence_loyer_minimale_dot_condition_2_du_832_25_1 + try: + temp_calcul_equivalence_loyer_minimale_dot_n_nombre_parts_d832_25_1 = n_nombre_parts_d832_11_1 + except EmptyError: + temp_calcul_equivalence_loyer_minimale_dot_n_nombre_parts_d832_25_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=615, start_column=10, + end_line=615, end_column=32, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + calcul_equivalence_loyer_minimale_dot_n_nombre_parts_d832_25_1 = temp_calcul_equivalence_loyer_minimale_dot_n_nombre_parts_d832_25_1 + result_6 = calcul_equivalence_loyer_minimale(CalculEquivalenceLoyerMinimaleIn(ressources_menage_arrondies_in = calcul_equivalence_loyer_minimale_dot_ressources_menage_arrondies_1, + condition_2_du_832_25_in = calcul_equivalence_loyer_minimale_dot_condition_2_du_832_25_1, + n_nombre_parts_d832_25_in = calcul_equivalence_loyer_minimale_dot_n_nombre_parts_d832_25_1)) + calcul_equivalence_loyer_minimale_dot_montant_1 = result_6.montant_out + try: + temp_coefficient_prise_en_charge_d832_10_formule = (decimal_of_string("0.95") - + (ressources_menage_arrondies_3 / + (coefficient_multiplicateur_d832_11 * n_nombre_parts_d832_11_1))) + except EmptyError: + temp_coefficient_prise_en_charge_d832_10_formule = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=712, start_column=10, + end_line=712, end_column=17, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + coefficient_prise_en_charge_d832_10_formule = temp_coefficient_prise_en_charge_d832_10_formule + try: + def temp_abattement_depense_nette_minimale_d832_10(param_15:Money): + try: + if (depense_nette_minimale_d832_10(param_15) <= + (ressources_menage_avec_d832_18 * + coefficient_multiplicateur_d832_17_3)): + return ((ressources_menage_avec_d832_18 * + coefficient_multiplicateur_d832_17_3) - + depense_nette_minimale_d832_10(param_15)) + else: + return money_of_cents_string("0") + except EmptyError: + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=716, + start_column=11, + end_line=716, + end_column=52, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + except EmptyError: + temp_abattement_depense_nette_minimale_d832_10 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=716, start_column=11, + end_line=716, end_column=52, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + abattement_depense_nette_minimale_d832_10 = temp_abattement_depense_nette_minimale_d832_10 + try: + try: + if ((date_courante_5 < date_of_numbers(2021,10,1)) and + (date_courante_5 >= + date_of_numbers(2020,10,1))): + if copropriete: + temp_plafond_mensualite_d832_10_3_coproprietaires = (plafond_mensualite_d832_10_3_base * + decimal_of_string("0.75")) + else: + temp_plafond_mensualite_d832_10_3_coproprietaires = plafond_mensualite_d832_10_3_base + else: + temp_plafond_mensualite_d832_10_3_coproprietaires = dead_value + raise EmptyError + except EmptyError: + if (date_courante_5 >= + date_of_numbers(2021,10,1)): + if copropriete: + temp_plafond_mensualite_d832_10_3_coproprietaires = (plafond_mensualite_d832_10_3_base * + decimal_of_string("0.75")) + else: + temp_plafond_mensualite_d832_10_3_coproprietaires = plafond_mensualite_d832_10_3_base + else: + temp_plafond_mensualite_d832_10_3_coproprietaires = dead_value + raise EmptyError + except EmptyError: + temp_plafond_mensualite_d832_10_3_coproprietaires = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=708, start_column=10, + end_line=708, end_column=25, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + plafond_mensualite_d832_10_3_coproprietaires = temp_plafond_mensualite_d832_10_3_coproprietaires + try: + def temp_mensualite_minimale(_:Any): + raise EmptyError + def temp_mensualite_minimale_1(_:Any): + return False + def temp_mensualite_minimale_2(_:Any): + match_arg_333 = type_travaux_logement + if match_arg_333.code == TypeTravauxLogementD83215_Code.TravauxPourAcquisitionD832_15_1: + _ = match_arg_333.value + temp_mensualite_minimale_3 = False + elif match_arg_333.code == TypeTravauxLogementD83215_Code.TravauxSurLogementDejaAcquisD832_15_2: + _ = match_arg_333.value + temp_mensualite_minimale_3 = True + elif match_arg_333.code == TypeTravauxLogementD83215_Code.PasDeTravaux: + _ = match_arg_333.value + temp_mensualite_minimale_3 = False + if temp_mensualite_minimale_3: + return calcul_equivalence_loyer_minimale_dot_montant_1 + else: + raise EmptyError + def temp_mensualite_minimale_4(_:Any): + match_arg_334 = type_travaux_logement + if match_arg_334.code == TypeTravauxLogementD83215_Code.TravauxPourAcquisitionD832_15_1: + _ = match_arg_334.value + temp_mensualite_minimale_5 = False + elif match_arg_334.code == TypeTravauxLogementD83215_Code.TravauxSurLogementDejaAcquisD832_15_2: + _ = match_arg_334.value + temp_mensualite_minimale_5 = False + elif match_arg_334.code == TypeTravauxLogementD83215_Code.PasDeTravaux: + _ = match_arg_334.value + temp_mensualite_minimale_5 = True + match_arg_335 = type_travaux_logement + if match_arg_335.code == TypeTravauxLogementD83215_Code.TravauxPourAcquisitionD832_15_1: + _ = match_arg_335.value + temp_mensualite_minimale_6 = True + elif match_arg_335.code == TypeTravauxLogementD83215_Code.TravauxSurLogementDejaAcquisD832_15_2: + _ = match_arg_335.value + temp_mensualite_minimale_6 = False + elif match_arg_335.code == TypeTravauxLogementD83215_Code.PasDeTravaux: + _ = match_arg_335.value + temp_mensualite_minimale_6 = False + if (temp_mensualite_minimale_6 or + temp_mensualite_minimale_5): + if (decimal_of_money(ressources_menage_arrondies_3) <= + (decimal_of_money(montant_limite_tranches_d832_15_1) * + n_nombre_parts_d832_11_1)): + temp_mensualite_minimale_7 = (decimal_of_money(ressources_menage_arrondies_3) * + taux_tranche_inferieure_d832_15_1) + else: + temp_mensualite_minimale_7 = ((decimal_of_money(montant_limite_tranches_d832_15_1) * + n_nombre_parts_d832_11_1) * + taux_tranche_inferieure_d832_15_1) + if (decimal_of_money(ressources_menage_arrondies_3) >= + (decimal_of_money(montant_limite_tranches_d832_15_1) * + n_nombre_parts_d832_11_1)): + temp_mensualite_minimale_8 = ((decimal_of_money(ressources_menage_arrondies_3) - + (decimal_of_money(montant_limite_tranches_d832_15_1) * + n_nombre_parts_d832_11_1)) * + taux_tranche_superieure_d832_15_1) + else: + temp_mensualite_minimale_8 = decimal_of_string("0.") + return money_of_decimal(((temp_mensualite_minimale_8 + + temp_mensualite_minimale_7) / decimal_of_string("12."))) + else: + raise EmptyError + temp_mensualite_minimale_9 = handle_default(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=705, + start_column=10, + end_line=705, end_column=29, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"]), [temp_mensualite_minimale_4, + temp_mensualite_minimale_2], + temp_mensualite_minimale_1, + temp_mensualite_minimale) + except EmptyError: + temp_mensualite_minimale_9 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=705, start_column=10, + end_line=705, end_column=29, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + mensualite_minimale = temp_mensualite_minimale_9 + try: + temp_coefficient_prise_en_charge_d832_10_arrondi = (decimal_round(((coefficient_prise_en_charge_d832_10_formule - + decimal_of_string("0.005")) * decimal_of_string("100."))) / + decimal_of_string("100.")) + except EmptyError: + temp_coefficient_prise_en_charge_d832_10_arrondi = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=713, start_column=10, + end_line=713, end_column=17, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + coefficient_prise_en_charge_d832_10_arrondi = temp_coefficient_prise_en_charge_d832_10_arrondi + try: + def temp_traitement_aide_finale_abattement_1(param_16:Money): + try: + if ((traitement_aide_finale_minoration_forfaitaire_2( + param_16) - + abattement_depense_nette_minimale_d832_10(traitement_aide_finale_minoration_forfaitaire_2( + param_16))) >= + money_of_cents_string("0")): + return (traitement_aide_finale_minoration_forfaitaire_2( + param_16) - + abattement_depense_nette_minimale_d832_10(traitement_aide_finale_minoration_forfaitaire_2( + param_16))) + else: + return money_of_cents_string("0") + except EmptyError: + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=739, + start_column=10, + end_line=739, + end_column=20, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + except EmptyError: + temp_traitement_aide_finale_abattement_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=739, start_column=10, + end_line=739, end_column=20, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + traitement_aide_finale_abattement_1 = temp_traitement_aide_finale_abattement_1 + try: + if (mensualite_principale > + plafond_mensualite_d832_10_3_coproprietaires): + temp_mensualite_eligible = plafond_mensualite_d832_10_3_coproprietaires + else: + temp_mensualite_eligible = mensualite_principale + except EmptyError: + temp_mensualite_eligible = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=704, start_column=10, + end_line=704, end_column=29, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + mensualite_eligible = temp_mensualite_eligible + try: + if (coefficient_prise_en_charge_d832_10_arrondi >= + decimal_of_string("0.95")): + temp_coefficient_prise_en_charge_d832_10_seuil = decimal_of_string("0.95") + else: + temp_coefficient_prise_en_charge_d832_10_seuil = coefficient_prise_en_charge_d832_10_arrondi + except EmptyError: + temp_coefficient_prise_en_charge_d832_10_seuil = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=714, start_column=10, + end_line=714, end_column=15, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + coefficient_prise_en_charge_d832_10_seuil = temp_coefficient_prise_en_charge_d832_10_seuil + try: + def temp_traitement_aide_finale_contributions_sociales_arrondi_2(param_17:Money): + try: + if ((money_round(((traitement_aide_finale_abattement_1( + param_17) - + contributions_sociales_dot_montant_2(traitement_aide_finale_abattement_1( + param_17))) - + money_of_cents_string("50"))) + + contributions_sociales_dot_montant_2(traitement_aide_finale_abattement_1( + param_17))) >= + money_of_cents_string("0")): + return (money_round(((traitement_aide_finale_abattement_1( + param_17) - + contributions_sociales_dot_montant_2(traitement_aide_finale_abattement_1( + param_17))) - + money_of_cents_string("50"))) + + contributions_sociales_dot_montant_2(traitement_aide_finale_abattement_1( + param_17))) + else: + return money_of_cents_string("0") + except EmptyError: + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=740, + start_column=10, + end_line=740, + end_column=40, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + except EmptyError: + temp_traitement_aide_finale_contributions_sociales_arrondi_2 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=740, start_column=10, + end_line=740, end_column=40, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + traitement_aide_finale_contributions_sociales_arrondi_2 = temp_traitement_aide_finale_contributions_sociales_arrondi_2 + try: + if ((((mensualite_eligible + montant_forfaitaire_charges_d832_10) - + mensualite_minimale) * + coefficient_prise_en_charge_d832_10_seuil) < + money_of_cents_string("0")): + temp_aide_finale_formule_2 = money_of_cents_string("0") + else: + temp_aide_finale_formule_2 = (((mensualite_eligible + + montant_forfaitaire_charges_d832_10) - mensualite_minimale) * + coefficient_prise_en_charge_d832_10_seuil) + except EmptyError: + temp_aide_finale_formule_2 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=736, start_column=10, + end_line=736, end_column=29, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + aide_finale_formule_2 = temp_aide_finale_formule_2 + try: + def temp_traitement_aide_finale_montant_minimal_2(param_18:Money): + try: + if (traitement_aide_finale_contributions_sociales_arrondi_2( + param_18) < + montant_minimal_aide_d832_10): + return money_of_cents_string("0") + else: + return traitement_aide_finale_contributions_sociales_arrondi_2( + param_18) + except EmptyError: + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=741, + start_column=10, + end_line=741, + end_column=25, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + except EmptyError: + temp_traitement_aide_finale_montant_minimal_2 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=741, start_column=10, + end_line=741, end_column=25, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + traitement_aide_finale_montant_minimal_2 = temp_traitement_aide_finale_montant_minimal_2 + return CalculAidePersonnaliseeLogementAccessionProprieteOut(mensualite_eligible_out = mensualite_eligible, + mensualite_minimale_out = mensualite_minimale, + coefficient_prise_en_charge_d832_10_seuil_out = coefficient_prise_en_charge_d832_10_seuil, + aide_finale_formule_out = aide_finale_formule_2, + traitement_aide_finale_montant_minimal_out = traitement_aide_finale_montant_minimal_2) + +def eligibilite_aides_personnelle_logement(eligibilite_aides_personnelle_logement_in:EligibiliteAidesPersonnelleLogementIn): + menage = eligibilite_aides_personnelle_logement_in.menage_in + demandeur = eligibilite_aides_personnelle_logement_in.demandeur_in + date_courante_6 = eligibilite_aides_personnelle_logement_in.date_courante_in + condition_logement_residence_principale = eligibilite_aides_personnelle_logement_in.condition_logement_residence_principale_in + condition_logement_surface = eligibilite_aides_personnelle_logement_in.condition_logement_surface_in + try: + def temp_condition_pret(param_19:Pret): + try: + return False + except EmptyError: + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=316, + start_column=11, + end_line=316, + end_column=25, + law_headings=["Éligibilité aux aides personnelles au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + except EmptyError: + temp_condition_pret = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=316, start_column=11, + end_line=316, end_column=25, + law_headings=["Éligibilité aux aides personnelles au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + condition_pret = temp_condition_pret + try: + temp_condition_peuplement_logement_l822_10 = False + except EmptyError: + temp_condition_peuplement_logement_l822_10 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=327, start_column=11, + end_line=327, end_column=48, + law_headings=["Éligibilité aux aides personnelles au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + condition_peuplement_logement_l822_10 = temp_condition_peuplement_logement_l822_10 + try: + temp_seuil_l822_3_parts_propriete = decimal_of_string("0.1") + except EmptyError: + temp_seuil_l822_3_parts_propriete = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=338, start_column=11, + end_line=338, end_column=39, + law_headings=["Éligibilité aux aides personnelles au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + seuil_l822_3_parts_propriete = temp_seuil_l822_3_parts_propriete + try: + temp_seuil_l822_3_parts_usufruit = decimal_of_string("0.1") + except EmptyError: + temp_seuil_l822_3_parts_usufruit = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=339, start_column=11, + end_line=339, end_column=38, + law_headings=["Éligibilité aux aides personnelles au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + seuil_l822_3_parts_usufruit = temp_seuil_l822_3_parts_usufruit + try: + temp_seuil_l822_5_patrimoine = money_of_cents_string("3000000") + except EmptyError: + temp_seuil_l822_5_patrimoine = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=340, start_column=11, + end_line=340, end_column=34, + law_headings=["Éligibilité aux aides personnelles au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + seuil_l822_5_patrimoine = temp_seuil_l822_5_patrimoine + try: + match_arg_336 = menage.logement.usufruit + if match_arg_336.code == ParentOuAutre_Code.DemandeurOuConjointOuParentOuViaPartsSocietes: + parts = match_arg_336.value + temp_usufruit_ou_propriete_famille = True + elif match_arg_336.code == ParentOuAutre_Code.Autre: + _ = match_arg_336.value + temp_usufruit_ou_propriete_famille = False + match_arg_337 = menage.logement.proprietaire + if match_arg_337.code == ParentOuAutre_Code.DemandeurOuConjointOuParentOuViaPartsSocietes: + parts_1 = match_arg_337.value + temp_usufruit_ou_propriete_famille_1 = True + elif match_arg_337.code == ParentOuAutre_Code.Autre: + _ = match_arg_337.value + temp_usufruit_ou_propriete_famille_1 = False + temp_usufruit_ou_propriete_famille_2 = (temp_usufruit_ou_propriete_famille_1 or + temp_usufruit_ou_propriete_famille) + except EmptyError: + temp_usufruit_ou_propriete_famille_2 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=337, start_column=11, + end_line=337, end_column=40, + law_headings=["Éligibilité aux aides personnelles au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + usufruit_ou_propriete_famille = temp_usufruit_ou_propriete_famille_2 + try: + match_arg_338 = menage.situation_familiale + if match_arg_338.code == SituationFamiliale_Code.Celibataire: + _ = match_arg_338.value + temp_nombre_personnes_logement = integer_of_string("1") + elif match_arg_338.code == SituationFamiliale_Code.Maries: + _ = match_arg_338.value + temp_nombre_personnes_logement = integer_of_string("2") + elif match_arg_338.code == SituationFamiliale_Code.Pacses: + _ = match_arg_338.value + temp_nombre_personnes_logement = integer_of_string("2") + elif match_arg_338.code == SituationFamiliale_Code.Concubins: + _ = match_arg_338.value + temp_nombre_personnes_logement = integer_of_string("2") + elif match_arg_338.code == SituationFamiliale_Code.CelibataireSepareDeFait: + _ = match_arg_338.value + temp_nombre_personnes_logement = integer_of_string("1") + elif match_arg_338.code == SituationFamiliale_Code.ConcubinageDontSepareDeFait: + _ = match_arg_338.value + temp_nombre_personnes_logement = integer_of_string("2") + temp_nombre_personnes_logement_1 = ((temp_nombre_personnes_logement + + menage.nombre_autres_occupants_logement) + + list_length(menage.personnes_a_charge)) + except EmptyError: + temp_nombre_personnes_logement_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=336, start_column=11, + end_line=336, end_column=36, + law_headings=["Éligibilité aux aides personnelles au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + nombre_personnes_logement = temp_nombre_personnes_logement_1 + try: + try: + if not menage.logement.logement_decent_l89_462: + temp_condition_non_ouverture_l822_9_decence_logement = True + else: + temp_condition_non_ouverture_l822_9_decence_logement = dead_value + raise EmptyError + except EmptyError: + temp_condition_non_ouverture_l822_9_decence_logement = False + except EmptyError: + temp_condition_non_ouverture_l822_9_decence_logement = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=325, start_column=11, + end_line=325, end_column=58, + law_headings=["Éligibilité aux aides personnelles au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + condition_non_ouverture_l822_9_decence_logement = temp_condition_non_ouverture_l822_9_decence_logement + try: + try: + if menage.condition_rattache_foyer_fiscal_parent_ifi: + temp_condition_non_ouverture_l822_8 = True + else: + temp_condition_non_ouverture_l822_8 = dead_value + raise EmptyError + except EmptyError: + temp_condition_non_ouverture_l822_8 = False + except EmptyError: + temp_condition_non_ouverture_l822_8 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=324, start_column=11, + end_line=324, end_column=41, + law_headings=["Éligibilité aux aides personnelles au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + condition_non_ouverture_l822_8 = temp_condition_non_ouverture_l822_8 + try: + match_arg_339 = menage.situation_familiale + if match_arg_339.code == SituationFamiliale_Code.Celibataire: + _ = match_arg_339.value + temp_condition_logement_surface_minimale_sans_seuil_m_carres = integer_of_string("9") + elif match_arg_339.code == SituationFamiliale_Code.Maries: + _ = match_arg_339.value + temp_condition_logement_surface_minimale_sans_seuil_m_carres = integer_of_string("16") + elif match_arg_339.code == SituationFamiliale_Code.Pacses: + _ = match_arg_339.value + temp_condition_logement_surface_minimale_sans_seuil_m_carres = integer_of_string("16") + elif match_arg_339.code == SituationFamiliale_Code.Concubins: + _ = match_arg_339.value + temp_condition_logement_surface_minimale_sans_seuil_m_carres = integer_of_string("16") + elif match_arg_339.code == SituationFamiliale_Code.CelibataireSepareDeFait: + _ = match_arg_339.value + temp_condition_logement_surface_minimale_sans_seuil_m_carres = integer_of_string("9") + elif match_arg_339.code == SituationFamiliale_Code.ConcubinageDontSepareDeFait: + _ = match_arg_339.value + temp_condition_logement_surface_minimale_sans_seuil_m_carres = integer_of_string("16") + temp_condition_logement_surface_minimale_sans_seuil_m_carres_1 = (temp_condition_logement_surface_minimale_sans_seuil_m_carres + + ((menage.nombre_autres_occupants_logement + + list_length(menage.personnes_a_charge)) * + integer_of_string("9"))) + except EmptyError: + temp_condition_logement_surface_minimale_sans_seuil_m_carres_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=321, start_column=11, + end_line=321, end_column=66, + law_headings=["Éligibilité aux aides personnelles au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + condition_logement_surface_minimale_sans_seuil_m_carres = temp_condition_logement_surface_minimale_sans_seuil_m_carres_1 + try: + try: + try: + match_arg_340 = menage.logement.loue_ou_sous_loue_a_des_tiers + if match_arg_340.code == LoueOuSousLoueADesTiers_Code.Non: + _ = match_arg_340.value + temp_condition_logement_location_tiers = True + elif match_arg_340.code == LoueOuSousLoueADesTiers_Code.Oui: + personne = match_arg_340.value + temp_condition_logement_location_tiers = ((personne.age_personne_sous_location <= + integer_of_string("30")) or + personne.conforme_article_l442_1) + if temp_condition_logement_location_tiers: + temp_condition_logement_location_tiers_1 = True + else: + temp_condition_logement_location_tiers_1 = dead_value + raise EmptyError + except EmptyError: + match_arg_341 = menage.logement.loue_ou_sous_loue_a_des_tiers + if match_arg_341.code == LoueOuSousLoueADesTiers_Code.Non: + _ = match_arg_341.value + temp_condition_logement_location_tiers_2 = True + elif match_arg_341.code == LoueOuSousLoueADesTiers_Code.Oui: + _ = match_arg_341.value + temp_condition_logement_location_tiers_2 = False + if temp_condition_logement_location_tiers_2: + temp_condition_logement_location_tiers_1 = False + else: + temp_condition_logement_location_tiers_1 = dead_value + raise EmptyError + except EmptyError: + temp_condition_logement_location_tiers_1 = False + except EmptyError: + temp_condition_logement_location_tiers_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=320, start_column=11, + end_line=320, end_column=44, + law_headings=["Éligibilité aux aides personnelles au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + condition_logement_location_tiers = temp_condition_logement_location_tiers_1 + try: + try: + temp_condition_logement_residence_principale = condition_logement_residence_principale( + Unit()) + except EmptyError: + try: + if menage.logement.residence_principale: + temp_condition_logement_residence_principale = True + else: + temp_condition_logement_residence_principale = dead_value + raise EmptyError + except EmptyError: + temp_condition_logement_residence_principale = False + except EmptyError: + temp_condition_logement_residence_principale = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=318, start_column=12, + end_line=318, end_column=51, + law_headings=["Éligibilité aux aides personnelles au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + condition_logement_residence_principale_1 = temp_condition_logement_residence_principale + try: + temp_ouverture_droits_retraite_dot_date_naissance_assure = demandeur.date_naissance + except EmptyError: + temp_ouverture_droits_retraite_dot_date_naissance_assure = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=1034, + start_column=10, end_line=1034, + end_column=31, + law_headings=["Date d'ouverture des droits à la retraite", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + ouverture_droits_retraite_dot_date_naissance_assure = temp_ouverture_droits_retraite_dot_date_naissance_assure + result_7 = ouverture_droits_retraite(OuvertureDroitsRetraiteIn(date_naissance_assure_in = ouverture_droits_retraite_dot_date_naissance_assure)) + ouverture_droits_retraite_dot_age_ouverture_droit = result_7.age_ouverture_droit_out + try: + temp_patrimoine_total_demandeur = (demandeur.patrimoine.produisant_revenu_periode_r822_3_3_r822_4 + + demandeur.patrimoine.ne_produisant_pas_revenu_periode_r822_3_3_r822_4) + except EmptyError: + temp_patrimoine_total_demandeur = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=335, start_column=11, + end_line=335, end_column=37, + law_headings=["Éligibilité aux aides personnelles au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + patrimoine_total_demandeur = temp_patrimoine_total_demandeur + try: + try: + match_arg_342 = demandeur.nationalite + if match_arg_342.code == Nationalite_Code.Francaise: + _ = match_arg_342.value + temp_condition_nationalite = True + elif match_arg_342.code == Nationalite_Code.Etrangere: + _ = match_arg_342.value + temp_condition_nationalite = demandeur.satisfait_conditions_l512_2_code_securite_sociale + if temp_condition_nationalite: + temp_condition_nationalite_1 = True + else: + temp_condition_nationalite_1 = dead_value + raise EmptyError + except EmptyError: + temp_condition_nationalite_1 = False + except EmptyError: + temp_condition_nationalite_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=317, start_column=11, + end_line=317, end_column=32, + law_headings=["Éligibilité aux aides personnelles au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + condition_nationalite = temp_condition_nationalite_1 + try: + def temp_plafond_individuel_l815_9_secu(_:Any): + raise EmptyError + def temp_plafond_individuel_l815_9_secu_1(_:Any): + return False + def temp_plafond_individuel_l815_9_secu_2(_:Any): + if ((date_courante_6 >= date_of_numbers(2021,1,1)) and + (date_courante_6 < + date_of_numbers(2022,1,1))): + return money_of_cents_string("1088175") + else: + raise EmptyError + def temp_plafond_individuel_l815_9_secu_3(_:Any): + if ((date_courante_6 >= date_of_numbers(2022,1,1)) and + (date_courante_6 < + date_of_numbers(2023,1,1))): + return money_of_cents_string("1100144") + else: + raise EmptyError + def temp_plafond_individuel_l815_9_secu_4(_:Any): + if ((date_courante_6 >= date_of_numbers(2020,1,4)) and + (date_courante_6 < + date_of_numbers(2021,1,1))): + return money_of_cents_string("1083840") + else: + raise EmptyError + def temp_plafond_individuel_l815_9_secu_5(_:Any): + if ((date_courante_6 >= date_of_numbers(2019,1,1)) and + (date_courante_6 < + date_of_numbers(2020,1,1))): + return money_of_cents_string("1041840") + else: + raise EmptyError + def temp_plafond_individuel_l815_9_secu_6(_:Any): + if ((date_courante_6 >= date_of_numbers(2018,1,4)) and + (date_courante_6 < + date_of_numbers(2019,1,1))): + return money_of_cents_string("999840") + else: + raise EmptyError + temp_plafond_individuel_l815_9_secu_7 = handle_default(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=344, + start_column=11, + end_line=344, end_column=41, + law_headings=["Éligibilité aux aides personnelles au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"]), [temp_plafond_individuel_l815_9_secu_6, + temp_plafond_individuel_l815_9_secu_5, + temp_plafond_individuel_l815_9_secu_4, + temp_plafond_individuel_l815_9_secu_3, + temp_plafond_individuel_l815_9_secu_2], + temp_plafond_individuel_l815_9_secu_1, + temp_plafond_individuel_l815_9_secu) + except EmptyError: + temp_plafond_individuel_l815_9_secu_7 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=344, start_column=11, + end_line=344, end_column=41, + law_headings=["Éligibilité aux aides personnelles au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + plafond_individuel_l815_9_secu = temp_plafond_individuel_l815_9_secu_7 + try: + try: + if condition_peuplement_logement_l822_10: + temp_condition_non_ouverture_l822_10_peuplement_logement = True + else: + temp_condition_non_ouverture_l822_10_peuplement_logement = dead_value + raise EmptyError + except EmptyError: + temp_condition_non_ouverture_l822_10_peuplement_logement = False + except EmptyError: + temp_condition_non_ouverture_l822_10_peuplement_logement = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=326, start_column=11, + end_line=326, end_column=62, + law_headings=["Éligibilité aux aides personnelles au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + condition_non_ouverture_l822_10_peuplement_logement = temp_condition_non_ouverture_l822_10_peuplement_logement + try: + try: + try: + try: + match_arg_343 = menage.logement.usufruit + if match_arg_343.code == ParentOuAutre_Code.DemandeurOuConjointOuParentOuViaPartsSocietes: + parts_2 = match_arg_343.value + temp_condition_logement_mode_occupation = parts_2 + elif match_arg_343.code == ParentOuAutre_Code.Autre: + _ = match_arg_343.value + temp_condition_logement_mode_occupation = decimal_of_string("0.") + match_arg_344 = menage.logement.proprietaire + if match_arg_344.code == ParentOuAutre_Code.DemandeurOuConjointOuParentOuViaPartsSocietes: + parts_3 = match_arg_344.value + temp_condition_logement_mode_occupation_1 = parts_3 + elif match_arg_344.code == ParentOuAutre_Code.Autre: + _ = match_arg_344.value + temp_condition_logement_mode_occupation_1 = decimal_of_string("0.") + if (usufruit_ou_propriete_famille and + ((temp_condition_logement_mode_occupation_1 < + seuil_l822_3_parts_propriete) and + (temp_condition_logement_mode_occupation < + seuil_l822_3_parts_usufruit))): + temp_condition_logement_mode_occupation_2 = True + else: + temp_condition_logement_mode_occupation_2 = dead_value + raise EmptyError + except EmptyError: + match_arg_345 = menage.logement.mode_occupation + if match_arg_345.code == ModeOccupation_Code.Locataire: + _ = match_arg_345.value + temp_condition_logement_mode_occupation_3 = usufruit_ou_propriete_famille + elif match_arg_345.code == ModeOccupation_Code.ResidentLogementFoyer: + _ = match_arg_345.value + temp_condition_logement_mode_occupation_3 = False + elif match_arg_345.code == ModeOccupation_Code.AccessionProprieteLocalUsageExclusifHabitation: + _ = match_arg_345.value + temp_condition_logement_mode_occupation_3 = False + elif match_arg_345.code == ModeOccupation_Code.SousLocataire: + _ = match_arg_345.value + temp_condition_logement_mode_occupation_3 = False + elif match_arg_345.code == ModeOccupation_Code.LocationAccession: + _ = match_arg_345.value + temp_condition_logement_mode_occupation_3 = False + if temp_condition_logement_mode_occupation_3: + temp_condition_logement_mode_occupation_2 = False + else: + temp_condition_logement_mode_occupation_2 = dead_value + raise EmptyError + except EmptyError: + match_arg_346 = menage.logement.mode_occupation + if match_arg_346.code == ModeOccupation_Code.Locataire: + _ = match_arg_346.value + temp_condition_logement_mode_occupation_4 = True + elif match_arg_346.code == ModeOccupation_Code.ResidentLogementFoyer: + _ = match_arg_346.value + temp_condition_logement_mode_occupation_4 = True + elif match_arg_346.code == ModeOccupation_Code.AccessionProprieteLocalUsageExclusifHabitation: + _ = match_arg_346.value + temp_condition_logement_mode_occupation_4 = menage.logement.residence_principale + elif match_arg_346.code == ModeOccupation_Code.SousLocataire: + _ = match_arg_346.value + temp_condition_logement_mode_occupation_4 = True + elif match_arg_346.code == ModeOccupation_Code.LocationAccession: + _ = match_arg_346.value + temp_condition_logement_mode_occupation_4 = True + if temp_condition_logement_mode_occupation_4: + temp_condition_logement_mode_occupation_2 = True + else: + temp_condition_logement_mode_occupation_2 = dead_value + raise EmptyError + except EmptyError: + temp_condition_logement_mode_occupation_2 = False + except EmptyError: + temp_condition_logement_mode_occupation_2 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=319, start_column=11, + end_line=319, end_column=45, + law_headings=["Éligibilité aux aides personnelles au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + condition_logement_mode_occupation = temp_condition_logement_mode_occupation_2 + try: + try: + temp_condition_logement_surface = condition_logement_surface( + Unit()) + except EmptyError: + try: + if ((condition_logement_surface_minimale_sans_seuil_m_carres >= + integer_of_string("70")) and + (nombre_personnes_logement >= + integer_of_string("8"))): + temp_condition_logement_surface_1 = (menage.logement.surface_m_carres >= + integer_of_string("70")) + else: + temp_condition_logement_surface_1 = (menage.logement.surface_m_carres >= + condition_logement_surface_minimale_sans_seuil_m_carres) + if temp_condition_logement_surface_1: + temp_condition_logement_surface = True + else: + temp_condition_logement_surface = dead_value + raise EmptyError + except EmptyError: + temp_condition_logement_surface = False + except EmptyError: + temp_condition_logement_surface = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=323, start_column=12, + end_line=323, end_column=38, + law_headings=["Éligibilité aux aides personnelles au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + condition_logement_surface_1 = temp_condition_logement_surface + try: + temp_age_l161_17_2_secu = ouverture_droits_retraite_dot_age_ouverture_droit + except EmptyError: + temp_age_l161_17_2_secu = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=343, start_column=11, + end_line=343, end_column=29, + law_headings=["Éligibilité aux aides personnelles au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + age_l161_17_2_secu = temp_age_l161_17_2_secu + try: + try: + try: + try: + if menage.logement.est_ehpad_ou_maison_autonomie_l313_12_asf: + temp_patrimoine_pris_en_compte = money_of_cents_string("0") + else: + temp_patrimoine_pris_en_compte = dead_value + raise EmptyError + except EmptyError: + def temp_patrimoine_pris_en_compte_1(acc_2:bool, prestation:Any): + return (acc_2 or ((prestation == + PrestationRecue(PrestationRecue_Code.AllocationSoutienEnfantHandicape, + Unit())) or (prestation == + PrestationRecue(PrestationRecue_Code.AllocationAdulteHandicape, + Unit())))) + if list_fold_left(temp_patrimoine_pris_en_compte_1, + False, menage.prestations_recues): + temp_patrimoine_pris_en_compte = money_of_cents_string("0") + else: + temp_patrimoine_pris_en_compte = dead_value + raise EmptyError + except EmptyError: + if (patrimoine_total_demandeur >= + seuil_l822_5_patrimoine): + temp_patrimoine_pris_en_compte = demandeur.patrimoine.ne_produisant_pas_revenu_periode_r822_3_3_r822_4 + else: + temp_patrimoine_pris_en_compte = dead_value + raise EmptyError + except EmptyError: + if (patrimoine_total_demandeur > + seuil_l822_5_patrimoine): + temp_patrimoine_pris_en_compte = patrimoine_total_demandeur + else: + temp_patrimoine_pris_en_compte = money_of_cents_string("0") + except EmptyError: + temp_patrimoine_pris_en_compte = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=341, start_column=11, + end_line=341, end_column=36, + law_headings=["Éligibilité aux aides personnelles au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + patrimoine_pris_en_compte = temp_patrimoine_pris_en_compte + try: + try: + try: + if (condition_non_ouverture_l822_8 or + (condition_non_ouverture_l822_9_decence_logement or + condition_non_ouverture_l822_10_peuplement_logement)): + temp_eligibilite_logement = False + else: + temp_eligibilite_logement = dead_value + raise EmptyError + except EmptyError: + if (condition_logement_residence_principale_1 and + (condition_logement_mode_occupation and + (condition_logement_location_tiers and + condition_logement_surface_1))): + temp_eligibilite_logement = True + else: + temp_eligibilite_logement = dead_value + raise EmptyError + except EmptyError: + temp_eligibilite_logement = False + except EmptyError: + temp_eligibilite_logement = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=328, start_column=11, + end_line=328, end_column=31, + law_headings=["Éligibilité aux aides personnelles au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + eligibilite_logement = temp_eligibilite_logement + try: + temp_age_l351_8_1_secu = (age_l161_17_2_secu + + duration_of_numbers(5,0,0)) + except EmptyError: + temp_age_l351_8_1_secu = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=342, start_column=11, + end_line=342, end_column=28, + law_headings=["Éligibilité aux aides personnelles au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + age_l351_8_1_secu = temp_age_l351_8_1_secu + try: + try: + if (condition_nationalite and + (condition_logement_mode_occupation and + eligibilite_logement)): + temp_eligibilite = True + else: + temp_eligibilite = dead_value + raise EmptyError + except EmptyError: + temp_eligibilite = False + except EmptyError: + temp_eligibilite = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=347, start_column=10, + end_line=347, end_column=21, + law_headings=["Éligibilité aux aides personnelles au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + eligibilite = temp_eligibilite + try: + def temp_condition_2_r823_4(param_20:PersonneACharge): + try: + try: + match_arg_347 = param_20 + if match_arg_347.code == PersonneACharge_Code.EnfantACharge: + enfant = match_arg_347.value + temp_condition_2_r823_4_1 = False + elif match_arg_347.code == PersonneACharge_Code.AutrePersonneACharge: + parent = match_arg_347.value + temp_condition_2_r823_4_1 = ((parent.parente == + Parente(Parente_Code.Ascendant, Unit())) and + ((parent.ressources <= + (plafond_individuel_l815_9_secu * + decimal_of_string("1.25"))) and + ((((parent.date_naissance + age_l351_8_1_secu) <= + date_courante_6) or + (parent.titulaire_allocation_personne_agee and + ((parent.date_naissance + + duration_of_numbers(65,0,0)) <= + date_courante_6))) or (((parent.date_naissance + + age_l161_17_2_secu) <= date_courante_6) and + parent.beneficiaire_l161_19_l351_8_l643_3_secu)))) + if temp_condition_2_r823_4_1: + return True + else: + raise EmptyError + except EmptyError: + return False + except EmptyError: + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=351, + start_column=10, + end_line=351, + end_column=28, + law_headings=["Éligibilité aux aides personnelles au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + except EmptyError: + temp_condition_2_r823_4 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=351, start_column=10, + end_line=351, end_column=28, + law_headings=["Éligibilité aux aides personnelles au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + condition_2_r823_4 = temp_condition_2_r823_4 + try: + def temp_prise_en_compte_personne_a_charge(param_21:PersonneACharge): + try: + def temp_prise_en_compte_personne_a_charge_1(_:Any): + return False + def temp_prise_en_compte_personne_a_charge_2(_:Any): + return True + def temp_prise_en_compte_personne_a_charge_3(_:Any): + match_arg_348 = param_21 + if match_arg_348.code == PersonneACharge_Code.EnfantACharge: + enfant_1 = match_arg_348.value + temp_prise_en_compte_personne_a_charge_4 = (enfant_1.age <= + integer_of_string("21")) + elif match_arg_348.code == PersonneACharge_Code.AutrePersonneACharge: + parent_1 = match_arg_348.value + temp_prise_en_compte_personne_a_charge_4 = False + if temp_prise_en_compte_personne_a_charge_4: + return True + else: + raise EmptyError + def temp_prise_en_compte_personne_a_charge_5(_:Any): + try: + match_arg_349 = param_21 + if match_arg_349.code == PersonneACharge_Code.EnfantACharge: + enfant_2 = match_arg_349.value + temp_prise_en_compte_personne_a_charge_6 = False + elif match_arg_349.code == PersonneACharge_Code.AutrePersonneACharge: + parent_2 = match_arg_349.value + temp_prise_en_compte_personne_a_charge_6 = (parent_2.incapacite_80_pourcent_ou_restriction_emploi and + (parent_2.ressources <= + (plafond_individuel_l815_9_secu * + decimal_of_string("1.25")))) + if temp_prise_en_compte_personne_a_charge_6: + return True + else: + raise EmptyError + except EmptyError: + if condition_2_r823_4(param_21): + return True + else: + raise EmptyError + return handle_default(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=329, start_column=11, + end_line=329, end_column=44, + law_headings=["Éligibilité aux aides personnelles au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"]), [temp_prise_en_compte_personne_a_charge_5, + temp_prise_en_compte_personne_a_charge_3], + temp_prise_en_compte_personne_a_charge_2, + temp_prise_en_compte_personne_a_charge_1) + except EmptyError: + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=329, + start_column=11, + end_line=329, + end_column=44, + law_headings=["Éligibilité aux aides personnelles au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + except EmptyError: + temp_prise_en_compte_personne_a_charge = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=329, start_column=11, + end_line=329, end_column=44, + law_headings=["Éligibilité aux aides personnelles au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + prise_en_compte_personne_a_charge = temp_prise_en_compte_personne_a_charge + try: + def temp_personnes_a_charge_prises_en_compte(personne_a_charge:Any): + return prise_en_compte_personne_a_charge(personne_a_charge) + temp_personnes_a_charge_prises_en_compte_1 = list_filter(temp_personnes_a_charge_prises_en_compte, + menage.personnes_a_charge) + except EmptyError: + temp_personnes_a_charge_prises_en_compte_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=331, start_column=11, + end_line=331, end_column=46, + law_headings=["Éligibilité aux aides personnelles au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + personnes_a_charge_prises_en_compte = temp_personnes_a_charge_prises_en_compte_1 + try: + def temp_coefficents_enfants_garde_alternee_pris_en_compte(personne_a_charge_1:Any): + match_arg_350 = personne_a_charge_1 + if match_arg_350.code == PersonneACharge_Code.EnfantACharge: + enfant_3 = match_arg_350.value + match_arg_351 = enfant_3.situation_garde_alternee + if match_arg_351.code == SituationGardeAlternee_Code.PasDeGardeAlternee: + _ = match_arg_351.value + return False + elif match_arg_351.code == SituationGardeAlternee_Code.GardeAlterneeCoefficientPriseEnCharge: + _ = match_arg_351.value + return True + elif match_arg_350.code == PersonneACharge_Code.AutrePersonneACharge: + _ = match_arg_350.value + return False + def temp_coefficents_enfants_garde_alternee_pris_en_compte_1(personne_a_charge_2:Any): + match_arg_352 = personne_a_charge_2 + if match_arg_352.code == PersonneACharge_Code.EnfantACharge: + enfant_4 = match_arg_352.value + match_arg_353 = enfant_4.situation_garde_alternee + if match_arg_353.code == SituationGardeAlternee_Code.PasDeGardeAlternee: + _ = match_arg_353.value + return decimal_of_string("0.") + elif match_arg_353.code == SituationGardeAlternee_Code.GardeAlterneeCoefficientPriseEnCharge: + coeff = match_arg_353.value + return coeff + elif match_arg_352.code == PersonneACharge_Code.AutrePersonneACharge: + _ = match_arg_352.value + return decimal_of_string("0.") + temp_coefficents_enfants_garde_alternee_pris_en_compte_2 = list_map(temp_coefficents_enfants_garde_alternee_pris_en_compte_1, + list_filter(temp_coefficents_enfants_garde_alternee_pris_en_compte, + personnes_a_charge_prises_en_compte)) + except EmptyError: + temp_coefficents_enfants_garde_alternee_pris_en_compte_2 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=349, start_column=10, + end_line=349, end_column=59, + law_headings=["Éligibilité aux aides personnelles au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + coefficents_enfants_garde_alternee_pris_en_compte = temp_coefficents_enfants_garde_alternee_pris_en_compte_2 + try: + temp_nombre_personnes_a_charge_prises_en_compte = list_length(personnes_a_charge_prises_en_compte) + except EmptyError: + temp_nombre_personnes_a_charge_prises_en_compte = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=348, start_column=10, + end_line=348, end_column=52, + law_headings=["Éligibilité aux aides personnelles au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + nombre_personnes_a_charge_prises_en_compte = temp_nombre_personnes_a_charge_prises_en_compte + try: + temp___3 = (seuil_l822_3_parts_usufruit < decimal_of_string("0.2")) + except EmptyError: + temp___3 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_legislatif.catala_fr", + start_line=182, start_column=13, + end_line=182, end_column=48, + law_headings=["Article L822-3", + "Chapitre II : Conditions générales d'attribution", + "Titre II : Dispositions communes aux aides personnelles au logement", + "Livre VIII : Aides personnelles au logement", + "Partie législative", + "Code de la construction et de l'habitation"])) + if not (temp___3): + raise AssertionFailure(SourcePosition(filename="examples/aides_logement/code_construction_legislatif.catala_fr", + start_line=182, + start_column=13, end_line=182, + end_column=48, + law_headings=["Article L822-3", + "Chapitre II : Conditions générales d'attribution", + "Titre II : Dispositions communes aux aides personnelles au logement", + "Livre VIII : Aides personnelles au logement", + "Partie législative", + "Code de la construction et de l'habitation"])) + try: + temp___4 = (seuil_l822_3_parts_propriete < decimal_of_string("0.2")) + except EmptyError: + temp___4 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_legislatif.catala_fr", + start_line=181, start_column=13, + end_line=181, end_column=49, + law_headings=["Article L822-3", + "Chapitre II : Conditions générales d'attribution", + "Titre II : Dispositions communes aux aides personnelles au logement", + "Livre VIII : Aides personnelles au logement", + "Partie législative", + "Code de la construction et de l'habitation"])) + if not (temp___4): + raise AssertionFailure(SourcePosition(filename="examples/aides_logement/code_construction_legislatif.catala_fr", + start_line=181, + start_column=13, end_line=181, + end_column=49, + law_headings=["Article L822-3", + "Chapitre II : Conditions générales d'attribution", + "Titre II : Dispositions communes aux aides personnelles au logement", + "Livre VIII : Aides personnelles au logement", + "Partie législative", + "Code de la construction et de l'habitation"])) + return EligibiliteAidesPersonnelleLogementOut(date_courante_out = date_courante_6, + eligibilite_out = eligibilite, + nombre_personnes_a_charge_prises_en_compte_out = nombre_personnes_a_charge_prises_en_compte, + coefficents_enfants_garde_alternee_pris_en_compte_out = coefficents_enfants_garde_alternee_pris_en_compte, + condition_2_r823_4_out = condition_2_r823_4) + +def ressources_aides_personnelle_logement(ressources_aides_personnelle_logement_in:RessourcesAidesPersonnelleLogementIn): + ressources_demandeur = ressources_aides_personnelle_logement_in.ressources_demandeur_in + ressources_conjoint = ressources_aides_personnelle_logement_in.ressources_conjoint_in + personnes_vivant_habituellement_foyer = ressources_aides_personnelle_logement_in.personnes_vivant_habituellement_foyer_in + demandeur_exerce_activite_remuneree = ressources_aides_personnelle_logement_in.demandeur_exerce_activite_remuneree_in + conjoint_exerce_activite_remuneree = ressources_aides_personnelle_logement_in.conjoint_exerce_activite_remuneree_in + personnes_a_charge = ressources_aides_personnelle_logement_in.personnes_a_charge_in + situation_familiale = ressources_aides_personnelle_logement_in.situation_familiale_in + mode_occupation_2 = ressources_aides_personnelle_logement_in.mode_occupation_in + condition_age_bourse_enseignement_superieur = ressources_aides_personnelle_logement_in.condition_age_bourse_enseignement_superieur_in + demandeur_poursuit_des_etudes = ressources_aides_personnelle_logement_in.demandeur_poursuit_des_etudes_in + date_demande_ou_reexamen_droit = ressources_aides_personnelle_logement_in.date_demande_ou_reexamen_droit_in + paiement_logement_distinct_professionnel = ressources_aides_personnelle_logement_in.paiement_logement_distinct_professionnel_in + ressources_menage_arrondies_base = ressources_aides_personnelle_logement_in.ressources_menage_arrondies_base_in + temp_ressources_menage_arrondies_seuil = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=524, start_column=10, + end_line=524, end_column=15, + law_headings=["Prise en compte des ressources pour les aides personnelles au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + ressources_menage_arrondies_seuil = temp_ressources_menage_arrondies_seuil + try: + temp_montant_forfaitaire_r_822_8 = money_of_cents_string("258900") + except EmptyError: + temp_montant_forfaitaire_r_822_8 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=528, start_column=11, + end_line=528, end_column=38, + law_headings=["Prise en compte des ressources pour les aides personnelles au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + montant_forfaitaire_r_822_8 = temp_montant_forfaitaire_r_822_8 + try: + temp_montant_forfaitaire_r_822_7 = money_of_cents_string("9500") + except EmptyError: + temp_montant_forfaitaire_r_822_7 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=530, start_column=11, + end_line=530, end_column=38, + law_headings=["Prise en compte des ressources pour les aides personnelles au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + montant_forfaitaire_r_822_7 = temp_montant_forfaitaire_r_822_7 + temp_ressources_forfaitaires_r822_20 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=532, start_column=11, + end_line=532, end_column=42, + law_headings=["Prise en compte des ressources pour les aides personnelles au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + ressources_forfaitaires_r822_20 = temp_ressources_forfaitaires_r822_20 + try: + def temp_ressources_personnes_vivant_habituellement_foyer(acc_3:Money, personne_1:Any): + return (acc_3 + personne_1.ressources) + temp_ressources_personnes_vivant_habituellement_foyer_1 = list_fold_left( + temp_ressources_personnes_vivant_habituellement_foyer, + money_of_cents_string("0"), + personnes_vivant_habituellement_foyer) + except EmptyError: + temp_ressources_personnes_vivant_habituellement_foyer_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=526, start_column=11, + end_line=526, end_column=59, + law_headings=["Prise en compte des ressources pour les aides personnelles au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + ressources_personnes_vivant_habituellement_foyer = temp_ressources_personnes_vivant_habituellement_foyer_1 + try: + match_arg_354 = situation_familiale + if match_arg_354.code == SituationFamiliale_Code.Celibataire: + _ = match_arg_354.value + if (list_length(personnes_a_charge) == + integer_of_string("0")): + temp_abattement_r_822_10 = money_of_cents_string("0") + else: + if (list_length(personnes_a_charge) <= + integer_of_string("2")): + temp_abattement_r_822_10 = money_of_cents_string("90100") + else: + temp_abattement_r_822_10 = money_of_cents_string("135000") + elif match_arg_354.code == SituationFamiliale_Code.Maries: + _ = match_arg_354.value + temp_abattement_r_822_10 = money_of_cents_string("0") + elif match_arg_354.code == SituationFamiliale_Code.Pacses: + _ = match_arg_354.value + temp_abattement_r_822_10 = money_of_cents_string("0") + elif match_arg_354.code == SituationFamiliale_Code.Concubins: + _ = match_arg_354.value + temp_abattement_r_822_10 = money_of_cents_string("0") + elif match_arg_354.code == SituationFamiliale_Code.CelibataireSepareDeFait: + _ = match_arg_354.value + if (list_length(personnes_a_charge) == + integer_of_string("0")): + temp_abattement_r_822_10 = money_of_cents_string("0") + else: + if (list_length(personnes_a_charge) <= + integer_of_string("2")): + temp_abattement_r_822_10 = money_of_cents_string("90100") + else: + temp_abattement_r_822_10 = money_of_cents_string("135000") + elif match_arg_354.code == SituationFamiliale_Code.ConcubinageDontSepareDeFait: + _ = match_arg_354.value + temp_abattement_r_822_10 = money_of_cents_string("0") + except EmptyError: + temp_abattement_r_822_10 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=531, start_column=11, + end_line=531, end_column=30, + law_headings=["Prise en compte des ressources pour les aides personnelles au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + abattement_r_822_10 = temp_abattement_r_822_10 + try: + temp_base_mensuelle_allocations_familiales_dot_date_courante = date_demande_ou_reexamen_droit + except EmptyError: + temp_base_mensuelle_allocations_familiales_dot_date_courante = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/../base_mensuelle_allocations_familiales/bmaf.catala_fr", + start_line=5, start_column=10, + end_line=5, end_column=23, + law_headings=["Montant de la base mensuelle des allocations familiales"])) + base_mensuelle_allocations_familiales_dot_date_courante = temp_base_mensuelle_allocations_familiales_dot_date_courante + result_8 = base_mensuelle_allocations_familiales(BaseMensuelleAllocationsFamilialesIn(date_courante_in = base_mensuelle_allocations_familiales_dot_date_courante)) + base_mensuelle_allocations_familiales_dot_montant = result_8.montant_out + try: + match_arg_355 = paiement_logement_distinct_professionnel + if match_arg_355.code == PaiementLogementDistinctProfessionnel_Code.OuiAvecLoyerOuCharges: + loyer_ou_charges = match_arg_355.value + temp_abattement_r_822_8 = montant_forfaitaire_r_822_8 + elif match_arg_355.code == PaiementLogementDistinctProfessionnel_Code.Non: + _ = match_arg_355.value + temp_abattement_r_822_8 = money_of_cents_string("0") + except EmptyError: + temp_abattement_r_822_8 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=527, start_column=11, + end_line=527, end_column=29, + law_headings=["Prise en compte des ressources pour les aides personnelles au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + abattement_r_822_8 = temp_abattement_r_822_8 + try: + try: + match_arg_356 = mode_occupation_2 + if match_arg_356.code == ModeOccupation_Code.Locataire: + _ = match_arg_356.value + temp_ressources_prises_en_compte = True + elif match_arg_356.code == ModeOccupation_Code.ResidentLogementFoyer: + _ = match_arg_356.value + temp_ressources_prises_en_compte = False + elif match_arg_356.code == ModeOccupation_Code.AccessionProprieteLocalUsageExclusifHabitation: + _ = match_arg_356.value + temp_ressources_prises_en_compte = False + elif match_arg_356.code == ModeOccupation_Code.SousLocataire: + _ = match_arg_356.value + temp_ressources_prises_en_compte = False + elif match_arg_356.code == ModeOccupation_Code.LocationAccession: + _ = match_arg_356.value + temp_ressources_prises_en_compte = False + if (temp_ressources_prises_en_compte and + (condition_age_bourse_enseignement_superieur and + demandeur_poursuit_des_etudes)): + temp_ressources_prises_en_compte_1 = ressources_forfaitaires_r822_20 + else: + temp_ressources_prises_en_compte_1 = dead_value + raise EmptyError + except EmptyError: + temp_ressources_prises_en_compte_1 = ((ressources_demandeur + + ressources_conjoint) + + ressources_personnes_vivant_habituellement_foyer) + except EmptyError: + temp_ressources_prises_en_compte_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=537, start_column=10, + end_line=537, end_column=37, + law_headings=["Prise en compte des ressources pour les aides personnelles au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + ressources_prises_en_compte = temp_ressources_prises_en_compte_1 + try: + if (demandeur_exerce_activite_remuneree and + (conjoint_exerce_activite_remuneree and ((ressources_conjoint + + ressources_conjoint) >= + (base_mensuelle_allocations_familiales_dot_montant * + decimal_of_string("12."))))): + temp_abattement_r_822_7 = montant_forfaitaire_r_822_7 + else: + temp_abattement_r_822_7 = money_of_cents_string("0") + except EmptyError: + temp_abattement_r_822_7 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=529, start_column=11, + end_line=529, end_column=29, + law_headings=["Prise en compte des ressources pour les aides personnelles au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + abattement_r_822_7 = temp_abattement_r_822_7 + try: + def temp___5(acc_4:bool, personne_2:Any): + return (acc_4 and + personne_2.duree_residence_durant_periode_r_822_3_1_superieure_a_6_mois) + temp___6 = list_fold_left(temp___5, True, + personnes_vivant_habituellement_foyer) + except EmptyError: + temp___6 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", + start_line=142, start_column=13, + end_line=143, end_column=74, + law_headings=["Article R822-2", + "Sous-section 1 : Modalités générales de l'appréciation des ressources", + "Section 2 : Conditions relatives aux ressources", + "Chapitre II : Conditions générales d'attribution", + "Titre II : Dispositions communes aux aides personnelles au logement", + "Livre VIII : Aides personnelles au logement", + "Partie réglementaire", + "Code de la construction et de l'habitation"])) + if not (temp___6): + raise AssertionFailure(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", + start_line=142, + start_column=13, end_line=143, + end_column=74, + law_headings=["Article R822-2", + "Sous-section 1 : Modalités générales de l'appréciation des ressources", + "Section 2 : Conditions relatives aux ressources", + "Chapitre II : Conditions générales d'attribution", + "Titre II : Dispositions communes aux aides personnelles au logement", + "Livre VIII : Aides personnelles au logement", + "Partie réglementaire", + "Code de la construction et de l'habitation"])) + return RessourcesAidesPersonnelleLogementOut(ressources_prises_en_compte_out = ressources_prises_en_compte) + +def eligibilite_prestations_familiales(eligibilite_prestations_familiales_in:EligibilitePrestationsFamilialesIn): + date_courante_7 = eligibilite_prestations_familiales_in.date_courante_in + prestation_courante = eligibilite_prestations_familiales_in.prestation_courante_in + residence_1 = eligibilite_prestations_familiales_in.residence_in + try: + temp_age_l512_3_2 = integer_of_string("20") + except EmptyError: + temp_age_l512_3_2 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/../prestations_familiales/prologue.catala_fr", + start_line=44, start_column=10, + end_line=44, end_column=22, + law_headings=["Prologue : prestations familiales"])) + age_l512_3_2 = temp_age_l512_3_2 + try: + temp_smic_dot_date_courante = date_courante_7 + except EmptyError: + temp_smic_dot_date_courante = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/../prestations_familiales/../smic/smic.catala_fr", + start_line=9, start_column=10, + end_line=9, end_column=23, + law_headings=["Prologue", + "Montant du salaire minimum de croissance"])) + smic_dot_date_courante = temp_smic_dot_date_courante + try: + temp_smic_dot_residence = residence_1 + except EmptyError: + temp_smic_dot_residence = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/../prestations_familiales/../smic/smic.catala_fr", + start_line=10, start_column=10, + end_line=10, end_column=19, + law_headings=["Prologue", + "Montant du salaire minimum de croissance"])) + smic_dot_residence = temp_smic_dot_residence + result_9 = smic(SmicIn(date_courante_in = smic_dot_date_courante, + residence_in = smic_dot_residence)) + smic_dot_brut_horaire = result_9.brut_horaire_out + try: + try: + if ((residence_1 == Collectivite(Collectivite_Code.Guadeloupe, + Unit())) or ((residence_1 == + Collectivite(Collectivite_Code.Guyane, Unit())) or + ((residence_1 == Collectivite(Collectivite_Code.Martinique, + Unit())) or ((residence_1 == + Collectivite(Collectivite_Code.LaReunion, Unit())) or + ((residence_1 == + Collectivite(Collectivite_Code.SaintBarthelemy, Unit())) or + (residence_1 == Collectivite(Collectivite_Code.SaintMartin, + Unit()))))))): + temp_regime_outre_mer_l751_1 = True + else: + temp_regime_outre_mer_l751_1 = dead_value + raise EmptyError + except EmptyError: + temp_regime_outre_mer_l751_1 = False + except EmptyError: + temp_regime_outre_mer_l751_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/../prestations_familiales/prologue.catala_fr", + start_line=45, start_column=10, + end_line=45, end_column=33, + law_headings=["Prologue : prestations familiales"])) + regime_outre_mer_l751_1 = temp_regime_outre_mer_l751_1 + try: + try: + if regime_outre_mer_l751_1: + temp_plafond_l512_3_2 = ((smic_dot_brut_horaire * + decimal_of_string("0.55")) * decimal_of_string("169.")) + else: + temp_plafond_l512_3_2 = dead_value + raise EmptyError + except EmptyError: + temp_plafond_l512_3_2 = ((smic_dot_brut_horaire * + decimal_of_string("0.55")) * decimal_of_string("169.")) + except EmptyError: + temp_plafond_l512_3_2 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/../prestations_familiales/prologue.catala_fr", + start_line=43, start_column=11, + end_line=43, end_column=27, + law_headings=["Prologue : prestations familiales"])) + plafond_l512_3_2 = temp_plafond_l512_3_2 + try: + def temp_conditions_hors_age(param_22:EnfantPrestationsFamiliales): + try: + try: + match_arg_357 = param_22.obligation_scolaire + if match_arg_357.code == SituationObligationScolaire_Code.Avant: + _ = match_arg_357.value + temp_conditions_hors_age_1 = False + elif match_arg_357.code == SituationObligationScolaire_Code.Pendant: + _ = match_arg_357.value + temp_conditions_hors_age_1 = False + elif match_arg_357.code == SituationObligationScolaire_Code.Apres: + _ = match_arg_357.value + temp_conditions_hors_age_1 = True + match_arg_358 = param_22.obligation_scolaire + if match_arg_358.code == SituationObligationScolaire_Code.Avant: + _ = match_arg_358.value + temp_conditions_hors_age_2 = False + elif match_arg_358.code == SituationObligationScolaire_Code.Pendant: + _ = match_arg_358.value + temp_conditions_hors_age_2 = True + elif match_arg_358.code == SituationObligationScolaire_Code.Apres: + _ = match_arg_358.value + temp_conditions_hors_age_2 = False + match_arg_359 = param_22.obligation_scolaire + if match_arg_359.code == SituationObligationScolaire_Code.Avant: + _ = match_arg_359.value + temp_conditions_hors_age_3 = True + elif match_arg_359.code == SituationObligationScolaire_Code.Pendant: + _ = match_arg_359.value + temp_conditions_hors_age_3 = False + elif match_arg_359.code == SituationObligationScolaire_Code.Apres: + _ = match_arg_359.value + temp_conditions_hors_age_3 = False + if ((temp_conditions_hors_age_3 or + (temp_conditions_hors_age_2 or + temp_conditions_hors_age_1)) and + (param_22.remuneration_mensuelle <= + plafond_l512_3_2)): + return True + else: + raise EmptyError + except EmptyError: + return False + except EmptyError: + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/../prestations_familiales/prologue.catala_fr", + start_line=42, + start_column=10, + end_line=42, + end_column=29, + law_headings=["Prologue : prestations familiales"])) + except EmptyError: + temp_conditions_hors_age = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/../prestations_familiales/prologue.catala_fr", + start_line=42, start_column=10, + end_line=42, end_column=29, + law_headings=["Prologue : prestations familiales"])) + conditions_hors_age = temp_conditions_hors_age + try: + def temp_droit_ouvert(param_23:EnfantPrestationsFamiliales): + try: + try: + try: + match_arg_360 = param_23.obligation_scolaire + if match_arg_360.code == SituationObligationScolaire_Code.Avant: + _ = match_arg_360.value + temp_droit_ouvert_1 = False + elif match_arg_360.code == SituationObligationScolaire_Code.Pendant: + _ = match_arg_360.value + temp_droit_ouvert_1 = False + elif match_arg_360.code == SituationObligationScolaire_Code.Apres: + _ = match_arg_360.value + temp_droit_ouvert_1 = True + if (temp_droit_ouvert_1 and + ((param_23.remuneration_mensuelle <= + plafond_l512_3_2) and (param_23.age < + age_l512_3_2))): + return True + else: + raise EmptyError + except EmptyError: + match_arg_361 = param_23.obligation_scolaire + if match_arg_361.code == SituationObligationScolaire_Code.Avant: + _ = match_arg_361.value + temp_droit_ouvert_2 = False + elif match_arg_361.code == SituationObligationScolaire_Code.Pendant: + _ = match_arg_361.value + temp_droit_ouvert_2 = True + elif match_arg_361.code == SituationObligationScolaire_Code.Apres: + _ = match_arg_361.value + temp_droit_ouvert_2 = False + match_arg_362 = param_23.obligation_scolaire + if match_arg_362.code == SituationObligationScolaire_Code.Avant: + _ = match_arg_362.value + temp_droit_ouvert_3 = True + elif match_arg_362.code == SituationObligationScolaire_Code.Pendant: + _ = match_arg_362.value + temp_droit_ouvert_3 = False + elif match_arg_362.code == SituationObligationScolaire_Code.Apres: + _ = match_arg_362.value + temp_droit_ouvert_3 = False + if (temp_droit_ouvert_3 or + temp_droit_ouvert_2): + return True + else: + raise EmptyError + except EmptyError: + return False + except EmptyError: + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/../prestations_familiales/prologue.catala_fr", + start_line=41, + start_column=10, + end_line=41, + end_column=22, + law_headings=["Prologue : prestations familiales"])) + except EmptyError: + temp_droit_ouvert = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/../prestations_familiales/prologue.catala_fr", + start_line=41, start_column=10, + end_line=41, end_column=22, + law_headings=["Prologue : prestations familiales"])) + droit_ouvert = temp_droit_ouvert + return EligibilitePrestationsFamilialesOut(droit_ouvert_out = droit_ouvert, + conditions_hors_age_out = conditions_hors_age, + age_l512_3_2_out = age_l512_3_2, + regime_outre_mer_l751_1_out = regime_outre_mer_l751_1) + +def calcul_allocation_logement_locatif(calcul_allocation_logement_locatif_in:CalculAllocationLogementLocatifIn): + loyer_principal_1 = calcul_allocation_logement_locatif_in.loyer_principal_in + ressources_menage_arrondies_4 = calcul_allocation_logement_locatif_in.ressources_menage_arrondies_in + beneficiaire_aide_adulte_ou_enfant_handicapes_1 = calcul_allocation_logement_locatif_in.beneficiaire_aide_adulte_ou_enfant_handicapes_in + date_courante_8 = calcul_allocation_logement_locatif_in.date_courante_in + nombre_personnes_a_charge_5 = calcul_allocation_logement_locatif_in.nombre_personnes_a_charge_in + situation_familiale_calcul_apl_5 = calcul_allocation_logement_locatif_in.situation_familiale_calcul_apl_in + zone_3 = calcul_allocation_logement_locatif_in.zone_in + logement_est_chambre_1 = calcul_allocation_logement_locatif_in.logement_est_chambre_in + agees_ou_handicap_adultes_hebergees_onereux_particuliers_1 = calcul_allocation_logement_locatif_in.agees_ou_handicap_adultes_hebergees_onereux_particuliers_in + type_aide_1 = calcul_allocation_logement_locatif_in.type_aide_in + colocation_1 = calcul_allocation_logement_locatif_in.colocation_in + reduction_loyer_solidarite_1 = calcul_allocation_logement_locatif_in.reduction_loyer_solidarite_in + logement_meuble_d842_2 = calcul_allocation_logement_locatif_in.logement_meuble_d842_2_in + changement_logement_d842_4 = calcul_allocation_logement_locatif_in.changement_logement_d842_4_in + try: + try: + if logement_meuble_d842_2: + temp_calcul_apl_locatif_dot_loyer_principal = (loyer_principal_1 * + (decimal_of_string("2.") / decimal_of_string("3."))) + else: + temp_calcul_apl_locatif_dot_loyer_principal = dead_value + raise EmptyError + except EmptyError: + temp_calcul_apl_locatif_dot_loyer_principal = loyer_principal_1 + temp_calcul_apl_locatif_dot_loyer_principal_1 = temp_calcul_apl_locatif_dot_loyer_principal + except EmptyError: + temp_calcul_apl_locatif_dot_loyer_principal_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=558, start_column=10, + end_line=558, end_column=25, + law_headings=["Secteur locatif", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + calcul_apl_locatif_dot_loyer_principal = temp_calcul_apl_locatif_dot_loyer_principal_1 + try: + temp_calcul_apl_locatif_dot_ressources_menage_arrondies = ressources_menage_arrondies_4 + except EmptyError: + temp_calcul_apl_locatif_dot_ressources_menage_arrondies = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=559, start_column=10, + end_line=559, end_column=37, + law_headings=["Secteur locatif", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + calcul_apl_locatif_dot_ressources_menage_arrondies = temp_calcul_apl_locatif_dot_ressources_menage_arrondies + try: + temp_calcul_apl_locatif_dot_beneficiaire_aide_adulte_ou_enfant_handicapes = beneficiaire_aide_adulte_ou_enfant_handicapes_1 + except EmptyError: + temp_calcul_apl_locatif_dot_beneficiaire_aide_adulte_ou_enfant_handicapes = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=560, start_column=10, + end_line=560, end_column=55, + law_headings=["Secteur locatif", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + calcul_apl_locatif_dot_beneficiaire_aide_adulte_ou_enfant_handicapes = temp_calcul_apl_locatif_dot_beneficiaire_aide_adulte_ou_enfant_handicapes + try: + temp_calcul_apl_locatif_dot_date_courante = date_courante_8 + except EmptyError: + temp_calcul_apl_locatif_dot_date_courante = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=562, start_column=10, + end_line=562, end_column=23, + law_headings=["Secteur locatif", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + calcul_apl_locatif_dot_date_courante = temp_calcul_apl_locatif_dot_date_courante + try: + temp_calcul_apl_locatif_dot_nombre_personnes_a_charge = nombre_personnes_a_charge_5 + except EmptyError: + temp_calcul_apl_locatif_dot_nombre_personnes_a_charge = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=563, start_column=10, + end_line=563, end_column=35, + law_headings=["Secteur locatif", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + calcul_apl_locatif_dot_nombre_personnes_a_charge = temp_calcul_apl_locatif_dot_nombre_personnes_a_charge + try: + temp_calcul_apl_locatif_dot_situation_familiale_calcul_apl = situation_familiale_calcul_apl_5 + except EmptyError: + temp_calcul_apl_locatif_dot_situation_familiale_calcul_apl = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=564, start_column=10, + end_line=564, end_column=40, + law_headings=["Secteur locatif", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + calcul_apl_locatif_dot_situation_familiale_calcul_apl = temp_calcul_apl_locatif_dot_situation_familiale_calcul_apl + try: + temp_calcul_apl_locatif_dot_zone = zone_3 + except EmptyError: + temp_calcul_apl_locatif_dot_zone = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=565, start_column=10, + end_line=565, end_column=14, + law_headings=["Secteur locatif", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + calcul_apl_locatif_dot_zone = temp_calcul_apl_locatif_dot_zone + try: + temp_calcul_apl_locatif_dot_logement_est_chambre = logement_est_chambre_1 + except EmptyError: + temp_calcul_apl_locatif_dot_logement_est_chambre = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=566, start_column=10, + end_line=566, end_column=30, + law_headings=["Secteur locatif", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + calcul_apl_locatif_dot_logement_est_chambre = temp_calcul_apl_locatif_dot_logement_est_chambre + try: + temp_calcul_apl_locatif_dot_agees_ou_handicap_adultes_hebergees_onereux_particuliers = agees_ou_handicap_adultes_hebergees_onereux_particuliers_1 + except EmptyError: + temp_calcul_apl_locatif_dot_agees_ou_handicap_adultes_hebergees_onereux_particuliers = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=567, start_column=10, + end_line=567, end_column=66, + law_headings=["Secteur locatif", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + calcul_apl_locatif_dot_agees_ou_handicap_adultes_hebergees_onereux_particuliers = temp_calcul_apl_locatif_dot_agees_ou_handicap_adultes_hebergees_onereux_particuliers + try: + temp_calcul_apl_locatif_dot_type_aide = type_aide_1 + except EmptyError: + temp_calcul_apl_locatif_dot_type_aide = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=569, start_column=10, + end_line=569, end_column=19, + law_headings=["Secteur locatif", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + calcul_apl_locatif_dot_type_aide = temp_calcul_apl_locatif_dot_type_aide + try: + temp_calcul_apl_locatif_dot_colocation = colocation_1 + except EmptyError: + temp_calcul_apl_locatif_dot_colocation = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=570, start_column=10, + end_line=570, end_column=20, + law_headings=["Secteur locatif", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + calcul_apl_locatif_dot_colocation = temp_calcul_apl_locatif_dot_colocation + try: + temp_calcul_apl_locatif_dot_reduction_loyer_solidarite = reduction_loyer_solidarite_1 + except EmptyError: + temp_calcul_apl_locatif_dot_reduction_loyer_solidarite = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=571, start_column=10, + end_line=571, end_column=36, + law_headings=["Secteur locatif", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + calcul_apl_locatif_dot_reduction_loyer_solidarite = temp_calcul_apl_locatif_dot_reduction_loyer_solidarite + result_10 = calcul_aide_personnalisee_logement_locatif(CalculAidePersonnaliseeLogementLocatifIn(loyer_principal_in = calcul_apl_locatif_dot_loyer_principal, + ressources_menage_arrondies_in = calcul_apl_locatif_dot_ressources_menage_arrondies, + beneficiaire_aide_adulte_ou_enfant_handicapes_in = calcul_apl_locatif_dot_beneficiaire_aide_adulte_ou_enfant_handicapes, + date_courante_in = calcul_apl_locatif_dot_date_courante, + nombre_personnes_a_charge_in = calcul_apl_locatif_dot_nombre_personnes_a_charge, + situation_familiale_calcul_apl_in = calcul_apl_locatif_dot_situation_familiale_calcul_apl, + zone_in = calcul_apl_locatif_dot_zone, + logement_est_chambre_in = calcul_apl_locatif_dot_logement_est_chambre, + agees_ou_handicap_adultes_hebergees_onereux_particuliers_in = calcul_apl_locatif_dot_agees_ou_handicap_adultes_hebergees_onereux_particuliers, + type_aide_in = calcul_apl_locatif_dot_type_aide, + colocation_in = calcul_apl_locatif_dot_colocation, + reduction_loyer_solidarite_in = calcul_apl_locatif_dot_reduction_loyer_solidarite)) + calcul_apl_locatif_dot_montant_forfaitaire_charges_d823_16 = result_10.montant_forfaitaire_charges_d823_16_out + calcul_apl_locatif_dot_plafond_loyer_d823_16_2 = result_10.plafond_loyer_d823_16_2_out + calcul_apl_locatif_dot_participation_minimale = result_10.participation_minimale_out + calcul_apl_locatif_dot_taux_composition_familiale = result_10.taux_composition_familiale_out + calcul_apl_locatif_dot_participation_personnelle = result_10.participation_personnelle_out + calcul_apl_locatif_dot_aide_finale_formule = result_10.aide_finale_formule_out + calcul_apl_locatif_dot_traitement_aide_finale_montant_minimal = result_10.traitement_aide_finale_montant_minimal_out + try: + def temp_traitement_aide_finale(param_24:Money): + try: + try: + match_arg_363 = changement_logement_d842_4 + if match_arg_363.code == ChangementLogementD8424_Code.Changement: + infos = match_arg_363.value + temp_traitement_aide_finale_1 = (loyer_principal_1 >= + infos.ancien_loyer_principal) + elif match_arg_363.code == ChangementLogementD8424_Code.PasDeChangement: + _ = match_arg_363.value + temp_traitement_aide_finale_1 = False + if temp_traitement_aide_finale_1: + return param_24 + else: + raise EmptyError + except EmptyError: + return calcul_apl_locatif_dot_traitement_aide_finale_montant_minimal( + param_24) + except EmptyError: + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=813, + start_column=10, + end_line=813, + end_column=32, + law_headings=["Secteur locatif", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + except EmptyError: + temp_traitement_aide_finale = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=813, start_column=10, + end_line=813, end_column=32, + law_headings=["Secteur locatif", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + traitement_aide_finale = temp_traitement_aide_finale + try: + try: + match_arg_364 = changement_logement_d842_4 + if match_arg_364.code == ChangementLogementD8424_Code.Changement: + infos_1 = match_arg_364.value + temp_aide_finale_formule_3 = (loyer_principal_1 >= + infos_1.ancien_loyer_principal) + elif match_arg_364.code == ChangementLogementD8424_Code.PasDeChangement: + _ = match_arg_364.value + temp_aide_finale_formule_3 = False + if temp_aide_finale_formule_3: + match_arg_365 = changement_logement_d842_4 + if match_arg_365.code == ChangementLogementD8424_Code.Changement: + infos_2 = match_arg_365.value + temp_aide_finale_formule_4 = (loyer_principal_1 - + (infos_2.ancien_loyer_principal - + infos_2.ancienne_allocation_logement)) + elif match_arg_365.code == ChangementLogementD8424_Code.PasDeChangement: + _ = match_arg_365.value + temp_aide_finale_formule_4 = money_of_cents_string("0") + else: + temp_aide_finale_formule_4 = dead_value + raise EmptyError + except EmptyError: + temp_aide_finale_formule_4 = calcul_apl_locatif_dot_aide_finale_formule + except EmptyError: + temp_aide_finale_formule_4 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=811, start_column=10, + end_line=811, end_column=29, + law_headings=["Secteur locatif", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + aide_finale_formule_3 = temp_aide_finale_formule_4 + return CalculAllocationLogementLocatifOut(aide_finale_formule_out = aide_finale_formule_3, + traitement_aide_finale_out = traitement_aide_finale) + +def calcul_allocation_logement_foyer(calcul_allocation_logement_foyer_in:CalculAllocationLogementFoyerIn): + redevance_1 = calcul_allocation_logement_foyer_in.redevance_in + mode_occupation_3 = calcul_allocation_logement_foyer_in.mode_occupation_in + ressources_menage_arrondies_5 = calcul_allocation_logement_foyer_in.ressources_menage_arrondies_in + nombre_personnes_a_charge_6 = calcul_allocation_logement_foyer_in.nombre_personnes_a_charge_in + situation_familiale_calcul_apl_6 = calcul_allocation_logement_foyer_in.situation_familiale_calcul_apl_in + zone_4 = calcul_allocation_logement_foyer_in.zone_in + date_courante_9 = calcul_allocation_logement_foyer_in.date_courante_in + categorie_equivalence_loyer_d842_16 = calcul_allocation_logement_foyer_in.categorie_equivalence_loyer_d842_16_in + try: + temp_montant_minimal_aide_d842_15 = money_of_cents_string("1000") + except EmptyError: + temp_montant_minimal_aide_d842_15 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=960, start_column=11, + end_line=960, end_column=39, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + montant_minimal_aide_d842_15 = temp_montant_minimal_aide_d842_15 + try: + temp_montant_forfaitaire_d842_15 = money_of_cents_string("500") + except EmptyError: + temp_montant_forfaitaire_d842_15 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=961, start_column=11, + end_line=961, end_column=38, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + montant_forfaitaire_d842_15 = temp_montant_forfaitaire_d842_15 + try: + temp_montant_minimal_depense_nette_d842_17 = money_of_cents_string("1500") + except EmptyError: + temp_montant_minimal_depense_nette_d842_17 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=962, start_column=11, + end_line=962, end_column=48, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + montant_minimal_depense_nette_d842_17 = temp_montant_minimal_depense_nette_d842_17 + try: + temp_calcul_nombre_parts_dot_condition_2_du_832_25_1 = True + except EmptyError: + temp_calcul_nombre_parts_dot_condition_2_du_832_25_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=625, start_column=10, + end_line=625, end_column=31, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + calcul_nombre_parts_dot_condition_2_du_832_25_1 = temp_calcul_nombre_parts_dot_condition_2_du_832_25_1 + try: + temp_calcul_nombre_parts_dot_nombre_personnes_a_charge_2 = nombre_personnes_a_charge_6 + except EmptyError: + temp_calcul_nombre_parts_dot_nombre_personnes_a_charge_2 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=626, start_column=10, + end_line=626, end_column=35, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + calcul_nombre_parts_dot_nombre_personnes_a_charge_2 = temp_calcul_nombre_parts_dot_nombre_personnes_a_charge_2 + try: + temp_calcul_nombre_parts_dot_situation_familiale_calcul_apl_2 = situation_familiale_calcul_apl_6 + except EmptyError: + temp_calcul_nombre_parts_dot_situation_familiale_calcul_apl_2 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=627, start_column=10, + end_line=627, end_column=40, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + calcul_nombre_parts_dot_situation_familiale_calcul_apl_2 = temp_calcul_nombre_parts_dot_situation_familiale_calcul_apl_2 + result_11 = calcul_nombre_part_logement_foyer(CalculNombrePartLogementFoyerIn(condition_2_du_832_25_in = calcul_nombre_parts_dot_condition_2_du_832_25_1, + nombre_personnes_a_charge_in = calcul_nombre_parts_dot_nombre_personnes_a_charge_2, + situation_familiale_calcul_apl_in = calcul_nombre_parts_dot_situation_familiale_calcul_apl_2)) + calcul_nombre_parts_dot_n_nombre_parts_d832_25_1 = result_11.n_nombre_parts_d832_25_out + try: + temp_contributions_sociales_dot_date_courante_3 = date_courante_9 + except EmptyError: + temp_contributions_sociales_dot_date_courante_3 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=544, start_column=10, + end_line=544, end_column=23, + law_headings=["Calcul des contributions sociales s'appliquant aux aides personnelles au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + contributions_sociales_dot_date_courante_3 = temp_contributions_sociales_dot_date_courante_3 + result_12 = contributions_sociales_aides_personnelle_logement(ContributionsSocialesAidesPersonnelleLogementIn(date_courante_in = contributions_sociales_dot_date_courante_3)) + contributions_sociales_dot_montant_3 = result_12.montant_out + try: + temp_calcul_apl_logement_foyer_dot_mode_occupation = mode_occupation_3 + except EmptyError: + temp_calcul_apl_logement_foyer_dot_mode_occupation = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=632, start_column=10, + end_line=632, end_column=25, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + calcul_apl_logement_foyer_dot_mode_occupation = temp_calcul_apl_logement_foyer_dot_mode_occupation + try: + temp_calcul_apl_logement_foyer_dot_ressources_menage_arrondies = ressources_menage_arrondies_5 + except EmptyError: + temp_calcul_apl_logement_foyer_dot_ressources_menage_arrondies = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=633, start_column=10, + end_line=633, end_column=37, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + calcul_apl_logement_foyer_dot_ressources_menage_arrondies = temp_calcul_apl_logement_foyer_dot_ressources_menage_arrondies + try: + temp_calcul_apl_logement_foyer_dot_nombre_personnes_a_charge = nombre_personnes_a_charge_6 + except EmptyError: + temp_calcul_apl_logement_foyer_dot_nombre_personnes_a_charge = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=634, start_column=10, + end_line=634, end_column=35, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + calcul_apl_logement_foyer_dot_nombre_personnes_a_charge = temp_calcul_apl_logement_foyer_dot_nombre_personnes_a_charge + try: + temp_calcul_apl_logement_foyer_dot_situation_familiale_calcul_apl = situation_familiale_calcul_apl_6 + except EmptyError: + temp_calcul_apl_logement_foyer_dot_situation_familiale_calcul_apl = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=635, start_column=10, + end_line=635, end_column=40, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + calcul_apl_logement_foyer_dot_situation_familiale_calcul_apl = temp_calcul_apl_logement_foyer_dot_situation_familiale_calcul_apl + try: + temp_calcul_apl_logement_foyer_dot_zone = zone_4 + except EmptyError: + temp_calcul_apl_logement_foyer_dot_zone = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=636, start_column=10, + end_line=636, end_column=14, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + calcul_apl_logement_foyer_dot_zone = temp_calcul_apl_logement_foyer_dot_zone + try: + temp_calcul_apl_logement_foyer_dot_date_courante = date_courante_9 + except EmptyError: + temp_calcul_apl_logement_foyer_dot_date_courante = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=637, start_column=10, + end_line=637, end_column=23, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + calcul_apl_logement_foyer_dot_date_courante = temp_calcul_apl_logement_foyer_dot_date_courante + try: + temp_calcul_apl_logement_foyer_dot_redevance = redevance_1 + except EmptyError: + temp_calcul_apl_logement_foyer_dot_redevance = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=638, start_column=10, + end_line=638, end_column=19, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + calcul_apl_logement_foyer_dot_redevance = temp_calcul_apl_logement_foyer_dot_redevance + def temp_calcul_apl_logement_foyer_dot_condition_2_du_832_25(_:Unit): + return True + calcul_apl_logement_foyer_dot_condition_2_du_832_25 = temp_calcul_apl_logement_foyer_dot_condition_2_du_832_25 + def temp_calcul_apl_logement_foyer_dot_n_nombre_parts_d832_25(_:Unit): + temp_calcul_apl_logement_foyer_dot_n_nombre_parts_d832_25_1 = dead_value + raise EmptyError + return temp_calcul_apl_logement_foyer_dot_n_nombre_parts_d832_25_1 + calcul_apl_logement_foyer_dot_n_nombre_parts_d832_25 = temp_calcul_apl_logement_foyer_dot_n_nombre_parts_d832_25 + result_13 = calcul_aide_personnalisee_logement_foyer(CalculAidePersonnaliseeLogementFoyerIn(mode_occupation_in = calcul_apl_logement_foyer_dot_mode_occupation, + ressources_menage_arrondies_in = calcul_apl_logement_foyer_dot_ressources_menage_arrondies, + nombre_personnes_a_charge_in = calcul_apl_logement_foyer_dot_nombre_personnes_a_charge, + situation_familiale_calcul_apl_in = calcul_apl_logement_foyer_dot_situation_familiale_calcul_apl, + zone_in = calcul_apl_logement_foyer_dot_zone, + date_courante_in = calcul_apl_logement_foyer_dot_date_courante, + redevance_in = calcul_apl_logement_foyer_dot_redevance, + condition_2_du_832_25_in = calcul_apl_logement_foyer_dot_condition_2_du_832_25, + n_nombre_parts_d832_25_in = calcul_apl_logement_foyer_dot_n_nombre_parts_d832_25)) + calcul_apl_logement_foyer_dot_coefficient_multiplicateur_d832_25 = result_13.coefficient_multiplicateur_d832_25_out + calcul_apl_logement_foyer_dot_coefficient_r_d832_25 = result_13.coefficient_r_d832_25_out + calcul_apl_logement_foyer_dot_n_nombre_parts_d832_25_1 = result_13.n_nombre_parts_d832_25_out + calcul_apl_logement_foyer_dot_equivalence_loyer_eligible = result_13.equivalence_loyer_eligible_out + calcul_apl_logement_foyer_dot_plafond_equivalence_loyer_eligible = result_13.plafond_equivalence_loyer_eligible_out + calcul_apl_logement_foyer_dot_equivalence_loyer_minimale = result_13.equivalence_loyer_minimale_out + calcul_apl_logement_foyer_dot_coefficient_prise_en_charge_d832_25_seuil = result_13.coefficient_prise_en_charge_d832_25_seuil_out + calcul_apl_logement_foyer_dot_aide_finale_formule = result_13.aide_finale_formule_out + calcul_apl_logement_foyer_dot_traitement_aide_finale_montant_minimal = result_13.traitement_aide_finale_montant_minimal_out + try: + if (date_courante_9 >= + date_of_numbers(2021,10,1)): + if (nombre_personnes_a_charge_6 == + integer_of_string("0")): + temp_montant_forfaitaire_charges = money_of_cents_string("5422") + else: + temp_montant_forfaitaire_charges = (money_of_cents_string("5422") + + (money_of_cents_string("1229") * + decimal_of_integer(nombre_personnes_a_charge_6))) + else: + temp_montant_forfaitaire_charges = dead_value + raise EmptyError + except EmptyError: + temp_montant_forfaitaire_charges = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=965, start_column=10, + end_line=965, end_column=37, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + montant_forfaitaire_charges = temp_montant_forfaitaire_charges + try: + def temp_equivalence_loyer(_:Any): + raise EmptyError + def temp_equivalence_loyer_1(_:Any): + return False + def temp_equivalence_loyer_2(_:Any): + try: + match_arg_366 = categorie_equivalence_loyer_d842_16 + if match_arg_366.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.EtudiantLogeEnChambre: + _ = match_arg_366.value + temp_equivalence_loyer_3 = False + elif match_arg_366.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.EtudiantLogeEnChambreRehabilitee: + _ = match_arg_366.value + temp_equivalence_loyer_3 = False + elif match_arg_366.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.PersonnesAgeesSelon3DeD842_16: + _ = match_arg_366.value + temp_equivalence_loyer_3 = False + elif match_arg_366.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.AutresPersonnes: + _ = match_arg_366.value + temp_equivalence_loyer_3 = True + if ((date_courante_9 >= date_of_numbers(2021,10,1)) and + temp_equivalence_loyer_3): + match_arg_367 = situation_familiale_calcul_apl_6 + if match_arg_367.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_367.value + return money_of_cents_string("17012") + elif match_arg_367.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_367.value + return money_of_cents_string("26440") + else: + raise EmptyError + except EmptyError: + match_arg_368 = categorie_equivalence_loyer_d842_16 + if match_arg_368.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.EtudiantLogeEnChambre: + _ = match_arg_368.value + temp_equivalence_loyer_4 = False + elif match_arg_368.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.EtudiantLogeEnChambreRehabilitee: + _ = match_arg_368.value + temp_equivalence_loyer_4 = True + elif match_arg_368.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.PersonnesAgeesSelon3DeD842_16: + _ = match_arg_368.value + temp_equivalence_loyer_4 = False + elif match_arg_368.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.AutresPersonnes: + _ = match_arg_368.value + temp_equivalence_loyer_4 = False + if ((date_courante_9 >= date_of_numbers(2021,10,1)) and + temp_equivalence_loyer_4): + match_arg_369 = situation_familiale_calcul_apl_6 + if match_arg_369.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_369.value + return money_of_cents_string("17012") + elif match_arg_369.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_369.value + return money_of_cents_string("26440") + else: + raise EmptyError + def temp_equivalence_loyer_5(_:Any): + match_arg_370 = categorie_equivalence_loyer_d842_16 + if match_arg_370.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.EtudiantLogeEnChambre: + _ = match_arg_370.value + temp_equivalence_loyer_6 = False + elif match_arg_370.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.EtudiantLogeEnChambreRehabilitee: + _ = match_arg_370.value + temp_equivalence_loyer_6 = False + elif match_arg_370.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.PersonnesAgeesSelon3DeD842_16: + _ = match_arg_370.value + temp_equivalence_loyer_6 = True + elif match_arg_370.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.AutresPersonnes: + _ = match_arg_370.value + temp_equivalence_loyer_6 = False + if ((date_courante_9 >= date_of_numbers(2021,10,1)) and + temp_equivalence_loyer_6): + match_arg_371 = situation_familiale_calcul_apl_6 + if match_arg_371.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_371.value + return money_of_cents_string("20640") + elif match_arg_371.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_371.value + return money_of_cents_string("32073") + else: + raise EmptyError + def temp_equivalence_loyer_7(_:Any): + match_arg_372 = categorie_equivalence_loyer_d842_16 + if match_arg_372.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.EtudiantLogeEnChambre: + _ = match_arg_372.value + temp_equivalence_loyer_8 = True + elif match_arg_372.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.EtudiantLogeEnChambreRehabilitee: + _ = match_arg_372.value + temp_equivalence_loyer_8 = False + elif match_arg_372.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.PersonnesAgeesSelon3DeD842_16: + _ = match_arg_372.value + temp_equivalence_loyer_8 = False + elif match_arg_372.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.AutresPersonnes: + _ = match_arg_372.value + temp_equivalence_loyer_8 = False + if ((date_courante_9 >= date_of_numbers(2021,10,1)) and + temp_equivalence_loyer_8): + match_arg_373 = situation_familiale_calcul_apl_6 + if match_arg_373.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_373.value + return money_of_cents_string("8414") + elif match_arg_373.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_373.value + return money_of_cents_string("13100") + else: + raise EmptyError + temp_equivalence_loyer_9 = handle_default(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=964, + start_column=10, + end_line=964, end_column=27, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"]), [temp_equivalence_loyer_7, + temp_equivalence_loyer_5, + temp_equivalence_loyer_2], + temp_equivalence_loyer_1, + temp_equivalence_loyer) + except EmptyError: + temp_equivalence_loyer_9 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=964, start_column=10, + end_line=964, end_column=27, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + equivalence_loyer = temp_equivalence_loyer_9 + try: + def temp_traitement_aide_finale_minoration_forfaitaire_3(param_25:Money): + try: + if ((param_25 - montant_forfaitaire_d842_15) < + money_of_cents_string("0")): + return money_of_cents_string("0") + else: + return (param_25 - montant_forfaitaire_d842_15) + except EmptyError: + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=978, + start_column=10, + end_line=978, + end_column=32, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + except EmptyError: + temp_traitement_aide_finale_minoration_forfaitaire_3 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=978, start_column=10, + end_line=978, end_column=32, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + traitement_aide_finale_minoration_forfaitaire_3 = temp_traitement_aide_finale_minoration_forfaitaire_3 + try: + temp_calcul_equivalence_loyer_minimale_dot_ressources_menage_arrondies_2 = ressources_menage_arrondies_5 + except EmptyError: + temp_calcul_equivalence_loyer_minimale_dot_ressources_menage_arrondies_2 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=613, start_column=10, + end_line=613, end_column=37, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + calcul_equivalence_loyer_minimale_dot_ressources_menage_arrondies_2 = temp_calcul_equivalence_loyer_minimale_dot_ressources_menage_arrondies_2 + try: + temp_calcul_equivalence_loyer_minimale_dot_condition_2_du_832_25_2 = True + except EmptyError: + temp_calcul_equivalence_loyer_minimale_dot_condition_2_du_832_25_2 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=614, start_column=10, + end_line=614, end_column=31, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + calcul_equivalence_loyer_minimale_dot_condition_2_du_832_25_2 = temp_calcul_equivalence_loyer_minimale_dot_condition_2_du_832_25_2 + try: + temp_calcul_equivalence_loyer_minimale_dot_n_nombre_parts_d832_25_2 = calcul_nombre_parts_dot_n_nombre_parts_d832_25_1 + except EmptyError: + temp_calcul_equivalence_loyer_minimale_dot_n_nombre_parts_d832_25_2 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=615, start_column=10, + end_line=615, end_column=32, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + calcul_equivalence_loyer_minimale_dot_n_nombre_parts_d832_25_2 = temp_calcul_equivalence_loyer_minimale_dot_n_nombre_parts_d832_25_2 + result_14 = calcul_equivalence_loyer_minimale(CalculEquivalenceLoyerMinimaleIn(ressources_menage_arrondies_in = calcul_equivalence_loyer_minimale_dot_ressources_menage_arrondies_2, + condition_2_du_832_25_in = calcul_equivalence_loyer_minimale_dot_condition_2_du_832_25_2, + n_nombre_parts_d832_25_in = calcul_equivalence_loyer_minimale_dot_n_nombre_parts_d832_25_2)) + calcul_equivalence_loyer_minimale_dot_montant_2 = result_14.montant_out + try: + temp_coefficient_prise_en_charge = calcul_apl_logement_foyer_dot_coefficient_prise_en_charge_d832_25_seuil + except EmptyError: + temp_coefficient_prise_en_charge = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=963, start_column=10, + end_line=963, end_column=37, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + coefficient_prise_en_charge = temp_coefficient_prise_en_charge + try: + def temp_depense_nette_minimale(param_26:Money): + try: + return ((equivalence_loyer + montant_forfaitaire_charges) - + param_26) + except EmptyError: + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=958, + start_column=11, + end_line=958, + end_column=33, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + except EmptyError: + temp_depense_nette_minimale = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=958, start_column=11, + end_line=958, end_column=33, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + depense_nette_minimale = temp_depense_nette_minimale + try: + temp_loyer_minimal = calcul_equivalence_loyer_minimale_dot_montant_2 + except EmptyError: + temp_loyer_minimal = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=966, start_column=10, + end_line=966, end_column=23, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + loyer_minimal = temp_loyer_minimal + try: + def temp_abattement_depense_nette_minimale(param_27:Money): + try: + if (depense_nette_minimale(param_27) < + montant_minimal_depense_nette_d842_17): + return (montant_minimal_depense_nette_d842_17 - + depense_nette_minimale(param_27)) + else: + return money_of_cents_string("0") + except EmptyError: + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=959, + start_column=11, + end_line=959, + end_column=44, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + except EmptyError: + temp_abattement_depense_nette_minimale = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=959, start_column=11, + end_line=959, end_column=44, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + abattement_depense_nette_minimale = temp_abattement_depense_nette_minimale + try: + temp_aide_finale_formule_5 = (((equivalence_loyer + + montant_forfaitaire_charges) - loyer_minimal) * + coefficient_prise_en_charge) + except EmptyError: + temp_aide_finale_formule_5 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=976, start_column=10, + end_line=976, end_column=29, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + aide_finale_formule_4 = temp_aide_finale_formule_5 + try: + def temp_traitement_aide_finale_depense_nette_minimale(param_28:Money): + try: + if ((traitement_aide_finale_minoration_forfaitaire_3( + param_28) - + abattement_depense_nette_minimale(traitement_aide_finale_minoration_forfaitaire_3( + param_28))) < + money_of_cents_string("0")): + return money_of_cents_string("0") + else: + return (traitement_aide_finale_minoration_forfaitaire_3( + param_28) - + abattement_depense_nette_minimale(traitement_aide_finale_minoration_forfaitaire_3( + param_28))) + except EmptyError: + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=979, + start_column=10, + end_line=979, + end_column=32, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + except EmptyError: + temp_traitement_aide_finale_depense_nette_minimale = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=979, start_column=10, + end_line=979, end_column=32, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + traitement_aide_finale_depense_nette_minimale = temp_traitement_aide_finale_depense_nette_minimale + try: + def temp_traitement_aide_finale_redevance(param_29:Money): + try: + if (traitement_aide_finale_depense_nette_minimale(param_29) > + redevance_1): + return redevance_1 + else: + return traitement_aide_finale_depense_nette_minimale( + param_29) + except EmptyError: + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=980, + start_column=10, + end_line=980, + end_column=19, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + except EmptyError: + temp_traitement_aide_finale_redevance = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=980, start_column=10, + end_line=980, end_column=19, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + traitement_aide_finale_redevance = temp_traitement_aide_finale_redevance + try: + def temp_traitement_aide_finale_contributions_sociales_arrondi_3(param_30:Money): + try: + if ((money_round(((traitement_aide_finale_redevance(param_30) - + contributions_sociales_dot_montant_3(traitement_aide_finale_redevance( + param_30))) - + money_of_cents_string("50"))) + + contributions_sociales_dot_montant_3(traitement_aide_finale_redevance( + param_30))) >= + money_of_cents_string("0")): + return (money_round(((traitement_aide_finale_redevance( + param_30) - + contributions_sociales_dot_montant_3(traitement_aide_finale_redevance( + param_30))) - + money_of_cents_string("50"))) + + contributions_sociales_dot_montant_3(traitement_aide_finale_redevance( + param_30))) + else: + return money_of_cents_string("0") + except EmptyError: + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=981, + start_column=10, + end_line=981, + end_column=40, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + except EmptyError: + temp_traitement_aide_finale_contributions_sociales_arrondi_3 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=981, start_column=10, + end_line=981, end_column=40, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + traitement_aide_finale_contributions_sociales_arrondi_3 = temp_traitement_aide_finale_contributions_sociales_arrondi_3 + try: + def temp_traitement_aide_finale_montant_minimal_3(param_31:Money): + try: + if (traitement_aide_finale_contributions_sociales_arrondi_3( + param_31) < + montant_minimal_aide_d842_15): + return money_of_cents_string("0") + else: + return traitement_aide_finale_contributions_sociales_arrondi_3( + param_31) + except EmptyError: + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=982, + start_column=10, + end_line=982, + end_column=25, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + except EmptyError: + temp_traitement_aide_finale_montant_minimal_3 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=982, start_column=10, + end_line=982, end_column=25, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + traitement_aide_finale_montant_minimal_3 = temp_traitement_aide_finale_montant_minimal_3 + return CalculAllocationLogementFoyerOut(coefficient_prise_en_charge_out = coefficient_prise_en_charge, + equivalence_loyer_out = equivalence_loyer, + montant_forfaitaire_charges_out = montant_forfaitaire_charges, + loyer_minimal_out = loyer_minimal, + aide_finale_formule_out = aide_finale_formule_4, + traitement_aide_finale_montant_minimal_out = traitement_aide_finale_montant_minimal_3) + +def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_accession_propriete_in:CalculAllocationLogementAccessionProprieteIn): + ressources_menage_arrondies_base_1 = calcul_allocation_logement_accession_propriete_in.ressources_menage_arrondies_base_in + nombre_personnes_a_charge_7 = calcul_allocation_logement_accession_propriete_in.nombre_personnes_a_charge_in + situation_familiale_calcul_apl_7 = calcul_allocation_logement_accession_propriete_in.situation_familiale_calcul_apl_in + zone_5 = calcul_allocation_logement_accession_propriete_in.zone_in + date_courante_10 = calcul_allocation_logement_accession_propriete_in.date_courante_in + mensualite_principale_1 = calcul_allocation_logement_accession_propriete_in.mensualite_principale_in + situation_r822_11_13_17_1 = calcul_allocation_logement_accession_propriete_in.situation_r822_11_13_17_in + date_signature_pret_1 = calcul_allocation_logement_accession_propriete_in.date_signature_pret_in + type_travaux_logement_1 = calcul_allocation_logement_accession_propriete_in.type_travaux_logement_in + local_habite_premiere_fois_beneficiaire_1 = calcul_allocation_logement_accession_propriete_in.local_habite_premiere_fois_beneficiaire_in + date_entree_logement_1 = calcul_allocation_logement_accession_propriete_in.date_entree_logement_in + charges_mensuelles_pret = calcul_allocation_logement_accession_propriete_in.charges_mensuelles_pret_in + copropriete_1 = calcul_allocation_logement_accession_propriete_in.copropriete_in + try: + temp_montant_forfaitaire_d842_6 = money_of_cents_string("500") + except EmptyError: + temp_montant_forfaitaire_d842_6 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=879, start_column=11, + end_line=879, end_column=37, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + montant_forfaitaire_d842_6 = temp_montant_forfaitaire_d842_6 + try: + temp_taux_francs_vers_euros_1 = (decimal_of_string("1.") / + decimal_of_string("6.55957")) + except EmptyError: + temp_taux_francs_vers_euros_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=882, start_column=11, + end_line=882, end_column=33, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + taux_francs_vers_euros_1 = temp_taux_francs_vers_euros_1 + try: + temp_montant_minimal_aide_d842_6 = money_of_cents_string("1000") + except EmptyError: + temp_montant_minimal_aide_d842_6 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=885, start_column=11, + end_line=885, end_column=38, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + montant_minimal_aide_d842_6 = temp_montant_minimal_aide_d842_6 + try: + temp_montant_forfaitaire_d842_11 = money_of_cents_string("1500") + except EmptyError: + temp_montant_forfaitaire_d842_11 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=886, start_column=11, + end_line=886, end_column=38, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + montant_forfaitaire_d842_11 = temp_montant_forfaitaire_d842_11 + try: + temp_montant_forfaitaire_d842_12 = money_of_cents_string("390000") + except EmptyError: + temp_montant_forfaitaire_d842_12 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=887, start_column=11, + end_line=887, end_column=38, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + montant_forfaitaire_d842_12 = temp_montant_forfaitaire_d842_12 + try: + temp_coefficient_d842_11 = decimal_of_string("0.0234") + except EmptyError: + temp_coefficient_d842_11 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=888, start_column=11, + end_line=888, end_column=30, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + coefficient_d842_11 = temp_coefficient_d842_11 + try: + temp_coefficient_d842_12 = decimal_of_string("16.25") + except EmptyError: + temp_coefficient_d842_12 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=889, start_column=11, + end_line=889, end_column=30, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + coefficient_d842_12 = temp_coefficient_d842_12 + try: + temp_calcul_nombre_parts_dot_nombre_personnes_a_charge_3 = nombre_personnes_a_charge_7 + except EmptyError: + temp_calcul_nombre_parts_dot_nombre_personnes_a_charge_3 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=681, start_column=10, + end_line=681, end_column=35, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + calcul_nombre_parts_dot_nombre_personnes_a_charge_3 = temp_calcul_nombre_parts_dot_nombre_personnes_a_charge_3 + try: + temp_calcul_nombre_parts_dot_situation_familiale_calcul_apl_3 = situation_familiale_calcul_apl_7 + except EmptyError: + temp_calcul_nombre_parts_dot_situation_familiale_calcul_apl_3 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=682, start_column=10, + end_line=682, end_column=40, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + calcul_nombre_parts_dot_situation_familiale_calcul_apl_3 = temp_calcul_nombre_parts_dot_situation_familiale_calcul_apl_3 + result_15 = calcul_nombre_parts_accession_propriete(CalculNombrePartsAccessionProprieteIn(nombre_personnes_a_charge_in = calcul_nombre_parts_dot_nombre_personnes_a_charge_3, + situation_familiale_calcul_apl_in = calcul_nombre_parts_dot_situation_familiale_calcul_apl_3)) + calcul_nombre_parts_dot_n_nombre_parts_d832_11_1 = result_15.n_nombre_parts_d832_11_out + try: + temp_contributions_sociales_dot_date_courante_4 = date_courante_10 + except EmptyError: + temp_contributions_sociales_dot_date_courante_4 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=544, start_column=10, + end_line=544, end_column=23, + law_headings=["Calcul des contributions sociales s'appliquant aux aides personnelles au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + contributions_sociales_dot_date_courante_4 = temp_contributions_sociales_dot_date_courante_4 + result_16 = contributions_sociales_aides_personnelle_logement(ContributionsSocialesAidesPersonnelleLogementIn(date_courante_in = contributions_sociales_dot_date_courante_4)) + contributions_sociales_dot_montant_4 = result_16.montant_out + try: + try: + if ((date_courante_10 >= date_of_numbers(2021,10,1)) and + copropriete_1): + match_arg_374 = situation_familiale_calcul_apl_7 + if match_arg_374.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_374.value + temp_montant_forfaitaire_charges_1 = money_of_cents_string("2710") + elif match_arg_374.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_374.value + temp_montant_forfaitaire_charges_1 = money_of_cents_string("5422") + temp_montant_forfaitaire_charges_2 = (temp_montant_forfaitaire_charges_1 + + (money_of_cents_string("1229") * + decimal_of_integer(nombre_personnes_a_charge_7))) + else: + temp_montant_forfaitaire_charges_2 = dead_value + raise EmptyError + except EmptyError: + if (date_courante_10 >= + date_of_numbers(2021,10,1)): + if (nombre_personnes_a_charge_7 == + integer_of_string("0")): + temp_montant_forfaitaire_charges_2 = money_of_cents_string("5422") + else: + temp_montant_forfaitaire_charges_2 = (money_of_cents_string("5422") + + (money_of_cents_string("1229") * + decimal_of_integer(nombre_personnes_a_charge_7))) + else: + temp_montant_forfaitaire_charges_2 = dead_value + raise EmptyError + except EmptyError: + temp_montant_forfaitaire_charges_2 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=872, start_column=11, + end_line=872, end_column=38, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + montant_forfaitaire_charges_1 = temp_montant_forfaitaire_charges_2 + try: + def temp_traitement_aide_finale_minoration_forfaitaire_4(param_32:Money): + try: + if ((param_32 - montant_forfaitaire_d842_6) < + money_of_cents_string("0")): + return money_of_cents_string("0") + else: + return (param_32 - montant_forfaitaire_d842_6) + except EmptyError: + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=902, + start_column=10, + end_line=902, + end_column=32, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + except EmptyError: + temp_traitement_aide_finale_minoration_forfaitaire_4 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=902, start_column=10, + end_line=902, end_column=32, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + traitement_aide_finale_minoration_forfaitaire_4 = temp_traitement_aide_finale_minoration_forfaitaire_4 + try: + def temp_calcul_plafond_mensualite_d842_6_base(param_33:Date): + try: + def temp_calcul_plafond_mensualite_d842_6_base_1(_:Any): + raise EmptyError + def temp_calcul_plafond_mensualite_d842_6_base_2(_:Any): + return False + def temp_calcul_plafond_mensualite_d842_6_base_3(_:Any): + if ((date_courante_10 >= date_of_numbers(2020,1,1)) and + (param_33 >= + date_of_numbers(2019,10,1))): + match_arg_375 = zone_5 + if match_arg_375.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_375.value + if (nombre_personnes_a_charge_7 == + integer_of_string("0")): + match_arg_376 = situation_familiale_calcul_apl_7 + if match_arg_376.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_376.value + return money_of_cents_string("31476") + elif match_arg_376.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_376.value + return money_of_cents_string("37933") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("1")): + return money_of_cents_string("40787") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("2")): + return money_of_cents_string("41927") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("3")): + return money_of_cents_string("43106") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("4")): + return money_of_cents_string("44262") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("5")): + return money_of_cents_string("45200") + else: + return (money_of_cents_string("45200") + + (money_of_cents_string("3936") * + decimal_of_integer((nombre_personnes_a_charge_7 - + integer_of_string("5"))))) + elif match_arg_375.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_375.value + if (nombre_personnes_a_charge_7 == + integer_of_string("0")): + match_arg_377 = situation_familiale_calcul_apl_7 + if match_arg_377.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_377.value + return money_of_cents_string("27614") + elif match_arg_377.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_377.value + return money_of_cents_string("33853") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("1")): + return money_of_cents_string("36646") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("2")): + return money_of_cents_string("37915") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("3")): + return money_of_cents_string("39222") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("4")): + return money_of_cents_string("40510") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("5")): + return money_of_cents_string("43378") + else: + return (money_of_cents_string("43378") + + (money_of_cents_string("3771") * + decimal_of_integer((nombre_personnes_a_charge_7 - + integer_of_string("5"))))) + elif match_arg_375.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_375.value + if (nombre_personnes_a_charge_7 == + integer_of_string("0")): + match_arg_378 = situation_familiale_calcul_apl_7 + if match_arg_378.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_378.value + return money_of_cents_string("25904") + elif match_arg_378.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_378.value + return money_of_cents_string("31419") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("1")): + return money_of_cents_string("34255") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("2")): + return money_of_cents_string("35670") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("3")): + return money_of_cents_string("37107") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("4")): + return money_of_cents_string("38521") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("5")): + return money_of_cents_string("41392") + else: + return (money_of_cents_string("41392") + + (money_of_cents_string("3588") * + decimal_of_integer((nombre_personnes_a_charge_7 - + integer_of_string("5"))))) + else: + raise EmptyError + def temp_calcul_plafond_mensualite_d842_6_base_4(_:Any): + if ((date_courante_10 >= date_of_numbers(2020,1,1)) and + ((param_33 >= date_of_numbers(2017,10,1)) and + (param_33 < + date_of_numbers(2019,10,1)))): + match_arg_379 = zone_5 + if match_arg_379.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_379.value + if (nombre_personnes_a_charge_7 == + integer_of_string("0")): + match_arg_380 = situation_familiale_calcul_apl_7 + if match_arg_380.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_380.value + return money_of_cents_string("31382") + elif match_arg_380.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_380.value + return money_of_cents_string("37820") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("1")): + return money_of_cents_string("40665") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("2")): + return money_of_cents_string("41801") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("3")): + return money_of_cents_string("42977") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("4")): + return money_of_cents_string("44130") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("5")): + return money_of_cents_string("45064") + else: + return (money_of_cents_string("45064") + + (money_of_cents_string("3924") * + decimal_of_integer((nombre_personnes_a_charge_7 - + integer_of_string("5"))))) + elif match_arg_379.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_379.value + if (nombre_personnes_a_charge_7 == + integer_of_string("0")): + match_arg_381 = situation_familiale_calcul_apl_7 + if match_arg_381.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_381.value + return money_of_cents_string("27531") + elif match_arg_381.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_381.value + return money_of_cents_string("33751") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("1")): + return money_of_cents_string("36536") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("2")): + return money_of_cents_string("37801") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("3")): + return money_of_cents_string("39105") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("4")): + return money_of_cents_string("40389") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("5")): + return money_of_cents_string("43248") + else: + return (money_of_cents_string("43248") + + (money_of_cents_string("3760") * + decimal_of_integer((nombre_personnes_a_charge_7 - + integer_of_string("5"))))) + elif match_arg_379.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_379.value + if (nombre_personnes_a_charge_7 == + integer_of_string("0")): + match_arg_382 = situation_familiale_calcul_apl_7 + if match_arg_382.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_382.value + return money_of_cents_string("25826") + elif match_arg_382.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_382.value + return money_of_cents_string("31325") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("1")): + return money_of_cents_string("34152") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("2")): + return money_of_cents_string("35564") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("3")): + return money_of_cents_string("36996") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("4")): + return money_of_cents_string("38406") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("5")): + return money_of_cents_string("41268") + else: + return (money_of_cents_string("41268") + + (money_of_cents_string("3578") * + decimal_of_integer((nombre_personnes_a_charge_7 - + integer_of_string("5"))))) + else: + raise EmptyError + def temp_calcul_plafond_mensualite_d842_6_base_5(_:Any): + if ((date_courante_10 >= date_of_numbers(2020,1,1)) and + ((param_33 >= date_of_numbers(2015,10,1)) and + (param_33 < + date_of_numbers(2017,10,1)))): + match_arg_383 = zone_5 + if match_arg_383.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_383.value + if (nombre_personnes_a_charge_7 == + integer_of_string("0")): + match_arg_384 = situation_familiale_calcul_apl_7 + if match_arg_384.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_384.value + return money_of_cents_string("31148") + elif match_arg_384.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_384.value + return money_of_cents_string("37538") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("1")): + return money_of_cents_string("40362") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("2")): + return money_of_cents_string("41490") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("3")): + return money_of_cents_string("42657") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("4")): + return money_of_cents_string("43801") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("5")): + return money_of_cents_string("44729") + else: + return (money_of_cents_string("44729") + + (money_of_cents_string("3895") * + decimal_of_integer((nombre_personnes_a_charge_7 - + integer_of_string("5"))))) + elif match_arg_383.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_383.value + if (nombre_personnes_a_charge_7 == + integer_of_string("0")): + match_arg_385 = situation_familiale_calcul_apl_7 + if match_arg_385.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_385.value + return money_of_cents_string("27326") + elif match_arg_385.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_385.value + return money_of_cents_string("33500") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("1")): + return money_of_cents_string("36264") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("2")): + return money_of_cents_string("37520") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("3")): + return money_of_cents_string("38814") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("4")): + return money_of_cents_string("40088") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("5")): + return money_of_cents_string("42926") + else: + return (money_of_cents_string("42926") + + (money_of_cents_string("3732") * + decimal_of_integer((nombre_personnes_a_charge_7 - + integer_of_string("5"))))) + elif match_arg_383.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_383.value + if (nombre_personnes_a_charge_7 == + integer_of_string("0")): + match_arg_386 = situation_familiale_calcul_apl_7 + if match_arg_386.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_386.value + return money_of_cents_string("25634") + elif match_arg_386.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_386.value + return money_of_cents_string("31092") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("1")): + return money_of_cents_string("33898") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("2")): + return money_of_cents_string("35299") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("3")): + return money_of_cents_string("36721") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("4")): + return money_of_cents_string("38120") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("5")): + return money_of_cents_string("40961") + else: + return (money_of_cents_string("40961") + + (money_of_cents_string("3551") * + decimal_of_integer((nombre_personnes_a_charge_7 - + integer_of_string("5"))))) + else: + raise EmptyError + def temp_calcul_plafond_mensualite_d842_6_base_6(_:Any): + if ((date_courante_10 >= date_of_numbers(2020,1,1)) and + ((param_33 >= date_of_numbers(2014,10,1)) and + (param_33 < + date_of_numbers(2015,10,1)))): + match_arg_387 = zone_5 + if match_arg_387.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_387.value + if (nombre_personnes_a_charge_7 == + integer_of_string("0")): + match_arg_388 = situation_familiale_calcul_apl_7 + if match_arg_388.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_388.value + return money_of_cents_string("31123") + elif match_arg_388.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_388.value + return money_of_cents_string("37508") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("1")): + return money_of_cents_string("40330") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("2")): + return money_of_cents_string("41457") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("3")): + return money_of_cents_string("42623") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("4")): + return money_of_cents_string("43766") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("5")): + return money_of_cents_string("44693") + else: + return (money_of_cents_string("44693") + + (money_of_cents_string("3892") * + decimal_of_integer((nombre_personnes_a_charge_7 - + integer_of_string("5"))))) + elif match_arg_387.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_387.value + if (nombre_personnes_a_charge_7 == + integer_of_string("0")): + match_arg_389 = situation_familiale_calcul_apl_7 + if match_arg_389.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_389.value + return money_of_cents_string("27304") + elif match_arg_389.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_389.value + return money_of_cents_string("33473") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("1")): + return money_of_cents_string("36235") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("2")): + return money_of_cents_string("37490") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("3")): + return money_of_cents_string("38783") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("4")): + return money_of_cents_string("40056") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("5")): + return money_of_cents_string("42892") + else: + return (money_of_cents_string("42892") + + (money_of_cents_string("3729") * + decimal_of_integer((nombre_personnes_a_charge_7 - + integer_of_string("5"))))) + elif match_arg_387.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_387.value + if (nombre_personnes_a_charge_7 == + integer_of_string("0")): + match_arg_390 = situation_familiale_calcul_apl_7 + if match_arg_390.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_390.value + return money_of_cents_string("25614") + elif match_arg_390.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_390.value + return money_of_cents_string("31067") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("1")): + return money_of_cents_string("33871") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("2")): + return money_of_cents_string("35271") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("3")): + return money_of_cents_string("36692") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("4")): + return money_of_cents_string("38090") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("5")): + return money_of_cents_string("40928") + else: + return (money_of_cents_string("40928") + + (money_of_cents_string("3548") * + decimal_of_integer((nombre_personnes_a_charge_7 - + integer_of_string("5"))))) + else: + raise EmptyError + def temp_calcul_plafond_mensualite_d842_6_base_7(_:Any): + if ((date_courante_10 >= date_of_numbers(2020,1,1)) and + ((param_33 >= date_of_numbers(2013,1,1)) and + (param_33 < + date_of_numbers(2014,10,1)))): + match_arg_391 = zone_5 + if match_arg_391.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_391.value + if (nombre_personnes_a_charge_7 == + integer_of_string("0")): + match_arg_392 = situation_familiale_calcul_apl_7 + if match_arg_392.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_392.value + return money_of_cents_string("30947") + elif match_arg_392.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_392.value + return money_of_cents_string("37295") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("1")): + return money_of_cents_string("40101") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("2")): + return money_of_cents_string("41222") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("3")): + return money_of_cents_string("42381") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("4")): + return money_of_cents_string("43518") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("5")): + return money_of_cents_string("44440") + else: + return (money_of_cents_string("44440") + + (money_of_cents_string("3870") * + decimal_of_integer((nombre_personnes_a_charge_7 - + integer_of_string("5"))))) + elif match_arg_391.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_391.value + if (nombre_personnes_a_charge_7 == + integer_of_string("0")): + match_arg_393 = situation_familiale_calcul_apl_7 + if match_arg_393.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_393.value + return money_of_cents_string("27149") + elif match_arg_393.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_393.value + return money_of_cents_string("33283") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("1")): + return money_of_cents_string("36030") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("2")): + return money_of_cents_string("37278") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("3")): + return money_of_cents_string("38563") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("4")): + return money_of_cents_string("39829") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("5")): + return money_of_cents_string("42649") + else: + return (money_of_cents_string("42659") + + (money_of_cents_string("3708") * + decimal_of_integer((nombre_personnes_a_charge_7 - + integer_of_string("5"))))) + elif match_arg_391.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_391.value + if (nombre_personnes_a_charge_7 == + integer_of_string("0")): + match_arg_394 = situation_familiale_calcul_apl_7 + if match_arg_394.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_394.value + return money_of_cents_string("25469") + elif match_arg_394.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_394.value + return money_of_cents_string("30891") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("1")): + return money_of_cents_string("33679") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("2")): + return money_of_cents_string("35071") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("3")): + return money_of_cents_string("36484") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("4")): + return money_of_cents_string("37874") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("5")): + return money_of_cents_string("40696") + else: + return (money_of_cents_string("40696") + + (money_of_cents_string("3528") * + decimal_of_integer((nombre_personnes_a_charge_7 - + integer_of_string("5"))))) + else: + raise EmptyError + def temp_calcul_plafond_mensualite_d842_6_base_8(_:Any): + if ((date_courante_10 >= date_of_numbers(2020,1,1)) and + ((param_33 >= date_of_numbers(2012,1,1)) and + (param_33 < + date_of_numbers(2013,1,1)))): + match_arg_395 = zone_5 + if match_arg_395.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_395.value + if (nombre_personnes_a_charge_7 == + integer_of_string("0")): + match_arg_396 = situation_familiale_calcul_apl_7 + if match_arg_396.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_396.value + return money_of_cents_string("30296") + elif match_arg_396.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_396.value + return money_of_cents_string("36510") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("1")): + return money_of_cents_string("39257") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("2")): + return money_of_cents_string("40354") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("3")): + return money_of_cents_string("41489") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("4")): + return money_of_cents_string("42602") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("5")): + return money_of_cents_string("43505") + else: + return (money_of_cents_string("43505") + + (money_of_cents_string("3789") * + decimal_of_integer((nombre_personnes_a_charge_7 - + integer_of_string("5"))))) + elif match_arg_395.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_395.value + if (nombre_personnes_a_charge_7 == + integer_of_string("0")): + match_arg_397 = situation_familiale_calcul_apl_7 + if match_arg_397.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_397.value + return money_of_cents_string("26578") + elif match_arg_397.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_397.value + return money_of_cents_string("32582") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("1")): + return money_of_cents_string("35272") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("2")): + return money_of_cents_string("36493") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("3")): + return money_of_cents_string("37751") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("4")): + return money_of_cents_string("38991") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("5")): + return money_of_cents_string("41751") + else: + return (money_of_cents_string("41751") + + (money_of_cents_string("3630") * + decimal_of_integer((nombre_personnes_a_charge_7 - + integer_of_string("5"))))) + elif match_arg_395.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_395.value + if (nombre_personnes_a_charge_7 == + integer_of_string("0")): + match_arg_398 = situation_familiale_calcul_apl_7 + if match_arg_398.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_398.value + return money_of_cents_string("24933") + elif match_arg_398.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_398.value + return money_of_cents_string("30241") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("1")): + return money_of_cents_string("32970") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("2")): + return money_of_cents_string("34333") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("3")): + return money_of_cents_string("35716") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("4")): + return money_of_cents_string("37077") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("5")): + return money_of_cents_string("39839") + else: + return (money_of_cents_string("39839") + + (money_of_cents_string("3454") * + decimal_of_integer((nombre_personnes_a_charge_7 - + integer_of_string("5"))))) + else: + raise EmptyError + def temp_calcul_plafond_mensualite_d842_6_base_9(_:Any): + if ((date_courante_10 >= date_of_numbers(2020,1,1)) and + ((param_33 >= date_of_numbers(2011,1,1)) and + (param_33 < + date_of_numbers(2012,1,1)))): + match_arg_399 = zone_5 + if match_arg_399.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_399.value + if (nombre_personnes_a_charge_7 == + integer_of_string("0")): + match_arg_400 = situation_familiale_calcul_apl_7 + if match_arg_400.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_400.value + return money_of_cents_string("29996") + elif match_arg_400.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_400.value + return money_of_cents_string("36149") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("1")): + return money_of_cents_string("38868") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("2")): + return money_of_cents_string("39954") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("3")): + return money_of_cents_string("41078") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("4")): + return money_of_cents_string("42180") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("5")): + return money_of_cents_string("43074") + else: + return (money_of_cents_string("43074") + + (money_of_cents_string("3751") * + decimal_of_integer((nombre_personnes_a_charge_7 - + integer_of_string("5"))))) + elif match_arg_399.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_399.value + if (nombre_personnes_a_charge_7 == + integer_of_string("0")): + match_arg_401 = situation_familiale_calcul_apl_7 + if match_arg_401.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_401.value + return money_of_cents_string("26315") + elif match_arg_401.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_401.value + return money_of_cents_string("32259") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("1")): + return money_of_cents_string("34923") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("2")): + return money_of_cents_string("36132") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("3")): + return money_of_cents_string("37373") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("4")): + return money_of_cents_string("38605") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("5")): + return money_of_cents_string("41338") + else: + return (money_of_cents_string("41338") + + (money_of_cents_string("3594") * + decimal_of_integer((nombre_personnes_a_charge_7 - + integer_of_string("5"))))) + elif match_arg_399.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_399.value + if (nombre_personnes_a_charge_7 == + integer_of_string("0")): + match_arg_402 = situation_familiale_calcul_apl_7 + if match_arg_402.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_402.value + return money_of_cents_string("24686") + elif match_arg_402.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_402.value + return money_of_cents_string("29942") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("1")): + return money_of_cents_string("32644") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("2")): + return money_of_cents_string("33993") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("3")): + return money_of_cents_string("35362") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("4")): + return money_of_cents_string("36710") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("5")): + return money_of_cents_string("39445") + else: + return (money_of_cents_string("39445") + + (money_of_cents_string("3420") * + decimal_of_integer((nombre_personnes_a_charge_7 - + integer_of_string("5"))))) + else: + raise EmptyError + def temp_calcul_plafond_mensualite_d842_6_base_10(_:Any): + if ((date_courante_10 >= date_of_numbers(2020,1,1)) and + ((param_33 >= date_of_numbers(2010,1,1)) and + (param_33 < + date_of_numbers(2011,1,1)))): + match_arg_403 = zone_5 + if match_arg_403.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_403.value + if (nombre_personnes_a_charge_7 == + integer_of_string("0")): + match_arg_404 = situation_familiale_calcul_apl_7 + if match_arg_404.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_404.value + return money_of_cents_string("29670") + elif match_arg_404.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_404.value + return money_of_cents_string("35757") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("1")): + return money_of_cents_string("38445") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("2")): + return money_of_cents_string("39519") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("3")): + return money_of_cents_string("40601") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("4")): + return money_of_cents_string("41721") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("5")): + return money_of_cents_string("42605") + else: + return (money_of_cents_string("42605") + + (money_of_cents_string("3710") * + decimal_of_integer((nombre_personnes_a_charge_7 - + integer_of_string("5"))))) + elif match_arg_403.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_403.value + if (nombre_personnes_a_charge_7 == + integer_of_string("0")): + match_arg_405 = situation_familiale_calcul_apl_7 + if match_arg_405.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_405.value + return money_of_cents_string("26029") + elif match_arg_405.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_405.value + return money_of_cents_string("31908") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("1")): + return money_of_cents_string("34643") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("2")): + return money_of_cents_string("35739") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("3")): + return money_of_cents_string("36970") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("4")): + return money_of_cents_string("38185") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("5")): + return money_of_cents_string("40888") + else: + return (money_of_cents_string("40888") + + (money_of_cents_string("3555") * + decimal_of_integer((nombre_personnes_a_charge_7 - + integer_of_string("5"))))) + elif match_arg_403.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_403.value + if (nombre_personnes_a_charge_7 == + integer_of_string("0")): + match_arg_406 = situation_familiale_calcul_apl_7 + if match_arg_406.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_406.value + return money_of_cents_string("24417") + elif match_arg_406.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_406.value + return money_of_cents_string("29616") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("1")): + return money_of_cents_string("32289") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("2")): + return money_of_cents_string("33623") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("3")): + return money_of_cents_string("34977") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("4")): + return money_of_cents_string("36311") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("5")): + return money_of_cents_string("39016") + else: + return (money_of_cents_string("39016") + + (money_of_cents_string("3383") * + decimal_of_integer((nombre_personnes_a_charge_7 - + integer_of_string("5"))))) + else: + raise EmptyError + def temp_calcul_plafond_mensualite_d842_6_base_11(_:Any): + if ((date_courante_10 >= date_of_numbers(2020,1,1)) and + ((param_33 >= date_of_numbers(2009,1,1)) and + (param_33 < + date_of_numbers(2010,1,1)))): + match_arg_407 = zone_5 + if match_arg_407.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_407.value + if (nombre_personnes_a_charge_7 == + integer_of_string("0")): + match_arg_408 = situation_familiale_calcul_apl_7 + if match_arg_408.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_408.value + return money_of_cents_string("29575") + elif match_arg_408.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_408.value + return money_of_cents_string("35642") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("1")): + return money_of_cents_string("38322") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("2")): + return money_of_cents_string("39393") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("3")): + return money_of_cents_string("40501") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("4")): + return money_of_cents_string("41588") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("5")): + return money_of_cents_string("42469") + else: + return (money_of_cents_string("42469") + + (money_of_cents_string("3698") * + decimal_of_integer((nombre_personnes_a_charge_7 - + integer_of_string("5"))))) + elif match_arg_407.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_407.value + if (nombre_personnes_a_charge_7 == + integer_of_string("0")): + match_arg_409 = situation_familiale_calcul_apl_7 + if match_arg_409.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_409.value + return money_of_cents_string("25946") + elif match_arg_409.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_409.value + return money_of_cents_string("31806") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("1")): + return money_of_cents_string("34433") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("2")): + return money_of_cents_string("35625") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("3")): + return money_of_cents_string("36852") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("4")): + return money_of_cents_string("38063") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("5")): + return money_of_cents_string("40758") + else: + return (money_of_cents_string("40758") + + (money_of_cents_string("3544") * + decimal_of_integer((nombre_personnes_a_charge_7 - + integer_of_string("5"))))) + elif match_arg_407.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_407.value + if (nombre_personnes_a_charge_7 == + integer_of_string("0")): + match_arg_410 = situation_familiale_calcul_apl_7 + if match_arg_410.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_410.value + return money_of_cents_string("24339") + elif match_arg_410.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_410.value + return money_of_cents_string("29522") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("1")): + return money_of_cents_string("32186") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("2")): + return money_of_cents_string("33516") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("3")): + return money_of_cents_string("34865") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("4")): + return money_of_cents_string("36195") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("5")): + return money_of_cents_string("38892") + else: + return (money_of_cents_string("38892") + + (money_of_cents_string("3372") * + decimal_of_integer((nombre_personnes_a_charge_7 - + integer_of_string("5"))))) + else: + raise EmptyError + def temp_calcul_plafond_mensualite_d842_6_base_12(_:Any): + if ((date_courante_10 >= date_of_numbers(2020,1,1)) and + ((param_33 >= date_of_numbers(2008,1,1)) and + (param_33 < + date_of_numbers(2009,1,1)))): + match_arg_411 = zone_5 + if match_arg_411.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_411.value + if (nombre_personnes_a_charge_7 == + integer_of_string("0")): + match_arg_412 = situation_familiale_calcul_apl_7 + if match_arg_412.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_412.value + return money_of_cents_string("28728") + elif match_arg_412.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_412.value + return money_of_cents_string("34621") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("1")): + return money_of_cents_string("37224") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("2")): + return money_of_cents_string("38264") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("3")): + return money_of_cents_string("39340") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("4")): + return money_of_cents_string("40396") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("5")): + return money_of_cents_string("41252") + else: + return (money_of_cents_string("41252") + + (money_of_cents_string("3592") * + decimal_of_integer((nombre_personnes_a_charge_7 - + integer_of_string("5"))))) + elif match_arg_411.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_411.value + if (nombre_personnes_a_charge_7 == + integer_of_string("0")): + match_arg_413 = situation_familiale_calcul_apl_7 + if match_arg_413.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_413.value + return money_of_cents_string("25203") + elif match_arg_413.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_413.value + return money_of_cents_string("30895") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("1")): + return money_of_cents_string("33446") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("2")): + return money_of_cents_string("34604") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("3")): + return money_of_cents_string("35796") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("4")): + return money_of_cents_string("36972") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("5")): + return money_of_cents_string("39590") + else: + return (money_of_cents_string("39590") + + (money_of_cents_string("3442") * + decimal_of_integer((nombre_personnes_a_charge_7 - + integer_of_string("5"))))) + elif match_arg_411.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_411.value + if (nombre_personnes_a_charge_7 == + integer_of_string("0")): + match_arg_414 = situation_familiale_calcul_apl_7 + if match_arg_414.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_414.value + return money_of_cents_string("23642") + elif match_arg_414.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_414.value + return money_of_cents_string("28676") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("1")): + return money_of_cents_string("31264") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("2")): + return money_of_cents_string("32556") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("3")): + return money_of_cents_string("33866") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("4")): + return money_of_cents_string("35158") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("5")): + return money_of_cents_string("37778") + else: + return (money_of_cents_string("37778") + + (money_of_cents_string("3275") * + decimal_of_integer((nombre_personnes_a_charge_7 - + integer_of_string("5"))))) + else: + raise EmptyError + def temp_calcul_plafond_mensualite_d842_6_base_13(_:Any): + if ((date_courante_10 >= date_of_numbers(2020,1,1)) and + ((param_33 >= date_of_numbers(2007,1,1)) and + (param_33 < + date_of_numbers(2008,1,1)))): + match_arg_415 = zone_5 + if match_arg_415.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_415.value + if (nombre_personnes_a_charge_7 == + integer_of_string("0")): + match_arg_416 = situation_familiale_calcul_apl_7 + if match_arg_416.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_416.value + return money_of_cents_string("27956") + elif match_arg_416.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_416.value + return money_of_cents_string("33691") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("1")): + return money_of_cents_string("36224") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("2")): + return money_of_cents_string("37236") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("3")): + return money_of_cents_string("38283") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("4")): + return money_of_cents_string("39311") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("5")): + return money_of_cents_string("40144") + else: + return (money_of_cents_string("40144") + + (money_of_cents_string("3496") * + decimal_of_integer((nombre_personnes_a_charge_7 - + integer_of_string("5"))))) + elif match_arg_415.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_415.value + if (nombre_personnes_a_charge_7 == + integer_of_string("0")): + match_arg_417 = situation_familiale_calcul_apl_7 + if match_arg_417.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_417.value + return money_of_cents_string("24526") + elif match_arg_417.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_417.value + return money_of_cents_string("30065") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("1")): + return money_of_cents_string("32548") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("2")): + return money_of_cents_string("33675") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("3")): + return money_of_cents_string("34865") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("4")): + return money_of_cents_string("35979") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("5")): + return money_of_cents_string("38527") + else: + return (money_of_cents_string("38527") + + (money_of_cents_string("3350") * + decimal_of_integer((nombre_personnes_a_charge_7 - + integer_of_string("5"))))) + elif match_arg_415.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_415.value + if (nombre_personnes_a_charge_7 == + integer_of_string("0")): + match_arg_418 = situation_familiale_calcul_apl_7 + if match_arg_418.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_418.value + return money_of_cents_string("23007") + elif match_arg_418.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_418.value + return money_of_cents_string("27906") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("1")): + return money_of_cents_string("30424") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("2")): + return money_of_cents_string("31682") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("3")): + return money_of_cents_string("32956") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("4")): + return money_of_cents_string("34214") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("5")): + return money_of_cents_string("36733") + else: + return (money_of_cents_string("36733") + + (money_of_cents_string("3187") * + decimal_of_integer((nombre_personnes_a_charge_7 - + integer_of_string("5"))))) + else: + raise EmptyError + def temp_calcul_plafond_mensualite_d842_6_base_14(_:Any): + if ((date_courante_10 >= date_of_numbers(2020,1,1)) and + ((param_33 >= date_of_numbers(2005,9,1)) and + (param_33 < + date_of_numbers(2007,1,1)))): + match_arg_419 = zone_5 + if match_arg_419.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_419.value + if (nombre_personnes_a_charge_7 == + integer_of_string("0")): + match_arg_420 = situation_familiale_calcul_apl_7 + if match_arg_420.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_420.value + return money_of_cents_string("27195") + elif match_arg_420.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_420.value + return money_of_cents_string("32773") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("1")): + return money_of_cents_string("35237") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("2")): + return money_of_cents_string("36222") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("3")): + return money_of_cents_string("37240") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("4")): + return money_of_cents_string("38240") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("5")): + return money_of_cents_string("39051") + else: + return (money_of_cents_string("39051") + + (money_of_cents_string("3401") * + decimal_of_integer((nombre_personnes_a_charge_7 - + integer_of_string("5"))))) + elif match_arg_419.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_419.value + if (nombre_personnes_a_charge_7 == + integer_of_string("0")): + match_arg_421 = situation_familiale_calcul_apl_7 + if match_arg_421.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_421.value + return money_of_cents_string("23858") + elif match_arg_421.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_421.value + return money_of_cents_string("29246") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("1")): + return money_of_cents_string("31661") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("2")): + return money_of_cents_string("32758") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("3")): + return money_of_cents_string("33886") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("4")): + return money_of_cents_string("34999") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("5")): + return money_of_cents_string("37478") + else: + return (money_of_cents_string("37478") + + (money_of_cents_string("3259") * + decimal_of_integer((nombre_personnes_a_charge_7 - + integer_of_string("5"))))) + elif match_arg_419.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_419.value + if (nombre_personnes_a_charge_7 == + integer_of_string("0")): + match_arg_422 = situation_familiale_calcul_apl_7 + if match_arg_422.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_422.value + return money_of_cents_string("22380") + elif match_arg_422.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_422.value + return money_of_cents_string("27146") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("1")): + return money_of_cents_string("29595") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("2")): + return money_of_cents_string("30819") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("3")): + return money_of_cents_string("32058") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("4")): + return money_of_cents_string("33282") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("5")): + return money_of_cents_string("35762") + else: + return (money_of_cents_string("35762") + + (money_of_cents_string("3100") * + decimal_of_integer((nombre_personnes_a_charge_7 - + integer_of_string("5"))))) + else: + raise EmptyError + def temp_calcul_plafond_mensualite_d842_6_base_15(_:Any): + if ((date_courante_10 >= date_of_numbers(2020,1,1)) and + ((param_33 >= date_of_numbers(2003,7,1)) and + (param_33 < + date_of_numbers(2005,9,1)))): + match_arg_423 = zone_5 + if match_arg_423.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_423.value + if (nombre_personnes_a_charge_7 == + integer_of_string("0")): + match_arg_424 = situation_familiale_calcul_apl_7 + if match_arg_424.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_424.value + return money_of_cents_string("26714") + elif match_arg_424.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_424.value + return money_of_cents_string("32194") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("1")): + return money_of_cents_string("34614") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("2")): + return money_of_cents_string("35582") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("3")): + return money_of_cents_string("36582") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("4")): + return money_of_cents_string("37564") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("5")): + return money_of_cents_string("38361") + else: + return (money_of_cents_string("38361") + + (money_of_cents_string("3341") * + decimal_of_integer((nombre_personnes_a_charge_7 - + integer_of_string("5"))))) + elif match_arg_423.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_423.value + if (nombre_personnes_a_charge_7 == + integer_of_string("0")): + match_arg_425 = situation_familiale_calcul_apl_7 + if match_arg_425.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_425.value + return money_of_cents_string("23436") + elif match_arg_425.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_425.value + return money_of_cents_string("28729") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("1")): + return money_of_cents_string("31101") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("2")): + return money_of_cents_string("32179") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("3")): + return money_of_cents_string("33287") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("4")): + return money_of_cents_string("34380") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("5")): + return money_of_cents_string("36815") + else: + return (money_of_cents_string("36815") + + (money_of_cents_string("3201") * + decimal_of_integer((nombre_personnes_a_charge_7 - + integer_of_string("5"))))) + elif match_arg_423.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_423.value + if (nombre_personnes_a_charge_7 == + integer_of_string("0")): + match_arg_426 = situation_familiale_calcul_apl_7 + if match_arg_426.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_426.value + return money_of_cents_string("21984") + elif match_arg_426.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_426.value + return money_of_cents_string("26666") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("1")): + return money_of_cents_string("29072") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("2")): + return money_of_cents_string("30274") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("3")): + return money_of_cents_string("31491") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("4")): + return money_of_cents_string("32694") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("5")): + return money_of_cents_string("35130") + else: + return (money_of_cents_string("35130") + + (money_of_cents_string("3045") * + decimal_of_integer((nombre_personnes_a_charge_7 - + integer_of_string("5"))))) + else: + raise EmptyError + def temp_calcul_plafond_mensualite_d842_6_base_16(_:Any): + if ((date_courante_10 >= date_of_numbers(2020,1,1)) and + ((param_33 >= date_of_numbers(2002,7,1)) and + (param_33 < + date_of_numbers(2003,7,1)))): + match_arg_427 = zone_5 + if match_arg_427.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_427.value + if (nombre_personnes_a_charge_7 == + integer_of_string("0")): + match_arg_428 = situation_familiale_calcul_apl_7 + if match_arg_428.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_428.value + return money_of_cents_string("26397") + elif match_arg_428.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_428.value + return money_of_cents_string("31812") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("1")): + return money_of_cents_string("34204") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("2")): + return money_of_cents_string("35160") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("3")): + return money_of_cents_string("36148") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("4")): + return money_of_cents_string("37119") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("5")): + return money_of_cents_string("37906") + else: + return (money_of_cents_string("37906") + + (money_of_cents_string("3301") * + decimal_of_integer((nombre_personnes_a_charge_7 - + integer_of_string("5"))))) + elif match_arg_427.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_427.value + if (nombre_personnes_a_charge_7 == + integer_of_string("0")): + match_arg_429 = situation_familiale_calcul_apl_7 + if match_arg_429.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_429.value + return money_of_cents_string("23158") + elif match_arg_429.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_429.value + return money_of_cents_string("28388") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("1")): + return money_of_cents_string("30732") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("2")): + return money_of_cents_string("31797") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("3")): + return money_of_cents_string("32892") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("4")): + return money_of_cents_string("33972") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("5")): + return money_of_cents_string("36378") + else: + return (money_of_cents_string("36378") + + (money_of_cents_string("3163") * + decimal_of_integer((nombre_personnes_a_charge_7 - + integer_of_string("5"))))) + elif match_arg_427.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_427.value + if (nombre_personnes_a_charge_7 == + integer_of_string("0")): + match_arg_430 = situation_familiale_calcul_apl_7 + if match_arg_430.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_430.value + return money_of_cents_string("21723") + elif match_arg_430.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_430.value + return money_of_cents_string("26350") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("1")): + return money_of_cents_string("28727") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("2")): + return money_of_cents_string("29915") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("3")): + return money_of_cents_string("31118") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("4")): + return money_of_cents_string("32306") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("5")): + return money_of_cents_string("34713") + else: + return (money_of_cents_string("34713") + + (money_of_cents_string("3009") * + decimal_of_integer((nombre_personnes_a_charge_7 - + integer_of_string("5"))))) + else: + raise EmptyError + def temp_calcul_plafond_mensualite_d842_6_base_17(_:Any): + if ((date_courante_10 >= date_of_numbers(2020,1,1)) and + ((param_33 >= date_of_numbers(2002,1,1)) and + (param_33 < + date_of_numbers(2002,7,1)))): + match_arg_431 = zone_5 + if match_arg_431.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_431.value + if (nombre_personnes_a_charge_7 == + integer_of_string("0")): + match_arg_432 = situation_familiale_calcul_apl_7 + if match_arg_432.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_432.value + return money_of_cents_string("26084") + elif match_arg_432.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_432.value + return money_of_cents_string("31435") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("1")): + return money_of_cents_string("33798") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("2")): + return money_of_cents_string("34743") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("3")): + return money_of_cents_string("35719") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("4")): + return money_of_cents_string("36679") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("5")): + return money_of_cents_string("37457") + else: + return (money_of_cents_string("37457") + + (money_of_cents_string("3262") * + decimal_of_integer((nombre_personnes_a_charge_7 - + integer_of_string("5"))))) + elif match_arg_431.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_431.value + if (nombre_personnes_a_charge_7 == + integer_of_string("0")): + match_arg_433 = situation_familiale_calcul_apl_7 + if match_arg_433.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_433.value + return money_of_cents_string("22883") + elif match_arg_433.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_433.value + return money_of_cents_string("28051") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("1")): + return money_of_cents_string("30368") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("2")): + return money_of_cents_string("31420") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("3")): + return money_of_cents_string("32502") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("4")): + return money_of_cents_string("33569") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("5")): + return money_of_cents_string("35947") + else: + return (money_of_cents_string("35947") + + (money_of_cents_string("3125") * + decimal_of_integer((nombre_personnes_a_charge_7 - + integer_of_string("5"))))) + elif match_arg_431.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_431.value + if (nombre_personnes_a_charge_7 == + integer_of_string("0")): + match_arg_434 = situation_familiale_calcul_apl_7 + if match_arg_434.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_434.value + return money_of_cents_string("21465") + elif match_arg_434.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_434.value + return money_of_cents_string("26038") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("1")): + return money_of_cents_string("28386") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("2")): + return money_of_cents_string("29560") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("3")): + return money_of_cents_string("30749") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("4")): + return money_of_cents_string("31923") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("5")): + return money_of_cents_string("34301") + else: + return (money_of_cents_string("34301") + + (money_of_cents_string("2973") * + decimal_of_integer((nombre_personnes_a_charge_7 - + integer_of_string("5"))))) + else: + raise EmptyError + def temp_calcul_plafond_mensualite_d842_6_base_18(_:Any): + if ((date_courante_10 >= date_of_numbers(2020,1,1)) and + ((param_33 >= date_of_numbers(2001,7,1)) and + (param_33 < + date_of_numbers(2002,1,1)))): + match_arg_435 = zone_5 + if match_arg_435.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_435.value + if (nombre_personnes_a_charge_7 == + integer_of_string("0")): + match_arg_436 = situation_familiale_calcul_apl_7 + if match_arg_436.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_436.value + temp_calcul_plafond_mensualite_d842_6_base_19 = money_of_cents_string("171100") + elif match_arg_436.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_436.value + temp_calcul_plafond_mensualite_d842_6_base_19 = money_of_cents_string("206200") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("1")): + temp_calcul_plafond_mensualite_d842_6_base_19 = money_of_cents_string("221700") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("2")): + temp_calcul_plafond_mensualite_d842_6_base_19 = money_of_cents_string("227900") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("3")): + temp_calcul_plafond_mensualite_d842_6_base_19 = money_of_cents_string("234300") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("4")): + temp_calcul_plafond_mensualite_d842_6_base_19 = money_of_cents_string("240600") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("5")): + temp_calcul_plafond_mensualite_d842_6_base_19 = money_of_cents_string("245700") + else: + temp_calcul_plafond_mensualite_d842_6_base_19 = (money_of_cents_string("245700") + + (money_of_cents_string("21400") * + decimal_of_integer((nombre_personnes_a_charge_7 - + integer_of_string("5"))))) + elif match_arg_435.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_435.value + if (nombre_personnes_a_charge_7 == + integer_of_string("0")): + match_arg_437 = situation_familiale_calcul_apl_7 + if match_arg_437.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_437.value + temp_calcul_plafond_mensualite_d842_6_base_19 = money_of_cents_string("150100") + elif match_arg_437.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_437.value + temp_calcul_plafond_mensualite_d842_6_base_19 = money_of_cents_string("184000") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("1")): + temp_calcul_plafond_mensualite_d842_6_base_19 = money_of_cents_string("199200") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("2")): + temp_calcul_plafond_mensualite_d842_6_base_19 = money_of_cents_string("206100") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("3")): + temp_calcul_plafond_mensualite_d842_6_base_19 = money_of_cents_string("213200") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("4")): + temp_calcul_plafond_mensualite_d842_6_base_19 = money_of_cents_string("220200") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("5")): + temp_calcul_plafond_mensualite_d842_6_base_19 = money_of_cents_string("235800") + else: + temp_calcul_plafond_mensualite_d842_6_base_19 = (money_of_cents_string("235800") + + (money_of_cents_string("20500") * + decimal_of_integer((nombre_personnes_a_charge_7 - + integer_of_string("5"))))) + elif match_arg_435.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_435.value + if (nombre_personnes_a_charge_7 == + integer_of_string("0")): + match_arg_438 = situation_familiale_calcul_apl_7 + if match_arg_438.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_438.value + temp_calcul_plafond_mensualite_d842_6_base_19 = money_of_cents_string("140800") + elif match_arg_438.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_438.value + temp_calcul_plafond_mensualite_d842_6_base_19 = money_of_cents_string("170800") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("1")): + temp_calcul_plafond_mensualite_d842_6_base_19 = money_of_cents_string("186200") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("2")): + temp_calcul_plafond_mensualite_d842_6_base_19 = money_of_cents_string("193900") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("3")): + temp_calcul_plafond_mensualite_d842_6_base_19 = money_of_cents_string("201700") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("4")): + temp_calcul_plafond_mensualite_d842_6_base_19 = money_of_cents_string("209400") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("5")): + temp_calcul_plafond_mensualite_d842_6_base_19 = money_of_cents_string("225000") + else: + temp_calcul_plafond_mensualite_d842_6_base_19 = (money_of_cents_string("225000") + + (money_of_cents_string("19500") * + decimal_of_integer((nombre_personnes_a_charge_7 - + integer_of_string("5"))))) + return (temp_calcul_plafond_mensualite_d842_6_base_19 * + taux_francs_vers_euros_1) + else: + raise EmptyError + def temp_calcul_plafond_mensualite_d842_6_base_20(_:Any): + if ((date_courante_10 >= date_of_numbers(2020,1,1)) and + ((param_33 >= date_of_numbers(2000,7,1)) and + (param_33 < + date_of_numbers(2001,7,1)))): + match_arg_439 = zone_5 + if match_arg_439.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_439.value + if (nombre_personnes_a_charge_7 == + integer_of_string("0")): + match_arg_440 = situation_familiale_calcul_apl_7 + if match_arg_440.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_440.value + temp_calcul_plafond_mensualite_d842_6_base_21 = money_of_cents_string("169100") + elif match_arg_440.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_440.value + temp_calcul_plafond_mensualite_d842_6_base_21 = money_of_cents_string("203800") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("1")): + temp_calcul_plafond_mensualite_d842_6_base_21 = money_of_cents_string("219100") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("2")): + temp_calcul_plafond_mensualite_d842_6_base_21 = money_of_cents_string("225200") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("3")): + temp_calcul_plafond_mensualite_d842_6_base_21 = money_of_cents_string("231500") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("4")): + temp_calcul_plafond_mensualite_d842_6_base_21 = money_of_cents_string("237700") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("5")): + temp_calcul_plafond_mensualite_d842_6_base_21 = money_of_cents_string("242800") + else: + temp_calcul_plafond_mensualite_d842_6_base_21 = (money_of_cents_string("242800") + + (money_of_cents_string("21100") * + decimal_of_integer((nombre_personnes_a_charge_7 - + integer_of_string("5"))))) + elif match_arg_439.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_439.value + if (nombre_personnes_a_charge_7 == + integer_of_string("0")): + match_arg_441 = situation_familiale_calcul_apl_7 + if match_arg_441.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_441.value + temp_calcul_plafond_mensualite_d842_6_base_21 = money_of_cents_string("148300") + elif match_arg_441.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_441.value + temp_calcul_plafond_mensualite_d842_6_base_21 = money_of_cents_string("181800") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("1")): + temp_calcul_plafond_mensualite_d842_6_base_21 = money_of_cents_string("196800") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("2")): + temp_calcul_plafond_mensualite_d842_6_base_21 = money_of_cents_string("203700") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("3")): + temp_calcul_plafond_mensualite_d842_6_base_21 = money_of_cents_string("210700") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("4")): + temp_calcul_plafond_mensualite_d842_6_base_21 = money_of_cents_string("217600") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("5")): + temp_calcul_plafond_mensualite_d842_6_base_21 = money_of_cents_string("233000") + else: + temp_calcul_plafond_mensualite_d842_6_base_21 = (money_of_cents_string("233000") + + (money_of_cents_string("20300") * + decimal_of_integer((nombre_personnes_a_charge_7 - + integer_of_string("5"))))) + elif match_arg_439.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_439.value + if (nombre_personnes_a_charge_7 == + integer_of_string("0")): + match_arg_442 = situation_familiale_calcul_apl_7 + if match_arg_442.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_442.value + temp_calcul_plafond_mensualite_d842_6_base_21 = money_of_cents_string("139100") + elif match_arg_442.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_442.value + temp_calcul_plafond_mensualite_d842_6_base_21 = money_of_cents_string("168800") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("1")): + temp_calcul_plafond_mensualite_d842_6_base_21 = money_of_cents_string("184000") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("2")): + temp_calcul_plafond_mensualite_d842_6_base_21 = money_of_cents_string("191600") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("3")): + temp_calcul_plafond_mensualite_d842_6_base_21 = money_of_cents_string("199300") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("4")): + temp_calcul_plafond_mensualite_d842_6_base_21 = money_of_cents_string("206900") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("5")): + temp_calcul_plafond_mensualite_d842_6_base_21 = money_of_cents_string("222300") + else: + temp_calcul_plafond_mensualite_d842_6_base_21 = (money_of_cents_string("222300") + + (money_of_cents_string("19300") * + decimal_of_integer((nombre_personnes_a_charge_7 - + integer_of_string("5"))))) + return (temp_calcul_plafond_mensualite_d842_6_base_21 * + taux_francs_vers_euros_1) + else: + raise EmptyError + def temp_calcul_plafond_mensualite_d842_6_base_22(_:Any): + if ((date_courante_10 >= date_of_numbers(2020,1,1)) and + ((param_33 >= date_of_numbers(1999,7,1)) and + (param_33 < + date_of_numbers(2000,7,1)))): + match_arg_443 = zone_5 + if match_arg_443.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_443.value + if (nombre_personnes_a_charge_7 == + integer_of_string("0")): + match_arg_444 = situation_familiale_calcul_apl_7 + if match_arg_444.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_444.value + temp_calcul_plafond_mensualite_d842_6_base_23 = money_of_cents_string("167400") + elif match_arg_444.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_444.value + temp_calcul_plafond_mensualite_d842_6_base_23 = money_of_cents_string("201800") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("1")): + temp_calcul_plafond_mensualite_d842_6_base_23 = money_of_cents_string("216900") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("2")): + temp_calcul_plafond_mensualite_d842_6_base_23 = money_of_cents_string("223000") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("3")): + temp_calcul_plafond_mensualite_d842_6_base_23 = money_of_cents_string("229200") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("4")): + temp_calcul_plafond_mensualite_d842_6_base_23 = money_of_cents_string("235300") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("5")): + temp_calcul_plafond_mensualite_d842_6_base_23 = money_of_cents_string("240400") + else: + temp_calcul_plafond_mensualite_d842_6_base_23 = (money_of_cents_string("240400") + + (money_of_cents_string("20900") * + decimal_of_integer((nombre_personnes_a_charge_7 - + integer_of_string("5"))))) + elif match_arg_443.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_443.value + if (nombre_personnes_a_charge_7 == + integer_of_string("0")): + match_arg_445 = situation_familiale_calcul_apl_7 + if match_arg_445.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_445.value + temp_calcul_plafond_mensualite_d842_6_base_23 = money_of_cents_string("146800") + elif match_arg_445.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_445.value + temp_calcul_plafond_mensualite_d842_6_base_23 = money_of_cents_string("180000") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("1")): + temp_calcul_plafond_mensualite_d842_6_base_23 = money_of_cents_string("194900") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("2")): + temp_calcul_plafond_mensualite_d842_6_base_23 = money_of_cents_string("201700") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("3")): + temp_calcul_plafond_mensualite_d842_6_base_23 = money_of_cents_string("208600") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("4")): + temp_calcul_plafond_mensualite_d842_6_base_23 = money_of_cents_string("215400") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("5")): + temp_calcul_plafond_mensualite_d842_6_base_23 = money_of_cents_string("230700") + else: + temp_calcul_plafond_mensualite_d842_6_base_23 = (money_of_cents_string("230700") + + (money_of_cents_string("20100") * + decimal_of_integer((nombre_personnes_a_charge_7 - + integer_of_string("5"))))) + elif match_arg_443.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_443.value + if (nombre_personnes_a_charge_7 == + integer_of_string("0")): + match_arg_446 = situation_familiale_calcul_apl_7 + if match_arg_446.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_446.value + temp_calcul_plafond_mensualite_d842_6_base_23 = money_of_cents_string("137700") + elif match_arg_446.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_446.value + temp_calcul_plafond_mensualite_d842_6_base_23 = money_of_cents_string("167100") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("1")): + temp_calcul_plafond_mensualite_d842_6_base_23 = money_of_cents_string("182200") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("2")): + temp_calcul_plafond_mensualite_d842_6_base_23 = money_of_cents_string("189700") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("3")): + temp_calcul_plafond_mensualite_d842_6_base_23 = money_of_cents_string("197300") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("4")): + temp_calcul_plafond_mensualite_d842_6_base_23 = money_of_cents_string("204900") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("5")): + temp_calcul_plafond_mensualite_d842_6_base_23 = money_of_cents_string("220100") + else: + temp_calcul_plafond_mensualite_d842_6_base_23 = (money_of_cents_string("220100") + + (money_of_cents_string("19100") * + decimal_of_integer((nombre_personnes_a_charge_7 - + integer_of_string("5"))))) + return (temp_calcul_plafond_mensualite_d842_6_base_23 * + taux_francs_vers_euros_1) + else: + raise EmptyError + def temp_calcul_plafond_mensualite_d842_6_base_24(_:Any): + if ((date_courante_10 >= date_of_numbers(2020,1,1)) and + ((param_33 >= date_of_numbers(1998,7,1)) and + (param_33 < + date_of_numbers(1999,7,1)))): + match_arg_447 = zone_5 + if match_arg_447.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_447.value + if (nombre_personnes_a_charge_7 == + integer_of_string("0")): + match_arg_448 = situation_familiale_calcul_apl_7 + if match_arg_448.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_448.value + temp_calcul_plafond_mensualite_d842_6_base_25 = money_of_cents_string("167200") + elif match_arg_448.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_448.value + temp_calcul_plafond_mensualite_d842_6_base_25 = money_of_cents_string("201600") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("1")): + temp_calcul_plafond_mensualite_d842_6_base_25 = money_of_cents_string("216700") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("2")): + temp_calcul_plafond_mensualite_d842_6_base_25 = money_of_cents_string("222800") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("3")): + temp_calcul_plafond_mensualite_d842_6_base_25 = money_of_cents_string("229000") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("4")): + temp_calcul_plafond_mensualite_d842_6_base_25 = money_of_cents_string("235100") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("5")): + temp_calcul_plafond_mensualite_d842_6_base_25 = money_of_cents_string("240200") + else: + temp_calcul_plafond_mensualite_d842_6_base_25 = (money_of_cents_string("240200") + + (money_of_cents_string("20900") * + decimal_of_integer((nombre_personnes_a_charge_7 - + integer_of_string("5"))))) + elif match_arg_447.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_447.value + if (nombre_personnes_a_charge_7 == + integer_of_string("0")): + match_arg_449 = situation_familiale_calcul_apl_7 + if match_arg_449.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_449.value + temp_calcul_plafond_mensualite_d842_6_base_25 = money_of_cents_string("146700") + elif match_arg_449.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_449.value + temp_calcul_plafond_mensualite_d842_6_base_25 = money_of_cents_string("179800") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("1")): + temp_calcul_plafond_mensualite_d842_6_base_25 = money_of_cents_string("194700") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("2")): + temp_calcul_plafond_mensualite_d842_6_base_25 = money_of_cents_string("201500") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("3")): + temp_calcul_plafond_mensualite_d842_6_base_25 = money_of_cents_string("208400") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("4")): + temp_calcul_plafond_mensualite_d842_6_base_25 = money_of_cents_string("215200") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("5")): + temp_calcul_plafond_mensualite_d842_6_base_25 = money_of_cents_string("230500") + else: + temp_calcul_plafond_mensualite_d842_6_base_25 = (money_of_cents_string("230500") + + (money_of_cents_string("20100") * + decimal_of_integer((nombre_personnes_a_charge_7 - + integer_of_string("5"))))) + elif match_arg_447.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_447.value + if (nombre_personnes_a_charge_7 == + integer_of_string("0")): + match_arg_450 = situation_familiale_calcul_apl_7 + if match_arg_450.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_450.value + temp_calcul_plafond_mensualite_d842_6_base_25 = money_of_cents_string("137600") + elif match_arg_450.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_450.value + temp_calcul_plafond_mensualite_d842_6_base_25 = money_of_cents_string("166900") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("1")): + temp_calcul_plafond_mensualite_d842_6_base_25 = money_of_cents_string("182000") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("2")): + temp_calcul_plafond_mensualite_d842_6_base_25 = money_of_cents_string("189500") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("3")): + temp_calcul_plafond_mensualite_d842_6_base_25 = money_of_cents_string("197100") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("4")): + temp_calcul_plafond_mensualite_d842_6_base_25 = money_of_cents_string("204700") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("5")): + temp_calcul_plafond_mensualite_d842_6_base_25 = money_of_cents_string("219900") + else: + temp_calcul_plafond_mensualite_d842_6_base_25 = (money_of_cents_string("219900") + + (money_of_cents_string("19100") * + decimal_of_integer((nombre_personnes_a_charge_7 - + integer_of_string("5"))))) + return (temp_calcul_plafond_mensualite_d842_6_base_25 * + taux_francs_vers_euros_1) + else: + raise EmptyError + def temp_calcul_plafond_mensualite_d842_6_base_26(_:Any): + if ((date_courante_10 >= date_of_numbers(2020,1,1)) and + ((param_33 >= date_of_numbers(1997,7,1)) and + (param_33 < + date_of_numbers(1998,7,1)))): + match_arg_451 = zone_5 + if match_arg_451.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_451.value + if (nombre_personnes_a_charge_7 == + integer_of_string("0")): + match_arg_452 = situation_familiale_calcul_apl_7 + if match_arg_452.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_452.value + temp_calcul_plafond_mensualite_d842_6_base_27 = money_of_cents_string("163300") + elif match_arg_452.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_452.value + temp_calcul_plafond_mensualite_d842_6_base_27 = money_of_cents_string("196900") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("1")): + temp_calcul_plafond_mensualite_d842_6_base_27 = money_of_cents_string("211600") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("2")): + temp_calcul_plafond_mensualite_d842_6_base_27 = money_of_cents_string("217600") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("3")): + temp_calcul_plafond_mensualite_d842_6_base_27 = money_of_cents_string("223600") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("4")): + temp_calcul_plafond_mensualite_d842_6_base_27 = money_of_cents_string("229600") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("5")): + temp_calcul_plafond_mensualite_d842_6_base_27 = money_of_cents_string("234600") + else: + temp_calcul_plafond_mensualite_d842_6_base_27 = (money_of_cents_string("234600") + + (money_of_cents_string("20400") * + decimal_of_integer((nombre_personnes_a_charge_7 - + integer_of_string("5"))))) + elif match_arg_451.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_451.value + if (nombre_personnes_a_charge_7 == + integer_of_string("0")): + match_arg_453 = situation_familiale_calcul_apl_7 + if match_arg_453.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_453.value + temp_calcul_plafond_mensualite_d842_6_base_27 = money_of_cents_string("143300") + elif match_arg_453.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_453.value + temp_calcul_plafond_mensualite_d842_6_base_27 = money_of_cents_string("175600") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("1")): + temp_calcul_plafond_mensualite_d842_6_base_27 = money_of_cents_string("190100") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("2")): + temp_calcul_plafond_mensualite_d842_6_base_27 = money_of_cents_string("196600") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("3")): + temp_calcul_plafond_mensualite_d842_6_base_27 = money_of_cents_string("203500") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("4")): + temp_calcul_plafond_mensualite_d842_6_base_27 = money_of_cents_string("210200") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("5")): + temp_calcul_plafond_mensualite_d842_6_base_27 = money_of_cents_string("225100") + else: + temp_calcul_plafond_mensualite_d842_6_base_27 = (money_of_cents_string("225100") + + (money_of_cents_string("19600") * + decimal_of_integer((nombre_personnes_a_charge_7 - + integer_of_string("5"))))) + elif match_arg_451.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_451.value + if (nombre_personnes_a_charge_7 == + integer_of_string("0")): + match_arg_454 = situation_familiale_calcul_apl_7 + if match_arg_454.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_454.value + temp_calcul_plafond_mensualite_d842_6_base_27 = money_of_cents_string("134400") + elif match_arg_454.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_454.value + temp_calcul_plafond_mensualite_d842_6_base_27 = money_of_cents_string("163000") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("1")): + temp_calcul_plafond_mensualite_d842_6_base_27 = money_of_cents_string("177700") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("2")): + temp_calcul_plafond_mensualite_d842_6_base_27 = money_of_cents_string("185100") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("3")): + temp_calcul_plafond_mensualite_d842_6_base_27 = money_of_cents_string("192500") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("4")): + temp_calcul_plafond_mensualite_d842_6_base_27 = money_of_cents_string("199900") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("5")): + temp_calcul_plafond_mensualite_d842_6_base_27 = money_of_cents_string("214700") + else: + temp_calcul_plafond_mensualite_d842_6_base_27 = (money_of_cents_string("214700") + + (money_of_cents_string("18700") * + decimal_of_integer((nombre_personnes_a_charge_7 - + integer_of_string("5"))))) + return (temp_calcul_plafond_mensualite_d842_6_base_27 * + taux_francs_vers_euros_1) + else: + raise EmptyError + def temp_calcul_plafond_mensualite_d842_6_base_28(_:Any): + if ((date_courante_10 >= date_of_numbers(2020,1,1)) and + ((param_33 >= date_of_numbers(1994,7,1)) and + (param_33 < + date_of_numbers(1997,7,1)))): + match_arg_455 = zone_5 + if match_arg_455.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_455.value + if (nombre_personnes_a_charge_7 == + integer_of_string("0")): + match_arg_456 = situation_familiale_calcul_apl_7 + if match_arg_456.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_456.value + temp_calcul_plafond_mensualite_d842_6_base_29 = money_of_cents_string("160400") + elif match_arg_456.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_456.value + temp_calcul_plafond_mensualite_d842_6_base_29 = money_of_cents_string("193400") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("1")): + temp_calcul_plafond_mensualite_d842_6_base_29 = money_of_cents_string("207800") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("2")): + temp_calcul_plafond_mensualite_d842_6_base_29 = money_of_cents_string("213700") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("3")): + temp_calcul_plafond_mensualite_d842_6_base_29 = money_of_cents_string("219600") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("4")): + temp_calcul_plafond_mensualite_d842_6_base_29 = money_of_cents_string("225500") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("5")): + temp_calcul_plafond_mensualite_d842_6_base_29 = money_of_cents_string("230500") + else: + temp_calcul_plafond_mensualite_d842_6_base_29 = (money_of_cents_string("230500") + + (money_of_cents_string("20000") * + decimal_of_integer((nombre_personnes_a_charge_7 - + integer_of_string("5"))))) + elif match_arg_455.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_455.value + if (nombre_personnes_a_charge_7 == + integer_of_string("0")): + match_arg_457 = situation_familiale_calcul_apl_7 + if match_arg_457.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_457.value + temp_calcul_plafond_mensualite_d842_6_base_29 = money_of_cents_string("140800") + elif match_arg_457.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_457.value + temp_calcul_plafond_mensualite_d842_6_base_29 = money_of_cents_string("172500") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("1")): + temp_calcul_plafond_mensualite_d842_6_base_29 = money_of_cents_string("186700") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("2")): + temp_calcul_plafond_mensualite_d842_6_base_29 = money_of_cents_string("193300") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("3")): + temp_calcul_plafond_mensualite_d842_6_base_29 = money_of_cents_string("199900") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("4")): + temp_calcul_plafond_mensualite_d842_6_base_29 = money_of_cents_string("206500") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("5")): + temp_calcul_plafond_mensualite_d842_6_base_29 = money_of_cents_string("221100") + else: + temp_calcul_plafond_mensualite_d842_6_base_29 = (money_of_cents_string("221100") + + (money_of_cents_string("19300") * + decimal_of_integer((nombre_personnes_a_charge_7 - + integer_of_string("5"))))) + elif match_arg_455.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_455.value + if (nombre_personnes_a_charge_7 == + integer_of_string("0")): + match_arg_458 = situation_familiale_calcul_apl_7 + if match_arg_458.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_458.value + temp_calcul_plafond_mensualite_d842_6_base_29 = money_of_cents_string("132000") + elif match_arg_458.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_458.value + temp_calcul_plafond_mensualite_d842_6_base_29 = money_of_cents_string("180100") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("1")): + temp_calcul_plafond_mensualite_d842_6_base_29 = money_of_cents_string("174500") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("2")): + temp_calcul_plafond_mensualite_d842_6_base_29 = money_of_cents_string("181800") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("3")): + temp_calcul_plafond_mensualite_d842_6_base_29 = money_of_cents_string("189100") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("4")): + temp_calcul_plafond_mensualite_d842_6_base_29 = money_of_cents_string("194200") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("5")): + temp_calcul_plafond_mensualite_d842_6_base_29 = money_of_cents_string("210900") + else: + temp_calcul_plafond_mensualite_d842_6_base_29 = (money_of_cents_string("210900") + + (money_of_cents_string("18400") * + decimal_of_integer((nombre_personnes_a_charge_7 - + integer_of_string("5"))))) + return (temp_calcul_plafond_mensualite_d842_6_base_29 * + taux_francs_vers_euros_1) + else: + raise EmptyError + def temp_calcul_plafond_mensualite_d842_6_base_30(_:Any): + if ((date_courante_10 >= date_of_numbers(2020,1,1)) and + ((param_33 >= date_of_numbers(1992,7,1)) and + (param_33 < + date_of_numbers(1994,7,1)))): + match_arg_459 = zone_5 + if match_arg_459.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_459.value + if (nombre_personnes_a_charge_7 == + integer_of_string("0")): + match_arg_460 = situation_familiale_calcul_apl_7 + if match_arg_460.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_460.value + temp_calcul_plafond_mensualite_d842_6_base_31 = money_of_cents_string("158700") + elif match_arg_460.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_460.value + temp_calcul_plafond_mensualite_d842_6_base_31 = money_of_cents_string("191300") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("1")): + temp_calcul_plafond_mensualite_d842_6_base_31 = money_of_cents_string("205500") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("2")): + temp_calcul_plafond_mensualite_d842_6_base_31 = money_of_cents_string("211300") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("3")): + temp_calcul_plafond_mensualite_d842_6_base_31 = money_of_cents_string("217100") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("4")): + temp_calcul_plafond_mensualite_d842_6_base_31 = money_of_cents_string("222900") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("5")): + temp_calcul_plafond_mensualite_d842_6_base_31 = money_of_cents_string("228000") + else: + temp_calcul_plafond_mensualite_d842_6_base_31 = (money_of_cents_string("228000") + + (money_of_cents_string("19800") * + decimal_of_integer((nombre_personnes_a_charge_7 - + integer_of_string("5"))))) + elif match_arg_459.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_459.value + if (nombre_personnes_a_charge_7 == + integer_of_string("0")): + match_arg_461 = situation_familiale_calcul_apl_7 + if match_arg_461.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_461.value + temp_calcul_plafond_mensualite_d842_6_base_31 = money_of_cents_string("139300") + elif match_arg_461.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_461.value + temp_calcul_plafond_mensualite_d842_6_base_31 = money_of_cents_string("170600") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("1")): + temp_calcul_plafond_mensualite_d842_6_base_31 = money_of_cents_string("184700") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("2")): + temp_calcul_plafond_mensualite_d842_6_base_31 = money_of_cents_string("191200") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("3")): + temp_calcul_plafond_mensualite_d842_6_base_31 = money_of_cents_string("197700") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("4")): + temp_calcul_plafond_mensualite_d842_6_base_31 = money_of_cents_string("204200") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("5")): + temp_calcul_plafond_mensualite_d842_6_base_31 = money_of_cents_string("218700") + else: + temp_calcul_plafond_mensualite_d842_6_base_31 = (money_of_cents_string("218700") + + (money_of_cents_string("19100") * + decimal_of_integer((nombre_personnes_a_charge_7 - + integer_of_string("5"))))) + elif match_arg_459.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_459.value + if (nombre_personnes_a_charge_7 == + integer_of_string("0")): + match_arg_462 = situation_familiale_calcul_apl_7 + if match_arg_462.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_462.value + temp_calcul_plafond_mensualite_d842_6_base_31 = money_of_cents_string("130600") + elif match_arg_462.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_462.value + temp_calcul_plafond_mensualite_d842_6_base_31 = money_of_cents_string("158400") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("1")): + temp_calcul_plafond_mensualite_d842_6_base_31 = money_of_cents_string("172600") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("2")): + temp_calcul_plafond_mensualite_d842_6_base_31 = money_of_cents_string("179800") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("3")): + temp_calcul_plafond_mensualite_d842_6_base_31 = money_of_cents_string("187000") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("4")): + temp_calcul_plafond_mensualite_d842_6_base_31 = money_of_cents_string("194200") + else: + if (nombre_personnes_a_charge_7 == + integer_of_string("5")): + temp_calcul_plafond_mensualite_d842_6_base_31 = money_of_cents_string("208600") + else: + temp_calcul_plafond_mensualite_d842_6_base_31 = (money_of_cents_string("208600") + + (money_of_cents_string("18200") * + decimal_of_integer((nombre_personnes_a_charge_7 - + integer_of_string("5"))))) + return (temp_calcul_plafond_mensualite_d842_6_base_31 * + taux_francs_vers_euros_1) + else: + raise EmptyError + return handle_default(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=877, start_column=10, + end_line=877, end_column=14, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"]), [temp_calcul_plafond_mensualite_d842_6_base_30, + temp_calcul_plafond_mensualite_d842_6_base_28, + temp_calcul_plafond_mensualite_d842_6_base_26, + temp_calcul_plafond_mensualite_d842_6_base_24, + temp_calcul_plafond_mensualite_d842_6_base_22, + temp_calcul_plafond_mensualite_d842_6_base_20, + temp_calcul_plafond_mensualite_d842_6_base_18, + temp_calcul_plafond_mensualite_d842_6_base_17, + temp_calcul_plafond_mensualite_d842_6_base_16, + temp_calcul_plafond_mensualite_d842_6_base_15, + temp_calcul_plafond_mensualite_d842_6_base_14, + temp_calcul_plafond_mensualite_d842_6_base_13, + temp_calcul_plafond_mensualite_d842_6_base_12, + temp_calcul_plafond_mensualite_d842_6_base_11, + temp_calcul_plafond_mensualite_d842_6_base_10, + temp_calcul_plafond_mensualite_d842_6_base_9, + temp_calcul_plafond_mensualite_d842_6_base_8, + temp_calcul_plafond_mensualite_d842_6_base_7, + temp_calcul_plafond_mensualite_d842_6_base_6, + temp_calcul_plafond_mensualite_d842_6_base_5, + temp_calcul_plafond_mensualite_d842_6_base_4, + temp_calcul_plafond_mensualite_d842_6_base_3], + temp_calcul_plafond_mensualite_d842_6_base_2, + temp_calcul_plafond_mensualite_d842_6_base_1) + except EmptyError: + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=877, + start_column=10, + end_line=877, + end_column=14, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + except EmptyError: + temp_calcul_plafond_mensualite_d842_6_base = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=877, start_column=10, + end_line=877, end_column=14, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + calcul_plafond_mensualite_d842_6_base = temp_calcul_plafond_mensualite_d842_6_base + try: + def temp_seuil_minimal_ressources_menage(_:Any): + raise EmptyError + def temp_seuil_minimal_ressources_menage_1(_:Any): + return False + def temp_seuil_minimal_ressources_menage_2(_:Any): + match_arg_463 = type_travaux_logement_1 + if match_arg_463.code == TypeTravauxLogementR8425_Code.ObjectifDecenceLogement: + _ = match_arg_463.value + temp_seuil_minimal_ressources_menage_3 = False + elif match_arg_463.code == TypeTravauxLogementR8425_Code.PrevuDansListeR321_15: + _ = match_arg_463.value + temp_seuil_minimal_ressources_menage_3 = True + elif match_arg_463.code == TypeTravauxLogementR8425_Code.AgrandirOuRendreHabitableD331_63: + _ = match_arg_463.value + temp_seuil_minimal_ressources_menage_3 = False + elif match_arg_463.code == TypeTravauxLogementR8425_Code.PasDeTravaux: + _ = match_arg_463.value + temp_seuil_minimal_ressources_menage_3 = False + if ((date_signature_pret_1 >= date_of_numbers(1994,9,30)) and + temp_seuil_minimal_ressources_menage_3): + return montant_forfaitaire_d842_12 + else: + raise EmptyError + def temp_seuil_minimal_ressources_menage_4(_:Any): + match_arg_464 = type_travaux_logement_1 + if match_arg_464.code == TypeTravauxLogementR8425_Code.ObjectifDecenceLogement: + _ = match_arg_464.value + temp_seuil_minimal_ressources_menage_5 = False + elif match_arg_464.code == TypeTravauxLogementR8425_Code.PrevuDansListeR321_15: + _ = match_arg_464.value + temp_seuil_minimal_ressources_menage_5 = False + elif match_arg_464.code == TypeTravauxLogementR8425_Code.AgrandirOuRendreHabitableD331_63: + _ = match_arg_464.value + temp_seuil_minimal_ressources_menage_5 = True + elif match_arg_464.code == TypeTravauxLogementR8425_Code.PasDeTravaux: + _ = match_arg_464.value + temp_seuil_minimal_ressources_menage_5 = False + match_arg_465 = type_travaux_logement_1 + if match_arg_465.code == TypeTravauxLogementR8425_Code.ObjectifDecenceLogement: + _ = match_arg_465.value + temp_seuil_minimal_ressources_menage_6 = True + elif match_arg_465.code == TypeTravauxLogementR8425_Code.PrevuDansListeR321_15: + _ = match_arg_465.value + temp_seuil_minimal_ressources_menage_6 = False + elif match_arg_465.code == TypeTravauxLogementR8425_Code.AgrandirOuRendreHabitableD331_63: + _ = match_arg_465.value + temp_seuil_minimal_ressources_menage_6 = False + elif match_arg_465.code == TypeTravauxLogementR8425_Code.PasDeTravaux: + _ = match_arg_465.value + temp_seuil_minimal_ressources_menage_6 = False + match_arg_466 = type_travaux_logement_1 + if match_arg_466.code == TypeTravauxLogementR8425_Code.ObjectifDecenceLogement: + _ = match_arg_466.value + temp_seuil_minimal_ressources_menage_7 = False + elif match_arg_466.code == TypeTravauxLogementR8425_Code.PrevuDansListeR321_15: + _ = match_arg_466.value + temp_seuil_minimal_ressources_menage_7 = False + elif match_arg_466.code == TypeTravauxLogementR8425_Code.AgrandirOuRendreHabitableD331_63: + _ = match_arg_466.value + temp_seuil_minimal_ressources_menage_7 = False + elif match_arg_466.code == TypeTravauxLogementR8425_Code.PasDeTravaux: + _ = match_arg_466.value + temp_seuil_minimal_ressources_menage_7 = True + if (((date_signature_pret_1 >= date_of_numbers(1992,9,30)) and + (date_signature_pret_1 >= date_of_numbers(1994,9,30))) or + ((date_signature_pret_1 >= date_of_numbers(1994,9,30)) and + (temp_seuil_minimal_ressources_menage_7 or + (temp_seuil_minimal_ressources_menage_6 or + temp_seuil_minimal_ressources_menage_5)))): + return (mensualite_principale_1 * coefficient_d842_12) + else: + raise EmptyError + temp_seuil_minimal_ressources_menage_8 = handle_default(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=881, + start_column=11, + end_line=881, end_column=42, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"]), [temp_seuil_minimal_ressources_menage_4, + temp_seuil_minimal_ressources_menage_2], + temp_seuil_minimal_ressources_menage_1, + temp_seuil_minimal_ressources_menage) + except EmptyError: + temp_seuil_minimal_ressources_menage_8 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=881, start_column=11, + end_line=881, end_column=42, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + seuil_minimal_ressources_menage = temp_seuil_minimal_ressources_menage_8 + try: + def temp_depense_nette_minimale_1(param_34:Money): + try: + return ((charges_mensuelles_pret + + montant_forfaitaire_charges_1) - param_34) + except EmptyError: + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=883, + start_column=11, + end_line=883, + end_column=33, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + except EmptyError: + temp_depense_nette_minimale_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=883, start_column=11, + end_line=883, end_column=33, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + depense_nette_minimale_1 = temp_depense_nette_minimale_1 + try: + def temp_calcul_plafond_mensualite_d842_6_avec_copropriete(param_35:Date): + try: + try: + if (date_courante_10 >= + date_of_numbers(2021,10,1)): + if copropriete_1: + return (calcul_plafond_mensualite_d842_6_base( + param_35) * decimal_of_string("0.75")) + else: + return calcul_plafond_mensualite_d842_6_base( + param_35) + else: + raise EmptyError + except EmptyError: + if (date_courante_10 >= + date_of_numbers(2020,1,1)): + return calcul_plafond_mensualite_d842_6_base( + param_35) + else: + raise EmptyError + except EmptyError: + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=878, + start_column=10, + end_line=878, + end_column=26, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + except EmptyError: + temp_calcul_plafond_mensualite_d842_6_avec_copropriete = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=878, start_column=10, + end_line=878, end_column=26, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + calcul_plafond_mensualite_d842_6_avec_copropriete = temp_calcul_plafond_mensualite_d842_6_avec_copropriete + try: + try: + if situation_r822_11_13_17_1: + temp_ressources_menage_arrondies_seuil_1 = ressources_menage_arrondies_base_1 + else: + temp_ressources_menage_arrondies_seuil_1 = dead_value + raise EmptyError + except EmptyError: + if (ressources_menage_arrondies_base_1 <= + seuil_minimal_ressources_menage): + temp_ressources_menage_arrondies_seuil_1 = (money_round(((seuil_minimal_ressources_menage + + money_of_cents_string("4999")) * + decimal_of_string("0.01"))) * decimal_of_string("100.")) + else: + temp_ressources_menage_arrondies_seuil_1 = ressources_menage_arrondies_base_1 + except EmptyError: + temp_ressources_menage_arrondies_seuil_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=857, start_column=10, + end_line=857, end_column=15, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + ressources_menage_arrondies_seuil_1 = temp_ressources_menage_arrondies_seuil_1 + try: + try: + if local_habite_premiere_fois_beneficiaire_1: + if (calcul_plafond_mensualite_d842_6_avec_copropriete( + date_signature_pret_1) < + calcul_plafond_mensualite_d842_6_avec_copropriete( + date_entree_logement_1)): + temp_plafond_mensualite_d842_6 = calcul_plafond_mensualite_d842_6_avec_copropriete( + date_entree_logement_1) + else: + temp_plafond_mensualite_d842_6 = calcul_plafond_mensualite_d842_6_avec_copropriete( + date_signature_pret_1) + else: + temp_plafond_mensualite_d842_6 = dead_value + raise EmptyError + except EmptyError: + temp_plafond_mensualite_d842_6 = calcul_plafond_mensualite_d842_6_avec_copropriete( + date_signature_pret_1) + except EmptyError: + temp_plafond_mensualite_d842_6 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=875, start_column=11, + end_line=875, end_column=36, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + plafond_mensualite_d842_6 = temp_plafond_mensualite_d842_6 + try: + temp_calcul_equivalence_loyer_minimale_dot_ressources_menage_arrondies_3 = ressources_menage_arrondies_seuil_1 + except EmptyError: + temp_calcul_equivalence_loyer_minimale_dot_ressources_menage_arrondies_3 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=613, start_column=10, + end_line=613, end_column=37, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + calcul_equivalence_loyer_minimale_dot_ressources_menage_arrondies_3 = temp_calcul_equivalence_loyer_minimale_dot_ressources_menage_arrondies_3 + try: + temp_calcul_equivalence_loyer_minimale_dot_condition_2_du_832_25_3 = True + except EmptyError: + temp_calcul_equivalence_loyer_minimale_dot_condition_2_du_832_25_3 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=614, start_column=10, + end_line=614, end_column=31, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + calcul_equivalence_loyer_minimale_dot_condition_2_du_832_25_3 = temp_calcul_equivalence_loyer_minimale_dot_condition_2_du_832_25_3 + try: + temp_calcul_equivalence_loyer_minimale_dot_n_nombre_parts_d832_25_3 = calcul_nombre_parts_dot_n_nombre_parts_d832_11_1 + except EmptyError: + temp_calcul_equivalence_loyer_minimale_dot_n_nombre_parts_d832_25_3 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=615, start_column=10, + end_line=615, end_column=32, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + calcul_equivalence_loyer_minimale_dot_n_nombre_parts_d832_25_3 = temp_calcul_equivalence_loyer_minimale_dot_n_nombre_parts_d832_25_3 + result_17 = calcul_equivalence_loyer_minimale(CalculEquivalenceLoyerMinimaleIn(ressources_menage_arrondies_in = calcul_equivalence_loyer_minimale_dot_ressources_menage_arrondies_3, + condition_2_du_832_25_in = calcul_equivalence_loyer_minimale_dot_condition_2_du_832_25_3, + n_nombre_parts_d832_25_in = calcul_equivalence_loyer_minimale_dot_n_nombre_parts_d832_25_3)) + calcul_equivalence_loyer_minimale_dot_montant_3 = result_17.montant_out + try: + temp_calcul_apl_logement_foyer_dot_mode_occupation_1 = ModeOccupation(ModeOccupation_Code.ResidentLogementFoyer, + LogementFoyer(type = TypeLogementFoyer(TypeLogementFoyer_Code.ResidenceSociale, + Unit()), date_conventionnement = date_of_numbers(2022,1,1), + location = Location(bailleur = Bailleur(type_bailleur = TypeBailleur(TypeBailleur_Code.BailleurSocial, + Unit()), respecte_convention_titre_V = True, + respecte_convention_titre_II = True, + construit_ameliore_conditions_l831_1_4 = True, + acquisition_aides_etat_pret_titre_II_ou_livre_III = True)), + remplit_conditions_r832_21 = False, + construit_application_loi_1957_12_III = False)) + except EmptyError: + temp_calcul_apl_logement_foyer_dot_mode_occupation_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=632, start_column=10, + end_line=632, end_column=25, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + calcul_apl_logement_foyer_dot_mode_occupation_1 = temp_calcul_apl_logement_foyer_dot_mode_occupation_1 + try: + temp_calcul_apl_logement_foyer_dot_ressources_menage_arrondies_1 = ressources_menage_arrondies_seuil_1 + except EmptyError: + temp_calcul_apl_logement_foyer_dot_ressources_menage_arrondies_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=633, start_column=10, + end_line=633, end_column=37, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + calcul_apl_logement_foyer_dot_ressources_menage_arrondies_1 = temp_calcul_apl_logement_foyer_dot_ressources_menage_arrondies_1 + try: + temp_calcul_apl_logement_foyer_dot_nombre_personnes_a_charge_1 = nombre_personnes_a_charge_7 + except EmptyError: + temp_calcul_apl_logement_foyer_dot_nombre_personnes_a_charge_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=634, start_column=10, + end_line=634, end_column=35, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + calcul_apl_logement_foyer_dot_nombre_personnes_a_charge_1 = temp_calcul_apl_logement_foyer_dot_nombre_personnes_a_charge_1 + try: + temp_calcul_apl_logement_foyer_dot_situation_familiale_calcul_apl_1 = situation_familiale_calcul_apl_7 + except EmptyError: + temp_calcul_apl_logement_foyer_dot_situation_familiale_calcul_apl_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=635, start_column=10, + end_line=635, end_column=40, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + calcul_apl_logement_foyer_dot_situation_familiale_calcul_apl_1 = temp_calcul_apl_logement_foyer_dot_situation_familiale_calcul_apl_1 + try: + temp_calcul_apl_logement_foyer_dot_zone_1 = zone_5 + except EmptyError: + temp_calcul_apl_logement_foyer_dot_zone_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=636, start_column=10, + end_line=636, end_column=14, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + calcul_apl_logement_foyer_dot_zone_1 = temp_calcul_apl_logement_foyer_dot_zone_1 + try: + temp_calcul_apl_logement_foyer_dot_date_courante_1 = date_courante_10 + except EmptyError: + temp_calcul_apl_logement_foyer_dot_date_courante_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=637, start_column=10, + end_line=637, end_column=23, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + calcul_apl_logement_foyer_dot_date_courante_1 = temp_calcul_apl_logement_foyer_dot_date_courante_1 + try: + temp_calcul_apl_logement_foyer_dot_redevance_1 = money_of_cents_string("0") + except EmptyError: + temp_calcul_apl_logement_foyer_dot_redevance_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=638, start_column=10, + end_line=638, end_column=19, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + calcul_apl_logement_foyer_dot_redevance_1 = temp_calcul_apl_logement_foyer_dot_redevance_1 + def temp_calcul_apl_logement_foyer_dot_condition_2_du_832_25_1(_:Unit): + return True + calcul_apl_logement_foyer_dot_condition_2_du_832_25_1 = temp_calcul_apl_logement_foyer_dot_condition_2_du_832_25_1 + def temp_calcul_apl_logement_foyer_dot_n_nombre_parts_d832_25_2(_:Unit): + return calcul_nombre_parts_dot_n_nombre_parts_d832_11_1 + calcul_apl_logement_foyer_dot_n_nombre_parts_d832_25_2 = temp_calcul_apl_logement_foyer_dot_n_nombre_parts_d832_25_2 + result_18 = calcul_aide_personnalisee_logement_foyer(CalculAidePersonnaliseeLogementFoyerIn(mode_occupation_in = calcul_apl_logement_foyer_dot_mode_occupation_1, + ressources_menage_arrondies_in = calcul_apl_logement_foyer_dot_ressources_menage_arrondies_1, + nombre_personnes_a_charge_in = calcul_apl_logement_foyer_dot_nombre_personnes_a_charge_1, + situation_familiale_calcul_apl_in = calcul_apl_logement_foyer_dot_situation_familiale_calcul_apl_1, + zone_in = calcul_apl_logement_foyer_dot_zone_1, + date_courante_in = calcul_apl_logement_foyer_dot_date_courante_1, + redevance_in = calcul_apl_logement_foyer_dot_redevance_1, + condition_2_du_832_25_in = calcul_apl_logement_foyer_dot_condition_2_du_832_25_1, + n_nombre_parts_d832_25_in = calcul_apl_logement_foyer_dot_n_nombre_parts_d832_25_2)) + calcul_apl_logement_foyer_dot_coefficient_multiplicateur_d832_25_1 = result_18.coefficient_multiplicateur_d832_25_out + calcul_apl_logement_foyer_dot_coefficient_r_d832_25_1 = result_18.coefficient_r_d832_25_out + calcul_apl_logement_foyer_dot_n_nombre_parts_d832_25_3 = result_18.n_nombre_parts_d832_25_out + calcul_apl_logement_foyer_dot_equivalence_loyer_eligible_1 = result_18.equivalence_loyer_eligible_out + calcul_apl_logement_foyer_dot_plafond_equivalence_loyer_eligible_1 = result_18.plafond_equivalence_loyer_eligible_out + calcul_apl_logement_foyer_dot_equivalence_loyer_minimale_1 = result_18.equivalence_loyer_minimale_out + calcul_apl_logement_foyer_dot_coefficient_prise_en_charge_d832_25_seuil_1 = result_18.coefficient_prise_en_charge_d832_25_seuil_out + calcul_apl_logement_foyer_dot_aide_finale_formule_1 = result_18.aide_finale_formule_out + calcul_apl_logement_foyer_dot_traitement_aide_finale_montant_minimal_1 = result_18.traitement_aide_finale_montant_minimal_out + try: + try: + match_arg_467 = type_travaux_logement_1 + if match_arg_467.code == TypeTravauxLogementR8425_Code.ObjectifDecenceLogement: + _ = match_arg_467.value + temp_seuil_minimal_depense_nette_minimale = False + elif match_arg_467.code == TypeTravauxLogementR8425_Code.PrevuDansListeR321_15: + _ = match_arg_467.value + temp_seuil_minimal_depense_nette_minimale = False + elif match_arg_467.code == TypeTravauxLogementR8425_Code.AgrandirOuRendreHabitableD331_63: + _ = match_arg_467.value + temp_seuil_minimal_depense_nette_minimale = True + elif match_arg_467.code == TypeTravauxLogementR8425_Code.PasDeTravaux: + _ = match_arg_467.value + temp_seuil_minimal_depense_nette_minimale = False + match_arg_468 = type_travaux_logement_1 + if match_arg_468.code == TypeTravauxLogementR8425_Code.ObjectifDecenceLogement: + _ = match_arg_468.value + temp_seuil_minimal_depense_nette_minimale_1 = True + elif match_arg_468.code == TypeTravauxLogementR8425_Code.PrevuDansListeR321_15: + _ = match_arg_468.value + temp_seuil_minimal_depense_nette_minimale_1 = False + elif match_arg_468.code == TypeTravauxLogementR8425_Code.AgrandirOuRendreHabitableD331_63: + _ = match_arg_468.value + temp_seuil_minimal_depense_nette_minimale_1 = False + elif match_arg_468.code == TypeTravauxLogementR8425_Code.PasDeTravaux: + _ = match_arg_468.value + temp_seuil_minimal_depense_nette_minimale_1 = False + match_arg_469 = type_travaux_logement_1 + if match_arg_469.code == TypeTravauxLogementR8425_Code.ObjectifDecenceLogement: + _ = match_arg_469.value + temp_seuil_minimal_depense_nette_minimale_2 = False + elif match_arg_469.code == TypeTravauxLogementR8425_Code.PrevuDansListeR321_15: + _ = match_arg_469.value + temp_seuil_minimal_depense_nette_minimale_2 = False + elif match_arg_469.code == TypeTravauxLogementR8425_Code.AgrandirOuRendreHabitableD331_63: + _ = match_arg_469.value + temp_seuil_minimal_depense_nette_minimale_2 = False + elif match_arg_469.code == TypeTravauxLogementR8425_Code.PasDeTravaux: + _ = match_arg_469.value + temp_seuil_minimal_depense_nette_minimale_2 = True + if ((temp_seuil_minimal_depense_nette_minimale_2 or + (temp_seuil_minimal_depense_nette_minimale_1 or + temp_seuil_minimal_depense_nette_minimale)) and + (date_signature_pret_1 >= + date_of_numbers(1999,7,1))): + temp_seuil_minimal_depense_nette_minimale_3 = (ressources_menage_arrondies_seuil_1 * + coefficient_d842_11) + else: + temp_seuil_minimal_depense_nette_minimale_3 = dead_value + raise EmptyError + except EmptyError: + temp_seuil_minimal_depense_nette_minimale_3 = montant_forfaitaire_d842_11 + except EmptyError: + temp_seuil_minimal_depense_nette_minimale_3 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=880, start_column=11, + end_line=880, end_column=47, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + seuil_minimal_depense_nette_minimale = temp_seuil_minimal_depense_nette_minimale_3 + try: + if (mensualite_principale_1 > + plafond_mensualite_d842_6): + temp_mensualite_eligible_1 = plafond_mensualite_d842_6 + else: + temp_mensualite_eligible_1 = mensualite_principale_1 + except EmptyError: + temp_mensualite_eligible_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=871, start_column=11, + end_line=871, end_column=30, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + mensualite_eligible_1 = temp_mensualite_eligible_1 + try: + temp_mensualite_minimale_10 = calcul_equivalence_loyer_minimale_dot_montant_3 + except EmptyError: + temp_mensualite_minimale_10 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=873, start_column=11, + end_line=873, end_column=30, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + mensualite_minimale_1 = temp_mensualite_minimale_10 + try: + temp_coefficient_prise_en_charge_1 = calcul_apl_logement_foyer_dot_coefficient_prise_en_charge_d832_25_seuil_1 + except EmptyError: + temp_coefficient_prise_en_charge_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=874, start_column=11, + end_line=874, end_column=38, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + coefficient_prise_en_charge_1 = temp_coefficient_prise_en_charge_1 + try: + def temp_abattement_depense_nette_minimale_1(param_36:Money): + try: + if (depense_nette_minimale_1(param_36) < + seuil_minimal_depense_nette_minimale): + return (seuil_minimal_depense_nette_minimale - + depense_nette_minimale_1(param_36)) + else: + return money_of_cents_string("0") + except EmptyError: + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=884, + start_column=11, + end_line=884, + end_column=44, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + except EmptyError: + temp_abattement_depense_nette_minimale_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=884, start_column=11, + end_line=884, end_column=44, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + abattement_depense_nette_minimale_1 = temp_abattement_depense_nette_minimale_1 + try: + temp_aide_finale_formule_6 = (((mensualite_eligible_1 + + montant_forfaitaire_charges_1) - mensualite_minimale_1) * + coefficient_prise_en_charge_1) + except EmptyError: + temp_aide_finale_formule_6 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=899, start_column=10, + end_line=899, end_column=29, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + aide_finale_formule_5 = temp_aide_finale_formule_6 + try: + def temp_traitement_aide_finale_depense_nette_minimale_1(param_37:Money): + try: + if ((traitement_aide_finale_minoration_forfaitaire_4( + param_37) - + abattement_depense_nette_minimale_1(traitement_aide_finale_minoration_forfaitaire_4( + param_37))) < + money_of_cents_string("0")): + return money_of_cents_string("0") + else: + return (traitement_aide_finale_minoration_forfaitaire_4( + param_37) - + abattement_depense_nette_minimale_1(traitement_aide_finale_minoration_forfaitaire_4( + param_37))) + except EmptyError: + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=903, + start_column=10, + end_line=903, + end_column=32, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + except EmptyError: + temp_traitement_aide_finale_depense_nette_minimale_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=903, start_column=10, + end_line=903, end_column=32, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + traitement_aide_finale_depense_nette_minimale_1 = temp_traitement_aide_finale_depense_nette_minimale_1 + try: + def temp_traitement_aide_finale_contributions_sociales_arrondi_4(param_38:Money): + try: + if ((money_round(((traitement_aide_finale_depense_nette_minimale_1( + param_38) - + contributions_sociales_dot_montant_4(traitement_aide_finale_depense_nette_minimale_1( + param_38))) - + money_of_cents_string("50"))) + + contributions_sociales_dot_montant_4(traitement_aide_finale_depense_nette_minimale_1( + param_38))) >= + money_of_cents_string("0")): + return (money_round(((traitement_aide_finale_depense_nette_minimale_1( + param_38) - + contributions_sociales_dot_montant_4(traitement_aide_finale_depense_nette_minimale_1( + param_38))) - + money_of_cents_string("50"))) + + contributions_sociales_dot_montant_4(traitement_aide_finale_depense_nette_minimale_1( + param_38))) + else: + return money_of_cents_string("0") + except EmptyError: + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=904, + start_column=10, + end_line=904, + end_column=40, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + except EmptyError: + temp_traitement_aide_finale_contributions_sociales_arrondi_4 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=904, start_column=10, + end_line=904, end_column=40, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + traitement_aide_finale_contributions_sociales_arrondi_4 = temp_traitement_aide_finale_contributions_sociales_arrondi_4 + try: + def temp_traitement_aide_finale_montant_minimal_4(param_39:Money): + try: + if (traitement_aide_finale_contributions_sociales_arrondi_4( + param_39) < + montant_minimal_aide_d842_6): + return money_of_cents_string("0") + else: + return traitement_aide_finale_contributions_sociales_arrondi_4( + param_39) + except EmptyError: + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=905, + start_column=10, + end_line=905, + end_column=25, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + except EmptyError: + temp_traitement_aide_finale_montant_minimal_4 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=905, start_column=10, + end_line=905, end_column=25, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + traitement_aide_finale_montant_minimal_4 = temp_traitement_aide_finale_montant_minimal_4 + return CalculAllocationLogementAccessionProprieteOut(aide_finale_formule_out = aide_finale_formule_5, + traitement_aide_finale_montant_minimal_out = traitement_aide_finale_montant_minimal_4) + +def calcul_aide_personnalisee_logement(calcul_aide_personnalisee_logement_in:CalculAidePersonnaliseeLogementIn): + mode_occupation_4 = calcul_aide_personnalisee_logement_in.mode_occupation_in + type_aide_2 = calcul_aide_personnalisee_logement_in.type_aide_in + informations_calcul = calcul_aide_personnalisee_logement_in.informations_calcul_in + ressources_menage_sans_arrondi = calcul_aide_personnalisee_logement_in.ressources_menage_sans_arrondi_in + situation_familiale_1 = calcul_aide_personnalisee_logement_in.situation_familiale_in + nombre_personnes_a_charge_8 = calcul_aide_personnalisee_logement_in.nombre_personnes_a_charge_in + zone_6 = calcul_aide_personnalisee_logement_in.zone_in + date_courante_11 = calcul_aide_personnalisee_logement_in.date_courante_in + try: + match_arg_470 = mode_occupation_4 + if match_arg_470.code == ModeOccupation_Code.Locataire: + _ = match_arg_470.value + temp_categorie_calcul_apl = CategorieCalculAPL(CategorieCalculAPL_Code.Location, + Unit()) + elif match_arg_470.code == ModeOccupation_Code.ResidentLogementFoyer: + _ = match_arg_470.value + temp_categorie_calcul_apl = CategorieCalculAPL(CategorieCalculAPL_Code.LogementFoyer, + Unit()) + elif match_arg_470.code == ModeOccupation_Code.AccessionProprieteLocalUsageExclusifHabitation: + _ = match_arg_470.value + temp_categorie_calcul_apl = CategorieCalculAPL(CategorieCalculAPL_Code.AccessionPropriete, + Unit()) + elif match_arg_470.code == ModeOccupation_Code.SousLocataire: + _ = match_arg_470.value + temp_categorie_calcul_apl = CategorieCalculAPL(CategorieCalculAPL_Code.Location, + Unit()) + elif match_arg_470.code == ModeOccupation_Code.LocationAccession: + _ = match_arg_470.value + temp_categorie_calcul_apl = CategorieCalculAPL(CategorieCalculAPL_Code.AccessionPropriete, + Unit()) + except EmptyError: + temp_categorie_calcul_apl = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=762, start_column=11, + end_line=762, end_column=31, + law_headings=["Tous secteurs", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + categorie_calcul_apl = temp_categorie_calcul_apl + try: + temp_ressources_menage_avec_arrondi = (money_round(((ressources_menage_sans_arrondi + + money_of_cents_string("4999")) * decimal_of_string("0.01"))) * + decimal_of_string("100.")) + except EmptyError: + temp_ressources_menage_avec_arrondi = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=756, start_column=10, + end_line=756, end_column=22, + law_headings=["Tous secteurs", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + ressources_menage_avec_arrondi = temp_ressources_menage_avec_arrondi + try: + match_arg_471 = situation_familiale_1 + if match_arg_471.code == SituationFamiliale_Code.Celibataire: + _ = match_arg_471.value + temp_situation_familiale_calcul_apl = SituationFamilialeCalculAPL(SituationFamilialeCalculAPL_Code.PersonneSeule, + Unit()) + elif match_arg_471.code == SituationFamiliale_Code.Maries: + _ = match_arg_471.value + temp_situation_familiale_calcul_apl = SituationFamilialeCalculAPL(SituationFamilialeCalculAPL_Code.Couple, + Unit()) + elif match_arg_471.code == SituationFamiliale_Code.Pacses: + _ = match_arg_471.value + temp_situation_familiale_calcul_apl = SituationFamilialeCalculAPL(SituationFamilialeCalculAPL_Code.Couple, + Unit()) + elif match_arg_471.code == SituationFamiliale_Code.Concubins: + _ = match_arg_471.value + temp_situation_familiale_calcul_apl = SituationFamilialeCalculAPL(SituationFamilialeCalculAPL_Code.Couple, + Unit()) + elif match_arg_471.code == SituationFamiliale_Code.CelibataireSepareDeFait: + _ = match_arg_471.value + temp_situation_familiale_calcul_apl = SituationFamilialeCalculAPL(SituationFamilialeCalculAPL_Code.PersonneSeule, + Unit()) + elif match_arg_471.code == SituationFamiliale_Code.ConcubinageDontSepareDeFait: + _ = match_arg_471.value + temp_situation_familiale_calcul_apl = SituationFamilialeCalculAPL(SituationFamilialeCalculAPL_Code.Couple, + Unit()) + except EmptyError: + temp_situation_familiale_calcul_apl = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=763, start_column=11, + end_line=763, end_column=41, + law_headings=["Tous secteurs", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + situation_familiale_calcul_apl_8 = temp_situation_familiale_calcul_apl + try: + match_arg_472 = informations_calcul + if match_arg_472.code == InformationsCalculAPL_Code.InfosLocatif: + _ = match_arg_472.value + temp_accession_propriete_dot_mensualite_principale = money_of_cents_string("0") + elif match_arg_472.code == InformationsCalculAPL_Code.InfosLogementFoyer: + _ = match_arg_472.value + temp_accession_propriete_dot_mensualite_principale = money_of_cents_string("0") + elif match_arg_472.code == InformationsCalculAPL_Code.InfosAccessionPropriete: + infos_3 = match_arg_472.value + temp_accession_propriete_dot_mensualite_principale = infos_3.mensualite_principale + temp_accession_propriete_dot_mensualite_principale_1 = temp_accession_propriete_dot_mensualite_principale + except EmptyError: + temp_accession_propriete_dot_mensualite_principale_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=689, start_column=10, + end_line=689, end_column=31, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + accession_propriete_dot_mensualite_principale = temp_accession_propriete_dot_mensualite_principale_1 + try: + temp_accession_propriete_dot_ressources_menage_arrondies = ressources_menage_avec_arrondi + except EmptyError: + temp_accession_propriete_dot_ressources_menage_arrondies = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=690, start_column=10, + end_line=690, end_column=37, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + accession_propriete_dot_ressources_menage_arrondies = temp_accession_propriete_dot_ressources_menage_arrondies + try: + temp_accession_propriete_dot_nombre_personnes_a_charge = nombre_personnes_a_charge_8 + except EmptyError: + temp_accession_propriete_dot_nombre_personnes_a_charge = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=691, start_column=10, + end_line=691, end_column=35, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + accession_propriete_dot_nombre_personnes_a_charge = temp_accession_propriete_dot_nombre_personnes_a_charge + try: + temp_accession_propriete_dot_situation_familiale_calcul_apl = situation_familiale_calcul_apl_8 + except EmptyError: + temp_accession_propriete_dot_situation_familiale_calcul_apl = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=692, start_column=10, + end_line=692, end_column=40, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + accession_propriete_dot_situation_familiale_calcul_apl = temp_accession_propriete_dot_situation_familiale_calcul_apl + try: + match_arg_473 = informations_calcul + if match_arg_473.code == InformationsCalculAPL_Code.InfosLocatif: + _ = match_arg_473.value + temp_accession_propriete_dot_type_travaux_logement = TypeTravauxLogementD83215(TypeTravauxLogementD83215_Code.PasDeTravaux, + Unit()) + elif match_arg_473.code == InformationsCalculAPL_Code.InfosLogementFoyer: + _ = match_arg_473.value + temp_accession_propriete_dot_type_travaux_logement = TypeTravauxLogementD83215(TypeTravauxLogementD83215_Code.PasDeTravaux, + Unit()) + elif match_arg_473.code == InformationsCalculAPL_Code.InfosAccessionPropriete: + infos_4 = match_arg_473.value + temp_accession_propriete_dot_type_travaux_logement = infos_4.type_travaux_logement_d832_15 + temp_accession_propriete_dot_type_travaux_logement_1 = temp_accession_propriete_dot_type_travaux_logement + except EmptyError: + temp_accession_propriete_dot_type_travaux_logement_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=693, start_column=10, + end_line=693, end_column=31, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + accession_propriete_dot_type_travaux_logement = temp_accession_propriete_dot_type_travaux_logement_1 + try: + match_arg_474 = informations_calcul + if match_arg_474.code == InformationsCalculAPL_Code.InfosLocatif: + _ = match_arg_474.value + temp_accession_propriete_dot_date_signature_pret = date_of_numbers(2010,1,1) + elif match_arg_474.code == InformationsCalculAPL_Code.InfosLogementFoyer: + _ = match_arg_474.value + temp_accession_propriete_dot_date_signature_pret = date_of_numbers(2010,1,1) + elif match_arg_474.code == InformationsCalculAPL_Code.InfosAccessionPropriete: + infos_5 = match_arg_474.value + temp_accession_propriete_dot_date_signature_pret = infos_5.date_signature_pret + temp_accession_propriete_dot_date_signature_pret_1 = temp_accession_propriete_dot_date_signature_pret + except EmptyError: + temp_accession_propriete_dot_date_signature_pret_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=694, start_column=10, + end_line=694, end_column=29, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + accession_propriete_dot_date_signature_pret = temp_accession_propriete_dot_date_signature_pret_1 + try: + match_arg_475 = informations_calcul + if match_arg_475.code == InformationsCalculAPL_Code.InfosLocatif: + _ = match_arg_475.value + temp_accession_propriete_dot_local_habite_premiere_fois_beneficiaire = False + elif match_arg_475.code == InformationsCalculAPL_Code.InfosLogementFoyer: + _ = match_arg_475.value + temp_accession_propriete_dot_local_habite_premiere_fois_beneficiaire = False + elif match_arg_475.code == InformationsCalculAPL_Code.InfosAccessionPropriete: + infos_6 = match_arg_475.value + temp_accession_propriete_dot_local_habite_premiere_fois_beneficiaire = infos_6.local_habite_premiere_fois_beneficiaire + temp_accession_propriete_dot_local_habite_premiere_fois_beneficiaire_1 = temp_accession_propriete_dot_local_habite_premiere_fois_beneficiaire + except EmptyError: + temp_accession_propriete_dot_local_habite_premiere_fois_beneficiaire_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=695, start_column=10, + end_line=695, end_column=49, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + accession_propriete_dot_local_habite_premiere_fois_beneficiaire = temp_accession_propriete_dot_local_habite_premiere_fois_beneficiaire_1 + try: + match_arg_476 = informations_calcul + if match_arg_476.code == InformationsCalculAPL_Code.InfosLocatif: + _ = match_arg_476.value + temp_accession_propriete_dot_date_entree_logement = date_of_numbers(2010,1,1) + elif match_arg_476.code == InformationsCalculAPL_Code.InfosLogementFoyer: + _ = match_arg_476.value + temp_accession_propriete_dot_date_entree_logement = date_of_numbers(2010,1,1) + elif match_arg_476.code == InformationsCalculAPL_Code.InfosAccessionPropriete: + infos_7 = match_arg_476.value + temp_accession_propriete_dot_date_entree_logement = infos_7.date_entree_logement + temp_accession_propriete_dot_date_entree_logement_1 = temp_accession_propriete_dot_date_entree_logement + except EmptyError: + temp_accession_propriete_dot_date_entree_logement_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=696, start_column=10, + end_line=696, end_column=30, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + accession_propriete_dot_date_entree_logement = temp_accession_propriete_dot_date_entree_logement_1 + try: + match_arg_477 = informations_calcul + if match_arg_477.code == InformationsCalculAPL_Code.InfosLocatif: + _ = match_arg_477.value + temp_accession_propriete_dot_copropriete = False + elif match_arg_477.code == InformationsCalculAPL_Code.InfosLogementFoyer: + _ = match_arg_477.value + temp_accession_propriete_dot_copropriete = False + elif match_arg_477.code == InformationsCalculAPL_Code.InfosAccessionPropriete: + infos_8 = match_arg_477.value + temp_accession_propriete_dot_copropriete = infos_8.copropriete + temp_accession_propriete_dot_copropriete_1 = temp_accession_propriete_dot_copropriete + except EmptyError: + temp_accession_propriete_dot_copropriete_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=697, start_column=10, + end_line=697, end_column=21, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + accession_propriete_dot_copropriete = temp_accession_propriete_dot_copropriete_1 + try: + match_arg_478 = informations_calcul + if match_arg_478.code == InformationsCalculAPL_Code.InfosLocatif: + _ = match_arg_478.value + temp_accession_propriete_dot_situation_r822_11_13_17 = False + elif match_arg_478.code == InformationsCalculAPL_Code.InfosLogementFoyer: + _ = match_arg_478.value + temp_accession_propriete_dot_situation_r822_11_13_17 = False + elif match_arg_478.code == InformationsCalculAPL_Code.InfosAccessionPropriete: + infos_9 = match_arg_478.value + temp_accession_propriete_dot_situation_r822_11_13_17 = infos_9.situation_r822_11_13_17 + temp_accession_propriete_dot_situation_r822_11_13_17_1 = temp_accession_propriete_dot_situation_r822_11_13_17 + except EmptyError: + temp_accession_propriete_dot_situation_r822_11_13_17_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=698, start_column=10, + end_line=698, end_column=33, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + accession_propriete_dot_situation_r822_11_13_17 = temp_accession_propriete_dot_situation_r822_11_13_17_1 + try: + temp_accession_propriete_dot_zone = zone_6 + except EmptyError: + temp_accession_propriete_dot_zone = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=699, start_column=10, + end_line=699, end_column=14, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + accession_propriete_dot_zone = temp_accession_propriete_dot_zone + try: + match_arg_479 = informations_calcul + if match_arg_479.code == InformationsCalculAPL_Code.InfosLocatif: + _ = match_arg_479.value + temp_accession_propriete_dot_type_pret = TypePret(TypePret_Code.D331_32, + Unit()) + elif match_arg_479.code == InformationsCalculAPL_Code.InfosLogementFoyer: + _ = match_arg_479.value + temp_accession_propriete_dot_type_pret = TypePret(TypePret_Code.D331_32, + Unit()) + elif match_arg_479.code == InformationsCalculAPL_Code.InfosAccessionPropriete: + infos_10 = match_arg_479.value + temp_accession_propriete_dot_type_pret = infos_10.type_pret + temp_accession_propriete_dot_type_pret_1 = temp_accession_propriete_dot_type_pret + except EmptyError: + temp_accession_propriete_dot_type_pret_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=700, start_column=10, + end_line=700, end_column=19, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + accession_propriete_dot_type_pret = temp_accession_propriete_dot_type_pret_1 + try: + match_arg_480 = informations_calcul + if match_arg_480.code == InformationsCalculAPL_Code.InfosLocatif: + _ = match_arg_480.value + temp_accession_propriete_dot_anciennete_logement = NeufOuAncien(NeufOuAncien_Code.Neuf, + Unit()) + elif match_arg_480.code == InformationsCalculAPL_Code.InfosLogementFoyer: + _ = match_arg_480.value + temp_accession_propriete_dot_anciennete_logement = NeufOuAncien(NeufOuAncien_Code.Neuf, + Unit()) + elif match_arg_480.code == InformationsCalculAPL_Code.InfosAccessionPropriete: + infos_11 = match_arg_480.value + temp_accession_propriete_dot_anciennete_logement = infos_11.anciennete_logement + temp_accession_propriete_dot_anciennete_logement_1 = temp_accession_propriete_dot_anciennete_logement + except EmptyError: + temp_accession_propriete_dot_anciennete_logement_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=701, start_column=10, + end_line=701, end_column=29, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + accession_propriete_dot_anciennete_logement = temp_accession_propriete_dot_anciennete_logement_1 + try: + temp_accession_propriete_dot_date_courante = date_courante_11 + except EmptyError: + temp_accession_propriete_dot_date_courante = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=702, start_column=10, + end_line=702, end_column=23, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + accession_propriete_dot_date_courante = temp_accession_propriete_dot_date_courante + result_19 = calcul_aide_personnalisee_logement_accession_propriete( + CalculAidePersonnaliseeLogementAccessionProprieteIn(mensualite_principale_in = accession_propriete_dot_mensualite_principale, + ressources_menage_arrondies_in = accession_propriete_dot_ressources_menage_arrondies, + nombre_personnes_a_charge_in = accession_propriete_dot_nombre_personnes_a_charge, + situation_familiale_calcul_apl_in = accession_propriete_dot_situation_familiale_calcul_apl, + type_travaux_logement_in = accession_propriete_dot_type_travaux_logement, + date_signature_pret_in = accession_propriete_dot_date_signature_pret, + local_habite_premiere_fois_beneficiaire_in = accession_propriete_dot_local_habite_premiere_fois_beneficiaire, + date_entree_logement_in = accession_propriete_dot_date_entree_logement, + copropriete_in = accession_propriete_dot_copropriete, + situation_r822_11_13_17_in = accession_propriete_dot_situation_r822_11_13_17, + zone_in = accession_propriete_dot_zone, + type_pret_in = accession_propriete_dot_type_pret, + anciennete_logement_in = accession_propriete_dot_anciennete_logement, + date_courante_in = accession_propriete_dot_date_courante)) + accession_propriete_dot_mensualite_eligible = result_19.mensualite_eligible_out + accession_propriete_dot_mensualite_minimale = result_19.mensualite_minimale_out + accession_propriete_dot_coefficient_prise_en_charge_d832_10_seuil = result_19.coefficient_prise_en_charge_d832_10_seuil_out + accession_propriete_dot_aide_finale_formule = result_19.aide_finale_formule_out + accession_propriete_dot_traitement_aide_finale_montant_minimal = result_19.traitement_aide_finale_montant_minimal_out + try: + temp_logement_foyer_dot_mode_occupation = mode_occupation_4 + except EmptyError: + temp_logement_foyer_dot_mode_occupation = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=632, start_column=10, + end_line=632, end_column=25, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + logement_foyer_dot_mode_occupation = temp_logement_foyer_dot_mode_occupation + try: + temp_logement_foyer_dot_ressources_menage_arrondies = ressources_menage_avec_arrondi + except EmptyError: + temp_logement_foyer_dot_ressources_menage_arrondies = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=633, start_column=10, + end_line=633, end_column=37, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + logement_foyer_dot_ressources_menage_arrondies = temp_logement_foyer_dot_ressources_menage_arrondies + try: + temp_logement_foyer_dot_nombre_personnes_a_charge = nombre_personnes_a_charge_8 + except EmptyError: + temp_logement_foyer_dot_nombre_personnes_a_charge = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=634, start_column=10, + end_line=634, end_column=35, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + logement_foyer_dot_nombre_personnes_a_charge = temp_logement_foyer_dot_nombre_personnes_a_charge + try: + temp_logement_foyer_dot_situation_familiale_calcul_apl = situation_familiale_calcul_apl_8 + except EmptyError: + temp_logement_foyer_dot_situation_familiale_calcul_apl = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=635, start_column=10, + end_line=635, end_column=40, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + logement_foyer_dot_situation_familiale_calcul_apl = temp_logement_foyer_dot_situation_familiale_calcul_apl + try: + temp_logement_foyer_dot_zone = zone_6 + except EmptyError: + temp_logement_foyer_dot_zone = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=636, start_column=10, + end_line=636, end_column=14, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + logement_foyer_dot_zone = temp_logement_foyer_dot_zone + try: + temp_logement_foyer_dot_date_courante = date_courante_11 + except EmptyError: + temp_logement_foyer_dot_date_courante = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=637, start_column=10, + end_line=637, end_column=23, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + logement_foyer_dot_date_courante = temp_logement_foyer_dot_date_courante + try: + match_arg_481 = informations_calcul + if match_arg_481.code == InformationsCalculAPL_Code.InfosLocatif: + _ = match_arg_481.value + temp_logement_foyer_dot_redevance = money_of_cents_string("0") + elif match_arg_481.code == InformationsCalculAPL_Code.InfosLogementFoyer: + infos_12 = match_arg_481.value + temp_logement_foyer_dot_redevance = infos_12.redevance + elif match_arg_481.code == InformationsCalculAPL_Code.InfosAccessionPropriete: + _ = match_arg_481.value + temp_logement_foyer_dot_redevance = money_of_cents_string("0") + temp_logement_foyer_dot_redevance_1 = temp_logement_foyer_dot_redevance + except EmptyError: + temp_logement_foyer_dot_redevance_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=638, start_column=10, + end_line=638, end_column=19, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + logement_foyer_dot_redevance = temp_logement_foyer_dot_redevance_1 + def temp_logement_foyer_dot_condition_2_du_832_25(_:Unit): + temp_logement_foyer_dot_condition_2_du_832_25_1 = dead_value + raise EmptyError + return temp_logement_foyer_dot_condition_2_du_832_25_1 + logement_foyer_dot_condition_2_du_832_25 = temp_logement_foyer_dot_condition_2_du_832_25 + def temp_logement_foyer_dot_n_nombre_parts_d832_25(_:Unit): + temp_logement_foyer_dot_n_nombre_parts_d832_25_1 = dead_value + raise EmptyError + return temp_logement_foyer_dot_n_nombre_parts_d832_25_1 + logement_foyer_dot_n_nombre_parts_d832_25 = temp_logement_foyer_dot_n_nombre_parts_d832_25 + result_20 = calcul_aide_personnalisee_logement_foyer(CalculAidePersonnaliseeLogementFoyerIn(mode_occupation_in = logement_foyer_dot_mode_occupation, + ressources_menage_arrondies_in = logement_foyer_dot_ressources_menage_arrondies, + nombre_personnes_a_charge_in = logement_foyer_dot_nombre_personnes_a_charge, + situation_familiale_calcul_apl_in = logement_foyer_dot_situation_familiale_calcul_apl, + zone_in = logement_foyer_dot_zone, + date_courante_in = logement_foyer_dot_date_courante, + redevance_in = logement_foyer_dot_redevance, + condition_2_du_832_25_in = logement_foyer_dot_condition_2_du_832_25, + n_nombre_parts_d832_25_in = logement_foyer_dot_n_nombre_parts_d832_25)) + logement_foyer_dot_coefficient_multiplicateur_d832_25 = result_20.coefficient_multiplicateur_d832_25_out + logement_foyer_dot_coefficient_r_d832_25 = result_20.coefficient_r_d832_25_out + logement_foyer_dot_n_nombre_parts_d832_25_1 = result_20.n_nombre_parts_d832_25_out + logement_foyer_dot_equivalence_loyer_eligible = result_20.equivalence_loyer_eligible_out + logement_foyer_dot_plafond_equivalence_loyer_eligible = result_20.plafond_equivalence_loyer_eligible_out + logement_foyer_dot_equivalence_loyer_minimale = result_20.equivalence_loyer_minimale_out + logement_foyer_dot_coefficient_prise_en_charge_d832_25_seuil = result_20.coefficient_prise_en_charge_d832_25_seuil_out + logement_foyer_dot_aide_finale_formule = result_20.aide_finale_formule_out + logement_foyer_dot_traitement_aide_finale_montant_minimal = result_20.traitement_aide_finale_montant_minimal_out + try: + match_arg_482 = informations_calcul + if match_arg_482.code == InformationsCalculAPL_Code.InfosLocatif: + infos_13 = match_arg_482.value + temp_locatif_dot_loyer_principal = infos_13.loyer_principal + elif match_arg_482.code == InformationsCalculAPL_Code.InfosLogementFoyer: + _ = match_arg_482.value + temp_locatif_dot_loyer_principal = money_of_cents_string("0") + elif match_arg_482.code == InformationsCalculAPL_Code.InfosAccessionPropriete: + _ = match_arg_482.value + temp_locatif_dot_loyer_principal = money_of_cents_string("0") + temp_locatif_dot_loyer_principal_1 = temp_locatif_dot_loyer_principal + except EmptyError: + temp_locatif_dot_loyer_principal_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=558, start_column=10, + end_line=558, end_column=25, + law_headings=["Secteur locatif", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + locatif_dot_loyer_principal = temp_locatif_dot_loyer_principal_1 + try: + temp_locatif_dot_ressources_menage_arrondies = ressources_menage_avec_arrondi + except EmptyError: + temp_locatif_dot_ressources_menage_arrondies = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=559, start_column=10, + end_line=559, end_column=37, + law_headings=["Secteur locatif", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + locatif_dot_ressources_menage_arrondies = temp_locatif_dot_ressources_menage_arrondies + try: + match_arg_483 = informations_calcul + if match_arg_483.code == InformationsCalculAPL_Code.InfosLocatif: + infos_14 = match_arg_483.value + temp_locatif_dot_beneficiaire_aide_adulte_ou_enfant_handicapes = infos_14.beneficiaire_aide_adulte_ou_enfant_handicapes + elif match_arg_483.code == InformationsCalculAPL_Code.InfosLogementFoyer: + _ = match_arg_483.value + temp_locatif_dot_beneficiaire_aide_adulte_ou_enfant_handicapes = False + elif match_arg_483.code == InformationsCalculAPL_Code.InfosAccessionPropriete: + _ = match_arg_483.value + temp_locatif_dot_beneficiaire_aide_adulte_ou_enfant_handicapes = False + temp_locatif_dot_beneficiaire_aide_adulte_ou_enfant_handicapes_1 = temp_locatif_dot_beneficiaire_aide_adulte_ou_enfant_handicapes + except EmptyError: + temp_locatif_dot_beneficiaire_aide_adulte_ou_enfant_handicapes_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=560, start_column=10, + end_line=560, end_column=55, + law_headings=["Secteur locatif", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + locatif_dot_beneficiaire_aide_adulte_ou_enfant_handicapes = temp_locatif_dot_beneficiaire_aide_adulte_ou_enfant_handicapes_1 + try: + temp_locatif_dot_date_courante = date_courante_11 + except EmptyError: + temp_locatif_dot_date_courante = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=562, start_column=10, + end_line=562, end_column=23, + law_headings=["Secteur locatif", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + locatif_dot_date_courante = temp_locatif_dot_date_courante + try: + temp_locatif_dot_nombre_personnes_a_charge = nombre_personnes_a_charge_8 + except EmptyError: + temp_locatif_dot_nombre_personnes_a_charge = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=563, start_column=10, + end_line=563, end_column=35, + law_headings=["Secteur locatif", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + locatif_dot_nombre_personnes_a_charge = temp_locatif_dot_nombre_personnes_a_charge + try: + temp_locatif_dot_situation_familiale_calcul_apl = situation_familiale_calcul_apl_8 + except EmptyError: + temp_locatif_dot_situation_familiale_calcul_apl = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=564, start_column=10, + end_line=564, end_column=40, + law_headings=["Secteur locatif", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + locatif_dot_situation_familiale_calcul_apl = temp_locatif_dot_situation_familiale_calcul_apl + try: + temp_locatif_dot_zone = zone_6 + except EmptyError: + temp_locatif_dot_zone = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=565, start_column=10, + end_line=565, end_column=14, + law_headings=["Secteur locatif", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + locatif_dot_zone = temp_locatif_dot_zone + try: + match_arg_484 = informations_calcul + if match_arg_484.code == InformationsCalculAPL_Code.InfosLocatif: + infos_15 = match_arg_484.value + temp_locatif_dot_logement_est_chambre = infos_15.logement_est_chambre + elif match_arg_484.code == InformationsCalculAPL_Code.InfosLogementFoyer: + _ = match_arg_484.value + temp_locatif_dot_logement_est_chambre = False + elif match_arg_484.code == InformationsCalculAPL_Code.InfosAccessionPropriete: + _ = match_arg_484.value + temp_locatif_dot_logement_est_chambre = False + temp_locatif_dot_logement_est_chambre_1 = temp_locatif_dot_logement_est_chambre + except EmptyError: + temp_locatif_dot_logement_est_chambre_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=566, start_column=10, + end_line=566, end_column=30, + law_headings=["Secteur locatif", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + locatif_dot_logement_est_chambre = temp_locatif_dot_logement_est_chambre_1 + try: + match_arg_485 = informations_calcul + if match_arg_485.code == InformationsCalculAPL_Code.InfosLocatif: + infos_16 = match_arg_485.value + temp_locatif_dot_agees_ou_handicap_adultes_hebergees_onereux_particuliers = infos_16.agees_ou_handicap_adultes_hebergees_onereux_particuliers + elif match_arg_485.code == InformationsCalculAPL_Code.InfosLogementFoyer: + _ = match_arg_485.value + temp_locatif_dot_agees_ou_handicap_adultes_hebergees_onereux_particuliers = False + elif match_arg_485.code == InformationsCalculAPL_Code.InfosAccessionPropriete: + _ = match_arg_485.value + temp_locatif_dot_agees_ou_handicap_adultes_hebergees_onereux_particuliers = False + temp_locatif_dot_agees_ou_handicap_adultes_hebergees_onereux_particuliers_1 = temp_locatif_dot_agees_ou_handicap_adultes_hebergees_onereux_particuliers + except EmptyError: + temp_locatif_dot_agees_ou_handicap_adultes_hebergees_onereux_particuliers_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=567, start_column=10, + end_line=567, end_column=66, + law_headings=["Secteur locatif", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + locatif_dot_agees_ou_handicap_adultes_hebergees_onereux_particuliers = temp_locatif_dot_agees_ou_handicap_adultes_hebergees_onereux_particuliers_1 + try: + temp_locatif_dot_type_aide = type_aide_2 + except EmptyError: + temp_locatif_dot_type_aide = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=569, start_column=10, + end_line=569, end_column=19, + law_headings=["Secteur locatif", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + locatif_dot_type_aide = temp_locatif_dot_type_aide + try: + match_arg_486 = informations_calcul + if match_arg_486.code == InformationsCalculAPL_Code.InfosLocatif: + infos_17 = match_arg_486.value + temp_locatif_dot_colocation = infos_17.colocation + elif match_arg_486.code == InformationsCalculAPL_Code.InfosLogementFoyer: + _ = match_arg_486.value + temp_locatif_dot_colocation = False + elif match_arg_486.code == InformationsCalculAPL_Code.InfosAccessionPropriete: + _ = match_arg_486.value + temp_locatif_dot_colocation = False + temp_locatif_dot_colocation_1 = temp_locatif_dot_colocation + except EmptyError: + temp_locatif_dot_colocation_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=570, start_column=10, + end_line=570, end_column=20, + law_headings=["Secteur locatif", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + locatif_dot_colocation = temp_locatif_dot_colocation_1 + try: + match_arg_487 = informations_calcul + if match_arg_487.code == InformationsCalculAPL_Code.InfosLocatif: + infos_18 = match_arg_487.value + temp_locatif_dot_reduction_loyer_solidarite = infos_18.reduction_loyer_solidarite + elif match_arg_487.code == InformationsCalculAPL_Code.InfosLogementFoyer: + _ = match_arg_487.value + temp_locatif_dot_reduction_loyer_solidarite = money_of_cents_string("0") + elif match_arg_487.code == InformationsCalculAPL_Code.InfosAccessionPropriete: + _ = match_arg_487.value + temp_locatif_dot_reduction_loyer_solidarite = money_of_cents_string("0") + temp_locatif_dot_reduction_loyer_solidarite_1 = temp_locatif_dot_reduction_loyer_solidarite + except EmptyError: + temp_locatif_dot_reduction_loyer_solidarite_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=571, start_column=10, + end_line=571, end_column=36, + law_headings=["Secteur locatif", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + locatif_dot_reduction_loyer_solidarite = temp_locatif_dot_reduction_loyer_solidarite_1 + result_21 = calcul_aide_personnalisee_logement_locatif(CalculAidePersonnaliseeLogementLocatifIn(loyer_principal_in = locatif_dot_loyer_principal, + ressources_menage_arrondies_in = locatif_dot_ressources_menage_arrondies, + beneficiaire_aide_adulte_ou_enfant_handicapes_in = locatif_dot_beneficiaire_aide_adulte_ou_enfant_handicapes, + date_courante_in = locatif_dot_date_courante, + nombre_personnes_a_charge_in = locatif_dot_nombre_personnes_a_charge, + situation_familiale_calcul_apl_in = locatif_dot_situation_familiale_calcul_apl, + zone_in = locatif_dot_zone, + logement_est_chambre_in = locatif_dot_logement_est_chambre, + agees_ou_handicap_adultes_hebergees_onereux_particuliers_in = locatif_dot_agees_ou_handicap_adultes_hebergees_onereux_particuliers, + type_aide_in = locatif_dot_type_aide, + colocation_in = locatif_dot_colocation, + reduction_loyer_solidarite_in = locatif_dot_reduction_loyer_solidarite)) + locatif_dot_montant_forfaitaire_charges_d823_16 = result_21.montant_forfaitaire_charges_d823_16_out + locatif_dot_plafond_loyer_d823_16_2 = result_21.plafond_loyer_d823_16_2_out + locatif_dot_participation_minimale = result_21.participation_minimale_out + locatif_dot_taux_composition_familiale = result_21.taux_composition_familiale_out + locatif_dot_participation_personnelle = result_21.participation_personnelle_out + locatif_dot_aide_finale_formule = result_21.aide_finale_formule_out + locatif_dot_traitement_aide_finale_montant_minimal = result_21.traitement_aide_finale_montant_minimal_out + try: + def temp_traitement_aide_finale_2(param_40:Money): + try: + match_arg_488 = categorie_calcul_apl + if match_arg_488.code == CategorieCalculAPL_Code.Location: + _ = match_arg_488.value + return locatif_dot_traitement_aide_finale_montant_minimal( + param_40) + elif match_arg_488.code == CategorieCalculAPL_Code.AccessionPropriete: + _ = match_arg_488.value + return accession_propriete_dot_traitement_aide_finale_montant_minimal( + param_40) + elif match_arg_488.code == CategorieCalculAPL_Code.LogementFoyer: + _ = match_arg_488.value + return logement_foyer_dot_traitement_aide_finale_montant_minimal( + param_40) + except EmptyError: + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=771, + start_column=10, + end_line=771, + end_column=32, + law_headings=["Tous secteurs", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + except EmptyError: + temp_traitement_aide_finale_2 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=771, start_column=10, + end_line=771, end_column=32, + law_headings=["Tous secteurs", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + traitement_aide_finale_1 = temp_traitement_aide_finale_2 + try: + match_arg_489 = categorie_calcul_apl + if match_arg_489.code == CategorieCalculAPL_Code.Location: + _ = match_arg_489.value + temp_aide_finale_formule_7 = locatif_dot_aide_finale_formule + elif match_arg_489.code == CategorieCalculAPL_Code.AccessionPropriete: + _ = match_arg_489.value + temp_aide_finale_formule_7 = accession_propriete_dot_aide_finale_formule + elif match_arg_489.code == CategorieCalculAPL_Code.LogementFoyer: + _ = match_arg_489.value + temp_aide_finale_formule_7 = logement_foyer_dot_aide_finale_formule + except EmptyError: + temp_aide_finale_formule_7 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=770, start_column=10, + end_line=770, end_column=29, + law_headings=["Tous secteurs", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + aide_finale_formule_6 = temp_aide_finale_formule_7 + try: + match_arg_490 = categorie_calcul_apl + if match_arg_490.code == CategorieCalculAPL_Code.Location: + _ = match_arg_490.value + temp___7 = False + elif match_arg_490.code == CategorieCalculAPL_Code.AccessionPropriete: + _ = match_arg_490.value + temp___7 = True + elif match_arg_490.code == CategorieCalculAPL_Code.LogementFoyer: + _ = match_arg_490.value + temp___7 = False + if temp___7: + match_arg_491 = informations_calcul + if match_arg_491.code == InformationsCalculAPL_Code.InfosLocatif: + _ = match_arg_491.value + temp___8 = False + elif match_arg_491.code == InformationsCalculAPL_Code.InfosLogementFoyer: + _ = match_arg_491.value + temp___8 = False + elif match_arg_491.code == InformationsCalculAPL_Code.InfosAccessionPropriete: + _ = match_arg_491.value + temp___8 = True + else: + temp___8 = True + except EmptyError: + temp___8 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", + start_line=1469, start_column=5, + end_line=1471, end_column=15, + law_headings=["Article D823-9", + "Section 1 : Calcul, liquidation et versement des aides", + "Chapitre III : Modalités de liquidation et de versement", + "Titre II : Dispositions communes aux aides personnelles au logement", + "Livre VIII : Aides personnelles au logement", + "Partie réglementaire", + "Code de la construction et de l'habitation"])) + if not (temp___8): + raise AssertionFailure(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", + start_line=1469, + start_column=5, end_line=1471, + end_column=15, + law_headings=["Article D823-9", + "Section 1 : Calcul, liquidation et versement des aides", + "Chapitre III : Modalités de liquidation et de versement", + "Titre II : Dispositions communes aux aides personnelles au logement", + "Livre VIII : Aides personnelles au logement", + "Partie réglementaire", + "Code de la construction et de l'habitation"])) + try: + match_arg_492 = categorie_calcul_apl + if match_arg_492.code == CategorieCalculAPL_Code.Location: + _ = match_arg_492.value + temp___9 = False + elif match_arg_492.code == CategorieCalculAPL_Code.AccessionPropriete: + _ = match_arg_492.value + temp___9 = False + elif match_arg_492.code == CategorieCalculAPL_Code.LogementFoyer: + _ = match_arg_492.value + temp___9 = True + if temp___9: + match_arg_493 = informations_calcul + if match_arg_493.code == InformationsCalculAPL_Code.InfosLocatif: + _ = match_arg_493.value + temp___10 = False + elif match_arg_493.code == InformationsCalculAPL_Code.InfosLogementFoyer: + _ = match_arg_493.value + temp___10 = True + elif match_arg_493.code == InformationsCalculAPL_Code.InfosAccessionPropriete: + _ = match_arg_493.value + temp___10 = False + else: + temp___10 = True + except EmptyError: + temp___10 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", + start_line=1465, start_column=5, + end_line=1467, end_column=15, + law_headings=["Article D823-9", + "Section 1 : Calcul, liquidation et versement des aides", + "Chapitre III : Modalités de liquidation et de versement", + "Titre II : Dispositions communes aux aides personnelles au logement", + "Livre VIII : Aides personnelles au logement", + "Partie réglementaire", + "Code de la construction et de l'habitation"])) + if not (temp___10): + raise AssertionFailure(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", + start_line=1465, + start_column=5, end_line=1467, + end_column=15, + law_headings=["Article D823-9", + "Section 1 : Calcul, liquidation et versement des aides", + "Chapitre III : Modalités de liquidation et de versement", + "Titre II : Dispositions communes aux aides personnelles au logement", + "Livre VIII : Aides personnelles au logement", + "Partie réglementaire", + "Code de la construction et de l'habitation"])) + try: + match_arg_494 = categorie_calcul_apl + if match_arg_494.code == CategorieCalculAPL_Code.Location: + _ = match_arg_494.value + temp___11 = True + elif match_arg_494.code == CategorieCalculAPL_Code.AccessionPropriete: + _ = match_arg_494.value + temp___11 = False + elif match_arg_494.code == CategorieCalculAPL_Code.LogementFoyer: + _ = match_arg_494.value + temp___11 = False + if temp___11: + match_arg_495 = informations_calcul + if match_arg_495.code == InformationsCalculAPL_Code.InfosLocatif: + _ = match_arg_495.value + temp___12 = True + elif match_arg_495.code == InformationsCalculAPL_Code.InfosLogementFoyer: + _ = match_arg_495.value + temp___12 = False + elif match_arg_495.code == InformationsCalculAPL_Code.InfosAccessionPropriete: + _ = match_arg_495.value + temp___12 = False + else: + temp___12 = True + except EmptyError: + temp___12 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", + start_line=1461, start_column=5, + end_line=1463, end_column=15, + law_headings=["Article D823-9", + "Section 1 : Calcul, liquidation et versement des aides", + "Chapitre III : Modalités de liquidation et de versement", + "Titre II : Dispositions communes aux aides personnelles au logement", + "Livre VIII : Aides personnelles au logement", + "Partie réglementaire", + "Code de la construction et de l'habitation"])) + if not (temp___12): + raise AssertionFailure(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", + start_line=1461, + start_column=5, end_line=1463, + end_column=15, + law_headings=["Article D823-9", + "Section 1 : Calcul, liquidation et versement des aides", + "Chapitre III : Modalités de liquidation et de versement", + "Titre II : Dispositions communes aux aides personnelles au logement", + "Livre VIII : Aides personnelles au logement", + "Partie réglementaire", + "Code de la construction et de l'habitation"])) + return CalculAidePersonnaliseeLogementOut(aide_finale_formule_out = aide_finale_formule_6, + traitement_aide_finale_out = traitement_aide_finale_1) + +def eligibilite_prime_de_demenagement(eligibilite_prime_de_demenagement_in:EligibilitePrimeDeDemenagementIn): + date_emmenagement = eligibilite_prime_de_demenagement_in.date_emmenagement_in + menage_1 = eligibilite_prime_de_demenagement_in.menage_in + demandeur_1 = eligibilite_prime_de_demenagement_in.demandeur_in + date_courante_12 = eligibilite_prime_de_demenagement_in.date_courante_in + depenses_justifiees_reellement_engagees = eligibilite_prime_de_demenagement_in.depenses_justifiees_reellement_engagees_in + try: + temp_delai_apres_emmenagement_l823_8_2 = duration_of_numbers(0,6,0) + except EmptyError: + temp_delai_apres_emmenagement_l823_8_2 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=486, start_column=11, + end_line=486, end_column=44, + law_headings=["Éligibilité à la prime de déménagement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + delai_apres_emmenagement_l823_8_2 = temp_delai_apres_emmenagement_l823_8_2 + try: + try: + def temp_condition_rang_enfant(acc_5:Integer, personne_a_charge_3:Any): + match_arg_496 = personne_a_charge_3 + if match_arg_496.code == PersonneACharge_Code.EnfantACharge: + _ = match_arg_496.value + temp_condition_rang_enfant_1 = True + elif match_arg_496.code == PersonneACharge_Code.AutrePersonneACharge: + _ = match_arg_496.value + temp_condition_rang_enfant_1 = False + if temp_condition_rang_enfant_1: + return (acc_5 + integer_of_string("1")) + else: + return acc_5 + if ((list_fold_left(temp_condition_rang_enfant, + integer_of_string("0"), + menage_1.personnes_a_charge) + + menage_1.nombre_enfants_a_naitre_apres_troisieme_mois_grossesse) >= + integer_of_string("3")): + temp_condition_rang_enfant_2 = True + else: + temp_condition_rang_enfant_2 = dead_value + raise EmptyError + except EmptyError: + temp_condition_rang_enfant_2 = False + except EmptyError: + temp_condition_rang_enfant_2 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=483, start_column=11, + end_line=483, end_column=32, + law_headings=["Éligibilité à la prime de déménagement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + condition_rang_enfant = temp_condition_rang_enfant_2 + try: + temp_base_mensuelle_allocations_familiales_dot_date_courante_1 = date_courante_12 + except EmptyError: + temp_base_mensuelle_allocations_familiales_dot_date_courante_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/../base_mensuelle_allocations_familiales/bmaf.catala_fr", + start_line=5, start_column=10, + end_line=5, end_column=23, + law_headings=["Montant de la base mensuelle des allocations familiales"])) + base_mensuelle_allocations_familiales_dot_date_courante_1 = temp_base_mensuelle_allocations_familiales_dot_date_courante_1 + result_22 = base_mensuelle_allocations_familiales(BaseMensuelleAllocationsFamilialesIn(date_courante_in = base_mensuelle_allocations_familiales_dot_date_courante_1)) + base_mensuelle_allocations_familiales_dot_montant_1 = result_22.montant_out + try: + temp_eligibilite_apl_dot_menage = menage_1 + except EmptyError: + temp_eligibilite_apl_dot_menage = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=311, start_column=10, + end_line=311, end_column=16, + law_headings=["Éligibilité aux aides personnelles au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + eligibilite_apl_dot_menage = temp_eligibilite_apl_dot_menage + try: + temp_eligibilite_apl_dot_demandeur = demandeur_1 + except EmptyError: + temp_eligibilite_apl_dot_demandeur = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=312, start_column=10, + end_line=312, end_column=19, + law_headings=["Éligibilité aux aides personnelles au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + eligibilite_apl_dot_demandeur = temp_eligibilite_apl_dot_demandeur + try: + temp_eligibilite_apl_dot_date_courante = date_courante_12 + except EmptyError: + temp_eligibilite_apl_dot_date_courante = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=313, start_column=17, + end_line=313, end_column=30, + law_headings=["Éligibilité aux aides personnelles au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + eligibilite_apl_dot_date_courante = temp_eligibilite_apl_dot_date_courante + def temp_eligibilite_apl_dot_condition_logement_residence_principale(_:Unit): + temp_eligibilite_apl_dot_condition_logement_residence_principale_1 = dead_value + raise EmptyError + return temp_eligibilite_apl_dot_condition_logement_residence_principale_1 + eligibilite_apl_dot_condition_logement_residence_principale = temp_eligibilite_apl_dot_condition_logement_residence_principale + def temp_eligibilite_apl_dot_condition_logement_surface(_:Unit): + temp_eligibilite_apl_dot_condition_logement_surface_1 = dead_value + raise EmptyError + return temp_eligibilite_apl_dot_condition_logement_surface_1 + eligibilite_apl_dot_condition_logement_surface = temp_eligibilite_apl_dot_condition_logement_surface + result_23 = eligibilite_aides_personnelle_logement(EligibiliteAidesPersonnelleLogementIn(menage_in = eligibilite_apl_dot_menage, + demandeur_in = eligibilite_apl_dot_demandeur, + date_courante_in = eligibilite_apl_dot_date_courante, + condition_logement_residence_principale_in = eligibilite_apl_dot_condition_logement_residence_principale, + condition_logement_surface_in = eligibilite_apl_dot_condition_logement_surface)) + eligibilite_apl_dot_date_courante_1 = result_23.date_courante_out + eligibilite_apl_dot_eligibilite = result_23.eligibilite_out + eligibilite_apl_dot_nombre_personnes_a_charge_prises_en_compte = result_23.nombre_personnes_a_charge_prises_en_compte_out + eligibilite_apl_dot_coefficents_enfants_garde_alternee_pris_en_compte = result_23.coefficents_enfants_garde_alternee_pris_en_compte_out + eligibilite_apl_dot_condition_2_r823_4 = result_23.condition_2_r823_4_out + try: + try: + match_arg_497 = menage_1.date_naissance_troisieme_enfant_ou_dernier_si_plus + if match_arg_497.code == DateNaissanceTroisiemeOuDernierPlusEnfant_Code.MoinsDeTroisEnfants: + _ = match_arg_497.value + temp_condition_periode_demenagement = False + elif match_arg_497.code == DateNaissanceTroisiemeOuDernierPlusEnfant_Code.PlusDeTroisEnfants: + date_naissance_ou_grossesse = match_arg_497.value + match_arg_498 = date_naissance_ou_grossesse + if match_arg_498.code == DateDeNaissanceOuMoisDeGrossesse_Code.DateDeNaissance: + date_naissance = match_arg_498.value + temp_condition_periode_demenagement = (date_courante_12 <= + (first_day_of_month((date_naissance + + duration_of_numbers(2,0,0))) + + duration_of_numbers(0,0,-1))) + elif match_arg_498.code == DateDeNaissanceOuMoisDeGrossesse_Code.AvantPremierJourMoisCivilTroisiemeMoisDeGrossesse: + _ = match_arg_498.value + temp_condition_periode_demenagement = False + elif match_arg_498.code == DateDeNaissanceOuMoisDeGrossesse_Code.ApresPremierJourMoisCivilTroisiemeMoisDeGrossesse: + _ = match_arg_498.value + temp_condition_periode_demenagement = True + if temp_condition_periode_demenagement: + temp_condition_periode_demenagement_1 = True + else: + temp_condition_periode_demenagement_1 = dead_value + raise EmptyError + except EmptyError: + temp_condition_periode_demenagement_1 = False + except EmptyError: + temp_condition_periode_demenagement_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=484, start_column=11, + end_line=484, end_column=41, + law_headings=["Éligibilité à la prime de déménagement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + condition_periode_demenagement = temp_condition_periode_demenagement_1 + try: + def temp_plafond_d823_22(acc_6:Integer, personne_a_charge_4:Any): + match_arg_499 = personne_a_charge_4 + if match_arg_499.code == PersonneACharge_Code.EnfantACharge: + _ = match_arg_499.value + temp_plafond_d823_22_1 = True + elif match_arg_499.code == PersonneACharge_Code.AutrePersonneACharge: + _ = match_arg_499.value + temp_plafond_d823_22_1 = False + if temp_plafond_d823_22_1: + return (acc_6 + integer_of_string("1")) + else: + return acc_6 + if (list_fold_left(temp_plafond_d823_22, integer_of_string("0"), + menage_1.personnes_a_charge) > + integer_of_string("3")): + def temp_plafond_d823_22_2(acc_7:Integer, personne_a_charge_5:Any): + match_arg_500 = personne_a_charge_5 + if match_arg_500.code == PersonneACharge_Code.EnfantACharge: + _ = match_arg_500.value + temp_plafond_d823_22_3 = True + elif match_arg_500.code == PersonneACharge_Code.AutrePersonneACharge: + _ = match_arg_500.value + temp_plafond_d823_22_3 = False + if temp_plafond_d823_22_3: + return (acc_7 + integer_of_string("1")) + else: + return acc_7 + temp_plafond_d823_22_4 = (base_mensuelle_allocations_familiales_dot_montant_1 * + (decimal_of_integer((list_fold_left(temp_plafond_d823_22_2, + integer_of_string("0"), + menage_1.personnes_a_charge) - + integer_of_string("3"))) * decimal_of_string("0.2"))) + else: + temp_plafond_d823_22_4 = money_of_cents_string("0") + temp_plafond_d823_22_5 = ((base_mensuelle_allocations_familiales_dot_montant_1 * + decimal_of_string("2.4")) + temp_plafond_d823_22_4) + except EmptyError: + temp_plafond_d823_22_5 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=487, start_column=11, + end_line=487, end_column=26, + law_headings=["Éligibilité à la prime de déménagement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + plafond_d823_22 = temp_plafond_d823_22_5 + try: + try: + if (eligibilite_apl_dot_eligibilite and + (condition_rang_enfant and + (condition_periode_demenagement and + ((eligibilite_apl_dot_date_courante_1 - date_emmenagement) <= + delai_apres_emmenagement_l823_8_2)))): + temp_eligibilite_logement_1 = True + else: + temp_eligibilite_logement_1 = dead_value + raise EmptyError + except EmptyError: + temp_eligibilite_logement_1 = False + except EmptyError: + temp_eligibilite_logement_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=485, start_column=11, + end_line=485, end_column=31, + law_headings=["Éligibilité à la prime de déménagement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + eligibilite_logement_1 = temp_eligibilite_logement_1 + try: + if (depenses_justifiees_reellement_engagees <= + plafond_d823_22): + temp_montant_prime_demenagement = depenses_justifiees_reellement_engagees + else: + temp_montant_prime_demenagement = plafond_d823_22 + except EmptyError: + temp_montant_prime_demenagement = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=493, start_column=10, + end_line=493, end_column=36, + law_headings=["Éligibilité à la prime de déménagement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + montant_prime_demenagement = temp_montant_prime_demenagement + return EligibilitePrimeDeDemenagementOut(montant_prime_demenagement_out = montant_prime_demenagement) + +def eligibilite_aide_personnalisee_logement(eligibilite_aide_personnalisee_logement_in:EligibiliteAidePersonnaliseeLogementIn): + menage_2 = eligibilite_aide_personnalisee_logement_in.menage_in + demandeur_2 = eligibilite_aide_personnalisee_logement_in.demandeur_in + date_courante_13 = eligibilite_aide_personnalisee_logement_in.date_courante_in + try: + def temp_caracteristiques_pret_l831_1_1(param_41:Pret): + try: + try: + try: + match_arg_501 = param_41.type_pret + if match_arg_501.code == TypePret_Code.D331_32: + _ = match_arg_501.value + temp_caracteristiques_pret_l831_1_1_1 = False + elif match_arg_501.code == TypePret_Code.D331_63_64: + _ = match_arg_501.value + temp_caracteristiques_pret_l831_1_1_1 = False + elif match_arg_501.code == TypePret_Code.D331_59_8: + _ = match_arg_501.value + temp_caracteristiques_pret_l831_1_1_1 = False + elif match_arg_501.code == TypePret_Code.D331_76_1: + _ = match_arg_501.value + temp_caracteristiques_pret_l831_1_1_1 = True + elif match_arg_501.code == TypePret_Code.Autre: + _ = match_arg_501.value + temp_caracteristiques_pret_l831_1_1_1 = False + match_arg_502 = param_41.type_pret + if match_arg_502.code == TypePret_Code.D331_32: + _ = match_arg_502.value + temp_caracteristiques_pret_l831_1_1_2 = False + elif match_arg_502.code == TypePret_Code.D331_63_64: + _ = match_arg_502.value + temp_caracteristiques_pret_l831_1_1_2 = False + elif match_arg_502.code == TypePret_Code.D331_59_8: + _ = match_arg_502.value + temp_caracteristiques_pret_l831_1_1_2 = True + elif match_arg_502.code == TypePret_Code.D331_76_1: + _ = match_arg_502.value + temp_caracteristiques_pret_l831_1_1_2 = False + elif match_arg_502.code == TypePret_Code.Autre: + _ = match_arg_502.value + temp_caracteristiques_pret_l831_1_1_2 = False + match_arg_503 = param_41.titulaire_pret + if match_arg_503.code == TitulairePret_Code.Demandeur: + _ = match_arg_503.value + temp_caracteristiques_pret_l831_1_1_3 = False + elif match_arg_503.code == TitulairePret_Code.VendeurQuandDemandeurAContratLocationAccession: + _ = match_arg_503.value + temp_caracteristiques_pret_l831_1_1_3 = True + if (temp_caracteristiques_pret_l831_1_1_3 and + (temp_caracteristiques_pret_l831_1_1_2 or + temp_caracteristiques_pret_l831_1_1_1)): + return True + else: + raise EmptyError + except EmptyError: + match_arg_504 = param_41.type_pret + if match_arg_504.code == TypePret_Code.D331_32: + _ = match_arg_504.value + temp_caracteristiques_pret_l831_1_1_4 = False + elif match_arg_504.code == TypePret_Code.D331_63_64: + _ = match_arg_504.value + temp_caracteristiques_pret_l831_1_1_4 = True + elif match_arg_504.code == TypePret_Code.D331_59_8: + _ = match_arg_504.value + temp_caracteristiques_pret_l831_1_1_4 = False + elif match_arg_504.code == TypePret_Code.D331_76_1: + _ = match_arg_504.value + temp_caracteristiques_pret_l831_1_1_4 = False + elif match_arg_504.code == TypePret_Code.Autre: + _ = match_arg_504.value + temp_caracteristiques_pret_l831_1_1_4 = False + match_arg_505 = param_41.type_pret + if match_arg_505.code == TypePret_Code.D331_32: + _ = match_arg_505.value + temp_caracteristiques_pret_l831_1_1_5 = True + elif match_arg_505.code == TypePret_Code.D331_63_64: + _ = match_arg_505.value + temp_caracteristiques_pret_l831_1_1_5 = False + elif match_arg_505.code == TypePret_Code.D331_59_8: + _ = match_arg_505.value + temp_caracteristiques_pret_l831_1_1_5 = False + elif match_arg_505.code == TypePret_Code.D331_76_1: + _ = match_arg_505.value + temp_caracteristiques_pret_l831_1_1_5 = False + elif match_arg_505.code == TypePret_Code.Autre: + _ = match_arg_505.value + temp_caracteristiques_pret_l831_1_1_5 = False + match_arg_506 = param_41.titulaire_pret + if match_arg_506.code == TitulairePret_Code.Demandeur: + _ = match_arg_506.value + temp_caracteristiques_pret_l831_1_1_6 = True + elif match_arg_506.code == TitulairePret_Code.VendeurQuandDemandeurAContratLocationAccession: + _ = match_arg_506.value + temp_caracteristiques_pret_l831_1_1_6 = False + if (temp_caracteristiques_pret_l831_1_1_6 and + (temp_caracteristiques_pret_l831_1_1_5 or + temp_caracteristiques_pret_l831_1_1_4)): + return True + else: + raise EmptyError + except EmptyError: + return False + except EmptyError: + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=392, + start_column=11, + end_line=392, + end_column=41, + law_headings=["Éligibilité à l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + except EmptyError: + temp_caracteristiques_pret_l831_1_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=392, start_column=11, + end_line=392, end_column=41, + law_headings=["Éligibilité à l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + caracteristiques_pret_l831_1_1 = temp_caracteristiques_pret_l831_1_1 + try: + def temp_caracteristiques_pret_l831_1_6(param_42:Pret): + try: + return False + except EmptyError: + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=393, + start_column=11, + end_line=393, + end_column=41, + law_headings=["Éligibilité à l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + except EmptyError: + temp_caracteristiques_pret_l831_1_6 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=393, start_column=11, + end_line=393, end_column=41, + law_headings=["Éligibilité à l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + caracteristiques_pret_l831_1_6 = temp_caracteristiques_pret_l831_1_6 + try: + try: + try: + try: + match_arg_507 = menage_2.logement.mode_occupation + if match_arg_507.code == ModeOccupation_Code.Locataire: + _ = match_arg_507.value + temp_condition_logement_pret = False + elif match_arg_507.code == ModeOccupation_Code.ResidentLogementFoyer: + _ = match_arg_507.value + temp_condition_logement_pret = False + elif match_arg_507.code == ModeOccupation_Code.AccessionProprieteLocalUsageExclusifHabitation: + propriete = match_arg_507.value + temp_condition_logement_pret = ((propriete.pret.date_signature >= + date_of_numbers(2018,1,1)) and + ((propriete.pret.date_signature < + date_of_numbers(2020,1,1)) and + (menage_2.logement.est_ancien_l831_2 and + menage_2.logement.situe_commune_desequilibre_l831_2))) + elif match_arg_507.code == ModeOccupation_Code.SousLocataire: + _ = match_arg_507.value + temp_condition_logement_pret = False + elif match_arg_507.code == ModeOccupation_Code.LocationAccession: + propriete_1 = match_arg_507.value + temp_condition_logement_pret = ((propriete_1.pret.date_signature >= + date_of_numbers(2018,1,1)) and + ((propriete_1.pret.date_signature < + date_of_numbers(2020,1,1)) and + (menage_2.logement.est_ancien_l831_2 and + menage_2.logement.situe_commune_desequilibre_l831_2))) + if temp_condition_logement_pret: + temp_condition_logement_pret_1 = True + else: + temp_condition_logement_pret_1 = dead_value + raise EmptyError + except EmptyError: + match_arg_508 = menage_2.logement.mode_occupation + if match_arg_508.code == ModeOccupation_Code.Locataire: + _ = match_arg_508.value + temp_condition_logement_pret_2 = False + elif match_arg_508.code == ModeOccupation_Code.ResidentLogementFoyer: + _ = match_arg_508.value + temp_condition_logement_pret_2 = False + elif match_arg_508.code == ModeOccupation_Code.AccessionProprieteLocalUsageExclusifHabitation: + propriete_2 = match_arg_508.value + temp_condition_logement_pret_2 = (propriete_2.pret.date_signature >= + date_of_numbers(2017,12,31)) + elif match_arg_508.code == ModeOccupation_Code.SousLocataire: + _ = match_arg_508.value + temp_condition_logement_pret_2 = False + elif match_arg_508.code == ModeOccupation_Code.LocationAccession: + propriete_3 = match_arg_508.value + temp_condition_logement_pret_2 = (propriete_3.pret.date_signature >= + date_of_numbers(2017,12,31)) + if temp_condition_logement_pret_2: + temp_condition_logement_pret_1 = False + else: + temp_condition_logement_pret_1 = dead_value + raise EmptyError + except EmptyError: + temp_condition_logement_pret_1 = True + except EmptyError: + temp_condition_logement_pret_1 = False + except EmptyError: + temp_condition_logement_pret_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=391, start_column=11, + end_line=391, end_column=34, + law_headings=["Éligibilité à l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + condition_logement_pret = temp_condition_logement_pret_1 + try: + temp_eligibilite_commune_dot_menage = menage_2 + except EmptyError: + temp_eligibilite_commune_dot_menage = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=311, start_column=10, + end_line=311, end_column=16, + law_headings=["Éligibilité aux aides personnelles au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + eligibilite_commune_dot_menage = temp_eligibilite_commune_dot_menage + try: + temp_eligibilite_commune_dot_demandeur = demandeur_2 + except EmptyError: + temp_eligibilite_commune_dot_demandeur = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=312, start_column=10, + end_line=312, end_column=19, + law_headings=["Éligibilité aux aides personnelles au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + eligibilite_commune_dot_demandeur = temp_eligibilite_commune_dot_demandeur + try: + temp_eligibilite_commune_dot_date_courante = date_courante_13 + except EmptyError: + temp_eligibilite_commune_dot_date_courante = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=313, start_column=17, + end_line=313, end_column=30, + law_headings=["Éligibilité aux aides personnelles au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + eligibilite_commune_dot_date_courante = temp_eligibilite_commune_dot_date_courante + def temp_eligibilite_commune_dot_condition_logement_residence_principale(_:Unit): + temp_eligibilite_commune_dot_condition_logement_residence_principale_1 = dead_value + raise EmptyError + return temp_eligibilite_commune_dot_condition_logement_residence_principale_1 + eligibilite_commune_dot_condition_logement_residence_principale = temp_eligibilite_commune_dot_condition_logement_residence_principale + def temp_eligibilite_commune_dot_condition_logement_surface(_:Unit): + temp_eligibilite_commune_dot_condition_logement_surface_1 = dead_value + raise EmptyError + return temp_eligibilite_commune_dot_condition_logement_surface_1 + eligibilite_commune_dot_condition_logement_surface = temp_eligibilite_commune_dot_condition_logement_surface + result_24 = eligibilite_aides_personnelle_logement(EligibiliteAidesPersonnelleLogementIn(menage_in = eligibilite_commune_dot_menage, + demandeur_in = eligibilite_commune_dot_demandeur, + date_courante_in = eligibilite_commune_dot_date_courante, + condition_logement_residence_principale_in = eligibilite_commune_dot_condition_logement_residence_principale, + condition_logement_surface_in = eligibilite_commune_dot_condition_logement_surface)) + eligibilite_commune_dot_date_courante_1 = result_24.date_courante_out + eligibilite_commune_dot_eligibilite = result_24.eligibilite_out + eligibilite_commune_dot_nombre_personnes_a_charge_prises_en_compte = result_24.nombre_personnes_a_charge_prises_en_compte_out + eligibilite_commune_dot_coefficents_enfants_garde_alternee_pris_en_compte = result_24.coefficents_enfants_garde_alternee_pris_en_compte_out + eligibilite_commune_dot_condition_2_r823_4 = result_24.condition_2_r823_4_out + try: + def temp_condition_logement_bailleur(_:Any): + return False + def temp_condition_logement_bailleur_1(_:Any): + return True + def temp_condition_logement_bailleur_2(_:Any): + try: + try: + match_arg_509 = menage_2.logement.mode_occupation + if match_arg_509.code == ModeOccupation_Code.Locataire: + _ = match_arg_509.value + temp_condition_logement_bailleur_3 = False + elif match_arg_509.code == ModeOccupation_Code.ResidentLogementFoyer: + logement_foyer_1 = match_arg_509.value + temp_condition_logement_bailleur_3 = logement_foyer_1.remplit_conditions_r832_21 + elif match_arg_509.code == ModeOccupation_Code.AccessionProprieteLocalUsageExclusifHabitation: + _ = match_arg_509.value + temp_condition_logement_bailleur_3 = False + elif match_arg_509.code == ModeOccupation_Code.SousLocataire: + _ = match_arg_509.value + temp_condition_logement_bailleur_3 = False + elif match_arg_509.code == ModeOccupation_Code.LocationAccession: + _ = match_arg_509.value + temp_condition_logement_bailleur_3 = False + if temp_condition_logement_bailleur_3: + return True + else: + raise EmptyError + except EmptyError: + match_arg_510 = menage_2.logement.mode_occupation + if match_arg_510.code == ModeOccupation_Code.Locataire: + _ = match_arg_510.value + temp_condition_logement_bailleur_4 = False + elif match_arg_510.code == ModeOccupation_Code.ResidentLogementFoyer: + _ = match_arg_510.value + temp_condition_logement_bailleur_4 = False + elif match_arg_510.code == ModeOccupation_Code.AccessionProprieteLocalUsageExclusifHabitation: + _ = match_arg_510.value + temp_condition_logement_bailleur_4 = False + elif match_arg_510.code == ModeOccupation_Code.SousLocataire: + _ = match_arg_510.value + temp_condition_logement_bailleur_4 = False + elif match_arg_510.code == ModeOccupation_Code.LocationAccession: + propriete_4 = match_arg_510.value + temp_condition_logement_bailleur_4 = caracteristiques_pret_l831_1_6( + propriete_4.pret) + if temp_condition_logement_bailleur_4: + return True + else: + raise EmptyError + except EmptyError: + match_arg_511 = menage_2.logement.mode_occupation + if match_arg_511.code == ModeOccupation_Code.Locataire: + _ = match_arg_511.value + temp_condition_logement_bailleur_5 = False + elif match_arg_511.code == ModeOccupation_Code.ResidentLogementFoyer: + _ = match_arg_511.value + temp_condition_logement_bailleur_5 = False + elif match_arg_511.code == ModeOccupation_Code.AccessionProprieteLocalUsageExclusifHabitation: + propriete_5 = match_arg_511.value + temp_condition_logement_bailleur_5 = caracteristiques_pret_l831_1_1( + propriete_5.pret) + elif match_arg_511.code == ModeOccupation_Code.SousLocataire: + _ = match_arg_511.value + temp_condition_logement_bailleur_5 = False + elif match_arg_511.code == ModeOccupation_Code.LocationAccession: + _ = match_arg_511.value + temp_condition_logement_bailleur_5 = False + if temp_condition_logement_bailleur_5: + return True + else: + raise EmptyError + def temp_condition_logement_bailleur_6(_:Any): + try: + try: + match_arg_512 = menage_2.logement.mode_occupation + if match_arg_512.code == ModeOccupation_Code.Locataire: + location = match_arg_512.value + match_arg_513 = location.bailleur.type_bailleur + if match_arg_513.code == TypeBailleur_Code.BailleurSocial: + _ = match_arg_513.value + temp_condition_logement_bailleur_7 = False + elif match_arg_513.code == TypeBailleur_Code.BailleurPrive: + _ = match_arg_513.value + temp_condition_logement_bailleur_7 = (location.bailleur.acquisition_aides_etat_pret_titre_II_ou_livre_III and + not location.bailleur.respecte_convention_titre_V) + elif match_arg_512.code == ModeOccupation_Code.ResidentLogementFoyer: + _ = match_arg_512.value + temp_condition_logement_bailleur_7 = False + elif match_arg_512.code == ModeOccupation_Code.AccessionProprieteLocalUsageExclusifHabitation: + _ = match_arg_512.value + temp_condition_logement_bailleur_7 = False + elif match_arg_512.code == ModeOccupation_Code.SousLocataire: + _ = match_arg_512.value + temp_condition_logement_bailleur_7 = False + elif match_arg_512.code == ModeOccupation_Code.LocationAccession: + _ = match_arg_512.value + temp_condition_logement_bailleur_7 = False + if temp_condition_logement_bailleur_7: + return False + else: + raise EmptyError + except EmptyError: + match_arg_514 = menage_2.logement.mode_occupation + if match_arg_514.code == ModeOccupation_Code.Locataire: + location_1 = match_arg_514.value + match_arg_515 = location_1.bailleur.type_bailleur + if match_arg_515.code == TypeBailleur_Code.BailleurSocial: + _ = match_arg_515.value + temp_condition_logement_bailleur_8 = (location_1.bailleur.construit_ameliore_conditions_l831_1_4 and + (location_1.bailleur.respecte_convention_titre_V or + location_1.bailleur.respecte_convention_titre_II)) + elif match_arg_515.code == TypeBailleur_Code.BailleurPrive: + _ = match_arg_515.value + temp_condition_logement_bailleur_8 = (location_1.bailleur.construit_ameliore_conditions_l831_1_4 and + (location_1.bailleur.respecte_convention_titre_V or + location_1.bailleur.respecte_convention_titre_II)) + elif match_arg_514.code == ModeOccupation_Code.ResidentLogementFoyer: + _ = match_arg_514.value + temp_condition_logement_bailleur_8 = False + elif match_arg_514.code == ModeOccupation_Code.AccessionProprieteLocalUsageExclusifHabitation: + _ = match_arg_514.value + temp_condition_logement_bailleur_8 = False + elif match_arg_514.code == ModeOccupation_Code.SousLocataire: + _ = match_arg_514.value + temp_condition_logement_bailleur_8 = False + elif match_arg_514.code == ModeOccupation_Code.LocationAccession: + _ = match_arg_514.value + temp_condition_logement_bailleur_8 = False + if temp_condition_logement_bailleur_8: + return True + else: + raise EmptyError + except EmptyError: + match_arg_516 = menage_2.logement.mode_occupation + if match_arg_516.code == ModeOccupation_Code.Locataire: + location_2 = match_arg_516.value + match_arg_517 = location_2.bailleur.type_bailleur + if match_arg_517.code == TypeBailleur_Code.BailleurSocial: + _ = match_arg_517.value + temp_condition_logement_bailleur_9 = location_2.bailleur.respecte_convention_titre_V + elif match_arg_517.code == TypeBailleur_Code.BailleurPrive: + _ = match_arg_517.value + temp_condition_logement_bailleur_9 = location_2.bailleur.respecte_convention_titre_II + elif match_arg_516.code == ModeOccupation_Code.ResidentLogementFoyer: + _ = match_arg_516.value + temp_condition_logement_bailleur_9 = False + elif match_arg_516.code == ModeOccupation_Code.AccessionProprieteLocalUsageExclusifHabitation: + _ = match_arg_516.value + temp_condition_logement_bailleur_9 = False + elif match_arg_516.code == ModeOccupation_Code.SousLocataire: + _ = match_arg_516.value + temp_condition_logement_bailleur_9 = False + elif match_arg_516.code == ModeOccupation_Code.LocationAccession: + _ = match_arg_516.value + temp_condition_logement_bailleur_9 = False + if temp_condition_logement_bailleur_9: + return True + else: + raise EmptyError + temp_condition_logement_bailleur_10 = handle_default(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=390, + start_column=11, + end_line=390, end_column=38, + law_headings=["Éligibilité à l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"]), [temp_condition_logement_bailleur_6, + temp_condition_logement_bailleur_2], + temp_condition_logement_bailleur_1, + temp_condition_logement_bailleur) + except EmptyError: + temp_condition_logement_bailleur_10 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=390, start_column=11, + end_line=390, end_column=38, + law_headings=["Éligibilité à l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + condition_logement_bailleur = temp_condition_logement_bailleur_10 + try: + temp_coefficents_enfants_garde_alternee_pris_en_compte_3 = eligibilite_commune_dot_coefficents_enfants_garde_alternee_pris_en_compte + except EmptyError: + temp_coefficents_enfants_garde_alternee_pris_en_compte_3 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=399, start_column=10, + end_line=399, end_column=59, + law_headings=["Éligibilité à l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + coefficents_enfants_garde_alternee_pris_en_compte_1 = temp_coefficents_enfants_garde_alternee_pris_en_compte_3 + try: + temp_nombre_personnes_a_charge_prises_en_compte_1 = eligibilite_commune_dot_nombre_personnes_a_charge_prises_en_compte + except EmptyError: + temp_nombre_personnes_a_charge_prises_en_compte_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=398, start_column=10, + end_line=398, end_column=52, + law_headings=["Éligibilité à l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + nombre_personnes_a_charge_prises_en_compte_1 = temp_nombre_personnes_a_charge_prises_en_compte_1 + try: + try: + if (condition_logement_bailleur and (condition_logement_pret and + eligibilite_commune_dot_eligibilite)): + temp_eligibilite_1 = True + else: + temp_eligibilite_1 = dead_value + raise EmptyError + except EmptyError: + temp_eligibilite_1 = False + except EmptyError: + temp_eligibilite_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=397, start_column=10, + end_line=397, end_column=21, + law_headings=["Éligibilité à l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + eligibilite_1 = temp_eligibilite_1 + return EligibiliteAidePersonnaliseeLogementOut(date_courante_out = date_courante_13, + eligibilite_out = eligibilite_1, + nombre_personnes_a_charge_prises_en_compte_out = nombre_personnes_a_charge_prises_en_compte_1, + coefficents_enfants_garde_alternee_pris_en_compte_out = coefficents_enfants_garde_alternee_pris_en_compte_1) + +def eligibilite_allocation_logement(eligibilite_allocation_logement_in:EligibiliteAllocationLogementIn): + date_courante_14 = eligibilite_allocation_logement_in.date_courante_in + menage_3 = eligibilite_allocation_logement_in.menage_in + demandeur_3 = eligibilite_allocation_logement_in.demandeur_in + beneficie_aide_personnalisee_logement = eligibilite_allocation_logement_in.beneficie_aide_personnalisee_logement_in + informations_calcul_1 = eligibilite_allocation_logement_in.informations_calcul_in + try: + temp_duree_l841_1_3 = duration_of_numbers(5,0,0) + except EmptyError: + temp_duree_l841_1_3 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=433, start_column=11, + end_line=433, end_column=25, + law_headings=["Éligibilité aux allocations de logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + duree_l841_1_3 = temp_duree_l841_1_3 + try: + temp_prestations_familiales_dot_date_courante = date_courante_14 + except EmptyError: + temp_prestations_familiales_dot_date_courante = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/../prestations_familiales/prologue.catala_fr", + start_line=46, start_column=10, + end_line=46, end_column=23, + law_headings=["Prologue : prestations familiales"])) + prestations_familiales_dot_date_courante = temp_prestations_familiales_dot_date_courante + try: + temp_prestations_familiales_dot_prestation_courante = ElementPrestationsFamiliales(ElementPrestationsFamiliales_Code.AllocationsFamiliales, + Unit()) + except EmptyError: + temp_prestations_familiales_dot_prestation_courante = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/../prestations_familiales/prologue.catala_fr", + start_line=47, start_column=10, + end_line=47, end_column=29, + law_headings=["Prologue : prestations familiales"])) + prestations_familiales_dot_prestation_courante = temp_prestations_familiales_dot_prestation_courante + try: + temp_prestations_familiales_dot_residence = Collectivite(Collectivite_Code.Metropole, + Unit()) + except EmptyError: + temp_prestations_familiales_dot_residence = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/../prestations_familiales/prologue.catala_fr", + start_line=48, start_column=10, + end_line=48, end_column=19, + law_headings=["Prologue : prestations familiales"])) + prestations_familiales_dot_residence = temp_prestations_familiales_dot_residence + result_25 = eligibilite_prestations_familiales(EligibilitePrestationsFamilialesIn(date_courante_in = prestations_familiales_dot_date_courante, + prestation_courante_in = prestations_familiales_dot_prestation_courante, + residence_in = prestations_familiales_dot_residence)) + prestations_familiales_dot_droit_ouvert = result_25.droit_ouvert_out + prestations_familiales_dot_conditions_hors_age = result_25.conditions_hors_age_out + prestations_familiales_dot_age_l512_3_2 = result_25.age_l512_3_2_out + prestations_familiales_dot_regime_outre_mer_l751_1 = result_25.regime_outre_mer_l751_1_out + try: + temp_eligibilite_commune_dot_menage_1 = menage_3 + except EmptyError: + temp_eligibilite_commune_dot_menage_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=311, start_column=10, + end_line=311, end_column=16, + law_headings=["Éligibilité aux aides personnelles au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + eligibilite_commune_dot_menage_1 = temp_eligibilite_commune_dot_menage_1 + try: + temp_eligibilite_commune_dot_demandeur_1 = demandeur_3 + except EmptyError: + temp_eligibilite_commune_dot_demandeur_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=312, start_column=10, + end_line=312, end_column=19, + law_headings=["Éligibilité aux aides personnelles au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + eligibilite_commune_dot_demandeur_1 = temp_eligibilite_commune_dot_demandeur_1 + try: + temp_eligibilite_commune_dot_date_courante_1 = date_courante_14 + except EmptyError: + temp_eligibilite_commune_dot_date_courante_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=313, start_column=17, + end_line=313, end_column=30, + law_headings=["Éligibilité aux aides personnelles au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + eligibilite_commune_dot_date_courante_2 = temp_eligibilite_commune_dot_date_courante_1 + def temp_eligibilite_commune_dot_condition_logement_residence_principale_2(_:Unit): + try: + match_arg_518 = menage_3.logement.mode_occupation + if match_arg_518.code == ModeOccupation_Code.Locataire: + _ = match_arg_518.value + temp_eligibilite_commune_dot_condition_logement_residence_principale_3 = False + elif match_arg_518.code == ModeOccupation_Code.ResidentLogementFoyer: + logement_foyer_2 = match_arg_518.value + temp_eligibilite_commune_dot_condition_logement_residence_principale_3 = logement_foyer_2.construit_application_loi_1957_12_III + elif match_arg_518.code == ModeOccupation_Code.AccessionProprieteLocalUsageExclusifHabitation: + _ = match_arg_518.value + temp_eligibilite_commune_dot_condition_logement_residence_principale_3 = False + elif match_arg_518.code == ModeOccupation_Code.SousLocataire: + _ = match_arg_518.value + temp_eligibilite_commune_dot_condition_logement_residence_principale_3 = False + elif match_arg_518.code == ModeOccupation_Code.LocationAccession: + _ = match_arg_518.value + temp_eligibilite_commune_dot_condition_logement_residence_principale_3 = False + if temp_eligibilite_commune_dot_condition_logement_residence_principale_3: + temp_eligibilite_commune_dot_condition_logement_residence_principale_4 = True + else: + temp_eligibilite_commune_dot_condition_logement_residence_principale_4 = dead_value + raise EmptyError + except EmptyError: + temp_eligibilite_commune_dot_condition_logement_residence_principale_4 = False + return temp_eligibilite_commune_dot_condition_logement_residence_principale_4 + eligibilite_commune_dot_condition_logement_residence_principale_1 = temp_eligibilite_commune_dot_condition_logement_residence_principale_2 + def temp_eligibilite_commune_dot_condition_logement_surface_2(_:Unit): + try: + match_arg_519 = menage_3.logement.mode_occupation + if match_arg_519.code == ModeOccupation_Code.Locataire: + _ = match_arg_519.value + temp_eligibilite_commune_dot_condition_logement_surface_3 = False + elif match_arg_519.code == ModeOccupation_Code.ResidentLogementFoyer: + logement_foyer_3 = match_arg_519.value + temp_eligibilite_commune_dot_condition_logement_surface_3 = logement_foyer_3.construit_application_loi_1957_12_III + elif match_arg_519.code == ModeOccupation_Code.AccessionProprieteLocalUsageExclusifHabitation: + _ = match_arg_519.value + temp_eligibilite_commune_dot_condition_logement_surface_3 = False + elif match_arg_519.code == ModeOccupation_Code.SousLocataire: + _ = match_arg_519.value + temp_eligibilite_commune_dot_condition_logement_surface_3 = False + elif match_arg_519.code == ModeOccupation_Code.LocationAccession: + _ = match_arg_519.value + temp_eligibilite_commune_dot_condition_logement_surface_3 = False + if temp_eligibilite_commune_dot_condition_logement_surface_3: + temp_eligibilite_commune_dot_condition_logement_surface_4 = True + else: + temp_eligibilite_commune_dot_condition_logement_surface_4 = dead_value + raise EmptyError + except EmptyError: + temp_eligibilite_commune_dot_condition_logement_surface_4 = False + return temp_eligibilite_commune_dot_condition_logement_surface_4 + eligibilite_commune_dot_condition_logement_surface_1 = temp_eligibilite_commune_dot_condition_logement_surface_2 + result_26 = eligibilite_aides_personnelle_logement(EligibiliteAidesPersonnelleLogementIn(menage_in = eligibilite_commune_dot_menage_1, + demandeur_in = eligibilite_commune_dot_demandeur_1, + date_courante_in = eligibilite_commune_dot_date_courante_2, + condition_logement_residence_principale_in = eligibilite_commune_dot_condition_logement_residence_principale_1, + condition_logement_surface_in = eligibilite_commune_dot_condition_logement_surface_1)) + eligibilite_commune_dot_date_courante_3 = result_26.date_courante_out + eligibilite_commune_dot_eligibilite_1 = result_26.eligibilite_out + eligibilite_commune_dot_nombre_personnes_a_charge_prises_en_compte_1 = result_26.nombre_personnes_a_charge_prises_en_compte_out + eligibilite_commune_dot_coefficents_enfants_garde_alternee_pris_en_compte_1 = result_26.coefficents_enfants_garde_alternee_pris_en_compte_out + eligibilite_commune_dot_condition_2_r823_4_1 = result_26.condition_2_r823_4_out + try: + try: + if demandeur_3.personne_hebergee_centre_soin_l_L162_22_3_securite_sociale: + temp_eligibilite_allocation_logement_sociale = True + else: + temp_eligibilite_allocation_logement_sociale = dead_value + raise EmptyError + except EmptyError: + temp_eligibilite_allocation_logement_sociale = False + except EmptyError: + temp_eligibilite_allocation_logement_sociale = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=432, start_column=11, + end_line=432, end_column=50, + law_headings=["Éligibilité aux allocations de logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + eligibilite_allocation_logement_sociale = temp_eligibilite_allocation_logement_sociale + try: + try: + try: + try: + match_arg_520 = informations_calcul_1 + if match_arg_520.code == InformationsCalculAPL_Code.InfosLocatif: + _ = match_arg_520.value + temp_condition_logement = False + elif match_arg_520.code == InformationsCalculAPL_Code.InfosLogementFoyer: + _ = match_arg_520.value + temp_condition_logement = False + elif match_arg_520.code == InformationsCalculAPL_Code.InfosAccessionPropriete: + infos_19 = match_arg_520.value + match_arg_521 = menage_3.logement.mode_occupation + if match_arg_521.code == ModeOccupation_Code.Locataire: + _ = match_arg_521.value + temp_condition_logement = False + elif match_arg_521.code == ModeOccupation_Code.ResidentLogementFoyer: + _ = match_arg_521.value + temp_condition_logement = False + elif match_arg_521.code == ModeOccupation_Code.AccessionProprieteLocalUsageExclusifHabitation: + proprietaire = match_arg_521.value + match_arg_522 = infos_19.type_travaux_logement_r842_5 + if match_arg_522.code == TypeTravauxLogementR8425_Code.ObjectifDecenceLogement: + _ = match_arg_522.value + temp_condition_logement_1 = False + elif match_arg_522.code == TypeTravauxLogementR8425_Code.PrevuDansListeR321_15: + _ = match_arg_522.value + temp_condition_logement_1 = False + elif match_arg_522.code == TypeTravauxLogementR8425_Code.AgrandirOuRendreHabitableD331_63: + _ = match_arg_522.value + temp_condition_logement_1 = True + elif match_arg_522.code == TypeTravauxLogementR8425_Code.PasDeTravaux: + _ = match_arg_522.value + temp_condition_logement_1 = False + match_arg_523 = proprietaire.pret.titulaire_pret + if match_arg_523.code == TitulairePret_Code.Demandeur: + _ = match_arg_523.value + temp_condition_logement_2 = True + elif match_arg_523.code == TitulairePret_Code.VendeurQuandDemandeurAContratLocationAccession: + _ = match_arg_523.value + temp_condition_logement_2 = False + temp_condition_logement = (temp_condition_logement_2 and + temp_condition_logement_1) + elif match_arg_521.code == ModeOccupation_Code.SousLocataire: + _ = match_arg_521.value + temp_condition_logement = False + elif match_arg_521.code == ModeOccupation_Code.LocationAccession: + _ = match_arg_521.value + temp_condition_logement = False + if temp_condition_logement: + temp_condition_logement_3 = True + else: + temp_condition_logement_3 = dead_value + raise EmptyError + except EmptyError: + match_arg_524 = informations_calcul_1 + if match_arg_524.code == InformationsCalculAPL_Code.InfosLocatif: + _ = match_arg_524.value + temp_condition_logement_4 = False + elif match_arg_524.code == InformationsCalculAPL_Code.InfosLogementFoyer: + _ = match_arg_524.value + temp_condition_logement_4 = False + elif match_arg_524.code == InformationsCalculAPL_Code.InfosAccessionPropriete: + infos_20 = match_arg_524.value + match_arg_525 = menage_3.logement.mode_occupation + if match_arg_525.code == ModeOccupation_Code.Locataire: + _ = match_arg_525.value + temp_condition_logement_4 = False + elif match_arg_525.code == ModeOccupation_Code.ResidentLogementFoyer: + _ = match_arg_525.value + temp_condition_logement_4 = False + elif match_arg_525.code == ModeOccupation_Code.AccessionProprieteLocalUsageExclusifHabitation: + proprietaire_1 = match_arg_525.value + match_arg_526 = infos_20.type_travaux_logement_r842_5 + if match_arg_526.code == TypeTravauxLogementR8425_Code.ObjectifDecenceLogement: + _ = match_arg_526.value + temp_condition_logement_5 = False + elif match_arg_526.code == TypeTravauxLogementR8425_Code.PrevuDansListeR321_15: + _ = match_arg_526.value + temp_condition_logement_5 = True + elif match_arg_526.code == TypeTravauxLogementR8425_Code.AgrandirOuRendreHabitableD331_63: + _ = match_arg_526.value + temp_condition_logement_5 = False + elif match_arg_526.code == TypeTravauxLogementR8425_Code.PasDeTravaux: + _ = match_arg_526.value + temp_condition_logement_5 = False + match_arg_527 = proprietaire_1.pret.titulaire_pret + if match_arg_527.code == TitulairePret_Code.Demandeur: + _ = match_arg_527.value + temp_condition_logement_6 = True + elif match_arg_527.code == TitulairePret_Code.VendeurQuandDemandeurAContratLocationAccession: + _ = match_arg_527.value + temp_condition_logement_6 = False + temp_condition_logement_4 = (temp_condition_logement_6 and + temp_condition_logement_5) + elif match_arg_525.code == ModeOccupation_Code.SousLocataire: + _ = match_arg_525.value + temp_condition_logement_4 = False + elif match_arg_525.code == ModeOccupation_Code.LocationAccession: + _ = match_arg_525.value + temp_condition_logement_4 = False + if temp_condition_logement_4: + temp_condition_logement_3 = True + else: + temp_condition_logement_3 = dead_value + raise EmptyError + except EmptyError: + match_arg_528 = informations_calcul_1 + if match_arg_528.code == InformationsCalculAPL_Code.InfosLocatif: + _ = match_arg_528.value + temp_condition_logement_7 = False + elif match_arg_528.code == InformationsCalculAPL_Code.InfosLogementFoyer: + _ = match_arg_528.value + temp_condition_logement_7 = False + elif match_arg_528.code == InformationsCalculAPL_Code.InfosAccessionPropriete: + infos_21 = match_arg_528.value + match_arg_529 = menage_3.logement.mode_occupation + if match_arg_529.code == ModeOccupation_Code.Locataire: + _ = match_arg_529.value + temp_condition_logement_7 = False + elif match_arg_529.code == ModeOccupation_Code.ResidentLogementFoyer: + _ = match_arg_529.value + temp_condition_logement_7 = False + elif match_arg_529.code == ModeOccupation_Code.AccessionProprieteLocalUsageExclusifHabitation: + proprietaire_2 = match_arg_529.value + match_arg_530 = infos_21.type_travaux_logement_r842_5 + if match_arg_530.code == TypeTravauxLogementR8425_Code.ObjectifDecenceLogement: + _ = match_arg_530.value + temp_condition_logement_8 = True + elif match_arg_530.code == TypeTravauxLogementR8425_Code.PrevuDansListeR321_15: + _ = match_arg_530.value + temp_condition_logement_8 = False + elif match_arg_530.code == TypeTravauxLogementR8425_Code.AgrandirOuRendreHabitableD331_63: + _ = match_arg_530.value + temp_condition_logement_8 = False + elif match_arg_530.code == TypeTravauxLogementR8425_Code.PasDeTravaux: + _ = match_arg_530.value + temp_condition_logement_8 = False + match_arg_531 = infos_21.type_travaux_logement_r842_5 + if match_arg_531.code == TypeTravauxLogementR8425_Code.ObjectifDecenceLogement: + _ = match_arg_531.value + temp_condition_logement_9 = False + elif match_arg_531.code == TypeTravauxLogementR8425_Code.PrevuDansListeR321_15: + _ = match_arg_531.value + temp_condition_logement_9 = False + elif match_arg_531.code == TypeTravauxLogementR8425_Code.AgrandirOuRendreHabitableD331_63: + _ = match_arg_531.value + temp_condition_logement_9 = False + elif match_arg_531.code == TypeTravauxLogementR8425_Code.PasDeTravaux: + _ = match_arg_531.value + temp_condition_logement_9 = True + match_arg_532 = proprietaire_2.pret.titulaire_pret + if match_arg_532.code == TitulairePret_Code.Demandeur: + _ = match_arg_532.value + temp_condition_logement_10 = True + elif match_arg_532.code == TitulairePret_Code.VendeurQuandDemandeurAContratLocationAccession: + _ = match_arg_532.value + temp_condition_logement_10 = False + temp_condition_logement_7 = (temp_condition_logement_10 and + (temp_condition_logement_9 or + temp_condition_logement_8)) + elif match_arg_529.code == ModeOccupation_Code.SousLocataire: + _ = match_arg_529.value + temp_condition_logement_7 = False + elif match_arg_529.code == ModeOccupation_Code.LocationAccession: + _ = match_arg_529.value + temp_condition_logement_7 = False + if temp_condition_logement_7: + temp_condition_logement_3 = True + else: + temp_condition_logement_3 = dead_value + raise EmptyError + except EmptyError: + temp_condition_logement_3 = False + except EmptyError: + temp_condition_logement_3 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=429, start_column=11, + end_line=429, end_column=29, + law_headings=["Éligibilité aux allocations de logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + condition_logement = temp_condition_logement_3 + try: + temp_coefficents_enfants_garde_alternee_pris_en_compte_4 = eligibilite_commune_dot_coefficents_enfants_garde_alternee_pris_en_compte_1 + except EmptyError: + temp_coefficents_enfants_garde_alternee_pris_en_compte_4 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=444, start_column=10, + end_line=444, end_column=59, + law_headings=["Éligibilité aux allocations de logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + coefficents_enfants_garde_alternee_pris_en_compte_2 = temp_coefficents_enfants_garde_alternee_pris_en_compte_4 + try: + temp_nombre_personnes_a_charge_prises_en_compte_2 = eligibilite_commune_dot_nombre_personnes_a_charge_prises_en_compte_1 + except EmptyError: + temp_nombre_personnes_a_charge_prises_en_compte_2 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=443, start_column=10, + end_line=443, end_column=52, + law_headings=["Éligibilité aux allocations de logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + nombre_personnes_a_charge_prises_en_compte_2 = temp_nombre_personnes_a_charge_prises_en_compte_2 + try: + if not eligibilite_commune_dot_eligibilite_1: + temp_eligibilite_dispositions_communes = EligibiliteAllocationLogement(EligibiliteAllocationLogement_Code.PasEligible, + Unit()) + else: + temp_eligibilite_dispositions_communes = EligibiliteAllocationLogement(EligibiliteAllocationLogement_Code.AllocationLogementSociale, + Unit()) + except EmptyError: + temp_eligibilite_dispositions_communes = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=440, start_column=10, + end_line=440, end_column=31, + law_headings=["Éligibilité aux allocations de logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + eligibilite_dispositions_communes = temp_eligibilite_dispositions_communes + try: + try: + try: + try: + try: + try: + match_arg_533 = menage_3.situation_familiale + if match_arg_533.code == SituationFamiliale_Code.Celibataire: + _ = match_arg_533.value + temp_eligibilite_allocation_logement_familiale = ((list_length(menage_3.personnes_a_charge) == + integer_of_string("0")) and + menage_3.enfant_a_naitre_apres_quatrieme_mois_grossesse) + elif match_arg_533.code == SituationFamiliale_Code.Maries: + _ = match_arg_533.value + temp_eligibilite_allocation_logement_familiale = False + elif match_arg_533.code == SituationFamiliale_Code.Pacses: + _ = match_arg_533.value + temp_eligibilite_allocation_logement_familiale = False + elif match_arg_533.code == SituationFamiliale_Code.Concubins: + _ = match_arg_533.value + temp_eligibilite_allocation_logement_familiale = False + elif match_arg_533.code == SituationFamiliale_Code.CelibataireSepareDeFait: + _ = match_arg_533.value + temp_eligibilite_allocation_logement_familiale = False + elif match_arg_533.code == SituationFamiliale_Code.ConcubinageDontSepareDeFait: + _ = match_arg_533.value + temp_eligibilite_allocation_logement_familiale = False + if temp_eligibilite_allocation_logement_familiale: + temp_eligibilite_allocation_logement_familiale_1 = True + else: + temp_eligibilite_allocation_logement_familiale_1 = dead_value + raise EmptyError + except EmptyError: + try: + def temp_eligibilite_allocation_logement_familiale_2(acc_8:Integer, personne_a_charge_6:Any): + match_arg_534 = personne_a_charge_6 + if match_arg_534.code == PersonneACharge_Code.EnfantACharge: + enfant_5 = match_arg_534.value + temp_eligibilite_allocation_logement_familiale_3 = False + elif match_arg_534.code == PersonneACharge_Code.AutrePersonneACharge: + parent_3 = match_arg_534.value + temp_eligibilite_allocation_logement_familiale_3 = (parent_3.ascendant_descendant_collateral_deuxieme_troisieme_degre and + parent_3.incapacite_80_pourcent_ou_restriction_emploi) + if temp_eligibilite_allocation_logement_familiale_3: + return (acc_8 + + integer_of_string("1")) + else: + return acc_8 + if (list_fold_left(temp_eligibilite_allocation_logement_familiale_2, + integer_of_string("0"), + menage_3.personnes_a_charge) >= + integer_of_string("1")): + temp_eligibilite_allocation_logement_familiale_1 = True + else: + temp_eligibilite_allocation_logement_familiale_1 = dead_value + raise EmptyError + except EmptyError: + def temp_eligibilite_allocation_logement_familiale_4(acc_9:Integer, personne_a_charge_7:Any): + if eligibilite_commune_dot_condition_2_r823_4_1( + personne_a_charge_7): + return (acc_9 + + integer_of_string("1")) + else: + return acc_9 + if (list_fold_left(temp_eligibilite_allocation_logement_familiale_4, + integer_of_string("0"), + menage_3.personnes_a_charge) >= + integer_of_string("1")): + temp_eligibilite_allocation_logement_familiale_1 = True + else: + temp_eligibilite_allocation_logement_familiale_1 = dead_value + raise EmptyError + except EmptyError: + match_arg_535 = menage_3.situation_familiale + if match_arg_535.code == SituationFamiliale_Code.Celibataire: + _ = match_arg_535.value + temp_eligibilite_allocation_logement_familiale_5 = False + elif match_arg_535.code == SituationFamiliale_Code.Maries: + date_mariage = match_arg_535.value + temp_eligibilite_allocation_logement_familiale_5 = (date_courante_14 <= + (date_mariage + duree_l841_1_3)) + elif match_arg_535.code == SituationFamiliale_Code.Pacses: + _ = match_arg_535.value + temp_eligibilite_allocation_logement_familiale_5 = False + elif match_arg_535.code == SituationFamiliale_Code.Concubins: + _ = match_arg_535.value + temp_eligibilite_allocation_logement_familiale_5 = False + elif match_arg_535.code == SituationFamiliale_Code.CelibataireSepareDeFait: + _ = match_arg_535.value + temp_eligibilite_allocation_logement_familiale_5 = False + elif match_arg_535.code == SituationFamiliale_Code.ConcubinageDontSepareDeFait: + _ = match_arg_535.value + temp_eligibilite_allocation_logement_familiale_5 = False + def temp_eligibilite_allocation_logement_familiale_6(acc_10:Integer, personne_a_charge_8:Any): + match_arg_536 = personne_a_charge_8 + if match_arg_536.code == PersonneACharge_Code.EnfantACharge: + enfant_6 = match_arg_536.value + match_arg_537 = enfant_6.prise_en_charge + if match_arg_537.code == PriseEnCharge_Code.EffectiveEtPermanente: + _ = match_arg_537.value + temp_eligibilite_allocation_logement_familiale_7 = PriseEnChargeEnfant(PriseEnChargeEnfant_Code.EffectiveEtPermanente, + Unit()) + elif match_arg_537.code == PriseEnCharge_Code.ResidenceAlterneeAllocataireUnique: + _ = match_arg_537.value + temp_eligibilite_allocation_logement_familiale_7 = PriseEnChargeEnfant(PriseEnChargeEnfant_Code.GardeAlterneeAllocataireUnique, + Unit()) + elif match_arg_537.code == PriseEnCharge_Code.ResidenceAlterneeAllocationsPartagee: + _ = match_arg_537.value + temp_eligibilite_allocation_logement_familiale_7 = PriseEnChargeEnfant(PriseEnChargeEnfant_Code.GardeAlterneePartageAllocations, + Unit()) + temp_eligibilite_allocation_logement_familiale_8 = not prestations_familiales_dot_droit_ouvert( + EnfantPrestationsFamiliales(identifiant = enfant_6.identifiant, + obligation_scolaire = enfant_6.obligation_scolaire, + remuneration_mensuelle = enfant_6.remuneration_mensuelle, + date_de_naissance = enfant_6.date_de_naissance, + age = enfant_6.age, + prise_en_charge = temp_eligibilite_allocation_logement_familiale_7, + a_deja_ouvert_droit_aux_allocations_familiales = enfant_6.a_deja_ouvert_droit_aux_allocations_familiales, + beneficie_titre_personnel_aide_personnelle_logement = enfant_6.beneficie_titre_personnel_aide_personnelle_logement)) + elif match_arg_536.code == PersonneACharge_Code.AutrePersonneACharge: + _ = match_arg_536.value + temp_eligibilite_allocation_logement_familiale_8 = False + if temp_eligibilite_allocation_logement_familiale_8: + return (acc_10 + integer_of_string("1")) + else: + return acc_10 + if ((list_fold_left(temp_eligibilite_allocation_logement_familiale_6, + integer_of_string("0"), + menage_3.personnes_a_charge) == + integer_of_string("0")) and + temp_eligibilite_allocation_logement_familiale_5): + temp_eligibilite_allocation_logement_familiale_1 = True + else: + temp_eligibilite_allocation_logement_familiale_1 = dead_value + raise EmptyError + except EmptyError: + def temp_eligibilite_allocation_logement_familiale_9(acc_11:Integer, personne_a_charge_9:Any): + match_arg_538 = personne_a_charge_9 + if match_arg_538.code == PersonneACharge_Code.EnfantACharge: + enfant_7 = match_arg_538.value + match_arg_539 = enfant_7.prise_en_charge + if match_arg_539.code == PriseEnCharge_Code.EffectiveEtPermanente: + _ = match_arg_539.value + temp_eligibilite_allocation_logement_familiale_10 = PriseEnChargeEnfant(PriseEnChargeEnfant_Code.EffectiveEtPermanente, + Unit()) + elif match_arg_539.code == PriseEnCharge_Code.ResidenceAlterneeAllocataireUnique: + _ = match_arg_539.value + temp_eligibilite_allocation_logement_familiale_10 = PriseEnChargeEnfant(PriseEnChargeEnfant_Code.GardeAlterneeAllocataireUnique, + Unit()) + elif match_arg_539.code == PriseEnCharge_Code.ResidenceAlterneeAllocationsPartagee: + _ = match_arg_539.value + temp_eligibilite_allocation_logement_familiale_10 = PriseEnChargeEnfant(PriseEnChargeEnfant_Code.GardeAlterneePartageAllocations, + Unit()) + temp_eligibilite_allocation_logement_familiale_11 = prestations_familiales_dot_droit_ouvert( + EnfantPrestationsFamiliales(identifiant = enfant_7.identifiant, + obligation_scolaire = enfant_7.obligation_scolaire, + remuneration_mensuelle = enfant_7.remuneration_mensuelle, + date_de_naissance = enfant_7.date_de_naissance, + age = enfant_7.age, + prise_en_charge = temp_eligibilite_allocation_logement_familiale_10, + a_deja_ouvert_droit_aux_allocations_familiales = enfant_7.a_deja_ouvert_droit_aux_allocations_familiales, + beneficie_titre_personnel_aide_personnelle_logement = enfant_7.beneficie_titre_personnel_aide_personnelle_logement)) + elif match_arg_538.code == PersonneACharge_Code.AutrePersonneACharge: + _ = match_arg_538.value + temp_eligibilite_allocation_logement_familiale_11 = False + if temp_eligibilite_allocation_logement_familiale_11: + return (acc_11 + integer_of_string("1")) + else: + return acc_11 + if (list_fold_left(temp_eligibilite_allocation_logement_familiale_9, + integer_of_string("0"), + menage_3.personnes_a_charge) == + integer_of_string("1")): + temp_eligibilite_allocation_logement_familiale_1 = True + else: + temp_eligibilite_allocation_logement_familiale_1 = dead_value + raise EmptyError + except EmptyError: + def temp_eligibilite_allocation_logement_familiale_12(acc_12:bool, prestation_1:Any): + return (acc_12 or ((prestation_1 == + PrestationRecue(PrestationRecue_Code.AllocationsFamiliales, + Unit())) or ((prestation_1 == + PrestationRecue(PrestationRecue_Code.ComplementFamilial, + Unit())) or ((prestation_1 == + PrestationRecue(PrestationRecue_Code.AllocationSoutienFamilial, + Unit())) or (prestation_1 == + PrestationRecue(PrestationRecue_Code.AllocationSoutienEnfantHandicape, + Unit())))))) + if list_fold_left(temp_eligibilite_allocation_logement_familiale_12, + False, menage_3.prestations_recues): + temp_eligibilite_allocation_logement_familiale_1 = True + else: + temp_eligibilite_allocation_logement_familiale_1 = dead_value + raise EmptyError + except EmptyError: + temp_eligibilite_allocation_logement_familiale_1 = False + except EmptyError: + temp_eligibilite_allocation_logement_familiale_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=431, start_column=11, + end_line=431, end_column=52, + law_headings=["Éligibilité aux allocations de logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + eligibilite_allocation_logement_familiale = temp_eligibilite_allocation_logement_familiale_1 + try: + try: + match_arg_540 = menage_3.logement.mode_occupation + if match_arg_540.code == ModeOccupation_Code.Locataire: + _ = match_arg_540.value + temp_eligibilite_l841_2 = False + elif match_arg_540.code == ModeOccupation_Code.ResidentLogementFoyer: + _ = match_arg_540.value + temp_eligibilite_l841_2 = False + elif match_arg_540.code == ModeOccupation_Code.AccessionProprieteLocalUsageExclusifHabitation: + proprietaire_3 = match_arg_540.value + temp_eligibilite_l841_2 = (proprietaire_3.pret.date_signature > + date_of_numbers(2017,12,31)) + elif match_arg_540.code == ModeOccupation_Code.SousLocataire: + _ = match_arg_540.value + temp_eligibilite_l841_2 = False + elif match_arg_540.code == ModeOccupation_Code.LocationAccession: + _ = match_arg_540.value + temp_eligibilite_l841_2 = False + if temp_eligibilite_l841_2: + temp_eligibilite_l841_2_1 = EligibiliteAllocationLogement(EligibiliteAllocationLogement_Code.PasEligible, + Unit()) + else: + temp_eligibilite_l841_2_1 = dead_value + raise EmptyError + except EmptyError: + if ((eligibilite_dispositions_communes == + EligibiliteAllocationLogement(EligibiliteAllocationLogement_Code.PasEligible, + Unit())) or + beneficie_aide_personnalisee_logement): + temp_eligibilite_l841_2_1 = EligibiliteAllocationLogement(EligibiliteAllocationLogement_Code.PasEligible, + Unit()) + else: + if eligibilite_allocation_logement_familiale: + temp_eligibilite_l841_2_1 = EligibiliteAllocationLogement(EligibiliteAllocationLogement_Code.AllocationLogementFamiliale, + Unit()) + else: + if eligibilite_allocation_logement_sociale: + temp_eligibilite_l841_2_1 = EligibiliteAllocationLogement(EligibiliteAllocationLogement_Code.AllocationLogementSociale, + Unit()) + else: + temp_eligibilite_l841_2_1 = EligibiliteAllocationLogement(EligibiliteAllocationLogement_Code.PasEligible, + Unit()) + except EmptyError: + temp_eligibilite_l841_2_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=441, start_column=10, + end_line=441, end_column=16, + law_headings=["Éligibilité aux allocations de logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + eligibilite_l841_2 = temp_eligibilite_l841_2_1 + try: + if not condition_logement: + temp_eligibilite_avec_condition_logement = EligibiliteAllocationLogement(EligibiliteAllocationLogement_Code.PasEligible, + Unit()) + else: + temp_eligibilite_avec_condition_logement = eligibilite_l841_2 + except EmptyError: + temp_eligibilite_avec_condition_logement = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=442, start_column=10, + end_line=442, end_column=33, + law_headings=["Éligibilité aux allocations de logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + eligibilite_avec_condition_logement = temp_eligibilite_avec_condition_logement + return EligibiliteAllocationLogementOut(eligibilite_avec_condition_logement_out = eligibilite_avec_condition_logement, + nombre_personnes_a_charge_prises_en_compte_out = nombre_personnes_a_charge_prises_en_compte_2, + coefficents_enfants_garde_alternee_pris_en_compte_out = coefficents_enfants_garde_alternee_pris_en_compte_2) + +def calcul_allocation_logement(calcul_allocation_logement_in:CalculAllocationLogementIn): + mode_occupation_5 = calcul_allocation_logement_in.mode_occupation_in + informations_calcul_2 = calcul_allocation_logement_in.informations_calcul_in + ressources_menage_sans_arrondi_1 = calcul_allocation_logement_in.ressources_menage_sans_arrondi_in + situation_familiale_2 = calcul_allocation_logement_in.situation_familiale_in + nombre_personnes_a_charge_9 = calcul_allocation_logement_in.nombre_personnes_a_charge_in + zone_7 = calcul_allocation_logement_in.zone_in + date_courante_15 = calcul_allocation_logement_in.date_courante_in + type_aide_3 = calcul_allocation_logement_in.type_aide_in + try: + match_arg_541 = mode_occupation_5 + if match_arg_541.code == ModeOccupation_Code.Locataire: + _ = match_arg_541.value + temp_categorie_calcul_apl_1 = CategorieCalculAPL(CategorieCalculAPL_Code.Location, + Unit()) + elif match_arg_541.code == ModeOccupation_Code.ResidentLogementFoyer: + _ = match_arg_541.value + temp_categorie_calcul_apl_1 = CategorieCalculAPL(CategorieCalculAPL_Code.LogementFoyer, + Unit()) + elif match_arg_541.code == ModeOccupation_Code.AccessionProprieteLocalUsageExclusifHabitation: + _ = match_arg_541.value + temp_categorie_calcul_apl_1 = CategorieCalculAPL(CategorieCalculAPL_Code.AccessionPropriete, + Unit()) + elif match_arg_541.code == ModeOccupation_Code.SousLocataire: + _ = match_arg_541.value + temp_categorie_calcul_apl_1 = CategorieCalculAPL(CategorieCalculAPL_Code.Location, + Unit()) + elif match_arg_541.code == ModeOccupation_Code.LocationAccession: + _ = match_arg_541.value + temp_categorie_calcul_apl_1 = CategorieCalculAPL(CategorieCalculAPL_Code.AccessionPropriete, + Unit()) + except EmptyError: + temp_categorie_calcul_apl_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=1017, + start_column=11, end_line=1017, + end_column=31, + law_headings=["Tous secteurs", + "Secteur logement-foyer", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + categorie_calcul_apl_1 = temp_categorie_calcul_apl_1 + try: + temp_ressources_menage_avec_arrondi_1 = (money_round(((ressources_menage_sans_arrondi_1 + + money_of_cents_string("4999")) * decimal_of_string("0.01"))) * + decimal_of_string("100.")) + except EmptyError: + temp_ressources_menage_avec_arrondi_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=1010, + start_column=10, end_line=1010, + end_column=22, + law_headings=["Tous secteurs", + "Secteur logement-foyer", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + ressources_menage_avec_arrondi_1 = temp_ressources_menage_avec_arrondi_1 + try: + match_arg_542 = situation_familiale_2 + if match_arg_542.code == SituationFamiliale_Code.Celibataire: + _ = match_arg_542.value + temp_situation_familiale_calcul_apl_1 = SituationFamilialeCalculAPL(SituationFamilialeCalculAPL_Code.PersonneSeule, + Unit()) + elif match_arg_542.code == SituationFamiliale_Code.Maries: + _ = match_arg_542.value + temp_situation_familiale_calcul_apl_1 = SituationFamilialeCalculAPL(SituationFamilialeCalculAPL_Code.Couple, + Unit()) + elif match_arg_542.code == SituationFamiliale_Code.Pacses: + _ = match_arg_542.value + temp_situation_familiale_calcul_apl_1 = SituationFamilialeCalculAPL(SituationFamilialeCalculAPL_Code.Couple, + Unit()) + elif match_arg_542.code == SituationFamiliale_Code.Concubins: + _ = match_arg_542.value + temp_situation_familiale_calcul_apl_1 = SituationFamilialeCalculAPL(SituationFamilialeCalculAPL_Code.Couple, + Unit()) + elif match_arg_542.code == SituationFamiliale_Code.CelibataireSepareDeFait: + _ = match_arg_542.value + temp_situation_familiale_calcul_apl_1 = SituationFamilialeCalculAPL(SituationFamilialeCalculAPL_Code.PersonneSeule, + Unit()) + elif match_arg_542.code == SituationFamiliale_Code.ConcubinageDontSepareDeFait: + _ = match_arg_542.value + temp_situation_familiale_calcul_apl_1 = SituationFamilialeCalculAPL(SituationFamilialeCalculAPL_Code.Couple, + Unit()) + except EmptyError: + temp_situation_familiale_calcul_apl_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=1018, + start_column=11, end_line=1018, + end_column=41, + law_headings=["Tous secteurs", + "Secteur logement-foyer", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + situation_familiale_calcul_apl_9 = temp_situation_familiale_calcul_apl_1 + try: + temp_accession_propriete_dot_ressources_menage_arrondies_base = ressources_menage_avec_arrondi_1 + except EmptyError: + temp_accession_propriete_dot_ressources_menage_arrondies_base = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=855, start_column=10, + end_line=855, end_column=37, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + accession_propriete_dot_ressources_menage_arrondies_base = temp_accession_propriete_dot_ressources_menage_arrondies_base + try: + temp_accession_propriete_dot_nombre_personnes_a_charge_1 = nombre_personnes_a_charge_9 + except EmptyError: + temp_accession_propriete_dot_nombre_personnes_a_charge_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=858, start_column=10, + end_line=858, end_column=35, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + accession_propriete_dot_nombre_personnes_a_charge_1 = temp_accession_propriete_dot_nombre_personnes_a_charge_1 + try: + temp_accession_propriete_dot_situation_familiale_calcul_apl_1 = situation_familiale_calcul_apl_9 + except EmptyError: + temp_accession_propriete_dot_situation_familiale_calcul_apl_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=859, start_column=10, + end_line=859, end_column=40, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + accession_propriete_dot_situation_familiale_calcul_apl_1 = temp_accession_propriete_dot_situation_familiale_calcul_apl_1 + try: + temp_accession_propriete_dot_zone_1 = zone_7 + except EmptyError: + temp_accession_propriete_dot_zone_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=860, start_column=10, + end_line=860, end_column=14, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + accession_propriete_dot_zone_1 = temp_accession_propriete_dot_zone_1 + try: + temp_accession_propriete_dot_date_courante_1 = date_courante_15 + except EmptyError: + temp_accession_propriete_dot_date_courante_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=861, start_column=10, + end_line=861, end_column=23, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + accession_propriete_dot_date_courante_1 = temp_accession_propriete_dot_date_courante_1 + try: + match_arg_543 = informations_calcul_2 + if match_arg_543.code == InformationsCalculAPL_Code.InfosLocatif: + _ = match_arg_543.value + temp_accession_propriete_dot_mensualite_principale_2 = money_of_cents_string("0") + elif match_arg_543.code == InformationsCalculAPL_Code.InfosLogementFoyer: + _ = match_arg_543.value + temp_accession_propriete_dot_mensualite_principale_2 = money_of_cents_string("0") + elif match_arg_543.code == InformationsCalculAPL_Code.InfosAccessionPropriete: + infos_22 = match_arg_543.value + temp_accession_propriete_dot_mensualite_principale_2 = infos_22.mensualite_principale + temp_accession_propriete_dot_mensualite_principale_3 = temp_accession_propriete_dot_mensualite_principale_2 + except EmptyError: + temp_accession_propriete_dot_mensualite_principale_3 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=862, start_column=10, + end_line=862, end_column=31, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + accession_propriete_dot_mensualite_principale_1 = temp_accession_propriete_dot_mensualite_principale_3 + try: + match_arg_544 = informations_calcul_2 + if match_arg_544.code == InformationsCalculAPL_Code.InfosLocatif: + _ = match_arg_544.value + temp_accession_propriete_dot_situation_r822_11_13_17_2 = False + elif match_arg_544.code == InformationsCalculAPL_Code.InfosLogementFoyer: + _ = match_arg_544.value + temp_accession_propriete_dot_situation_r822_11_13_17_2 = False + elif match_arg_544.code == InformationsCalculAPL_Code.InfosAccessionPropriete: + infos_23 = match_arg_544.value + temp_accession_propriete_dot_situation_r822_11_13_17_2 = infos_23.situation_r822_11_13_17 + temp_accession_propriete_dot_situation_r822_11_13_17_3 = temp_accession_propriete_dot_situation_r822_11_13_17_2 + except EmptyError: + temp_accession_propriete_dot_situation_r822_11_13_17_3 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=863, start_column=10, + end_line=863, end_column=33, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + accession_propriete_dot_situation_r822_11_13_17_1 = temp_accession_propriete_dot_situation_r822_11_13_17_3 + try: + match_arg_545 = informations_calcul_2 + if match_arg_545.code == InformationsCalculAPL_Code.InfosLocatif: + _ = match_arg_545.value + temp_accession_propriete_dot_date_signature_pret_2 = date_of_numbers(2010,1,1) + elif match_arg_545.code == InformationsCalculAPL_Code.InfosLogementFoyer: + _ = match_arg_545.value + temp_accession_propriete_dot_date_signature_pret_2 = date_of_numbers(2010,1,1) + elif match_arg_545.code == InformationsCalculAPL_Code.InfosAccessionPropriete: + infos_24 = match_arg_545.value + temp_accession_propriete_dot_date_signature_pret_2 = infos_24.date_signature_pret + temp_accession_propriete_dot_date_signature_pret_3 = temp_accession_propriete_dot_date_signature_pret_2 + except EmptyError: + temp_accession_propriete_dot_date_signature_pret_3 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=864, start_column=10, + end_line=864, end_column=29, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + accession_propriete_dot_date_signature_pret_1 = temp_accession_propriete_dot_date_signature_pret_3 + try: + match_arg_546 = informations_calcul_2 + if match_arg_546.code == InformationsCalculAPL_Code.InfosLocatif: + _ = match_arg_546.value + temp_accession_propriete_dot_type_travaux_logement_2 = TypeTravauxLogementR8425(TypeTravauxLogementR8425_Code.PasDeTravaux, + Unit()) + elif match_arg_546.code == InformationsCalculAPL_Code.InfosLogementFoyer: + _ = match_arg_546.value + temp_accession_propriete_dot_type_travaux_logement_2 = TypeTravauxLogementR8425(TypeTravauxLogementR8425_Code.PasDeTravaux, + Unit()) + elif match_arg_546.code == InformationsCalculAPL_Code.InfosAccessionPropriete: + infos_25 = match_arg_546.value + temp_accession_propriete_dot_type_travaux_logement_2 = infos_25.type_travaux_logement_r842_5 + temp_accession_propriete_dot_type_travaux_logement_3 = temp_accession_propriete_dot_type_travaux_logement_2 + except EmptyError: + temp_accession_propriete_dot_type_travaux_logement_3 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=865, start_column=10, + end_line=865, end_column=31, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + accession_propriete_dot_type_travaux_logement_1 = temp_accession_propriete_dot_type_travaux_logement_3 + try: + match_arg_547 = informations_calcul_2 + if match_arg_547.code == InformationsCalculAPL_Code.InfosLocatif: + _ = match_arg_547.value + temp_accession_propriete_dot_local_habite_premiere_fois_beneficiaire_2 = False + elif match_arg_547.code == InformationsCalculAPL_Code.InfosLogementFoyer: + _ = match_arg_547.value + temp_accession_propriete_dot_local_habite_premiere_fois_beneficiaire_2 = False + elif match_arg_547.code == InformationsCalculAPL_Code.InfosAccessionPropriete: + infos_26 = match_arg_547.value + temp_accession_propriete_dot_local_habite_premiere_fois_beneficiaire_2 = infos_26.local_habite_premiere_fois_beneficiaire + temp_accession_propriete_dot_local_habite_premiere_fois_beneficiaire_3 = temp_accession_propriete_dot_local_habite_premiere_fois_beneficiaire_2 + except EmptyError: + temp_accession_propriete_dot_local_habite_premiere_fois_beneficiaire_3 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=866, start_column=10, + end_line=866, end_column=49, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + accession_propriete_dot_local_habite_premiere_fois_beneficiaire_1 = temp_accession_propriete_dot_local_habite_premiere_fois_beneficiaire_3 + try: + match_arg_548 = informations_calcul_2 + if match_arg_548.code == InformationsCalculAPL_Code.InfosLocatif: + _ = match_arg_548.value + temp_accession_propriete_dot_date_entree_logement_2 = date_of_numbers(2010,1,1) + elif match_arg_548.code == InformationsCalculAPL_Code.InfosLogementFoyer: + _ = match_arg_548.value + temp_accession_propriete_dot_date_entree_logement_2 = date_of_numbers(2010,1,1) + elif match_arg_548.code == InformationsCalculAPL_Code.InfosAccessionPropriete: + infos_27 = match_arg_548.value + temp_accession_propriete_dot_date_entree_logement_2 = infos_27.date_entree_logement + temp_accession_propriete_dot_date_entree_logement_3 = temp_accession_propriete_dot_date_entree_logement_2 + except EmptyError: + temp_accession_propriete_dot_date_entree_logement_3 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=867, start_column=10, + end_line=867, end_column=30, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + accession_propriete_dot_date_entree_logement_1 = temp_accession_propriete_dot_date_entree_logement_3 + try: + match_arg_549 = informations_calcul_2 + if match_arg_549.code == InformationsCalculAPL_Code.InfosLocatif: + _ = match_arg_549.value + temp_accession_propriete_dot_charges_mensuelles_pret = money_of_cents_string("0") + elif match_arg_549.code == InformationsCalculAPL_Code.InfosLogementFoyer: + _ = match_arg_549.value + temp_accession_propriete_dot_charges_mensuelles_pret = money_of_cents_string("0") + elif match_arg_549.code == InformationsCalculAPL_Code.InfosAccessionPropriete: + infos_28 = match_arg_549.value + temp_accession_propriete_dot_charges_mensuelles_pret = infos_28.charges_mensuelles_pret + temp_accession_propriete_dot_charges_mensuelles_pret_1 = temp_accession_propriete_dot_charges_mensuelles_pret + except EmptyError: + temp_accession_propriete_dot_charges_mensuelles_pret_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=868, start_column=10, + end_line=868, end_column=33, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + accession_propriete_dot_charges_mensuelles_pret = temp_accession_propriete_dot_charges_mensuelles_pret_1 + try: + match_arg_550 = informations_calcul_2 + if match_arg_550.code == InformationsCalculAPL_Code.InfosLocatif: + _ = match_arg_550.value + temp_accession_propriete_dot_copropriete_2 = False + elif match_arg_550.code == InformationsCalculAPL_Code.InfosLogementFoyer: + _ = match_arg_550.value + temp_accession_propriete_dot_copropriete_2 = False + elif match_arg_550.code == InformationsCalculAPL_Code.InfosAccessionPropriete: + infos_29 = match_arg_550.value + temp_accession_propriete_dot_copropriete_2 = infos_29.copropriete + temp_accession_propriete_dot_copropriete_3 = temp_accession_propriete_dot_copropriete_2 + except EmptyError: + temp_accession_propriete_dot_copropriete_3 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=869, start_column=10, + end_line=869, end_column=21, + law_headings=["Secteur accession à la propriété", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + accession_propriete_dot_copropriete_1 = temp_accession_propriete_dot_copropriete_3 + result_27 = calcul_allocation_logement_accession_propriete(CalculAllocationLogementAccessionProprieteIn(ressources_menage_arrondies_base_in = accession_propriete_dot_ressources_menage_arrondies_base, + nombre_personnes_a_charge_in = accession_propriete_dot_nombre_personnes_a_charge_1, + situation_familiale_calcul_apl_in = accession_propriete_dot_situation_familiale_calcul_apl_1, + zone_in = accession_propriete_dot_zone_1, + date_courante_in = accession_propriete_dot_date_courante_1, + mensualite_principale_in = accession_propriete_dot_mensualite_principale_1, + situation_r822_11_13_17_in = accession_propriete_dot_situation_r822_11_13_17_1, + date_signature_pret_in = accession_propriete_dot_date_signature_pret_1, + type_travaux_logement_in = accession_propriete_dot_type_travaux_logement_1, + local_habite_premiere_fois_beneficiaire_in = accession_propriete_dot_local_habite_premiere_fois_beneficiaire_1, + date_entree_logement_in = accession_propriete_dot_date_entree_logement_1, + charges_mensuelles_pret_in = accession_propriete_dot_charges_mensuelles_pret, + copropriete_in = accession_propriete_dot_copropriete_1)) + accession_propriete_dot_aide_finale_formule_1 = result_27.aide_finale_formule_out + accession_propriete_dot_traitement_aide_finale_montant_minimal_1 = result_27.traitement_aide_finale_montant_minimal_out + try: + match_arg_551 = informations_calcul_2 + if match_arg_551.code == InformationsCalculAPL_Code.InfosLocatif: + _ = match_arg_551.value + temp_logement_foyer_dot_redevance_2 = money_of_cents_string("0") + elif match_arg_551.code == InformationsCalculAPL_Code.InfosLogementFoyer: + infos_30 = match_arg_551.value + temp_logement_foyer_dot_redevance_2 = infos_30.redevance + elif match_arg_551.code == InformationsCalculAPL_Code.InfosAccessionPropriete: + _ = match_arg_551.value + temp_logement_foyer_dot_redevance_2 = money_of_cents_string("0") + temp_logement_foyer_dot_redevance_3 = temp_logement_foyer_dot_redevance_2 + except EmptyError: + temp_logement_foyer_dot_redevance_3 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=948, start_column=10, + end_line=948, end_column=19, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + logement_foyer_dot_redevance_1 = temp_logement_foyer_dot_redevance_3 + try: + temp_logement_foyer_dot_mode_occupation_1 = mode_occupation_5 + except EmptyError: + temp_logement_foyer_dot_mode_occupation_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=949, start_column=10, + end_line=949, end_column=25, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + logement_foyer_dot_mode_occupation_1 = temp_logement_foyer_dot_mode_occupation_1 + try: + temp_logement_foyer_dot_ressources_menage_arrondies_1 = ressources_menage_avec_arrondi_1 + except EmptyError: + temp_logement_foyer_dot_ressources_menage_arrondies_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=950, start_column=10, + end_line=950, end_column=37, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + logement_foyer_dot_ressources_menage_arrondies_1 = temp_logement_foyer_dot_ressources_menage_arrondies_1 + try: + temp_logement_foyer_dot_nombre_personnes_a_charge_1 = nombre_personnes_a_charge_9 + except EmptyError: + temp_logement_foyer_dot_nombre_personnes_a_charge_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=951, start_column=10, + end_line=951, end_column=35, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + logement_foyer_dot_nombre_personnes_a_charge_1 = temp_logement_foyer_dot_nombre_personnes_a_charge_1 + try: + temp_logement_foyer_dot_situation_familiale_calcul_apl_1 = situation_familiale_calcul_apl_9 + except EmptyError: + temp_logement_foyer_dot_situation_familiale_calcul_apl_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=952, start_column=10, + end_line=952, end_column=40, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + logement_foyer_dot_situation_familiale_calcul_apl_1 = temp_logement_foyer_dot_situation_familiale_calcul_apl_1 + try: + temp_logement_foyer_dot_zone_1 = zone_7 + except EmptyError: + temp_logement_foyer_dot_zone_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=953, start_column=10, + end_line=953, end_column=14, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + logement_foyer_dot_zone_1 = temp_logement_foyer_dot_zone_1 + try: + temp_logement_foyer_dot_date_courante_1 = date_courante_15 + except EmptyError: + temp_logement_foyer_dot_date_courante_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=954, start_column=10, + end_line=954, end_column=23, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + logement_foyer_dot_date_courante_1 = temp_logement_foyer_dot_date_courante_1 + try: + match_arg_552 = informations_calcul_2 + if match_arg_552.code == InformationsCalculAPL_Code.InfosLocatif: + _ = match_arg_552.value + temp_logement_foyer_dot_categorie_equivalence_loyer_d842_16 = CategorieEquivalenceLoyerAllocationLogementFoyer(CategorieEquivalenceLoyerAllocationLogementFoyer_Code.AutresPersonnes, + Unit()) + elif match_arg_552.code == InformationsCalculAPL_Code.InfosLogementFoyer: + infos_31 = match_arg_552.value + temp_logement_foyer_dot_categorie_equivalence_loyer_d842_16 = infos_31.categorie_equivalence_loyer_d842_16 + elif match_arg_552.code == InformationsCalculAPL_Code.InfosAccessionPropriete: + _ = match_arg_552.value + temp_logement_foyer_dot_categorie_equivalence_loyer_d842_16 = CategorieEquivalenceLoyerAllocationLogementFoyer(CategorieEquivalenceLoyerAllocationLogementFoyer_Code.AutresPersonnes, + Unit()) + temp_logement_foyer_dot_categorie_equivalence_loyer_d842_16_1 = temp_logement_foyer_dot_categorie_equivalence_loyer_d842_16 + except EmptyError: + temp_logement_foyer_dot_categorie_equivalence_loyer_d842_16_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=955, start_column=10, + end_line=955, end_column=45, + law_headings=["Secteur logement-foyer", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + logement_foyer_dot_categorie_equivalence_loyer_d842_16 = temp_logement_foyer_dot_categorie_equivalence_loyer_d842_16_1 + result_28 = calcul_allocation_logement_foyer(CalculAllocationLogementFoyerIn(redevance_in = logement_foyer_dot_redevance_1, + mode_occupation_in = logement_foyer_dot_mode_occupation_1, + ressources_menage_arrondies_in = logement_foyer_dot_ressources_menage_arrondies_1, + nombre_personnes_a_charge_in = logement_foyer_dot_nombre_personnes_a_charge_1, + situation_familiale_calcul_apl_in = logement_foyer_dot_situation_familiale_calcul_apl_1, + zone_in = logement_foyer_dot_zone_1, + date_courante_in = logement_foyer_dot_date_courante_1, + categorie_equivalence_loyer_d842_16_in = logement_foyer_dot_categorie_equivalence_loyer_d842_16)) + logement_foyer_dot_coefficient_prise_en_charge = result_28.coefficient_prise_en_charge_out + logement_foyer_dot_equivalence_loyer = result_28.equivalence_loyer_out + logement_foyer_dot_montant_forfaitaire_charges = result_28.montant_forfaitaire_charges_out + logement_foyer_dot_loyer_minimal = result_28.loyer_minimal_out + logement_foyer_dot_aide_finale_formule_1 = result_28.aide_finale_formule_out + logement_foyer_dot_traitement_aide_finale_montant_minimal_1 = result_28.traitement_aide_finale_montant_minimal_out + try: + match_arg_553 = informations_calcul_2 + if match_arg_553.code == InformationsCalculAPL_Code.InfosLocatif: + infos_32 = match_arg_553.value + temp_locatif_dot_loyer_principal_2 = infos_32.loyer_principal + elif match_arg_553.code == InformationsCalculAPL_Code.InfosLogementFoyer: + _ = match_arg_553.value + temp_locatif_dot_loyer_principal_2 = money_of_cents_string("0") + elif match_arg_553.code == InformationsCalculAPL_Code.InfosAccessionPropriete: + _ = match_arg_553.value + temp_locatif_dot_loyer_principal_2 = money_of_cents_string("0") + temp_locatif_dot_loyer_principal_3 = temp_locatif_dot_loyer_principal_2 + except EmptyError: + temp_locatif_dot_loyer_principal_3 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=790, start_column=10, + end_line=790, end_column=25, + law_headings=["Secteur locatif", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + locatif_dot_loyer_principal_1 = temp_locatif_dot_loyer_principal_3 + try: + temp_locatif_dot_ressources_menage_arrondies_1 = ressources_menage_avec_arrondi_1 + except EmptyError: + temp_locatif_dot_ressources_menage_arrondies_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=791, start_column=10, + end_line=791, end_column=37, + law_headings=["Secteur locatif", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + locatif_dot_ressources_menage_arrondies_1 = temp_locatif_dot_ressources_menage_arrondies_1 + try: + match_arg_554 = informations_calcul_2 + if match_arg_554.code == InformationsCalculAPL_Code.InfosLocatif: + infos_33 = match_arg_554.value + temp_locatif_dot_beneficiaire_aide_adulte_ou_enfant_handicapes_2 = infos_33.beneficiaire_aide_adulte_ou_enfant_handicapes + elif match_arg_554.code == InformationsCalculAPL_Code.InfosLogementFoyer: + _ = match_arg_554.value + temp_locatif_dot_beneficiaire_aide_adulte_ou_enfant_handicapes_2 = False + elif match_arg_554.code == InformationsCalculAPL_Code.InfosAccessionPropriete: + _ = match_arg_554.value + temp_locatif_dot_beneficiaire_aide_adulte_ou_enfant_handicapes_2 = False + temp_locatif_dot_beneficiaire_aide_adulte_ou_enfant_handicapes_3 = temp_locatif_dot_beneficiaire_aide_adulte_ou_enfant_handicapes_2 + except EmptyError: + temp_locatif_dot_beneficiaire_aide_adulte_ou_enfant_handicapes_3 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=792, start_column=10, + end_line=792, end_column=55, + law_headings=["Secteur locatif", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + locatif_dot_beneficiaire_aide_adulte_ou_enfant_handicapes_1 = temp_locatif_dot_beneficiaire_aide_adulte_ou_enfant_handicapes_3 + try: + temp_locatif_dot_date_courante_1 = date_courante_15 + except EmptyError: + temp_locatif_dot_date_courante_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=794, start_column=10, + end_line=794, end_column=23, + law_headings=["Secteur locatif", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + locatif_dot_date_courante_1 = temp_locatif_dot_date_courante_1 + try: + temp_locatif_dot_nombre_personnes_a_charge_1 = nombre_personnes_a_charge_9 + except EmptyError: + temp_locatif_dot_nombre_personnes_a_charge_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=795, start_column=10, + end_line=795, end_column=35, + law_headings=["Secteur locatif", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + locatif_dot_nombre_personnes_a_charge_1 = temp_locatif_dot_nombre_personnes_a_charge_1 + try: + temp_locatif_dot_situation_familiale_calcul_apl_1 = situation_familiale_calcul_apl_9 + except EmptyError: + temp_locatif_dot_situation_familiale_calcul_apl_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=796, start_column=10, + end_line=796, end_column=40, + law_headings=["Secteur locatif", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + locatif_dot_situation_familiale_calcul_apl_1 = temp_locatif_dot_situation_familiale_calcul_apl_1 + try: + temp_locatif_dot_zone_1 = zone_7 + except EmptyError: + temp_locatif_dot_zone_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=797, start_column=10, + end_line=797, end_column=14, + law_headings=["Secteur locatif", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + locatif_dot_zone_1 = temp_locatif_dot_zone_1 + try: + match_arg_555 = informations_calcul_2 + if match_arg_555.code == InformationsCalculAPL_Code.InfosLocatif: + infos_34 = match_arg_555.value + temp_locatif_dot_logement_est_chambre_2 = infos_34.logement_est_chambre + elif match_arg_555.code == InformationsCalculAPL_Code.InfosLogementFoyer: + _ = match_arg_555.value + temp_locatif_dot_logement_est_chambre_2 = False + elif match_arg_555.code == InformationsCalculAPL_Code.InfosAccessionPropriete: + _ = match_arg_555.value + temp_locatif_dot_logement_est_chambre_2 = False + temp_locatif_dot_logement_est_chambre_3 = temp_locatif_dot_logement_est_chambre_2 + except EmptyError: + temp_locatif_dot_logement_est_chambre_3 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=798, start_column=10, + end_line=798, end_column=30, + law_headings=["Secteur locatif", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + locatif_dot_logement_est_chambre_1 = temp_locatif_dot_logement_est_chambre_3 + try: + match_arg_556 = informations_calcul_2 + if match_arg_556.code == InformationsCalculAPL_Code.InfosLocatif: + infos_35 = match_arg_556.value + temp_locatif_dot_agees_ou_handicap_adultes_hebergees_onereux_particuliers_2 = infos_35.agees_ou_handicap_adultes_hebergees_onereux_particuliers + elif match_arg_556.code == InformationsCalculAPL_Code.InfosLogementFoyer: + _ = match_arg_556.value + temp_locatif_dot_agees_ou_handicap_adultes_hebergees_onereux_particuliers_2 = False + elif match_arg_556.code == InformationsCalculAPL_Code.InfosAccessionPropriete: + _ = match_arg_556.value + temp_locatif_dot_agees_ou_handicap_adultes_hebergees_onereux_particuliers_2 = False + temp_locatif_dot_agees_ou_handicap_adultes_hebergees_onereux_particuliers_3 = temp_locatif_dot_agees_ou_handicap_adultes_hebergees_onereux_particuliers_2 + except EmptyError: + temp_locatif_dot_agees_ou_handicap_adultes_hebergees_onereux_particuliers_3 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=799, start_column=10, + end_line=799, end_column=66, + law_headings=["Secteur locatif", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + locatif_dot_agees_ou_handicap_adultes_hebergees_onereux_particuliers_1 = temp_locatif_dot_agees_ou_handicap_adultes_hebergees_onereux_particuliers_3 + try: + temp_locatif_dot_type_aide_1 = type_aide_3 + except EmptyError: + temp_locatif_dot_type_aide_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=801, start_column=10, + end_line=801, end_column=19, + law_headings=["Secteur locatif", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + locatif_dot_type_aide_1 = temp_locatif_dot_type_aide_1 + try: + match_arg_557 = informations_calcul_2 + if match_arg_557.code == InformationsCalculAPL_Code.InfosLocatif: + infos_36 = match_arg_557.value + temp_locatif_dot_colocation_2 = infos_36.colocation + elif match_arg_557.code == InformationsCalculAPL_Code.InfosLogementFoyer: + _ = match_arg_557.value + temp_locatif_dot_colocation_2 = False + elif match_arg_557.code == InformationsCalculAPL_Code.InfosAccessionPropriete: + _ = match_arg_557.value + temp_locatif_dot_colocation_2 = False + temp_locatif_dot_colocation_3 = temp_locatif_dot_colocation_2 + except EmptyError: + temp_locatif_dot_colocation_3 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=802, start_column=10, + end_line=802, end_column=20, + law_headings=["Secteur locatif", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + locatif_dot_colocation_1 = temp_locatif_dot_colocation_3 + try: + match_arg_558 = informations_calcul_2 + if match_arg_558.code == InformationsCalculAPL_Code.InfosLocatif: + infos_37 = match_arg_558.value + temp_locatif_dot_reduction_loyer_solidarite_2 = infos_37.reduction_loyer_solidarite + elif match_arg_558.code == InformationsCalculAPL_Code.InfosLogementFoyer: + _ = match_arg_558.value + temp_locatif_dot_reduction_loyer_solidarite_2 = money_of_cents_string("0") + elif match_arg_558.code == InformationsCalculAPL_Code.InfosAccessionPropriete: + _ = match_arg_558.value + temp_locatif_dot_reduction_loyer_solidarite_2 = money_of_cents_string("0") + temp_locatif_dot_reduction_loyer_solidarite_3 = temp_locatif_dot_reduction_loyer_solidarite_2 + except EmptyError: + temp_locatif_dot_reduction_loyer_solidarite_3 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=803, start_column=10, + end_line=803, end_column=36, + law_headings=["Secteur locatif", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + locatif_dot_reduction_loyer_solidarite_1 = temp_locatif_dot_reduction_loyer_solidarite_3 + try: + match_arg_559 = informations_calcul_2 + if match_arg_559.code == InformationsCalculAPL_Code.InfosLocatif: + infos_38 = match_arg_559.value + temp_locatif_dot_logement_meuble_d842_2 = infos_38.logement_meuble_d842_2 + elif match_arg_559.code == InformationsCalculAPL_Code.InfosLogementFoyer: + _ = match_arg_559.value + temp_locatif_dot_logement_meuble_d842_2 = False + elif match_arg_559.code == InformationsCalculAPL_Code.InfosAccessionPropriete: + _ = match_arg_559.value + temp_locatif_dot_logement_meuble_d842_2 = False + temp_locatif_dot_logement_meuble_d842_2_1 = temp_locatif_dot_logement_meuble_d842_2 + except EmptyError: + temp_locatif_dot_logement_meuble_d842_2_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=806, start_column=10, + end_line=806, end_column=32, + law_headings=["Secteur locatif", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + locatif_dot_logement_meuble_d842_2 = temp_locatif_dot_logement_meuble_d842_2_1 + try: + match_arg_560 = informations_calcul_2 + if match_arg_560.code == InformationsCalculAPL_Code.InfosLocatif: + infos_39 = match_arg_560.value + temp_locatif_dot_changement_logement_d842_4 = infos_39.changement_logement_d842_4 + elif match_arg_560.code == InformationsCalculAPL_Code.InfosLogementFoyer: + _ = match_arg_560.value + temp_locatif_dot_changement_logement_d842_4 = ChangementLogementD8424(ChangementLogementD8424_Code.PasDeChangement, + Unit()) + elif match_arg_560.code == InformationsCalculAPL_Code.InfosAccessionPropriete: + _ = match_arg_560.value + temp_locatif_dot_changement_logement_d842_4 = ChangementLogementD8424(ChangementLogementD8424_Code.PasDeChangement, + Unit()) + temp_locatif_dot_changement_logement_d842_4_1 = temp_locatif_dot_changement_logement_d842_4 + except EmptyError: + temp_locatif_dot_changement_logement_d842_4_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=807, start_column=10, + end_line=807, end_column=36, + law_headings=["Secteur locatif", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + locatif_dot_changement_logement_d842_4 = temp_locatif_dot_changement_logement_d842_4_1 + result_29 = calcul_allocation_logement_locatif(CalculAllocationLogementLocatifIn(loyer_principal_in = locatif_dot_loyer_principal_1, + ressources_menage_arrondies_in = locatif_dot_ressources_menage_arrondies_1, + beneficiaire_aide_adulte_ou_enfant_handicapes_in = locatif_dot_beneficiaire_aide_adulte_ou_enfant_handicapes_1, + date_courante_in = locatif_dot_date_courante_1, + nombre_personnes_a_charge_in = locatif_dot_nombre_personnes_a_charge_1, + situation_familiale_calcul_apl_in = locatif_dot_situation_familiale_calcul_apl_1, + zone_in = locatif_dot_zone_1, + logement_est_chambre_in = locatif_dot_logement_est_chambre_1, + agees_ou_handicap_adultes_hebergees_onereux_particuliers_in = locatif_dot_agees_ou_handicap_adultes_hebergees_onereux_particuliers_1, + type_aide_in = locatif_dot_type_aide_1, + colocation_in = locatif_dot_colocation_1, + reduction_loyer_solidarite_in = locatif_dot_reduction_loyer_solidarite_1, + logement_meuble_d842_2_in = locatif_dot_logement_meuble_d842_2, + changement_logement_d842_4_in = locatif_dot_changement_logement_d842_4)) + locatif_dot_aide_finale_formule_1 = result_29.aide_finale_formule_out + locatif_dot_traitement_aide_finale = result_29.traitement_aide_finale_out + try: + def temp_traitement_aide_finale_3(param_43:Money): + try: + match_arg_561 = categorie_calcul_apl_1 + if match_arg_561.code == CategorieCalculAPL_Code.Location: + _ = match_arg_561.value + return locatif_dot_traitement_aide_finale(param_43) + elif match_arg_561.code == CategorieCalculAPL_Code.AccessionPropriete: + _ = match_arg_561.value + return accession_propriete_dot_traitement_aide_finale_montant_minimal_1( + param_43) + elif match_arg_561.code == CategorieCalculAPL_Code.LogementFoyer: + _ = match_arg_561.value + return logement_foyer_dot_traitement_aide_finale_montant_minimal_1( + param_43) + except EmptyError: + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=1026, + start_column=10, + end_line=1026, + end_column=32, + law_headings=["Tous secteurs", + "Secteur logement-foyer", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + except EmptyError: + temp_traitement_aide_finale_3 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=1026, + start_column=10, end_line=1026, + end_column=32, + law_headings=["Tous secteurs", + "Secteur logement-foyer", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + traitement_aide_finale_2 = temp_traitement_aide_finale_3 + try: + match_arg_562 = categorie_calcul_apl_1 + if match_arg_562.code == CategorieCalculAPL_Code.Location: + _ = match_arg_562.value + temp_aide_finale_formule_8 = locatif_dot_aide_finale_formule_1 + elif match_arg_562.code == CategorieCalculAPL_Code.AccessionPropriete: + _ = match_arg_562.value + temp_aide_finale_formule_8 = accession_propriete_dot_aide_finale_formule_1 + elif match_arg_562.code == CategorieCalculAPL_Code.LogementFoyer: + _ = match_arg_562.value + temp_aide_finale_formule_8 = logement_foyer_dot_aide_finale_formule_1 + except EmptyError: + temp_aide_finale_formule_8 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=1025, + start_column=10, end_line=1025, + end_column=29, + law_headings=["Tous secteurs", + "Secteur logement-foyer", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + aide_finale_formule_7 = temp_aide_finale_formule_8 + try: + match_arg_563 = categorie_calcul_apl_1 + if match_arg_563.code == CategorieCalculAPL_Code.Location: + _ = match_arg_563.value + temp___13 = False + elif match_arg_563.code == CategorieCalculAPL_Code.AccessionPropriete: + _ = match_arg_563.value + temp___13 = True + elif match_arg_563.code == CategorieCalculAPL_Code.LogementFoyer: + _ = match_arg_563.value + temp___13 = False + if temp___13: + match_arg_564 = informations_calcul_2 + if match_arg_564.code == InformationsCalculAPL_Code.InfosLocatif: + _ = match_arg_564.value + temp___14 = False + elif match_arg_564.code == InformationsCalculAPL_Code.InfosLogementFoyer: + _ = match_arg_564.value + temp___14 = False + elif match_arg_564.code == InformationsCalculAPL_Code.InfosAccessionPropriete: + _ = match_arg_564.value + temp___14 = True + else: + temp___14 = True + except EmptyError: + temp___14 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", + start_line=1603, start_column=5, + end_line=1605, end_column=15, + law_headings=["Article D823-9", + "Section 1 : Calcul, liquidation et versement des aides", + "Chapitre III : Modalités de liquidation et de versement", + "Titre II : Dispositions communes aux aides personnelles au logement", + "Livre VIII : Aides personnelles au logement", + "Partie réglementaire", + "Code de la construction et de l'habitation"])) + if not (temp___14): + raise AssertionFailure(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", + start_line=1603, + start_column=5, end_line=1605, + end_column=15, + law_headings=["Article D823-9", + "Section 1 : Calcul, liquidation et versement des aides", + "Chapitre III : Modalités de liquidation et de versement", + "Titre II : Dispositions communes aux aides personnelles au logement", + "Livre VIII : Aides personnelles au logement", + "Partie réglementaire", + "Code de la construction et de l'habitation"])) + try: + match_arg_565 = categorie_calcul_apl_1 + if match_arg_565.code == CategorieCalculAPL_Code.Location: + _ = match_arg_565.value + temp___15 = False + elif match_arg_565.code == CategorieCalculAPL_Code.AccessionPropriete: + _ = match_arg_565.value + temp___15 = False + elif match_arg_565.code == CategorieCalculAPL_Code.LogementFoyer: + _ = match_arg_565.value + temp___15 = True + if temp___15: + match_arg_566 = informations_calcul_2 + if match_arg_566.code == InformationsCalculAPL_Code.InfosLocatif: + _ = match_arg_566.value + temp___16 = False + elif match_arg_566.code == InformationsCalculAPL_Code.InfosLogementFoyer: + _ = match_arg_566.value + temp___16 = True + elif match_arg_566.code == InformationsCalculAPL_Code.InfosAccessionPropriete: + _ = match_arg_566.value + temp___16 = False + else: + temp___16 = True + except EmptyError: + temp___16 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", + start_line=1599, start_column=5, + end_line=1601, end_column=15, + law_headings=["Article D823-9", + "Section 1 : Calcul, liquidation et versement des aides", + "Chapitre III : Modalités de liquidation et de versement", + "Titre II : Dispositions communes aux aides personnelles au logement", + "Livre VIII : Aides personnelles au logement", + "Partie réglementaire", + "Code de la construction et de l'habitation"])) + if not (temp___16): + raise AssertionFailure(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", + start_line=1599, + start_column=5, end_line=1601, + end_column=15, + law_headings=["Article D823-9", + "Section 1 : Calcul, liquidation et versement des aides", + "Chapitre III : Modalités de liquidation et de versement", + "Titre II : Dispositions communes aux aides personnelles au logement", + "Livre VIII : Aides personnelles au logement", + "Partie réglementaire", + "Code de la construction et de l'habitation"])) + try: + match_arg_567 = categorie_calcul_apl_1 + if match_arg_567.code == CategorieCalculAPL_Code.Location: + _ = match_arg_567.value + temp___17 = True + elif match_arg_567.code == CategorieCalculAPL_Code.AccessionPropriete: + _ = match_arg_567.value + temp___17 = False + elif match_arg_567.code == CategorieCalculAPL_Code.LogementFoyer: + _ = match_arg_567.value + temp___17 = False + if temp___17: + match_arg_568 = informations_calcul_2 + if match_arg_568.code == InformationsCalculAPL_Code.InfosLocatif: + _ = match_arg_568.value + temp___18 = True + elif match_arg_568.code == InformationsCalculAPL_Code.InfosLogementFoyer: + _ = match_arg_568.value + temp___18 = False + elif match_arg_568.code == InformationsCalculAPL_Code.InfosAccessionPropriete: + _ = match_arg_568.value + temp___18 = False + else: + temp___18 = True + except EmptyError: + temp___18 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", + start_line=1595, start_column=5, + end_line=1597, end_column=15, + law_headings=["Article D823-9", + "Section 1 : Calcul, liquidation et versement des aides", + "Chapitre III : Modalités de liquidation et de versement", + "Titre II : Dispositions communes aux aides personnelles au logement", + "Livre VIII : Aides personnelles au logement", + "Partie réglementaire", + "Code de la construction et de l'habitation"])) + if not (temp___18): + raise AssertionFailure(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", + start_line=1595, + start_column=5, end_line=1597, + end_column=15, + law_headings=["Article D823-9", + "Section 1 : Calcul, liquidation et versement des aides", + "Chapitre III : Modalités de liquidation et de versement", + "Titre II : Dispositions communes aux aides personnelles au logement", + "Livre VIII : Aides personnelles au logement", + "Partie réglementaire", + "Code de la construction et de l'habitation"])) + return CalculAllocationLogementOut(aide_finale_formule_out = aide_finale_formule_7, + traitement_aide_finale_out = traitement_aide_finale_2) + +def calculette_aides_au_logement(calculette_aides_au_logement_in:CalculetteAidesAuLogementIn): + menage_4 = calculette_aides_au_logement_in.menage_in + demandeur_4 = calculette_aides_au_logement_in.demandeur_in + informations_calcul_3 = calculette_aides_au_logement_in.informations_calcul_in + date_courante_16 = calculette_aides_au_logement_in.date_courante_in + ressources_menage_prises_en_compte = calculette_aides_au_logement_in.ressources_menage_prises_en_compte_in + try: + temp_eligibilite_allocation_logement_dot_date_courante = date_courante_16 + except EmptyError: + temp_eligibilite_allocation_logement_dot_date_courante = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=423, start_column=10, + end_line=423, end_column=23, + law_headings=["Éligibilité aux allocations de logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + eligibilite_allocation_logement_dot_date_courante = temp_eligibilite_allocation_logement_dot_date_courante + try: + temp_eligibilite_allocation_logement_dot_menage = menage_4 + except EmptyError: + temp_eligibilite_allocation_logement_dot_menage = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=424, start_column=10, + end_line=424, end_column=16, + law_headings=["Éligibilité aux allocations de logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + eligibilite_allocation_logement_dot_menage = temp_eligibilite_allocation_logement_dot_menage + try: + temp_eligibilite_allocation_logement_dot_demandeur = demandeur_4 + except EmptyError: + temp_eligibilite_allocation_logement_dot_demandeur = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=425, start_column=10, + end_line=425, end_column=19, + law_headings=["Éligibilité aux allocations de logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + eligibilite_allocation_logement_dot_demandeur = temp_eligibilite_allocation_logement_dot_demandeur + try: + temp_eligibilite_allocation_logement_dot_beneficie_aide_personnalisee_logement = False + except EmptyError: + temp_eligibilite_allocation_logement_dot_beneficie_aide_personnalisee_logement = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=426, start_column=10, + end_line=426, end_column=47, + law_headings=["Éligibilité aux allocations de logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + eligibilite_allocation_logement_dot_beneficie_aide_personnalisee_logement = temp_eligibilite_allocation_logement_dot_beneficie_aide_personnalisee_logement + try: + temp_eligibilite_allocation_logement_dot_informations_calcul = informations_calcul_3 + except EmptyError: + temp_eligibilite_allocation_logement_dot_informations_calcul = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=427, start_column=10, + end_line=427, end_column=29, + law_headings=["Éligibilité aux allocations de logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + eligibilite_allocation_logement_dot_informations_calcul = temp_eligibilite_allocation_logement_dot_informations_calcul + result_30 = eligibilite_allocation_logement(EligibiliteAllocationLogementIn(date_courante_in = eligibilite_allocation_logement_dot_date_courante, + menage_in = eligibilite_allocation_logement_dot_menage, + demandeur_in = eligibilite_allocation_logement_dot_demandeur, + beneficie_aide_personnalisee_logement_in = eligibilite_allocation_logement_dot_beneficie_aide_personnalisee_logement, + informations_calcul_in = eligibilite_allocation_logement_dot_informations_calcul)) + eligibilite_allocation_logement_dot_eligibilite_avec_condition_logement = result_30.eligibilite_avec_condition_logement_out + eligibilite_allocation_logement_dot_nombre_personnes_a_charge_prises_en_compte = result_30.nombre_personnes_a_charge_prises_en_compte_out + eligibilite_allocation_logement_dot_coefficents_enfants_garde_alternee_pris_en_compte = result_30.coefficents_enfants_garde_alternee_pris_en_compte_out + try: + temp_eligibilite_aide_personnalisee_logement_dot_menage = menage_4 + except EmptyError: + temp_eligibilite_aide_personnalisee_logement_dot_menage = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=386, start_column=10, + end_line=386, end_column=16, + law_headings=["Éligibilité à l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + eligibilite_aide_personnalisee_logement_dot_menage = temp_eligibilite_aide_personnalisee_logement_dot_menage + try: + temp_eligibilite_aide_personnalisee_logement_dot_demandeur = demandeur_4 + except EmptyError: + temp_eligibilite_aide_personnalisee_logement_dot_demandeur = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=387, start_column=10, + end_line=387, end_column=19, + law_headings=["Éligibilité à l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + eligibilite_aide_personnalisee_logement_dot_demandeur = temp_eligibilite_aide_personnalisee_logement_dot_demandeur + try: + temp_eligibilite_aide_personnalisee_logement_dot_date_courante = date_courante_16 + except EmptyError: + temp_eligibilite_aide_personnalisee_logement_dot_date_courante = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=388, start_column=17, + end_line=388, end_column=30, + law_headings=["Éligibilité à l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + eligibilite_aide_personnalisee_logement_dot_date_courante = temp_eligibilite_aide_personnalisee_logement_dot_date_courante + result_31 = eligibilite_aide_personnalisee_logement(EligibiliteAidePersonnaliseeLogementIn(menage_in = eligibilite_aide_personnalisee_logement_dot_menage, + demandeur_in = eligibilite_aide_personnalisee_logement_dot_demandeur, + date_courante_in = eligibilite_aide_personnalisee_logement_dot_date_courante)) + eligibilite_aide_personnalisee_logement_dot_date_courante_1 = result_31.date_courante_out + eligibilite_aide_personnalisee_logement_dot_eligibilite = result_31.eligibilite_out + eligibilite_aide_personnalisee_logement_dot_nombre_personnes_a_charge_prises_en_compte = result_31.nombre_personnes_a_charge_prises_en_compte_out + eligibilite_aide_personnalisee_logement_dot_coefficents_enfants_garde_alternee_pris_en_compte = result_31.coefficents_enfants_garde_alternee_pris_en_compte_out + try: + temp_calcul_allocation_logement_dot_mode_occupation = menage_4.logement.mode_occupation + except EmptyError: + temp_calcul_allocation_logement_dot_mode_occupation = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=1006, + start_column=10, end_line=1006, + end_column=25, + law_headings=["Tous secteurs", + "Secteur logement-foyer", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + calcul_allocation_logement_dot_mode_occupation = temp_calcul_allocation_logement_dot_mode_occupation + try: + try: + temp_calcul_allocation_logement_dot_informations_calcul = informations_calcul_3 + except EmptyError: + temp_calcul_allocation_logement_dot_informations_calcul = informations_calcul_3 + temp_calcul_allocation_logement_dot_informations_calcul_1 = temp_calcul_allocation_logement_dot_informations_calcul + except EmptyError: + temp_calcul_allocation_logement_dot_informations_calcul_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=1007, + start_column=10, end_line=1007, + end_column=29, + law_headings=["Tous secteurs", + "Secteur logement-foyer", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + calcul_allocation_logement_dot_informations_calcul = temp_calcul_allocation_logement_dot_informations_calcul_1 + try: + temp_calcul_allocation_logement_dot_ressources_menage_sans_arrondi = ressources_menage_prises_en_compte + except EmptyError: + temp_calcul_allocation_logement_dot_ressources_menage_sans_arrondi = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=1008, + start_column=10, end_line=1008, + end_column=27, + law_headings=["Tous secteurs", + "Secteur logement-foyer", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + calcul_allocation_logement_dot_ressources_menage_sans_arrondi = temp_calcul_allocation_logement_dot_ressources_menage_sans_arrondi + try: + temp_calcul_allocation_logement_dot_situation_familiale = menage_4.situation_familiale + except EmptyError: + temp_calcul_allocation_logement_dot_situation_familiale = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=1011, + start_column=10, end_line=1011, + end_column=29, + law_headings=["Tous secteurs", + "Secteur logement-foyer", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + calcul_allocation_logement_dot_situation_familiale = temp_calcul_allocation_logement_dot_situation_familiale + try: + temp_calcul_allocation_logement_dot_nombre_personnes_a_charge = eligibilite_allocation_logement_dot_nombre_personnes_a_charge_prises_en_compte + except EmptyError: + temp_calcul_allocation_logement_dot_nombre_personnes_a_charge = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=1012, + start_column=10, end_line=1012, + end_column=35, + law_headings=["Tous secteurs", + "Secteur logement-foyer", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + calcul_allocation_logement_dot_nombre_personnes_a_charge = temp_calcul_allocation_logement_dot_nombre_personnes_a_charge + try: + temp_calcul_allocation_logement_dot_zone = menage_4.logement.zone + except EmptyError: + temp_calcul_allocation_logement_dot_zone = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=1013, + start_column=10, end_line=1013, + end_column=14, + law_headings=["Tous secteurs", + "Secteur logement-foyer", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + calcul_allocation_logement_dot_zone = temp_calcul_allocation_logement_dot_zone + try: + temp_calcul_allocation_logement_dot_date_courante = date_courante_16 + except EmptyError: + temp_calcul_allocation_logement_dot_date_courante = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=1014, + start_column=10, end_line=1014, + end_column=23, + law_headings=["Tous secteurs", + "Secteur logement-foyer", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + calcul_allocation_logement_dot_date_courante = temp_calcul_allocation_logement_dot_date_courante + try: + match_arg_569 = eligibilite_allocation_logement_dot_eligibilite_avec_condition_logement + if match_arg_569.code == EligibiliteAllocationLogement_Code.PasEligible: + _ = match_arg_569.value + temp_calcul_allocation_logement_dot_type_aide = TypeAidesPersonnelleLogement(TypeAidesPersonnelleLogement_Code.AllocationLogementSociale, + Unit()) + elif match_arg_569.code == EligibiliteAllocationLogement_Code.AllocationLogementFamiliale: + _ = match_arg_569.value + temp_calcul_allocation_logement_dot_type_aide = TypeAidesPersonnelleLogement(TypeAidesPersonnelleLogement_Code.AllocationLogementFamiliale, + Unit()) + elif match_arg_569.code == EligibiliteAllocationLogement_Code.AllocationLogementSociale: + _ = match_arg_569.value + temp_calcul_allocation_logement_dot_type_aide = TypeAidesPersonnelleLogement(TypeAidesPersonnelleLogement_Code.AllocationLogementSociale, + Unit()) + temp_calcul_allocation_logement_dot_type_aide_1 = temp_calcul_allocation_logement_dot_type_aide + except EmptyError: + temp_calcul_allocation_logement_dot_type_aide_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=1015, + start_column=10, end_line=1015, + end_column=19, + law_headings=["Tous secteurs", + "Secteur logement-foyer", + "Calcul du montant de l'allocation logement", + "Prologue : aides au logement"])) + calcul_allocation_logement_dot_type_aide = temp_calcul_allocation_logement_dot_type_aide_1 + result_32 = calcul_allocation_logement(CalculAllocationLogementIn(mode_occupation_in = calcul_allocation_logement_dot_mode_occupation, + informations_calcul_in = calcul_allocation_logement_dot_informations_calcul, + ressources_menage_sans_arrondi_in = calcul_allocation_logement_dot_ressources_menage_sans_arrondi, + situation_familiale_in = calcul_allocation_logement_dot_situation_familiale, + nombre_personnes_a_charge_in = calcul_allocation_logement_dot_nombre_personnes_a_charge, + zone_in = calcul_allocation_logement_dot_zone, + date_courante_in = calcul_allocation_logement_dot_date_courante, + type_aide_in = calcul_allocation_logement_dot_type_aide)) + calcul_allocation_logement_dot_aide_finale_formule = result_32.aide_finale_formule_out + calcul_allocation_logement_dot_traitement_aide_finale = result_32.traitement_aide_finale_out + try: + temp_calcul_aide_personnalisee_logement_dot_mode_occupation = menage_4.logement.mode_occupation + except EmptyError: + temp_calcul_aide_personnalisee_logement_dot_mode_occupation = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=751, start_column=10, + end_line=751, end_column=25, + law_headings=["Tous secteurs", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + calcul_aide_personnalisee_logement_dot_mode_occupation = temp_calcul_aide_personnalisee_logement_dot_mode_occupation + try: + temp_calcul_aide_personnalisee_logement_dot_type_aide = TypeAidesPersonnelleLogement(TypeAidesPersonnelleLogement_Code.AidePersonnaliseeLogement, + Unit()) + except EmptyError: + temp_calcul_aide_personnalisee_logement_dot_type_aide = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=752, start_column=10, + end_line=752, end_column=19, + law_headings=["Tous secteurs", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + calcul_aide_personnalisee_logement_dot_type_aide = temp_calcul_aide_personnalisee_logement_dot_type_aide + try: + try: + temp_calcul_aide_personnalisee_logement_dot_informations_calcul = informations_calcul_3 + except EmptyError: + temp_calcul_aide_personnalisee_logement_dot_informations_calcul = informations_calcul_3 + temp_calcul_aide_personnalisee_logement_dot_informations_calcul_1 = temp_calcul_aide_personnalisee_logement_dot_informations_calcul + except EmptyError: + temp_calcul_aide_personnalisee_logement_dot_informations_calcul_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=753, start_column=10, + end_line=753, end_column=29, + law_headings=["Tous secteurs", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + calcul_aide_personnalisee_logement_dot_informations_calcul = temp_calcul_aide_personnalisee_logement_dot_informations_calcul_1 + try: + temp_calcul_aide_personnalisee_logement_dot_ressources_menage_sans_arrondi = ressources_menage_prises_en_compte + except EmptyError: + temp_calcul_aide_personnalisee_logement_dot_ressources_menage_sans_arrondi = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=754, start_column=10, + end_line=754, end_column=27, + law_headings=["Tous secteurs", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + calcul_aide_personnalisee_logement_dot_ressources_menage_sans_arrondi = temp_calcul_aide_personnalisee_logement_dot_ressources_menage_sans_arrondi + try: + temp_calcul_aide_personnalisee_logement_dot_situation_familiale = menage_4.situation_familiale + except EmptyError: + temp_calcul_aide_personnalisee_logement_dot_situation_familiale = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=757, start_column=10, + end_line=757, end_column=29, + law_headings=["Tous secteurs", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + calcul_aide_personnalisee_logement_dot_situation_familiale = temp_calcul_aide_personnalisee_logement_dot_situation_familiale + try: + temp_calcul_aide_personnalisee_logement_dot_nombre_personnes_a_charge = eligibilite_aide_personnalisee_logement_dot_nombre_personnes_a_charge_prises_en_compte + except EmptyError: + temp_calcul_aide_personnalisee_logement_dot_nombre_personnes_a_charge = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=758, start_column=10, + end_line=758, end_column=35, + law_headings=["Tous secteurs", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + calcul_aide_personnalisee_logement_dot_nombre_personnes_a_charge = temp_calcul_aide_personnalisee_logement_dot_nombre_personnes_a_charge + try: + temp_calcul_aide_personnalisee_logement_dot_zone = menage_4.logement.zone + except EmptyError: + temp_calcul_aide_personnalisee_logement_dot_zone = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=759, start_column=10, + end_line=759, end_column=14, + law_headings=["Tous secteurs", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + calcul_aide_personnalisee_logement_dot_zone = temp_calcul_aide_personnalisee_logement_dot_zone + try: + temp_calcul_aide_personnalisee_logement_dot_date_courante = date_courante_16 + except EmptyError: + temp_calcul_aide_personnalisee_logement_dot_date_courante = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=760, start_column=10, + end_line=760, end_column=23, + law_headings=["Tous secteurs", + "Calcul du montant de l'aide personnalisée au logement", + "Déclarations des champs d'application", + "Prologue : aides au logement"])) + calcul_aide_personnalisee_logement_dot_date_courante = temp_calcul_aide_personnalisee_logement_dot_date_courante + result_33 = calcul_aide_personnalisee_logement(CalculAidePersonnaliseeLogementIn(mode_occupation_in = calcul_aide_personnalisee_logement_dot_mode_occupation, + type_aide_in = calcul_aide_personnalisee_logement_dot_type_aide, + informations_calcul_in = calcul_aide_personnalisee_logement_dot_informations_calcul, + ressources_menage_sans_arrondi_in = calcul_aide_personnalisee_logement_dot_ressources_menage_sans_arrondi, + situation_familiale_in = calcul_aide_personnalisee_logement_dot_situation_familiale, + nombre_personnes_a_charge_in = calcul_aide_personnalisee_logement_dot_nombre_personnes_a_charge, + zone_in = calcul_aide_personnalisee_logement_dot_zone, + date_courante_in = calcul_aide_personnalisee_logement_dot_date_courante)) + calcul_aide_personnalisee_logement_dot_aide_finale_formule = result_33.aide_finale_formule_out + calcul_aide_personnalisee_logement_dot_traitement_aide_finale = result_33.traitement_aide_finale_out + try: + temp_coefficents_enfants_garde_alternee_pris_en_compte_5 = eligibilite_aide_personnalisee_logement_dot_coefficents_enfants_garde_alternee_pris_en_compte + except EmptyError: + temp_coefficents_enfants_garde_alternee_pris_en_compte_5 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=1091, + start_column=10, end_line=1091, + end_column=59, + law_headings=["Calculette globale", + "Prologue : aides au logement"])) + coefficents_enfants_garde_alternee_pris_en_compte_3 = temp_coefficents_enfants_garde_alternee_pris_en_compte_5 + try: + match_arg_570 = eligibilite_allocation_logement_dot_eligibilite_avec_condition_logement + if match_arg_570.code == EligibiliteAllocationLogement_Code.PasEligible: + _ = match_arg_570.value + temp_eligibilite_2 = False + elif match_arg_570.code == EligibiliteAllocationLogement_Code.AllocationLogementFamiliale: + _ = match_arg_570.value + temp_eligibilite_2 = True + elif match_arg_570.code == EligibiliteAllocationLogement_Code.AllocationLogementSociale: + _ = match_arg_570.value + temp_eligibilite_2 = True + temp_eligibilite_3 = (eligibilite_aide_personnalisee_logement_dot_eligibilite or + temp_eligibilite_2) + except EmptyError: + temp_eligibilite_3 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=1088, + start_column=10, end_line=1088, + end_column=21, + law_headings=["Calculette globale", + "Prologue : aides au logement"])) + eligibilite_2 = temp_eligibilite_3 + try: + def temp_traitement_aide_finale_4(param_44:Money): + try: + if not eligibilite_2: + return param_44 + else: + match_arg_571 = eligibilite_allocation_logement_dot_eligibilite_avec_condition_logement + if match_arg_571.code == EligibiliteAllocationLogement_Code.PasEligible: + _ = match_arg_571.value + temp_traitement_aide_finale_5 = True + elif match_arg_571.code == EligibiliteAllocationLogement_Code.AllocationLogementFamiliale: + _ = match_arg_571.value + temp_traitement_aide_finale_5 = False + elif match_arg_571.code == EligibiliteAllocationLogement_Code.AllocationLogementSociale: + _ = match_arg_571.value + temp_traitement_aide_finale_5 = False + if (eligibilite_aide_personnalisee_logement_dot_eligibilite and + not temp_traitement_aide_finale_5): + if (calcul_aide_personnalisee_logement_dot_traitement_aide_finale( + calcul_aide_personnalisee_logement_dot_aide_finale_formule) > + calcul_allocation_logement_dot_traitement_aide_finale( + calcul_allocation_logement_dot_aide_finale_formule)): + return calcul_aide_personnalisee_logement_dot_traitement_aide_finale( + param_44) + else: + return calcul_allocation_logement_dot_traitement_aide_finale( + param_44) + else: + if eligibilite_aide_personnalisee_logement_dot_eligibilite: + return calcul_aide_personnalisee_logement_dot_traitement_aide_finale( + param_44) + else: + return calcul_allocation_logement_dot_traitement_aide_finale( + param_44) + except EmptyError: + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=1090, + start_column=10, + end_line=1090, + end_column=32, + law_headings=["Calculette globale", + "Prologue : aides au logement"])) + except EmptyError: + temp_traitement_aide_finale_4 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=1090, + start_column=10, end_line=1090, + end_column=32, + law_headings=["Calculette globale", + "Prologue : aides au logement"])) + traitement_aide_finale_3 = temp_traitement_aide_finale_4 + try: + if not eligibilite_2: + temp_aide_finale_formule_9 = money_of_cents_string("0") + else: + match_arg_572 = eligibilite_allocation_logement_dot_eligibilite_avec_condition_logement + if match_arg_572.code == EligibiliteAllocationLogement_Code.PasEligible: + _ = match_arg_572.value + temp_aide_finale_formule_10 = True + elif match_arg_572.code == EligibiliteAllocationLogement_Code.AllocationLogementFamiliale: + _ = match_arg_572.value + temp_aide_finale_formule_10 = False + elif match_arg_572.code == EligibiliteAllocationLogement_Code.AllocationLogementSociale: + _ = match_arg_572.value + temp_aide_finale_formule_10 = False + if (eligibilite_aide_personnalisee_logement_dot_eligibilite and + not temp_aide_finale_formule_10): + if (calcul_aide_personnalisee_logement_dot_traitement_aide_finale( + calcul_aide_personnalisee_logement_dot_aide_finale_formule) > + calcul_allocation_logement_dot_traitement_aide_finale( + calcul_allocation_logement_dot_aide_finale_formule)): + temp_aide_finale_formule_9 = calcul_aide_personnalisee_logement_dot_aide_finale_formule + else: + temp_aide_finale_formule_9 = calcul_allocation_logement_dot_aide_finale_formule + else: + if eligibilite_aide_personnalisee_logement_dot_eligibilite: + temp_aide_finale_formule_9 = calcul_aide_personnalisee_logement_dot_aide_finale_formule + else: + temp_aide_finale_formule_9 = calcul_allocation_logement_dot_aide_finale_formule + except EmptyError: + temp_aide_finale_formule_9 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=1089, + start_column=10, end_line=1089, + end_column=29, + law_headings=["Calculette globale", + "Prologue : aides au logement"])) + aide_finale_formule_8 = temp_aide_finale_formule_9 + return CalculetteAidesAuLogementOut(eligibilite_out = eligibilite_2, + aide_finale_formule_out = aide_finale_formule_8, + traitement_aide_finale_out = traitement_aide_finale_3, + coefficents_enfants_garde_alternee_pris_en_compte_out = coefficents_enfants_garde_alternee_pris_en_compte_3) + +def calculette_aides_au_logement_garde_alternee(calculette_aides_au_logement_garde_alternee_in:CalculetteAidesAuLogementGardeAlterneeIn): + menage_5 = calculette_aides_au_logement_garde_alternee_in.menage_in + demandeur_5 = calculette_aides_au_logement_garde_alternee_in.demandeur_in + informations_calcul_4 = calculette_aides_au_logement_garde_alternee_in.informations_calcul_in + date_courante_17 = calculette_aides_au_logement_garde_alternee_in.date_courante_in + ressources_menage_prises_en_compte_1 = calculette_aides_au_logement_garde_alternee_in.ressources_menage_prises_en_compte_in + try: + def temp_menage_sans_enfants_garde_alternee(personne_a_charge_10:Any): + match_arg_573 = personne_a_charge_10 + if match_arg_573.code == PersonneACharge_Code.EnfantACharge: + enfant_8 = match_arg_573.value + match_arg_574 = enfant_8.situation_garde_alternee + if match_arg_574.code == SituationGardeAlternee_Code.PasDeGardeAlternee: + _ = match_arg_574.value + return True + elif match_arg_574.code == SituationGardeAlternee_Code.GardeAlterneeCoefficientPriseEnCharge: + _ = match_arg_574.value + return False + elif match_arg_573.code == PersonneACharge_Code.AutrePersonneACharge: + _ = match_arg_573.value + return True + temp_menage_sans_enfants_garde_alternee_1 = Menage(prestations_recues = menage_5.prestations_recues, + logement = menage_5.logement, + personnes_a_charge = list_filter(temp_menage_sans_enfants_garde_alternee, + menage_5.personnes_a_charge), + nombre_autres_occupants_logement = menage_5.nombre_autres_occupants_logement, + situation_familiale = menage_5.situation_familiale, + condition_rattache_foyer_fiscal_parent_ifi = menage_5.condition_rattache_foyer_fiscal_parent_ifi, + nombre_enfants_a_naitre_apres_troisieme_mois_grossesse = menage_5.nombre_enfants_a_naitre_apres_troisieme_mois_grossesse, + enfant_a_naitre_apres_quatrieme_mois_grossesse = menage_5.enfant_a_naitre_apres_quatrieme_mois_grossesse, + date_naissance_troisieme_enfant_ou_dernier_si_plus = menage_5.date_naissance_troisieme_enfant_ou_dernier_si_plus) + except EmptyError: + temp_menage_sans_enfants_garde_alternee_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=1166, + start_column=11, end_line=1166, + end_column=45, + law_headings=["Calculette avec garde alternée", + "Prologue : aides au logement"])) + menage_sans_enfants_garde_alternee = temp_menage_sans_enfants_garde_alternee_1 + try: + temp_calculette_dot_menage = menage_5 + except EmptyError: + temp_calculette_dot_menage = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=1066, + start_column=10, end_line=1066, + end_column=16, + law_headings=["Calculette globale", + "Prologue : aides au logement"])) + calculette_dot_menage = temp_calculette_dot_menage + try: + temp_calculette_dot_demandeur = demandeur_5 + except EmptyError: + temp_calculette_dot_demandeur = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=1067, + start_column=10, end_line=1067, + end_column=19, + law_headings=["Calculette globale", + "Prologue : aides au logement"])) + calculette_dot_demandeur = temp_calculette_dot_demandeur + try: + temp_calculette_dot_informations_calcul = informations_calcul_4 + except EmptyError: + temp_calculette_dot_informations_calcul = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=1068, + start_column=10, end_line=1068, + end_column=29, + law_headings=["Calculette globale", + "Prologue : aides au logement"])) + calculette_dot_informations_calcul = temp_calculette_dot_informations_calcul + try: + temp_calculette_dot_date_courante = date_courante_17 + except EmptyError: + temp_calculette_dot_date_courante = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=1069, + start_column=10, end_line=1069, + end_column=23, + law_headings=["Calculette globale", + "Prologue : aides au logement"])) + calculette_dot_date_courante = temp_calculette_dot_date_courante + try: + temp_calculette_dot_ressources_menage_prises_en_compte = ressources_menage_prises_en_compte_1 + except EmptyError: + temp_calculette_dot_ressources_menage_prises_en_compte = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=1074, + start_column=10, end_line=1074, + end_column=44, + law_headings=["Calculette globale", + "Prologue : aides au logement"])) + calculette_dot_ressources_menage_prises_en_compte = temp_calculette_dot_ressources_menage_prises_en_compte + result_34 = calculette_aides_au_logement(CalculetteAidesAuLogementIn(menage_in = calculette_dot_menage, + demandeur_in = calculette_dot_demandeur, + informations_calcul_in = calculette_dot_informations_calcul, + date_courante_in = calculette_dot_date_courante, + ressources_menage_prises_en_compte_in = calculette_dot_ressources_menage_prises_en_compte)) + calculette_dot_eligibilite = result_34.eligibilite_out + calculette_dot_aide_finale_formule = result_34.aide_finale_formule_out + calculette_dot_traitement_aide_finale = result_34.traitement_aide_finale_out + calculette_dot_coefficents_enfants_garde_alternee_pris_en_compte = result_34.coefficents_enfants_garde_alternee_pris_en_compte_out + try: + temp_calculette_sans_garde_alternee_dot_menage = menage_sans_enfants_garde_alternee + except EmptyError: + temp_calculette_sans_garde_alternee_dot_menage = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=1066, + start_column=10, end_line=1066, + end_column=16, + law_headings=["Calculette globale", + "Prologue : aides au logement"])) + calculette_sans_garde_alternee_dot_menage = temp_calculette_sans_garde_alternee_dot_menage + try: + temp_calculette_sans_garde_alternee_dot_demandeur = demandeur_5 + except EmptyError: + temp_calculette_sans_garde_alternee_dot_demandeur = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=1067, + start_column=10, end_line=1067, + end_column=19, + law_headings=["Calculette globale", + "Prologue : aides au logement"])) + calculette_sans_garde_alternee_dot_demandeur = temp_calculette_sans_garde_alternee_dot_demandeur + try: + temp_calculette_sans_garde_alternee_dot_informations_calcul = informations_calcul_4 + except EmptyError: + temp_calculette_sans_garde_alternee_dot_informations_calcul = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=1068, + start_column=10, end_line=1068, + end_column=29, + law_headings=["Calculette globale", + "Prologue : aides au logement"])) + calculette_sans_garde_alternee_dot_informations_calcul = temp_calculette_sans_garde_alternee_dot_informations_calcul + try: + temp_calculette_sans_garde_alternee_dot_date_courante = date_courante_17 + except EmptyError: + temp_calculette_sans_garde_alternee_dot_date_courante = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=1069, + start_column=10, end_line=1069, + end_column=23, + law_headings=["Calculette globale", + "Prologue : aides au logement"])) + calculette_sans_garde_alternee_dot_date_courante = temp_calculette_sans_garde_alternee_dot_date_courante + try: + temp_calculette_sans_garde_alternee_dot_ressources_menage_prises_en_compte = ressources_menage_prises_en_compte_1 + except EmptyError: + temp_calculette_sans_garde_alternee_dot_ressources_menage_prises_en_compte = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=1074, + start_column=10, end_line=1074, + end_column=44, + law_headings=["Calculette globale", + "Prologue : aides au logement"])) + calculette_sans_garde_alternee_dot_ressources_menage_prises_en_compte = temp_calculette_sans_garde_alternee_dot_ressources_menage_prises_en_compte + result_35 = calculette_aides_au_logement(CalculetteAidesAuLogementIn(menage_in = calculette_sans_garde_alternee_dot_menage, + demandeur_in = calculette_sans_garde_alternee_dot_demandeur, + informations_calcul_in = calculette_sans_garde_alternee_dot_informations_calcul, + date_courante_in = calculette_sans_garde_alternee_dot_date_courante, + ressources_menage_prises_en_compte_in = calculette_sans_garde_alternee_dot_ressources_menage_prises_en_compte)) + calculette_sans_garde_alternee_dot_eligibilite = result_35.eligibilite_out + calculette_sans_garde_alternee_dot_aide_finale_formule = result_35.aide_finale_formule_out + calculette_sans_garde_alternee_dot_traitement_aide_finale = result_35.traitement_aide_finale_out + calculette_sans_garde_alternee_dot_coefficents_enfants_garde_alternee_pris_en_compte = result_35.coefficents_enfants_garde_alternee_pris_en_compte_out + try: + temp_eligibilite_4 = calculette_dot_eligibilite + except EmptyError: + temp_eligibilite_4 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=1173, + start_column=10, end_line=1173, + end_column=21, + law_headings=["Calculette avec garde alternée", + "Prologue : aides au logement"])) + eligibilite_3 = temp_eligibilite_4 + try: + temp_coefficents_enfants_garde_alternee_pris_en_compte_6 = calculette_dot_coefficents_enfants_garde_alternee_pris_en_compte + except EmptyError: + temp_coefficents_enfants_garde_alternee_pris_en_compte_6 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=1167, + start_column=11, end_line=1167, + end_column=60, + law_headings=["Calculette avec garde alternée", + "Prologue : aides au logement"])) + coefficents_enfants_garde_alternee_pris_en_compte_4 = temp_coefficents_enfants_garde_alternee_pris_en_compte_6 + try: + if (list_length(coefficents_enfants_garde_alternee_pris_en_compte_4) == + integer_of_string("0")): + temp_aide_finale = money_of_cents_string("0") + else: + def temp_aide_finale_1(acc_13:Decimal, coeff_1:Any): + return (acc_13 + coeff_1) + temp_aide_finale = ((calculette_dot_aide_finale_formule - + calculette_sans_garde_alternee_dot_aide_finale_formule) * + (list_fold_left(temp_aide_finale_1, decimal_of_string("0."), + coefficents_enfants_garde_alternee_pris_en_compte_4) / + decimal_of_integer(list_length(coefficents_enfants_garde_alternee_pris_en_compte_4)))) + temp_aide_finale_2 = calculette_dot_traitement_aide_finale((calculette_sans_garde_alternee_dot_aide_finale_formule + + temp_aide_finale)) + except EmptyError: + temp_aide_finale_2 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", + start_line=1174, + start_column=10, end_line=1174, + end_column=21, + law_headings=["Calculette avec garde alternée", + "Prologue : aides au logement"])) + aide_finale = temp_aide_finale_2 + return CalculetteAidesAuLogementGardeAlterneeOut(eligibilite_out = eligibilite_3, + aide_finale_out = aide_finale) \ No newline at end of file diff --git a/french_law/python/src/allocations_familiales.py b/french_law/python/src/allocations_familiales.py index 3ff1314b..2cbfeaaa 100644 --- a/french_law/python/src/allocations_familiales.py +++ b/french_law/python/src/allocations_familiales.py @@ -4,7 +4,6 @@ from catala.runtime import * from typing import Any, List, Callable, Tuple from enum import Enum - class PriseEnCharge_Code(Enum): GardeAlterneePartageAllocations = 0 GardeAlterneeAllocataireUnique = 1 @@ -12,96 +11,96 @@ class PriseEnCharge_Code(Enum): ServicesSociauxAllocationVerseeALaFamille = 3 ServicesSociauxAllocationVerseeAuxServicesSociaux = 4 - class PriseEnCharge: def __init__(self, code: PriseEnCharge_Code, value: Any) -> None: self.code = code self.value = value + def __eq__(self, other: object) -> bool: if isinstance(other, PriseEnCharge): return self.code == other.code and self.value == other.value else: return False + def __ne__(self, other: object) -> bool: return not (self == other) def __str__(self) -> str: return "{}({})".format(self.code, self.value) - class SituationObligationScolaire_Code(Enum): Avant = 0 Pendant = 1 Apres = 2 - class SituationObligationScolaire: def __init__(self, code: SituationObligationScolaire_Code, value: Any) -> None: self.code = code self.value = value + def __eq__(self, other: object) -> bool: if isinstance(other, SituationObligationScolaire): return self.code == other.code and self.value == other.value else: return False + def __ne__(self, other: object) -> bool: return not (self == other) def __str__(self) -> str: return "{}({})".format(self.code, self.value) - class PriseEnCompte_Code(Enum): Complete = 0 Partagee = 1 Zero = 2 - class PriseEnCompte: def __init__(self, code: PriseEnCompte_Code, value: Any) -> None: self.code = code self.value = value + def __eq__(self, other: object) -> bool: if isinstance(other, PriseEnCompte): return self.code == other.code and self.value == other.value else: return False + def __ne__(self, other: object) -> bool: return not (self == other) def __str__(self) -> str: return "{}({})".format(self.code, self.value) - class VersementAllocations_Code(Enum): Normal = 0 AllocationVerseeAuxServicesSociaux = 1 - class VersementAllocations: def __init__(self, code: VersementAllocations_Code, value: Any) -> None: self.code = code self.value = value + def __eq__(self, other: object) -> bool: if isinstance(other, VersementAllocations): return self.code == other.code and self.value == other.value else: return False + def __ne__(self, other: object) -> bool: return not (self == other) def __str__(self) -> str: return "{}({})".format(self.code, self.value) - class ElementPrestationsFamiliales_Code(Enum): PrestationAccueilJeuneEnfant = 0 AllocationsFamiliales = 1 @@ -112,25 +111,25 @@ class ElementPrestationsFamiliales_Code(Enum): AllocationRentreeScolaire = 6 AllocationJournalierePresenceParentale = 7 - class ElementPrestationsFamiliales: def __init__(self, code: ElementPrestationsFamiliales_Code, value: Any) -> None: self.code = code self.value = value + def __eq__(self, other: object) -> bool: if isinstance(other, ElementPrestationsFamiliales): return self.code == other.code and self.value == other.value else: return False + def __ne__(self, other: object) -> bool: return not (self == other) def __str__(self) -> str: return "{}({})".format(self.code, self.value) - class Collectivite_Code(Enum): Guadeloupe = 0 Guyane = 1 @@ -142,25 +141,25 @@ class Collectivite_Code(Enum): SaintPierreEtMiquelon = 7 Mayotte = 8 - class Collectivite: def __init__(self, code: Collectivite_Code, value: Any) -> None: self.code = code self.value = value + def __eq__(self, other: object) -> bool: if isinstance(other, Collectivite): return self.code == other.code and self.value == other.value else: return False + def __ne__(self, other: object) -> bool: return not (self == other) def __str__(self) -> str: return "{}({})".format(self.code, self.value) - class EnfantEntree: def __init__(self, d_identifiant: Integer, d_remuneration_mensuelle: Money, d_date_de_naissance: Date, d_prise_en_charge: PriseEnCharge, d_a_deja_ouvert_droit_aux_allocations_familiales: bool, d_beneficie_titre_personnel_aide_personnelle_logement: bool) -> None: self.d_identifiant = d_identifiant @@ -173,11 +172,11 @@ class EnfantEntree: def __eq__(self, other: object) -> bool: if isinstance(other, EnfantEntree): return (self.d_identifiant == other.d_identifiant and - self.d_remuneration_mensuelle == other.d_remuneration_mensuelle and - self.d_date_de_naissance == other.d_date_de_naissance and - self.d_prise_en_charge == other.d_prise_en_charge and - self.d_a_deja_ouvert_droit_aux_allocations_familiales == other.d_a_deja_ouvert_droit_aux_allocations_familiales and - self.d_beneficie_titre_personnel_aide_personnelle_logement == other.d_beneficie_titre_personnel_aide_personnelle_logement) + self.d_remuneration_mensuelle == other.d_remuneration_mensuelle and + self.d_date_de_naissance == other.d_date_de_naissance and + self.d_prise_en_charge == other.d_prise_en_charge and + self.d_a_deja_ouvert_droit_aux_allocations_familiales == other.d_a_deja_ouvert_droit_aux_allocations_familiales and + self.d_beneficie_titre_personnel_aide_personnelle_logement == other.d_beneficie_titre_personnel_aide_personnelle_logement) else: return False @@ -186,11 +185,10 @@ class EnfantEntree: def __str__(self) -> str: return "EnfantEntree(d_identifiant={},d_remuneration_mensuelle={},d_date_de_naissance={},d_prise_en_charge={},d_a_deja_ouvert_droit_aux_allocations_familiales={},d_beneficie_titre_personnel_aide_personnelle_logement={})".format(self.d_identifiant, - self.d_remuneration_mensuelle, self.d_date_de_naissance, - self.d_prise_en_charge, - self.d_a_deja_ouvert_droit_aux_allocations_familiales, - self.d_beneficie_titre_personnel_aide_personnelle_logement) - + self.d_remuneration_mensuelle, self.d_date_de_naissance, + self.d_prise_en_charge, + self.d_a_deja_ouvert_droit_aux_allocations_familiales, + self.d_beneficie_titre_personnel_aide_personnelle_logement) class Enfant: def __init__(self, identifiant: Integer, obligation_scolaire: SituationObligationScolaire, remuneration_mensuelle: Money, date_de_naissance: Date, age: Integer, prise_en_charge: PriseEnCharge, a_deja_ouvert_droit_aux_allocations_familiales: bool, beneficie_titre_personnel_aide_personnelle_logement: bool) -> None: @@ -206,13 +204,13 @@ class Enfant: def __eq__(self, other: object) -> bool: if isinstance(other, Enfant): return (self.identifiant == other.identifiant and - self.obligation_scolaire == other.obligation_scolaire and - self.remuneration_mensuelle == other.remuneration_mensuelle and - self.date_de_naissance == other.date_de_naissance and - self.age == other.age and - self.prise_en_charge == other.prise_en_charge and - self.a_deja_ouvert_droit_aux_allocations_familiales == other.a_deja_ouvert_droit_aux_allocations_familiales and - self.beneficie_titre_personnel_aide_personnelle_logement == other.beneficie_titre_personnel_aide_personnelle_logement) + self.obligation_scolaire == other.obligation_scolaire and + self.remuneration_mensuelle == other.remuneration_mensuelle and + self.date_de_naissance == other.date_de_naissance and + self.age == other.age and + self.prise_en_charge == other.prise_en_charge and + self.a_deja_ouvert_droit_aux_allocations_familiales == other.a_deja_ouvert_droit_aux_allocations_familiales and + self.beneficie_titre_personnel_aide_personnelle_logement == other.beneficie_titre_personnel_aide_personnelle_logement) else: return False @@ -221,11 +219,10 @@ class Enfant: def __str__(self) -> str: return "Enfant(identifiant={},obligation_scolaire={},remuneration_mensuelle={},date_de_naissance={},age={},prise_en_charge={},a_deja_ouvert_droit_aux_allocations_familiales={},beneficie_titre_personnel_aide_personnelle_logement={})".format(self.identifiant, - self.obligation_scolaire, self.remuneration_mensuelle, - self.date_de_naissance, self.age, self.prise_en_charge, - self.a_deja_ouvert_droit_aux_allocations_familiales, - self.beneficie_titre_personnel_aide_personnelle_logement) - + self.obligation_scolaire, self.remuneration_mensuelle, + self.date_de_naissance, self.age, self.prise_en_charge, + self.a_deja_ouvert_droit_aux_allocations_familiales, + self.beneficie_titre_personnel_aide_personnelle_logement) class PrestationsFamilialesOut: def __init__(self, droit_ouvert_out: Callable[[Enfant], bool], conditions_hors_age_out: Callable[[Enfant], bool], age_l512_3_2_out: Integer, regime_outre_mer_l751_1_out: bool) -> None: @@ -237,9 +234,9 @@ class PrestationsFamilialesOut: def __eq__(self, other: object) -> bool: if isinstance(other, PrestationsFamilialesOut): return (self.droit_ouvert_out == other.droit_ouvert_out and - self.conditions_hors_age_out == other.conditions_hors_age_out and - self.age_l512_3_2_out == other.age_l512_3_2_out and - self.regime_outre_mer_l751_1_out == other.regime_outre_mer_l751_1_out) + self.conditions_hors_age_out == other.conditions_hors_age_out and + self.age_l512_3_2_out == other.age_l512_3_2_out and + self.regime_outre_mer_l751_1_out == other.regime_outre_mer_l751_1_out) else: return False @@ -248,9 +245,8 @@ class PrestationsFamilialesOut: def __str__(self) -> str: return "PrestationsFamilialesOut(droit_ouvert_out={},conditions_hors_age_out={},age_l512_3_2_out={},regime_outre_mer_l751_1_out={})".format(self.droit_ouvert_out, - self.conditions_hors_age_out, self.age_l512_3_2_out, - self.regime_outre_mer_l751_1_out) - + self.conditions_hors_age_out, self.age_l512_3_2_out, + self.regime_outre_mer_l751_1_out) class PrestationsFamilialesIn: def __init__(self, date_courante_in: Date, prestation_courante_in: ElementPrestationsFamiliales, residence_in: Collectivite) -> None: @@ -261,8 +257,8 @@ class PrestationsFamilialesIn: def __eq__(self, other: object) -> bool: if isinstance(other, PrestationsFamilialesIn): return (self.date_courante_in == other.date_courante_in and - self.prestation_courante_in == other.prestation_courante_in and - self.residence_in == other.residence_in) + self.prestation_courante_in == other.prestation_courante_in and + self.residence_in == other.residence_in) else: return False @@ -271,8 +267,7 @@ class PrestationsFamilialesIn: def __str__(self) -> str: return "PrestationsFamilialesIn(date_courante_in={},prestation_courante_in={},residence_in={})".format(self.date_courante_in, - self.prestation_courante_in, self.residence_in) - + self.prestation_courante_in, self.residence_in) class AllocationFamilialesAvril2008Out: def __init__(self, age_minimum_alinea_1_l521_3_out: Integer) -> None: @@ -290,7 +285,6 @@ class AllocationFamilialesAvril2008Out: def __str__(self) -> str: return "AllocationFamilialesAvril2008Out(age_minimum_alinea_1_l521_3_out={})".format(self.age_minimum_alinea_1_l521_3_out) - class AllocationFamilialesAvril2008In: def __init__(self, ) -> None: pass @@ -307,7 +301,6 @@ class AllocationFamilialesAvril2008In: def __str__(self) -> str: return "AllocationFamilialesAvril2008In()".format() - class EnfantLePlusAgeOut: def __init__(self, le_plus_age_out: Enfant) -> None: self.le_plus_age_out = le_plus_age_out @@ -324,7 +317,6 @@ class EnfantLePlusAgeOut: def __str__(self) -> str: return "EnfantLePlusAgeOut(le_plus_age_out={})".format(self.le_plus_age_out) - class EnfantLePlusAgeIn: def __init__(self, enfants_in: List[Enfant]) -> None: self.enfants_in = enfants_in @@ -341,7 +333,6 @@ class EnfantLePlusAgeIn: def __str__(self) -> str: return "EnfantLePlusAgeIn(enfants_in={})".format(self.enfants_in) - class AllocationsFamilialesOut: def __init__(self, montant_verse_out: Money) -> None: self.montant_verse_out = montant_verse_out @@ -358,7 +349,6 @@ class AllocationsFamilialesOut: def __str__(self) -> str: return "AllocationsFamilialesOut(montant_verse_out={})".format(self.montant_verse_out) - class AllocationsFamilialesIn: def __init__(self, personne_charge_effective_permanente_est_parent_in: bool, personne_charge_effective_permanente_remplit_titre_I_in: bool, ressources_menage_in: Money, residence_in: Collectivite, date_courante_in: Date, enfants_a_charge_in: List[Enfant], avait_enfant_a_charge_avant_1er_janvier_2012_in: bool) -> None: self.personne_charge_effective_permanente_est_parent_in = personne_charge_effective_permanente_est_parent_in @@ -372,12 +362,12 @@ class AllocationsFamilialesIn: def __eq__(self, other: object) -> bool: if isinstance(other, AllocationsFamilialesIn): return (self.personne_charge_effective_permanente_est_parent_in == other.personne_charge_effective_permanente_est_parent_in and - self.personne_charge_effective_permanente_remplit_titre_I_in == other.personne_charge_effective_permanente_remplit_titre_I_in and - self.ressources_menage_in == other.ressources_menage_in and - self.residence_in == other.residence_in and - self.date_courante_in == other.date_courante_in and - self.enfants_a_charge_in == other.enfants_a_charge_in and - self.avait_enfant_a_charge_avant_1er_janvier_2012_in == other.avait_enfant_a_charge_avant_1er_janvier_2012_in) + self.personne_charge_effective_permanente_remplit_titre_I_in == other.personne_charge_effective_permanente_remplit_titre_I_in and + self.ressources_menage_in == other.ressources_menage_in and + self.residence_in == other.residence_in and + self.date_courante_in == other.date_courante_in and + self.enfants_a_charge_in == other.enfants_a_charge_in and + self.avait_enfant_a_charge_avant_1er_janvier_2012_in == other.avait_enfant_a_charge_avant_1er_janvier_2012_in) else: return False @@ -386,11 +376,10 @@ class AllocationsFamilialesIn: def __str__(self) -> str: return "AllocationsFamilialesIn(personne_charge_effective_permanente_est_parent_in={},personne_charge_effective_permanente_remplit_titre_I_in={},ressources_menage_in={},residence_in={},date_courante_in={},enfants_a_charge_in={},avait_enfant_a_charge_avant_1er_janvier_2012_in={})".format(self.personne_charge_effective_permanente_est_parent_in, - self.personne_charge_effective_permanente_remplit_titre_I_in, - self.ressources_menage_in, self.residence_in, self.date_courante_in, - self.enfants_a_charge_in, - self.avait_enfant_a_charge_avant_1er_janvier_2012_in) - + self.personne_charge_effective_permanente_remplit_titre_I_in, + self.ressources_menage_in, self.residence_in, + self.date_courante_in, self.enfants_a_charge_in, + self.avait_enfant_a_charge_avant_1er_janvier_2012_in) class SmicOut: def __init__(self, brut_horaire_out: Money) -> None: @@ -408,7 +397,6 @@ class SmicOut: def __str__(self) -> str: return "SmicOut(brut_horaire_out={})".format(self.brut_horaire_out) - class SmicIn: def __init__(self, date_courante_in: Date, residence_in: Collectivite) -> None: self.date_courante_in = date_courante_in @@ -417,7 +405,7 @@ class SmicIn: def __eq__(self, other: object) -> bool: if isinstance(other, SmicIn): return (self.date_courante_in == other.date_courante_in and - self.residence_in == other.residence_in) + self.residence_in == other.residence_in) else: return False @@ -426,8 +414,7 @@ class SmicIn: def __str__(self) -> str: return "SmicIn(date_courante_in={},residence_in={})".format(self.date_courante_in, - self.residence_in) - + self.residence_in) class BaseMensuelleAllocationsFamilialesOut: def __init__(self, montant_out: Money) -> None: @@ -445,7 +432,6 @@ class BaseMensuelleAllocationsFamilialesOut: def __str__(self) -> str: return "BaseMensuelleAllocationsFamilialesOut(montant_out={})".format(self.montant_out) - class BaseMensuelleAllocationsFamilialesIn: def __init__(self, date_courante_in: Date) -> None: self.date_courante_in = date_courante_in @@ -462,7 +448,6 @@ class BaseMensuelleAllocationsFamilialesIn: def __str__(self) -> str: return "BaseMensuelleAllocationsFamilialesIn(date_courante_in={})".format(self.date_courante_in) - class InterfaceAllocationsFamilialesOut: def __init__(self, i_montant_verse_out: Money) -> None: self.i_montant_verse_out = i_montant_verse_out @@ -479,7 +464,6 @@ class InterfaceAllocationsFamilialesOut: def __str__(self) -> str: return "InterfaceAllocationsFamilialesOut(i_montant_verse_out={})".format(self.i_montant_verse_out) - class InterfaceAllocationsFamilialesIn: def __init__(self, i_date_courante_in: Date, i_enfants_in: List[EnfantEntree], i_ressources_menage_in: Money, i_residence_in: Collectivite, i_personne_charge_effective_permanente_est_parent_in: bool, i_personne_charge_effective_permanente_remplit_titre_I_in: bool, i_avait_enfant_a_charge_avant_1er_janvier_2012_in: bool) -> None: self.i_date_courante_in = i_date_courante_in @@ -493,12 +477,12 @@ class InterfaceAllocationsFamilialesIn: def __eq__(self, other: object) -> bool: if isinstance(other, InterfaceAllocationsFamilialesIn): return (self.i_date_courante_in == other.i_date_courante_in and - self.i_enfants_in == other.i_enfants_in and - self.i_ressources_menage_in == other.i_ressources_menage_in and - self.i_residence_in == other.i_residence_in and - self.i_personne_charge_effective_permanente_est_parent_in == other.i_personne_charge_effective_permanente_est_parent_in and - self.i_personne_charge_effective_permanente_remplit_titre_I_in == other.i_personne_charge_effective_permanente_remplit_titre_I_in and - self.i_avait_enfant_a_charge_avant_1er_janvier_2012_in == other.i_avait_enfant_a_charge_avant_1er_janvier_2012_in) + self.i_enfants_in == other.i_enfants_in and + self.i_ressources_menage_in == other.i_ressources_menage_in and + self.i_residence_in == other.i_residence_in and + self.i_personne_charge_effective_permanente_est_parent_in == other.i_personne_charge_effective_permanente_est_parent_in and + self.i_personne_charge_effective_permanente_remplit_titre_I_in == other.i_personne_charge_effective_permanente_remplit_titre_I_in and + self.i_avait_enfant_a_charge_avant_1er_janvier_2012_in == other.i_avait_enfant_a_charge_avant_1er_janvier_2012_in) else: return False @@ -507,372 +491,366 @@ class InterfaceAllocationsFamilialesIn: def __str__(self) -> str: return "InterfaceAllocationsFamilialesIn(i_date_courante_in={},i_enfants_in={},i_ressources_menage_in={},i_residence_in={},i_personne_charge_effective_permanente_est_parent_in={},i_personne_charge_effective_permanente_remplit_titre_I_in={},i_avait_enfant_a_charge_avant_1er_janvier_2012_in={})".format(self.i_date_courante_in, - self.i_enfants_in, self.i_ressources_menage_in, self.i_residence_in, - self.i_personne_charge_effective_permanente_est_parent_in, - self.i_personne_charge_effective_permanente_remplit_titre_I_in, - self.i_avait_enfant_a_charge_avant_1er_janvier_2012_in) + self.i_enfants_in, self.i_ressources_menage_in, + self.i_residence_in, + self.i_personne_charge_effective_permanente_est_parent_in, + self.i_personne_charge_effective_permanente_remplit_titre_I_in, + self.i_avait_enfant_a_charge_avant_1er_janvier_2012_in) -def allocation_familiales_avril2008(allocation_familiales_avril2008_in: AllocationFamilialesAvril2008In): + +def allocation_familiales_avril2008(allocation_familiales_avril2008_in:AllocationFamilialesAvril2008In): try: temp_age_minimum_alinea_1_l521_3 = integer_of_string("16") except EmptyError: - raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", + temp_age_minimum_alinea_1_l521_3 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/allocations_familiales/prologue.catala_fr", start_line=77, start_column=10, end_line=77, end_column=37, law_headings=["Allocations familiales", - "Champs d'applications", - "Prologue"])) - age_minimum_alinea_1_l521_3 = log_variable_definition(["AllocationFamilialesAvril2008", - "âge_minimum_alinéa_1_l521_3"], temp_age_minimum_alinea_1_l521_3) - return AllocationFamilialesAvril2008Out(age_minimum_alinea_1_l521_3_out=age_minimum_alinea_1_l521_3) + "Champs d'applications", + "Prologue"])) + age_minimum_alinea_1_l521_3 = temp_age_minimum_alinea_1_l521_3 + return AllocationFamilialesAvril2008Out(age_minimum_alinea_1_l521_3_out = age_minimum_alinea_1_l521_3) - -def enfant_le_plus_age(enfant_le_plus_age_in: EnfantLePlusAgeIn): +def enfant_le_plus_age(enfant_le_plus_age_in:EnfantLePlusAgeIn): enfants = enfant_le_plus_age_in.enfants_in try: - def temp_le_plus_age(acc: Any, item: Any): + def temp_le_plus_age(acc:Any, item:Any): if (acc.age > item.age): return acc else: return item temp_le_plus_age_1 = list_fold_left(temp_le_plus_age, - Enfant(identifiant=- integer_of_string("1"), - obligation_scolaire=SituationObligationScolaire(SituationObligationScolaire_Code.Pendant, - Unit()), - remuneration_mensuelle=money_of_cents_string( - "0"), - date_de_naissance=date_of_numbers( - 1900, 1, 1), - age=integer_of_string("0"), - prise_en_charge=PriseEnCharge(PriseEnCharge_Code.EffectiveEtPermanente, - Unit()), - a_deja_ouvert_droit_aux_allocations_familiales=False, - beneficie_titre_personnel_aide_personnelle_logement=False), + Enfant(identifiant = integer_of_string("-1"), + obligation_scolaire = SituationObligationScolaire(SituationObligationScolaire_Code.Pendant, + Unit()), + remuneration_mensuelle = money_of_cents_string("0"), + date_de_naissance = date_of_numbers(1900,1,1), + age = integer_of_string("0"), + prise_en_charge = PriseEnCharge(PriseEnCharge_Code.EffectiveEtPermanente, + Unit()), + a_deja_ouvert_droit_aux_allocations_familiales = False, + beneficie_titre_personnel_aide_personnelle_logement = False), enfants) except EmptyError: - raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", + temp_le_plus_age_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/allocations_familiales/prologue.catala_fr", start_line=81, start_column=10, end_line=81, end_column=21, law_headings=["Allocations familiales", - "Champs d'applications", - "Prologue"])) - le_plus_age = log_variable_definition(["EnfantLePlusÂgé", - "le_plus_âgé"], temp_le_plus_age_1) - return EnfantLePlusAgeOut(le_plus_age_out=le_plus_age) + "Champs d'applications", + "Prologue"])) + le_plus_age = temp_le_plus_age_1 + return EnfantLePlusAgeOut(le_plus_age_out = le_plus_age) - -def smic(smic_in: SmicIn): +def smic(smic_in:SmicIn): date_courante = smic_in.date_courante_in residence = smic_in.residence_in try: - def temp_brut_horaire(_: Any): + def temp_brut_horaire(_:Any): raise EmptyError - - def temp_brut_horaire_1(_: Any): - return True - - def temp_brut_horaire_2(_: Any): - if log_decision_taken(SourcePosition(filename="./../smic/smic.catala_fr", - start_line=29, start_column=5, end_line=38, end_column=6, - law_headings=["Article 1", - "Décret n° 2018-1173 du 19 décembre 2018 portant relèvement du salaire minimum de croissance", - "Montant du salaire minimum de croissance"]), ((date_courante >= - date_of_numbers(2019, 1, 1)) and ((date_courante <= - 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 money_of_cents_string("1003") + def temp_brut_horaire_1(_:Any): + return False + def temp_brut_horaire_2(_:Any): + if ((date_courante >= date_of_numbers(2022,5,1)) and + ((date_courante <= date_of_numbers(2022,12,31)) and + (residence == Collectivite(Collectivite_Code.Mayotte, + Unit())))): + return money_of_cents_string("819") else: raise EmptyError - - def temp_brut_horaire_3(_: Any): - if log_decision_taken(SourcePosition(filename="./../smic/smic.catala_fr", - start_line=47, start_column=5, end_line=49, end_column=6, - law_headings=["Article 1", - "Décret n° 2018-1173 du 19 décembre 2018 portant relèvement du salaire minimum de croissance", - "Montant du salaire minimum de croissance"]), ((date_courante >= - date_of_numbers(2019, 1, 1)) and ((date_courante <= - date_of_numbers(2019, 12, 31)) and (residence == - Collectivite(Collectivite_Code.Mayotte, - Unit()))))): - return money_of_cents_string("757") + def temp_brut_horaire_3(_:Any): + if ((date_courante >= date_of_numbers(2022,5,1)) and + ((date_courante <= date_of_numbers(2022,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 money_of_cents_string("1085") else: raise EmptyError - - def temp_brut_horaire_4(_: Any): - if log_decision_taken(SourcePosition(filename="./../smic/smic.catala_fr", - start_line=68, start_column=5, end_line=77, end_column=6, - law_headings=["Article 1", - "Décret n° 2019-1387 du 18 décembre 2019 portant relèvement du salaire minimum de croissance", - "Montant du salaire minimum de croissance"]), ((date_courante >= - date_of_numbers(2020, 1, 1)) and ((date_courante <= - date_of_numbers(2020, 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 money_of_cents_string("1015") + def temp_brut_horaire_4(_:Any): + if ((date_courante >= date_of_numbers(2022,1,1)) and + ((date_courante <= date_of_numbers(2022,4,30)) and + (residence == Collectivite(Collectivite_Code.Mayotte, + Unit())))): + return money_of_cents_string("798") else: raise EmptyError - - def temp_brut_horaire_5(_: Any): - if log_decision_taken(SourcePosition(filename="./../smic/smic.catala_fr", - start_line=86, start_column=5, end_line=88, end_column=6, - law_headings=["Article 1", - "Décret n° 2019-1387 du 18 décembre 2019 portant relèvement du salaire minimum de croissance", - "Montant du salaire minimum de croissance"]), ((date_courante >= - date_of_numbers(2020, 1, 1)) and ((date_courante <= - date_of_numbers(2020, 12, 31)) and (residence == - Collectivite(Collectivite_Code.Mayotte, - Unit()))))): - return money_of_cents_string("766") + def temp_brut_horaire_5(_:Any): + if ((date_courante >= date_of_numbers(2022,1,1)) and + ((date_courante <= date_of_numbers(2022,4,30)) 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 money_of_cents_string("1057") else: raise EmptyError - - def temp_brut_horaire_6(_: Any): - if log_decision_taken(SourcePosition(filename="./../smic/smic.catala_fr", - start_line=107, start_column=5, end_line=116, end_column=6, - law_headings=["Article 1", - "Décret n° 2020-1598 du 16 décembre 2020 portant relèvement du salaire minimum de croissance", - "Montant du salaire minimum de croissance"]), ((date_courante >= - date_of_numbers(2021, 1, 1)) and ((date_courante <= - date_of_numbers(2021, 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 money_of_cents_string("1025") - else: - raise EmptyError - - def temp_brut_horaire_7(_: Any): - if log_decision_taken(SourcePosition(filename="./../smic/smic.catala_fr", - start_line=125, start_column=5, end_line=127, end_column=6, - law_headings=["Article 1", - "Décret n° 2020-1598 du 16 décembre 2020 portant relèvement du salaire minimum de croissance", - "Montant du salaire minimum de croissance"]), ((date_courante >= - date_of_numbers(2021, 1, 1)) and ((date_courante <= - date_of_numbers(2021, 12, 31)) and (residence == - Collectivite(Collectivite_Code.Mayotte, - Unit()))))): + def temp_brut_horaire_6(_:Any): + if ((date_courante >= date_of_numbers(2021,1,1)) and + ((date_courante <= date_of_numbers(2021,12,31)) and + (residence == Collectivite(Collectivite_Code.Mayotte, + Unit())))): return money_of_cents_string("774") else: raise EmptyError - temp_brut_horaire_8 = handle_default([temp_brut_horaire_7, - temp_brut_horaire_6, - temp_brut_horaire_5, - temp_brut_horaire_4, - temp_brut_horaire_3, - temp_brut_horaire_2], - temp_brut_horaire_1, - temp_brut_horaire) + def temp_brut_horaire_7(_:Any): + if ((date_courante >= date_of_numbers(2021,1,1)) and + ((date_courante <= date_of_numbers(2021,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 money_of_cents_string("1025") + else: + raise EmptyError + def temp_brut_horaire_8(_:Any): + if ((date_courante >= date_of_numbers(2020,1,1)) and + ((date_courante <= date_of_numbers(2020,12,31)) and + (residence == Collectivite(Collectivite_Code.Mayotte, + Unit())))): + return money_of_cents_string("766") + else: + raise EmptyError + def temp_brut_horaire_9(_:Any): + if ((date_courante >= date_of_numbers(2020,1,1)) and + ((date_courante <= date_of_numbers(2020,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 money_of_cents_string("1015") + else: + raise EmptyError + def temp_brut_horaire_10(_:Any): + if ((date_courante >= date_of_numbers(2019,1,1)) and + ((date_courante <= date_of_numbers(2019,12,31)) and + (residence == Collectivite(Collectivite_Code.Mayotte, + Unit())))): + return money_of_cents_string("757") + else: + raise EmptyError + def temp_brut_horaire_11(_:Any): + if ((date_courante >= date_of_numbers(2019,1,1)) and + ((date_courante <= 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 money_of_cents_string("1003") + else: + raise EmptyError + temp_brut_horaire_12 = handle_default(SourcePosition(filename="examples/allocations_familiales/../smic/smic.catala_fr", + start_line=11, start_column=10, + end_line=11, end_column=22, + law_headings=["Prologue", + "Montant du salaire minimum de croissance"]), [temp_brut_horaire_11, + temp_brut_horaire_10, + temp_brut_horaire_9, + temp_brut_horaire_8, + temp_brut_horaire_7, + temp_brut_horaire_6, + temp_brut_horaire_5, + temp_brut_horaire_4, + temp_brut_horaire_3, + temp_brut_horaire_2], + temp_brut_horaire_1, + temp_brut_horaire) except EmptyError: - raise NoValueProvided(SourcePosition(filename="./../smic/smic.catala_fr", + temp_brut_horaire_12 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/allocations_familiales/../smic/smic.catala_fr", start_line=11, start_column=10, end_line=11, end_column=22, law_headings=["Prologue", - "Montant du salaire minimum de croissance"])) - brut_horaire = log_variable_definition(["Smic", "brut_horaire"], - temp_brut_horaire_8) - return SmicOut(brut_horaire_out=brut_horaire) + "Montant du salaire minimum de croissance"])) + brut_horaire = temp_brut_horaire_12 + return SmicOut(brut_horaire_out = brut_horaire) - -def base_mensuelle_allocations_familiales(base_mensuelle_allocations_familiales_in: BaseMensuelleAllocationsFamilialesIn): +def base_mensuelle_allocations_familiales(base_mensuelle_allocations_familiales_in:BaseMensuelleAllocationsFamilialesIn): date_courante_1 = base_mensuelle_allocations_familiales_in.date_courante_in try: - def temp_montant(_: Any): + def temp_montant(_:Any): raise EmptyError - - def temp_montant_1(_: Any): - return True - - def temp_montant_2(_: Any): - if log_decision_taken(SourcePosition(filename="./../base_mensuelle_allocations_familiales/bmaf.catala_fr", - start_line=28, start_column=5, end_line=29, end_column=34, - law_headings=["Instruction ministérielle N°DSS/SD2B/2019/65 du 25 mars 2019 relative à la revalorisation au 1er avril 2019 des prestations familiales servies en métropole", - "Montant de la base mensuelle des allocations familiales"]), ((date_courante_1 >= - date_of_numbers(2019, 4, 1)) and (date_courante_1 < - date_of_numbers(2020, 4, 1)))): - return money_of_cents_string("41316") - else: - raise EmptyError - - def temp_montant_3(_: Any): - if log_decision_taken(SourcePosition(filename="./../base_mensuelle_allocations_familiales/bmaf.catala_fr", - start_line=48, start_column=5, end_line=49, end_column=34, - law_headings=["Instruction interministérielle no DSS/SD2B/2020/33 du 18 février 2020 relative à la revalorisation au 1er avril 2020 des prestations familiales servies en métropole, en Guadeloupe, en Guyane, en Martinique, à La Réunion, à Saint-Barthélemy, à Saint-Martin et dans le département de Mayotte", - "Montant de la base mensuelle des allocations familiales"]), ((date_courante_1 >= - date_of_numbers(2020, 4, 1)) and (date_courante_1 < - date_of_numbers(2021, 4, 1)))): - return money_of_cents_string("41440") - else: - raise EmptyError - - def temp_montant_4(_: Any): - if log_decision_taken(SourcePosition(filename="./../base_mensuelle_allocations_familiales/bmaf.catala_fr", - start_line=64, start_column=5, end_line=65, end_column=34, - law_headings=["Instruction interministérielle n°DSS/2B/2021/65 du 19 mars 2021 relative à la revalorisation au 1er avril 2021 des prestations familiales servies en métropole, en Guadeloupe, en Guyane, en Martinique, à la Réunion, à Saint-Barthélemy, à Saint-Martin et dans le département de Mayotte", - "Montant de la base mensuelle des allocations familiales"]), ((date_courante_1 >= - date_of_numbers(2021, 4, 1)) and (date_courante_1 < - date_of_numbers(2022, 4, 1)))): - return money_of_cents_string("41481") - else: - raise EmptyError - - def temp_montant_5(_: Any): - if log_decision_taken(SourcePosition(filename="./../base_mensuelle_allocations_familiales/bmaf.catala_fr", - start_line=82, start_column=5, end_line=83, end_column=34, - law_headings=["Instruction interministérielle n°DSS/2B/2022/82 du 28 mars 2022 relative à la revalorisation au 1er avril 2022 des prestations familiales servies en métropole, en Guadeloupe, en Guyane, en Martinique, à la Réunion, à Saint-Barthélemy, à Saint-Martin et dans le département de Mayotte", - "Montant de la base mensuelle des allocations familiales"]), ((date_courante_1 >= - date_of_numbers(2022, 4, 1)) and (date_courante_1 < - date_of_numbers(2023, 4, 1)))): + def temp_montant_1(_:Any): + return False + def temp_montant_2(_:Any): + if ((date_courante_1 >= date_of_numbers(2022,4,1)) and + (date_courante_1 < + date_of_numbers(2023,4,1))): return money_of_cents_string("42228") else: raise EmptyError - temp_montant_6 = handle_default([temp_montant_5, temp_montant_4, - temp_montant_3, temp_montant_2], - temp_montant_1, temp_montant) + def temp_montant_3(_:Any): + if ((date_courante_1 >= date_of_numbers(2021,4,1)) and + (date_courante_1 < + date_of_numbers(2022,4,1))): + return money_of_cents_string("41481") + else: + raise EmptyError + def temp_montant_4(_:Any): + if ((date_courante_1 >= date_of_numbers(2020,4,1)) and + (date_courante_1 < + date_of_numbers(2021,4,1))): + return money_of_cents_string("41440") + else: + raise EmptyError + def temp_montant_5(_:Any): + if ((date_courante_1 >= date_of_numbers(2019,4,1)) and + (date_courante_1 < + date_of_numbers(2020,4,1))): + return money_of_cents_string("41316") + else: + raise EmptyError + temp_montant_6 = handle_default(SourcePosition(filename="examples/allocations_familiales/../base_mensuelle_allocations_familiales/bmaf.catala_fr", + start_line=6, start_column=10, + end_line=6, end_column=17, + law_headings=["Montant de la base mensuelle des allocations familiales"]), [temp_montant_5, + temp_montant_4, temp_montant_3, + temp_montant_2], temp_montant_1, + temp_montant) except EmptyError: - raise NoValueProvided(SourcePosition(filename="./../base_mensuelle_allocations_familiales/bmaf.catala_fr", + temp_montant_6 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/allocations_familiales/../base_mensuelle_allocations_familiales/bmaf.catala_fr", start_line=6, start_column=10, end_line=6, end_column=17, law_headings=["Montant de la base mensuelle des allocations familiales"])) - montant = log_variable_definition(["BaseMensuelleAllocationsFamiliales", - "montant"], temp_montant_6) - return BaseMensuelleAllocationsFamilialesOut(montant_out=montant) + montant = temp_montant_6 + return BaseMensuelleAllocationsFamilialesOut(montant_out = montant) - -def prestations_familiales(prestations_familiales_in: PrestationsFamilialesIn): +def prestations_familiales(prestations_familiales_in:PrestationsFamilialesIn): date_courante_2 = prestations_familiales_in.date_courante_in prestation_courante = prestations_familiales_in.prestation_courante_in residence_1 = prestations_familiales_in.residence_in try: temp_age_l512_3_2 = integer_of_string("20") except EmptyError: - raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", + temp_age_l512_3_2 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/allocations_familiales/prologue.catala_fr", start_line=61, start_column=10, end_line=61, end_column=22, law_headings=["Prestations familiales", - "Champs d'applications", - "Prologue"])) - age_l512_3_2 = log_variable_definition(["PrestationsFamiliales", - "âge_l512_3_2"], temp_age_l512_3_2) + "Champs d'applications", + "Prologue"])) + age_l512_3_2 = temp_age_l512_3_2 try: - temp_smic_dot_date_courante = log_variable_definition(["PrestationsFamiliales", - "smic.date_courante"], date_courante_2) + temp_smic_dot_date_courante = date_courante_2 except EmptyError: - raise NoValueProvided(SourcePosition(filename="./../smic/smic.catala_fr", + temp_smic_dot_date_courante = dead_value + raise NoValueProvided(SourcePosition(filename="examples/allocations_familiales/../smic/smic.catala_fr", start_line=9, start_column=10, end_line=9, end_column=23, law_headings=["Prologue", - "Montant du salaire minimum de croissance"])) + "Montant du salaire minimum de croissance"])) smic_dot_date_courante = temp_smic_dot_date_courante try: - temp_smic_dot_residence = log_variable_definition(["PrestationsFamiliales", - "smic.résidence"], residence_1) + temp_smic_dot_residence = residence_1 except EmptyError: - raise NoValueProvided(SourcePosition(filename="./../smic/smic.catala_fr", + temp_smic_dot_residence = dead_value + raise NoValueProvided(SourcePosition(filename="examples/allocations_familiales/../smic/smic.catala_fr", start_line=10, start_column=10, end_line=10, end_column=19, law_headings=["Prologue", - "Montant du salaire minimum de croissance"])) + "Montant du salaire minimum de croissance"])) smic_dot_residence = temp_smic_dot_residence - result = log_end_call(["PrestationsFamiliales", "smic", "Smic"], - log_begin_call(["PrestationsFamiliales", "smic", "Smic"], smic, - SmicIn(date_courante_in=smic_dot_date_courante, - residence_in=smic_dot_residence))) + result = smic(SmicIn(date_courante_in = smic_dot_date_courante, + residence_in = smic_dot_residence)) smic_dot_brut_horaire = result.brut_horaire_out try: try: - if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=354, start_column=5, end_line=359, end_column=30, - law_headings=["Article L751-1", - "Chapitre 1er : Généralités", - "Titre 5 : Dispositions particulières à la Guadeloupe, à la Guyane, à la Martinique, à La Réunion, à Saint-Barthélemy et à Saint-Martin", - "Livre 7 : Régimes divers - Dispositions diverses", - "Partie législative", - "Code de la sécurité sociale"]), ((residence_1 == - Collectivite(Collectivite_Code.Guadeloupe, Unit())) or - ((residence_1 == Collectivite(Collectivite_Code.Guyane, - Unit())) or ((residence_1 == - Collectivite(Collectivite_Code.Martinique, Unit())) or - ((residence_1 == Collectivite(Collectivite_Code.LaReunion, - Unit())) or ((residence_1 == - Collectivite(Collectivite_Code.SaintBarthelemy, Unit())) or - (residence_1 == Collectivite(Collectivite_Code.SaintMartin, - Unit())))))))): + if ((residence_1 == Collectivite(Collectivite_Code.Guadeloupe, + Unit())) or ((residence_1 == + Collectivite(Collectivite_Code.Guyane, Unit())) or + ((residence_1 == Collectivite(Collectivite_Code.Martinique, + Unit())) or ((residence_1 == + Collectivite(Collectivite_Code.LaReunion, Unit())) or + ((residence_1 == + Collectivite(Collectivite_Code.SaintBarthelemy, Unit())) or + (residence_1 == Collectivite(Collectivite_Code.SaintMartin, + Unit()))))))): temp_regime_outre_mer_l751_1 = True else: + temp_regime_outre_mer_l751_1 = dead_value raise EmptyError except EmptyError: temp_regime_outre_mer_l751_1 = False except EmptyError: - raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", + temp_regime_outre_mer_l751_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/allocations_familiales/prologue.catala_fr", start_line=62, start_column=10, end_line=62, end_column=33, law_headings=["Prestations familiales", - "Champs d'applications", - "Prologue"])) - regime_outre_mer_l751_1 = log_variable_definition(["PrestationsFamiliales", - "régime_outre_mer_l751_1"], temp_regime_outre_mer_l751_1) + "Champs d'applications", + "Prologue"])) + regime_outre_mer_l751_1 = temp_regime_outre_mer_l751_1 try: try: - if log_decision_taken(SourcePosition(filename="./securite_sociale_R.catala_fr", - start_line=216, start_column=18, end_line=216, end_column=41, - law_headings=["Article R755-0-2", - "Chapitre 5 : Prestations familiales et prestations assimilées", - "Titre 5 : Départements d'outre-mer", - "Livre 7 : Régimes divers - Dispositions diverses", - "Partie réglementaire - Décrets en Conseil d'Etat", - "Code de la sécurité sociale"]), regime_outre_mer_l751_1): + if regime_outre_mer_l751_1: temp_plafond_l512_3_2 = ((smic_dot_brut_horaire * - decimal_of_string("0.55")) * decimal_of_string("169.")) + decimal_of_string("0.55")) * decimal_of_string("169.")) else: + temp_plafond_l512_3_2 = dead_value raise EmptyError except EmptyError: temp_plafond_l512_3_2 = ((smic_dot_brut_horaire * - decimal_of_string("0.55")) * decimal_of_string("169.")) + decimal_of_string("0.55")) * decimal_of_string("169.")) except EmptyError: - raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", + temp_plafond_l512_3_2 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/allocations_familiales/prologue.catala_fr", start_line=60, start_column=11, end_line=60, end_column=27, law_headings=["Prestations familiales", - "Champs d'applications", - "Prologue"])) - plafond_l512_3_2 = log_variable_definition(["PrestationsFamiliales", - "plafond_l512_3_2"], temp_plafond_l512_3_2) + "Champs d'applications", + "Prologue"])) + plafond_l512_3_2 = temp_plafond_l512_3_2 try: - def temp_conditions_hors_age(param: Enfant): + def temp_conditions_hors_age(param:Enfant): try: try: match_arg = param.obligation_scolaire @@ -905,160 +883,114 @@ def prestations_familiales(prestations_familiales_in: PrestationsFamilialesIn): elif match_arg_2.code == SituationObligationScolaire_Code.Apres: _ = match_arg_2.value temp_conditions_hors_age_3 = False - if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=68, start_column=5, - end_line=71, end_column=57, - law_headings=["Article L512-3", - "Chapitre 2 : Champ d'application", - "Titre 1 : Champ d'application - Généralités", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie législative", - "Code de la sécurité sociale"]), ((temp_conditions_hors_age_3 or - (temp_conditions_hors_age_2 or - temp_conditions_hors_age_1)) and - (param.remuneration_mensuelle <= - plafond_l512_3_2))): + if ((temp_conditions_hors_age_3 or + (temp_conditions_hors_age_2 or + temp_conditions_hors_age_1)) and + (param.remuneration_mensuelle <= + plafond_l512_3_2)): return True else: raise EmptyError except EmptyError: return False except EmptyError: - raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", + raise NoValueProvided(SourcePosition(filename="examples/allocations_familiales/prologue.catala_fr", start_line=59, start_column=10, end_line=59, end_column=29, law_headings=["Prestations familiales", - "Champs d'applications", - "Prologue"])) + "Champs d'applications", + "Prologue"])) except EmptyError: - raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", + temp_conditions_hors_age = dead_value + raise NoValueProvided(SourcePosition(filename="examples/allocations_familiales/prologue.catala_fr", start_line=59, start_column=10, end_line=59, end_column=29, law_headings=["Prestations familiales", - "Champs d'applications", - "Prologue"])) - conditions_hors_age = log_variable_definition(["PrestationsFamiliales", - "conditions_hors_âge"], temp_conditions_hors_age) + "Champs d'applications", + "Prologue"])) + conditions_hors_age = temp_conditions_hors_age try: - def temp_droit_ouvert(param_1: Enfant): + def temp_droit_ouvert(param_1:Enfant): try: try: try: - if log_decision_taken(SourcePosition(filename="./autres_codes.catala_fr", - start_line=24, start_column=5, - end_line=24, end_column=63, - law_headings=["Article L821-3", - "Sous-section 1 : Aides personnelles au logement", - "Section 2 : Règles de non-cumul", - "Chapitre Ier : Principes généraux", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie législative", - "Code de la construction et de l'habitation"]), param_1.beneficie_titre_personnel_aide_personnelle_logement): + if param_1.beneficie_titre_personnel_aide_personnelle_logement: return False else: raise EmptyError except EmptyError: - def temp_droit_ouvert_1(_: Any): - raise EmptyError - - def temp_droit_ouvert_2(_: Any): - return False - - def temp_droit_ouvert_3(_: Any): + try: match_arg_3 = param_1.obligation_scolaire if match_arg_3.code == SituationObligationScolaire_Code.Avant: _ = match_arg_3.value - temp_droit_ouvert_4 = False + temp_droit_ouvert_1 = False elif match_arg_3.code == SituationObligationScolaire_Code.Pendant: _ = match_arg_3.value - temp_droit_ouvert_4 = False + temp_droit_ouvert_1 = False elif match_arg_3.code == SituationObligationScolaire_Code.Apres: _ = match_arg_3.value - temp_droit_ouvert_4 = True - if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=60, start_column=5, - end_line=62, end_column=32, - law_headings=["Article L512-3", - "Chapitre 2 : Champ d'application", - "Titre 1 : Champ d'application - Généralités", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie législative", - "Code de la sécurité sociale"]), (temp_droit_ouvert_4 and - ((param_1.remuneration_mensuelle <= - plafond_l512_3_2) and (param_1.age < - age_l512_3_2)))): + temp_droit_ouvert_1 = True + if (temp_droit_ouvert_1 and + ((param_1.remuneration_mensuelle <= + plafond_l512_3_2) and (param_1.age < + age_l512_3_2))): return True else: raise EmptyError - - def temp_droit_ouvert_5(_: Any): + except EmptyError: match_arg_4 = param_1.obligation_scolaire if match_arg_4.code == SituationObligationScolaire_Code.Avant: _ = match_arg_4.value - temp_droit_ouvert_6 = False + temp_droit_ouvert_2 = False elif match_arg_4.code == SituationObligationScolaire_Code.Pendant: _ = match_arg_4.value - temp_droit_ouvert_6 = True + temp_droit_ouvert_2 = True elif match_arg_4.code == SituationObligationScolaire_Code.Apres: _ = match_arg_4.value - temp_droit_ouvert_6 = False + temp_droit_ouvert_2 = False match_arg_5 = param_1.obligation_scolaire if match_arg_5.code == SituationObligationScolaire_Code.Avant: _ = match_arg_5.value - temp_droit_ouvert_7 = True + temp_droit_ouvert_3 = True elif match_arg_5.code == SituationObligationScolaire_Code.Pendant: _ = match_arg_5.value - temp_droit_ouvert_7 = False + temp_droit_ouvert_3 = False elif match_arg_5.code == SituationObligationScolaire_Code.Apres: _ = match_arg_5.value - temp_droit_ouvert_7 = False - if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=49, start_column=5, - end_line=50, end_column=50, - law_headings=["Article L512-3", - "Chapitre 2 : Champ d'application", - "Titre 1 : Champ d'application - Généralités", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie législative", - "Code de la sécurité sociale"]), (temp_droit_ouvert_7 or - temp_droit_ouvert_6)): + temp_droit_ouvert_3 = False + if (temp_droit_ouvert_3 or + temp_droit_ouvert_2): return True else: raise EmptyError - return handle_default([temp_droit_ouvert_5, - temp_droit_ouvert_3], - temp_droit_ouvert_2, - temp_droit_ouvert_1) except EmptyError: return False except EmptyError: - raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", + raise NoValueProvided(SourcePosition(filename="examples/allocations_familiales/prologue.catala_fr", start_line=58, start_column=10, end_line=58, end_column=22, law_headings=["Prestations familiales", - "Champs d'applications", - "Prologue"])) + "Champs d'applications", + "Prologue"])) except EmptyError: - raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", + temp_droit_ouvert = dead_value + raise NoValueProvided(SourcePosition(filename="examples/allocations_familiales/prologue.catala_fr", start_line=58, start_column=10, end_line=58, end_column=22, law_headings=["Prestations familiales", - "Champs d'applications", - "Prologue"])) - droit_ouvert = log_variable_definition(["PrestationsFamiliales", - "droit_ouvert"], temp_droit_ouvert) - return PrestationsFamilialesOut(droit_ouvert_out=droit_ouvert, - conditions_hors_age_out=conditions_hors_age, - age_l512_3_2_out=age_l512_3_2, - regime_outre_mer_l751_1_out=regime_outre_mer_l751_1) + "Champs d'applications", + "Prologue"])) + droit_ouvert = temp_droit_ouvert + return PrestationsFamilialesOut(droit_ouvert_out = droit_ouvert, + conditions_hors_age_out = conditions_hors_age, + age_l512_3_2_out = age_l512_3_2, + regime_outre_mer_l751_1_out = regime_outre_mer_l751_1) - -def allocations_familiales(allocations_familiales_in: AllocationsFamilialesIn): +def allocations_familiales(allocations_familiales_in:AllocationsFamilialesIn): personne_charge_effective_permanente_est_parent = allocations_familiales_in.personne_charge_effective_permanente_est_parent_in personne_charge_effective_permanente_remplit_titre__i = allocations_familiales_in.personne_charge_effective_permanente_remplit_titre_I_in ressources_menage = allocations_familiales_in.ressources_menage_in @@ -1067,1069 +999,852 @@ def allocations_familiales(allocations_familiales_in: AllocationsFamilialesIn): enfants_a_charge = allocations_familiales_in.enfants_a_charge_in avait_enfant_a_charge_avant_1er_janvier_2012 = allocations_familiales_in.avait_enfant_a_charge_avant_1er_janvier_2012_in try: - def temp_prise_en_compte(param_2: Enfant): + def temp_prise_en_compte(param_2:Enfant): try: - def temp_prise_en_compte_1(_: Any): + def temp_prise_en_compte_1(_:Any): raise EmptyError - - def temp_prise_en_compte_2(_: Any): - return True - - def temp_prise_en_compte_3(_: Any): - match_arg_6 = param_2.prise_en_charge - if match_arg_6.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: - _ = match_arg_6.value - temp_prise_en_compte_4 = False - elif match_arg_6.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: - _ = match_arg_6.value - temp_prise_en_compte_4 = False - elif match_arg_6.code == PriseEnCharge_Code.EffectiveEtPermanente: - _ = match_arg_6.value - temp_prise_en_compte_4 = True - elif match_arg_6.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: - _ = match_arg_6.value - temp_prise_en_compte_4 = False - elif match_arg_6.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: - _ = match_arg_6.value - temp_prise_en_compte_4 = False - if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=184, start_column=5, - end_line=184, end_column=60, - law_headings=["Article L521-2", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie législative", - "Code de la sécurité sociale"]), temp_prise_en_compte_4): - return PriseEnCompte(PriseEnCompte_Code.Complete, - Unit()) - else: - raise EmptyError - - def temp_prise_en_compte_5(_: Any): - match_arg_7 = param_2.prise_en_charge - if match_arg_7.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: - _ = match_arg_7.value - temp_prise_en_compte_6 = False - elif match_arg_7.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: - _ = match_arg_7.value - temp_prise_en_compte_6 = True - elif match_arg_7.code == PriseEnCharge_Code.EffectiveEtPermanente: - _ = match_arg_7.value - temp_prise_en_compte_6 = False - elif match_arg_7.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: - _ = match_arg_7.value - temp_prise_en_compte_6 = False - elif match_arg_7.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: - _ = match_arg_7.value - temp_prise_en_compte_6 = False - if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=204, start_column=5, - end_line=204, end_column=69, - law_headings=["Article L521-2", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie législative", - "Code de la sécurité sociale"]), temp_prise_en_compte_6): - return PriseEnCompte(PriseEnCompte_Code.Complete, - Unit()) - else: - raise EmptyError - - def temp_prise_en_compte_7(_: Any): - match_arg_8 = param_2.prise_en_charge - if match_arg_8.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: - _ = match_arg_8.value - temp_prise_en_compte_8 = True - elif match_arg_8.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: - _ = match_arg_8.value - temp_prise_en_compte_8 = False - elif match_arg_8.code == PriseEnCharge_Code.EffectiveEtPermanente: - _ = match_arg_8.value - temp_prise_en_compte_8 = False - elif match_arg_8.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: - _ = match_arg_8.value - temp_prise_en_compte_8 = False - elif match_arg_8.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: - _ = match_arg_8.value - temp_prise_en_compte_8 = False - if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=214, start_column=5, - end_line=214, end_column=70, - law_headings=["Article L521-2", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie législative", - "Code de la sécurité sociale"]), temp_prise_en_compte_8): - return PriseEnCompte(PriseEnCompte_Code.Partagee, - Unit()) - else: - raise EmptyError - - def temp_prise_en_compte_9(_: Any): + def temp_prise_en_compte_2(_:Any): + return False + def temp_prise_en_compte_3(_:Any): + try: + try: + match_arg_6 = param_2.prise_en_charge + if match_arg_6.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: + _ = match_arg_6.value + temp_prise_en_compte_4 = False + elif match_arg_6.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: + _ = match_arg_6.value + temp_prise_en_compte_4 = False + elif match_arg_6.code == PriseEnCharge_Code.EffectiveEtPermanente: + _ = match_arg_6.value + temp_prise_en_compte_4 = False + elif match_arg_6.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: + _ = match_arg_6.value + temp_prise_en_compte_4 = True + elif match_arg_6.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: + _ = match_arg_6.value + temp_prise_en_compte_4 = False + if temp_prise_en_compte_4: + return PriseEnCompte(PriseEnCompte_Code.Complete, + Unit()) + else: + raise EmptyError + except EmptyError: + match_arg_7 = param_2.prise_en_charge + if match_arg_7.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: + _ = match_arg_7.value + temp_prise_en_compte_5 = False + elif match_arg_7.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: + _ = match_arg_7.value + temp_prise_en_compte_5 = True + elif match_arg_7.code == PriseEnCharge_Code.EffectiveEtPermanente: + _ = match_arg_7.value + temp_prise_en_compte_5 = False + elif match_arg_7.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: + _ = match_arg_7.value + temp_prise_en_compte_5 = False + elif match_arg_7.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: + _ = match_arg_7.value + temp_prise_en_compte_5 = False + if temp_prise_en_compte_5: + return PriseEnCompte(PriseEnCompte_Code.Complete, + Unit()) + else: + raise EmptyError + except EmptyError: + match_arg_8 = param_2.prise_en_charge + if match_arg_8.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: + _ = match_arg_8.value + temp_prise_en_compte_6 = False + elif match_arg_8.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: + _ = match_arg_8.value + temp_prise_en_compte_6 = False + elif match_arg_8.code == PriseEnCharge_Code.EffectiveEtPermanente: + _ = match_arg_8.value + temp_prise_en_compte_6 = True + elif match_arg_8.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: + _ = match_arg_8.value + temp_prise_en_compte_6 = False + elif match_arg_8.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: + _ = match_arg_8.value + temp_prise_en_compte_6 = False + if temp_prise_en_compte_6: + return PriseEnCompte(PriseEnCompte_Code.Complete, + Unit()) + else: + raise EmptyError + def temp_prise_en_compte_7(_:Any): match_arg_9 = param_2.prise_en_charge if match_arg_9.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: _ = match_arg_9.value - temp_prise_en_compte_10 = False + temp_prise_en_compte_8 = False elif match_arg_9.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: _ = match_arg_9.value - temp_prise_en_compte_10 = False + temp_prise_en_compte_8 = False elif match_arg_9.code == PriseEnCharge_Code.EffectiveEtPermanente: _ = match_arg_9.value - temp_prise_en_compte_10 = False + temp_prise_en_compte_8 = False elif match_arg_9.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: _ = match_arg_9.value - temp_prise_en_compte_10 = False + temp_prise_en_compte_8 = False elif match_arg_9.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: _ = match_arg_9.value - temp_prise_en_compte_10 = True - if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=253, start_column=5, - end_line=254, end_column=56, - law_headings=["Article L521-2", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie législative", - "Code de la sécurité sociale"]), temp_prise_en_compte_10): + temp_prise_en_compte_8 = True + if temp_prise_en_compte_8: return PriseEnCompte(PriseEnCompte_Code.Zero, Unit()) else: raise EmptyError - - def temp_prise_en_compte_11(_: Any): + def temp_prise_en_compte_9(_:Any): match_arg_10 = param_2.prise_en_charge if match_arg_10.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: _ = match_arg_10.value - temp_prise_en_compte_12 = False + temp_prise_en_compte_10 = True elif match_arg_10.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: _ = match_arg_10.value - temp_prise_en_compte_12 = False + temp_prise_en_compte_10 = False elif match_arg_10.code == PriseEnCharge_Code.EffectiveEtPermanente: _ = match_arg_10.value - temp_prise_en_compte_12 = False + temp_prise_en_compte_10 = False elif match_arg_10.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: _ = match_arg_10.value - temp_prise_en_compte_12 = True + temp_prise_en_compte_10 = False elif match_arg_10.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: _ = match_arg_10.value - temp_prise_en_compte_12 = False - if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=263, start_column=5, - end_line=264, end_column=48, - law_headings=["Article L521-2", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie législative", - "Code de la sécurité sociale"]), temp_prise_en_compte_12): - return PriseEnCompte(PriseEnCompte_Code.Complete, - Unit()) + temp_prise_en_compte_10 = False + if temp_prise_en_compte_10: + return PriseEnCompte(PriseEnCompte_Code.Partagee, + Unit()) else: raise EmptyError - return handle_default([temp_prise_en_compte_11, - temp_prise_en_compte_9, + return handle_default(SourcePosition(filename="examples/allocations_familiales/prologue.catala_fr", + start_line=98, start_column=11, + end_line=98, end_column=26, + law_headings=["Allocations familiales", + "Champs d'applications", + "Prologue"]), [temp_prise_en_compte_9, temp_prise_en_compte_7, - temp_prise_en_compte_5, temp_prise_en_compte_3], temp_prise_en_compte_2, temp_prise_en_compte_1) except EmptyError: - raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", + raise NoValueProvided(SourcePosition(filename="examples/allocations_familiales/prologue.catala_fr", start_line=98, start_column=11, end_line=98, end_column=26, law_headings=["Allocations familiales", - "Champs d'applications", - "Prologue"])) + "Champs d'applications", + "Prologue"])) except EmptyError: - raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", + temp_prise_en_compte = dead_value + raise NoValueProvided(SourcePosition(filename="examples/allocations_familiales/prologue.catala_fr", start_line=98, start_column=11, end_line=98, end_column=26, law_headings=["Allocations familiales", - "Champs d'applications", - "Prologue"])) - prise_en_compte = log_variable_definition(["AllocationsFamiliales", - "prise_en_compte"], temp_prise_en_compte) + "Champs d'applications", + "Prologue"])) + prise_en_compte = temp_prise_en_compte try: - def temp_versement(param_3: Enfant): + def temp_versement(param_3:Enfant): try: - def temp_versement_1(_: Any): + def temp_versement_1(_:Any): raise EmptyError - - def temp_versement_2(_: Any): - return True - - def temp_versement_3(_: Any): - match_arg_11 = param_3.prise_en_charge - if match_arg_11.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: - _ = match_arg_11.value - temp_versement_4 = False - elif match_arg_11.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: - _ = match_arg_11.value - temp_versement_4 = False - elif match_arg_11.code == PriseEnCharge_Code.EffectiveEtPermanente: - _ = match_arg_11.value - temp_versement_4 = True - elif match_arg_11.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: - _ = match_arg_11.value - temp_versement_4 = False - elif match_arg_11.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: - _ = match_arg_11.value - temp_versement_4 = False - if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=188, start_column=5, - end_line=188, end_column=60, - law_headings=["Article L521-2", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie législative", - "Code de la sécurité sociale"]), temp_versement_4): - return VersementAllocations(VersementAllocations_Code.Normal, - Unit()) - else: - raise EmptyError - - def temp_versement_5(_: Any): - match_arg_12 = param_3.prise_en_charge - if match_arg_12.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: - _ = match_arg_12.value - temp_versement_6 = False - elif match_arg_12.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: - _ = match_arg_12.value - temp_versement_6 = True - elif match_arg_12.code == PriseEnCharge_Code.EffectiveEtPermanente: - _ = match_arg_12.value - temp_versement_6 = False - elif match_arg_12.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: - _ = match_arg_12.value - temp_versement_6 = False - elif match_arg_12.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: - _ = match_arg_12.value - temp_versement_6 = False - if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=208, start_column=5, - end_line=208, end_column=69, - law_headings=["Article L521-2", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie législative", - "Code de la sécurité sociale"]), temp_versement_6): - return VersementAllocations(VersementAllocations_Code.Normal, - Unit()) - else: - raise EmptyError - - def temp_versement_7(_: Any): - match_arg_13 = param_3.prise_en_charge - if match_arg_13.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: - _ = match_arg_13.value - temp_versement_8 = True - elif match_arg_13.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: - _ = match_arg_13.value - temp_versement_8 = False - elif match_arg_13.code == PriseEnCharge_Code.EffectiveEtPermanente: - _ = match_arg_13.value - temp_versement_8 = False - elif match_arg_13.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: - _ = match_arg_13.value - temp_versement_8 = False - elif match_arg_13.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: - _ = match_arg_13.value - temp_versement_8 = False - if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=218, start_column=5, - end_line=218, end_column=70, - law_headings=["Article L521-2", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie législative", - "Code de la sécurité sociale"]), temp_versement_8): - return VersementAllocations(VersementAllocations_Code.Normal, - Unit()) - else: - raise EmptyError - - def temp_versement_9(_: Any): - match_arg_14 = param_3.prise_en_charge - if match_arg_14.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: - _ = match_arg_14.value - temp_versement_10 = False - elif match_arg_14.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: - _ = match_arg_14.value - temp_versement_10 = False - elif match_arg_14.code == PriseEnCharge_Code.EffectiveEtPermanente: - _ = match_arg_14.value - temp_versement_10 = False - elif match_arg_14.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: - _ = match_arg_14.value - temp_versement_10 = False - elif match_arg_14.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: - _ = match_arg_14.value - temp_versement_10 = True - if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=258, start_column=5, - end_line=259, end_column=56, - law_headings=["Article L521-2", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie législative", - "Code de la sécurité sociale"]), temp_versement_10): - return VersementAllocations(VersementAllocations_Code.AllocationVerseeAuxServicesSociaux, - Unit()) - else: - raise EmptyError - - def temp_versement_11(_: Any): + def temp_versement_2(_:Any): + return False + def temp_versement_3(_:Any): + try: + try: + try: + match_arg_11 = param_3.prise_en_charge + if match_arg_11.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: + _ = match_arg_11.value + temp_versement_4 = False + elif match_arg_11.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: + _ = match_arg_11.value + temp_versement_4 = False + elif match_arg_11.code == PriseEnCharge_Code.EffectiveEtPermanente: + _ = match_arg_11.value + temp_versement_4 = False + elif match_arg_11.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: + _ = match_arg_11.value + temp_versement_4 = True + elif match_arg_11.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: + _ = match_arg_11.value + temp_versement_4 = False + if temp_versement_4: + return VersementAllocations(VersementAllocations_Code.Normal, + Unit()) + else: + raise EmptyError + except EmptyError: + match_arg_12 = param_3.prise_en_charge + if match_arg_12.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: + _ = match_arg_12.value + temp_versement_5 = True + elif match_arg_12.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: + _ = match_arg_12.value + temp_versement_5 = False + elif match_arg_12.code == PriseEnCharge_Code.EffectiveEtPermanente: + _ = match_arg_12.value + temp_versement_5 = False + elif match_arg_12.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: + _ = match_arg_12.value + temp_versement_5 = False + elif match_arg_12.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: + _ = match_arg_12.value + temp_versement_5 = False + if temp_versement_5: + return VersementAllocations(VersementAllocations_Code.Normal, + Unit()) + else: + raise EmptyError + except EmptyError: + match_arg_13 = param_3.prise_en_charge + if match_arg_13.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: + _ = match_arg_13.value + temp_versement_6 = False + elif match_arg_13.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: + _ = match_arg_13.value + temp_versement_6 = True + elif match_arg_13.code == PriseEnCharge_Code.EffectiveEtPermanente: + _ = match_arg_13.value + temp_versement_6 = False + elif match_arg_13.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: + _ = match_arg_13.value + temp_versement_6 = False + elif match_arg_13.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: + _ = match_arg_13.value + temp_versement_6 = False + if temp_versement_6: + return VersementAllocations(VersementAllocations_Code.Normal, + Unit()) + else: + raise EmptyError + except EmptyError: + match_arg_14 = param_3.prise_en_charge + if match_arg_14.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: + _ = match_arg_14.value + temp_versement_7 = False + elif match_arg_14.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: + _ = match_arg_14.value + temp_versement_7 = False + elif match_arg_14.code == PriseEnCharge_Code.EffectiveEtPermanente: + _ = match_arg_14.value + temp_versement_7 = True + elif match_arg_14.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: + _ = match_arg_14.value + temp_versement_7 = False + elif match_arg_14.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: + _ = match_arg_14.value + temp_versement_7 = False + if temp_versement_7: + return VersementAllocations(VersementAllocations_Code.Normal, + Unit()) + else: + raise EmptyError + def temp_versement_8(_:Any): match_arg_15 = param_3.prise_en_charge if match_arg_15.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: _ = match_arg_15.value - temp_versement_12 = False + temp_versement_9 = False elif match_arg_15.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: _ = match_arg_15.value - temp_versement_12 = False + temp_versement_9 = False elif match_arg_15.code == PriseEnCharge_Code.EffectiveEtPermanente: _ = match_arg_15.value - temp_versement_12 = False + temp_versement_9 = False elif match_arg_15.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: _ = match_arg_15.value - temp_versement_12 = True + temp_versement_9 = False elif match_arg_15.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: _ = match_arg_15.value - temp_versement_12 = False - if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=269, start_column=5, - end_line=270, end_column=48, - law_headings=["Article L521-2", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie législative", - "Code de la sécurité sociale"]), temp_versement_12): - return VersementAllocations(VersementAllocations_Code.Normal, - Unit()) + temp_versement_9 = True + if temp_versement_9: + return VersementAllocations(VersementAllocations_Code.AllocationVerseeAuxServicesSociaux, + Unit()) else: raise EmptyError - return handle_default([temp_versement_11, temp_versement_9, - temp_versement_7, temp_versement_5, + return handle_default(SourcePosition(filename="examples/allocations_familiales/prologue.catala_fr", + start_line=99, start_column=11, + end_line=99, end_column=20, + law_headings=["Allocations familiales", + "Champs d'applications", + "Prologue"]), [temp_versement_8, temp_versement_3], temp_versement_2, temp_versement_1) except EmptyError: - raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", + raise NoValueProvided(SourcePosition(filename="examples/allocations_familiales/prologue.catala_fr", start_line=99, start_column=11, end_line=99, end_column=20, law_headings=["Allocations familiales", - "Champs d'applications", - "Prologue"])) + "Champs d'applications", + "Prologue"])) except EmptyError: - raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", + temp_versement = dead_value + raise NoValueProvided(SourcePosition(filename="examples/allocations_familiales/prologue.catala_fr", start_line=99, start_column=11, end_line=99, end_column=20, law_headings=["Allocations familiales", - "Champs d'applications", - "Prologue"])) - versement = log_variable_definition(["AllocationsFamiliales", - "versement"], temp_versement) + "Champs d'applications", + "Prologue"])) + versement = temp_versement try: temp_nombre_enfants_l521_1 = integer_of_string("3") except EmptyError: - raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", + temp_nombre_enfants_l521_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/allocations_familiales/prologue.catala_fr", start_line=146, start_column=11, end_line=146, end_column=32, law_headings=["Allocations familiales", - "Champs d'applications", - "Prologue"])) - nombre_enfants_l521_1 = log_variable_definition(["AllocationsFamiliales", - "nombre_enfants_l521_1"], temp_nombre_enfants_l521_1) + "Champs d'applications", + "Prologue"])) + nombre_enfants_l521_1 = temp_nombre_enfants_l521_1 try: temp_nombre_enfants_alinea_2_l521_3 = integer_of_string("3") except EmptyError: - raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", + temp_nombre_enfants_alinea_2_l521_3 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/allocations_familiales/prologue.catala_fr", start_line=148, start_column=11, end_line=148, end_column=41, law_headings=["Allocations familiales", - "Champs d'applications", - "Prologue"])) - nombre_enfants_alinea_2_l521_3 = log_variable_definition(["AllocationsFamiliales", - "nombre_enfants_alinéa_2_l521_3"], - temp_nombre_enfants_alinea_2_l521_3) - result_1 = log_end_call(["AllocationsFamiliales", "version_avril_2008", - "AllocationFamilialesAvril2008"], - log_begin_call(["AllocationsFamiliales", "version_avril_2008", - "AllocationFamilialesAvril2008"], allocation_familiales_avril2008, - AllocationFamilialesAvril2008In())) + "Champs d'applications", + "Prologue"])) + nombre_enfants_alinea_2_l521_3 = temp_nombre_enfants_alinea_2_l521_3 + result_1 = allocation_familiales_avril2008(AllocationFamilialesAvril2008In()) version_avril_2008_dot_age_minimum_alinea_1_l521_3 = result_1.age_minimum_alinea_1_l521_3_out try: - temp_bmaf_dot_date_courante = log_variable_definition(["AllocationsFamiliales", - "bmaf.date_courante"], date_courante_3) + temp_bmaf_dot_date_courante = date_courante_3 except EmptyError: - raise NoValueProvided(SourcePosition(filename="./../base_mensuelle_allocations_familiales/bmaf.catala_fr", + temp_bmaf_dot_date_courante = dead_value + raise NoValueProvided(SourcePosition(filename="examples/allocations_familiales/../base_mensuelle_allocations_familiales/bmaf.catala_fr", start_line=5, start_column=10, end_line=5, end_column=23, law_headings=["Montant de la base mensuelle des allocations familiales"])) bmaf_dot_date_courante = temp_bmaf_dot_date_courante - result_2 = log_end_call(["AllocationsFamiliales", "bmaf", - "BaseMensuelleAllocationsFamiliales"], - log_begin_call(["AllocationsFamiliales", "bmaf", - "BaseMensuelleAllocationsFamiliales"], - base_mensuelle_allocations_familiales, - BaseMensuelleAllocationsFamilialesIn(date_courante_in=bmaf_dot_date_courante))) + result_2 = base_mensuelle_allocations_familiales(BaseMensuelleAllocationsFamilialesIn(date_courante_in = bmaf_dot_date_courante)) bmaf_dot_montant = result_2.montant_out try: - temp_prestations_familiales_dot_date_courante = log_variable_definition(["AllocationsFamiliales", - "prestations_familiales.date_courante"], date_courante_3) + temp_prestations_familiales_dot_date_courante = date_courante_3 except EmptyError: - raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", + temp_prestations_familiales_dot_date_courante = dead_value + raise NoValueProvided(SourcePosition(filename="examples/allocations_familiales/prologue.catala_fr", start_line=63, start_column=10, end_line=63, end_column=23, law_headings=["Prestations familiales", - "Champs d'applications", - "Prologue"])) + "Champs d'applications", + "Prologue"])) prestations_familiales_dot_date_courante = temp_prestations_familiales_dot_date_courante try: - temp_prestations_familiales_dot_prestation_courante = log_variable_definition(["AllocationsFamiliales", - "prestations_familiales.prestation_courante"], - ElementPrestationsFamiliales(ElementPrestationsFamiliales_Code.AllocationsFamiliales, - Unit())) + temp_prestations_familiales_dot_prestation_courante = ElementPrestationsFamiliales(ElementPrestationsFamiliales_Code.AllocationsFamiliales, + Unit()) except EmptyError: - raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", + temp_prestations_familiales_dot_prestation_courante = dead_value + raise NoValueProvided(SourcePosition(filename="examples/allocations_familiales/prologue.catala_fr", start_line=64, start_column=10, end_line=64, end_column=29, law_headings=["Prestations familiales", - "Champs d'applications", - "Prologue"])) + "Champs d'applications", + "Prologue"])) prestations_familiales_dot_prestation_courante = temp_prestations_familiales_dot_prestation_courante try: - temp_prestations_familiales_dot_residence = log_variable_definition(["AllocationsFamiliales", - "prestations_familiales.résidence"], residence_2) + temp_prestations_familiales_dot_residence = residence_2 except EmptyError: - raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", + temp_prestations_familiales_dot_residence = dead_value + raise NoValueProvided(SourcePosition(filename="examples/allocations_familiales/prologue.catala_fr", start_line=65, start_column=10, end_line=65, end_column=19, law_headings=["Prestations familiales", - "Champs d'applications", - "Prologue"])) + "Champs d'applications", + "Prologue"])) prestations_familiales_dot_residence = temp_prestations_familiales_dot_residence - result_3 = log_end_call(["AllocationsFamiliales", - "prestations_familiales", "PrestationsFamiliales"], - log_begin_call(["AllocationsFamiliales", "prestations_familiales", - "PrestationsFamiliales"], prestations_familiales, - PrestationsFamilialesIn(date_courante_in=prestations_familiales_dot_date_courante, - prestation_courante_in=prestations_familiales_dot_prestation_courante, - residence_in=prestations_familiales_dot_residence))) + result_3 = prestations_familiales(PrestationsFamilialesIn(date_courante_in = prestations_familiales_dot_date_courante, + prestation_courante_in = prestations_familiales_dot_prestation_courante, + residence_in = prestations_familiales_dot_residence)) prestations_familiales_dot_droit_ouvert = result_3.droit_ouvert_out prestations_familiales_dot_conditions_hors_age = result_3.conditions_hors_age_out prestations_familiales_dot_age_l512_3_2 = result_3.age_l512_3_2_out prestations_familiales_dot_regime_outre_mer_l751_1 = result_3.regime_outre_mer_l751_1_out try: - temp_enfant_le_plus_age_dot_enfants = log_variable_definition(["AllocationsFamiliales", - "enfant_le_plus_âgé.enfants"], enfants_a_charge) + temp_enfant_le_plus_age_dot_enfants = enfants_a_charge except EmptyError: - raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", + temp_enfant_le_plus_age_dot_enfants = dead_value + raise NoValueProvided(SourcePosition(filename="examples/allocations_familiales/prologue.catala_fr", start_line=80, start_column=10, end_line=80, end_column=17, law_headings=["Allocations familiales", - "Champs d'applications", - "Prologue"])) + "Champs d'applications", + "Prologue"])) enfant_le_plus_age_dot_enfants = temp_enfant_le_plus_age_dot_enfants - result_4 = log_end_call(["AllocationsFamiliales", "enfant_le_plus_âgé", - "EnfantLePlusÂgé"], log_begin_call(["AllocationsFamiliales", - "enfant_le_plus_âgé", "EnfantLePlusÂgé"], enfant_le_plus_age, - EnfantLePlusAgeIn(enfants_in=enfant_le_plus_age_dot_enfants))) + result_4 = enfant_le_plus_age(EnfantLePlusAgeIn(enfants_in = enfant_le_plus_age_dot_enfants)) enfant_le_plus_age_dot_le_plus_age = result_4.le_plus_age_out try: - def temp_age_minimum_alinea_1_l521_3_1(param_4: Enfant): + def temp_age_minimum_alinea_1_l521_3_1(param_4:Enfant): try: try: - if log_decision_taken(SourcePosition(filename="./securite_sociale_R.catala_fr", - start_line=83, start_column=19, - end_line=83, end_column=69, - law_headings=["Article R521-1", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets en Conseil d'Etat", - "Code de la sécurité sociale"]), ((param_4.date_de_naissance + - duration_of_numbers(11, 0, 0)) <= - date_of_numbers(2008, 4, 30))): + if ((param_4.date_de_naissance + + duration_of_numbers(11,0,0)) <= + date_of_numbers(2008,4,30)): return version_avril_2008_dot_age_minimum_alinea_1_l521_3 else: raise EmptyError except EmptyError: return integer_of_string("14") except EmptyError: - raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", + raise NoValueProvided(SourcePosition(filename="examples/allocations_familiales/prologue.catala_fr", start_line=147, start_column=11, end_line=147, end_column=38, law_headings=["Allocations familiales", - "Champs d'applications", - "Prologue"])) + "Champs d'applications", + "Prologue"])) except EmptyError: - raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", + temp_age_minimum_alinea_1_l521_3_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/allocations_familiales/prologue.catala_fr", start_line=147, start_column=11, end_line=147, end_column=38, law_headings=["Allocations familiales", - "Champs d'applications", - "Prologue"])) - age_minimum_alinea_1_l521_3_1 = log_variable_definition(["AllocationsFamiliales", - "âge_minimum_alinéa_1_l521_3"], temp_age_minimum_alinea_1_l521_3_1) + "Champs d'applications", + "Prologue"])) + age_minimum_alinea_1_l521_3_1 = temp_age_minimum_alinea_1_l521_3_1 try: - def temp_enfants_a_charge_droit_ouvert_prestation_familiale(enfant: Any): - return log_end_call(["PrestationsFamiliales", "droit_ouvert"], - log_variable_definition(["PrestationsFamiliales", - "droit_ouvert", "output"], - log_begin_call(["PrestationsFamiliales", "droit_ouvert"], - prestations_familiales_dot_droit_ouvert, - log_variable_definition(["PrestationsFamiliales", - "droit_ouvert", "input"], enfant)))) + def temp_enfants_a_charge_droit_ouvert_prestation_familiale(enfant:Any): + return prestations_familiales_dot_droit_ouvert(enfant) temp_enfants_a_charge_droit_ouvert_prestation_familiale_1 = list_filter(temp_enfants_a_charge_droit_ouvert_prestation_familiale, - enfants_a_charge) + enfants_a_charge) except EmptyError: - raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", + temp_enfants_a_charge_droit_ouvert_prestation_familiale_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/allocations_familiales/prologue.catala_fr", start_line=96, start_column=11, end_line=96, end_column=61, law_headings=["Allocations familiales", - "Champs d'applications", - "Prologue"])) - enfants_a_charge_droit_ouvert_prestation_familiale = log_variable_definition(["AllocationsFamiliales", - "enfants_à_charge_droit_ouvert_prestation_familiale"], - temp_enfants_a_charge_droit_ouvert_prestation_familiale_1) + "Champs d'applications", + "Prologue"])) + enfants_a_charge_droit_ouvert_prestation_familiale = temp_enfants_a_charge_droit_ouvert_prestation_familiale_1 try: - def temp_est_enfant_le_plus_age(param_5: Enfant): + def temp_est_enfant_le_plus_age(param_5:Enfant): try: return (enfant_le_plus_age_dot_le_plus_age == param_5) except EmptyError: - raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", + raise NoValueProvided(SourcePosition(filename="examples/allocations_familiales/prologue.catala_fr", start_line=149, start_column=11, end_line=149, end_column=33, law_headings=["Allocations familiales", - "Champs d'applications", - "Prologue"])) + "Champs d'applications", + "Prologue"])) except EmptyError: - raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", + temp_est_enfant_le_plus_age = dead_value + raise NoValueProvided(SourcePosition(filename="examples/allocations_familiales/prologue.catala_fr", start_line=149, start_column=11, end_line=149, end_column=33, law_headings=["Allocations familiales", - "Champs d'applications", - "Prologue"])) - est_enfant_le_plus_age = log_variable_definition(["AllocationsFamiliales", - "est_enfant_le_plus_âgé"], temp_est_enfant_le_plus_age) + "Champs d'applications", + "Prologue"])) + est_enfant_le_plus_age = temp_est_enfant_le_plus_age try: - def temp_plafond__i_i_d521_3(_: Any): - return (money_of_cents_string("7830000") + - (money_of_cents_string("559500") * - decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale)))) - - def temp_plafond__i_i_d521_3_1(_: Any): - return True - - def temp_plafond__i_i_d521_3_2(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=30, start_column=5, end_line=30, end_column=69, - law_headings=["Circulaire interministérielle N° DSS/SD2B/2017/352 du 22 décembre 2017 relative à la revalorisation au 1er janvier 2018 des plafonds de ressources d’attribution de certaines prestations familiales servies en métropole, en Guadeloupe, en Guyane, en Martinique, à la Réunion, à Saint-Barthélemy, à Saint-Martin et à Mayotte", - "Montant des plafonds de ressources"]), ((date_courante_3 >= - date_of_numbers(2018, 1, 1)) and (date_courante_3 <= - date_of_numbers(2018, 12, 31)))): - return (money_of_cents_string("7877000") + - (money_of_cents_string("562800") * - decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale)))) - else: + try: + def temp_plafond__i_i_d521_3(_:Any): raise EmptyError - - def temp_plafond__i_i_d521_3_3(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=63, start_column=5, end_line=63, end_column=69, - law_headings=["Instruction interministérielle n° DSS/SD2B/2018/279 du 17 décembre 2018 relative à la revalorisation au 1er janvier 2019 des plafonds de ressources d’attribution de certaines prestations familiales servies en métropole, en Guadeloupe, en Guyane, en Martinique, à la Réunion, à Saint-Barthélemy, à Saint-Martin et à Mayotte", - "Montant des plafonds de ressources"]), ((date_courante_3 >= - date_of_numbers(2019, 1, 1)) and (date_courante_3 <= - date_of_numbers(2019, 12, 31)))): - return (money_of_cents_string("7955800") + - (money_of_cents_string("568400") * - decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale)))) - else: - raise EmptyError - - def temp_plafond__i_i_d521_3_4(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=96, start_column=5, end_line=96, end_column=69, - law_headings=["Instruction interministerielle no DSS/SD2B/2019/261 du 18 décembre 2019 relative à la revalorisation au 1er janvier 2020 des plafonds de ressources d’attribution de certaines prestations familiales servies en métropole, en Guadeloupe, en Guyane, en Martinique, à La Réunion, à Saint-Barthélemy, à Saint-Martin et à Mayotte", - "Montant des plafonds de ressources"]), ((date_courante_3 >= - date_of_numbers(2020, 1, 1)) and (date_courante_3 <= - date_of_numbers(2020, 12, 31)))): - return (money_of_cents_string("8083100") + - (money_of_cents_string("577500") * - decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale)))) - else: - raise EmptyError - - def temp_plafond__i_i_d521_3_5(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=132, start_column=5, end_line=132, end_column=69, - law_headings=["Article 1", - "Arrêté du 14 décembre 2020 relatif au montant des plafonds de ressources de certaines prestations familiales et aux tranches du barème applicable au recouvrement des indus et à la saisie des prestations", - "Montant des plafonds de ressources"]), ((date_courante_3 >= - date_of_numbers(2021, 1, 1)) and (date_courante_3 <= - date_of_numbers(2021, 12, 31)))): - return (money_of_cents_string("8155800") + + def temp_plafond__i_i_d521_3_1(_:Any): + return False + def temp_plafond__i_i_d521_3_2(_:Any): + if ((date_courante_3 >= date_of_numbers(2021,1,1)) and + (date_courante_3 <= + date_of_numbers(2021,12,31))): + return (money_of_cents_string("8155800") + (money_of_cents_string("582700") * - decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale)))) - else: - raise EmptyError - temp_plafond__i_i_d521_3_6 = handle_default([temp_plafond__i_i_d521_3_5, - temp_plafond__i_i_d521_3_4, - temp_plafond__i_i_d521_3_3, - temp_plafond__i_i_d521_3_2], - temp_plafond__i_i_d521_3_1, - temp_plafond__i_i_d521_3) + decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale)))) + else: + raise EmptyError + def temp_plafond__i_i_d521_3_3(_:Any): + if ((date_courante_3 >= date_of_numbers(2020,1,1)) and + (date_courante_3 <= + date_of_numbers(2020,12,31))): + return (money_of_cents_string("8083100") + + (money_of_cents_string("577500") * + decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale)))) + else: + raise EmptyError + def temp_plafond__i_i_d521_3_4(_:Any): + if ((date_courante_3 >= date_of_numbers(2019,1,1)) and + (date_courante_3 <= + date_of_numbers(2019,12,31))): + return (money_of_cents_string("7955800") + + (money_of_cents_string("568400") * + decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale)))) + else: + raise EmptyError + def temp_plafond__i_i_d521_3_5(_:Any): + if ((date_courante_3 >= date_of_numbers(2018,1,1)) and + (date_courante_3 <= + date_of_numbers(2018,12,31))): + return (money_of_cents_string("7877000") + + (money_of_cents_string("562800") * + decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale)))) + else: + raise EmptyError + temp_plafond__i_i_d521_3_6 = handle_default(SourcePosition(filename="examples/allocations_familiales/prologue.catala_fr", + start_line=151, + start_column=11, + end_line=151, end_column=28, + law_headings=["Allocations familiales", + "Champs d'applications", + "Prologue"]), [temp_plafond__i_i_d521_3_5, + temp_plafond__i_i_d521_3_4, + temp_plafond__i_i_d521_3_3, + temp_plafond__i_i_d521_3_2], + temp_plafond__i_i_d521_3_1, + temp_plafond__i_i_d521_3) + except EmptyError: + temp_plafond__i_i_d521_3_6 = (money_of_cents_string("7830000") + + (money_of_cents_string("559500") * + decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale)))) except EmptyError: - raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", + temp_plafond__i_i_d521_3_6 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/allocations_familiales/prologue.catala_fr", start_line=151, start_column=11, end_line=151, end_column=28, law_headings=["Allocations familiales", - "Champs d'applications", - "Prologue"])) - plafond__i_i_d521_3 = log_variable_definition(["AllocationsFamiliales", - "plafond_II_d521_3"], temp_plafond__i_i_d521_3_6) + "Champs d'applications", + "Prologue"])) + plafond__i_i_d521_3 = temp_plafond__i_i_d521_3_6 try: - def temp_plafond__i_d521_3(_: Any): - return (money_of_cents_string("5595000") + - (money_of_cents_string("559500") * - decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale)))) - - def temp_plafond__i_d521_3_1(_: Any): - return True - - def temp_plafond__i_d521_3_2(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=23, start_column=5, end_line=23, end_column=69, - law_headings=["Circulaire interministérielle N° DSS/SD2B/2017/352 du 22 décembre 2017 relative à la revalorisation au 1er janvier 2018 des plafonds de ressources d’attribution de certaines prestations familiales servies en métropole, en Guadeloupe, en Guyane, en Martinique, à la Réunion, à Saint-Barthélemy, à Saint-Martin et à Mayotte", - "Montant des plafonds de ressources"]), ((date_courante_3 >= - date_of_numbers(2018, 1, 1)) and (date_courante_3 <= - date_of_numbers(2018, 12, 31)))): - return (money_of_cents_string("5628600") + - (money_of_cents_string("562800") * - decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale)))) - else: + try: + def temp_plafond__i_d521_3(_:Any): raise EmptyError - - def temp_plafond__i_d521_3_3(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=56, start_column=5, end_line=56, end_column=69, - law_headings=["Instruction interministérielle n° DSS/SD2B/2018/279 du 17 décembre 2018 relative à la revalorisation au 1er janvier 2019 des plafonds de ressources d’attribution de certaines prestations familiales servies en métropole, en Guadeloupe, en Guyane, en Martinique, à la Réunion, à Saint-Barthélemy, à Saint-Martin et à Mayotte", - "Montant des plafonds de ressources"]), ((date_courante_3 >= - date_of_numbers(2019, 1, 1)) and (date_courante_3 <= - date_of_numbers(2019, 12, 31)))): - return (money_of_cents_string("5684900") + - (money_of_cents_string("568400") * - decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale)))) - else: - raise EmptyError - - def temp_plafond__i_d521_3_4(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=89, start_column=5, end_line=89, end_column=69, - law_headings=["Instruction interministerielle no DSS/SD2B/2019/261 du 18 décembre 2019 relative à la revalorisation au 1er janvier 2020 des plafonds de ressources d’attribution de certaines prestations familiales servies en métropole, en Guadeloupe, en Guyane, en Martinique, à La Réunion, à Saint-Barthélemy, à Saint-Martin et à Mayotte", - "Montant des plafonds de ressources"]), ((date_courante_3 >= - date_of_numbers(2020, 1, 1)) and (date_courante_3 <= - date_of_numbers(2020, 12, 31)))): - return (money_of_cents_string("5775900") + - (money_of_cents_string("577500") * - decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale)))) - else: - raise EmptyError - - def temp_plafond__i_d521_3_5(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=116, start_column=5, end_line=116, end_column=69, - law_headings=["Article 1", - "Arrêté du 14 décembre 2020 relatif au montant des plafonds de ressources de certaines prestations familiales et aux tranches du barème applicable au recouvrement des indus et à la saisie des prestations", - "Montant des plafonds de ressources"]), ((date_courante_3 >= - date_of_numbers(2021, 1, 1)) and (date_courante_3 <= - date_of_numbers(2021, 12, 31)))): - return (money_of_cents_string("5827900") + + def temp_plafond__i_d521_3_1(_:Any): + return False + def temp_plafond__i_d521_3_2(_:Any): + if ((date_courante_3 >= date_of_numbers(2021,1,1)) and + (date_courante_3 <= + date_of_numbers(2021,12,31))): + return (money_of_cents_string("5827900") + (money_of_cents_string("582700") * - decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale)))) - else: - raise EmptyError - temp_plafond__i_d521_3_6 = handle_default([temp_plafond__i_d521_3_5, - temp_plafond__i_d521_3_4, - temp_plafond__i_d521_3_3, - temp_plafond__i_d521_3_2], - temp_plafond__i_d521_3_1, - temp_plafond__i_d521_3) + decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale)))) + else: + raise EmptyError + def temp_plafond__i_d521_3_3(_:Any): + if ((date_courante_3 >= date_of_numbers(2020,1,1)) and + (date_courante_3 <= + date_of_numbers(2020,12,31))): + return (money_of_cents_string("5775900") + + (money_of_cents_string("577500") * + decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale)))) + else: + raise EmptyError + def temp_plafond__i_d521_3_4(_:Any): + if ((date_courante_3 >= date_of_numbers(2019,1,1)) and + (date_courante_3 <= + date_of_numbers(2019,12,31))): + return (money_of_cents_string("5684900") + + (money_of_cents_string("568400") * + decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale)))) + else: + raise EmptyError + def temp_plafond__i_d521_3_5(_:Any): + if ((date_courante_3 >= date_of_numbers(2018,1,1)) and + (date_courante_3 <= + date_of_numbers(2018,12,31))): + return (money_of_cents_string("5628600") + + (money_of_cents_string("562800") * + decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale)))) + else: + raise EmptyError + temp_plafond__i_d521_3_6 = handle_default(SourcePosition(filename="examples/allocations_familiales/prologue.catala_fr", + start_line=150, + start_column=11, + end_line=150, end_column=27, + law_headings=["Allocations familiales", + "Champs d'applications", + "Prologue"]), [temp_plafond__i_d521_3_5, + temp_plafond__i_d521_3_4, + temp_plafond__i_d521_3_3, + temp_plafond__i_d521_3_2], + temp_plafond__i_d521_3_1, + temp_plafond__i_d521_3) + except EmptyError: + temp_plafond__i_d521_3_6 = (money_of_cents_string("5595000") + + (money_of_cents_string("559500") * + decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale)))) except EmptyError: - raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", + temp_plafond__i_d521_3_6 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/allocations_familiales/prologue.catala_fr", start_line=150, start_column=11, end_line=150, end_column=27, law_headings=["Allocations familiales", - "Champs d'applications", - "Prologue"])) - plafond__i_d521_3 = log_variable_definition(["AllocationsFamiliales", - "plafond_I_d521_3"], temp_plafond__i_d521_3_6) + "Champs d'applications", + "Prologue"])) + plafond__i_d521_3 = temp_plafond__i_d521_3_6 try: try: try: - if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=426, start_column=5, - end_line=427, end_column=71, - law_headings=["Article L755-12", - "Chapitre 5 : Prestations familiales et prestations assimilées", - "Titre 5 : Dispositions particulières à la Guadeloupe, à la Guyane, à la Martinique, à La Réunion, à Saint-Barthélemy et à Saint-Martin", - "Livre 7 : Régimes divers - Dispositions diverses", - "Partie législative", - "Code de la sécurité sociale"]), (prestations_familiales_dot_regime_outre_mer_l751_1 and - (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) == - integer_of_string("1")))): + if (prestations_familiales_dot_regime_outre_mer_l751_1 and + (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) == + integer_of_string("1"))): temp_droit_ouvert_complement = False else: + temp_droit_ouvert_complement = dead_value raise EmptyError except EmptyError: temp_droit_ouvert_complement = True except EmptyError: temp_droit_ouvert_complement = False except EmptyError: - raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", + temp_droit_ouvert_complement = dead_value + raise NoValueProvided(SourcePosition(filename="examples/allocations_familiales/prologue.catala_fr", start_line=133, start_column=11, end_line=133, end_column=34, law_headings=["Allocations familiales", - "Champs d'applications", - "Prologue"])) - droit_ouvert_complement = log_variable_definition(["AllocationsFamiliales", - "droit_ouvert_complément"], temp_droit_ouvert_complement) + "Champs d'applications", + "Prologue"])) + droit_ouvert_complement = temp_droit_ouvert_complement try: - def temp_droit_ouvert_forfaitaire(param_6: Enfant): + def temp_droit_ouvert_forfaitaire(param_6:Enfant): try: try: try: - if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=420, start_column=6, - end_line=421, end_column=72, - law_headings=["Article L755-12", - "Chapitre 5 : Prestations familiales et prestations assimilées", - "Titre 5 : Dispositions particulières à la Guadeloupe, à la Guyane, à la Martinique, à La Réunion, à Saint-Barthélemy et à Saint-Martin", - "Livre 7 : Régimes divers - Dispositions diverses", - "Partie législative", - "Code de la sécurité sociale"]), (prestations_familiales_dot_regime_outre_mer_l751_1 and - (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) == - integer_of_string("1")))): + if (prestations_familiales_dot_regime_outre_mer_l751_1 and + (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) == + integer_of_string("1"))): return False else: raise EmptyError except EmptyError: - if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=119, start_column=5, - end_line=125, end_column=59, - law_headings=["Article L521-1", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie législative", - "Code de la sécurité sociale"]), ((list_length(enfants_a_charge) >= - nombre_enfants_alinea_2_l521_3) and - ((param_6.age == - prestations_familiales_dot_age_l512_3_2) and - (param_6.a_deja_ouvert_droit_aux_allocations_familiales and - log_end_call(["PrestationsFamiliales", - "conditions_hors_âge"], - log_variable_definition(["PrestationsFamiliales", - "conditions_hors_âge", "output"], - log_begin_call(["PrestationsFamiliales", - "conditions_hors_âge"], - prestations_familiales_dot_conditions_hors_age, - log_variable_definition(["PrestationsFamiliales", - "conditions_hors_âge", "input"], - param_6)))))))): + if ((list_length(enfants_a_charge) >= + nombre_enfants_alinea_2_l521_3) and + ((param_6.age == + prestations_familiales_dot_age_l512_3_2) and + (param_6.a_deja_ouvert_droit_aux_allocations_familiales and + prestations_familiales_dot_conditions_hors_age( + param_6)))): return True else: raise EmptyError except EmptyError: return False except EmptyError: - raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", + raise NoValueProvided(SourcePosition(filename="examples/allocations_familiales/prologue.catala_fr", start_line=121, start_column=11, end_line=121, end_column=35, law_headings=["Allocations familiales", - "Champs d'applications", - "Prologue"])) + "Champs d'applications", + "Prologue"])) except EmptyError: - raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", + temp_droit_ouvert_forfaitaire = dead_value + raise NoValueProvided(SourcePosition(filename="examples/allocations_familiales/prologue.catala_fr", start_line=121, start_column=11, end_line=121, end_column=35, law_headings=["Allocations familiales", - "Champs d'applications", - "Prologue"])) - droit_ouvert_forfaitaire = log_variable_definition(["AllocationsFamiliales", - "droit_ouvert_forfaitaire"], temp_droit_ouvert_forfaitaire) + "Champs d'applications", + "Prologue"])) + droit_ouvert_forfaitaire = temp_droit_ouvert_forfaitaire try: if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) > - integer_of_string("3")): + integer_of_string("3")): temp_montant_initial_base_quatrieme_enfant_et_plus_mayotte = ((bmaf_dot_montant * - decimal_of_string("0.0463")) * - decimal_of_integer((list_length(enfants_a_charge_droit_ouvert_prestation_familiale) - - integer_of_string("3")))) + decimal_of_string("0.0463")) * + decimal_of_integer((list_length(enfants_a_charge_droit_ouvert_prestation_familiale) - + integer_of_string("3")))) else: - temp_montant_initial_base_quatrieme_enfant_et_plus_mayotte = money_of_cents_string( - "0") + temp_montant_initial_base_quatrieme_enfant_et_plus_mayotte = money_of_cents_string("0") except EmptyError: - raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", + temp_montant_initial_base_quatrieme_enfant_et_plus_mayotte = dead_value + raise NoValueProvided(SourcePosition(filename="examples/allocations_familiales/prologue.catala_fr", start_line=118, start_column=11, end_line=118, end_column=64, law_headings=["Allocations familiales", - "Champs d'applications", - "Prologue"])) - montant_initial_base_quatrieme_enfant_et_plus_mayotte = log_variable_definition(["AllocationsFamiliales", - "montant_initial_base_quatrième_enfant_et_plus_mayotte"], - temp_montant_initial_base_quatrieme_enfant_et_plus_mayotte) + "Champs d'applications", + "Prologue"])) + montant_initial_base_quatrieme_enfant_et_plus_mayotte = temp_montant_initial_base_quatrieme_enfant_et_plus_mayotte try: - def temp_montant_initial_base_troisieme_enfant_mayotte(_: Any): + try: + def temp_montant_initial_base_troisieme_enfant_mayotte(_:Any): + raise EmptyError + def temp_montant_initial_base_troisieme_enfant_mayotte_1(_:Any): + return False + def temp_montant_initial_base_troisieme_enfant_mayotte_2(_:Any): + if ((residence_2 == Collectivite(Collectivite_Code.Mayotte, + Unit())) and ((date_courante_3 >= + date_of_numbers(2020,1,1)) and (date_courante_3 <= + date_of_numbers(2020,12,31)))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) > + integer_of_string("2")): + return (bmaf_dot_montant * + decimal_of_string("0.143")) + else: + return money_of_cents_string("0") + else: + raise EmptyError + def temp_montant_initial_base_troisieme_enfant_mayotte_3(_:Any): + if ((residence_2 == Collectivite(Collectivite_Code.Mayotte, + Unit())) and ((date_courante_3 >= + date_of_numbers(2019,1,1)) and (date_courante_3 <= + date_of_numbers(2019,12,31)))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) > + integer_of_string("2")): + return (bmaf_dot_montant * + decimal_of_string("0.1259")) + else: + return money_of_cents_string("0") + else: + raise EmptyError + def temp_montant_initial_base_troisieme_enfant_mayotte_4(_:Any): + if ((residence_2 == Collectivite(Collectivite_Code.Mayotte, + Unit())) and ((date_courante_3 >= + date_of_numbers(2018,1,1)) and (date_courante_3 <= + date_of_numbers(2018,12,31)))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) > + integer_of_string("2")): + return (bmaf_dot_montant * + decimal_of_string("0.1089")) + else: + return money_of_cents_string("0") + else: + raise EmptyError + def temp_montant_initial_base_troisieme_enfant_mayotte_5(_:Any): + if ((residence_2 == Collectivite(Collectivite_Code.Mayotte, + Unit())) and ((date_courante_3 >= + date_of_numbers(2017,1,1)) and (date_courante_3 <= + date_of_numbers(2017,12,31)))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) > + integer_of_string("2")): + return (bmaf_dot_montant * + decimal_of_string("0.0918")) + else: + return money_of_cents_string("0") + else: + raise EmptyError + def temp_montant_initial_base_troisieme_enfant_mayotte_6(_:Any): + if ((residence_2 == Collectivite(Collectivite_Code.Mayotte, + Unit())) and ((date_courante_3 >= + date_of_numbers(2016,1,1)) and (date_courante_3 <= + date_of_numbers(2016,12,31)))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) > + integer_of_string("2")): + return (bmaf_dot_montant * + decimal_of_string("0.0842")) + else: + return money_of_cents_string("0") + else: + raise EmptyError + def temp_montant_initial_base_troisieme_enfant_mayotte_7(_:Any): + if ((residence_2 == Collectivite(Collectivite_Code.Mayotte, + Unit())) and ((date_courante_3 >= + date_of_numbers(2015,1,1)) and (date_courante_3 <= + date_of_numbers(2015,12,31)))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) > + integer_of_string("2")): + return (bmaf_dot_montant * + decimal_of_string("0.0766")) + else: + return money_of_cents_string("0") + else: + raise EmptyError + def temp_montant_initial_base_troisieme_enfant_mayotte_8(_:Any): + if ((residence_2 == Collectivite(Collectivite_Code.Mayotte, + Unit())) and ((date_courante_3 >= + date_of_numbers(2014,1,1)) and (date_courante_3 <= + date_of_numbers(2014,12,31)))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) > + integer_of_string("2")): + return (bmaf_dot_montant * + decimal_of_string("0.069")) + else: + return money_of_cents_string("0") + else: + raise EmptyError + def temp_montant_initial_base_troisieme_enfant_mayotte_9(_:Any): + if ((residence_2 == Collectivite(Collectivite_Code.Mayotte, + Unit())) and ((date_courante_3 >= + date_of_numbers(2013,1,1)) and (date_courante_3 <= + date_of_numbers(2013,12,31)))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) > + integer_of_string("2")): + return (bmaf_dot_montant * + decimal_of_string("0.0615")) + else: + return money_of_cents_string("0") + else: + raise EmptyError + def temp_montant_initial_base_troisieme_enfant_mayotte_10(_:Any): + if ((residence_2 == Collectivite(Collectivite_Code.Mayotte, + Unit())) and ((date_courante_3 >= + date_of_numbers(2012,1,1)) and (date_courante_3 <= + date_of_numbers(2012,12,31)))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) > + integer_of_string("2")): + return (bmaf_dot_montant * + decimal_of_string("0.0539")) + else: + return money_of_cents_string("0") + else: + raise EmptyError + def temp_montant_initial_base_troisieme_enfant_mayotte_11(_:Any): + if ((residence_2 == Collectivite(Collectivite_Code.Mayotte, + Unit())) and ((date_courante_3 >= + date_of_numbers(2011,1,1)) and (date_courante_3 <= + date_of_numbers(2011,12,31)))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) > + integer_of_string("2")): + return (bmaf_dot_montant * + decimal_of_string("0.0463")) + else: + return money_of_cents_string("0") + else: + raise EmptyError + temp_montant_initial_base_troisieme_enfant_mayotte_12 = handle_default( + SourcePosition(filename="examples/allocations_familiales/prologue.catala_fr", + start_line=117, start_column=11, end_line=117, end_column=56, + law_headings=["Allocations familiales", + "Champs d'applications", + "Prologue"]), [temp_montant_initial_base_troisieme_enfant_mayotte_11, + temp_montant_initial_base_troisieme_enfant_mayotte_10, + temp_montant_initial_base_troisieme_enfant_mayotte_9, + temp_montant_initial_base_troisieme_enfant_mayotte_8, + temp_montant_initial_base_troisieme_enfant_mayotte_7, + temp_montant_initial_base_troisieme_enfant_mayotte_6, + temp_montant_initial_base_troisieme_enfant_mayotte_5, + temp_montant_initial_base_troisieme_enfant_mayotte_4, + temp_montant_initial_base_troisieme_enfant_mayotte_3, + temp_montant_initial_base_troisieme_enfant_mayotte_2], + temp_montant_initial_base_troisieme_enfant_mayotte_1, + temp_montant_initial_base_troisieme_enfant_mayotte) + except EmptyError: if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) > - integer_of_string("2")): - return (bmaf_dot_montant * decimal_of_string("0.16")) + integer_of_string("2")): + temp_montant_initial_base_troisieme_enfant_mayotte_12 = (bmaf_dot_montant * + decimal_of_string("0.16")) else: - return money_of_cents_string("0") - - def temp_montant_initial_base_troisieme_enfant_mayotte_1(_: Any): - return True - - def temp_montant_initial_base_troisieme_enfant_mayotte_2(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=409, start_column=5, end_line=409, end_column=69, - law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte"]), ((residence_2 == - Collectivite(Collectivite_Code.Mayotte, Unit())) and - ((date_courante_3 >= date_of_numbers(2011, 1, 1)) and - (date_courante_3 <= - date_of_numbers(2011, 12, 31))))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) > - integer_of_string("2")): - return (bmaf_dot_montant * decimal_of_string("0.0463")) - else: - return money_of_cents_string("0") - else: - raise EmptyError - - def temp_montant_initial_base_troisieme_enfant_mayotte_3(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=416, start_column=5, end_line=416, end_column=69, - law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte"]), ((residence_2 == - Collectivite(Collectivite_Code.Mayotte, Unit())) and - ((date_courante_3 >= date_of_numbers(2012, 1, 1)) and - (date_courante_3 <= - date_of_numbers(2012, 12, 31))))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) > - integer_of_string("2")): - return (bmaf_dot_montant * decimal_of_string("0.0539")) - else: - return money_of_cents_string("0") - else: - raise EmptyError - - def temp_montant_initial_base_troisieme_enfant_mayotte_4(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=423, start_column=5, end_line=423, end_column=69, - law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte"]), ((residence_2 == - Collectivite(Collectivite_Code.Mayotte, Unit())) and - ((date_courante_3 >= date_of_numbers(2013, 1, 1)) and - (date_courante_3 <= - date_of_numbers(2013, 12, 31))))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) > - integer_of_string("2")): - return (bmaf_dot_montant * decimal_of_string("0.0615")) - else: - return money_of_cents_string("0") - else: - raise EmptyError - - def temp_montant_initial_base_troisieme_enfant_mayotte_5(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=430, start_column=5, end_line=430, end_column=69, - law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte"]), ((residence_2 == - Collectivite(Collectivite_Code.Mayotte, Unit())) and - ((date_courante_3 >= date_of_numbers(2014, 1, 1)) and - (date_courante_3 <= - date_of_numbers(2014, 12, 31))))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) > - integer_of_string("2")): - return (bmaf_dot_montant * decimal_of_string("0.069")) - else: - return money_of_cents_string("0") - else: - raise EmptyError - - def temp_montant_initial_base_troisieme_enfant_mayotte_6(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=437, start_column=5, end_line=437, end_column=69, - law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte"]), ((residence_2 == - Collectivite(Collectivite_Code.Mayotte, Unit())) and - ((date_courante_3 >= date_of_numbers(2015, 1, 1)) and - (date_courante_3 <= - date_of_numbers(2015, 12, 31))))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) > - integer_of_string("2")): - return (bmaf_dot_montant * decimal_of_string("0.0766")) - else: - return money_of_cents_string("0") - else: - raise EmptyError - - def temp_montant_initial_base_troisieme_enfant_mayotte_7(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=444, start_column=5, end_line=444, end_column=69, - law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte"]), ((residence_2 == - Collectivite(Collectivite_Code.Mayotte, Unit())) and - ((date_courante_3 >= date_of_numbers(2016, 1, 1)) and - (date_courante_3 <= - date_of_numbers(2016, 12, 31))))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) > - integer_of_string("2")): - return (bmaf_dot_montant * decimal_of_string("0.0842")) - else: - return money_of_cents_string("0") - else: - raise EmptyError - - def temp_montant_initial_base_troisieme_enfant_mayotte_8(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=451, start_column=5, end_line=451, end_column=69, - law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte"]), ((residence_2 == - Collectivite(Collectivite_Code.Mayotte, Unit())) and - ((date_courante_3 >= date_of_numbers(2017, 1, 1)) and - (date_courante_3 <= - date_of_numbers(2017, 12, 31))))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) > - integer_of_string("2")): - return (bmaf_dot_montant * decimal_of_string("0.0918")) - else: - return money_of_cents_string("0") - else: - raise EmptyError - - def temp_montant_initial_base_troisieme_enfant_mayotte_9(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=458, start_column=5, end_line=458, end_column=69, - law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte"]), ((residence_2 == - Collectivite(Collectivite_Code.Mayotte, Unit())) and - ((date_courante_3 >= date_of_numbers(2018, 1, 1)) and - (date_courante_3 <= - date_of_numbers(2018, 12, 31))))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) > - integer_of_string("2")): - return (bmaf_dot_montant * decimal_of_string("0.1089")) - else: - return money_of_cents_string("0") - else: - raise EmptyError - - def temp_montant_initial_base_troisieme_enfant_mayotte_10(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=465, start_column=5, end_line=465, end_column=69, - law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte"]), ((residence_2 == - Collectivite(Collectivite_Code.Mayotte, Unit())) and - ((date_courante_3 >= date_of_numbers(2019, 1, 1)) and - (date_courante_3 <= - date_of_numbers(2019, 12, 31))))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) > - integer_of_string("2")): - return (bmaf_dot_montant * decimal_of_string("0.1259")) - else: - return money_of_cents_string("0") - else: - raise EmptyError - - def temp_montant_initial_base_troisieme_enfant_mayotte_11(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=472, start_column=5, end_line=472, end_column=69, - law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte"]), ((residence_2 == - Collectivite(Collectivite_Code.Mayotte, Unit())) and - ((date_courante_3 >= date_of_numbers(2020, 1, 1)) and - (date_courante_3 <= - date_of_numbers(2020, 12, 31))))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) > - integer_of_string("2")): - return (bmaf_dot_montant * decimal_of_string("0.143")) - else: - return money_of_cents_string("0") - else: - raise EmptyError - temp_montant_initial_base_troisieme_enfant_mayotte_12 = handle_default( - [temp_montant_initial_base_troisieme_enfant_mayotte_11, - temp_montant_initial_base_troisieme_enfant_mayotte_10, - temp_montant_initial_base_troisieme_enfant_mayotte_9, - temp_montant_initial_base_troisieme_enfant_mayotte_8, - temp_montant_initial_base_troisieme_enfant_mayotte_7, - temp_montant_initial_base_troisieme_enfant_mayotte_6, - temp_montant_initial_base_troisieme_enfant_mayotte_5, - temp_montant_initial_base_troisieme_enfant_mayotte_4, - temp_montant_initial_base_troisieme_enfant_mayotte_3, - temp_montant_initial_base_troisieme_enfant_mayotte_2], - temp_montant_initial_base_troisieme_enfant_mayotte_1, - temp_montant_initial_base_troisieme_enfant_mayotte) + temp_montant_initial_base_troisieme_enfant_mayotte_12 = money_of_cents_string("0") except EmptyError: - raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", + temp_montant_initial_base_troisieme_enfant_mayotte_12 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/allocations_familiales/prologue.catala_fr", start_line=117, start_column=11, end_line=117, end_column=56, law_headings=["Allocations familiales", - "Champs d'applications", - "Prologue"])) - montant_initial_base_troisieme_enfant_mayotte = log_variable_definition(["AllocationsFamiliales", - "montant_initial_base_troisième_enfant_mayotte"], - temp_montant_initial_base_troisieme_enfant_mayotte_12) + "Champs d'applications", + "Prologue"])) + montant_initial_base_troisieme_enfant_mayotte = temp_montant_initial_base_troisieme_enfant_mayotte_12 try: - temp_nombre_total_enfants = decimal_of_integer( - list_length(enfants_a_charge_droit_ouvert_prestation_familiale)) + temp_nombre_total_enfants = decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale)) except EmptyError: - raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", + temp_nombre_total_enfants = dead_value + raise NoValueProvided(SourcePosition(filename="examples/allocations_familiales/prologue.catala_fr", start_line=111, start_column=11, end_line=111, end_column=31, law_headings=["Allocations familiales", - "Champs d'applications", - "Prologue"])) - nombre_total_enfants = log_variable_definition(["AllocationsFamiliales", - "nombre_total_enfants"], temp_nombre_total_enfants) + "Champs d'applications", + "Prologue"])) + nombre_total_enfants = temp_nombre_total_enfants try: - def temp_nombre_moyen_enfants(acc_1: Decimal, enfant_1: Any): - match_arg_16 = log_end_call(["AllocationsFamiliales", - "prise_en_compte"], - log_variable_definition(["AllocationsFamiliales", - "prise_en_compte", "output"], - log_begin_call(["AllocationsFamiliales", "prise_en_compte"], - prise_en_compte, - log_variable_definition(["AllocationsFamiliales", - "prise_en_compte", "input"], - enfant_1)))) + def temp_nombre_moyen_enfants(acc_1:Decimal, enfant_1:Any): + match_arg_16 = prise_en_compte(enfant_1) if match_arg_16.code == PriseEnCompte_Code.Complete: _ = match_arg_16.value temp_nombre_moyen_enfants_1 = decimal_of_string("1.") @@ -2144,1504 +1859,1073 @@ def allocations_familiales(allocations_familiales_in: AllocationsFamilialesIn): decimal_of_string("0."), enfants_a_charge_droit_ouvert_prestation_familiale) except EmptyError: - raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", + temp_nombre_moyen_enfants_2 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/allocations_familiales/prologue.catala_fr", start_line=110, start_column=11, end_line=110, end_column=31, law_headings=["Allocations familiales", - "Champs d'applications", - "Prologue"])) - nombre_moyen_enfants = log_variable_definition(["AllocationsFamiliales", - "nombre_moyen_enfants"], temp_nombre_moyen_enfants_2) + "Champs d'applications", + "Prologue"])) + nombre_moyen_enfants = temp_nombre_moyen_enfants_2 try: - def temp_montant_initial_base_premier_enfant(_: Any): + def temp_montant_initial_base_premier_enfant(_:Any): return money_of_cents_string("0") - - def temp_montant_initial_base_premier_enfant_1(_: Any): + def temp_montant_initial_base_premier_enfant_1(_:Any): return True - - def temp_montant_initial_base_premier_enfant_2(_: Any): - if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=362, start_column=5, end_line=363, end_column=71, - law_headings=["Article D755-5", - "Chapitre 5 : Prestations familiales et prestations assimilées", - "Titre 5 : Départements d'outre-mer", - "Livre 7 : Régimes divers - Dispositions diverses", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), (prestations_familiales_dot_regime_outre_mer_l751_1 and - (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) == - integer_of_string("1")))): + def temp_montant_initial_base_premier_enfant_2(_:Any): + if (prestations_familiales_dot_regime_outre_mer_l751_1 and + (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) == + integer_of_string("1"))): return (bmaf_dot_montant * decimal_of_string("0.0588")) else: raise EmptyError - - def temp_montant_initial_base_premier_enfant_3(_: Any): - def temp_montant_initial_base_premier_enfant_4(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=167, start_column=14, - end_line=167, end_column=49, law_headings=["Article 7", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte"]), (residence_2 == - Collectivite(Collectivite_Code.Mayotte, - Unit()))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) > - integer_of_string("0")): - return (bmaf_dot_montant * - decimal_of_string("0.0588")) - else: - return money_of_cents_string("0") - else: + def temp_montant_initial_base_premier_enfant_3(_:Any): + try: + def temp_montant_initial_base_premier_enfant_4(_:Any): raise EmptyError - - def temp_montant_initial_base_premier_enfant_5(_: Any): - return True - - def temp_montant_initial_base_premier_enfant_6(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=250, start_column=5, - end_line=251, end_column=53, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte"]), ((residence_2 == - Collectivite(Collectivite_Code.Mayotte, Unit())) and - ((date_courante_3 >= date_of_numbers(2011, 1, 1)) and - ((date_courante_3 <= date_of_numbers(2011, 12, 31)) and - not avait_enfant_a_charge_avant_1er_janvier_2012)))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) > + def temp_montant_initial_base_premier_enfant_5(_:Any): + return False + def temp_montant_initial_base_premier_enfant_6(_:Any): + if ((residence_2 == + Collectivite(Collectivite_Code.Mayotte, Unit())) and + avait_enfant_a_charge_avant_1er_janvier_2012): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) > integer_of_string("0")): - return (bmaf_dot_montant * - decimal_of_string("0.145")) + return money_of_cents_string("5728") + else: + return money_of_cents_string("0") else: - return money_of_cents_string("0") - else: - raise EmptyError - - def temp_montant_initial_base_premier_enfant_7(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=258, start_column=5, - end_line=259, end_column=53, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte"]), ((residence_2 == - Collectivite(Collectivite_Code.Mayotte, Unit())) and - ((date_courante_3 >= date_of_numbers(2012, 1, 1)) and - ((date_courante_3 <= date_of_numbers(2012, 12, 31)) and - not avait_enfant_a_charge_avant_1er_janvier_2012)))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) > + raise EmptyError + def temp_montant_initial_base_premier_enfant_7(_:Any): + if ((residence_2 == + Collectivite(Collectivite_Code.Mayotte, Unit())) and + ((date_courante_3 >= date_of_numbers(2020,1,1)) and + ((date_courante_3 <= date_of_numbers(2020,12,31)) and + not avait_enfant_a_charge_avant_1er_janvier_2012))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) > integer_of_string("0")): - return (bmaf_dot_montant * - decimal_of_string("0.1393")) - else: - return money_of_cents_string("0") - else: - raise EmptyError - - def temp_montant_initial_base_premier_enfant_8(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=266, start_column=5, - end_line=267, end_column=53, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte"]), ((residence_2 == - Collectivite(Collectivite_Code.Mayotte, Unit())) and - ((date_courante_3 >= date_of_numbers(2013, 1, 1)) and - ((date_courante_3 <= date_of_numbers(2013, 12, 31)) and - not avait_enfant_a_charge_avant_1er_janvier_2012)))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) > - integer_of_string("0")): - return (bmaf_dot_montant * - decimal_of_string("0.1335")) - else: - return money_of_cents_string("0") - else: - raise EmptyError - - def temp_montant_initial_base_premier_enfant_9(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=274, start_column=5, - end_line=275, end_column=53, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte"]), ((residence_2 == - Collectivite(Collectivite_Code.Mayotte, Unit())) and - ((date_courante_3 >= date_of_numbers(2014, 1, 1)) and - ((date_courante_3 <= date_of_numbers(2014, 12, 31)) and - not avait_enfant_a_charge_avant_1er_janvier_2012)))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) > - integer_of_string("0")): - return (bmaf_dot_montant * - decimal_of_string("0.1278")) - else: - return money_of_cents_string("0") - else: - raise EmptyError - - def temp_montant_initial_base_premier_enfant_10(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=282, start_column=5, - end_line=283, end_column=53, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte"]), ((residence_2 == - Collectivite(Collectivite_Code.Mayotte, Unit())) and - ((date_courante_3 >= date_of_numbers(2015, 1, 1)) and - ((date_courante_3 <= date_of_numbers(2015, 12, 31)) and - not avait_enfant_a_charge_avant_1er_janvier_2012)))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) > - integer_of_string("0")): - return (bmaf_dot_montant * - decimal_of_string("0.122")) - else: - return money_of_cents_string("0") - else: - raise EmptyError - - def temp_montant_initial_base_premier_enfant_11(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=290, start_column=5, - end_line=291, end_column=53, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte"]), ((residence_2 == - Collectivite(Collectivite_Code.Mayotte, Unit())) and - ((date_courante_3 >= date_of_numbers(2016, 1, 1)) and - ((date_courante_3 <= date_of_numbers(2016, 12, 31)) and - not avait_enfant_a_charge_avant_1er_janvier_2012)))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) > - integer_of_string("0")): - return (bmaf_dot_montant * - decimal_of_string("0.1163")) - else: - return money_of_cents_string("0") - else: - raise EmptyError - - def temp_montant_initial_base_premier_enfant_12(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=298, start_column=5, - end_line=299, end_column=53, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte"]), ((residence_2 == - Collectivite(Collectivite_Code.Mayotte, Unit())) and - ((date_courante_3 >= date_of_numbers(2017, 1, 1)) and - ((date_courante_3 <= date_of_numbers(2017, 12, 31)) and - not avait_enfant_a_charge_avant_1er_janvier_2012)))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) > - integer_of_string("0")): - return (bmaf_dot_montant * - decimal_of_string("0.1105")) - else: - return money_of_cents_string("0") - else: - raise EmptyError - - def temp_montant_initial_base_premier_enfant_13(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=306, start_column=5, - end_line=307, end_column=53, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte"]), ((residence_2 == - Collectivite(Collectivite_Code.Mayotte, Unit())) and - ((date_courante_3 >= date_of_numbers(2018, 1, 1)) and - ((date_courante_3 <= date_of_numbers(2018, 12, 31)) and - not avait_enfant_a_charge_avant_1er_janvier_2012)))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) > - integer_of_string("0")): - return (bmaf_dot_montant * - decimal_of_string("0.0976")) - else: - return money_of_cents_string("0") - else: - raise EmptyError - - def temp_montant_initial_base_premier_enfant_14(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=314, start_column=5, - end_line=315, end_column=53, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte"]), ((residence_2 == - Collectivite(Collectivite_Code.Mayotte, Unit())) and - ((date_courante_3 >= date_of_numbers(2019, 1, 1)) and - ((date_courante_3 <= date_of_numbers(2019, 12, 31)) and - not avait_enfant_a_charge_avant_1er_janvier_2012)))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) > - integer_of_string("0")): - return (bmaf_dot_montant * - decimal_of_string("0.0847")) - else: - return money_of_cents_string("0") - else: - raise EmptyError - - def temp_montant_initial_base_premier_enfant_15(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=322, start_column=5, - end_line=323, end_column=53, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte"]), ((residence_2 == - Collectivite(Collectivite_Code.Mayotte, Unit())) and - ((date_courante_3 >= date_of_numbers(2020, 1, 1)) and - ((date_courante_3 <= date_of_numbers(2020, 12, 31)) and - not avait_enfant_a_charge_avant_1er_janvier_2012)))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) > - integer_of_string("0")): - return (bmaf_dot_montant * + return (bmaf_dot_montant * decimal_of_string("0.0717")) + else: + return money_of_cents_string("0") else: - return money_of_cents_string("0") - else: - raise EmptyError - - def temp_montant_initial_base_premier_enfant_16(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=330, start_column=5, - end_line=330, end_column=49, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte"]), ((residence_2 == - Collectivite(Collectivite_Code.Mayotte, Unit())) and - avait_enfant_a_charge_avant_1er_janvier_2012)): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) > + raise EmptyError + def temp_montant_initial_base_premier_enfant_8(_:Any): + if ((residence_2 == + Collectivite(Collectivite_Code.Mayotte, Unit())) and + ((date_courante_3 >= date_of_numbers(2019,1,1)) and + ((date_courante_3 <= date_of_numbers(2019,12,31)) and + not avait_enfant_a_charge_avant_1er_janvier_2012))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) > integer_of_string("0")): - return money_of_cents_string("5728") + return (bmaf_dot_montant * + decimal_of_string("0.0847")) + else: + return money_of_cents_string("0") + else: + raise EmptyError + def temp_montant_initial_base_premier_enfant_9(_:Any): + if ((residence_2 == + Collectivite(Collectivite_Code.Mayotte, Unit())) and + ((date_courante_3 >= date_of_numbers(2018,1,1)) and + ((date_courante_3 <= date_of_numbers(2018,12,31)) and + not avait_enfant_a_charge_avant_1er_janvier_2012))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) > + integer_of_string("0")): + return (bmaf_dot_montant * + decimal_of_string("0.0976")) + else: + return money_of_cents_string("0") + else: + raise EmptyError + def temp_montant_initial_base_premier_enfant_10(_:Any): + if ((residence_2 == + Collectivite(Collectivite_Code.Mayotte, Unit())) and + ((date_courante_3 >= date_of_numbers(2017,1,1)) and + ((date_courante_3 <= date_of_numbers(2017,12,31)) and + not avait_enfant_a_charge_avant_1er_janvier_2012))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) > + integer_of_string("0")): + return (bmaf_dot_montant * + decimal_of_string("0.1105")) + else: + return money_of_cents_string("0") + else: + raise EmptyError + def temp_montant_initial_base_premier_enfant_11(_:Any): + if ((residence_2 == + Collectivite(Collectivite_Code.Mayotte, Unit())) and + ((date_courante_3 >= date_of_numbers(2016,1,1)) and + ((date_courante_3 <= date_of_numbers(2016,12,31)) and + not avait_enfant_a_charge_avant_1er_janvier_2012))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) > + integer_of_string("0")): + return (bmaf_dot_montant * + decimal_of_string("0.1163")) + else: + return money_of_cents_string("0") + else: + raise EmptyError + def temp_montant_initial_base_premier_enfant_12(_:Any): + if ((residence_2 == + Collectivite(Collectivite_Code.Mayotte, Unit())) and + ((date_courante_3 >= date_of_numbers(2015,1,1)) and + ((date_courante_3 <= date_of_numbers(2015,12,31)) and + not avait_enfant_a_charge_avant_1er_janvier_2012))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) > + integer_of_string("0")): + return (bmaf_dot_montant * + decimal_of_string("0.122")) + else: + return money_of_cents_string("0") + else: + raise EmptyError + def temp_montant_initial_base_premier_enfant_13(_:Any): + if ((residence_2 == + Collectivite(Collectivite_Code.Mayotte, Unit())) and + ((date_courante_3 >= date_of_numbers(2014,1,1)) and + ((date_courante_3 <= date_of_numbers(2014,12,31)) and + not avait_enfant_a_charge_avant_1er_janvier_2012))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) > + integer_of_string("0")): + return (bmaf_dot_montant * + decimal_of_string("0.1278")) + else: + return money_of_cents_string("0") + else: + raise EmptyError + def temp_montant_initial_base_premier_enfant_14(_:Any): + if ((residence_2 == + Collectivite(Collectivite_Code.Mayotte, Unit())) and + ((date_courante_3 >= date_of_numbers(2013,1,1)) and + ((date_courante_3 <= date_of_numbers(2013,12,31)) and + not avait_enfant_a_charge_avant_1er_janvier_2012))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) > + integer_of_string("0")): + return (bmaf_dot_montant * + decimal_of_string("0.1335")) + else: + return money_of_cents_string("0") + else: + raise EmptyError + def temp_montant_initial_base_premier_enfant_15(_:Any): + if ((residence_2 == + Collectivite(Collectivite_Code.Mayotte, Unit())) and + ((date_courante_3 >= date_of_numbers(2012,1,1)) and + ((date_courante_3 <= date_of_numbers(2012,12,31)) and + not avait_enfant_a_charge_avant_1er_janvier_2012))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) > + integer_of_string("0")): + return (bmaf_dot_montant * + decimal_of_string("0.1393")) + else: + return money_of_cents_string("0") + else: + raise EmptyError + def temp_montant_initial_base_premier_enfant_16(_:Any): + if ((residence_2 == + Collectivite(Collectivite_Code.Mayotte, Unit())) and + ((date_courante_3 >= date_of_numbers(2011,1,1)) and + ((date_courante_3 <= date_of_numbers(2011,12,31)) and + not avait_enfant_a_charge_avant_1er_janvier_2012))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) > + integer_of_string("0")): + return (bmaf_dot_montant * + decimal_of_string("0.145")) + else: + return money_of_cents_string("0") + else: + raise EmptyError + return handle_default(SourcePosition(filename="examples/allocations_familiales/prologue.catala_fr", + start_line=106, start_column=11, + end_line=106, end_column=46, + law_headings=["Allocations familiales", + "Champs d'applications", + "Prologue"]), [temp_montant_initial_base_premier_enfant_16, + temp_montant_initial_base_premier_enfant_15, + temp_montant_initial_base_premier_enfant_14, + temp_montant_initial_base_premier_enfant_13, + temp_montant_initial_base_premier_enfant_12, + temp_montant_initial_base_premier_enfant_11, + temp_montant_initial_base_premier_enfant_10, + temp_montant_initial_base_premier_enfant_9, + temp_montant_initial_base_premier_enfant_8, + temp_montant_initial_base_premier_enfant_7, + temp_montant_initial_base_premier_enfant_6], + temp_montant_initial_base_premier_enfant_5, + temp_montant_initial_base_premier_enfant_4) + except EmptyError: + if (residence_2 == Collectivite(Collectivite_Code.Mayotte, + Unit())): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) > + integer_of_string("0")): + return (bmaf_dot_montant * + decimal_of_string("0.0588")) else: return money_of_cents_string("0") else: raise EmptyError - return handle_default([temp_montant_initial_base_premier_enfant_16, - temp_montant_initial_base_premier_enfant_15, - temp_montant_initial_base_premier_enfant_14, - temp_montant_initial_base_premier_enfant_13, - temp_montant_initial_base_premier_enfant_12, - temp_montant_initial_base_premier_enfant_11, - temp_montant_initial_base_premier_enfant_10, - temp_montant_initial_base_premier_enfant_9, - temp_montant_initial_base_premier_enfant_8, - temp_montant_initial_base_premier_enfant_7, - temp_montant_initial_base_premier_enfant_6], - temp_montant_initial_base_premier_enfant_5, - temp_montant_initial_base_premier_enfant_4) temp_montant_initial_base_premier_enfant_17 = handle_default( - [temp_montant_initial_base_premier_enfant_3, - temp_montant_initial_base_premier_enfant_2], + SourcePosition(filename="examples/allocations_familiales/prologue.catala_fr", + start_line=106, start_column=11, end_line=106, end_column=46, + law_headings=["Allocations familiales", "Champs d'applications", + "Prologue"]), [temp_montant_initial_base_premier_enfant_3, + temp_montant_initial_base_premier_enfant_2], temp_montant_initial_base_premier_enfant_1, temp_montant_initial_base_premier_enfant) except EmptyError: - raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", + temp_montant_initial_base_premier_enfant_17 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/allocations_familiales/prologue.catala_fr", start_line=106, start_column=11, end_line=106, end_column=46, law_headings=["Allocations familiales", - "Champs d'applications", - "Prologue"])) - montant_initial_base_premier_enfant = log_variable_definition(["AllocationsFamiliales", - "montant_initial_base_premier_enfant"], - temp_montant_initial_base_premier_enfant_17) + "Champs d'applications", + "Prologue"])) + montant_initial_base_premier_enfant = temp_montant_initial_base_premier_enfant_17 try: try: - def temp_droit_ouvert_base(_: Any): - if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=101, start_column=5, - end_line=101, end_column=70, - law_headings=["Article L521-1", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie législative", - "Code de la sécurité sociale"]), (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) >= - integer_of_string("2"))): - return True + try: + try: + if ((residence_2 == + Collectivite(Collectivite_Code.Mayotte, Unit())) and + (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) >= + integer_of_string("1"))): + temp_droit_ouvert_base = True + else: + temp_droit_ouvert_base = dead_value + raise EmptyError + except EmptyError: + if (prestations_familiales_dot_regime_outre_mer_l751_1 and + (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) >= + integer_of_string("1"))): + temp_droit_ouvert_base = True + else: + temp_droit_ouvert_base = dead_value + raise EmptyError + except EmptyError: + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) >= + integer_of_string("2")): + temp_droit_ouvert_base = True else: + temp_droit_ouvert_base = dead_value raise EmptyError - - def temp_droit_ouvert_base_1(_: Any): - return True - - def temp_droit_ouvert_base_2(_: Any): - if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=406, start_column=5, - end_line=407, end_column=72, - law_headings=["Article L755-12", - "Chapitre 5 : Prestations familiales et prestations assimilées", - "Titre 5 : Dispositions particulières à la Guadeloupe, à la Guyane, à la Martinique, à La Réunion, à Saint-Barthélemy et à Saint-Martin", - "Livre 7 : Régimes divers - Dispositions diverses", - "Partie législative", - "Code de la sécurité sociale"]), (prestations_familiales_dot_regime_outre_mer_l751_1 and - (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) >= - integer_of_string("1")))): - return True - else: - raise EmptyError - - def temp_droit_ouvert_base_3(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=159, start_column=6, - end_line=159, end_column=71, law_headings=["Article 7", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte"]), ((residence_2 == - Collectivite(Collectivite_Code.Mayotte, Unit())) and - (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) >= - integer_of_string("1")))): - return True - else: - raise EmptyError - temp_droit_ouvert_base_4 = handle_default([temp_droit_ouvert_base_3, - temp_droit_ouvert_base_2], - temp_droit_ouvert_base_1, - temp_droit_ouvert_base) except EmptyError: - temp_droit_ouvert_base_4 = False + temp_droit_ouvert_base = False except EmptyError: - raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", + temp_droit_ouvert_base = dead_value + raise NoValueProvided(SourcePosition(filename="examples/allocations_familiales/prologue.catala_fr", start_line=104, start_column=11, end_line=104, end_column=28, law_headings=["Allocations familiales", - "Champs d'applications", - "Prologue"])) - droit_ouvert_base = log_variable_definition(["AllocationsFamiliales", - "droit_ouvert_base"], temp_droit_ouvert_base_4) + "Champs d'applications", + "Prologue"])) + droit_ouvert_base = temp_droit_ouvert_base try: - def temp_droit_ouvert_majoration(param_7: Enfant): + def temp_droit_ouvert_majoration(param_7:Enfant): try: try: try: - if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=313, start_column=5, - end_line=315, end_column=58, - law_headings=["Article L521-3", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie législative", - "Code de la sécurité sociale"]), ((list_length(enfants_a_charge_droit_ouvert_prestation_familiale) >= - nombre_enfants_alinea_2_l521_3) and - (param_7.age >= - log_end_call(["AllocationsFamiliales", - "âge_minimum_alinéa_1_l521_3"], - log_variable_definition(["AllocationsFamiliales", - "âge_minimum_alinéa_1_l521_3", "output"], - log_begin_call(["AllocationsFamiliales", - "âge_minimum_alinéa_1_l521_3"], - age_minimum_alinea_1_l521_3_1, - log_variable_definition(["AllocationsFamiliales", - "âge_minimum_alinéa_1_l521_3", "input"], - param_7))))))): + if ((list_length(enfants_a_charge_droit_ouvert_prestation_familiale) >= + nombre_enfants_alinea_2_l521_3) and + (param_7.age >= + age_minimum_alinea_1_l521_3_1(param_7))): return True else: raise EmptyError except EmptyError: - if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=299, start_column=5, - end_line=300, end_column=58, - law_headings=["Article L521-3", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie législative", - "Code de la sécurité sociale"]), (not log_end_call(["AllocationsFamiliales", - "est_enfant_le_plus_âgé"], - log_variable_definition(["AllocationsFamiliales", - "est_enfant_le_plus_âgé", "output"], - log_begin_call(["AllocationsFamiliales", - "est_enfant_le_plus_âgé"], - est_enfant_le_plus_age, - log_variable_definition(["AllocationsFamiliales", - "est_enfant_le_plus_âgé", "input"], - param_7)))) and (param_7.age >= - log_end_call(["AllocationsFamiliales", - "âge_minimum_alinéa_1_l521_3"], - log_variable_definition(["AllocationsFamiliales", - "âge_minimum_alinéa_1_l521_3", "output"], - log_begin_call(["AllocationsFamiliales", - "âge_minimum_alinéa_1_l521_3"], - age_minimum_alinea_1_l521_3_1, - log_variable_definition(["AllocationsFamiliales", - "âge_minimum_alinéa_1_l521_3", "input"], - param_7))))))): + if (not est_enfant_le_plus_age(param_7) and + (param_7.age >= + age_minimum_alinea_1_l521_3_1(param_7))): return True else: raise EmptyError except EmptyError: return False except EmptyError: - raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", + raise NoValueProvided(SourcePosition(filename="examples/allocations_familiales/prologue.catala_fr", start_line=126, start_column=11, end_line=126, end_column=34, law_headings=["Allocations familiales", - "Champs d'applications", - "Prologue"])) + "Champs d'applications", + "Prologue"])) except EmptyError: - raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", + temp_droit_ouvert_majoration = dead_value + raise NoValueProvided(SourcePosition(filename="examples/allocations_familiales/prologue.catala_fr", start_line=126, start_column=11, end_line=126, end_column=34, law_headings=["Allocations familiales", - "Champs d'applications", - "Prologue"])) - droit_ouvert_majoration = log_variable_definition(["AllocationsFamiliales", - "droit_ouvert_majoration"], temp_droit_ouvert_majoration) + "Champs d'applications", + "Prologue"])) + droit_ouvert_majoration = temp_droit_ouvert_majoration try: - def temp_complement_degressif(param_8: Money): + def temp_complement_degressif(param_8:Money): try: - def temp_complement_degressif_1(_: Any): + try: + try: + if ((ressources_menage > plafond__i_i_d521_3) and + (ressources_menage <= (plafond__i_i_d521_3 + + (param_8 * + decimal_of_string("12."))))): + return (((plafond__i_i_d521_3 + (param_8 * + decimal_of_string("12."))) - + ressources_menage) * + (decimal_of_string("1.") / + decimal_of_string("12."))) + else: + raise EmptyError + except EmptyError: + if ((ressources_menage > plafond__i_d521_3) and + (ressources_menage <= (plafond__i_d521_3 + + (param_8 * + decimal_of_string("12."))))): + return (((plafond__i_d521_3 + (param_8 * + decimal_of_string("12."))) - + ressources_menage) * + (decimal_of_string("1.") / + decimal_of_string("12."))) + else: + raise EmptyError + except EmptyError: return money_of_cents_string("0") - - def temp_complement_degressif_2(_: Any): - return True - - def temp_complement_degressif_3(_: Any): - if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=165, start_column=5, - end_line=166, end_column=68, - law_headings=["Article D521-1", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), ((ressources_menage > - plafond__i_d521_3) and (ressources_menage <= - (plafond__i_d521_3 + (param_8 * - decimal_of_string("12.")))))): - return ((plafond__i_d521_3 + ((param_8 * - decimal_of_string("12.")) - ressources_menage)) * - (decimal_of_string("1.") / - decimal_of_string("12."))) - else: - raise EmptyError - - def temp_complement_degressif_4(_: Any): - if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=173, start_column=5, - end_line=174, end_column=68, - law_headings=["Article D521-1", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), ((ressources_menage > - plafond__i_i_d521_3) and (ressources_menage <= - (plafond__i_i_d521_3 + (param_8 * - decimal_of_string("12.")))))): - return ((plafond__i_i_d521_3 + ((param_8 * - decimal_of_string("12.")) - ressources_menage)) * - (decimal_of_string("1.") / - decimal_of_string("12."))) - else: - raise EmptyError - return handle_default([temp_complement_degressif_4, - temp_complement_degressif_3], - temp_complement_degressif_2, - temp_complement_degressif_1) except EmptyError: - raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", + raise NoValueProvided(SourcePosition(filename="examples/allocations_familiales/prologue.catala_fr", start_line=135, start_column=11, end_line=135, end_column=31, law_headings=["Allocations familiales", - "Champs d'applications", - "Prologue"])) + "Champs d'applications", + "Prologue"])) except EmptyError: - raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", + temp_complement_degressif = dead_value + raise NoValueProvided(SourcePosition(filename="examples/allocations_familiales/prologue.catala_fr", start_line=135, start_column=11, end_line=135, end_column=31, law_headings=["Allocations familiales", - "Champs d'applications", - "Prologue"])) - complement_degressif = log_variable_definition(["AllocationsFamiliales", - "complément_dégressif"], temp_complement_degressif) + "Champs d'applications", + "Prologue"])) + complement_degressif = temp_complement_degressif try: - def temp_montant_verse_forfaitaire_par_enfant(_: Any): + def temp_montant_verse_forfaitaire_par_enfant(_:Any): raise EmptyError - - def temp_montant_verse_forfaitaire_par_enfant_1(_: Any): - return True - - def temp_montant_verse_forfaitaire_par_enfant_2(_: Any): - if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=218, start_column=5, end_line=218, end_column=43, - law_headings=["Article D521-2", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), (ressources_menage <= - plafond__i_d521_3)): - return (bmaf_dot_montant * decimal_of_string("0.20234")) - else: - raise EmptyError - - def temp_montant_verse_forfaitaire_par_enfant_3(_: Any): - if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=232, start_column=5, end_line=233, end_column=46, - law_headings=["Article D521-2", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), ((ressources_menage > - plafond__i_d521_3) and (ressources_menage <= - plafond__i_i_d521_3))): - return (bmaf_dot_montant * decimal_of_string("0.10117")) - else: - raise EmptyError - - def temp_montant_verse_forfaitaire_par_enfant_4(_: Any): - if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=246, start_column=5, end_line=246, end_column=43, - law_headings=["Article D521-2", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), (ressources_menage > - plafond__i_i_d521_3)): + def temp_montant_verse_forfaitaire_par_enfant_1(_:Any): + return False + def temp_montant_verse_forfaitaire_par_enfant_2(_:Any): + if (ressources_menage > + plafond__i_i_d521_3): return (bmaf_dot_montant * decimal_of_string("0.05059")) else: raise EmptyError + def temp_montant_verse_forfaitaire_par_enfant_3(_:Any): + if ((ressources_menage > plafond__i_d521_3) and + (ressources_menage <= + plafond__i_i_d521_3)): + return (bmaf_dot_montant * decimal_of_string("0.10117")) + else: + raise EmptyError + def temp_montant_verse_forfaitaire_par_enfant_4(_:Any): + if (ressources_menage <= + plafond__i_d521_3): + return (bmaf_dot_montant * decimal_of_string("0.20234")) + else: + raise EmptyError temp_montant_verse_forfaitaire_par_enfant_5 = handle_default( - [temp_montant_verse_forfaitaire_par_enfant_4, - temp_montant_verse_forfaitaire_par_enfant_3, - temp_montant_verse_forfaitaire_par_enfant_2], + SourcePosition(filename="examples/allocations_familiales/prologue.catala_fr", + start_line=122, start_column=11, end_line=122, end_column=47, + law_headings=["Allocations familiales", "Champs d'applications", + "Prologue"]), [temp_montant_verse_forfaitaire_par_enfant_4, + temp_montant_verse_forfaitaire_par_enfant_3, + temp_montant_verse_forfaitaire_par_enfant_2], temp_montant_verse_forfaitaire_par_enfant_1, temp_montant_verse_forfaitaire_par_enfant) except EmptyError: - raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", + temp_montant_verse_forfaitaire_par_enfant_5 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/allocations_familiales/prologue.catala_fr", start_line=122, start_column=11, end_line=122, end_column=47, law_headings=["Allocations familiales", - "Champs d'applications", - "Prologue"])) - montant_verse_forfaitaire_par_enfant = log_variable_definition(["AllocationsFamiliales", - "montant_versé_forfaitaire_par_enfant"], - temp_montant_verse_forfaitaire_par_enfant_5) + "Champs d'applications", + "Prologue"])) + montant_verse_forfaitaire_par_enfant = temp_montant_verse_forfaitaire_par_enfant_5 try: - def temp_montant_initial_base_troisieme_enfant_et_plus(_: Any): + def temp_montant_initial_base_troisieme_enfant_et_plus(_:Any): raise EmptyError - - def temp_montant_initial_base_troisieme_enfant_et_plus_1(_: Any): - return True - - def temp_montant_initial_base_troisieme_enfant_et_plus_2(_: Any): - if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=43, start_column=14, end_line=43, end_column=59, - law_headings=["Article D521-1", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), (ressources_menage <= - plafond__i_d521_3)): + def temp_montant_initial_base_troisieme_enfant_et_plus_1(_:Any): + return False + def temp_montant_initial_base_troisieme_enfant_et_plus_2(_:Any): + if (ressources_menage > + plafond__i_i_d521_3): if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) > - integer_of_string("2")): - return ((bmaf_dot_montant * decimal_of_string("0.41")) * - decimal_of_integer((list_length(enfants_a_charge_droit_ouvert_prestation_familiale) - - integer_of_string("2")))) - else: - return money_of_cents_string("0") - else: - raise EmptyError - - def temp_montant_initial_base_troisieme_enfant_et_plus_3(_: Any): - if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=84, start_column=14, end_line=84, end_column=59, - law_headings=["Article D521-1", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), ((ressources_menage > - plafond__i_d521_3) and (ressources_menage <= - plafond__i_i_d521_3))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) > - integer_of_string("2")): - return ((bmaf_dot_montant * decimal_of_string("0.205")) * - decimal_of_integer((list_length(enfants_a_charge_droit_ouvert_prestation_familiale) - - integer_of_string("2")))) - else: - return money_of_cents_string("0") - else: - raise EmptyError - - def temp_montant_initial_base_troisieme_enfant_et_plus_4(_: Any): - if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=122, start_column=14, end_line=122, end_column=59, - law_headings=["Article D521-1", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), (ressources_menage > - plafond__i_i_d521_3)): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) > - integer_of_string("2")): + integer_of_string("2")): return ((bmaf_dot_montant * - decimal_of_string("0.1025")) * - decimal_of_integer((list_length(enfants_a_charge_droit_ouvert_prestation_familiale) - - integer_of_string("2")))) + decimal_of_string("0.1025")) * + decimal_of_integer((list_length(enfants_a_charge_droit_ouvert_prestation_familiale) - + integer_of_string("2")))) + else: + return money_of_cents_string("0") + else: + raise EmptyError + def temp_montant_initial_base_troisieme_enfant_et_plus_3(_:Any): + if ((ressources_menage > plafond__i_d521_3) and + (ressources_menage <= + plafond__i_i_d521_3)): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) > + integer_of_string("2")): + return ((bmaf_dot_montant * decimal_of_string("0.205")) * + decimal_of_integer((list_length(enfants_a_charge_droit_ouvert_prestation_familiale) - + integer_of_string("2")))) + else: + return money_of_cents_string("0") + else: + raise EmptyError + def temp_montant_initial_base_troisieme_enfant_et_plus_4(_:Any): + if (ressources_menage <= + plafond__i_d521_3): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) > + integer_of_string("2")): + return ((bmaf_dot_montant * decimal_of_string("0.41")) * + decimal_of_integer((list_length(enfants_a_charge_droit_ouvert_prestation_familiale) - + integer_of_string("2")))) else: return money_of_cents_string("0") else: raise EmptyError temp_montant_initial_base_troisieme_enfant_et_plus_5 = handle_default( - [temp_montant_initial_base_troisieme_enfant_et_plus_4, - temp_montant_initial_base_troisieme_enfant_et_plus_3, - temp_montant_initial_base_troisieme_enfant_et_plus_2], + SourcePosition(filename="examples/allocations_familiales/prologue.catala_fr", + start_line=108, start_column=11, end_line=108, end_column=56, + law_headings=["Allocations familiales", "Champs d'applications", + "Prologue"]), [temp_montant_initial_base_troisieme_enfant_et_plus_4, + temp_montant_initial_base_troisieme_enfant_et_plus_3, + temp_montant_initial_base_troisieme_enfant_et_plus_2], temp_montant_initial_base_troisieme_enfant_et_plus_1, temp_montant_initial_base_troisieme_enfant_et_plus) except EmptyError: - raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", + temp_montant_initial_base_troisieme_enfant_et_plus_5 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/allocations_familiales/prologue.catala_fr", start_line=108, start_column=11, end_line=108, end_column=56, law_headings=["Allocations familiales", - "Champs d'applications", - "Prologue"])) - montant_initial_base_troisieme_enfant_et_plus = log_variable_definition(["AllocationsFamiliales", - "montant_initial_base_troisième_enfant_et_plus"], - temp_montant_initial_base_troisieme_enfant_et_plus_5) + "Champs d'applications", + "Prologue"])) + montant_initial_base_troisieme_enfant_et_plus = temp_montant_initial_base_troisieme_enfant_et_plus_5 try: try: - def temp_montant_initial_base_deuxieme_enfant(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=177, start_column=14, - end_line=177, end_column=50, law_headings=["Article 7", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte"]), (residence_2 == - Collectivite(Collectivite_Code.Mayotte, - Unit()))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) > - integer_of_string("1")): - return (bmaf_dot_montant * decimal_of_string("0.32")) - else: - return money_of_cents_string("0") - else: + try: + def temp_montant_initial_base_deuxieme_enfant(_:Any): raise EmptyError - - def temp_montant_initial_base_deuxieme_enfant_1(_: Any): - return True - - def temp_montant_initial_base_deuxieme_enfant_2(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=338, start_column=5, - end_line=338, end_column=69, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte"]), ((residence_2 == - Collectivite(Collectivite_Code.Mayotte, Unit())) and - ((date_courante_3 >= date_of_numbers(2011, 1, 1)) and - (date_courante_3 <= - date_of_numbers(2011, 12, 31))))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) > + def temp_montant_initial_base_deuxieme_enfant_1(_:Any): + return False + def temp_montant_initial_base_deuxieme_enfant_2(_:Any): + if ((residence_2 == + Collectivite(Collectivite_Code.Mayotte, Unit())) and + ((date_courante_3 >= date_of_numbers(2020,1,1)) and + (date_courante_3 <= + date_of_numbers(2020,12,31)))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) > integer_of_string("1")): - return (bmaf_dot_montant * - decimal_of_string("0.232")) - else: - return money_of_cents_string("0") - else: - raise EmptyError - - def temp_montant_initial_base_deuxieme_enfant_3(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=345, start_column=5, - end_line=345, end_column=69, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte"]), ((residence_2 == - Collectivite(Collectivite_Code.Mayotte, Unit())) and - ((date_courante_3 >= date_of_numbers(2012, 1, 1)) and - (date_courante_3 <= - date_of_numbers(2012, 12, 31))))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) > - integer_of_string("1")): - return (bmaf_dot_montant * - decimal_of_string("0.2379")) - else: - return money_of_cents_string("0") - else: - raise EmptyError - - def temp_montant_initial_base_deuxieme_enfant_4(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=352, start_column=5, - end_line=352, end_column=69, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte"]), ((residence_2 == - Collectivite(Collectivite_Code.Mayotte, Unit())) and - ((date_courante_3 >= date_of_numbers(2013, 1, 1)) and - (date_courante_3 <= - date_of_numbers(2013, 12, 31))))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) > - integer_of_string("1")): - return (bmaf_dot_montant * - decimal_of_string("0.2437")) - else: - return money_of_cents_string("0") - else: - raise EmptyError - - def temp_montant_initial_base_deuxieme_enfant_5(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=359, start_column=5, - end_line=359, end_column=69, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte"]), ((residence_2 == - Collectivite(Collectivite_Code.Mayotte, Unit())) and - ((date_courante_3 >= date_of_numbers(2014, 1, 1)) and - (date_courante_3 <= - date_of_numbers(2014, 12, 31))))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) > - integer_of_string("1")): - return (bmaf_dot_montant * - decimal_of_string("0.2496")) - else: - return money_of_cents_string("0") - else: - raise EmptyError - - def temp_montant_initial_base_deuxieme_enfant_6(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=366, start_column=5, - end_line=366, end_column=69, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte"]), ((residence_2 == - Collectivite(Collectivite_Code.Mayotte, Unit())) and - ((date_courante_3 >= date_of_numbers(2015, 1, 1)) and - (date_courante_3 <= - date_of_numbers(2015, 12, 31))))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) > - integer_of_string("1")): - return (bmaf_dot_montant * - decimal_of_string("0.2555")) - else: - return money_of_cents_string("0") - else: - raise EmptyError - - def temp_montant_initial_base_deuxieme_enfant_7(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=373, start_column=5, - end_line=373, end_column=69, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte"]), ((residence_2 == - Collectivite(Collectivite_Code.Mayotte, Unit())) and - ((date_courante_3 >= date_of_numbers(2016, 1, 1)) and - (date_courante_3 <= - date_of_numbers(2016, 12, 31))))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) > - integer_of_string("1")): - return (bmaf_dot_montant * - decimal_of_string("0.2613")) - else: - return money_of_cents_string("0") - else: - raise EmptyError - - def temp_montant_initial_base_deuxieme_enfant_8(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=380, start_column=5, - end_line=380, end_column=69, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte"]), ((residence_2 == - Collectivite(Collectivite_Code.Mayotte, Unit())) and - ((date_courante_3 >= date_of_numbers(2017, 1, 1)) and - (date_courante_3 <= - date_of_numbers(2017, 12, 31))))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) > - integer_of_string("1")): - return (bmaf_dot_montant * - decimal_of_string("0.2672")) - else: - return money_of_cents_string("0") - else: - raise EmptyError - - def temp_montant_initial_base_deuxieme_enfant_9(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=387, start_column=5, - end_line=387, end_column=69, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte"]), ((residence_2 == - Collectivite(Collectivite_Code.Mayotte, Unit())) and - ((date_courante_3 >= date_of_numbers(2018, 1, 1)) and - (date_courante_3 <= - date_of_numbers(2018, 12, 31))))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) > - integer_of_string("1")): - return (bmaf_dot_montant * - decimal_of_string("0.2804")) - else: - return money_of_cents_string("0") - else: - raise EmptyError - - def temp_montant_initial_base_deuxieme_enfant_10(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=394, start_column=5, - end_line=394, end_column=69, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte"]), ((residence_2 == - Collectivite(Collectivite_Code.Mayotte, Unit())) and - ((date_courante_3 >= date_of_numbers(2019, 1, 1)) and - (date_courante_3 <= - date_of_numbers(2019, 12, 31))))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) > - integer_of_string("1")): - return (bmaf_dot_montant * - decimal_of_string("0.2936")) - else: - return money_of_cents_string("0") - else: - raise EmptyError - - def temp_montant_initial_base_deuxieme_enfant_11(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=401, start_column=5, - end_line=401, end_column=69, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte"]), ((residence_2 == - Collectivite(Collectivite_Code.Mayotte, Unit())) and - ((date_courante_3 >= date_of_numbers(2020, 1, 1)) and - (date_courante_3 <= - date_of_numbers(2020, 12, 31))))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) > - integer_of_string("1")): - return (bmaf_dot_montant * + return (bmaf_dot_montant * decimal_of_string("0.3068")) + else: + return money_of_cents_string("0") else: - return money_of_cents_string("0") - else: - raise EmptyError - temp_montant_initial_base_deuxieme_enfant_12 = handle_default( - [temp_montant_initial_base_deuxieme_enfant_11, - temp_montant_initial_base_deuxieme_enfant_10, - temp_montant_initial_base_deuxieme_enfant_9, - temp_montant_initial_base_deuxieme_enfant_8, - temp_montant_initial_base_deuxieme_enfant_7, - temp_montant_initial_base_deuxieme_enfant_6, - temp_montant_initial_base_deuxieme_enfant_5, - temp_montant_initial_base_deuxieme_enfant_4, - temp_montant_initial_base_deuxieme_enfant_3, - temp_montant_initial_base_deuxieme_enfant_2], - temp_montant_initial_base_deuxieme_enfant_1, - temp_montant_initial_base_deuxieme_enfant) - except EmptyError: - def temp_montant_initial_base_deuxieme_enfant_13(_: Any): - raise EmptyError - - def temp_montant_initial_base_deuxieme_enfant_14(_: Any): - return False - - def temp_montant_initial_base_deuxieme_enfant_15(_: Any): - if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=117, start_column=14, - end_line=117, end_column=50, - law_headings=["Article D521-1", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), (ressources_menage > - plafond__i_i_d521_3)): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) > + raise EmptyError + def temp_montant_initial_base_deuxieme_enfant_3(_:Any): + if ((residence_2 == + Collectivite(Collectivite_Code.Mayotte, Unit())) and + ((date_courante_3 >= date_of_numbers(2019,1,1)) and + (date_courante_3 <= + date_of_numbers(2019,12,31)))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) > integer_of_string("1")): + return (bmaf_dot_montant * + decimal_of_string("0.2936")) + else: + return money_of_cents_string("0") + else: + raise EmptyError + def temp_montant_initial_base_deuxieme_enfant_4(_:Any): + if ((residence_2 == + Collectivite(Collectivite_Code.Mayotte, Unit())) and + ((date_courante_3 >= date_of_numbers(2018,1,1)) and + (date_courante_3 <= + date_of_numbers(2018,12,31)))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) > + integer_of_string("1")): + return (bmaf_dot_montant * + decimal_of_string("0.2804")) + else: + return money_of_cents_string("0") + else: + raise EmptyError + def temp_montant_initial_base_deuxieme_enfant_5(_:Any): + if ((residence_2 == + Collectivite(Collectivite_Code.Mayotte, Unit())) and + ((date_courante_3 >= date_of_numbers(2017,1,1)) and + (date_courante_3 <= + date_of_numbers(2017,12,31)))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) > + integer_of_string("1")): + return (bmaf_dot_montant * + decimal_of_string("0.2672")) + else: + return money_of_cents_string("0") + else: + raise EmptyError + def temp_montant_initial_base_deuxieme_enfant_6(_:Any): + if ((residence_2 == + Collectivite(Collectivite_Code.Mayotte, Unit())) and + ((date_courante_3 >= date_of_numbers(2016,1,1)) and + (date_courante_3 <= + date_of_numbers(2016,12,31)))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) > + integer_of_string("1")): + return (bmaf_dot_montant * + decimal_of_string("0.2613")) + else: + return money_of_cents_string("0") + else: + raise EmptyError + def temp_montant_initial_base_deuxieme_enfant_7(_:Any): + if ((residence_2 == + Collectivite(Collectivite_Code.Mayotte, Unit())) and + ((date_courante_3 >= date_of_numbers(2015,1,1)) and + (date_courante_3 <= + date_of_numbers(2015,12,31)))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) > + integer_of_string("1")): + return (bmaf_dot_montant * + decimal_of_string("0.2555")) + else: + return money_of_cents_string("0") + else: + raise EmptyError + def temp_montant_initial_base_deuxieme_enfant_8(_:Any): + if ((residence_2 == + Collectivite(Collectivite_Code.Mayotte, Unit())) and + ((date_courante_3 >= date_of_numbers(2014,1,1)) and + (date_courante_3 <= + date_of_numbers(2014,12,31)))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) > + integer_of_string("1")): + return (bmaf_dot_montant * + decimal_of_string("0.2496")) + else: + return money_of_cents_string("0") + else: + raise EmptyError + def temp_montant_initial_base_deuxieme_enfant_9(_:Any): + if ((residence_2 == + Collectivite(Collectivite_Code.Mayotte, Unit())) and + ((date_courante_3 >= date_of_numbers(2013,1,1)) and + (date_courante_3 <= + date_of_numbers(2013,12,31)))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) > + integer_of_string("1")): + return (bmaf_dot_montant * + decimal_of_string("0.2437")) + else: + return money_of_cents_string("0") + else: + raise EmptyError + def temp_montant_initial_base_deuxieme_enfant_10(_:Any): + if ((residence_2 == + Collectivite(Collectivite_Code.Mayotte, Unit())) and + ((date_courante_3 >= date_of_numbers(2012,1,1)) and + (date_courante_3 <= + date_of_numbers(2012,12,31)))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) > + integer_of_string("1")): + return (bmaf_dot_montant * + decimal_of_string("0.2379")) + else: + return money_of_cents_string("0") + else: + raise EmptyError + def temp_montant_initial_base_deuxieme_enfant_11(_:Any): + if ((residence_2 == + Collectivite(Collectivite_Code.Mayotte, Unit())) and + ((date_courante_3 >= date_of_numbers(2011,1,1)) and + (date_courante_3 <= + date_of_numbers(2011,12,31)))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) > + integer_of_string("1")): + return (bmaf_dot_montant * + decimal_of_string("0.232")) + else: + return money_of_cents_string("0") + else: + raise EmptyError + temp_montant_initial_base_deuxieme_enfant_12 = handle_default( + SourcePosition(filename="examples/allocations_familiales/prologue.catala_fr", + start_line=107, start_column=11, + end_line=107, end_column=47, + law_headings=["Allocations familiales", + "Champs d'applications", + "Prologue"]), [temp_montant_initial_base_deuxieme_enfant_11, + temp_montant_initial_base_deuxieme_enfant_10, + temp_montant_initial_base_deuxieme_enfant_9, + temp_montant_initial_base_deuxieme_enfant_8, + temp_montant_initial_base_deuxieme_enfant_7, + temp_montant_initial_base_deuxieme_enfant_6, + temp_montant_initial_base_deuxieme_enfant_5, + temp_montant_initial_base_deuxieme_enfant_4, + temp_montant_initial_base_deuxieme_enfant_3, + temp_montant_initial_base_deuxieme_enfant_2], + temp_montant_initial_base_deuxieme_enfant_1, + temp_montant_initial_base_deuxieme_enfant) + except EmptyError: + if (residence_2 == Collectivite(Collectivite_Code.Mayotte, + Unit())): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) > + integer_of_string("1")): + temp_montant_initial_base_deuxieme_enfant_12 = (bmaf_dot_montant * + decimal_of_string("0.32")) + else: + temp_montant_initial_base_deuxieme_enfant_12 = money_of_cents_string("0") + else: + temp_montant_initial_base_deuxieme_enfant_12 = dead_value + raise EmptyError + except EmptyError: + def temp_montant_initial_base_deuxieme_enfant_13(_:Any): + raise EmptyError + def temp_montant_initial_base_deuxieme_enfant_14(_:Any): + return False + def temp_montant_initial_base_deuxieme_enfant_15(_:Any): + if (ressources_menage > + plafond__i_i_d521_3): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) > + integer_of_string("1")): return (bmaf_dot_montant * decimal_of_string("0.08")) else: return money_of_cents_string("0") else: raise EmptyError - - def temp_montant_initial_base_deuxieme_enfant_16(_: Any): - if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=79, start_column=14, - end_line=79, end_column=50, - law_headings=["Article D521-1", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), ((ressources_menage > - plafond__i_d521_3) and (ressources_menage <= - plafond__i_i_d521_3))): + def temp_montant_initial_base_deuxieme_enfant_16(_:Any): + if ((ressources_menage > plafond__i_d521_3) and + (ressources_menage <= + plafond__i_i_d521_3)): if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) > - integer_of_string("1")): + integer_of_string("1")): return (bmaf_dot_montant * decimal_of_string("0.16")) else: return money_of_cents_string("0") else: raise EmptyError - - def temp_montant_initial_base_deuxieme_enfant_17(_: Any): - if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=38, start_column=14, - end_line=38, end_column=50, - law_headings=["Article D521-1", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), (ressources_menage <= - plafond__i_d521_3)): + def temp_montant_initial_base_deuxieme_enfant_17(_:Any): + if (ressources_menage <= + plafond__i_d521_3): if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) > - integer_of_string("1")): + integer_of_string("1")): return (bmaf_dot_montant * decimal_of_string("0.32")) else: return money_of_cents_string("0") else: raise EmptyError temp_montant_initial_base_deuxieme_enfant_12 = handle_default( - [temp_montant_initial_base_deuxieme_enfant_17, - temp_montant_initial_base_deuxieme_enfant_16, - temp_montant_initial_base_deuxieme_enfant_15], + SourcePosition(filename="examples/allocations_familiales/prologue.catala_fr", + start_line=107, start_column=11, end_line=107, end_column=47, + law_headings=["Allocations familiales", + "Champs d'applications", + "Prologue"]), [temp_montant_initial_base_deuxieme_enfant_17, + temp_montant_initial_base_deuxieme_enfant_16, + temp_montant_initial_base_deuxieme_enfant_15], temp_montant_initial_base_deuxieme_enfant_14, temp_montant_initial_base_deuxieme_enfant_13) except EmptyError: - raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", + temp_montant_initial_base_deuxieme_enfant_12 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/allocations_familiales/prologue.catala_fr", start_line=107, start_column=11, end_line=107, end_column=47, law_headings=["Allocations familiales", - "Champs d'applications", - "Prologue"])) - montant_initial_base_deuxieme_enfant = log_variable_definition(["AllocationsFamiliales", - "montant_initial_base_deuxième_enfant"], - temp_montant_initial_base_deuxieme_enfant_12) + "Champs d'applications", + "Prologue"])) + montant_initial_base_deuxieme_enfant = temp_montant_initial_base_deuxieme_enfant_12 try: if (nombre_total_enfants == - decimal_of_string("0.")): + decimal_of_string("0.")): temp_rapport_enfants_total_moyen = decimal_of_string("0.") else: temp_rapport_enfants_total_moyen = (nombre_moyen_enfants / - nombre_total_enfants) + nombre_total_enfants) except EmptyError: - raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", + temp_rapport_enfants_total_moyen = dead_value + raise NoValueProvided(SourcePosition(filename="examples/allocations_familiales/prologue.catala_fr", start_line=109, start_column=11, end_line=109, end_column=38, law_headings=["Allocations familiales", - "Champs d'applications", - "Prologue"])) - rapport_enfants_total_moyen = log_variable_definition(["AllocationsFamiliales", - "rapport_enfants_total_moyen"], temp_rapport_enfants_total_moyen) + "Champs d'applications", + "Prologue"])) + rapport_enfants_total_moyen = temp_rapport_enfants_total_moyen try: - def temp_montant_initial_metropole_majoration(param_9: Enfant): + def temp_montant_initial_metropole_majoration(param_9:Enfant): try: - def temp_montant_initial_metropole_majoration_1(_: Any): + def temp_montant_initial_metropole_majoration_1(_:Any): raise EmptyError - - def temp_montant_initial_metropole_majoration_2(_: Any): - return True - - def temp_montant_initial_metropole_majoration_3(_: Any): - if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=60, start_column=5, - end_line=60, end_column=38, - law_headings=["Article D521-1", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), ((ressources_menage <= - plafond__i_d521_3) and - log_end_call(["AllocationsFamiliales", - "droit_ouvert_majoration"], - log_variable_definition(["AllocationsFamiliales", - "droit_ouvert_majoration", "output"], - log_begin_call(["AllocationsFamiliales", - "droit_ouvert_majoration"], droit_ouvert_majoration, - log_variable_definition(["AllocationsFamiliales", - "droit_ouvert_majoration", "input"], - param_9)))))): - return (bmaf_dot_montant * decimal_of_string("0.16")) - else: - raise EmptyError - - def temp_montant_initial_metropole_majoration_4(_: Any): - if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=101, start_column=5, - end_line=101, end_column=38, - law_headings=["Article D521-1", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), (((ressources_menage > - plafond__i_d521_3) and (ressources_menage <= - plafond__i_i_d521_3)) and - log_end_call(["AllocationsFamiliales", - "droit_ouvert_majoration"], - log_variable_definition(["AllocationsFamiliales", - "droit_ouvert_majoration", "output"], - log_begin_call(["AllocationsFamiliales", - "droit_ouvert_majoration"], droit_ouvert_majoration, - log_variable_definition(["AllocationsFamiliales", - "droit_ouvert_majoration", "input"], - param_9)))))): - return (bmaf_dot_montant * decimal_of_string("0.08")) - else: - raise EmptyError - - def temp_montant_initial_metropole_majoration_5(_: Any): - if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=138, start_column=5, - end_line=138, end_column=38, - law_headings=["Article D521-1", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), ((ressources_menage > - plafond__i_i_d521_3) and - log_end_call(["AllocationsFamiliales", - "droit_ouvert_majoration"], - log_variable_definition(["AllocationsFamiliales", - "droit_ouvert_majoration", "output"], - log_begin_call(["AllocationsFamiliales", - "droit_ouvert_majoration"], droit_ouvert_majoration, - log_variable_definition(["AllocationsFamiliales", - "droit_ouvert_majoration", "input"], - param_9)))))): - return (bmaf_dot_montant * decimal_of_string("0.04")) - else: - raise EmptyError - - def temp_montant_initial_metropole_majoration_6(_: Any): - if log_decision_taken(SourcePosition(filename="./epilogue.catala_fr", - start_line=28, start_column=5, - end_line=28, end_column=44, - law_headings=["Règles diverses", "Épilogue", - "Dispositions spéciales relatives à Mayotte"]), not log_end_call(["AllocationsFamiliales", - "droit_ouvert_majoration"], - log_variable_definition(["AllocationsFamiliales", - "droit_ouvert_majoration", "output"], - log_begin_call(["AllocationsFamiliales", - "droit_ouvert_majoration"], droit_ouvert_majoration, - log_variable_definition(["AllocationsFamiliales", - "droit_ouvert_majoration", "input"], - param_9))))): + def temp_montant_initial_metropole_majoration_2(_:Any): + return False + def temp_montant_initial_metropole_majoration_3(_:Any): + if not droit_ouvert_majoration(param_9): return money_of_cents_string("0") else: raise EmptyError - return handle_default([temp_montant_initial_metropole_majoration_6, + def temp_montant_initial_metropole_majoration_4(_:Any): + if ((ressources_menage > plafond__i_i_d521_3) and + droit_ouvert_majoration(param_9)): + return (bmaf_dot_montant * decimal_of_string("0.04")) + else: + raise EmptyError + def temp_montant_initial_metropole_majoration_5(_:Any): + if (((ressources_menage > plafond__i_d521_3) and + (ressources_menage <= plafond__i_i_d521_3)) and + droit_ouvert_majoration(param_9)): + return (bmaf_dot_montant * decimal_of_string("0.08")) + else: + raise EmptyError + def temp_montant_initial_metropole_majoration_6(_:Any): + if ((ressources_menage <= plafond__i_d521_3) and + droit_ouvert_majoration(param_9)): + return (bmaf_dot_montant * decimal_of_string("0.16")) + else: + raise EmptyError + return handle_default(SourcePosition(filename="examples/allocations_familiales/prologue.catala_fr", + start_line=127, start_column=11, + end_line=127, end_column=47, + law_headings=["Allocations familiales", + "Champs d'applications", + "Prologue"]), [temp_montant_initial_metropole_majoration_6, temp_montant_initial_metropole_majoration_5, temp_montant_initial_metropole_majoration_4, temp_montant_initial_metropole_majoration_3], temp_montant_initial_metropole_majoration_2, temp_montant_initial_metropole_majoration_1) except EmptyError: - raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", + raise NoValueProvided(SourcePosition(filename="examples/allocations_familiales/prologue.catala_fr", start_line=127, start_column=11, end_line=127, end_column=47, law_headings=["Allocations familiales", - "Champs d'applications", - "Prologue"])) + "Champs d'applications", + "Prologue"])) except EmptyError: - raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", + temp_montant_initial_metropole_majoration = dead_value + raise NoValueProvided(SourcePosition(filename="examples/allocations_familiales/prologue.catala_fr", start_line=127, start_column=11, end_line=127, end_column=47, law_headings=["Allocations familiales", - "Champs d'applications", - "Prologue"])) - montant_initial_metropole_majoration = log_variable_definition(["AllocationsFamiliales", - "montant_initial_métropole_majoration"], - temp_montant_initial_metropole_majoration) + "Champs d'applications", + "Prologue"])) + montant_initial_metropole_majoration = temp_montant_initial_metropole_majoration try: - def temp_montant_verse_forfaitaire(acc_2: Integer, enfant_2: Any): - if log_end_call(["AllocationsFamiliales", - "droit_ouvert_forfaitaire"], - log_variable_definition(["AllocationsFamiliales", - "droit_ouvert_forfaitaire", "output"], - log_begin_call(["AllocationsFamiliales", - "droit_ouvert_forfaitaire"], droit_ouvert_forfaitaire, - log_variable_definition(["AllocationsFamiliales", - "droit_ouvert_forfaitaire", "input"], - enfant_2)))): + def temp_montant_verse_forfaitaire(acc_2:Integer, enfant_2:Any): + if droit_ouvert_forfaitaire(enfant_2): return (acc_2 + integer_of_string("1")) else: return acc_2 temp_montant_verse_forfaitaire_1 = (montant_verse_forfaitaire_par_enfant * - decimal_of_integer(list_fold_left(temp_montant_verse_forfaitaire, - integer_of_string( - "0"), - enfants_a_charge))) + decimal_of_integer(list_fold_left(temp_montant_verse_forfaitaire, + integer_of_string("0"), + enfants_a_charge))) except EmptyError: - raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", + temp_montant_verse_forfaitaire_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/allocations_familiales/prologue.catala_fr", start_line=123, start_column=11, end_line=123, end_column=36, law_headings=["Allocations familiales", - "Champs d'applications", - "Prologue"])) - montant_verse_forfaitaire = log_variable_definition(["AllocationsFamiliales", - "montant_versé_forfaitaire"], temp_montant_verse_forfaitaire_1) + "Champs d'applications", + "Prologue"])) + montant_verse_forfaitaire = temp_montant_verse_forfaitaire_1 try: - def temp_montant_initial_base(_: Any): - return (montant_initial_base_deuxieme_enfant + - montant_initial_base_troisieme_enfant_et_plus) - - def temp_montant_initial_base_1(_: Any): - return True - - def temp_montant_initial_base_2(_: Any): - if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=353, start_column=5, end_line=354, end_column=69, - law_headings=["Article D755-5", - "Chapitre 5 : Prestations familiales et prestations assimilées", - "Titre 5 : Départements d'outre-mer", - "Livre 7 : Régimes divers - Dispositions diverses", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), (prestations_familiales_dot_regime_outre_mer_l751_1 and - (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) == - integer_of_string("1")))): - return montant_initial_base_premier_enfant - else: + try: + def temp_montant_initial_base(_:Any): raise EmptyError - - def temp_montant_initial_base_3(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=151, start_column=24, end_line=151, end_column=44, - law_headings=["Article 7", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte"]), (residence_2 == - Collectivite(Collectivite_Code.Mayotte, - Unit()))): - return (montant_initial_base_premier_enfant + - (montant_initial_base_deuxieme_enfant + - (montant_initial_base_troisieme_enfant_mayotte + - montant_initial_base_quatrieme_enfant_et_plus_mayotte))) - else: - raise EmptyError - temp_montant_initial_base_4 = handle_default([temp_montant_initial_base_3, - temp_montant_initial_base_2], - temp_montant_initial_base_1, - temp_montant_initial_base) + def temp_montant_initial_base_1(_:Any): + return False + def temp_montant_initial_base_2(_:Any): + if (residence_2 == Collectivite(Collectivite_Code.Mayotte, + Unit())): + return (((montant_initial_base_premier_enfant + + montant_initial_base_deuxieme_enfant) + + montant_initial_base_troisieme_enfant_mayotte) + + montant_initial_base_quatrieme_enfant_et_plus_mayotte) + else: + raise EmptyError + def temp_montant_initial_base_3(_:Any): + if (prestations_familiales_dot_regime_outre_mer_l751_1 and + (list_length(enfants_a_charge_droit_ouvert_prestation_familiale) == + integer_of_string("1"))): + return montant_initial_base_premier_enfant + else: + raise EmptyError + temp_montant_initial_base_4 = handle_default(SourcePosition(filename="examples/allocations_familiales/prologue.catala_fr", + start_line=105, + start_column=11, + end_line=105, end_column=31, + law_headings=["Allocations familiales", + "Champs d'applications", + "Prologue"]), [temp_montant_initial_base_3, + temp_montant_initial_base_2], + temp_montant_initial_base_1, + temp_montant_initial_base) + except EmptyError: + temp_montant_initial_base_4 = (montant_initial_base_deuxieme_enfant + + montant_initial_base_troisieme_enfant_et_plus) except EmptyError: - raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", + temp_montant_initial_base_4 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/allocations_familiales/prologue.catala_fr", start_line=105, start_column=11, end_line=105, end_column=31, law_headings=["Allocations familiales", - "Champs d'applications", - "Prologue"])) - montant_initial_base = log_variable_definition(["AllocationsFamiliales", - "montant_initial_base"], temp_montant_initial_base_4) + "Champs d'applications", + "Prologue"])) + montant_initial_base = temp_montant_initial_base_4 try: - def temp_montant_initial_majoration(param_10: Enfant): + def temp_montant_initial_majoration(param_10:Enfant): try: - def temp_montant_initial_majoration_1(_: Any): - return log_end_call(["AllocationsFamiliales", - "montant_initial_métropole_majoration"], - log_variable_definition(["AllocationsFamiliales", - "montant_initial_métropole_majoration", "output"], - log_begin_call(["AllocationsFamiliales", - "montant_initial_métropole_majoration"], - montant_initial_metropole_majoration, - log_variable_definition(["AllocationsFamiliales", - "montant_initial_métropole_majoration", "input"], - param_10)))) - - def temp_montant_initial_majoration_2(_: Any): - return True - - def temp_montant_initial_majoration_3(_: Any): - if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=376, start_column=5, - end_line=379, end_column=42, - law_headings=["Article D755-5", - "Chapitre 5 : Prestations familiales et prestations assimilées", - "Titre 5 : Départements d'outre-mer", - "Livre 7 : Régimes divers - Dispositions diverses", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), (log_end_call(["AllocationsFamiliales", - "droit_ouvert_majoration"], - log_variable_definition(["AllocationsFamiliales", - "droit_ouvert_majoration", "output"], - log_begin_call(["AllocationsFamiliales", - "droit_ouvert_majoration"], droit_ouvert_majoration, - log_variable_definition(["AllocationsFamiliales", - "droit_ouvert_majoration", "input"], param_10)))) and - (prestations_familiales_dot_regime_outre_mer_l751_1 and - ((list_length(enfants_a_charge_droit_ouvert_prestation_familiale) == - integer_of_string("1")) and ((param_10.age >= - integer_of_string("11")) and (param_10.age < - integer_of_string("16"))))))): - return (bmaf_dot_montant * - decimal_of_string("0.0369")) - else: + try: + def temp_montant_initial_majoration_1(_:Any): raise EmptyError - - def temp_montant_initial_majoration_4(_: Any): - if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=385, start_column=5, - end_line=388, end_column=23, - law_headings=["Article D755-5", - "Chapitre 5 : Prestations familiales et prestations assimilées", - "Titre 5 : Départements d'outre-mer", - "Livre 7 : Régimes divers - Dispositions diverses", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), (log_end_call(["AllocationsFamiliales", - "droit_ouvert_majoration"], - log_variable_definition(["AllocationsFamiliales", - "droit_ouvert_majoration", "output"], - log_begin_call(["AllocationsFamiliales", - "droit_ouvert_majoration"], droit_ouvert_majoration, - log_variable_definition(["AllocationsFamiliales", - "droit_ouvert_majoration", "input"], param_10)))) and - (prestations_familiales_dot_regime_outre_mer_l751_1 and - ((list_length(enfants_a_charge_droit_ouvert_prestation_familiale) == - integer_of_string("1")) and (param_10.age >= - integer_of_string("16")))))): - return (bmaf_dot_montant * + def temp_montant_initial_majoration_2(_:Any): + return False + def temp_montant_initial_majoration_3(_:Any): + if (droit_ouvert_majoration(param_10) and + (prestations_familiales_dot_regime_outre_mer_l751_1 and + ((list_length(enfants_a_charge_droit_ouvert_prestation_familiale) == + integer_of_string("1")) and (param_10.age >= + integer_of_string("16"))))): + return (bmaf_dot_montant * decimal_of_string("0.0567")) - else: - raise EmptyError - return handle_default([temp_montant_initial_majoration_4, - temp_montant_initial_majoration_3], - temp_montant_initial_majoration_2, - temp_montant_initial_majoration_1) + else: + raise EmptyError + def temp_montant_initial_majoration_4(_:Any): + if (droit_ouvert_majoration(param_10) and + (prestations_familiales_dot_regime_outre_mer_l751_1 and + ((list_length(enfants_a_charge_droit_ouvert_prestation_familiale) == + integer_of_string("1")) and ((param_10.age >= + integer_of_string("11")) and (param_10.age < + integer_of_string("16")))))): + return (bmaf_dot_montant * + decimal_of_string("0.0369")) + else: + raise EmptyError + return handle_default(SourcePosition(filename="examples/allocations_familiales/prologue.catala_fr", + start_line=128, start_column=11, + end_line=128, end_column=37, + law_headings=["Allocations familiales", + "Champs d'applications", + "Prologue"]), [temp_montant_initial_majoration_4, + temp_montant_initial_majoration_3], + temp_montant_initial_majoration_2, + temp_montant_initial_majoration_1) + except EmptyError: + return montant_initial_metropole_majoration(param_10) except EmptyError: - raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", + raise NoValueProvided(SourcePosition(filename="examples/allocations_familiales/prologue.catala_fr", start_line=128, start_column=11, end_line=128, end_column=37, law_headings=["Allocations familiales", - "Champs d'applications", - "Prologue"])) + "Champs d'applications", + "Prologue"])) except EmptyError: - raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", + temp_montant_initial_majoration = dead_value + raise NoValueProvided(SourcePosition(filename="examples/allocations_familiales/prologue.catala_fr", start_line=128, start_column=11, end_line=128, end_column=37, law_headings=["Allocations familiales", - "Champs d'applications", - "Prologue"])) - montant_initial_majoration = log_variable_definition(["AllocationsFamiliales", - "montant_initial_majoration"], temp_montant_initial_majoration) + "Champs d'applications", + "Prologue"])) + montant_initial_majoration = temp_montant_initial_majoration try: - def temp_montant_verse_complement_pour_forfaitaire(_: Any): - return money_of_cents_string("0") - - def temp_montant_verse_complement_pour_forfaitaire_1(_: Any): - return True - - def temp_montant_verse_complement_pour_forfaitaire_2(_: Any): - if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=265, start_column=5, end_line=267, end_column=42, - law_headings=["Article D521-2", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), ((ressources_menage > - plafond__i_d521_3) and (ressources_menage <= - (plafond__i_d521_3 + (montant_verse_forfaitaire * - decimal_of_string("12.")))))): - return ((plafond__i_d521_3 + ((montant_verse_forfaitaire * - decimal_of_string("12.")) - ressources_menage)) * + try: + try: + if ((ressources_menage > plafond__i_i_d521_3) and + (ressources_menage <= (plafond__i_i_d521_3 + + (montant_verse_forfaitaire * + decimal_of_string("12."))))): + temp_montant_verse_complement_pour_forfaitaire = (((plafond__i_i_d521_3 + + (montant_verse_forfaitaire * + decimal_of_string("12."))) - ressources_menage) * (decimal_of_string("1.") / decimal_of_string("12."))) - else: - raise EmptyError - - def temp_montant_verse_complement_pour_forfaitaire_3(_: Any): - if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=275, start_column=5, end_line=277, end_column=41, - law_headings=["Article D521-2", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), ((ressources_menage > - plafond__i_i_d521_3) and (ressources_menage <= - (plafond__i_i_d521_3 + (montant_verse_forfaitaire * - decimal_of_string("12.")))))): - return ((plafond__i_i_d521_3 + ((montant_verse_forfaitaire * - decimal_of_string("12.")) - ressources_menage)) * + else: + temp_montant_verse_complement_pour_forfaitaire = dead_value + raise EmptyError + except EmptyError: + if ((ressources_menage > plafond__i_d521_3) and + (ressources_menage <= (plafond__i_d521_3 + + (montant_verse_forfaitaire * + decimal_of_string("12."))))): + temp_montant_verse_complement_pour_forfaitaire = (((plafond__i_d521_3 + + (montant_verse_forfaitaire * + decimal_of_string("12."))) - ressources_menage) * (decimal_of_string("1.") / decimal_of_string("12."))) - else: - raise EmptyError - temp_montant_verse_complement_pour_forfaitaire_4 = handle_default( - [temp_montant_verse_complement_pour_forfaitaire_3, - temp_montant_verse_complement_pour_forfaitaire_2], - temp_montant_verse_complement_pour_forfaitaire_1, - temp_montant_verse_complement_pour_forfaitaire) + else: + temp_montant_verse_complement_pour_forfaitaire = dead_value + raise EmptyError + except EmptyError: + temp_montant_verse_complement_pour_forfaitaire = money_of_cents_string("0") except EmptyError: - raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", + temp_montant_verse_complement_pour_forfaitaire = dead_value + raise NoValueProvided(SourcePosition(filename="examples/allocations_familiales/prologue.catala_fr", start_line=137, start_column=11, end_line=137, end_column=52, law_headings=["Allocations familiales", - "Champs d'applications", - "Prologue"])) - montant_verse_complement_pour_forfaitaire = log_variable_definition(["AllocationsFamiliales", - "montant_versé_complément_pour_forfaitaire"], - temp_montant_verse_complement_pour_forfaitaire_4) + "Champs d'applications", + "Prologue"])) + montant_verse_complement_pour_forfaitaire = temp_montant_verse_complement_pour_forfaitaire try: temp_montant_avec_garde_alternee_base = (montant_initial_base * - rapport_enfants_total_moyen) + rapport_enfants_total_moyen) except EmptyError: - raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", + temp_montant_avec_garde_alternee_base = dead_value + raise NoValueProvided(SourcePosition(filename="examples/allocations_familiales/prologue.catala_fr", start_line=112, start_column=11, end_line=112, end_column=43, law_headings=["Allocations familiales", - "Champs d'applications", - "Prologue"])) - montant_avec_garde_alternee_base = log_variable_definition(["AllocationsFamiliales", - "montant_avec_garde_alternée_base"], - temp_montant_avec_garde_alternee_base) + "Champs d'applications", + "Prologue"])) + montant_avec_garde_alternee_base = temp_montant_avec_garde_alternee_base try: - def temp_montant_avec_garde_alternee_majoration(param_11: Enfant): + def temp_montant_avec_garde_alternee_majoration(param_11:Enfant): try: - match_arg_17 = log_end_call(["AllocationsFamiliales", - "prise_en_compte"], - log_variable_definition(["AllocationsFamiliales", - "prise_en_compte", "output"], - log_begin_call(["AllocationsFamiliales", "prise_en_compte"], - prise_en_compte, - log_variable_definition(["AllocationsFamiliales", - "prise_en_compte", "input"], - param_11)))) + match_arg_17 = prise_en_compte(param_11) if match_arg_17.code == PriseEnCompte_Code.Complete: _ = match_arg_17.value - temp_montant_avec_garde_alternee_majoration_1 = decimal_of_string( - "1.") + temp_montant_avec_garde_alternee_majoration_1 = decimal_of_string("1.") elif match_arg_17.code == PriseEnCompte_Code.Partagee: _ = match_arg_17.value - temp_montant_avec_garde_alternee_majoration_1 = decimal_of_string( - "0.5") + temp_montant_avec_garde_alternee_majoration_1 = decimal_of_string("0.5") elif match_arg_17.code == PriseEnCompte_Code.Zero: _ = match_arg_17.value - temp_montant_avec_garde_alternee_majoration_1 = decimal_of_string( - "0.") - return (log_end_call(["AllocationsFamiliales", - "montant_initial_majoration"], - log_variable_definition(["AllocationsFamiliales", - "montant_initial_majoration", "output"], - log_begin_call(["AllocationsFamiliales", - "montant_initial_majoration"], - montant_initial_majoration, - log_variable_definition(["AllocationsFamiliales", - "montant_initial_majoration", "input"], param_11)))) * - temp_montant_avec_garde_alternee_majoration_1) + temp_montant_avec_garde_alternee_majoration_1 = decimal_of_string("0.") + return (montant_initial_majoration(param_11) * + temp_montant_avec_garde_alternee_majoration_1) except EmptyError: - raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", + raise NoValueProvided(SourcePosition(filename="examples/allocations_familiales/prologue.catala_fr", start_line=129, start_column=11, end_line=129, end_column=49, law_headings=["Allocations familiales", - "Champs d'applications", - "Prologue"])) + "Champs d'applications", + "Prologue"])) except EmptyError: - raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", + temp_montant_avec_garde_alternee_majoration = dead_value + raise NoValueProvided(SourcePosition(filename="examples/allocations_familiales/prologue.catala_fr", start_line=129, start_column=11, end_line=129, end_column=49, law_headings=["Allocations familiales", - "Champs d'applications", - "Prologue"])) - montant_avec_garde_alternee_majoration = log_variable_definition(["AllocationsFamiliales", - "montant_avec_garde_alternée_majoration"], - temp_montant_avec_garde_alternee_majoration) + "Champs d'applications", + "Prologue"])) + montant_avec_garde_alternee_majoration = temp_montant_avec_garde_alternee_majoration try: if droit_ouvert_base: temp_montant_verse_base = montant_avec_garde_alternee_base else: temp_montant_verse_base = money_of_cents_string("0") except EmptyError: - raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", + temp_montant_verse_base = dead_value + raise NoValueProvided(SourcePosition(filename="examples/allocations_familiales/prologue.catala_fr", start_line=113, start_column=11, end_line=113, end_column=29, law_headings=["Allocations familiales", - "Champs d'applications", - "Prologue"])) - montant_verse_base = log_variable_definition(["AllocationsFamiliales", - "montant_versé_base"], temp_montant_verse_base) + "Champs d'applications", + "Prologue"])) + montant_verse_base = temp_montant_verse_base try: if droit_ouvert_base: - def temp_montant_verse_majoration(acc_3: Money, enfant_3: Any): - return (acc_3 + log_end_call(["AllocationsFamiliales", - "montant_avec_garde_alternée_majoration"], - log_variable_definition(["AllocationsFamiliales", - "montant_avec_garde_alternée_majoration", "output"], - log_begin_call(["AllocationsFamiliales", - "montant_avec_garde_alternée_majoration"], - montant_avec_garde_alternee_majoration, - log_variable_definition(["AllocationsFamiliales", - "montant_avec_garde_alternée_majoration", "input"], - enfant_3))))) + def temp_montant_verse_majoration(acc_3:Money, enfant_3:Any): + return (acc_3 + + montant_avec_garde_alternee_majoration(enfant_3)) temp_montant_verse_majoration_1 = list_fold_left(temp_montant_verse_majoration, - money_of_cents_string( - "0"), + money_of_cents_string("0"), enfants_a_charge) else: temp_montant_verse_majoration_1 = money_of_cents_string("0") except EmptyError: - raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", + temp_montant_verse_majoration_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/allocations_familiales/prologue.catala_fr", start_line=130, start_column=11, end_line=130, end_column=35, law_headings=["Allocations familiales", - "Champs d'applications", - "Prologue"])) - montant_verse_majoration = log_variable_definition(["AllocationsFamiliales", - "montant_versé_majoration"], temp_montant_verse_majoration_1) + "Champs d'applications", + "Prologue"])) + montant_verse_majoration = temp_montant_verse_majoration_1 try: temp_montant_base_complement_pour_base_et_majoration = (montant_verse_base + - montant_verse_majoration) + montant_verse_majoration) except EmptyError: - raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", + temp_montant_base_complement_pour_base_et_majoration = dead_value + raise NoValueProvided(SourcePosition(filename="examples/allocations_familiales/prologue.catala_fr", start_line=134, start_column=11, end_line=134, end_column=58, law_headings=["Allocations familiales", - "Champs d'applications", - "Prologue"])) - montant_base_complement_pour_base_et_majoration = log_variable_definition(["AllocationsFamiliales", - "montant_base_complément_pour_base_et_majoration"], - temp_montant_base_complement_pour_base_et_majoration) + "Champs d'applications", + "Prologue"])) + montant_base_complement_pour_base_et_majoration = temp_montant_base_complement_pour_base_et_majoration try: if droit_ouvert_complement: - temp_montant_verse_complement_pour_base_et_majoration = log_end_call(["AllocationsFamiliales", - "complément_dégressif"], - log_variable_definition(["AllocationsFamiliales", - "complément_dégressif", "output"], - log_begin_call(["AllocationsFamiliales", - "complément_dégressif"], complement_degressif, - log_variable_definition(["AllocationsFamiliales", - "complément_dégressif", "input"], - montant_base_complement_pour_base_et_majoration)))) + temp_montant_verse_complement_pour_base_et_majoration = complement_degressif( + montant_base_complement_pour_base_et_majoration) else: - temp_montant_verse_complement_pour_base_et_majoration = money_of_cents_string( - "0") + temp_montant_verse_complement_pour_base_et_majoration = money_of_cents_string("0") except EmptyError: - raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", + temp_montant_verse_complement_pour_base_et_majoration = dead_value + raise NoValueProvided(SourcePosition(filename="examples/allocations_familiales/prologue.catala_fr", start_line=136, start_column=11, end_line=136, end_column=59, law_headings=["Allocations familiales", - "Champs d'applications", - "Prologue"])) - montant_verse_complement_pour_base_et_majoration = log_variable_definition(["AllocationsFamiliales", - "montant_versé_complément_pour_base_et_majoration"], - temp_montant_verse_complement_pour_base_et_majoration) + "Champs d'applications", + "Prologue"])) + montant_verse_complement_pour_base_et_majoration = temp_montant_verse_complement_pour_base_et_majoration try: if droit_ouvert_base: - temp_montant_verse = (montant_verse_base + - (montant_verse_majoration + (montant_verse_forfaitaire + - (montant_verse_complement_pour_base_et_majoration + - montant_verse_complement_pour_forfaitaire)))) + temp_montant_verse = ((((montant_verse_base + + montant_verse_majoration) + montant_verse_forfaitaire) + + montant_verse_complement_pour_base_et_majoration) + + montant_verse_complement_pour_forfaitaire) else: temp_montant_verse = money_of_cents_string("0") except EmptyError: - raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", + temp_montant_verse = dead_value + raise NoValueProvided(SourcePosition(filename="examples/allocations_familiales/prologue.catala_fr", start_line=101, start_column=10, end_line=101, end_column=23, law_headings=["Allocations familiales", - "Champs d'applications", - "Prologue"])) - montant_verse = log_variable_definition(["AllocationsFamiliales", - "montant_versé"], temp_montant_verse) + "Champs d'applications", + "Prologue"])) + montant_verse = temp_montant_verse try: temp__ = (personne_charge_effective_permanente_est_parent or - (not personne_charge_effective_permanente_est_parent and - personne_charge_effective_permanente_remplit_titre__i)) + (not personne_charge_effective_permanente_est_parent and + personne_charge_effective_permanente_remplit_titre__i)) except EmptyError: - raise NoValueProvided(SourcePosition(filename="./securite_sociale_L.catala_fr", + temp__ = dead_value + raise NoValueProvided(SourcePosition(filename="examples/allocations_familiales/securite_sociale_L.catala_fr", start_line=230, start_column=5, end_line=234, end_column=6, law_headings=["Article L521-2", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie législative", + "Code de la sécurité sociale"])) + if not (temp__): + raise AssertionFailure(SourcePosition(filename="examples/allocations_familiales/securite_sociale_L.catala_fr", + start_line=230, start_column=5, + end_line=234, end_column=6, + law_headings=["Article L521-2", "Chapitre 1er : Allocations familiales", "Titre 2 : Prestations générales d'entretien", "Livre 5 : Prestations familiales et prestations assimilées", "Partie législative", "Code de la sécurité sociale"])) - assert temp__ - return AllocationsFamilialesOut(montant_verse_out=montant_verse) + return AllocationsFamilialesOut(montant_verse_out = montant_verse) - -def interface_allocations_familiales(interface_allocations_familiales_in: InterfaceAllocationsFamilialesIn): +def interface_allocations_familiales(interface_allocations_familiales_in:InterfaceAllocationsFamilialesIn): i_date_courante = interface_allocations_familiales_in.i_date_courante_in i_enfants = interface_allocations_familiales_in.i_enfants_in i_ressources_menage = interface_allocations_familiales_in.i_ressources_menage_in @@ -3650,173 +2934,156 @@ def interface_allocations_familiales(interface_allocations_familiales_in: Interf i_personne_charge_effective_permanente_remplit_titre__i = interface_allocations_familiales_in.i_personne_charge_effective_permanente_remplit_titre_I_in i_avait_enfant_a_charge_avant_1er_janvier_2012 = interface_allocations_familiales_in.i_avait_enfant_a_charge_avant_1er_janvier_2012_in try: - def temp_enfants_a_charge(enfant_4: Any): + def temp_enfants_a_charge(enfant_4:Any): if ((enfant_4.d_date_de_naissance + - duration_of_numbers(3, 0, 0)) >= - i_date_courante): + duration_of_numbers(3,0,0)) >= + i_date_courante): temp_enfants_a_charge_1 = SituationObligationScolaire(SituationObligationScolaire_Code.Avant, - Unit()) + Unit()) else: if ((enfant_4.d_date_de_naissance + - duration_of_numbers(16, 0, 0)) >= - i_date_courante): + duration_of_numbers(16,0,0)) >= + i_date_courante): temp_enfants_a_charge_1 = SituationObligationScolaire(SituationObligationScolaire_Code.Pendant, - Unit()) + Unit()) else: temp_enfants_a_charge_1 = SituationObligationScolaire(SituationObligationScolaire_Code.Apres, - Unit()) - return Enfant(identifiant=enfant_4.d_identifiant, - obligation_scolaire=temp_enfants_a_charge_1, - remuneration_mensuelle=enfant_4.d_remuneration_mensuelle, - date_de_naissance=enfant_4.d_date_de_naissance, - age=year_of_date((date_of_numbers(0, 1, 1) + - (i_date_courante - enfant_4.d_date_de_naissance))), - prise_en_charge=enfant_4.d_prise_en_charge, - a_deja_ouvert_droit_aux_allocations_familiales=enfant_4.d_a_deja_ouvert_droit_aux_allocations_familiales, - beneficie_titre_personnel_aide_personnelle_logement=enfant_4.d_beneficie_titre_personnel_aide_personnelle_logement) + Unit()) + return Enfant(identifiant = enfant_4.d_identifiant, + obligation_scolaire = temp_enfants_a_charge_1, + remuneration_mensuelle = enfant_4.d_remuneration_mensuelle, + date_de_naissance = enfant_4.d_date_de_naissance, + age = year_of_date((date_of_numbers(0,1,1) + + (i_date_courante - enfant_4.d_date_de_naissance))), + prise_en_charge = enfant_4.d_prise_en_charge, + a_deja_ouvert_droit_aux_allocations_familiales = enfant_4.d_a_deja_ouvert_droit_aux_allocations_familiales, + beneficie_titre_personnel_aide_personnelle_logement = enfant_4.d_beneficie_titre_personnel_aide_personnelle_logement) temp_enfants_a_charge_2 = list_map(temp_enfants_a_charge, i_enfants) except EmptyError: - raise NoValueProvided(SourcePosition(filename="./epilogue.catala_fr", + temp_enfants_a_charge_2 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/allocations_familiales/epilogue.catala_fr", start_line=76, start_column=11, end_line=76, end_column=27, law_headings=["Interface du programme", - "Épilogue", - "Dispositions spéciales relatives à Mayotte"])) - enfants_a_charge_1 = log_variable_definition(["InterfaceAllocationsFamiliales", - "enfants_à_charge"], temp_enfants_a_charge_2) + "Épilogue"])) + enfants_a_charge_1 = temp_enfants_a_charge_2 try: try: - if log_decision_taken(SourcePosition(filename="./epilogue.catala_fr", - start_line=93, start_column=18, end_line=93, end_column=67, - law_headings=["Interface du programme", "Épilogue", - "Dispositions spéciales relatives à Mayotte"]), i_personne_charge_effective_permanente_est_parent): + if i_personne_charge_effective_permanente_est_parent: temp_allocations_familiales_dot_personne_charge_effective_permanente_est_parent = True else: + temp_allocations_familiales_dot_personne_charge_effective_permanente_est_parent = dead_value raise EmptyError except EmptyError: temp_allocations_familiales_dot_personne_charge_effective_permanente_est_parent = False - temp_allocations_familiales_dot_personne_charge_effective_permanente_est_parent_1 = log_variable_definition(["InterfaceAllocationsFamiliales", - "allocations_familiales.personne_charge_effective_permanente_est_parent"], - temp_allocations_familiales_dot_personne_charge_effective_permanente_est_parent) + temp_allocations_familiales_dot_personne_charge_effective_permanente_est_parent_1 = temp_allocations_familiales_dot_personne_charge_effective_permanente_est_parent except EmptyError: - raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", + temp_allocations_familiales_dot_personne_charge_effective_permanente_est_parent_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/allocations_familiales/prologue.catala_fr", start_line=86, start_column=10, end_line=86, end_column=57, law_headings=["Allocations familiales", - "Champs d'applications", - "Prologue"])) + "Champs d'applications", + "Prologue"])) allocations_familiales_dot_personne_charge_effective_permanente_est_parent = temp_allocations_familiales_dot_personne_charge_effective_permanente_est_parent_1 try: try: - if log_decision_taken(SourcePosition(filename="./epilogue.catala_fr", - start_line=97, start_column=18, end_line=97, end_column=72, - law_headings=["Interface du programme", "Épilogue", - "Dispositions spéciales relatives à Mayotte"]), i_personne_charge_effective_permanente_remplit_titre__i): + if i_personne_charge_effective_permanente_remplit_titre__i: temp_allocations_familiales_dot_personne_charge_effective_permanente_remplit_titre__i = True else: + temp_allocations_familiales_dot_personne_charge_effective_permanente_remplit_titre__i = dead_value raise EmptyError except EmptyError: temp_allocations_familiales_dot_personne_charge_effective_permanente_remplit_titre__i = False - temp_allocations_familiales_dot_personne_charge_effective_permanente_remplit_titre__i_1 = log_variable_definition(["InterfaceAllocationsFamiliales", - "allocations_familiales.personne_charge_effective_permanente_remplit_titre_I"], - temp_allocations_familiales_dot_personne_charge_effective_permanente_remplit_titre__i) + temp_allocations_familiales_dot_personne_charge_effective_permanente_remplit_titre__i_1 = temp_allocations_familiales_dot_personne_charge_effective_permanente_remplit_titre__i except EmptyError: - raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", + temp_allocations_familiales_dot_personne_charge_effective_permanente_remplit_titre__i_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/allocations_familiales/prologue.catala_fr", start_line=87, start_column=10, end_line=87, end_column=62, law_headings=["Allocations familiales", - "Champs d'applications", - "Prologue"])) + "Champs d'applications", + "Prologue"])) allocations_familiales_dot_personne_charge_effective_permanente_remplit_titre__i = temp_allocations_familiales_dot_personne_charge_effective_permanente_remplit_titre__i_1 try: - temp_allocations_familiales_dot_ressources_menage = log_variable_definition(["InterfaceAllocationsFamiliales", - "allocations_familiales.ressources_ménage"], - i_ressources_menage) + temp_allocations_familiales_dot_ressources_menage = i_ressources_menage except EmptyError: - raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", + temp_allocations_familiales_dot_ressources_menage = dead_value + raise NoValueProvided(SourcePosition(filename="examples/allocations_familiales/prologue.catala_fr", start_line=88, start_column=10, end_line=88, end_column=27, law_headings=["Allocations familiales", - "Champs d'applications", - "Prologue"])) + "Champs d'applications", + "Prologue"])) allocations_familiales_dot_ressources_menage = temp_allocations_familiales_dot_ressources_menage try: - temp_allocations_familiales_dot_residence = log_variable_definition(["InterfaceAllocationsFamiliales", - "allocations_familiales.résidence"], i_residence) + temp_allocations_familiales_dot_residence = i_residence except EmptyError: - raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", + temp_allocations_familiales_dot_residence = dead_value + raise NoValueProvided(SourcePosition(filename="examples/allocations_familiales/prologue.catala_fr", start_line=89, start_column=10, end_line=89, end_column=19, law_headings=["Allocations familiales", - "Champs d'applications", - "Prologue"])) + "Champs d'applications", + "Prologue"])) allocations_familiales_dot_residence = temp_allocations_familiales_dot_residence try: - temp_allocations_familiales_dot_date_courante = log_variable_definition(["InterfaceAllocationsFamiliales", - "allocations_familiales.date_courante"], i_date_courante) + temp_allocations_familiales_dot_date_courante = i_date_courante except EmptyError: - raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", + temp_allocations_familiales_dot_date_courante = dead_value + raise NoValueProvided(SourcePosition(filename="examples/allocations_familiales/prologue.catala_fr", start_line=92, start_column=10, end_line=92, end_column=23, law_headings=["Allocations familiales", - "Champs d'applications", - "Prologue"])) + "Champs d'applications", + "Prologue"])) allocations_familiales_dot_date_courante = temp_allocations_familiales_dot_date_courante try: - temp_allocations_familiales_dot_enfants_a_charge = log_variable_definition(["InterfaceAllocationsFamiliales", - "allocations_familiales.enfants_à_charge"], enfants_a_charge_1) + temp_allocations_familiales_dot_enfants_a_charge = enfants_a_charge_1 except EmptyError: - raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", + temp_allocations_familiales_dot_enfants_a_charge = dead_value + raise NoValueProvided(SourcePosition(filename="examples/allocations_familiales/prologue.catala_fr", start_line=95, start_column=10, end_line=95, end_column=26, law_headings=["Allocations familiales", - "Champs d'applications", - "Prologue"])) + "Champs d'applications", + "Prologue"])) allocations_familiales_dot_enfants_a_charge = temp_allocations_familiales_dot_enfants_a_charge try: try: - if log_decision_taken(SourcePosition(filename="./epilogue.catala_fr", - start_line=101, start_column=18, end_line=101, end_column=64, - law_headings=["Interface du programme", "Épilogue", - "Dispositions spéciales relatives à Mayotte"]), i_avait_enfant_a_charge_avant_1er_janvier_2012): + if i_avait_enfant_a_charge_avant_1er_janvier_2012: temp_allocations_familiales_dot_avait_enfant_a_charge_avant_1er_janvier_2012 = True else: + temp_allocations_familiales_dot_avait_enfant_a_charge_avant_1er_janvier_2012 = dead_value raise EmptyError except EmptyError: temp_allocations_familiales_dot_avait_enfant_a_charge_avant_1er_janvier_2012 = False - temp_allocations_familiales_dot_avait_enfant_a_charge_avant_1er_janvier_2012_1 = log_variable_definition(["InterfaceAllocationsFamiliales", - "allocations_familiales.avait_enfant_à_charge_avant_1er_janvier_2012"], - temp_allocations_familiales_dot_avait_enfant_a_charge_avant_1er_janvier_2012) + temp_allocations_familiales_dot_avait_enfant_a_charge_avant_1er_janvier_2012_1 = temp_allocations_familiales_dot_avait_enfant_a_charge_avant_1er_janvier_2012 except EmptyError: - raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", + temp_allocations_familiales_dot_avait_enfant_a_charge_avant_1er_janvier_2012_1 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/allocations_familiales/prologue.catala_fr", start_line=116, start_column=10, end_line=116, end_column=54, law_headings=["Allocations familiales", - "Champs d'applications", - "Prologue"])) + "Champs d'applications", + "Prologue"])) allocations_familiales_dot_avait_enfant_a_charge_avant_1er_janvier_2012 = temp_allocations_familiales_dot_avait_enfant_a_charge_avant_1er_janvier_2012_1 - result_5 = log_end_call(["InterfaceAllocationsFamiliales", - "allocations_familiales", "AllocationsFamiliales"], - log_begin_call(["InterfaceAllocationsFamiliales", - "allocations_familiales", "AllocationsFamiliales"], - allocations_familiales, - AllocationsFamilialesIn(personne_charge_effective_permanente_est_parent_in=allocations_familiales_dot_personne_charge_effective_permanente_est_parent, - personne_charge_effective_permanente_remplit_titre_I_in=allocations_familiales_dot_personne_charge_effective_permanente_remplit_titre__i, - ressources_menage_in=allocations_familiales_dot_ressources_menage, - residence_in=allocations_familiales_dot_residence, - date_courante_in=allocations_familiales_dot_date_courante, - enfants_a_charge_in=allocations_familiales_dot_enfants_a_charge, - avait_enfant_a_charge_avant_1er_janvier_2012_in=allocations_familiales_dot_avait_enfant_a_charge_avant_1er_janvier_2012))) + result_5 = allocations_familiales(AllocationsFamilialesIn(personne_charge_effective_permanente_est_parent_in = allocations_familiales_dot_personne_charge_effective_permanente_est_parent, + personne_charge_effective_permanente_remplit_titre_I_in = allocations_familiales_dot_personne_charge_effective_permanente_remplit_titre__i, + ressources_menage_in = allocations_familiales_dot_ressources_menage, + residence_in = allocations_familiales_dot_residence, + date_courante_in = allocations_familiales_dot_date_courante, + enfants_a_charge_in = allocations_familiales_dot_enfants_a_charge, + avait_enfant_a_charge_avant_1er_janvier_2012_in = allocations_familiales_dot_avait_enfant_a_charge_avant_1er_janvier_2012)) allocations_familiales_dot_montant_verse = result_5.montant_verse_out try: temp_i_montant_verse = allocations_familiales_dot_montant_verse except EmptyError: - raise NoValueProvided(SourcePosition(filename="./epilogue.catala_fr", + temp_i_montant_verse = dead_value + raise NoValueProvided(SourcePosition(filename="examples/allocations_familiales/epilogue.catala_fr", start_line=80, start_column=10, end_line=80, end_column=25, law_headings=["Interface du programme", - "Épilogue", - "Dispositions spéciales relatives à Mayotte"])) - i_montant_verse = log_variable_definition(["InterfaceAllocationsFamiliales", - "i_montant_versé"], temp_i_montant_verse) - return InterfaceAllocationsFamilialesOut(i_montant_verse_out=i_montant_verse) + "Épilogue"])) + i_montant_verse = temp_i_montant_verse + return InterfaceAllocationsFamilialesOut(i_montant_verse_out = i_montant_verse) \ No newline at end of file diff --git a/french_law/python/src/dune b/french_law/python/src/dune new file mode 100644 index 00000000..4566223a --- /dev/null +++ b/french_law/python/src/dune @@ -0,0 +1,17 @@ +(rule + (target runtime.py) + (mode promote) + (action + (copy ../../../runtimes/python/catala/src/catala/%{target} %{target}))) + +(rule + (target allocations_familiales.py) + (mode promote) + (action + (copy ../../../examples/allocations_familiales/%{target} %{target}))) + +(rule + (target aides_logement.py) + (mode promote) + (action + (copy ../../../examples/aides_logement/%{target} %{target}))) diff --git a/french_law/python/src/runtime.py b/french_law/python/src/runtime.py new file mode 100644 index 00000000..056998bb --- /dev/null +++ b/french_law/python/src/runtime.py @@ -0,0 +1,681 @@ +""" +.. module:: catala_runtime + :platform: Unix, Windows + :synopsis: The Python bindings for the functions used in the generated Catala code + :noindex: + +.. moduleauthor:: Denis Merigoux +""" + +# This file should be in sync with compiler/runtime.{ml, mli} ! + +from this import d +from gmpy2 import log2, mpz, mpq, mpfr, t_divmod, f_div, sign # type: ignore +import datetime +import calendar +import dateutil.relativedelta +from typing import NewType, List, Callable, Tuple, Optional, TypeVar, Iterable, Union, Any +from functools import reduce +from enum import Enum +import copy + +Alpha = TypeVar('Alpha') +Beta = TypeVar('Beta') + +# ============ +# Type classes +# ============ + + +class Integer: + def __init__(self, value: Union[str, int]) -> None: + self.value = mpz(value) + + def __add__(self, other: 'Integer') -> 'Integer': + return Integer(self.value + other.value) + + def __sub__(self, other: 'Integer') -> 'Integer': + return Integer(self.value - other.value) + + def __mul__(self, other: 'Integer') -> 'Integer': + return Integer(self.value * other.value) + + def __truediv__(self, other: 'Integer') -> 'Integer': + return Integer(self.value // other.value) + + def __neg__(self: 'Integer') -> 'Integer': + return Integer(- self.value) + + def __lt__(self, other: 'Integer') -> bool: + return self.value < other.value + + def __le__(self, other: 'Integer') -> bool: + return self.value <= other.value + + def __gt__(self, other: 'Integer') -> bool: + return self.value > other.value + + def __ge__(self, other: 'Integer') -> bool: + return self.value >= other.value + + def __ne__(self, other: object) -> bool: + if isinstance(other, Integer): + return self.value != other.value + else: + return True + + def __eq__(self, other: object) -> bool: + if isinstance(other, Integer): + return self.value == other.value + else: + return False + + def __str__(self) -> str: + return self.value.__str__() + + def __repr__(self) -> str: + return f"Integer({self.value.__repr__()})" + + +class Decimal: + def __init__(self, value: Union[str, int, float]) -> None: + self.value = mpq(value) + + def __add__(self, other: 'Decimal') -> 'Decimal': + return Decimal(self.value + other.value) + + def __sub__(self, other: 'Decimal') -> 'Decimal': + return Decimal(self.value - other.value) + + def __mul__(self, other: 'Decimal') -> 'Decimal': + return Decimal(self.value * other.value) + + def __truediv__(self, other: 'Decimal') -> 'Decimal': + return Decimal(self.value / other.value) + + def __neg__(self: 'Decimal') -> 'Decimal': + return Decimal(- self.value) + + def __lt__(self, other: 'Decimal') -> bool: + return self.value < other.value + + def __le__(self, other: 'Decimal') -> bool: + return self.value <= other.value + + def __gt__(self, other: 'Decimal') -> bool: + return self.value > other.value + + def __ge__(self, other: 'Decimal') -> bool: + return self.value >= other.value + + def __ne__(self, other: object) -> bool: + if isinstance(other, Decimal): + return self.value != other.value + else: + return True + + def __eq__(self, other: object) -> bool: + if isinstance(other, Decimal): + return self.value == other.value + else: + return False + + def __str__(self) -> str: + return "{}".format(mpfr(self.value)) + + def __repr__(self) -> str: + return f"Decimal({self.value.__repr__()})" + + +class Money: + def __init__(self, value: Integer) -> None: + self.value = value + + def __add__(self, other: 'Money') -> 'Money': + return Money(self.value + other.value) + + def __sub__(self, other: 'Money') -> 'Money': + return Money(self.value - other.value) + + def __mul__(self, other: Decimal) -> 'Money': + cents = self.value.value + coeff = other.value + # TODO: change, does not work with negative values. Must divide the + # absolute values and then multiply by the resulting sign. + rat_result = self.value.value * other.value + out = Money(Integer(rat_result)) + res, remainder = t_divmod(rat_result.numerator, rat_result.denominator) + if 2 * remainder >= rat_result.denominator: + return Money(Integer(res + 1)) + else: + return Money(Integer(res)) + + def __truediv__(self, other: 'Money') -> Decimal: + return Decimal(mpq(self.value.value / other.value.value)) + + def __neg__(self: 'Money') -> 'Money': + return Money(- self.value) + + def __lt__(self, other: 'Money') -> bool: + return self.value < other.value + + def __le__(self, other: 'Money') -> bool: + return self.value <= other.value + + def __gt__(self, other: 'Money') -> bool: + return self.value > other.value + + def __ge__(self, other: 'Money') -> bool: + return self.value >= other.value + + def __ne__(self, other: object) -> bool: + if isinstance(other, Money): + return self.value != other.value + else: + return True + + def __eq__(self, other: object) -> bool: + if isinstance(other, Money): + return self.value == other.value + else: + return False + + def __str__(self) -> str: + return "${:.2}".format(self.value.value / 100) + + def __repr__(self) -> str: + return f"Money({self.value.__repr__()})" + + +class Date: + def __init__(self, value: datetime.date) -> None: + self.value = value + + def __add__(self, other: 'Duration') -> 'Date': + return Date(self.value + other.value) + + def __sub__(self, other: 'Date') -> 'Duration': + return Duration(dateutil.relativedelta.relativedelta(self.value, other.value)) + + def __lt__(self, other: 'Date') -> bool: + return self.value < other.value + + def __le__(self, other: 'Date') -> bool: + return self.value <= other.value + + def __gt__(self, other: 'Date') -> bool: + return self.value > other.value + + def __ge__(self, other: 'Date') -> bool: + return self.value >= other.value + + def __ne__(self, other: object) -> bool: + if isinstance(other, Date): + return self.value != other.value + else: + return True + + def __eq__(self, other: object) -> bool: + if isinstance(other, Date): + return self.value == other.value + else: + return False + + def __str__(self) -> str: + return self.value.__str__() + + def __repr__(self) -> str: + return f"Date({self.value.__repr__()})" + + +class Duration: + def __init__(self, value: dateutil.relativedelta.relativedelta) -> None: + self.value = value + + def __add__(self, other: 'Duration') -> 'Duration': + return Duration(self.value + other.value) + + def __sub__(self, other: 'Duration') -> 'Duration': + return Duration(self.value - other.value) + + def __neg__(self: 'Duration') -> 'Duration': + return Duration(- self.value) + + def __truediv__(self, other: 'Duration') -> Decimal: + x = self.value.normalized() + y = other.value.normalized() + if (x.years != 0 or y.years != 0 or x.months != 0 or y.months != 0): + raise Exception("Can only divide durations expressed in days") + else: + return Decimal(x.days / y.days) + + def __mul__(self: 'Duration', rhs: Integer) -> 'Duration': + return Duration( + dateutil.relativedelta.relativedelta(years=self.value.years * rhs.value, + months=self.value.months * rhs.value, + days=self.value.days * rhs.value)) + + def __lt__(self, other: 'Duration') -> bool: + x = self.value.normalized() + y = other.value.normalized() + if (x.years != 0 or y.years != 0 or x.months != 0 or y.months != 0): + raise Exception("Can only compare durations expressed in days") + else: + return x.days < y.days + + def __le__(self, other: 'Duration') -> bool: + x = self.value.normalized() + y = other.value.normalized() + if (x.years != 0 or y.years != 0 or x.months != 0 or y.months != 0): + raise Exception("Can only compare durations expressed in days") + else: + return x.days <= y.days + + def __gt__(self, other: 'Duration') -> bool: + x = self.value.normalized() + y = other.value.normalized() + if (x.years != 0 or y.years != 0 or x.months != 0 or y.months != 0): + raise Exception("Can only compare durations expressed in days") + else: + return x.days > y.days + + def __ge__(self, other: 'Duration') -> bool: + x = self.value.normalized() + y = other.value.normalized() + if (x.years != 0 or y.years != 0 or x.months != 0 or y.months != 0): + raise Exception("Can only compare durations expressed in days") + else: + return x.days >= y.days + + def __ne__(self, other: object) -> bool: + if isinstance(other, Duration): + return self.value != other.value + else: + return True + + def __eq__(self, other: object) -> bool: + if isinstance(other, Duration): + return self.value == other.value + else: + return False + + def __str__(self) -> str: + return self.value.__str__() + + def __repr__(self) -> str: + return f"Duration({self.value.__repr__()})" + + +class Unit: + def __init__(self) -> None: + ... + + def __eq__(self, other: object) -> bool: + if isinstance(other, Unit): + return True + else: + return False + + def __ne__(self, other: object) -> bool: + if isinstance(other, Unit): + return False + else: + return True + + def __str__(self) -> str: + return "()" + + def __repr__(self) -> str: + return "Unit()" + + +class SourcePosition: + def __init__(self, + filename: str, + start_line: int, + start_column: int, + end_line: int, + end_column: int, + law_headings: List[str]) -> None: + self.filename = filename + self.start_line = start_line + self.start_column = start_column + self.end_line = end_line + self.end_column = end_column + self.law_headings = law_headings + + def __str__(self) -> str: + return "in file {}, from {}:{} to {}:{}".format( + self.filename, self.start_line, self.start_column, self.end_line, self.end_column) + +# ========== +# Exceptions +# ========== + + +class EmptyError(Exception): + pass + + +class AssertionFailed(Exception): + def __init__(self, source_position: SourcePosition) -> None: + self.source_position = SourcePosition + + +class ConflictError(Exception): + def __init__(self, source_position: SourcePosition) -> None: + self.source_position = SourcePosition + + +class NoValueProvided(Exception): + def __init__(self, source_position: SourcePosition) -> None: + self.source_position = SourcePosition + + +class AssertionFailure(Exception): + def __init__(self, source_position: SourcePosition) -> None: + self.source_position = SourcePosition + + +# ============================ +# Constructors and conversions +# ============================ + +# ----- +# Money +# ----- + + +def money_of_cents_string(v: str) -> Money: + return Money(Integer(v)) + + +def money_of_units_int(v: int) -> Money: + return Money(Integer(v) * Integer(100)) + + +def money_of_cents_integer(v: Integer) -> Money: + return Money(v) + + +def money_to_float(m: Money) -> float: + return float(mpfr(mpq(m.value.value, 100))) + + +def money_to_string(m: Money) -> str: + return str(money_to_float(m)) + + +def money_to_cents(m: Money) -> Integer: + return m.value + + +def money_round(m: Money) -> Money: + res, remainder = t_divmod(m, 100) + if remainder < 50: + return res * 100 + else: + return (res + sign(res)) * 100 + + +def money_of_decimal(m: Decimal) -> Money: + """ + Warning: rounds to nearest cent. + """ + return Money(mpz(m.value)) + +# -------- +# Decimals +# -------- + + +def decimal_of_string(d: str) -> Decimal: + return Decimal(d) + + +def decimal_to_float(d: Decimal) -> float: + return float(mpfr(d.value)) + + +def decimal_of_float(d: float) -> Decimal: + return Decimal(d) + + +def decimal_of_integer(d: Integer) -> Decimal: + return Decimal(d.value) + + +def decimal_to_string(precision: int, i: Decimal) -> str: + return "{1:.{0}}".format(precision, mpfr(i.value, precision * 10 // 2)) + + +def decimal_round(q: Decimal) -> Decimal: + # Implements the workaround by + # https://gmplib.org/list-archives/gmp-discuss/2009-May/003767.html *) + return f_div(2*q.numerator + q.denominator, 2*q.denominator) # type:ignore + + +def decimal_of_money(m: Money) -> Decimal: + return Decimal(f_div(mpq(m.value), mpq(100))) + +# -------- +# Integers +# -------- + + +def integer_of_string(s: str) -> Integer: + return Integer(s) + + +def integer_to_string(d: Integer) -> str: + return str(d.value) + + +def integer_of_int(d: int) -> Integer: + return Integer(d) + + +def integer_to_int(d: Integer) -> int: + return int(d.value) + + +def integer_exponentiation(i: Integer, e: int) -> Integer: + return i ** e # type: ignore + + +def integer_log2(i: Integer) -> int: + return int(log2(i.value)) + +# ----- +# Dates +# ----- + + +def day_of_month_of_date(d: Date) -> Integer: + return integer_of_int(d.value.day) + + +def month_number_of_date(d: Date) -> Integer: + return integer_of_int(d.value.month) + + +def year_of_date(d: Date) -> Integer: + return integer_of_int(d.value.year) + + +def date_to_string(d: Date) -> str: + return "{}".format(d.value) + + +def date_of_numbers(year: int, month: int, day: int) -> Date: + # The datetime.date does not take year=0 as an entry, we trick it into + # 1 in that case because year=0 cases don't care about the actual year + return Date(datetime.date(year if year != 0 else 1, month, day)) + + +def date_of_datetime(d: datetime.date) -> Date: + return Date(d) + + +def first_day_of_month(d: Date) -> Date: + return Date(datetime.date(d.value.year, d.value.month, 1)) + + +def last_day_of_month(d: Date) -> Date: + return Date(datetime.date(d.value.year, d.value.month, calendar.monthrange(d.value.year, d.value.month)[1])) + +# --------- +# Durations +# --------- + + +def duration_of_numbers(years: int, months: int, days: int) -> Duration: + return Duration(dateutil.relativedelta.relativedelta(years=years, months=months, days=days)) + + +def duration_to_years_months_days(d: Duration) -> Tuple[int, int, int]: + return (d.value.years, d.value.months, d.value.days) # type: ignore + + +def duration_to_string(s: Duration) -> str: + return "{}".format(s.value) + +# ----- +# Lists +# ----- + + +def list_fold_left(f: Callable[[Alpha, Beta], Alpha], init: Alpha, l: List[Beta]) -> Alpha: + return reduce(f, l, init) + + +def list_filter(f: Callable[[Alpha], bool], l: List[Alpha]) -> List[Alpha]: + return [i for i in l if f(i)] + + +def list_map(f: Callable[[Alpha], Beta], l: List[Alpha]) -> List[Beta]: + return [f(i) for i in l] + + +def list_length(l: List[Alpha]) -> Integer: + return Integer(len(l)) + +# ======== +# Defaults +# ======== + + +def handle_default( + pos: SourcePosition, + exceptions: List[Callable[[Unit], Alpha]], + just: Callable[[Unit], Alpha], + cons: Callable[[Unit], Alpha] +) -> Alpha: + acc: Optional[Alpha] = None + for exception in exceptions: + new_val: Optional[Alpha] + try: + new_val = exception(Unit()) + except EmptyError: + new_val = None + if acc is None: + acc = new_val + elif not (acc is None) and new_val is None: + pass # acc stays the same + elif not (acc is None) and not (new_val is None): + raise ConflictError(pos) + if acc is None: + if just(Unit()): + return cons(Unit()) + else: + raise EmptyError + else: + return acc + + +def handle_default_opt( + pos: SourcePosition, + exceptions: List[Optional[Any]], + just: Optional[bool], + cons: Optional[Alpha] +) -> Optional[Alpha]: + acc: Optional[Alpha] = None + for exception in exceptions: + if acc is None: + acc = exception + elif not (acc is None) and exception is None: + pass # acc stays the same + elif not (acc is None) and not (exception is None): + raise ConflictError(pos) + if acc is None: + if just is None: + return None + else: + if just: + return cons + else: + return None + else: + return acc + + +def no_input() -> Callable[[Unit], Alpha]: + def closure(_: Unit): + raise EmptyError + return closure + + +# This value is used for the Python code generation to trump mypy and forcing +# it to accept dead code. Indeed, when raising an exception during a variable +# definition, mypy complains that the later dead code will not know what +# this variable was. So we give this variable a dead value. +dead_value: Any = 0 + +# ======= +# Logging +# ======= + + +class LogEventCode(Enum): + VariableDefinition = 0 + BeginCall = 1 + EndCall = 2 + DecisionTaken = 3 + + +class LogEvent: + def __init__(self, code: LogEventCode, payload: Union[List[str], SourcePosition, Tuple[List[str], Alpha]]) -> None: + self.code = code + self.payload = payload + + +log: List[LogEvent] = [] + + +def reset_log(): + log = [] + + +def retrieve_log() -> List[LogEvent]: + return log + + +def log_variable_definition(headings: List[str], value: Alpha) -> Alpha: + log.append(LogEvent(LogEventCode.VariableDefinition, + (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)) + return f(value) + + +def log_end_call(headings: List[str], value: Alpha) -> Alpha: + log.append(LogEvent(LogEventCode.EndCall, headings)) + return value + + +def log_decision_taken(pos: SourcePosition, value: bool) -> bool: + log.append(LogEvent(LogEventCode.DecisionTaken, pos)) + return value diff --git a/generate_website_assets.sh b/generate_website_assets.sh index ae8091fa..ab632a99 100755 --- a/generate_website_assets.sh +++ b/generate_website_assets.sh @@ -1,35 +1,29 @@ -#! /usr/bin/env bash +#! /usr/bin/env sh + +set -eux cd "$(dirname "$0")" -if [[ $1 == "" ]]; then - echo "USAGE: $1 DST where DST is the directory in which files have to be copied" +if [ $# -ne 1 ]; then + echo "USAGE: \$1 DST where DST is the directory in which files have to be copied" exit 1 fi -rsync -a _build/default/_doc/_html/ $1/ocaml_docs/ -scp examples/allocations_familiales/allocations_familiales.html $1/ -scp examples/aides_logement/aides_logement.html $1/ -scp examples/us_tax_code/us_tax_code.html $1/ -scp examples/tutorial_en/tutorial_en.html $1/ -scp examples/tutoriel_fr/tutoriel_fr.html $1/ -scp grammar.html $1/ -scp catala.html $1/ -scp _build/default/compiler/catala_web_interpreter.bc.js $1/playground/ -scp examples/tutorial_en/tutorial_en.catala_en $1/playground/ -scp examples/tutoriel_fr/tutoriel_fr.catala_fr $1/playground/ -cat examples/allocations_familiales/prologue.catala_fr > allocations_familiales.catala_fr -cat examples/allocations_familiales/decrets_divers.catala_fr >> allocations_familiales.catala_fr -cat examples/allocations_familiales/securite_sociale_L.catala_fr >> allocations_familiales.catala_fr -cat examples/allocations_familiales/securite_sociale_R.catala_fr >> allocations_familiales.catala_fr -cat examples/allocations_familiales/securite_sociale_D.catala_fr >> allocations_familiales.catala_fr -cat examples/allocations_familiales/epilogue.catala_fr >> allocations_familiales.catala_fr -cat examples/allocations_familiales/tests/tests_allocations_familiales.catala_fr >> allocations_familiales.catala_fr -sed -r '/^> Inclusion.+$/d' allocations_familiales.catala_fr > allocations_familiales_fixed.catala_fr -mv -f allocations_familiales_fixed.catala_fr allocations_familiales.catala_fr -scp allocations_familiales.catala_fr $1/playground/ -rm allocations_familiales.catala_fr -scp syntax_highlighting/en/ace/mode-catala_en.js $1/playground/ -scp syntax_highlighting/fr/ace/mode-catala_fr.js $1/playground/ -# TODO: Polish ACE syntax highlighting -scp french_law/js/french_law.js $1/french_law.js +mkdir -p $1/playground + +BUILD=_build/default + +rsync -a $BUILD/_doc/_html/ $1/ocaml_docs/ + +rsync $BUILD/examples/allocations_familiales/allocations_familiales.html $1/ +rsync $BUILD/examples/aides_logement/aides_logement.html $1/ +rsync $BUILD/examples/us_tax_code/us_tax_code.html $1/ +rsync $BUILD/examples/tutorial_en/tutorial_en.html $1/ +rsync $BUILD/examples/tutoriel_fr/tutoriel_fr.html $1/ + +rsync $BUILD/grammar.html $1/ +rsync $BUILD/catala.html $1/ + +rsync $BUILD/french_law/js/french_law.js $1/french_law.js +rsync $BUILD/examples/allocations_familiales/allocations_familiales_schema.json $1/ +rsync $BUILD/examples/aides_logement/aides_logement_schema.json $1/ diff --git a/runtimes/dune b/runtimes/dune new file mode 100644 index 00000000..4c37f5e7 --- /dev/null +++ b/runtimes/dune @@ -0,0 +1,2 @@ +(documentation + (package catala)) diff --git a/runtimes/jsoo/dune b/runtimes/jsoo/dune new file mode 100644 index 00000000..0cf5f2ef --- /dev/null +++ b/runtimes/jsoo/dune @@ -0,0 +1,7 @@ +(library + (name runtime_jsoo) + (public_name catala.runtime_jsoo) + (preprocess + (pps js_of_ocaml-ppx)) + (libraries catala.runtime_ocaml js_of_ocaml) + (modules runtime)) diff --git a/runtimes/jsoo/runtime.ml b/runtimes/jsoo/runtime.ml new file mode 100644 index 00000000..adf3b748 --- /dev/null +++ b/runtimes/jsoo/runtime.ml @@ -0,0 +1,185 @@ +(* This file is part of the Catala compiler, a specification language for tax + and social benefits computation rules. Copyright (C) 2020 Inria, contributor: + Emile Rolley . + + Licensed under the Apache License, Version 2.0 (the "License"); you may not + use this file except in compliance with the License. You may obtain a copy of + the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + License for the specific language governing permissions and limitations under + the License. *) + +open Js_of_ocaml +module R_ocaml = Runtime_ocaml.Runtime + +class type source_position = + object + method fileName : Js.js_string Js.t Js.prop + method startLine : int Js.prop + method endLine : int Js.prop + method startColumn : int Js.prop + method endColumn : int Js.prop + method lawHeadings : Js.js_string Js.t Js.js_array Js.t Js.prop + end + +class type raw_event = + object + 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 loggedValueJson : Js.js_string Js.t Js.prop + end + +class type event = + object + method data : Js.js_string Js.t Js.prop + end + +class type duration = + object + method years : int Js.readonly_prop + method months : int Js.readonly_prop + method days : int Js.readonly_prop + end + +let duration_of_jsoo d = + R_ocaml.duration_of_numbers d##.years d##.months d##.days + +let duration_to_jsoo d = + let years, months, days = R_ocaml.duration_to_years_months_days d in + object%js + val years = years + val months = months + val days = days + end + +let date_of_jsoo d = + let d = Js.to_string d in + let d = + if String.contains d 'T' then d |> String.split_on_char 'T' |> List.hd + else d + in + match String.split_on_char '-' d with + | [year; month; day] -> + R_ocaml.date_of_numbers (int_of_string year) (int_of_string month) + (int_of_string day) + | _ -> failwith "date_of_jsoo: invalid date" + +let date_to_jsoo d = Js.string @@ R_ocaml.date_to_string d + +class type event_manager = + object + method resetLog : (unit, unit) Js.meth_callback Js.meth + + method retrieveEvents : + (unit, event Js.t Js.js_array Js.t) Js.meth_callback Js.meth + + method retrieveRawEvents : + (unit, raw_event Js.t Js.js_array Js.t) Js.meth_callback Js.meth + end + +let event_manager : event_manager Js.t = + object%js + method resetLog = Js.wrap_meth_callback R_ocaml.reset_log + + method retrieveEvents = + Js.wrap_meth_callback (fun () -> + Js.array + (Array.of_list + (R_ocaml.retrieve_log () + |> R_ocaml.EventParser.parse_raw_events + |> List.map (fun event -> + object%js + val mutable data = + event + |> R_ocaml.yojson_of_event + |> Yojson.Safe.to_string + |> Js.string + end)))) + + method retrieveRawEvents = + Js.wrap_meth_callback (fun () -> + Js.array + (Array.of_list + (List.map + (fun evt -> + object%js + val mutable eventType = + Js.string + (match evt with + | R_ocaml.BeginCall _ -> "Begin call" + | EndCall _ -> "End call" + | VariableDefinition _ -> "Variable definition" + | DecisionTaken _ -> "Decision taken") + + val mutable information = + Js.array + (Array.of_list + (match evt with + | BeginCall info + | EndCall info + | VariableDefinition (info, _) -> + List.map Js.string info + | DecisionTaken _ -> [])) + + val mutable loggedValueJson = + (match evt with + | VariableDefinition (_, v) -> v + | EndCall _ | BeginCall _ | DecisionTaken _ -> + R_ocaml.unembeddable ()) + |> R_ocaml.yojson_of_runtime_value + |> Yojson.Safe.to_string + |> Js.string + + val mutable sourcePosition = + match evt with + | DecisionTaken pos -> + Js.def + (object%js + val mutable fileName = Js.string pos.filename + val mutable startLine = pos.start_line + val mutable endLine = pos.end_line + val mutable startColumn = pos.start_column + val mutable endColumn = pos.end_column + + val mutable lawHeadings = + Js.array + (Array.of_list + (List.map Js.string pos.law_headings)) + end) + | _ -> Js.undefined + end) + (R_ocaml.retrieve_log ())))) + end + +let execute_or_throw_error f = + let throw_error (descr : string) (pos : R_ocaml.source_position) = + let msg = + Js.string + (Format.asprintf "%s in file %s, position %d:%d--%d:%d." descr + pos.filename pos.start_line pos.start_column pos.end_line + pos.end_column) + in + Js.Js_error.raise_ + (Js.Js_error.of_error + (object%js + val mutable name = Js.string "NoValueProvided" + val mutable message = msg + val mutable stack = Js.Optdef.empty + method toString = msg + end)) + in + try f () with + | R_ocaml.NoValueProvided pos -> + throw_error + "No rule applies in the given context to give a value to the variable" pos + | R_ocaml.ConflictError pos -> + throw_error + "A conflict happend between two rules giving a value to the variable" pos + | R_ocaml.AssertionFailed pos -> + throw_error "A failure happened in the assertion" pos diff --git a/runtimes/jsoo/runtime.mli b/runtimes/jsoo/runtime.mli new file mode 100644 index 00000000..ff33a43c --- /dev/null +++ b/runtimes/jsoo/runtime.mli @@ -0,0 +1,122 @@ +(* This file is part of the Catala compiler, a specification language for tax + and social benefits computation rules. Copyright (C) 2020 Inria, contributor: + Emile Rolley . + + Licensed under the Apache License, Version 2.0 (the "License"); you may not + use this file except in compliance with the License. You may obtain a copy of + the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + License for the specific language governing permissions and limitations under + the License. *) + +(** A {{:http://ocsigen.org/js_of_ocaml/latest/manual/overview} js_of_ocaml} + wrapper around the {!module: Runtime_ocaml.Runtime}. *) + +open Js_of_ocaml + +(** {1 Log events} *) + +(** Information about the position of the log inside the Catala source file. *) +class type source_position = + object + method fileName : Js.js_string Js.t Js.prop + method startLine : int Js.prop + method endLine : int Js.prop + method startColumn : int Js.prop + method endColumn : int Js.prop + method lawHeadings : Js.js_string Js.t Js.js_array Js.t Js.prop + end + +(** Wrapper for the {!type: Runtime_ocaml.Runtime.raw_event} -- directly + collected during the program execution.*) +class type raw_event = + object + method eventType : Js.js_string Js.t Js.prop + (** There is four type of raw log events: + + - 'BeginCall' is emitted when a function or a subscope is called. + - 'EndCall' is emitted when a function or a subscope is exited. + - 'VariableDefinition' is emitted when a variable or a function is + defined. + - 'DecisionTaken' stores the information about the source position of + the event. *) + + method information : Js.js_string Js.t Js.js_array Js.t Js.prop + (** Represents information about a name in the code -- i.e. variable name, + subscope name, etc... + + It's a list of strings with a length varying from 2 to 3, where: + + - the first string is the name of the current scope -- starting with a + capitalized letter [Scope_name], + - the second string is either: the name of a scope variable or, the name + of a subscope input variable -- [a_subscope_var.input_var] + - the third string is either: a subscope name (starting with a + capitalized letter [Subscope_name] or, the [input] (resp. [output]) + string -- which corresponds to the input (resp. the output) of a + function. *) + + method sourcePosition : source_position Js.t Js.optdef Js.prop + + method loggedValueJson : Js.js_string Js.t Js.prop + (** Serialized [Runtime_ocaml.Runtime.runtime_value] corresponding to a + 'VariableDefinition' raw event.*) + end + +(** Wrapper for the {!type: Runtime_ocaml.Runtime.event} -- structured log event + parsed from the {!raw_event} ones.*) +class type event = + object + method data : Js.js_string Js.t Js.prop + (** Serialized [Runtime_ocaml.Runtime.event]. *) + end + +class type event_manager = + object + method resetLog : (unit, unit) Js.meth_callback Js.meth + + method retrieveEvents : + (unit, event Js.t Js.js_array Js.t) Js.meth_callback Js.meth + + method retrieveRawEvents : + (unit, raw_event Js.t Js.js_array Js.t) Js.meth_callback Js.meth + end + +val event_manager : event_manager Js.t +(** JS object usable to retrieve and reset log events. *) + +(** {1 Duration} *) + +(** Simple JSOO wrapper around {!type: Runtime_ocaml.Runtime.duration}.*) +class type duration = + object + method years : int Js.readonly_prop + method months : int Js.readonly_prop + method days : int Js.readonly_prop + end + +val duration_of_jsoo : duration Js.t -> Runtime_ocaml.Runtime.duration +val duration_to_jsoo : Runtime_ocaml.Runtime.duration -> duration Js.t + +(** {1 Date conversion} *) + +(** Date values are encoded to a string in the + {{:https://www.iso.org/iso-8601-date-and-time-format.html} ISO8601 format}: + 'YYYY-MM-DD'. *) + +val date_of_jsoo : Js.js_string Js.t -> Runtime_ocaml.Runtime.date +val date_to_jsoo : Runtime_ocaml.Runtime.date -> Js.js_string Js.t + +(** {1 Error management} *) + +val execute_or_throw_error : (unit -> 'a) -> 'a +(** [execute_or_throw_error f] calls [f ()] and propagates the + {!Runtime_ocaml.Runtime.NoValueProvided}, + {!Runtime_ocaml.Runtime.ConflictError} + {!Runtime_ocaml.Runtime.AssertionFailed} exceptions by raising a JS error if + needed.*) diff --git a/runtimes/ocaml/dune b/runtimes/ocaml/dune new file mode 100644 index 00000000..03c76b5c --- /dev/null +++ b/runtimes/ocaml/dune @@ -0,0 +1,7 @@ +(library + (name runtime_ocaml) + (public_name catala.runtime_ocaml) + (preprocess + (pps ppx_yojson_conv)) + (libraries dates_calc zarith zarith_stubs_js) + (modules runtime)) diff --git a/compiler/runtime.ml b/runtimes/ocaml/runtime.ml similarity index 94% rename from compiler/runtime.ml rename to runtimes/ocaml/runtime.ml index 838d2660..74b2e8ae 100644 --- a/compiler/runtime.ml +++ b/runtimes/ocaml/runtime.ml @@ -14,6 +14,7 @@ License for the specific language governing permissions and limitations under the License. *) +(* An integer number of cents *) type money = Z.t type integer = Z.t type decimal = Q.t @@ -32,8 +33,8 @@ type source_position = { [@@deriving yojson_of] exception EmptyError -exception AssertionFailed -exception ConflictError +exception AssertionFailed of source_position +exception ConflictError of source_position exception UncomparableDurations exception IndivisableDurations exception ImpossibleDate @@ -44,6 +45,9 @@ let money_of_units_int (units : int) : money = Z.(of_int units * of_int 100) let money_of_cents_integer (cents : integer) : money = cents let money_to_float (m : money) : float = Z.to_float m /. 100. +let money_of_decimal (d : decimal) : money = + Q.to_bigint (Q.mul d (Q.of_int 100)) + let money_to_string (m : money) : string = Format.asprintf "%.2f" Q.(to_float (of_bigint m / of_int 100)) @@ -104,6 +108,9 @@ let decimal_round (q : decimal) : decimal = let d = Q.den q in Q.of_bigint Z.(fdiv ((of_int 2 * n) + d) (of_int 2 * d)) +let decimal_of_money (m : money) : decimal = + Q.div (Q.of_bigint m) (Q.of_int 100) + let integer_of_string (s : string) : integer = Z.of_string s let integer_to_string (i : integer) : string = Z.to_string i let integer_to_int (i : integer) : int = Z.to_int i @@ -130,6 +137,16 @@ let date_of_numbers (year : int) (month : int) (day : int) : date = let date_to_string (d : date) : string = Format.asprintf "%a" Dates_calc.Dates.format_date d +(* let first_day_of_month (d : date) : date = + * date_of_numbers (CalendarLib.Date.year d) + * (CalendarLib.Date.int_of_month (CalendarLib.Date.month d)) + * 1 + * + * let last_day_of_month (d : date) : date = + * date_of_numbers (CalendarLib.Date.year d) + * (CalendarLib.Date.int_of_month (CalendarLib.Date.month d)) + * (CalendarLib.Date.days_in_month d) *) + let duration_of_numbers (year : int) (month : int) (day : int) : duration = Dates_calc.Dates.make_period ~years:year ~months:month ~days:day @@ -428,16 +445,19 @@ module EventParser = struct { pos = Some pos; name; value; fun_calls = Some fun_calls } ) | event :: _ -> failwith - ("Invalid function call ([ " ^ String.concat ", " infos - ^ " ]): expected variable definition (function output), found: " - ^ raw_event_to_string event ^ "[" + ("Invalid function call ([ " + ^ String.concat ", " infos + ^ " ]): expected variable definition (function output), found: " + ^ raw_event_to_string event + ^ "[" ^ (nb_raw_events - List.length rest + 1 |> string_of_int) ^ "]") | [] -> failwith - ("Invalid function call ([ " ^ String.concat ", " infos - ^ " ]): expected variable definition (function output), found: \ - end of tokens") + ("Invalid function call ([ " + ^ String.concat ", " infos + ^ " ]): expected variable definition (function output), found: \ + end of tokens") in parse_events { ctx with events = var_comp :: ctx.events; rest } @@ -500,8 +520,13 @@ module EventParser = struct end let handle_default : - 'a. (unit -> 'a) array -> (unit -> bool) -> (unit -> 'a) -> 'a = - fun exceptions just cons -> + 'a. + source_position -> + (unit -> 'a) array -> + (unit -> bool) -> + (unit -> 'a) -> + 'a = + fun pos exceptions just cons -> let except = Array.fold_left (fun acc except -> @@ -509,7 +534,7 @@ let handle_default : match acc, new_val with | None, _ -> new_val | Some _, None -> acc - | Some _, Some _ -> raise ConflictError) + | Some _, Some _ -> raise (ConflictError pos)) None exceptions in match except with @@ -517,6 +542,7 @@ let handle_default : | None -> if just () then cons () else raise EmptyError let handle_default_opt + (pos : source_position) (exceptions : 'a eoption array) (just : bool eoption) (cons : 'a eoption) : 'a eoption = @@ -526,7 +552,7 @@ let handle_default_opt match acc, except with | ENone _, _ -> except | ESome _, ENone _ -> acc - | ESome _, ESome _ -> raise ConflictError) + | ESome _, ESome _ -> raise (ConflictError pos)) (ENone ()) exceptions in match except with diff --git a/compiler/runtime.mli b/runtimes/ocaml/runtime.mli similarity index 94% rename from compiler/runtime.mli rename to runtimes/ocaml/runtime.mli index 99598359..d978f3bd 100644 --- a/compiler/runtime.mli +++ b/runtimes/ocaml/runtime.mli @@ -15,6 +15,8 @@ License for the specific language governing permissions and limitations under the License. *) +(** The OCaml runtime. *) + (** {1 Types} *) type money @@ -38,8 +40,8 @@ type 'a eoption = ENone of unit | ESome of 'a (** {1 Exceptions} *) exception EmptyError -exception AssertionFailed -exception ConflictError +exception AssertionFailed of source_position +exception ConflictError of source_position exception UncomparableDurations exception IndivisableDurations exception ImpossibleDate @@ -209,6 +211,10 @@ val pp_events : ?is_first_call:bool -> Format.formatter -> event list -> unit val money_of_cents_string : string -> money val money_of_units_int : int -> money + +val money_of_decimal : decimal -> money +(** Warning: rounds to nearest cent. *) + val money_of_cents_integer : integer -> money val money_to_float : money -> float val money_to_string : money -> string @@ -223,6 +229,7 @@ val decimal_of_integer : integer -> decimal val decimal_of_float : float -> decimal val decimal_to_float : decimal -> float val decimal_round : decimal -> decimal +val decimal_of_money : money -> decimal (**{2 Integers} *) @@ -245,20 +252,32 @@ val date_of_numbers : int -> int -> int -> date @raise ImpossibleDate *) +val first_day_of_month : date -> date +val last_day_of_month : date -> date + (**{2 Durations} *) val duration_of_numbers : int -> int -> int -> duration +(** Usage : [duration_of_numbers year mounth day]. *) + val duration_to_years_months_days : duration -> int * int * int +(**{2 Times} *) + val duration_to_string : duration -> string (**{1 Defaults} *) -val handle_default : (unit -> 'a) array -> (unit -> bool) -> (unit -> 'a) -> 'a +val handle_default : + source_position -> (unit -> 'a) array -> (unit -> bool) -> (unit -> 'a) -> 'a (** @raise EmptyError @raise ConflictError *) val handle_default_opt : - 'a eoption array -> bool eoption -> 'a eoption -> 'a eoption + source_position -> + 'a eoption array -> + bool eoption -> + 'a eoption -> + 'a eoption (** @raise ConflictError *) val no_input : unit -> 'a diff --git a/runtimes/python/catala/src/catala/runtime.py b/runtimes/python/catala/src/catala/runtime.py index ec634491..056998bb 100644 --- a/runtimes/python/catala/src/catala/runtime.py +++ b/runtimes/python/catala/src/catala/runtime.py @@ -9,8 +9,10 @@ # This file should be in sync with compiler/runtime.{ml, mli} ! +from this import d from gmpy2 import log2, mpz, mpq, mpfr, t_divmod, f_div, sign # type: ignore import datetime +import calendar import dateutil.relativedelta from typing import NewType, List, Callable, Tuple, Optional, TypeVar, Iterable, Union, Any from functools import reduce @@ -356,17 +358,25 @@ class EmptyError(Exception): class AssertionFailed(Exception): - pass + def __init__(self, source_position: SourcePosition) -> None: + self.source_position = SourcePosition class ConflictError(Exception): - pass + def __init__(self, source_position: SourcePosition) -> None: + self.source_position = SourcePosition class NoValueProvided(Exception): def __init__(self, source_position: SourcePosition) -> None: self.source_position = SourcePosition + +class AssertionFailure(Exception): + def __init__(self, source_position: SourcePosition) -> None: + self.source_position = SourcePosition + + # ============================ # Constructors and conversions # ============================ @@ -407,6 +417,13 @@ def money_round(m: Money) -> Money: else: return (res + sign(res)) * 100 + +def money_of_decimal(m: Decimal) -> Money: + """ + Warning: rounds to nearest cent. + """ + return Money(mpz(m.value)) + # -------- # Decimals # -------- @@ -437,6 +454,10 @@ def decimal_round(q: Decimal) -> Decimal: # https://gmplib.org/list-archives/gmp-discuss/2009-May/003767.html *) return f_div(2*q.numerator + q.denominator, 2*q.denominator) # type:ignore + +def decimal_of_money(m: Money) -> Decimal: + return Decimal(f_div(mpq(m.value), mpq(100))) + # -------- # Integers # -------- @@ -495,6 +516,14 @@ def date_of_numbers(year: int, month: int, day: int) -> Date: def date_of_datetime(d: datetime.date) -> Date: return Date(d) + +def first_day_of_month(d: Date) -> Date: + return Date(datetime.date(d.value.year, d.value.month, 1)) + + +def last_day_of_month(d: Date) -> Date: + return Date(datetime.date(d.value.year, d.value.month, calendar.monthrange(d.value.year, d.value.month)[1])) + # --------- # Durations # --------- @@ -537,6 +566,7 @@ def list_length(l: List[Alpha]) -> Integer: def handle_default( + pos: SourcePosition, exceptions: List[Callable[[Unit], Alpha]], just: Callable[[Unit], Alpha], cons: Callable[[Unit], Alpha] @@ -553,7 +583,7 @@ def handle_default( elif not (acc is None) and new_val is None: pass # acc stays the same elif not (acc is None) and not (new_val is None): - raise ConflictError + raise ConflictError(pos) if acc is None: if just(Unit()): return cons(Unit()) @@ -564,6 +594,7 @@ def handle_default( def handle_default_opt( + pos: SourcePosition, exceptions: List[Optional[Any]], just: Optional[bool], cons: Optional[Alpha] @@ -575,7 +606,7 @@ def handle_default_opt( elif not (acc is None) and exception is None: pass # acc stays the same elif not (acc is None) and not (exception is None): - raise ConflictError + raise ConflictError(pos) if acc is None: if just is None: return None @@ -593,6 +624,13 @@ def no_input() -> Callable[[Unit], Alpha]: raise EmptyError return closure + +# This value is used for the Python code generation to trump mypy and forcing +# it to accept dead code. Indeed, when raising an exception during a variable +# definition, mypy complains that the later dead code will not know what +# this variable was. So we give this variable a dead value. +dead_value: Any = 0 + # ======= # Logging # ======= diff --git a/syntax_highlighting/en/set_up_pygments.sh b/syntax_highlighting/en/set_up_pygments.sh index 2a660513..2980e469 100755 --- a/syntax_highlighting/en/set_up_pygments.sh +++ b/syntax_highlighting/en/set_up_pygments.sh @@ -1,4 +1,6 @@ -#! /usr/bin/env bash +#! /usr/bin/env sh + +set -eu cd "$(dirname "$0")" cd pygments && python3 setup.py develop --user diff --git a/syntax_highlighting/en/setup_atom.sh b/syntax_highlighting/en/setup_atom.sh index 885ac5a0..31dd24cc 100755 --- a/syntax_highlighting/en/setup_atom.sh +++ b/syntax_highlighting/en/setup_atom.sh @@ -1,4 +1,6 @@ -#! /usr/bin/env bash +#! /usr/bin/env sh + +set -eu FILE=~/.atom/packages/catala_en SCRIPT=`realpath $0` diff --git a/syntax_highlighting/en/setup_vscode.sh b/syntax_highlighting/en/setup_vscode.sh index a5f2ac32..16f87d59 100755 --- a/syntax_highlighting/en/setup_vscode.sh +++ b/syntax_highlighting/en/setup_vscode.sh @@ -1,4 +1,6 @@ -#! /usr/bin/env bash +#! /usr/bin/env sh + +set -eu FILE=~/.vscode/extensions/catala-en SCRIPT=`realpath $0` diff --git a/syntax_highlighting/fr/set_up_pygments.sh b/syntax_highlighting/fr/set_up_pygments.sh index 2a660513..ee40d124 100755 --- a/syntax_highlighting/fr/set_up_pygments.sh +++ b/syntax_highlighting/fr/set_up_pygments.sh @@ -1,4 +1,6 @@ -#! /usr/bin/env bash +#! /usr/bin/env sh + +set -ue cd "$(dirname "$0")" cd pygments && python3 setup.py develop --user diff --git a/syntax_highlighting/fr/setup_atom.sh b/syntax_highlighting/fr/setup_atom.sh index d3551f7d..fae88ec5 100755 --- a/syntax_highlighting/fr/setup_atom.sh +++ b/syntax_highlighting/fr/setup_atom.sh @@ -1,4 +1,6 @@ -#! /usr/bin/env bash +#! /usr/bin/env sh + +set -eu FILE=~/.atom/packages/catala_fr SCRIPT=`realpath $0` diff --git a/syntax_highlighting/fr/setup_vscode.sh b/syntax_highlighting/fr/setup_vscode.sh index 7302c5b8..8187cabf 100755 --- a/syntax_highlighting/fr/setup_vscode.sh +++ b/syntax_highlighting/fr/setup_vscode.sh @@ -1,4 +1,6 @@ -#! /usr/bin/env bash +#! /usr/bin/env sh + +set -eu FILE=~/.vscode/extensions/catala-fr SCRIPT=`realpath $0` diff --git a/syntax_highlighting/pl/set_up_pygments.sh b/syntax_highlighting/pl/set_up_pygments.sh index 2a660513..2980e469 100755 --- a/syntax_highlighting/pl/set_up_pygments.sh +++ b/syntax_highlighting/pl/set_up_pygments.sh @@ -1,4 +1,6 @@ -#! /usr/bin/env bash +#! /usr/bin/env sh + +set -eu cd "$(dirname "$0")" cd pygments && python3 setup.py develop --user diff --git a/syntax_highlighting/pl/setup_atom.sh b/syntax_highlighting/pl/setup_atom.sh index 4ab816f5..2d66b139 100755 --- a/syntax_highlighting/pl/setup_atom.sh +++ b/syntax_highlighting/pl/setup_atom.sh @@ -1,4 +1,6 @@ -#! /usr/bin/env bash +#! /usr/bin/env sh + +set -eu FILE=~/.atom/packages/catala_pl SCRIPT=`realpath $0` diff --git a/tests/test_arithmetic/bad/output/division_by_zero.catala_en.Dec.Interpret b/tests/test_arithmetic/bad/output/division_by_zero.catala_en.Dec.Interpret index bd71f22c..e19d4466 100644 --- a/tests/test_arithmetic/bad/output/division_by_zero.catala_en.Dec.Interpret +++ b/tests/test_arithmetic/bad/output/division_by_zero.catala_en.Dec.Interpret @@ -4,7 +4,7 @@ The division operator: --> tests/test_arithmetic/bad/division_by_zero.catala_en | 20 | definition i equals 1. /. 0. - | ^^ + | ^^^^^^^^ + `Division_by_zero` exception management +-+ with decimals diff --git a/tests/test_arithmetic/bad/output/division_by_zero.catala_en.Duration.Interpret b/tests/test_arithmetic/bad/output/division_by_zero.catala_en.Duration.Interpret index 67ec9f48..4af67774 100644 --- a/tests/test_arithmetic/bad/output/division_by_zero.catala_en.Duration.Interpret +++ b/tests/test_arithmetic/bad/output/division_by_zero.catala_en.Duration.Interpret @@ -4,7 +4,7 @@ The division operator: --> tests/test_arithmetic/bad/division_by_zero.catala_en | 40 | definition i equals 10 day /^ 0 day - | ^^ + | ^^^^^^^^^^^^^^^ + `Division_by_zero` exception management +-+ with duration diff --git a/tests/test_arithmetic/bad/output/division_by_zero.catala_en.Int.Interpret b/tests/test_arithmetic/bad/output/division_by_zero.catala_en.Int.Interpret index 6c68abb1..007f8562 100644 --- a/tests/test_arithmetic/bad/output/division_by_zero.catala_en.Int.Interpret +++ b/tests/test_arithmetic/bad/output/division_by_zero.catala_en.Int.Interpret @@ -4,7 +4,7 @@ The division operator: --> tests/test_arithmetic/bad/division_by_zero.catala_en | 10 | definition i equals 1 / 0 - | ^ + | ^^^^^ + `Division_by_zero` exception management +-+ with integers diff --git a/tests/test_arithmetic/bad/output/division_by_zero.catala_en.Money.Interpret b/tests/test_arithmetic/bad/output/division_by_zero.catala_en.Money.Interpret index 284580d4..1956ace6 100644 --- a/tests/test_arithmetic/bad/output/division_by_zero.catala_en.Money.Interpret +++ b/tests/test_arithmetic/bad/output/division_by_zero.catala_en.Money.Interpret @@ -4,7 +4,7 @@ The division operator: --> tests/test_arithmetic/bad/division_by_zero.catala_en | 30 | definition i equals $10.0 /$ $0.0 - | ^^ + | ^^^^^^^^^^^^^ + `Division_by_zero` exception management +-+ with money diff --git a/tests/test_array/good/simple.catala_en b/tests/test_array/good/simple.catala_en index 24a7317c..41fe9712 100644 --- a/tests/test_array/good/simple.catala_en +++ b/tests/test_array/good/simple.catala_en @@ -16,7 +16,7 @@ declaration scope B: scope B: definition v equals number of a.x - definition w equals 64 in a.x + definition w equals a.x contains 64 definition y equals exists m in a.x such that m = 9 definition z equals for all m in a.x we have m > 0 ``` diff --git a/tests/test_bool/good/output/test_bool.catala_en.Dcalc b/tests/test_bool/good/output/test_bool.catala_en.Dcalc index fdfcfe1b..813187f7 100644 --- a/tests/test_bool/good/output/test_bool.catala_en.Dcalc +++ b/tests/test_bool/good/output/test_bool.catala_en.Dcalc @@ -1,15 +1,15 @@ -let TestBool_13 : +let TestBool_14 : TestBool_in{"foo_in": unit → bool; "bar_in": unit → integer} → TestBool_out{"foo_out": bool; "bar_out": integer} = - λ (TestBool_in_14: TestBool_in{"foo_in": unit → bool; "bar_in": + λ (TestBool_in_15: TestBool_in{"foo_in": unit → bool; "bar_in": unit → integer}) → - let foo_15 : unit → bool = TestBool_in_14."foo_in" in - let bar_16 : unit → integer = TestBool_in_14."bar_in" in - let bar_17 : integer = error_empty - ⟨bar_16 () | true ⊢ ⟨⟨true ⊢ 1⟩ | false ⊢ ∅ ⟩⟩ in - let foo_18 : bool = error_empty - ⟨foo_15 () | true ⊢ - ⟨⟨bar_17 < 0 ⊢ false⟩, ⟨bar_17 >= 0 ⊢ true⟩ | false ⊢ + let foo_16 : unit → bool = TestBool_in_15."foo_in" in + let bar_17 : unit → integer = TestBool_in_15."bar_in" in + let bar_18 : integer = error_empty + ⟨bar_17 () | true ⊢ ⟨true ⊢ 1⟩⟩ in + let foo_19 : bool = error_empty + ⟨foo_16 () | true ⊢ + ⟨⟨bar_18 >= 0 ⊢ true⟩, ⟨bar_18 < 0 ⊢ false⟩ | false ⊢ ∅ ⟩⟩ in - TestBool_out {"foo_out"= foo_18; "bar_out"= bar_17} in -TestBool_13 + TestBool_out {"foo_out"= foo_19; "bar_out"= bar_18} in +TestBool_14 diff --git a/tests/test_bool/good/output/test_bool.catala_en.Scopelang b/tests/test_bool/good/output/test_bool.catala_en.Scopelang index 991ac8b1..03cb2fa3 100644 --- a/tests/test_bool/good/output/test_bool.catala_en.Scopelang +++ b/tests/test_bool/good/output/test_bool.catala_en.Scopelang @@ -1,5 +1,4 @@ let scope TestBool (foo: bool|context|output) (bar: integer|context|output) = - let bar : integer = reentrant or by default - ⟨⟨true ⊢ 1⟩ | false ⊢ ∅ ⟩; + let bar : integer = reentrant or by default ⟨true ⊢ 1⟩; let foo : bool = reentrant or by default - ⟨⟨bar < 0 ⊢ false⟩, ⟨bar >= 0 ⊢ true⟩ | false ⊢ ∅ ⟩ + ⟨⟨bar >= 0 ⊢ true⟩, ⟨bar < 0 ⊢ false⟩ | false ⊢ ∅ ⟩ diff --git a/tests/test_default/bad/output/conflict.catala_en.A.Interpret b/tests/test_default/bad/output/conflict.catala_en.A.Interpret index 9bfd4eb9..9d6ff533 100644 --- a/tests/test_default/bad/output/conflict.catala_en.A.Interpret +++ b/tests/test_default/bad/output/conflict.catala_en.A.Interpret @@ -1,15 +1,15 @@ [ERROR] There is a conflict between multiple valid consequences for assigning the same variable. -This consequence has a valid justification: - --> tests/test_default/bad/conflict.catala_en - | -9 | definition x under condition true consequence equals 0 - | ^ - + Article - This consequence has a valid justification: --> tests/test_default/bad/conflict.catala_en | 8 | definition x under condition true consequence equals 1 | ^ + Article + +This consequence has a valid justification: + --> tests/test_default/bad/conflict.catala_en + | +9 | definition x under condition true consequence equals 0 + | ^ + + Article diff --git a/tests/test_exception/bad/output/exceptions_cycle.catala_en.A.Interpret b/tests/test_exception/bad/output/exceptions_cycle.catala_en.A.Interpret index f5f0d093..11e16881 100644 --- a/tests/test_exception/bad/output/exceptions_cycle.catala_en.A.Interpret +++ b/tests/test_exception/bad/output/exceptions_cycle.catala_en.A.Interpret @@ -14,8 +14,8 @@ Cyclic exception for definition of variable "x", declared here: Used here in the definition of another cyclic exception for defining "x": --> tests/test_exception/bad/exceptions_cycle.catala_en | -18 | definition x equals 2 - | ^ +17 | exception exception_x + | ^^^^^^^^^^^ + Test Cyclic exception for definition of variable "x", declared here: @@ -32,8 +32,8 @@ Cyclic exception for definition of variable "x", declared here: Used here in the definition of another cyclic exception for defining "x": --> tests/test_exception/bad/exceptions_cycle.catala_en | -14 | definition x equals 1 - | ^ +13 | exception base_x + | ^^^^^^ + Test Cyclic exception for definition of variable "x", declared here: @@ -48,8 +48,8 @@ Cyclic exception for definition of variable "x", declared here: + Used here in the definition of another cyclic exception for defining "x": - --> tests/test_exception/bad/exceptions_cycle.catala_en - | -10 | definition x equals 0 - | ^ - + Test + --> tests/test_exception/bad/exceptions_cycle.catala_en + | +9 | exception exception_exception_x + | ^^^^^^^^^^^^^^^^^^^^^ + + Test diff --git a/tests/test_exception/bad/output/self_exception.catala_en.A.Interpret b/tests/test_exception/bad/output/self_exception.catala_en.A.Interpret index 72dbd497..6b7067a6 100644 --- a/tests/test_exception/bad/output/self_exception.catala_en.A.Interpret +++ b/tests/test_exception/bad/output/self_exception.catala_en.A.Interpret @@ -1,7 +1,7 @@ [ERROR] Cannot define rule as an exception to itself - --> tests/test_exception/bad/self_exception.catala_en - | -10 | definition y equals 0 - | ^ - + Test + --> tests/test_exception/bad/self_exception.catala_en + | +9 | exception base_y + | ^^^^^^ + + Test diff --git a/tests/test_exception/bad/output/two_exceptions.catala_en.A.Interpret b/tests/test_exception/bad/output/two_exceptions.catala_en.A.Interpret index 8607d314..8b76d549 100644 --- a/tests/test_exception/bad/output/two_exceptions.catala_en.A.Interpret +++ b/tests/test_exception/bad/output/two_exceptions.catala_en.A.Interpret @@ -1,15 +1,15 @@ [ERROR] There is a conflict between multiple valid consequences for assigning the same variable. -This consequence has a valid justification: - --> tests/test_exception/bad/two_exceptions.catala_en - | -15 | definition x equals 2 - | ^ - + Test - This consequence has a valid justification: --> tests/test_exception/bad/two_exceptions.catala_en | 12 | definition x equals 1 | ^ + Test + +This consequence has a valid justification: + --> tests/test_exception/bad/two_exceptions.catala_en + | +15 | definition x equals 2 + | ^ + + Test diff --git a/tests/test_exception/good/groups_of_exceptions.catala_en b/tests/test_exception/good/groups_of_exceptions.catala_en new file mode 100644 index 00000000..2aaef6d0 --- /dev/null +++ b/tests/test_exception/good/groups_of_exceptions.catala_en @@ -0,0 +1,36 @@ +## Test + +```catala +declaration scope Foo: + input y content integer + output x content integer + +scope Foo: + label base definition x under condition + y = 0 + consequence equals 0 + + label base definition x under condition + y = 1 + consequence equals 1 + + label intermediate exception base definition x under condition + y = 2 + consequence equals 2 + + label intermediate exception base definition x under condition + y = 3 + consequence equals 3 + + exception intermediate definition x under condition + y = 4 + consequence equals 4 + + exception intermediate definition x under condition + y = 5 + consequence equals 5 +``` + +```catala-test { id = "scopelang"} +catala Scopelang +``` diff --git a/tests/test_exception/good/output/groups_of_exceptions.catala_en.scopelang b/tests/test_exception/good/output/groups_of_exceptions.catala_en.scopelang new file mode 100644 index 00000000..9fda879c --- /dev/null +++ b/tests/test_exception/good/output/groups_of_exceptions.catala_en.scopelang @@ -0,0 +1,6 @@ +let scope Foo (y: integer|input) (x: integer|internal|output) = + let x : integer = + ⟨⟨⟨⟨y = 4 ⊢ 4⟩, ⟨y = 5 ⊢ 5⟩ | false ⊢ ∅ ⟩ | + true ⊢ + ⟨⟨y = 2 ⊢ 2⟩, ⟨y = 3 ⊢ 3⟩ | false ⊢ ∅ ⟩⟩ | + true ⊢ ⟨⟨y = 0 ⊢ 0⟩, ⟨y = 1 ⊢ 1⟩ | false ⊢ ∅ ⟩⟩ diff --git a/tests/test_func/bad/output/bad_func.catala_en.S.Interpret b/tests/test_func/bad/output/bad_func.catala_en.S.Interpret index e7ce2e33..ce447977 100644 --- a/tests/test_func/bad/output/bad_func.catala_en.S.Interpret +++ b/tests/test_func/bad/output/bad_func.catala_en.S.Interpret @@ -1,15 +1,15 @@ [ERROR] There is a conflict between multiple valid consequences for assigning the same variable. -This consequence has a valid justification: - --> tests/test_func/bad/bad_func.catala_en - | -15 | definition f of x under condition not b consequence equals x * x - | ^^^^^ - + Article - This consequence has a valid justification: --> tests/test_func/bad/bad_func.catala_en | 14 | definition f of x under condition (x >= x) consequence equals x + x | ^^^^^ + Article + +This consequence has a valid justification: + --> tests/test_func/bad/bad_func.catala_en + | +15 | definition f of x under condition not b consequence equals x * x + | ^^^^^ + + Article diff --git a/tests/test_io/good/output/all_io.catala_en.A.Dcalc b/tests/test_io/good/output/all_io.catala_en.A.Dcalc index 7943d7e8..06559e00 100644 --- a/tests/test_io/good/output/all_io.catala_en.A.Dcalc +++ b/tests/test_io/good/output/all_io.catala_en.A.Dcalc @@ -1,18 +1,14 @@ let A = - λ (A_in_31: A_in{"c_in": integer; "d_in": integer; "e_in": + λ (A_in_21: A_in{"c_in": integer; "d_in": integer; "e_in": unit → integer; "f_in": unit → integer}) → - let c_32 : integer = A_in_31."c_in" in - let d_33 : integer = A_in_31."d_in" in - let e_34 : unit → integer = A_in_31."e_in" in - let f_35 : unit → integer = A_in_31."f_in" in - let a_36 : integer = error_empty ⟨⟨true ⊢ 0⟩ | false ⊢ ∅ ⟩ - in - let b_37 : integer = error_empty - ⟨⟨true ⊢ a_36 + 1⟩ | false ⊢ ∅ ⟩ in - let e_38 : integer = error_empty - ⟨e_34 () | true ⊢ - ⟨⟨true ⊢ b_37 + c_32 + d_33 + 1⟩ | false ⊢ ∅ ⟩⟩ in - let f_39 : integer = error_empty - ⟨f_35 () | true ⊢ ⟨⟨true ⊢ e_38 + 1⟩ | false ⊢ ∅ ⟩⟩ - in - A_out {"b_out"= b_37; "d_out"= d_33; "f_out"= f_39} + let c_22 : integer = A_in_21."c_in" in + let d_23 : integer = A_in_21."d_in" in + let e_24 : unit → integer = A_in_21."e_in" in + let f_25 : unit → integer = A_in_21."f_in" in + let a_26 : integer = error_empty ⟨true ⊢ 0⟩ in + let b_27 : integer = error_empty ⟨true ⊢ a_26 + 1⟩ in + let e_28 : integer = error_empty + ⟨e_24 () | true ⊢ ⟨true ⊢ b_27 + c_22 + d_23 + 1⟩⟩ in + let f_29 : integer = error_empty + ⟨f_25 () | true ⊢ ⟨true ⊢ e_28 + 1⟩⟩ in + A_out {"b_out"= b_27; "d_out"= d_23; "f_out"= f_29} diff --git a/tests/test_io/good/output/condition_only_input.catala_en.B.Dcalc b/tests/test_io/good/output/condition_only_input.catala_en.B.Dcalc index f47d6f29..2e14d7e4 100644 --- a/tests/test_io/good/output/condition_only_input.catala_en.B.Dcalc +++ b/tests/test_io/good/output/condition_only_input.catala_en.B.Dcalc @@ -1,7 +1,7 @@ let B = - λ (B_in_31: B_in{}) → - let a.x_32 : bool = error_empty ⟨true ⊢ false⟩ in - let result_33 : A_out{"y_out": integer} = A_24 (A_in {"x_in"= a.x_32}) in - let a.y_34 : integer = result_33."y_out" in - let __35 : unit = assert (error_empty a.y_34 = 1) in + λ (B_in_21: B_in{}) → + let a.x_22 : bool = error_empty ⟨true ⊢ false⟩ in + let result_23 : A_out{"y_out": integer} = A_13 (A_in {"x_in"= a.x_22}) in + let a.y_24 : integer = result_23."y_out" in + let __25 : unit = assert (error_empty a.y_24 = 1) in B_out {} diff --git a/tests/test_io/good/output/subscope.catala_en.B.Dcalc b/tests/test_io/good/output/subscope.catala_en.B.Dcalc index 5e05d0f3..aff1c554 100644 --- a/tests/test_io/good/output/subscope.catala_en.B.Dcalc +++ b/tests/test_io/good/output/subscope.catala_en.B.Dcalc @@ -1,10 +1,9 @@ let B = - λ (B_in_40: B_in{}) → - let a.a_41 : unit → integer = λ (__42: unit) → ∅ in - let a.b_43 : integer = error_empty - ⟨⟨true ⊢ 2⟩ | false ⊢ ∅ ⟩ in - let result_44 : A_out{"c_out": integer} = - A_32 (A_in {"a_in"= a.a_41; "b_in"= a.b_43}) in - let a.c_45 : integer = result_44."c_out" in - let __46 : unit = assert (error_empty a.c_45 = 1) in + λ (B_in_27: B_in{}) → + let a.a_28 : unit → integer = λ (__29: unit) → ∅ in + let a.b_30 : integer = error_empty ⟨true ⊢ 2⟩ in + let result_31 : A_out{"c_out": integer} = + A_17 (A_in {"a_in"= a.a_28; "b_in"= a.b_30}) in + let a.c_32 : integer = result_31."c_out" in + let __33 : unit = assert (error_empty a.c_32 = 1) in B_out {} diff --git a/tests/test_scope/bad/output/scope.catala_en.A.Interpret b/tests/test_scope/bad/output/scope.catala_en.A.Interpret index 2973e02c..fc20fc6c 100644 --- a/tests/test_scope/bad/output/scope.catala_en.A.Interpret +++ b/tests/test_scope/bad/output/scope.catala_en.A.Interpret @@ -1,15 +1,15 @@ [ERROR] There is a conflict between multiple valid consequences for assigning the same variable. -This consequence has a valid justification: - --> tests/test_scope/bad/scope.catala_en - | -14 | definition b under condition not c consequence equals 0 - | ^ - + Article - This consequence has a valid justification: --> tests/test_scope/bad/scope.catala_en | 13 | definition b under condition not c consequence equals 1337 | ^^^^ + Article + +This consequence has a valid justification: + --> tests/test_scope/bad/scope.catala_en + | +14 | definition b under condition not c consequence equals 0 + | ^ + + Article diff --git a/tests/test_scope/good/nothing.catala_en b/tests/test_scope/good/nothing.catala_en new file mode 100644 index 00000000..51d4b371 --- /dev/null +++ b/tests/test_scope/good/nothing.catala_en @@ -0,0 +1,10 @@ +## Test + +```catala +declaration scope Foo2: + output bar content integer +``` + +```catala-test {id="foo_2_scalc"} +catala Scalc -s Foo2 -O -t +``` diff --git a/tests/test_scope/good/output/191_fix_record_name_confusion.catala_en.OCaml b/tests/test_scope/good/output/191_fix_record_name_confusion.catala_en.OCaml index cea245aa..97d4a3c5 100644 --- a/tests/test_scope/good/output/191_fix_record_name_confusion.catala_en.OCaml +++ b/tests/test_scope/good/output/191_fix_record_name_confusion.catala_en.OCaml @@ -1,49 +1,47 @@ (** This file has been generated by the Catala compiler, do not edit! *) -open Runtime +open Runtime_ocaml.Runtime [@@@ocaml.warning "-4-26-27-32-41-42"] module ScopeAOut = struct - type t = { - a_out: bool; - } + type t = {a_out: bool} end module ScopeAIn = struct - type t = { - a_in: unit -> bool; - } + type t = {a_in: unit -> bool} end module ScopeBOut = struct type t = unit -end +end module ScopeBIn = struct - type t = { - a_in: unit -> bool; - } + type t = {a_in: unit -> bool} end let scope_a (scope_a_in: ScopeAIn.t) : ScopeAOut.t = let a_: unit -> bool = scope_a_in.ScopeAIn.a_in in - let a_: bool = (try - (handle_default ([|(fun (_: _) -> a_ ())|]) - (fun (_: _) -> true) - (fun (_: _) -> - handle_default - ([|(fun (_: _) -> - handle_default ([||]) (fun (_: _) -> true) - (fun (_: _) -> true))|]) - (fun (_: _) -> false) - (fun (_: _) -> raise EmptyError))) with - EmptyError -> (raise (NoValueProvided - {filename = "tests/test_scope/good/191_fix_record_name_confusion.catala_en"; - start_line=5; start_column=18; - end_line=5; end_column=19; law_headings=["Article"]}))) in + let a_: bool = ( + try + (handle_default + {filename = "tests/test_scope/good/191_fix_record_name_confusion.catala_en"; + start_line=5; start_column=18; end_line=5; end_column=19; + law_headings=["Article"]} ([|(fun (_: _) -> a_ ())|]) + (fun (_: _) -> true) + (fun (_: _) -> + handle_default + {filename = "tests/test_scope/good/191_fix_record_name_confusion.catala_en"; + start_line=5; start_column=18; end_line=5; end_column=19; + law_headings=["Article"]} ([||]) (fun (_: _) -> true) + (fun (_: _) -> true))) + with + EmptyError -> (raise (NoValueProvided + {filename = "tests/test_scope/good/191_fix_record_name_confusion.catala_en"; + start_line=5; start_column=18; end_line=5; end_column=19; + law_headings=["Article"]}))) in {ScopeAOut.a_out = a_} let scope_b (scope_b_in: ScopeBIn.t) : ScopeBOut.t = @@ -51,18 +49,22 @@ let scope_b (scope_b_in: ScopeBIn.t) : ScopeBOut.t = let scope_a_dot_a_: unit -> bool = fun (_: unit) -> (raise EmptyError) in let result_: ScopeAOut.t = ((scope_a) {ScopeAIn.a_in = scope_a_dot_a_}) in let scope_a_dot_a_: bool = result_.ScopeAOut.a_out in - let a_: bool = (try - (handle_default ([|(fun (_: _) -> a_ ())|]) - (fun (_: _) -> true) - (fun (_: _) -> - handle_default - ([|(fun (_: _) -> - handle_default ([||]) (fun (_: _) -> true) - (fun (_: _) -> scope_a_dot_a_))|]) - (fun (_: _) -> false) - (fun (_: _) -> raise EmptyError))) with - EmptyError -> (raise (NoValueProvided - {filename = "tests/test_scope/good/191_fix_record_name_confusion.catala_en"; - start_line=8; start_column=11; - end_line=8; end_column=12; law_headings=["Article"]}))) in - () \ No newline at end of file + let a_: bool = ( + try + (handle_default + {filename = "tests/test_scope/good/191_fix_record_name_confusion.catala_en"; + start_line=8; start_column=11; end_line=8; end_column=12; + law_headings=["Article"]} ([|(fun (_: _) -> a_ ())|]) + (fun (_: _) -> true) + (fun (_: _) -> + handle_default + {filename = "tests/test_scope/good/191_fix_record_name_confusion.catala_en"; + start_line=8; start_column=11; end_line=8; end_column=12; + law_headings=["Article"]} ([||]) (fun (_: _) -> true) + (fun (_: _) -> scope_a_dot_a_))) + with + EmptyError -> (raise (NoValueProvided + {filename = "tests/test_scope/good/191_fix_record_name_confusion.catala_en"; + start_line=8; start_column=11; end_line=8; end_column=12; + law_headings=["Article"]}))) in + () diff --git a/tests/test_scope/good/output/nothing.catala_en.foo_2_scalc b/tests/test_scope/good/output/nothing.catala_en.foo_2_scalc new file mode 100644 index 00000000..9bf4d372 --- /dev/null +++ b/tests/test_scope/good/output/nothing.catala_en.foo_2_scalc @@ -0,0 +1,7 @@ +let Foo2 (Foo2_in : Foo2_in{}) = + decl temp_bar : any; + temp_bar = dead_value_1; + raise NoValueProvided; + decl bar : integer; + bar = temp_bar_4; + return Foo2_out {"bar_out": bar_3} diff --git a/tests/test_scope/good/output/simple.catala_en.Lcalc b/tests/test_scope/good/output/simple.catala_en.Lcalc new file mode 100644 index 00000000..a9500b5f --- /dev/null +++ b/tests/test_scope/good/output/simple.catala_en.Lcalc @@ -0,0 +1,7 @@ +let Foo = + λ (Foo_in_28: Foo_in{}) → + let bar_29 : integer = + try + handle_default_0 [] (λ (__30: any) → true) (λ (__31: any) → 0) + with EmptyError -> raise NoValueProvided in + Foo_out {"bar_out": bar_29} diff --git a/tests/test_scope/good/simple.catala_en b/tests/test_scope/good/simple.catala_en new file mode 100644 index 00000000..b9e96b60 --- /dev/null +++ b/tests/test_scope/good/simple.catala_en @@ -0,0 +1,13 @@ +## Test + +```catala +declaration scope Foo: + output bar content integer + +scope Foo: + definition bar equals 0 +``` + +```catala-test {id="Lcalc"} +catala Lcalc -s Foo +``` diff --git a/tests/test_variable_state/good/output/subscope.catala_en.A.Scopelang b/tests/test_variable_state/good/output/subscope.catala_en.A.Scopelang index 693d872a..6f11acaf 100644 --- a/tests/test_variable_state/good/output/subscope.catala_en.A.Scopelang +++ b/tests/test_variable_state/good/output/subscope.catala_en.A.Scopelang @@ -1,6 +1,5 @@ let scope A (foo_bar: integer|context) (foo_baz: integer|internal) (foo_fizz: integer|internal|output) = - let foo_bar : integer = reentrant or by default - ⟨⟨true ⊢ 1⟩ | false ⊢ ∅ ⟩; - let foo_baz : integer = ⟨⟨true ⊢ foo_bar + 1⟩ | false ⊢ ∅ ⟩; - let foo_fizz : integer = ⟨⟨true ⊢ foo_baz + 1⟩ | false ⊢ ∅ ⟩ + let foo_bar : integer = reentrant or by default ⟨true ⊢ 1⟩; + let foo_baz : integer = ⟨true ⊢ foo_bar + 1⟩; + let foo_fizz : integer = ⟨true ⊢ foo_baz + 1⟩