mirror of
https://github.com/CatalaLang/catala.git
synced 2024-09-19 16:28:12 +03:00
Merge branch 'master' into xor
This commit is contained in:
commit
c4fc0ff622
6
Makefile
6
Makefile
@ -174,16 +174,16 @@ generate_french_law_library:\
|
||||
build_french_law_library: generate_french_law_library format
|
||||
dune build $(FRENCH_LAW_LIB_DIR)
|
||||
|
||||
run_french_law_library_benchmark: build_french_law_library
|
||||
run_french_law_library_benchmark: generate_french_law_library
|
||||
dune exec $(FRENCH_LAW_LIB_DIR)/bench.exe
|
||||
|
||||
run_french_law_library_tests: build_french_law_library
|
||||
run_french_law_library_tests: generate_french_law_library
|
||||
dune exec $(FRENCH_LAW_LIB_DIR)/law_source/unit_tests/run_tests.exe
|
||||
|
||||
#> build_french_law_library_js : Builds the JS version of the OCaml French law library
|
||||
build_french_law_library_js: generate_french_law_library format
|
||||
dune build --profile release $(FRENCH_LAW_LIB_DIR)/api_web.bc.js
|
||||
cd javascript && ln -sf ../_build/default/$(FRENCH_LAW_LIB_DIR)/api_web.bc.js french_law.js
|
||||
cp -f _build/default/$(FRENCH_LAW_LIB_DIR)/api_web.bc.js french_law_js/french_law.js
|
||||
|
||||
##########################################
|
||||
# Website assets
|
||||
|
@ -1,6 +1,6 @@
|
||||
# This file is generated by dune, edit dune-project instead
|
||||
opam-version: "2.0"
|
||||
version: "0.2.0"
|
||||
version: "0.3.0"
|
||||
synopsis: "Low-level language for tax code specification"
|
||||
description: """
|
||||
The Catala language is designed to be a low-level target for
|
||||
@ -28,6 +28,8 @@ depends: [
|
||||
"calendar" {>= "2.04"}
|
||||
"visitors" {>= "20200210"}
|
||||
"benchmark" {>= "1.6"}
|
||||
"js_of_ocaml-ppx" {>= "3.8.0"}
|
||||
"camomile" {>= "1.0.2"}
|
||||
]
|
||||
build: [
|
||||
["dune" "subst"] {pinned}
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 199 KiB After Width: | Height: | Size: 196 KiB |
@ -1,7 +1,7 @@
|
||||
(lang dune 2.2)
|
||||
|
||||
(name catala)
|
||||
(version 0.2.0)
|
||||
(version 0.3.0)
|
||||
(generate_opam_files true)
|
||||
(formatting)
|
||||
|
||||
@ -36,8 +36,10 @@
|
||||
(calendar (>= 2.04))
|
||||
(visitors (>= 20200210))
|
||||
(benchmark (>= 1.6))
|
||||
(js_of_ocaml-ppx (>= 3.8.0))
|
||||
(camomile (>= 1.0.2))
|
||||
)
|
||||
)
|
||||
|
||||
(using menhir 2.1)
|
||||
(allow_approximate_merlin)
|
||||
(allow_approximate_merlin)
|
@ -22,8 +22,8 @@ familiales, est ainsi porté de 411,92 € à 413,16 € au 1er avril 2019.
|
||||
champ d'application PrestationsFamiliales :
|
||||
définition base_mensuelle
|
||||
sous condition
|
||||
date_courante >=@ |01/04/2019| et
|
||||
date_courante <@ |01/04/2020|
|
||||
date_courante >=@ |2019-04-01| et
|
||||
date_courante <@ |2020-04-01|
|
||||
conséquence égal à 413,16 €
|
||||
```
|
||||
|
||||
@ -46,8 +46,8 @@ est ainsi porté de 413,16 € à 414,4 € au 1er avril 2020.
|
||||
champ d'application PrestationsFamiliales :
|
||||
définition base_mensuelle
|
||||
sous condition
|
||||
date_courante >=@ |01/04/2020| et
|
||||
date_courante <@ |01/04/2021|
|
||||
date_courante >=@ |2020-04-01| et
|
||||
date_courante <@ |2021-04-01|
|
||||
conséquence égal à 414,4 €
|
||||
```
|
||||
|
||||
@ -75,14 +75,14 @@ tranche est celle dont les revenus sont supérieurs au plafond de base de
|
||||
champ d'application AllocationsFamiliales :
|
||||
exception
|
||||
définition plafond_I_d521_3 sous condition
|
||||
date_courante >=@ |01/01/2020| et date_courante <=@ |31/12/2020|
|
||||
date_courante >=@ |2020-01-01| et date_courante <=@ |2020-12-31|
|
||||
conséquence égal à 57 759 € +€
|
||||
5 775 € *€ (entier_vers_décimal de
|
||||
(nombre de enfants_à_charge_droit_ouvert_prestation_familiale))
|
||||
|
||||
exception
|
||||
définition plafond_II_d521_3 sous condition
|
||||
date_courante >=@ |01/01/2020| et date_courante <=@ |31/12/2020|
|
||||
date_courante >=@ |2020-01-01| et date_courante <=@ |2020-12-31|
|
||||
conséquence égal à 80 831 € +€
|
||||
5 775 € *€ (entier_vers_décimal de
|
||||
(nombre de enfants_à_charge_droit_ouvert_prestation_familiale))
|
||||
@ -105,7 +105,7 @@ son montant est porté à 10,03 € l'heure.
|
||||
```catala
|
||||
champ d'application Smic :
|
||||
définition brut_horaire sous condition
|
||||
date_courante >=@ |01/01/2019| et date_courante <=@ |31/12/2019| et (
|
||||
date_courante >=@ |2019-01-01| et date_courante <=@ |2019-12-31| et (
|
||||
(résidence = Métropole) ou
|
||||
(résidence = Guadeloupe) ou
|
||||
(résidence = Guyane) ou
|
||||
@ -123,7 +123,7 @@ champ d'application Smic :
|
||||
```catala
|
||||
champ d'application Smic :
|
||||
définition brut_horaire sous condition
|
||||
date_courante >=@ |01/01/2019| et date_courante <=@ |31/12/2019| et (
|
||||
date_courante >=@ |2019-01-01| et date_courante <=@ |2019-12-31| et (
|
||||
(résidence = Mayotte)
|
||||
)
|
||||
conséquence égal à 7,57 €
|
||||
@ -144,7 +144,7 @@ son montant est porté à 10,15 € l'heure ;
|
||||
```catala
|
||||
champ d'application Smic :
|
||||
définition brut_horaire sous condition
|
||||
date_courante >=@ |01/01/2020| et date_courante <=@ |31/12/2020| et (
|
||||
date_courante >=@ |2020-01-01| et date_courante <=@ |2020-12-31| et (
|
||||
(résidence = Métropole) ou
|
||||
(résidence = Guadeloupe) ou
|
||||
(résidence = Guyane) ou
|
||||
@ -162,7 +162,7 @@ champ d'application Smic :
|
||||
```catala
|
||||
champ d'application Smic :
|
||||
définition brut_horaire sous condition
|
||||
date_courante >=@ |01/01/2020| et date_courante <=@ |31/12/2020| et (
|
||||
date_courante >=@ |2020-01-01| et date_courante <=@ |2020-12-31| et (
|
||||
(résidence = Mayotte)
|
||||
)
|
||||
conséquence égal à 7,66 €
|
||||
@ -183,7 +183,7 @@ son montant est porté à 10,25 € l'heure ;
|
||||
```catala
|
||||
champ d'application Smic :
|
||||
définition brut_horaire sous condition
|
||||
date_courante >=@ |01/01/2021| et date_courante <=@ |31/12/2021| et (
|
||||
date_courante >=@ |2021-01-01| et date_courante <=@ |2021-12-31| et (
|
||||
(résidence = Métropole) ou
|
||||
(résidence = Guadeloupe) ou
|
||||
(résidence = Guyane) ou
|
||||
@ -201,7 +201,7 @@ champ d'application Smic :
|
||||
```catala
|
||||
champ d'application Smic :
|
||||
définition brut_horaire sous condition
|
||||
date_courante >=@ |01/01/2021| et date_courante <=@ |31/12/2021| et (
|
||||
date_courante >=@ |2021-01-01| et date_courante <=@ |2021-12-31| et (
|
||||
(résidence = Mayotte)
|
||||
)
|
||||
conséquence égal à 7,74 €
|
||||
@ -221,7 +221,7 @@ décembre 2021. Il est majoré de 5 827 euros par enfant à charge.
|
||||
champ d'application AllocationsFamiliales :
|
||||
exception
|
||||
définition plafond_I_d521_3 sous condition
|
||||
date_courante >=@ |01/01/2021| et date_courante <=@ |31/12/2021|
|
||||
date_courante >=@ |2021-01-01| et date_courante <=@ |2021-12-31|
|
||||
conséquence égal à 58 279 € +€
|
||||
5 827 € *€ (entier_vers_décimal de
|
||||
(nombre de enfants_à_charge_droit_ouvert_prestation_familiale))
|
||||
@ -237,7 +237,7 @@ décembre 2021. Il est majoré de 5 827 euros par enfant à charge.
|
||||
champ d'application AllocationsFamiliales :
|
||||
exception
|
||||
définition plafond_II_d521_3 sous condition
|
||||
date_courante >=@ |01/01/2021| et date_courante <=@ |31/12/2021|
|
||||
date_courante >=@ |2021-01-01| et date_courante <=@ |2021-12-31|
|
||||
conséquence égal à 81 558 € +€
|
||||
5 827 € *€ (entier_vers_décimal de
|
||||
(nombre de enfants_à_charge_droit_ouvert_prestation_familiale))
|
||||
|
@ -14,20 +14,16 @@ champ d'application EnfantLePlusÂgé:
|
||||
définition le_plus_âgé égal à
|
||||
contenu maximum entier initial Enfant {
|
||||
-- identifiant: -1
|
||||
-- fin_obligation_scolaire: |01/01/1900|
|
||||
-- obligation_scolaire: Pendant
|
||||
-- rémuneration_mensuelle: 0€
|
||||
-- date_de_naissance: |01/01/1900|
|
||||
-- date_de_naissance: |1900-01-01|
|
||||
-- âge: 0
|
||||
-- garde_alternée: NonGardeUnique
|
||||
-- prise_en_charge_par_services_sociaux: NonPriseEnChargeFamille
|
||||
-- prise_en_charge: EffectiveEtPermanente
|
||||
-- a_déjà_ouvert_droit_aux_allocations_familiales: faux
|
||||
}
|
||||
pour potentiel_plus_âgé dans enfants de
|
||||
potentiel_plus_âgé.âge
|
||||
pour potentiel_plus_âgé dans enfants de potentiel_plus_âgé.âge
|
||||
|
||||
|
||||
champ d'application PrestationsFamiliales:
|
||||
définition âge_l512_3_2_alternatif égal à Absent
|
||||
|
||||
champ d'application AllocationsFamiliales:
|
||||
définition montant_initial_majoration de enfant sous condition
|
||||
non (droit_ouvert_majoration de enfant)
|
||||
@ -75,9 +71,8 @@ déclaration structure EnfantEntrée:
|
||||
donnée d_identifiant contenu entier
|
||||
donnée d_rémuneration_mensuelle contenu argent
|
||||
donnée d_date_de_naissance contenu date
|
||||
donnée d_garde_alternée contenu GardeAlternée
|
||||
donnée d_prise_en_charge_par_services_sociaux contenu
|
||||
PriseEnChargeServiceSociaux
|
||||
donnée d_prise_en_charge contenu PriseEnCharge
|
||||
donnée d_a_déjà_ouvert_droit_aux_allocations_familiales contenu booléen
|
||||
|
||||
déclaration champ d'application InterfaceAllocationsFamiliales:
|
||||
contexte date_courante contenu date
|
||||
@ -87,6 +82,8 @@ déclaration champ d'application InterfaceAllocationsFamiliales:
|
||||
contexte ressources_ménage contenu argent
|
||||
contexte résidence contenu Collectivité
|
||||
contexte montant_versé contenu argent
|
||||
contexte personne_charge_effective_permanente_est_parent condition
|
||||
contexte personne_charge_effective_permanente_remplit_titre_I condition
|
||||
|
||||
champ d'application InterfaceAllocationsFamiliales:
|
||||
définition allocations_familiales.date_courante égal à date_courante
|
||||
@ -94,10 +91,12 @@ champ d'application InterfaceAllocationsFamiliales:
|
||||
définition allocations_familiales.ressources_ménage égal à ressources_ménage
|
||||
définition allocations_familiales.résidence égal à résidence
|
||||
définition montant_versé égal à allocations_familiales.montant_versé
|
||||
assertion non (existe enfant dans enfants tel que
|
||||
enfant.d_garde_alternée != NonGardeUnique et
|
||||
enfant.d_prise_en_charge_par_services_sociaux != NonPriseEnChargeFamille
|
||||
)
|
||||
règle allocations_familiales.personne_charge_effective_permanente_est_parent
|
||||
sous condition personne_charge_effective_permanente_est_parent conséquence
|
||||
rempli
|
||||
règle allocations_familiales.personne_charge_effective_permanente_remplit_titre_I
|
||||
sous condition personne_charge_effective_permanente_remplit_titre_I conséquence
|
||||
rempli
|
||||
```
|
||||
|
||||
> Fin métadonnées
|
||||
@ -119,11 +118,16 @@ champ d'application InterfaceAllocationsFamiliales:
|
||||
-- identifiant : enfant.d_identifiant
|
||||
-- rémuneration_mensuelle : enfant.d_rémuneration_mensuelle
|
||||
-- date_de_naissance : enfant.d_date_de_naissance
|
||||
-- prise_en_charge_par_services_sociaux :
|
||||
enfant.d_prise_en_charge_par_services_sociaux
|
||||
-- garde_alternée : enfant.d_garde_alternée
|
||||
-- prise_en_charge : enfant.d_prise_en_charge
|
||||
-- âge: accès_année de
|
||||
(|01/01/0000| +@ (date_courante -@ enfant.d_date_de_naissance))
|
||||
-- fin_obligation_scolaire : enfant.d_date_de_naissance +@ 16 an
|
||||
(|0000-01-01| +@ (date_courante -@ enfant.d_date_de_naissance))
|
||||
-- obligation_scolaire :
|
||||
(si enfant.d_date_de_naissance +@ 3 an >=@ date_courante alors
|
||||
Avant
|
||||
sinon (si enfant.d_date_de_naissance +@ 16 an >=@ date_courante alors
|
||||
Pendant
|
||||
sinon Après))
|
||||
-- a_déjà_ouvert_droit_aux_allocations_familiales:
|
||||
enfant.d_a_déjà_ouvert_droit_aux_allocations_familiales
|
||||
}
|
||||
```
|
||||
|
@ -5,30 +5,27 @@ allocations familiales, il est nécessaire de définir les structures de donnée
|
||||
informatiques qui modélisent la situation dont parlent ces textes législatifs.
|
||||
|
||||
> Début métadonnées
|
||||
|
||||
```catala
|
||||
déclaration structure Personne:
|
||||
donnée numéro_sécurité_sociale contenu entier
|
||||
déclaration énumération PriseEnCharge :
|
||||
-- GardeAlternéePartageAllocations
|
||||
-- GardeAlternéeAllocataireUnique
|
||||
-- EffectiveEtPermanente
|
||||
-- ServicesSociauxAllocationVerséeÀLaFamille
|
||||
-- ServicesSociauxAllocationVerséeAuxServicesSociaux
|
||||
|
||||
déclaration énumération GardeAlternée :
|
||||
-- OuiPartageAllocations
|
||||
-- OuiAllocataireUnique
|
||||
-- NonGardeUnique
|
||||
|
||||
déclaration énumération PriseEnChargeServiceSociaux:
|
||||
-- OuiAllocationVerséeÀLaFamille
|
||||
-- OuiAllocationVerséeAuxServicesSociaux
|
||||
-- NonPriseEnChargeFamille
|
||||
déclaration énumération SituationObligationScolaire:
|
||||
-- Avant
|
||||
-- Pendant
|
||||
-- Après
|
||||
|
||||
déclaration structure Enfant :
|
||||
donnée identifiant contenu entier
|
||||
donnée fin_obligation_scolaire contenu date
|
||||
donnée obligation_scolaire contenu SituationObligationScolaire
|
||||
donnée rémuneration_mensuelle contenu argent
|
||||
donnée date_de_naissance contenu date
|
||||
donnée âge contenu entier
|
||||
donnée garde_alternée contenu GardeAlternée
|
||||
donnée prise_en_charge_par_services_sociaux contenu
|
||||
PriseEnChargeServiceSociaux
|
||||
donnée prise_en_charge contenu PriseEnCharge
|
||||
donnée a_déjà_ouvert_droit_aux_allocations_familiales contenu booléen
|
||||
|
||||
déclaration énumération Collectivité :
|
||||
-- Guadeloupe
|
||||
@ -46,18 +43,15 @@ déclaration champ d'application Smic :
|
||||
contexte résidence contenu Collectivité
|
||||
contexte brut_horaire contenu argent
|
||||
|
||||
déclaration énumération PriseEnCompteÉvaluationMontant:
|
||||
déclaration énumération PriseEnCompte:
|
||||
-- Complète
|
||||
-- Partagée
|
||||
-- Zéro
|
||||
|
||||
déclaration énumération VersementAllocations:
|
||||
-- Normal
|
||||
-- AllocationVerséeAuxServicesSociaux
|
||||
|
||||
déclaration énumération ÂgeAlternatif:
|
||||
-- Absent
|
||||
-- Présent contenu entier
|
||||
|
||||
déclaration énumération ÉlémentPrestationsFamiliales:
|
||||
-- PrestationAccueilJeuneEnfant
|
||||
-- AllocationsFamiliales
|
||||
@ -73,7 +67,6 @@ déclaration champ d'application PrestationsFamiliales:
|
||||
contexte conditions_hors_âge condition dépend de Enfant
|
||||
contexte plafond_l512_3_2 contenu argent
|
||||
contexte âge_l512_3_2 contenu entier
|
||||
contexte âge_l512_3_2_alternatif contenu ÂgeAlternatif
|
||||
contexte régime_outre_mer_l751_1 condition
|
||||
contexte date_courante contenu date
|
||||
contexte prestation_courante contenu ÉlémentPrestationsFamiliales
|
||||
@ -86,32 +79,34 @@ champ d'application PrestationsFamiliales:
|
||||
définition smic.date_courante égal à date_courante
|
||||
|
||||
déclaration champ d'application AllocationFamilialesAvril2008:
|
||||
contexte âge_limite_alinéa_1_l521_3 contenu entier
|
||||
|
||||
déclaration énumération StockageEnfant:
|
||||
-- PasEnfant
|
||||
-- UnEnfant contenu Enfant
|
||||
contexte âge_minimum_alinéa_1_l521_3 contenu entier
|
||||
|
||||
déclaration champ d'application EnfantLePlusÂgé:
|
||||
contexte enfants contenu collection Enfant
|
||||
contexte le_plus_âgé contenu Enfant
|
||||
|
||||
déclaration champ d'application AllocationsFamiliales:
|
||||
|
||||
# Variables concernant le ménage
|
||||
contexte personne_charge_effective_permanente_est_parent condition
|
||||
contexte personne_charge_effective_permanente_remplit_titre_I condition
|
||||
contexte ressources_ménage contenu argent
|
||||
contexte résidence contenu Collectivité
|
||||
|
||||
# Date à laquelle le calcul est effectué
|
||||
contexte date_courante contenu date
|
||||
|
||||
# Variables concernant les enfants du ménage
|
||||
contexte enfants_à_charge contenu collection Enfant
|
||||
contexte enfants_à_charge_droit_ouvert_prestation_familiale
|
||||
contenu collection Enfant
|
||||
contexte date_courante contenu date
|
||||
contexte résidence contenu Collectivité
|
||||
contexte ressources_ménage contenu argent
|
||||
contexte prise_en_compte contenu
|
||||
PriseEnCompteÉvaluationMontant dépend de Enfant
|
||||
contexte versement contenu
|
||||
VersementAllocations dépend de Enfant
|
||||
contexte prise_en_compte contenu PriseEnCompte dépend de Enfant
|
||||
contexte versement contenu VersementAllocations dépend de Enfant
|
||||
|
||||
contexte montant_versé contenu argent
|
||||
|
||||
# Variables liées à la base des allications familiales
|
||||
contexte droit_ouvert_base condition
|
||||
contexte droit_ouvert_majoration condition dépend de Enfant
|
||||
contexte montant_versé_base contenu argent
|
||||
contexte montant_avec_garde_alternée_base contenu argent
|
||||
contexte montant_initial_base contenu argent
|
||||
@ -122,26 +117,31 @@ déclaration champ d'application AllocationsFamiliales:
|
||||
contexte nombre_moyen_enfants contenu décimal
|
||||
contexte nombre_total_enfants contenu décimal
|
||||
|
||||
# Variables liées à l'allocation forfaitaire
|
||||
contexte droit_ouvert_forfaitaire condition dépend de Enfant
|
||||
contexte montant_versé_forfaitaire contenu argent
|
||||
|
||||
# Variables liées aux majorations des allocations familiales
|
||||
contexte droit_ouvert_majoration condition dépend de Enfant
|
||||
contexte montant_versé_majoration contenu argent
|
||||
contexte montant_avec_garde_alternée_majoration contenu argent dépend de Enfant
|
||||
contexte montant_initial_majoration contenu argent dépend de Enfant
|
||||
|
||||
# Variables liées au complément dégressif
|
||||
contexte droit_ouvert_complément condition
|
||||
contexte montant_versé_complément_pour_base_et_majoration contenu argent
|
||||
contexte montant_base_complément_pour_base_et_majoration contenu argent
|
||||
contexte montant_versé_complément_pour_forfaitaire contenu argent
|
||||
contexte dépassement_plafond_ressources contenu argent dépend de argent
|
||||
contexte complément_dégressif contenu argent dépend de argent
|
||||
|
||||
# Sous-champs d'applications
|
||||
contexte prestations_familiales champ d'application PrestationsFamiliales
|
||||
contexte version_avril_2008 champ d'application AllocationFamilialesAvril2008
|
||||
contexte enfant_le_plus_âgé champ d'application EnfantLePlusÂgé
|
||||
|
||||
contexte conditions_hors_âge condition dépend de Enfant
|
||||
# Plafonds, âges limites et autres constantes
|
||||
contexte nombre_enfants_l521_1 contenu entier
|
||||
contexte âge_limite_alinéa_1_l521_3 contenu entier dépend de Enfant
|
||||
contexte âge_minimum_alinéa_1_l521_3 contenu entier dépend de Enfant
|
||||
contexte nombre_enfants_alinéa_2_l521_3 contenu entier
|
||||
contexte est_enfant_le_plus_âgé contenu booléen dépend de Enfant
|
||||
contexte plafond_I_d521_3 contenu argent
|
||||
@ -156,5 +156,4 @@ champ d'application AllocationsFamiliales:
|
||||
résidence
|
||||
|
||||
```
|
||||
|
||||
> Fin métadonnées
|
||||
|
@ -79,7 +79,7 @@ champ d'application AllocationsFamiliales :
|
||||
(ressources_ménage <=€ plafond_II_d521_3)
|
||||
conséquence égal à
|
||||
si nombre de enfants_à_charge_droit_ouvert_prestation_familiale >= 2
|
||||
alors prestations_familiales.base_mensuelle *€ 32 %
|
||||
alors prestations_familiales.base_mensuelle *€ 16 %
|
||||
sinon 0 €
|
||||
```
|
||||
|
||||
@ -172,28 +172,28 @@ définie à l'alinéa précédent et, d'autre part, le montant des ressources.
|
||||
```catala
|
||||
champ d'application AllocationsFamiliales :
|
||||
exception
|
||||
définition dépassement_plafond_ressources de allocation
|
||||
définition complément_dégressif de allocation
|
||||
sous condition
|
||||
(ressources_ménage >€ plafond_I_d521_3) et
|
||||
(ressources_ménage <=€ plafond_I_d521_3 +€ allocation *€ 12,0 )
|
||||
conséquence égal à
|
||||
plafond_I_d521_3 +€ allocation *€ 12,0 -€ ressources_ménage
|
||||
(plafond_I_d521_3 +€ allocation *€ 12,0 -€ ressources_ménage) *€ (1,0 /. 12,0)
|
||||
|
||||
exception
|
||||
définition dépassement_plafond_ressources de allocation
|
||||
définition complément_dégressif de allocation
|
||||
sous condition
|
||||
(ressources_ménage >€ plafond_II_d521_3) et
|
||||
(ressources_ménage <=€ plafond_II_d521_3 +€ allocation *€ 12,0)
|
||||
conséquence égal à
|
||||
plafond_II_d521_3 +€ allocation *€ 12,0 -€ ressources_ménage
|
||||
(plafond_II_d521_3 +€ allocation *€ 12,0 -€ ressources_ménage) *€ (1,0 /. 12,0)
|
||||
|
||||
# Dans les autres cas, le dépassement est nul
|
||||
définition dépassement_plafond_ressources de allocations égal à 0 €
|
||||
définition complément_dégressif de allocations égal à 0 €
|
||||
|
||||
définition montant_versé_complément_pour_base_et_majoration égal à
|
||||
si droit_ouvert_complément alors
|
||||
(dépassement_plafond_ressources de
|
||||
montant_base_complément_pour_base_et_majoration) *€ (1,0 /. 12,0)
|
||||
(complément_dégressif de
|
||||
montant_base_complément_pour_base_et_majoration)
|
||||
sinon 0 €
|
||||
|
||||
définition montant_base_complément_pour_base_et_majoration égal à
|
||||
@ -265,8 +265,7 @@ l'alinéa précédent et, d'autre part, le montant des ressources.
|
||||
champ d'application AllocationsFamiliales :
|
||||
définition montant_versé_complément_pour_forfaitaire égal à
|
||||
si droit_ouvert_complément alors
|
||||
(dépassement_plafond_ressources de montant_versé_forfaitaire) *€
|
||||
(1,0 /. 12,0)
|
||||
(complément_dégressif de montant_versé_forfaitaire)
|
||||
sinon 0 €
|
||||
```
|
||||
|
||||
@ -370,8 +369,8 @@ partir de onze ans et à 5,67 p. 100 à partir de seize ans.
|
||||
|
||||
```catala
|
||||
champ d'application AllocationsFamiliales :
|
||||
exception base_âge_limite_alinéa_1_l521_3
|
||||
définition âge_limite_alinéa_1_l521_3 de enfant
|
||||
exception decret_2008_âge_minimum_alinéa_1_l521_3
|
||||
définition âge_minimum_alinéa_1_l521_3 de enfant
|
||||
sous condition prestations_familiales.régime_outre_mer_l751_1
|
||||
conséquence égal à 11
|
||||
|
||||
|
@ -46,7 +46,8 @@ ouvre droit aux prestations familiales :
|
||||
```catala
|
||||
champ d'application PrestationsFamiliales :
|
||||
règle droit_ouvert de enfant sous condition
|
||||
(date_courante <=@ enfant.fin_obligation_scolaire)
|
||||
enfant.obligation_scolaire sous forme Avant ou
|
||||
enfant.obligation_scolaire sous forme Pendant
|
||||
conséquence rempli
|
||||
```
|
||||
|
||||
@ -55,19 +56,21 @@ tout enfant dont la rémunération éventuelle n'excède pas un plafond.
|
||||
|
||||
```catala
|
||||
champ d'application PrestationsFamiliales :
|
||||
règle droit_ouvert de enfant sous condition
|
||||
enfant.obligation_scolaire sous forme Après et
|
||||
(enfant.rémuneration_mensuelle <=€ plafond_l512_3_2) et
|
||||
(enfant.âge < âge_l512_3_2)
|
||||
conséquence rempli
|
||||
|
||||
# On définit les conditions hors âge d'abord car elles
|
||||
# sont référencées plus tard dans l'article L521-1
|
||||
règle conditions_hors_âge de enfant sous condition
|
||||
(date_courante <=@ enfant.fin_obligation_scolaire) ou
|
||||
enfant.obligation_scolaire sous forme Avant ou
|
||||
enfant.obligation_scolaire sous forme Pendant ou
|
||||
enfant.obligation_scolaire sous forme Après et
|
||||
(enfant.rémuneration_mensuelle <=€ plafond_l512_3_2)
|
||||
conséquence rempli
|
||||
|
||||
règle droit_ouvert de enfant sous condition
|
||||
(date_courante >@ enfant.fin_obligation_scolaire) et
|
||||
(conditions_hors_âge de enfant) et
|
||||
(enfant.âge < âge_l512_3_2)
|
||||
conséquence rempli
|
||||
|
||||
champ d'application AllocationsFamiliales:
|
||||
définition enfants_à_charge_droit_ouvert_prestation_familiale égal à
|
||||
filtre pour enfant dans enfants_à_charge de
|
||||
@ -79,15 +82,9 @@ de logement mentionnés aux 3° et 4° de l'article L. 511-1 , l'âge limite
|
||||
peut être différent de celui mentionné au 2° du présent article.
|
||||
|
||||
```catala
|
||||
champ d'application PrestationsFamiliales :
|
||||
définition âge_l512_3_2 sous condition
|
||||
(âge_l512_3_2_alternatif sous forme Présent) et
|
||||
(prestation_courante = ComplémentFamilial ou
|
||||
prestation_courante = AllocationLogement)
|
||||
conséquence égal à
|
||||
selon âge_l512_3_2_alternatif sous forme
|
||||
-- Présent de âge : âge
|
||||
-- Absent: 0
|
||||
# Sera géré avec une exception dans Catala. Le texte est équivalent
|
||||
# à une méta-propriété du code à vérifier : i.e. pas d'exceptions pour
|
||||
# cet âge azutre part que pour Complément Familial ou AllocationLogement.
|
||||
```
|
||||
|
||||
##### Titre 2 : Prestations générales d'entretien
|
||||
@ -117,18 +114,15 @@ celles de l'âge pour l'ouverture du droit aux allocations familiales.
|
||||
champ d'application AllocationsFamiliales :
|
||||
assertion fixé montant_versé par décret
|
||||
|
||||
# Ici, l'ouverture du droit aux allocations familiales est conditionné
|
||||
# au fait d'avoir deux enfants à charges qui répondent aux conditions
|
||||
# d'ouverture du droit à une prestation familiale. Pour cette raison,
|
||||
# nous nous référons ici aux conditions_hors_âge de prestations_familiales
|
||||
règle conditions_hors_âge de enfant sous condition
|
||||
prestations_familiales.conditions_hors_âge de enfant
|
||||
conséquence rempli
|
||||
|
||||
règle droit_ouvert_forfaitaire de enfant sous condition
|
||||
(nombre de enfants_à_charge >= nombre_enfants_l521_1) et
|
||||
# nombre_enfants_alinéa_2_l521_3 sera défini dans l'article R521-3
|
||||
(nombre de enfants_à_charge >= nombre_enfants_alinéa_2_l521_3) et
|
||||
# Puisqu'un enfant ne garde un âge donné que pour une période d'un an,
|
||||
# cette condition assure que l'allocation ne peut être distribuée que pour
|
||||
# un an.
|
||||
(enfant.âge = prestations_familiales.âge_l512_3_2) et
|
||||
(conditions_hors_âge de enfant)
|
||||
(enfant.a_déjà_ouvert_droit_aux_allocations_familiales) et
|
||||
(prestations_familiales.conditions_hors_âge de enfant)
|
||||
conséquence rempli
|
||||
```
|
||||
|
||||
@ -186,9 +180,13 @@ que ce soit, la charge effective et permanente de l'enfant.
|
||||
|
||||
```catala
|
||||
champ d'application AllocationsFamiliales :
|
||||
définition prise_en_compte de enfant égal à Complète
|
||||
définition prise_en_compte de enfant sous condition
|
||||
enfant.prise_en_charge sous forme EffectiveEtPermanente
|
||||
conséquence égal à PriseEnCompte.Complète
|
||||
|
||||
définition versement de enfant égal à Normal
|
||||
définition versement de enfant sous condition
|
||||
enfant.prise_en_charge sous forme EffectiveEtPermanente
|
||||
conséquence égal à VersementAllocations.Normal
|
||||
```
|
||||
|
||||
En cas de résidence alternée de l'enfant au domicile de chacun des parents telle
|
||||
@ -202,27 +200,23 @@ les conditions d'application du présent alinéa.
|
||||
```catala
|
||||
champ d'application AllocationsFamiliales :
|
||||
# Premier cas : garde alternée, parents désignent un unique allocataire
|
||||
exception
|
||||
définition prise_en_compte de enfant sous condition
|
||||
enfant.garde_alternée sous forme OuiAllocataireUnique
|
||||
conséquence égal à Complète
|
||||
enfant.prise_en_charge sous forme GardeAlternéeAllocataireUnique
|
||||
conséquence égal à PriseEnCompte.Complète
|
||||
|
||||
exception
|
||||
définition versement de enfant sous condition
|
||||
enfant.garde_alternée sous forme OuiAllocataireUnique
|
||||
conséquence égal à Normal
|
||||
enfant.prise_en_charge sous forme GardeAlternéeAllocataireUnique
|
||||
conséquence égal à VersementAllocations.Normal
|
||||
|
||||
# Deuxième cas : garde alternée, parents partagent la charge pour
|
||||
# l'allocation
|
||||
exception
|
||||
définition prise_en_compte de enfant sous condition
|
||||
enfant.garde_alternée sous forme OuiPartageAllocations
|
||||
conséquence égal à Partagée
|
||||
enfant.prise_en_charge sous forme GardeAlternéePartageAllocations
|
||||
conséquence égal à PriseEnCompte.Partagée
|
||||
|
||||
exception
|
||||
définition versement de enfant sous condition
|
||||
enfant.garde_alternée sous forme OuiPartageAllocations
|
||||
conséquence égal à Normal
|
||||
enfant.prise_en_charge sous forme GardeAlternéePartageAllocations
|
||||
conséquence égal à VersementAllocations.Normal
|
||||
```
|
||||
|
||||
Lorsque la personne qui assume la charge effective et permanente de l'enfant ne
|
||||
@ -231,7 +225,13 @@ du droit aux allocations familiales, ce droit s'ouvre du chef du père ou,
|
||||
à défaut, du chef de la mère.
|
||||
|
||||
```catala
|
||||
# Non formalisé pour le calcul du montant des allocations
|
||||
champ d'application AllocationsFamiliales :
|
||||
assertion
|
||||
personne_charge_effective_permanente_est_parent ou
|
||||
(
|
||||
(non personne_charge_effective_permanente_est_parent) et
|
||||
personne_charge_effective_permanente_remplit_titre_I
|
||||
)
|
||||
```
|
||||
|
||||
Lorsqu'un enfant est confié au service d'aide sociale à l'enfance, les
|
||||
@ -249,11 +249,26 @@ de l'enfant dans son foyer.
|
||||
|
||||
```catala
|
||||
champ d'application AllocationsFamiliales :
|
||||
exception
|
||||
définition prise_en_compte de enfant sous condition
|
||||
enfant.prise_en_charge sous forme
|
||||
ServicesSociauxAllocationVerséeAuxServicesSociaux
|
||||
conséquence égal à PriseEnCompte.Zéro
|
||||
|
||||
définition versement de enfant sous condition
|
||||
enfant.prise_en_charge_par_services_sociaux sous forme
|
||||
OuiAllocationVerséeAuxServicesSociaux
|
||||
conséquence égal à AllocationVerséeAuxServicesSociaux
|
||||
enfant.prise_en_charge sous forme
|
||||
ServicesSociauxAllocationVerséeAuxServicesSociaux
|
||||
conséquence égal à VersementAllocations.AllocationVerséeAuxServicesSociaux
|
||||
|
||||
définition prise_en_compte de enfant sous condition
|
||||
enfant.prise_en_charge sous forme
|
||||
ServicesSociauxAllocationVerséeÀLaFamille
|
||||
conséquence égal à PriseEnCompte.Complète
|
||||
|
||||
|
||||
définition versement de enfant sous condition
|
||||
enfant.prise_en_charge sous forme
|
||||
ServicesSociauxAllocationVerséeÀLaFamille
|
||||
conséquence égal à VersementAllocations.Normal
|
||||
```
|
||||
|
||||
Un décret en Conseil d'Etat fixe les conditions d'application du présent
|
||||
@ -282,7 +297,7 @@ champ d'application AllocationsFamiliales :
|
||||
règle droit_ouvert_majoration de enfant
|
||||
sous condition
|
||||
(non (est_enfant_le_plus_âgé de enfant)) et
|
||||
(enfant.âge >= âge_limite_alinéa_1_l521_3 de enfant)
|
||||
(enfant.âge >= âge_minimum_alinéa_1_l521_3 de enfant)
|
||||
conséquence rempli
|
||||
```
|
||||
|
||||
@ -297,7 +312,7 @@ champ d'application AllocationsFamiliales :
|
||||
sous condition
|
||||
(nombre de enfants_à_charge_droit_ouvert_prestation_familiale >=
|
||||
nombre_enfants_alinéa_2_l521_3) et
|
||||
(enfant.âge >= âge_limite_alinéa_1_l521_3 de enfant)
|
||||
(enfant.âge >= âge_minimum_alinéa_1_l521_3 de enfant)
|
||||
conséquence rempli
|
||||
```
|
||||
|
||||
@ -331,6 +346,9 @@ l'ensemble des bénéficiaires de la législation générale de sécurité
|
||||
sociale, y compris les membres des professions agricoles.
|
||||
|
||||
```catala
|
||||
# Angle mort: ici nous n'avons pas formalisé la partie sur la législation
|
||||
# générale de sécurité sociale et les membres des professions agricoles.
|
||||
|
||||
champ d'application PrestationsFamiliales :
|
||||
règle régime_outre_mer_l751_1 sous condition
|
||||
(résidence = Guadeloupe) ou
|
||||
@ -376,6 +394,12 @@ Les allocations familiales sont dues, pour tout enfant, à la personne qui a
|
||||
effectivement la charge de celui-ci.
|
||||
|
||||
```catala
|
||||
# Angle mort: ici c'est marqué "effectivement la charge" mais dans l'article de
|
||||
# L521-2 il faut charge effective ET permanente. Pourquoi cette différence ?
|
||||
# Quelles conséquences pratiques ?
|
||||
# Apparemment en 1987 il y avait encore des exceptions pour certains agents
|
||||
# publics d'outre-mer
|
||||
|
||||
champ d'application AllocationsFamiliales:
|
||||
exception
|
||||
règle droit_ouvert_base sous condition
|
||||
|
@ -48,8 +48,8 @@ enfants ouvrent droit à la majoration des allocations familiales est fixé à
|
||||
|
||||
```catala
|
||||
champ d'application AllocationsFamiliales :
|
||||
étiquette base_âge_limite_alinéa_1_l521_3
|
||||
définition âge_limite_alinéa_1_l521_3 de enfant égal à 14
|
||||
étiquette cas_base_âge_minimum_alinéa_1_l521_3
|
||||
définition âge_minimum_alinéa_1_l521_3 de enfant égal à 14
|
||||
```
|
||||
|
||||
Le nombre minimum d'enfants à charge, mentionné au deuxième alinéa de l'article
|
||||
@ -71,13 +71,15 @@ le onzième anniversaire est postérieur au 30 avril 2008.
|
||||
# du décret de 2008 pour des raisons de place seulement.
|
||||
champ d'application AllocationFamilialesAvril2008:
|
||||
# Âge limite avant décret n° 2008-409 du 28 avril 2008
|
||||
définition âge_limite_alinéa_1_l521_3 égal à 16
|
||||
définition âge_minimum_alinéa_1_l521_3 égal à 16
|
||||
|
||||
champ d'application AllocationsFamiliales :
|
||||
définition âge_limite_alinéa_1_l521_3 de enfant
|
||||
sous condition (enfant.date_de_naissance +@ 11 an <=@ |30/04/2008|)
|
||||
étiquette decret_2008_âge_minimum_alinéa_1_l521_3
|
||||
exception cas_base_âge_minimum_alinéa_1_l521_3
|
||||
définition âge_minimum_alinéa_1_l521_3 de enfant
|
||||
sous condition (enfant.date_de_naissance +@ 11 an <=@ |2008-04-30|)
|
||||
conséquence égal à
|
||||
version_avril_2008.âge_limite_alinéa_1_l521_3
|
||||
version_avril_2008.âge_minimum_alinéa_1_l521_3
|
||||
```
|
||||
|
||||
#### [Article R521-2|LEGIARTI000006750608]
|
||||
@ -141,6 +143,10 @@ champ d'application AllocationsFamiliales :
|
||||
selon (prise_en_compte de enfant) sous forme
|
||||
-- Complète : 1,0
|
||||
-- Partagée : 0,5
|
||||
# Pas directement dans cet arricle de loi, mais concerne le
|
||||
# cas où l'enfant est pris en charge par les services sociaux et
|
||||
# la part de l'allocation va également au service social
|
||||
-- Zéro: 0,0
|
||||
)
|
||||
```
|
||||
|
||||
@ -177,6 +183,10 @@ champ d'application AllocationsFamiliales :
|
||||
selon (prise_en_compte de enfant) sous forme
|
||||
-- Complète : 100%
|
||||
-- Partagée : 50%
|
||||
# Pas directement dans cet arricle de loi, mais concerne le
|
||||
# cas où l'enfant est pris en charge par les services sociaux et
|
||||
# la part de l'allocation va également au service social
|
||||
-- Zéro: 0%
|
||||
)
|
||||
```
|
||||
|
||||
|
@ -15,38 +15,38 @@ déclaration champ d'application Données:
|
||||
champ d'application Données:
|
||||
définition enfant1 égal à EnfantEntrée {
|
||||
-- d_identifiant: 1
|
||||
-- d_date_de_naissance: |01/01/2007|
|
||||
-- d_date_de_naissance: |2007-01-01|
|
||||
-- d_rémuneration_mensuelle: 0€
|
||||
-- d_prise_en_charge_par_services_sociaux: NonPriseEnChargeFamille
|
||||
-- d_garde_alternée: NonGardeUnique
|
||||
-- d_prise_en_charge: EffectiveEtPermanente
|
||||
-- d_a_déjà_ouvert_droit_aux_allocations_familiales: vrai
|
||||
}
|
||||
définition enfant2 égal à EnfantEntrée {
|
||||
-- d_identifiant: 2
|
||||
-- d_date_de_naissance: |01/01/2009|
|
||||
-- d_date_de_naissance: |2009-01-01|
|
||||
-- d_rémuneration_mensuelle: 0€
|
||||
-- d_prise_en_charge_par_services_sociaux: NonPriseEnChargeFamille
|
||||
-- d_garde_alternée: NonGardeUnique
|
||||
-- d_prise_en_charge: EffectiveEtPermanente
|
||||
-- d_a_déjà_ouvert_droit_aux_allocations_familiales: vrai
|
||||
}
|
||||
définition enfant3 égal à EnfantEntrée {
|
||||
-- d_identifiant: 3
|
||||
-- d_date_de_naissance: |01/01/2003|
|
||||
-- d_date_de_naissance: |2003-01-01|
|
||||
-- d_rémuneration_mensuelle: 400€
|
||||
-- d_prise_en_charge_par_services_sociaux: NonPriseEnChargeFamille
|
||||
-- d_garde_alternée: OuiPartageAllocations
|
||||
-- d_prise_en_charge: GardeAlternéePartageAllocations
|
||||
-- d_a_déjà_ouvert_droit_aux_allocations_familiales: vrai
|
||||
}
|
||||
définition enfant4 égal à EnfantEntrée {
|
||||
-- d_identifiant: 4
|
||||
-- d_date_de_naissance: |01/01/2001|
|
||||
-- d_date_de_naissance: |2001-01-01|
|
||||
-- d_rémuneration_mensuelle: 1100€
|
||||
-- d_prise_en_charge_par_services_sociaux: NonPriseEnChargeFamille
|
||||
-- d_garde_alternée: NonGardeUnique
|
||||
-- d_prise_en_charge: EffectiveEtPermanente
|
||||
-- d_a_déjà_ouvert_droit_aux_allocations_familiales: vrai
|
||||
}
|
||||
définition enfant5 égal à EnfantEntrée {
|
||||
-- d_identifiant: 5
|
||||
-- d_date_de_naissance: |01/01/2000|
|
||||
-- d_date_de_naissance: |2000-01-01|
|
||||
-- d_rémuneration_mensuelle: 0€
|
||||
-- d_prise_en_charge_par_services_sociaux: NonPriseEnChargeFamille
|
||||
-- d_garde_alternée: NonGardeUnique
|
||||
-- d_prise_en_charge: EffectiveEtPermanente
|
||||
-- d_a_déjà_ouvert_droit_aux_allocations_familiales: vrai
|
||||
}
|
||||
|
||||
déclaration champ d'application Test1:
|
||||
@ -57,8 +57,9 @@ champ d'application Test1:
|
||||
définition f.enfants égal à
|
||||
[données.enfant1;données.enfant2;données.enfant3;données.enfant4]
|
||||
définition f.ressources_ménage égal à 30 000 €
|
||||
définition f.date_courante égal à |01/05/2020|
|
||||
définition f.date_courante égal à |2020-05-01|
|
||||
définition f.résidence égal à Métropole
|
||||
règle f.personne_charge_effective_permanente_est_parent rempli
|
||||
assertion f.montant_versé = 351,26€
|
||||
|
||||
déclaration champ d'application Test2:
|
||||
@ -69,8 +70,9 @@ champ d'application Test2:
|
||||
définition f.enfants égal à
|
||||
[données.enfant1;données.enfant2;données.enfant5]
|
||||
définition f.ressources_ménage égal à 30 000 €
|
||||
définition f.date_courante égal à |01/05/2020|
|
||||
définition f.date_courante égal à |2020-05-01|
|
||||
définition f.résidence égal à Métropole
|
||||
règle f.personne_charge_effective_permanente_est_parent rempli
|
||||
assertion f.montant_versé = 216,27€
|
||||
|
||||
|
||||
@ -81,8 +83,9 @@ déclaration champ d'application Test3:
|
||||
champ d'application Test3:
|
||||
définition f.enfants égal à [données.enfant1]
|
||||
définition f.ressources_ménage égal à 63540 €
|
||||
définition f.date_courante égal à |01/05/2020|
|
||||
définition f.date_courante égal à |2020-05-01|
|
||||
définition f.résidence égal à Guyane
|
||||
règle f.personne_charge_effective_permanente_est_parent rempli
|
||||
assertion f.montant_versé = 12,18€
|
||||
|
||||
déclaration champ d'application Test4:
|
||||
@ -92,8 +95,9 @@ déclaration champ d'application Test4:
|
||||
champ d'application Test4:
|
||||
définition f.enfants égal à [données.enfant1; données.enfant3]
|
||||
définition f.ressources_ménage égal à 67 250 €
|
||||
définition f.date_courante égal à |01/05/2020|
|
||||
définition f.date_courante égal à |2020-05-01|
|
||||
définition f.résidence égal à Métropole
|
||||
règle f.personne_charge_effective_permanente_est_parent rempli
|
||||
assertion f.montant_versé = 99,37€
|
||||
|
||||
déclaration champ d'application Test5:
|
||||
@ -103,8 +107,9 @@ déclaration champ d'application Test5:
|
||||
champ d'application Test5:
|
||||
définition f.enfants égal à [données.enfant1]
|
||||
définition f.ressources_ménage égal à 30 000 €
|
||||
définition f.date_courante égal à |01/05/2020|
|
||||
définition f.date_courante égal à |2020-05-01|
|
||||
définition f.résidence égal à Métropole
|
||||
règle f.personne_charge_effective_permanente_est_parent rempli
|
||||
assertion f.montant_versé = 0,00€
|
||||
|
||||
déclaration champ d'application Test6:
|
||||
@ -113,21 +118,22 @@ déclaration champ d'application Test6:
|
||||
champ d'application Test6:
|
||||
définition f.enfants égal à [EnfantEntrée {
|
||||
-- d_identifiant: 0
|
||||
-- d_date_de_naissance: |10/11/2009|
|
||||
-- d_date_de_naissance: |2009-11-10|
|
||||
-- d_rémuneration_mensuelle: 439€
|
||||
-- d_prise_en_charge_par_services_sociaux: NonPriseEnChargeFamille
|
||||
-- d_garde_alternée: NonGardeUnique
|
||||
-- d_prise_en_charge: EffectiveEtPermanente
|
||||
-- d_a_déjà_ouvert_droit_aux_allocations_familiales: vrai
|
||||
};EnfantEntrée {
|
||||
-- d_identifiant: 1
|
||||
-- d_date_de_naissance: |25/09/2020|
|
||||
-- d_date_de_naissance: |2020-09-25|
|
||||
-- d_rémuneration_mensuelle: 1949€
|
||||
-- d_prise_en_charge_par_services_sociaux: NonPriseEnChargeFamille
|
||||
-- d_garde_alternée: NonGardeUnique
|
||||
-- d_prise_en_charge: EffectiveEtPermanente
|
||||
-- d_a_déjà_ouvert_droit_aux_allocations_familiales: vrai
|
||||
}]
|
||||
définition f.ressources_ménage égal à 78 830 €
|
||||
définition f.date_courante égal à |01/05/2020|
|
||||
définition f.date_courante égal à |2020-05-01|
|
||||
définition f.résidence égal à Guadeloupe
|
||||
assertion f.montant_versé = 132,49€
|
||||
règle f.personne_charge_effective_permanente_est_parent rempli
|
||||
assertion f.montant_versé = 66,25€
|
||||
|
||||
déclaration champ d'application Test7:
|
||||
contexte f champ d'application InterfaceAllocationsFamiliales
|
||||
@ -137,9 +143,33 @@ champ d'application Test7:
|
||||
définition f.enfants égal à
|
||||
[données.enfant1;données.enfant2;données.enfant3;données.enfant4]
|
||||
définition f.ressources_ménage égal à 30 000 €
|
||||
définition f.date_courante égal à |01/02/2021|
|
||||
définition f.date_courante égal à |2021-02-01|
|
||||
définition f.résidence égal à Métropole
|
||||
règle f.personne_charge_effective_permanente_est_parent rempli
|
||||
assertion f.montant_versé = 417,51€
|
||||
|
||||
déclaration champ d'application Test8:
|
||||
contexte f champ d'application InterfaceAllocationsFamiliales
|
||||
|
||||
champ d'application Test8:
|
||||
définition f.enfants égal à [EnfantEntrée {
|
||||
-- d_identifiant: 0
|
||||
-- d_date_de_naissance: |2004-01-01|
|
||||
-- d_rémuneration_mensuelle: 0€
|
||||
-- d_prise_en_charge: EffectiveEtPermanente
|
||||
-- d_a_déjà_ouvert_droit_aux_allocations_familiales: vrai
|
||||
};EnfantEntrée {
|
||||
-- d_identifiant: 1
|
||||
-- d_date_de_naissance: |2005-01-01|
|
||||
-- d_rémuneration_mensuelle: 0€
|
||||
-- d_prise_en_charge: EffectiveEtPermanente
|
||||
-- d_a_déjà_ouvert_droit_aux_allocations_familiales: vrai
|
||||
}]
|
||||
définition f.ressources_ménage égal à 69945 €
|
||||
définition f.date_courante égal à |2021-01-01|
|
||||
définition f.résidence égal à Métropole
|
||||
règle f.personne_charge_effective_permanente_est_parent rempli
|
||||
assertion f.montant_versé = 197,74€
|
||||
|
||||
|
||||
```
|
||||
|
@ -14,39 +14,39 @@ déclaration champ d'application Données:
|
||||
champ d'application Données:
|
||||
définition enfant1 égal à Enfant {
|
||||
-- identifiant: 1
|
||||
-- fin_obligation_scolaire : |01/08/2023|
|
||||
-- date_de_naissance: |01/01/2007|
|
||||
-- obligation_scolaire : Pendant
|
||||
-- date_de_naissance: |2007-01-01|
|
||||
-- âge: 13
|
||||
-- rémuneration_mensuelle: 0€
|
||||
-- prise_en_charge_par_services_sociaux: NonPriseEnChargeFamille
|
||||
-- garde_alternée: NonGardeUnique
|
||||
-- prise_en_charge: EffectiveEtPermanente
|
||||
-- a_déjà_ouvert_droit_aux_allocations_familiales: vrai
|
||||
}
|
||||
définition enfant2 égal à Enfant {
|
||||
-- identifiant: 2
|
||||
-- fin_obligation_scolaire : |01/08/2019|
|
||||
-- date_de_naissance: |01/01/2003|
|
||||
-- obligation_scolaire : Après
|
||||
-- date_de_naissance: |2003-01-01|
|
||||
-- âge: 18
|
||||
-- rémuneration_mensuelle: 1000€
|
||||
-- prise_en_charge_par_services_sociaux: NonPriseEnChargeFamille
|
||||
-- garde_alternée: NonGardeUnique
|
||||
-- prise_en_charge: EffectiveEtPermanente
|
||||
-- a_déjà_ouvert_droit_aux_allocations_familiales: vrai
|
||||
}
|
||||
définition enfant3 égal à Enfant {
|
||||
-- identifiant: 3
|
||||
-- fin_obligation_scolaire : |01/08/2019|
|
||||
-- date_de_naissance: |01/01/2003|
|
||||
-- obligation_scolaire : Après
|
||||
-- date_de_naissance: |2003-01-01|
|
||||
-- âge: 18
|
||||
-- rémuneration_mensuelle: 400€
|
||||
-- prise_en_charge_par_services_sociaux: NonPriseEnChargeFamille
|
||||
-- garde_alternée: NonGardeUnique
|
||||
-- prise_en_charge: EffectiveEtPermanente
|
||||
-- a_déjà_ouvert_droit_aux_allocations_familiales: vrai
|
||||
}
|
||||
définition enfant4 égal à Enfant {
|
||||
-- identifiant: 4
|
||||
-- fin_obligation_scolaire : |01/08/2016|
|
||||
-- date_de_naissance: |01/01/1999|
|
||||
-- obligation_scolaire : Après
|
||||
-- date_de_naissance: |1999-01-01|
|
||||
-- âge: 21
|
||||
-- rémuneration_mensuelle: 0€
|
||||
-- prise_en_charge_par_services_sociaux: NonPriseEnChargeFamille
|
||||
-- garde_alternée: NonGardeUnique
|
||||
-- prise_en_charge: EffectiveEtPermanente
|
||||
-- a_déjà_ouvert_droit_aux_allocations_familiales: vrai
|
||||
}
|
||||
|
||||
déclaration champ d'application Test1:
|
||||
@ -54,8 +54,7 @@ déclaration champ d'application Test1:
|
||||
contexte f champ d'application PrestationsFamiliales
|
||||
|
||||
champ d'application Test1:
|
||||
définition f.âge_l512_3_2_alternatif égal à Absent
|
||||
définition f.date_courante égal à |01/05/2020|
|
||||
définition f.date_courante égal à |2020-05-01|
|
||||
définition f.prestation_courante égal à AllocationsFamiliales
|
||||
définition f.résidence égal à Métropole
|
||||
assertion (f.droit_ouvert de données.enfant1)
|
||||
|
4
examples/hawaii_lfo/Makefile
Normal file
4
examples/hawaii_lfo/Makefile
Normal file
@ -0,0 +1,4 @@
|
||||
CATALA_LANG=en
|
||||
SRC=Title17-MotorAndOtherVehicles.catala_en
|
||||
|
||||
include ../Makefile.common.mk
|
164
examples/hawaii_lfo/Title17-MotorAndOtherVehicles.catala_en
Normal file
164
examples/hawaii_lfo/Title17-MotorAndOtherVehicles.catala_en
Normal file
@ -0,0 +1,164 @@
|
||||
## Title17
|
||||
|
||||
> Begin metadata
|
||||
|
||||
```catala
|
||||
declaration enumeration Violation_83_135:
|
||||
-- Section286_102
|
||||
-- Section286_122
|
||||
-- Section286_130
|
||||
-- Section286_131
|
||||
-- Section286_132
|
||||
-- Section286_133
|
||||
-- Section286_134
|
||||
-- Other_83_135
|
||||
|
||||
declaration structure Offense:
|
||||
data date_of content date
|
||||
data violation content Violation_83_135
|
||||
|
||||
declaration scope Defendant:
|
||||
context priors content collection Offense
|
||||
# Only a number of years...
|
||||
context age content integer
|
||||
|
||||
declaration scope Penalty286_83_135:
|
||||
|
||||
# Inputs:
|
||||
|
||||
context fine content money
|
||||
context days content duration
|
||||
context loses_right_to_drive_until_18 condition
|
||||
context offense content Offense
|
||||
context defendant scope Defendant
|
||||
|
||||
# Internal:
|
||||
|
||||
context priors_same_offense content integer
|
||||
|
||||
context max_fine content money
|
||||
context min_fine content money
|
||||
context max_days content duration
|
||||
|
||||
context paragraph_a_applies condition
|
||||
context paragraph_b_applies condition
|
||||
context paragraph_c_applies condition
|
||||
|
||||
context fine_ok condition
|
||||
context days_ok condition
|
||||
|
||||
# Outcomes:
|
||||
|
||||
context ok condition
|
||||
```
|
||||
> End metadata
|
||||
|
||||
## [286-136 Penalty]
|
||||
|
||||
```catala
|
||||
scope Penalty286_83_135:
|
||||
|
||||
rule fine_ok under condition min_fine <=$ fine and fine <=$ max_fine
|
||||
consequence fulfilled
|
||||
|
||||
rule days_ok under condition days <=^ max_days
|
||||
consequence fulfilled
|
||||
|
||||
rule ok under condition fine_ok and days_ok
|
||||
consequence fulfilled
|
||||
```
|
||||
|
||||
§(a) Except as provided in subsection (b), any person who
|
||||
violates section 286-102, 286-122, 286-130, 286-131, 286-132, 286-133, or
|
||||
286-134 shall be fined not more than $1,000 or imprisoned not more than thirty
|
||||
days, or both. Any person who violates any other section in this part shall be
|
||||
fined not more than $1,000.
|
||||
|
||||
```catala
|
||||
scope Penalty286_83_135:
|
||||
|
||||
rule paragraph_a_applies under condition
|
||||
(not paragraph_b_applies) and
|
||||
(not paragraph_c_applies)
|
||||
consequence fulfilled
|
||||
|
||||
definition min_fine under condition
|
||||
paragraph_a_applies
|
||||
consequence equals $0
|
||||
|
||||
definition max_fine equals $1000
|
||||
|
||||
label max_days_a
|
||||
definition max_days under condition
|
||||
paragraph_a_applies
|
||||
consequence equals 0 day
|
||||
|
||||
exception max_days_a definition max_days under condition
|
||||
paragraph_a_applies and
|
||||
offense.violation with pattern Section286_102 or
|
||||
offense.violation with pattern Section286_122 or
|
||||
offense.violation with pattern Section286_130 or
|
||||
offense.violation with pattern Section286_131 or
|
||||
offense.violation with pattern Section286_132 or
|
||||
offense.violation with pattern Section286_133 or
|
||||
offense.violation with pattern Section286_134
|
||||
consequence equals 30 day
|
||||
```
|
||||
|
||||
(b) Any person who is convicted of violating section 286-102, 286-122, 286-130,
|
||||
286-131, 286-132, 286-133, or 286-134 shall be subject to a minimum fine of $500
|
||||
and a maximum fine of $1,000, or imprisoned not more than one year, or both, if
|
||||
the person has two or more prior convictions for the same offense in the
|
||||
preceding five-year period.
|
||||
|
||||
```catala
|
||||
scope Penalty286_83_135:
|
||||
|
||||
# Under subsection (b) (1996), it is the date the defendant committed the current
|
||||
# offense for which he or she is being prosecuted that is used to determine
|
||||
# whether the defendant has two or more prior convictions for the same offense in
|
||||
# the preceding five-year period. 118 H. 259 (App.), 188 P.3d 773 (2008).
|
||||
|
||||
# TODO: need to figure out how years are defined
|
||||
definition priors_same_offense equals
|
||||
number for prior in defendant.priors of (
|
||||
prior.violation = offense.violation and
|
||||
prior.date_of +@ 5 year <=@ offense.date_of
|
||||
)
|
||||
|
||||
rule paragraph_b_applies under condition
|
||||
(not (offense.violation with pattern Other_83_135)) and
|
||||
priors_same_offense >= 2 and
|
||||
not paragraph_c_applies
|
||||
consequence fulfilled
|
||||
|
||||
definition min_fine under condition
|
||||
paragraph_b_applies
|
||||
consequence equals $500
|
||||
|
||||
definition max_days under condition
|
||||
paragraph_b_applies
|
||||
consequence equals 1 year
|
||||
```
|
||||
|
||||
(c) Notwithstanding subsections (a) and (b), a minor under the age of eighteen
|
||||
under the jurisdiction of the family court who is subject to this section shall
|
||||
either lose the right to drive a motor vehicle until the age of eighteen or be
|
||||
subject to a fine of $500. [L 1967, c 214, pt of §2; HRS §286-136; am L 1993, c
|
||||
214, §7; am L 1996, c 169, §3; am L 2003, c 69, §5]
|
||||
|
||||
```catala
|
||||
scope Penalty286_83_135:
|
||||
|
||||
rule paragraph_c_applies under condition
|
||||
# TODO: check what happens if the offense is committed on the day of the
|
||||
# birthday
|
||||
defendant.age < 18 # and minor and under the jurisdiction etc.
|
||||
consequence fulfilled
|
||||
|
||||
# TODO: use a boolean xor
|
||||
exception definition fine_ok under condition paragraph_c_applies
|
||||
# TODO: = and != are usually left-associative
|
||||
consequence equals ((fine = $500) != loses_right_to_drive_until_18)
|
||||
|
||||
```
|
@ -51,7 +51,7 @@ scope BasisOfGift:
|
||||
transferor.basis
|
||||
|
||||
definition basis under condition
|
||||
acquisition.moment > |12/31/1920| and
|
||||
acquisition.moment > |1920-12-31| and
|
||||
acquisition.method = Gift
|
||||
consequence equals basis_subsection_a
|
||||
```
|
||||
@ -68,7 +68,7 @@ scope BasisOfGift:
|
||||
|
||||
```catala
|
||||
scope BasisOfGift under condition
|
||||
acquisition.moment > |01/31/1920| and
|
||||
acquisition.moment > |1920-01-31| and
|
||||
acquisition.method = Gift:
|
||||
|
||||
definition transferor.basis equals
|
||||
@ -88,7 +88,7 @@ made.
|
||||
|
||||
```catala
|
||||
scope BasisOfGift under condition
|
||||
acquisition.moment > |01/31/1920| and
|
||||
acquisition.moment > |1920-01-31| and
|
||||
acquisition.method = Trust:
|
||||
|
||||
definition basis equals
|
||||
@ -102,7 +102,7 @@ If the property was acquired by gift or transfer in trust on or before December
|
||||
of such acquisition.
|
||||
|
||||
```catala
|
||||
scope BasisOfGift under condition acquisition.moment <= |01/31/1920|:
|
||||
scope BasisOfGift under condition acquisition.moment <= |1920-01-31|:
|
||||
definition basis equals
|
||||
value.fair_market of acquisition.moment
|
||||
```
|
||||
@ -117,7 +117,7 @@ amount of gift tax paid with respect to such gift, or
|
||||
|
||||
```catala
|
||||
scope BasisOfGift under condition
|
||||
acquisition.moment >= |09/02/1958| and
|
||||
acquisition.moment >= |1958-09-02| and
|
||||
acquisition.method = Gift:
|
||||
|
||||
definition basis equals
|
||||
@ -139,7 +139,7 @@ gift.
|
||||
|
||||
```catala
|
||||
scope BasisOfGift under condition
|
||||
acquisition.moment < |09/02/1958| and
|
||||
acquisition.moment < |1958-09-02| and
|
||||
acquisition.method = Gift and
|
||||
acquisition.no_sale_or_exchange_before:
|
||||
|
||||
@ -222,7 +222,7 @@ bears the same ratio to the amount of tax so paid as—
|
||||
|
||||
```catala
|
||||
scope BasisOfGift under condition
|
||||
acquisition.moment > |09/02/1976| and
|
||||
acquisition.moment > |1976-09-02| and
|
||||
acquisition.method = Gift:
|
||||
|
||||
definition basis_bonus_after_1976 equals
|
||||
|
@ -16,20 +16,20 @@ declaration scope Data:
|
||||
context person_ko_2 content PersonalData
|
||||
|
||||
scope Data:
|
||||
definition date_of_sale_or_exchange equals |01/01/2021|
|
||||
definition return_date equals |01/01/2021|
|
||||
definition date_of_sale_or_exchange equals |2021-01-01|
|
||||
definition return_date equals |2021-01-01|
|
||||
definition gain_from_sale_or_exchange_of_property equals $350,000
|
||||
definition period_four_years_recent equals Period {
|
||||
-- begin: |01/01/2017|
|
||||
-- end: |01/01/2021|
|
||||
-- begin: |2017-01-01|
|
||||
-- end: |2021-01-01|
|
||||
}
|
||||
definition period_one_year_recent equals Period {
|
||||
-- begin: |01/01/2019|
|
||||
-- end: |01/01/2020|
|
||||
-- begin: |2019-01-01|
|
||||
-- end: |2020-01-01|
|
||||
}
|
||||
definition period_two_years_middle equals Period {
|
||||
-- begin: |01/01/2015|
|
||||
-- end: |01/02/2017|
|
||||
-- begin: |2015-01-01|
|
||||
-- end: |2017-01-02|
|
||||
}
|
||||
definition person_ok_1 equals PersonalData {
|
||||
-- property_ownage: [period_four_years_recent]
|
||||
|
52
french_law_js/README.md
Normal file
52
french_law_js/README.md
Normal file
@ -0,0 +1,52 @@
|
||||
# The French Law Javascript Library
|
||||
|
||||
This Javascript library contains some computations defined by French
|
||||
legislative texts. The JS code is extracted from OCaml, which is itself
|
||||
extracted from Catala code (https://catala-lang.org).
|
||||
|
||||
## Allocations familiales
|
||||
|
||||
The function of the library 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:
|
||||
|
||||
- _la base des allocations familiales_
|
||||
- _l'allocation forfaitaire relai pour dépassement de l'âge limite_
|
||||
- _la majoration pour âge_
|
||||
- _le complément dégressif en cas de dépassement du plafond de revenus_
|
||||
|
||||
An example of use:
|
||||
|
||||
```javascript
|
||||
Law.computeAllocationsFamiliales({
|
||||
currentDate: new Date("2020-05-20"),
|
||||
children: [
|
||||
{
|
||||
id: 0,
|
||||
remunerationMensuelle: 0,
|
||||
dateNaissance: new Date("2003-03-02"),
|
||||
priseEnCharge: "Effective et permanente",
|
||||
aDejaOuvertDroitAuxAllocationsFamiliales: true,
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
remunerationMensuelle: 300,
|
||||
dateNaissance: new Date("2013-10-30"),
|
||||
priseEnCharge: "Garde alternée, partage des allocations",
|
||||
aDejaOuvertDroitAuxAllocationsFamiliales: true,
|
||||
},
|
||||
],
|
||||
income: 30000,
|
||||
residence: "Métropole",
|
||||
personneQuiAssumeLaChargeEffectivePermanenteEstParent: true,
|
||||
personneQuiAssumeLaChargeEffectivePermanenteRemplitConditionsTitreISecuriteSociale: true,
|
||||
});
|
||||
```
|
||||
|
||||
Notably, the `priseEnCharge` variable for each child expects a value among:
|
||||
|
||||
- `"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"`
|
@ -11,26 +11,24 @@ suite
|
||||
id: 0,
|
||||
remunerationMensuelle: 0,
|
||||
dateNaissance: new Date("2003-03-02"),
|
||||
gardeAlternee: false,
|
||||
priseEnChargeServiceSociaux: false,
|
||||
priseEnCharge: "Effective et permanente",
|
||||
aDejaOuvertDroitAuxAllocationsFamiliales: true,
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
remunerationMensuelle: 300,
|
||||
dateNaissance: new Date("2013-10-30"),
|
||||
gardeAlternee: true,
|
||||
gardeAlterneePartageAllocation: true,
|
||||
priseEnChargeServiceSociaux: false,
|
||||
priseEnCharge: "Garde alternée, partage des allocations",
|
||||
aDejaOuvertDroitAuxAllocationsFamiliales: true,
|
||||
},
|
||||
],
|
||||
income: 30000,
|
||||
residence: "Métropole",
|
||||
personneQuiAssumeLaChargeEffectivePermanenteEstParent: true,
|
||||
personneQuiAssumeLaChargeEffectivePermanenteRemplitConditionsTitreISecuriteSociale: true,
|
||||
});
|
||||
})
|
||||
.on("cycle", function (event) {
|
||||
console.log(String(event.target));
|
||||
})
|
||||
.on("complete", function () {
|
||||
console.log("Fastest is " + this.filter("fastest").map("name"));
|
||||
})
|
||||
.run({ async: true });
|
4000
french_law_js/french_law.js
Normal file
4000
french_law_js/french_law.js
Normal file
File diff suppressed because one or more lines are too long
59
french_law_js/package-lock.json
generated
Normal file
59
french_law_js/package-lock.json
generated
Normal file
@ -0,0 +1,59 @@
|
||||
{
|
||||
"name": "french_law",
|
||||
"version": "0.3.0",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "french_law",
|
||||
"version": "0.3.0",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"benchmark": "^2.1.4",
|
||||
"lodash": "^4.17.20",
|
||||
"platform": "^1.3.6"
|
||||
},
|
||||
"devDependencies": {}
|
||||
},
|
||||
"node_modules/benchmark": {
|
||||
"version": "2.1.4",
|
||||
"resolved": "https://registry.npmjs.org/benchmark/-/benchmark-2.1.4.tgz",
|
||||
"integrity": "sha1-CfPeMckWQl1JjMLuVloOvzwqVik=",
|
||||
"dependencies": {
|
||||
"lodash": "^4.17.4",
|
||||
"platform": "^1.3.3"
|
||||
}
|
||||
},
|
||||
"node_modules/lodash": {
|
||||
"version": "4.17.20",
|
||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz",
|
||||
"integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA=="
|
||||
},
|
||||
"node_modules/platform": {
|
||||
"version": "1.3.6",
|
||||
"resolved": "https://registry.npmjs.org/platform/-/platform-1.3.6.tgz",
|
||||
"integrity": "sha512-fnWVljUchTro6RiCFvCXBbNhJc2NijN7oIQxbwsyL0buWJPG85v81ehlHI9fXrJsMNgTofEoWIQeClKpgxFLrg=="
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"benchmark": {
|
||||
"version": "2.1.4",
|
||||
"resolved": "https://registry.npmjs.org/benchmark/-/benchmark-2.1.4.tgz",
|
||||
"integrity": "sha1-CfPeMckWQl1JjMLuVloOvzwqVik=",
|
||||
"requires": {
|
||||
"lodash": "^4.17.4",
|
||||
"platform": "^1.3.3"
|
||||
}
|
||||
},
|
||||
"lodash": {
|
||||
"version": "4.17.20",
|
||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz",
|
||||
"integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA=="
|
||||
},
|
||||
"platform": {
|
||||
"version": "1.3.6",
|
||||
"resolved": "https://registry.npmjs.org/platform/-/platform-1.3.6.tgz",
|
||||
"integrity": "sha512-fnWVljUchTro6RiCFvCXBbNhJc2NijN7oIQxbwsyL0buWJPG85v81ehlHI9fXrJsMNgTofEoWIQeClKpgxFLrg=="
|
||||
}
|
||||
}
|
||||
}
|
28
french_law_js/package.json
Normal file
28
french_law_js/package.json
Normal file
@ -0,0 +1,28 @@
|
||||
{
|
||||
"name": "french_law",
|
||||
"version": "0.3.0",
|
||||
"description": "Library of computations defined by French legislative texts, extract from Catala programs (https://catala-lang.org)",
|
||||
"main": "french_law.js",
|
||||
"dependencies": {
|
||||
"benchmark": "^2.1.4",
|
||||
"lodash": "^4.17.20",
|
||||
"platform": "^1.3.6"
|
||||
},
|
||||
"devDependencies": {},
|
||||
"scripts": {
|
||||
"test": "node allocations_familiales.js"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/CatalaLang/catala.git"
|
||||
},
|
||||
"keywords": [
|
||||
"law"
|
||||
],
|
||||
"author": "Denis Merigoux",
|
||||
"license": "Apache-2.0",
|
||||
"bugs": {
|
||||
"url": "https://github.com/CatalaLang/catala/issues"
|
||||
},
|
||||
"homepage": "https://github.com/CatalaLang/catala#readme"
|
||||
}
|
@ -24,10 +24,10 @@ cat examples/allocations_familiales/securite_sociale_R.catala_fr >> allocations_
|
||||
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
|
||||
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/
|
||||
scp javascript/french_law.js $1/french_law.js
|
||||
scp french_law_js/french_law.js $1/french_law.js
|
||||
|
@ -1 +0,0 @@
|
||||
../_build/default/src/french_law/api_web.bc.js
|
25
javascript/package-lock.json
generated
25
javascript/package-lock.json
generated
@ -1,25 +0,0 @@
|
||||
{
|
||||
"requires": true,
|
||||
"lockfileVersion": 1,
|
||||
"dependencies": {
|
||||
"benchmark": {
|
||||
"version": "2.1.4",
|
||||
"resolved": "https://registry.npmjs.org/benchmark/-/benchmark-2.1.4.tgz",
|
||||
"integrity": "sha1-CfPeMckWQl1JjMLuVloOvzwqVik=",
|
||||
"requires": {
|
||||
"lodash": "^4.17.4",
|
||||
"platform": "^1.3.3"
|
||||
}
|
||||
},
|
||||
"lodash": {
|
||||
"version": "4.17.20",
|
||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz",
|
||||
"integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA=="
|
||||
},
|
||||
"platform": {
|
||||
"version": "1.3.6",
|
||||
"resolved": "https://registry.npmjs.org/platform/-/platform-1.3.6.tgz",
|
||||
"integrity": "sha512-fnWVljUchTro6RiCFvCXBbNhJc2NijN7oIQxbwsyL0buWJPG85v81ehlHI9fXrJsMNgTofEoWIQeClKpgxFLrg=="
|
||||
}
|
||||
}
|
||||
}
|
@ -159,7 +159,7 @@ let rec evaluate_operator (ctx : Ast.decl_ctx) (op : A.operator Pos.marked)
|
||||
| A.Binop (A.Gt KDate), [ ELit (LDate i1); ELit (LDate i2) ] ->
|
||||
A.ELit (LBool Runtime.(i1 >@ i2))
|
||||
| A.Binop (A.Gte KDate), [ ELit (LDate i1); ELit (LDate i2) ] ->
|
||||
A.ELit (LBool Runtime.(i1 >@ i2))
|
||||
A.ELit (LBool Runtime.(i1 >=@ i2))
|
||||
| A.Binop A.Eq, [ ELit LUnit; ELit LUnit ] -> A.ELit (LBool true)
|
||||
| A.Binop A.Eq, [ ELit (LDuration i1); ELit (LDuration i2) ] ->
|
||||
A.ELit (LBool Runtime.(i1 =^ i2))
|
||||
|
@ -59,20 +59,8 @@ let rec format_typ (ctx : Ast.decl_ctx) (fmt : Format.formatter)
|
||||
~pp_sep:(fun fmt () -> Format.fprintf fmt "@ *@ ")
|
||||
(fun fmt t -> Format.fprintf fmt "%a" format_typ t))
|
||||
ts
|
||||
| TTuple (ts, Some s) ->
|
||||
Format.fprintf fmt "%a @[<hov 2>{@ %a@ }@]" Ast.StructName.format_t s
|
||||
(Format.pp_print_list
|
||||
~pp_sep:(fun fmt () -> Format.fprintf fmt ";@ ")
|
||||
(fun fmt (t, f) ->
|
||||
Format.fprintf fmt "%a:@ %a" Ast.StructFieldName.format_t f format_typ t))
|
||||
(List.combine ts (List.map fst (Ast.StructMap.find s ctx.ctx_structs)))
|
||||
| TEnum (ts, e) ->
|
||||
Format.fprintf fmt "%a [@[<hov 2>%a@]]" Ast.EnumName.format_t e
|
||||
(Format.pp_print_list
|
||||
~pp_sep:(fun fmt () -> Format.fprintf fmt "@ |@ ")
|
||||
(fun fmt (t, f) ->
|
||||
Format.fprintf fmt "%a:@ %a" Ast.EnumConstructor.format_t f format_typ t))
|
||||
(List.combine ts (List.map fst (Ast.EnumMap.find e ctx.ctx_enums)))
|
||||
| TTuple (_ts, Some s) -> Format.fprintf fmt "%a" Ast.StructName.format_t s
|
||||
| TEnum (_ts, e) -> Format.fprintf fmt "%a" Ast.EnumName.format_t e
|
||||
| TArrow (t1, t2) ->
|
||||
Format.fprintf fmt "@[<hov 2>%a →@ %a@]" format_typ_with_parens t1 format_typ t2
|
||||
| TArray t1 -> Format.fprintf fmt "@[%a@ array@]" format_typ t1
|
||||
|
@ -71,7 +71,7 @@ let format_unop (fmt : Format.formatter) (op : Dcalc.Ast.unop Pos.marked) : unit
|
||||
match Pos.unmark op with
|
||||
| Minus k -> Format.fprintf fmt "~-%a" format_op_kind k
|
||||
| Not -> Format.fprintf fmt "%s" "not"
|
||||
| ErrorOnEmpty -> Format.fprintf fmt "%s" "error_empty"
|
||||
| ErrorOnEmpty -> assert false (* should not happen *)
|
||||
| Log (entry, infos) ->
|
||||
Format.fprintf fmt "@[<hov 2>log_entry@ \"%a|%a\"@]" format_log_entry entry
|
||||
(Format.pp_print_list
|
||||
@ -296,6 +296,9 @@ let rec format_expr (ctx : Dcalc.Ast.decl_ctx) (fmt : Format.formatter) (e : exp
|
||||
| EApp ((EOp (Binop op), _), [ arg1; arg2 ]) ->
|
||||
Format.fprintf fmt "@[<hov 2>%a@ %a@ %a@]" format_with_parens arg1 format_binop
|
||||
(op, Pos.no_pos) format_with_parens arg2
|
||||
| EApp ((EOp (Unop D.ErrorOnEmpty), _), [ arg1 ]) ->
|
||||
Format.fprintf fmt "@[<hov 2>try@ %a@ with@ EmptyError ->@ raise NoValueProvided@]"
|
||||
format_with_parens arg1
|
||||
| EApp ((EOp (Unop (D.Log _)), _), [ arg1 ]) -> Format.fprintf fmt "%a" format_with_parens arg1
|
||||
| EApp ((EOp (Unop op), _), [ arg1 ]) ->
|
||||
Format.fprintf fmt "@[<hov 2>%a@ %a@]" format_unop (op, Pos.no_pos) format_with_parens arg1
|
||||
|
@ -24,6 +24,8 @@ type duration = CalendarLib.Date.Period.t
|
||||
|
||||
exception EmptyError
|
||||
|
||||
exception NoValueProvided
|
||||
|
||||
exception AssertionFailed
|
||||
|
||||
exception ConflictError
|
||||
@ -127,8 +129,6 @@ let duration_to_string (d : duration) : string =
|
||||
|
||||
let duration_to_days_months_years (d : duration) : int * int * int = CalendarLib.Date.Period.ymd d
|
||||
|
||||
let error_empty : 'a. 'a -> 'a = fun x -> x
|
||||
|
||||
let handle_default : 'a. (unit -> 'a) array -> (unit -> bool) -> (unit -> 'a) -> 'a =
|
||||
fun exceptions just cons ->
|
||||
let except =
|
||||
|
@ -36,6 +36,8 @@ exception UncomparableDurations
|
||||
|
||||
exception ImpossibleDate
|
||||
|
||||
exception NoValueProvided
|
||||
|
||||
(**{1 Constructors and conversions} *)
|
||||
|
||||
(**{2 Money}*)
|
||||
@ -103,8 +105,6 @@ val duration_to_string : duration -> string
|
||||
|
||||
(**{1 Defaults} *)
|
||||
|
||||
val error_empty : 'a -> 'a
|
||||
|
||||
val handle_default : (unit -> 'a) array -> (unit -> bool) -> (unit -> 'a) -> 'a
|
||||
(** @raise EmptyError
|
||||
@raise ConflictError *)
|
||||
|
@ -253,7 +253,7 @@ let rec translate_expr (scope : Scopelang.Ast.ScopeName.t) (ctxt : Name_resoluti
|
||||
let x_possible_structs =
|
||||
try Desugared.Ast.IdentMap.find (Pos.unmark x) ctxt.field_idmap
|
||||
with Not_found ->
|
||||
Errors.raise_spanned_error "This identifier should refer to a struct field"
|
||||
Errors.raise_spanned_error "Unknown subscope or struct field name"
|
||||
(Pos.get_position x)
|
||||
in
|
||||
match c with
|
||||
|
@ -1852,59 +1852,15 @@ source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION
|
||||
|
||||
expected an operator to compose the expression on the left with
|
||||
|
||||
source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION VERTICAL INT_LITERAL DIV INT_LITERAL DIV INT_LITERAL YEAR
|
||||
##
|
||||
## Ends in an error in state: 32.
|
||||
##
|
||||
## literal -> VERTICAL date_int DIV date_int DIV date_int . VERTICAL [ WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RSQUARE RPAREN RBRACKET PLUSMONEY PLUSDURATION PLUSDEC PLUSDATE PLUS OR OF NOT_EQUAL MULTMONEY MULTDEC MULT 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 DIVDEC DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ]
|
||||
##
|
||||
## The known suffix of the stack is as follows:
|
||||
## VERTICAL date_int DIV date_int DIV date_int
|
||||
##
|
||||
|
||||
expected a delimiter to finish the date literal
|
||||
|
||||
source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION VERTICAL INT_LITERAL DIV INT_LITERAL DIV YEAR
|
||||
##
|
||||
## Ends in an error in state: 31.
|
||||
##
|
||||
## literal -> VERTICAL date_int DIV date_int DIV . date_int VERTICAL [ WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RSQUARE RPAREN RBRACKET PLUSMONEY PLUSDURATION PLUSDEC PLUSDATE PLUS OR OF NOT_EQUAL MULTMONEY MULTDEC MULT 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 DIVDEC DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ]
|
||||
##
|
||||
## The known suffix of the stack is as follows:
|
||||
## VERTICAL date_int DIV date_int DIV
|
||||
##
|
||||
|
||||
expected the third component of the date literal
|
||||
|
||||
source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION VERTICAL INT_LITERAL DIV INT_LITERAL YEAR
|
||||
##
|
||||
## Ends in an error in state: 30.
|
||||
##
|
||||
## literal -> VERTICAL date_int DIV date_int . DIV date_int VERTICAL [ WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RSQUARE RPAREN RBRACKET PLUSMONEY PLUSDURATION PLUSDEC PLUSDATE PLUS OR OF NOT_EQUAL MULTMONEY MULTDEC MULT 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 DIVDEC DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ]
|
||||
##
|
||||
## The known suffix of the stack is as follows:
|
||||
## VERTICAL date_int DIV date_int
|
||||
##
|
||||
|
||||
expected a "/"
|
||||
|
||||
source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION VERTICAL INT_LITERAL DIV YEAR
|
||||
##
|
||||
## Ends in an error in state: 29.
|
||||
##
|
||||
## literal -> VERTICAL date_int DIV . date_int DIV date_int VERTICAL [ WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RSQUARE RPAREN RBRACKET PLUSMONEY PLUSDURATION PLUSDEC PLUSDATE PLUS OR OF NOT_EQUAL MULTMONEY MULTDEC MULT 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 DIVDEC DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ]
|
||||
##
|
||||
## The known suffix of the stack is as follows:
|
||||
## VERTICAL date_int DIV
|
||||
##
|
||||
|
||||
expected the second component of the date literal
|
||||
|
||||
source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION VERTICAL INT_LITERAL YEAR
|
||||
##
|
||||
## Ends in an error in state: 28.
|
||||
##
|
||||
## literal -> VERTICAL date_int . DIV date_int DIV date_int VERTICAL [ WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RSQUARE RPAREN RBRACKET PLUSMONEY PLUSDURATION PLUSDEC PLUSDATE PLUS OR OF NOT_EQUAL MULTMONEY MULTDEC MULT 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 DIVDEC DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ]
|
||||
## literal -> VERTICAL date_int . MINUS date_int MINUS date_int VERTICAL [ WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RSQUARE RPAREN RBRACKET PLUSMONEY PLUSDURATION PLUSDEC PLUSDATE PLUS OR OF NOT_EQUAL MULTMONEY MULTDEC MULT 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 DIVDEC DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ]
|
||||
##
|
||||
## The known suffix of the stack is as follows:
|
||||
## VERTICAL date_int
|
||||
@ -1916,7 +1872,7 @@ source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION
|
||||
##
|
||||
## Ends in an error in state: 26.
|
||||
##
|
||||
## literal -> VERTICAL . date_int DIV date_int DIV date_int VERTICAL [ WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RSQUARE RPAREN RBRACKET PLUSMONEY PLUSDURATION PLUSDEC PLUSDATE PLUS OR OF NOT_EQUAL MULTMONEY MULTDEC MULT 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 DIVDEC DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ]
|
||||
## literal -> VERTICAL . date_int MINUS date_int MINUS date_int VERTICAL [ WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RSQUARE RPAREN RBRACKET PLUSMONEY PLUSDURATION PLUSDEC PLUSDATE PLUS OR OF NOT_EQUAL MULTMONEY MULTDEC MULT 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 DIVDEC DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ]
|
||||
##
|
||||
## The known suffix of the stack is as follows:
|
||||
## VERTICAL
|
||||
|
@ -181,11 +181,11 @@ struct_or_enum_inject:
|
||||
money_amount_cents = cents;
|
||||
}, Pos.from_lpos $sloc)
|
||||
}
|
||||
| VERTICAL d = date_int DIV m = date_int DIV y = date_int VERTICAL {
|
||||
| VERTICAL y = date_int MINUS m = date_int MINUS d = date_int VERTICAL {
|
||||
(LDate {
|
||||
literal_date_day = (match !Utils.Cli.locale_lang with `En -> m | `Fr -> d);
|
||||
literal_date_month = (match !Utils.Cli.locale_lang with `En -> d | `Fr -> m);
|
||||
literal_date_year = y;
|
||||
literal_date_year = y;
|
||||
literal_date_month = m;
|
||||
literal_date_day = d;
|
||||
}, Pos.from_lpos $sloc)
|
||||
}
|
||||
| TRUE { (LBool true, Pos.from_lpos $sloc) }
|
||||
|
@ -17,7 +17,8 @@ module AF = Allocations_familiales
|
||||
open Runtime
|
||||
|
||||
let compute_allocations_familiales ~(current_date : Runtime.date)
|
||||
~(children : AF.enfant_entree array) ~(income : int) ~(residence : AF.collectivite) : float =
|
||||
~(children : AF.enfant_entree array) ~(income : int) ~(residence : AF.collectivite)
|
||||
~(is_parent : bool) ~(fills_title_I : bool) : float =
|
||||
let result =
|
||||
AF.interface_allocations_familiales
|
||||
{
|
||||
@ -27,6 +28,8 @@ let compute_allocations_familiales ~(current_date : Runtime.date)
|
||||
AF.ressources_menage_in = (fun _ -> money_of_units_int income);
|
||||
AF.residence_in = (fun _ -> residence);
|
||||
AF.montant_verse_in = no_input;
|
||||
AF.personne_charge_effective_permanente_est_parent_in = (fun _ -> is_parent);
|
||||
AF.personne_charge_effective_permanente_remplit_titre_I_in = (fun _ -> fills_title_I);
|
||||
}
|
||||
in
|
||||
money_to_float result.AF.montant_verse_out
|
||||
|
@ -19,5 +19,7 @@ val compute_allocations_familiales :
|
||||
children:Allocations_familiales.enfant_entree array ->
|
||||
income:int ->
|
||||
residence:Allocations_familiales.collectivite ->
|
||||
is_parent:bool ->
|
||||
fills_title_I:bool ->
|
||||
float
|
||||
(** Usage *)
|
||||
|
@ -29,9 +29,16 @@ class type enfant_entree =
|
||||
|
||||
method gardeAlterneePartageAllocation : bool Js.t Js.readonly_prop
|
||||
|
||||
method priseEnChargeServiceSociaux : bool Js.t Js.readonly_prop
|
||||
method priseEnCharge : Js.js_string Js.t Js.readonly_prop
|
||||
(** Expects one of the five:
|
||||
|
||||
method allocationVerseeServiceSociaux : bool Js.t Js.readonly_prop
|
||||
- "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
|
||||
end
|
||||
|
||||
class type allocations_familiales_input =
|
||||
@ -43,6 +50,11 @@ class type allocations_familiales_input =
|
||||
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
|
||||
|
||||
let _ =
|
||||
@ -52,6 +64,12 @@ let _ =
|
||||
let result =
|
||||
AF.interface_allocations_familiales
|
||||
{
|
||||
AF.personne_charge_effective_permanente_est_parent_in =
|
||||
(fun _ -> Js.to_bool input##.personneQuiAssumeLaChargeEffectivePermanenteEstParent);
|
||||
AF.personne_charge_effective_permanente_remplit_titre_I_in =
|
||||
(fun _ ->
|
||||
Js.to_bool
|
||||
input##.personneQuiAssumeLaChargeEffectivePermanenteRemplitConditionsTitreISecuriteSociale);
|
||||
AF.date_courante_in =
|
||||
(fun _ ->
|
||||
date_of_numbers
|
||||
@ -63,24 +81,27 @@ let _ =
|
||||
Array.map
|
||||
(fun (child : enfant_entree Js.t) ->
|
||||
{
|
||||
AF.d_a_deja_ouvert_droit_aux_allocations_familiales =
|
||||
Js.to_bool child##.aDejaOuvertDroitAuxAllocationsFamiliales;
|
||||
AF.d_identifiant = integer_of_int child##.id;
|
||||
AF.d_date_de_naissance =
|
||||
date_of_numbers
|
||||
child##.dateNaissance##getFullYear
|
||||
child##.dateNaissance##getMonth
|
||||
child##.dateNaissance##getDay;
|
||||
AF.d_garde_alternee =
|
||||
( if Js.to_bool child##.gardeAlternee then
|
||||
if Js.to_bool child##.gardeAlterneePartageAllocation then
|
||||
OuiPartageAllocations ()
|
||||
else OuiAllocataireUnique ()
|
||||
else NonGardeUnique () );
|
||||
AF.d_prise_en_charge_par_services_sociaux =
|
||||
( if Js.to_bool child##.priseEnChargeServiceSociaux then
|
||||
if Js.to_bool child##.allocationVerseeServiceSociaux then
|
||||
OuiAllocationVerseeAuxServicesSociaux ()
|
||||
else OuiAllocationVerseeALaFamille ()
|
||||
else NonPriseEnChargeFamille () );
|
||||
AF.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.d_remuneration_mensuelle =
|
||||
money_of_units_int child##.remunerationMensuelle;
|
||||
})
|
||||
|
@ -21,16 +21,14 @@ let random_children (id : int) =
|
||||
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_garde_alternee =
|
||||
( match Random.int 3 with
|
||||
| 0 -> AF.NonGardeUnique ()
|
||||
| 1 -> AF.OuiPartageAllocations ()
|
||||
| _ -> AF.OuiAllocataireUnique () );
|
||||
d_prise_en_charge_par_services_sociaux =
|
||||
( match Random.int 3 with
|
||||
| 0 -> AF.OuiAllocationVerseeALaFamille ()
|
||||
| 1 -> AF.OuiAllocationVerseeAuxServicesSociaux ()
|
||||
| _ -> AF.NonPriseEnChargeFamille () );
|
||||
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 = true;
|
||||
}
|
||||
|
||||
let format_residence (fmt : Format.formatter) (r : AF.collectivite) : unit =
|
||||
@ -46,20 +44,15 @@ let format_residence (fmt : Format.formatter) (r : AF.collectivite) : unit =
|
||||
| AF.SaintMartin _ -> "Saint Martin"
|
||||
| AF.Mayotte _ -> "Mayotte" )
|
||||
|
||||
let format_garde_alternee (fmt : Format.formatter) (g : AF.garde_alternee) : unit =
|
||||
let format_prise_en_charge (fmt : Format.formatter) (g : AF.prise_en_charge) : unit =
|
||||
Format.fprintf fmt "%s"
|
||||
( match g with
|
||||
| AF.NonGardeUnique _ -> "Non"
|
||||
| AF.OuiPartageAllocations _ -> "Oui, allocations partagée"
|
||||
| AF.OuiAllocataireUnique _ -> "Oui, allocataire unique" )
|
||||
|
||||
let format_services_sociaux (fmt : Format.formatter) (g : AF.prise_en_charge_service_sociaux) : unit
|
||||
=
|
||||
Format.fprintf fmt "%s"
|
||||
( match g with
|
||||
| AF.OuiAllocationVerseeALaFamille _ -> "Oui, allocations versée à la famille"
|
||||
| AF.OuiAllocationVerseeAuxServicesSociaux _ -> "Oui, allocations versée aux services sociaux"
|
||||
| AF.NonPriseEnChargeFamille _ -> "Non" )
|
||||
| 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" )
|
||||
|
||||
let num_successful = ref 0
|
||||
|
||||
@ -74,24 +67,20 @@ let run_test () =
|
||||
try
|
||||
let amount =
|
||||
French_law.Api.compute_allocations_familiales ~current_date ~income ~residence ~children
|
||||
~is_parent:true ~fills_title_I:true
|
||||
in
|
||||
incr num_successful;
|
||||
total_amount := Float.add !total_amount amount
|
||||
with
|
||||
| EmptyError ->
|
||||
Format.printf "Empty error reached!\n%a\nincome: %d\ncurrent_date: %s\nresidence: %a\n"
|
||||
| NoValueProvided ->
|
||||
Format.printf
|
||||
"No value provided somewhere!\n%a\nincome: %d\ncurrent_date: %s\nresidence: %a\n"
|
||||
(Format.pp_print_list (fun fmt child ->
|
||||
Format.fprintf fmt
|
||||
"Child %d:\n\
|
||||
\ income: %.2f\n\
|
||||
\ birth date: %s\n\
|
||||
\ garde alternée: %a\n\
|
||||
\ services sociaux: %a"
|
||||
Format.fprintf fmt "Child %d:\n income: %.2f\n birth date: %s\n prise en charge: %a"
|
||||
(integer_to_int child.AF.d_identifiant)
|
||||
(money_to_float child.AF.d_remuneration_mensuelle)
|
||||
(Runtime.date_to_string child.AF.d_date_de_naissance)
|
||||
format_garde_alternee child.AF.d_garde_alternee format_services_sociaux
|
||||
child.AF.d_prise_en_charge_par_services_sociaux))
|
||||
format_prise_en_charge child.AF.d_prise_en_charge))
|
||||
(Array.to_list children) income
|
||||
(Runtime.date_to_string current_date)
|
||||
format_residence residence;
|
||||
|
@ -1,24 +1,19 @@
|
||||
(executable
|
||||
(name bench)
|
||||
(modes native)
|
||||
(package catala)
|
||||
(modules bench)
|
||||
(public_name benchmark_french_law)
|
||||
(libraries catala french_law benchmark))
|
||||
|
||||
(executable
|
||||
(name api_web)
|
||||
(modes byte js)
|
||||
(package catala)
|
||||
(modules api_web)
|
||||
(public_name french_law_web)
|
||||
(preprocess
|
||||
(pps js_of_ocaml-ppx))
|
||||
(libraries catala law_source js_of_ocaml))
|
||||
|
||||
(library
|
||||
(name french_law)
|
||||
(public_name catala.french_law)
|
||||
(synopsis
|
||||
"A collection of functions for computing French taxes and benefits derived from Catala programs")
|
||||
(libraries catala law_source)
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -12,15 +12,16 @@
|
||||
or implied. See the License for the specific language governing permissions and limitations under
|
||||
the License. *)
|
||||
|
||||
type garde_alternee =
|
||||
| OuiPartageAllocations of unit
|
||||
| OuiAllocataireUnique of unit
|
||||
| NonGardeUnique of unit
|
||||
open Runtime
|
||||
|
||||
type prise_en_charge_service_sociaux =
|
||||
| OuiAllocationVerseeALaFamille of unit
|
||||
| OuiAllocationVerseeAuxServicesSociaux of unit
|
||||
| NonPriseEnChargeFamille of unit
|
||||
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
|
||||
@ -33,12 +34,6 @@ type collectivite =
|
||||
| SaintPierreEtMiquelon of unit
|
||||
| Mayotte of unit
|
||||
|
||||
type prise_en_compte_evaluation_montant = Complete of unit | Partagee of unit
|
||||
|
||||
type versement_allocations = Normal of unit | AllocationVerseeAuxServicesSociaux of unit
|
||||
|
||||
type age_alternatif = Absent of unit | Present of Runtime.integer
|
||||
|
||||
type element_prestations_familiales =
|
||||
| PrestationAccueilJeuneEnfant of unit
|
||||
| AllocationsFamiliales of unit
|
||||
@ -49,44 +44,44 @@ type element_prestations_familiales =
|
||||
| AllocationRentreeScolaire of unit
|
||||
| AllocationJournalierePresenceParentale of unit
|
||||
|
||||
type personne = { numero_securite_sociale : Runtime.integer }
|
||||
|
||||
type enfant_entree = {
|
||||
d_identifiant : Runtime.integer;
|
||||
d_remuneration_mensuelle : Runtime.money;
|
||||
d_date_de_naissance : Runtime.date;
|
||||
d_garde_alternee : garde_alternee;
|
||||
d_prise_en_charge_par_services_sociaux : prise_en_charge_service_sociaux;
|
||||
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;
|
||||
}
|
||||
|
||||
type enfant = {
|
||||
identifiant : Runtime.integer;
|
||||
fin_obligation_scolaire : Runtime.date;
|
||||
remuneration_mensuelle : Runtime.money;
|
||||
date_de_naissance : Runtime.date;
|
||||
age : Runtime.integer;
|
||||
garde_alternee : garde_alternee;
|
||||
prise_en_charge_par_services_sociaux : prise_en_charge_service_sociaux;
|
||||
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;
|
||||
}
|
||||
|
||||
type stockage_enfant = PasEnfant of unit | UnEnfant of enfant
|
||||
|
||||
type interface_allocations_familiales_out = {
|
||||
date_courante_out : Runtime.date;
|
||||
date_courante_out : date;
|
||||
enfants_out : enfant_entree array;
|
||||
enfants_a_charge_out : enfant array;
|
||||
ressources_menage_out : Runtime.money;
|
||||
ressources_menage_out : money;
|
||||
residence_out : collectivite;
|
||||
montant_verse_out : Runtime.money;
|
||||
montant_verse_out : money;
|
||||
personne_charge_effective_permanente_est_parent_out : bool;
|
||||
personne_charge_effective_permanente_remplit_titre_I_out : bool;
|
||||
}
|
||||
|
||||
type interface_allocations_familiales_in = {
|
||||
date_courante_in : unit -> Runtime.date;
|
||||
date_courante_in : unit -> date;
|
||||
enfants_in : unit -> enfant_entree array;
|
||||
enfants_a_charge_in : unit -> enfant array;
|
||||
ressources_menage_in : unit -> Runtime.money;
|
||||
ressources_menage_in : unit -> money;
|
||||
residence_in : unit -> collectivite;
|
||||
montant_verse_in : unit -> Runtime.money;
|
||||
montant_verse_in : unit -> money;
|
||||
personne_charge_effective_permanente_est_parent_in : unit -> bool;
|
||||
personne_charge_effective_permanente_remplit_titre_I_in : unit -> bool;
|
||||
}
|
||||
|
||||
val interface_allocations_familiales :
|
||||
|
@ -1,6 +1,4 @@
|
||||
(executable
|
||||
(name run_tests)
|
||||
(modes native)
|
||||
(package catala)
|
||||
(public_name run_french_law_tests)
|
||||
(libraries catala ANSITerminal))
|
||||
|
@ -19,4 +19,6 @@ let _ =
|
||||
try_test "Allocations familiales #4" Tests_allocations_familiales.test4;
|
||||
try_test "Allocations familiales #5" Tests_allocations_familiales.test5;
|
||||
try_test "Allocations familiales #6" Tests_allocations_familiales.test6;
|
||||
try_test "Allocations familiales #7" Tests_allocations_familiales.test7;
|
||||
try_test "Allocations familiales #8" Tests_allocations_familiales.test8;
|
||||
exit (if !failure then -1 else 0)
|
||||
|
@ -5,14 +5,14 @@
|
||||
[ERROR] Error coming from typechecking the following expression:
|
||||
[ERROR] --> test_array/bad/fold_error.catala
|
||||
[ERROR] |
|
||||
[ERROR] 10 | def list_high_count := number for m in list of (m >=$ $7)
|
||||
[ERROR] 10 | def list_high_count := number for m in list of (m >=$ $7)
|
||||
[ERROR] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
[ERROR] + Article
|
||||
[ERROR]
|
||||
[ERROR] Type money coming from expression:
|
||||
[ERROR] --> test_array/bad/fold_error.catala
|
||||
[ERROR] |
|
||||
[ERROR] 10 | def list_high_count := number for m in list of (m >=$ $7)
|
||||
[ERROR] 10 | def list_high_count := number for m in list of (m >=$ $7)
|
||||
[ERROR] | ^^^
|
||||
[ERROR] + Article
|
||||
[ERROR]
|
||||
|
@ -9,8 +9,8 @@ new scope A:
|
||||
param z3 content duration
|
||||
|
||||
scope A:
|
||||
def x := |01/01/2019|
|
||||
def y := |09/30/2002|
|
||||
def x := |2019-01-01|
|
||||
def y := |2002-09-30|
|
||||
def z := y +@ (x -@ y) = x
|
||||
def z3 := x -@ y
|
||||
def z2 := z3 = 5937 day
|
||||
|
@ -7,7 +7,7 @@ new scope A:
|
||||
param z content duration
|
||||
|
||||
scope A:
|
||||
def x := |01/01/2019|
|
||||
def y := |09/30/2002|
|
||||
def x := |2019-01-01|
|
||||
def y := |2002-09-30|
|
||||
def z := x -@ y
|
||||
```
|
||||
|
@ -1,7 +1,7 @@
|
||||
[ERROR] The constructor Case3 of enum E is missing from this pattern matching
|
||||
[ERROR]
|
||||
[ERROR]
|
||||
[ERROR] --> test_enum/bad/missing_case.catala
|
||||
[ERROR] |
|
||||
[ERROR] |
|
||||
[ERROR] 14 | def out := match e with
|
||||
[ERROR] | ^^^^^^^^^^^
|
||||
[ERROR] 15 | -- Case1 of i : i = 0
|
||||
|
@ -1,6 +1,6 @@
|
||||
[ERROR] Error during typechecking, incompatible types:
|
||||
[ERROR] --> F [Case3: any[73]]
|
||||
[ERROR] --> E [Case1: integer | Case2: unit]
|
||||
[ERROR] --> F
|
||||
[ERROR] --> E
|
||||
[ERROR]
|
||||
[ERROR] Error coming from typechecking the following expression:
|
||||
[ERROR] --> test_enum/bad/quick_pattern_2.catala
|
||||
@ -9,14 +9,14 @@
|
||||
[ERROR] | ^
|
||||
[ERROR] + Article
|
||||
[ERROR]
|
||||
[ERROR] Type F [Case3: any[73]] coming from expression:
|
||||
[ERROR] Type F coming from expression:
|
||||
[ERROR] --> test_enum/bad/quick_pattern_2.catala
|
||||
[ERROR] |
|
||||
[ERROR] 28 | def y := x with Case3
|
||||
[ERROR] | ^
|
||||
[ERROR] + Article
|
||||
[ERROR]
|
||||
[ERROR] Type E [Case1: integer | Case2: unit] coming from expression:
|
||||
[ERROR] Type E coming from expression:
|
||||
[ERROR] --> test_enum/bad/quick_pattern_2.catala
|
||||
[ERROR] |
|
||||
[ERROR] 17 | param x content E
|
||||
|
@ -1,6 +1,6 @@
|
||||
[ERROR] Error during typechecking, incompatible types:
|
||||
[ERROR] --> F [Case3: any[19] | Case4: any[20]]
|
||||
[ERROR] --> E [Case1: unit | Case2: unit]
|
||||
[ERROR] --> F
|
||||
[ERROR] --> E
|
||||
[ERROR]
|
||||
[ERROR] Error coming from typechecking the following expression:
|
||||
[ERROR] --> test_enum/bad/quick_pattern_3.catala
|
||||
@ -9,14 +9,14 @@
|
||||
[ERROR] | ^
|
||||
[ERROR] + Article
|
||||
[ERROR]
|
||||
[ERROR] Type F [Case3: any[19] | Case4: any[20]] coming from expression:
|
||||
[ERROR] Type F coming from expression:
|
||||
[ERROR] --> test_enum/bad/quick_pattern_3.catala
|
||||
[ERROR] |
|
||||
[ERROR] 18 | def y := x with Case3
|
||||
[ERROR] | ^
|
||||
[ERROR] + Article
|
||||
[ERROR]
|
||||
[ERROR] Type E [Case1: unit | Case2: unit] coming from expression:
|
||||
[ERROR] Type E coming from expression:
|
||||
[ERROR] --> test_enum/bad/quick_pattern_3.catala
|
||||
[ERROR] |
|
||||
[ERROR] 13 | param x content E
|
||||
|
@ -1,6 +1,6 @@
|
||||
[ERROR] Error during typechecking, incompatible types:
|
||||
[ERROR] --> F [Case3: any[19]]
|
||||
[ERROR] --> E [Case1: unit | Case2: unit]
|
||||
[ERROR] --> F
|
||||
[ERROR] --> E
|
||||
[ERROR]
|
||||
[ERROR] Error coming from typechecking the following expression:
|
||||
[ERROR] --> test_enum/bad/quick_pattern_4.catala
|
||||
@ -9,14 +9,14 @@
|
||||
[ERROR] | ^
|
||||
[ERROR] + Test
|
||||
[ERROR]
|
||||
[ERROR] Type F [Case3: any[19]] coming from expression:
|
||||
[ERROR] Type F coming from expression:
|
||||
[ERROR] --> test_enum/bad/quick_pattern_4.catala
|
||||
[ERROR] |
|
||||
[ERROR] 17 | def y := x with Case3
|
||||
[ERROR] | ^
|
||||
[ERROR] + Test
|
||||
[ERROR]
|
||||
[ERROR] Type E [Case1: unit | Case2: unit] coming from expression:
|
||||
[ERROR] Type E coming from expression:
|
||||
[ERROR] --> test_enum/bad/quick_pattern_4.catala
|
||||
[ERROR] |
|
||||
[ERROR] 12 | param x content E
|
||||
|
@ -1,11 +1,11 @@
|
||||
[ERROR] This exception can refer to several definitions. Try using labels to disambiguate
|
||||
[ERROR]
|
||||
[ERROR]
|
||||
[ERROR] --> test_exception/bad/ambiguous_unlabeled_exception.catala
|
||||
[ERROR] |
|
||||
[ERROR] |
|
||||
[ERROR] 10 | def x := 1
|
||||
[ERROR] |
|
||||
[ERROR] 11 |
|
||||
[ERROR] |
|
||||
[ERROR] |
|
||||
[ERROR] 11 |
|
||||
[ERROR] |
|
||||
[ERROR] 12 | exception
|
||||
[ERROR] | ^^^^^^^^^
|
||||
[ERROR] 13 | def x := 2
|
||||
|
@ -10,7 +10,7 @@
|
||||
[ERROR] Used here in the definition of another cycle exception exception_x:
|
||||
[ERROR] --> test_exception/bad/exceptions_cycle.catala
|
||||
[ERROR] |
|
||||
[ERROR] 17 | exception exception_x
|
||||
[ERROR] 17 | exception exception_x
|
||||
[ERROR] | ^^^^^^^^^^^
|
||||
[ERROR] + Test
|
||||
[ERROR]
|
||||
|
@ -1,9 +1,9 @@
|
||||
[ERROR] This exception does not have a corresponding definition
|
||||
[ERROR]
|
||||
[ERROR]
|
||||
[ERROR] --> test_exception/bad/missing_unlabeled_definition.catala
|
||||
[ERROR] |
|
||||
[ERROR] |
|
||||
[ERROR] 7 | scope A:
|
||||
[ERROR] |
|
||||
[ERROR] |
|
||||
[ERROR] 8 | exception
|
||||
[ERROR] | ^^^^^^^^^
|
||||
[ERROR] 9 | def x := 1
|
||||
|
@ -19,6 +19,6 @@
|
||||
[ERROR] Type money coming from expression:
|
||||
[ERROR] --> test_money/bad/no_mingle.catala
|
||||
[ERROR] |
|
||||
[ERROR] 6 | param y content money
|
||||
[ERROR] 6 | param y content money
|
||||
[ERROR] | ^^^^^
|
||||
[ERROR] + Article
|
||||
|
@ -3,7 +3,7 @@
|
||||
[ERROR] Cycle variable z, declared:
|
||||
[ERROR] --> test_scope/bad/cycle_in_scope.catala
|
||||
[ERROR] |
|
||||
[ERROR] 7 | param z content int
|
||||
[ERROR] 7 | param z content int
|
||||
[ERROR] | ^
|
||||
[ERROR] + Article
|
||||
[ERROR]
|
||||
@ -17,7 +17,7 @@
|
||||
[ERROR] Cycle variable y, declared:
|
||||
[ERROR] --> test_scope/bad/cycle_in_scope.catala
|
||||
[ERROR] |
|
||||
[ERROR] 6 | param y content int
|
||||
[ERROR] 6 | param y content int
|
||||
[ERROR] | ^
|
||||
[ERROR] + Article
|
||||
[ERROR]
|
||||
@ -31,7 +31,7 @@
|
||||
[ERROR] Cycle variable x, declared:
|
||||
[ERROR] --> test_scope/bad/cycle_in_scope.catala
|
||||
[ERROR] |
|
||||
[ERROR] 5 | param x content int
|
||||
[ERROR] 5 | param x content int
|
||||
[ERROR] | ^
|
||||
[ERROR] + Article
|
||||
[ERROR]
|
||||
|
@ -2,6 +2,6 @@
|
||||
[ERROR]
|
||||
[ERROR] --> test_scope/bad/sub_vars_in_sub_var.catala
|
||||
[ERROR] |
|
||||
[ERROR] 13 | def a.y := if a.x then 0 else 1
|
||||
[ERROR] 13 | def a.y := if a.x then 0 else 1
|
||||
[ERROR] | ^^^
|
||||
[ERROR] + Article
|
||||
|
@ -2,6 +2,6 @@
|
||||
[ERROR]
|
||||
[ERROR] --> test_struct/bad/ambiguous_fields.catala
|
||||
[ERROR] |
|
||||
[ERROR] 16 | def y := x.f
|
||||
[ERROR] 16 | def y := x.f
|
||||
[ERROR] | ^
|
||||
[ERROR] + Article
|
||||
|
@ -2,6 +2,6 @@
|
||||
[ERROR]
|
||||
[ERROR] --> test_struct/bad/nested.catala
|
||||
[ERROR] |
|
||||
[ERROR] 5 | data x content S
|
||||
[ERROR] 5 | data x content S
|
||||
[ERROR] | ^
|
||||
[ERROR] + Article
|
||||
|
@ -2,6 +2,6 @@
|
||||
[ERROR]
|
||||
[ERROR] --> test_struct/bad/nonexisting_struct.catala
|
||||
[ERROR] |
|
||||
[ERROR] 13 | def y := x.Fo.f
|
||||
[ERROR] 13 | def y := x.Fo.f
|
||||
[ERROR] | ^^
|
||||
[ERROR] + Article
|
||||
|
@ -2,6 +2,6 @@
|
||||
[ERROR]
|
||||
[ERROR] --> test_struct/bad/wrong_qualified_field.catala
|
||||
[ERROR] |
|
||||
[ERROR] 17 | def y := x.Foo.g
|
||||
[ERROR] 17 | def y := x.Foo.g
|
||||
[ERROR] | ^^^^^^^
|
||||
[ERROR] + Article
|
||||
|
Loading…
Reference in New Issue
Block a user