Commit Graph

2366 Commits

Author SHA1 Message Date
Louis Gesbert
83de1a229b Mark the optimization passes as untyped
It's not expected to stay that way forever, but some additional effort will be required for them to preserve (or restore) types; until then, be safe and don't forward possibly incorrect information.
2022-07-13 12:17:43 +02:00
Denis Merigoux
0a0c1015e1
Merge pull request #288 from CatalaLang/191-fix
feat(backend): disambiguate OCaml record names derived from Catala structs
2022-07-13 10:14:59 +02:00
Denis Merigoux
a5c80b3ff1
Not silent commands 2022-07-13 09:53:20 +02:00
Emile Rolley
4991350b58 feat(backend/ocaml): disambiguate OCaml record names derived from Catala struct 2022-07-12 16:12:18 +02:00
Louis Gesbert
97120c4dc2 compiler/verification: force a typed AST as input 2022-07-12 15:57:50 +02:00
Emile Rolley
43eb4de28b
Merge pull request #286 from CatalaLang/fix_192
Corrects and finished the work of #285, by restoring automatic rebuild of all tests by ninja
2022-07-12 11:26:07 +02:00
Emile Rolley
1d05b57bdd refactor(clerk): suffix the ninja build outputs with .PHONY instead of .out 2022-07-12 11:16:12 +02:00
Denis Merigoux
71b03d85ef
Modified tests because of change to participation minimale formula 2022-07-11 23:10:24 +02:00
Denis Merigoux
4498ee7c6a
Ajout test gouvernemental 2022-07-11 22:52:28 +02:00
Denis Merigoux
ec6e186ab2
Ajout archives arrêtés pour anciens paramètres de calcul 2022-07-11 22:52:02 +02:00
Louis Gesbert
4726d00df8 Adjust test results
Nothing shocking here:
- division by zero now reported on the application rather than the
operator
- renumbering of printed bindlib variables
- some whitespace changes
2022-07-11 17:43:59 +02:00
Louis Gesbert
b8e73ab3ae Tweak build/ci 2022-07-11 17:42:34 +02:00
Louis Gesbert
7485c7f2ce Reformat 2022-07-11 17:42:34 +02:00
Louis Gesbert
985ecdac6d Bump required OCaml version to 4.13
This version of OCaml introduces [let-punning](https://v2.ocaml.org/manual/bindingops.html#ss:letops-punning)

It is just syntactic sugar, but OCamlformat makes use of it, without a configuration option, when the OCaml version permits.
This means that the same version of OCamlformat gives different results depending on the underlying OCaml version. Our options, if we want to keep the forced-format policy on the repository, are therefore:
- to disable it whenever binding operators are used (with this PR that's a lot of places, and this becomes too cumbersome, besides defeating the purpose)
- to force devs to use an earlier version of OCaml so that reformatting outputs something compatible
- to bump the minimum OCaml requirement

The latter is the simplest, but it can be reviewed if compatibility is required. Last option would be to report the issue to OCamlformat and hope that they provide a workaround...
2022-07-11 17:42:34 +02:00
Louis Gesbert
504f54c31e Rework type error reporting 2022-07-11 17:42:34 +02:00
Louis Gesbert
02fc255177 Typing scopes: bottom-up rather than top-down
it's better for error messages (and similar to how it was done before)
2022-07-11 17:42:34 +02:00
Louis Gesbert
18e86621d5 Port verification code to the AST changes 2022-07-11 17:42:34 +02:00
Louis Gesbert
5f882e35a2 dcalc ast: make the map function more polymorphic 2022-07-11 17:42:34 +02:00
Louis Gesbert
49efb5ddd7 Improve debugging, add backtraces (when recording is enabled) 2022-07-11 17:42:34 +02:00
Louis Gesbert
296a1de7dd Typing: add functions to type scopes without conversion to expr 2022-07-11 17:42:34 +02:00
Louis Gesbert
4eb5933ad0 Porting the interpreter to the marked AST 2022-07-11 17:42:30 +02:00
Denis Merigoux
c5cb6f5c4d
Restore automatic rebuild of all tests by ninja
Also cleaned unused rule arg
2022-07-11 16:56:06 +02:00
Louis Gesbert
6cc2e9a07b typing.ml: fix use of bindlib 2022-07-11 16:51:54 +02:00
Louis Gesbert
67179a793c Add type annotations on all AST nodes (first pass) 2022-07-11 16:51:54 +02:00
Louis Gesbert
513647cd32 AST simplification: remove redundant annotations
The AST structures track annotations (e.g., at the moment, source code
position information) in a lot of places. This patch tidies up a bit and
removes some duplication, ensuring a single level of annotation wrapping
at each AST recursion level.

This will be important when adding type information in these
annotations, because there will be consitency constraints to be ensured
and duplication is a likely source of mistakes.
2022-07-11 16:51:54 +02:00
Louis Gesbert
af0ac95682 Propagate renaming of Pos.mark* into module Marked
this patch is just a bunch of `sed` commands

```shell
cd compiler
sed -i 's/Pos.marked/Marked.pos/g' *.ml* **/*.ml*
sed -i 's/Pos.unmark/Marked.unmark/g' *.ml* **/*.ml*
sed -i 's/Pos\.get_position/Marked.get_mark/g' *.ml* **/*.ml*
sed -i 's/Pos\.same_pos_as/Marked.same_mark_as/g' *.ml* **/*.ml*
sed -i 's/Pos\.map_under_mark/Marked.map_under_mark/g' *.ml* **/*.ml*
sed -i 's/Pos\.mark/Marked.mark/g' *.ml* **/*.ml*
sed -i 's/Pos\.compare_marked/Marked.compare/g' *.ml* **/*.ml*
```
2022-07-11 16:51:54 +02:00
Louis Gesbert
481aea83e0 Generalise the type for AST node markings 2022-07-11 16:51:54 +02:00
Louis Gesbert
d7dbbde26f
Merge pull request #285 from CatalaLang/fix_192
Partially fix #192
2022-07-11 16:43:48 +02:00
Louis Gesbert
d2a182043b Update doc for handling tests 2022-07-11 16:03:47 +02:00
Catala nix updated
2051ea4457 update lock files 2022-07-11 00:23:12 +00:00
Louis Gesbert
1d268a940b Add tests for the examples as well 2022-07-08 17:18:58 +02:00
Louis Gesbert
2e5050481d Register all existing tests through the new engine
I removed the '.out' extension for now to preserve the test output file names and avoid a million file renames.

This makes the patch easier to read, and we can do the rename easily in another patch afterwards, without mixing with semantic changes.

(beautiful script àlarrache:
```bash
for f in */*/output/*; do
  target_base=${f##*/}
  target_base=${target_base%%.*}
  echo $f | awk -F. '{
    f=$1"."$2; if ($4 == "") { mode=$3; id=$3 } else { scope="-s "$3; mode=$4; id=$3"."$4}
    printf "\n```catala-test {id=\"%s\"}\ncatala %s %s\n```\n",id,mode,scope;
  }' >> $(dirname $f)/../${target_base}.*; done
```
2022-07-08 17:06:20 +02:00
Denis Merigoux
66a7d2f7a3 Fix test encoding 2022-07-08 15:37:01 +02:00
Denis Merigoux
fa0d94a2b6
Remove authors feature whose behavior is not satisfactory 2022-07-08 14:41:19 +02:00
Denis Merigoux
a78f649377
Add negative test 2022-07-08 14:16:02 +02:00
Denis Merigoux
bdbf202a8d
Minimal implementation of https://github.com/CatalaLang/catala/issues/192#issuecomment-1178750411 2022-07-08 14:10:25 +02:00
Denis Merigoux
46d2312bb6
Merge pull request #284 from CatalaLang/update-citation
docs: udpate the CITATION file
2022-07-07 16:35:41 +02:00
Emile Rolley
ad20f449d1
docs: update the CITATION file 2022-07-07 16:18:08 +02:00
Emile Rolley
3579bf90b1
docs: udpate the CITATION file 2022-07-07 16:14:56 +02:00
Denis Merigoux
81fe7db311
Implemented better split custody handling that applies correct post-processing steps to the
corrected amount
2022-07-07 15:19:32 +02:00
Denis Merigoux
6987719f3b
Prepping for correct split custody sharing 2022-07-07 15:03:03 +02:00
Denis Merigoux
a34a330dc4
Fix breaklines in LaTeX 2022-07-06 17:37:42 +02:00
Denis Merigoux
fdf9d49b23
Merge pull request #266 from CatalaLang/allocations_logement
Implementation of French housing benefits : 2/N
2022-07-06 17:02:14 +02:00
Denis Merigoux
1a08207680
Restore tests 2022-07-06 16:52:13 +02:00
Denis Merigoux
5e45940e1b
Merge branch 'master' into allocations_logement 2022-07-06 16:43:14 +02:00
Denis Merigoux
9cdeb907f5
Fix missing age of L841-1 2022-07-06 15:37:23 +02:00
Denis Merigoux
b1dd3a822e
We now compute the split custody! 2022-07-06 15:25:31 +02:00
Denis Merigoux
443a4bbc1d
Restore test 2022-07-06 14:46:25 +02:00
Denis Merigoux
cd6840fdcb
Prepping for split custody 2022-07-06 12:52:03 +02:00
Denis Merigoux
cfe9f0ca28
Added a global "calculette" tested with a dummy example 2022-07-06 12:24:45 +02:00