Commit Graph

3631 Commits

Author SHA1 Message Date
adelaett
576da177c5 Typed defaults: translate types in scope lets as well in the new
compile without exception passe
2023-11-27 11:12:35 +01:00
adelaett
f6027109d8 Typed default: Update passing tests
For now, most tests involving only one scope and no context do pass.
More work is required for the rest.
2023-11-27 11:12:26 +01:00
adelaett
cb29fdeefe fixing the handle_opt in the interpreter. 2023-11-27 11:09:08 +01:00
adelaett
1d72a57da4 Typed default: fix an issue to the error_on_empty constructor 2023-11-27 11:09:08 +01:00
adelaett
4a5335162e Typed default: implementing the type for handle defaults, as well as the
compile without exceptions compilation pass, using the newly found
invariant
2023-11-27 11:09:08 +01:00
adelaett
b0b83b14b9 Typed default: Implemented typing translating to the without exception compilation path. 2023-11-27 11:09:08 +01:00
adelaett
2c9f8ad8b1 Typed default: import the code from compile with exceptions to
re-implement without exceptions with the new typing of defaults terms.
2023-11-27 11:09:08 +01:00
Louis Gesbert
fca3221b78 Ensure dune exec -- clerk ... runs an up-to-date catala exec 2023-11-27 11:09:08 +01:00
Louis Gesbert
cc4e5339dd Typed defaults: small simplification and fixes 2023-11-27 11:09:08 +01:00
Louis Gesbert
3a149bc86e Fix compilation of plugins 2023-11-27 11:09:08 +01:00
Louis Gesbert
1efda5ca22 Typing defaults: support nested priorities
The way nested priorities are encoded use `< < excs | true :- nested > :- x >`,
which imply that `nested` can actually be ∅ ; to cope with this, the typing of
default terms is made more generic (the return type is now the same as the
`cons` type `'a`, rather than `<'a>`). For the general case, we add an explicit
`EPureDefault` node which just encapsulates its argument (a `return`, in monad
terminology).
2023-11-27 11:09:08 +01:00
Louis Gesbert
4ececf9960 Fix api_web plugin 2023-11-27 11:09:08 +01:00
Louis Gesbert
c4715ea86e Reformat 2023-11-27 11:09:08 +01:00
Louis Gesbert
bcf285913e Typing the HandleDefault operator 2023-11-27 11:06:33 +01:00
Louis Gesbert
fd50e6186f Fix default typing across modules 2023-11-27 11:06:33 +01:00
Louis Gesbert
9203e4f7bb Verification: support unboxed defaults 2023-11-27 11:06:33 +01:00
Louis Gesbert
dc3ffa0dcd Fix some error handling on scope calls
(and add suggestions)
2023-11-27 11:06:33 +01:00
Louis Gesbert
d00cac09ad Harmless test results changes 2023-11-27 11:06:33 +01:00
Louis Gesbert
958aaebac3 Typing defaults fixes: keep in and out type in scope sigs 2023-11-27 11:06:16 +01:00
Louis Gesbert
ab6bec390d Adjust plugins and warnings 2023-11-27 11:06:16 +01:00
Louis Gesbert
0be2636e65 Typing defaults: making the compiler adhere to the new type discipline 2023-11-27 11:06:01 +01:00
Louis Gesbert
52486af6ac Correct typing of context subscope variables 2023-11-27 11:06:01 +01:00
Louis Gesbert
b98bad8c33 Add a --no-typing option
it is useful e.g. to be able to print intermediate ASTs when they don't type, to
debug the typing errors. This is better than commenting the typing line each
time.

Note that the option is not available on all targets (esp. not for ocaml and
python outputs ; it's allowed on the interpreters for debugging purposes but I'm
not sure if that's a good idea)
2023-11-27 11:06:01 +01:00
Louis Gesbert
9425753eca Typer: add built-in "'a default" type 2023-11-27 11:06:01 +01:00
Louis Gesbert
e2730c0b44 Avoid redundant position in type error 2023-11-27 11:05:58 +01:00
Louis Gesbert
4fa9326618 Typer: on error, print the expression being typed in debug mode
useful when typing fails on internally generated expressions
2023-11-27 11:03:47 +01:00
Denis Merigoux
63f0cad312
Debug French housing benefits by comparing to the CAF API (#531) 2023-11-24 16:52:29 +01:00
Denis Merigoux
2b89e530b0
Code refactoring that works at execution + mypy 2023-11-23 15:38:45 +01:00
Denis Merigoux
fb85c64cfa
Continue debugging 2023-11-23 11:54:54 +01:00
Denis Merigoux
bb414eed06
Improve CNAF<->Catala rules, remove treacherous isinstance() 2023-11-22 18:32:52 +01:00
Denis Merigoux
14dffc2223
Fix links to CNAV 2023-11-22 18:09:04 +01:00
Denis Merigoux
fc242a5d1f
Fix Python compilation and runtime 2023-11-22 18:08:44 +01:00
Denis Merigoux
67d1665afc
Progress 2023-11-22 15:02:40 +01:00
Denis Merigoux
cf70e6cbb1
Fix bug in taux_loyer_éligible!
The formulae in the law is complex and there was a transcription error
2023-11-22 14:52:25 +01:00
Denis Merigoux
b25944a148
Fix bug in taux_loyer_éligible!
The formulae in the law is complex and there was a transcription error
2023-11-22 14:51:02 +01:00
Denis Merigoux
b055558ebf
Merge branch 'master' into api_apl 2023-11-22 11:31:02 +01:00
Denis Merigoux
03173e50d0
Mise à jour arrêté du 22 septembre 2023 (#530) 2023-11-22 11:27:52 +01:00
Denis Merigoux
4cff84291a
Mise à jour arrêté du 22 septembre 2023 2023-11-22 11:11:43 +01:00
Denis Merigoux
15921b4fda
Improve simulation 2023-11-22 10:11:20 +01:00
Denis Merigoux
d2e4da144c
Directly call the API 2023-11-21 12:15:36 +01:00
Denis Merigoux
9b287cc0a5
Refresh the code 2023-11-21 10:49:32 +01:00
adelaett
363ece217e
fix nix environment 2023-11-16 16:52:23 +01:00
Denis Merigoux
c46f5d568d
Don't put a box in list printing but do indent (#524)
Don't put a box in list printing but do indent
2023-11-02 11:56:57 +01:00
Louis Gesbert
1d8e3748ea Improving the printer on arrays 2023-11-02 11:12:51 +01:00
Denis Merigoux
c4d1c9a1ad
fix(examples): remove empty lines at the beginning and the end of code blocks (#526) 2023-10-30 11:09:23 +01:00
Emile Rolley
6d66cfe10a fix(examples): remove empty lines at the beginning and the end of catala code blocks 2023-10-27 17:32:46 +02:00
Louis Gesbert
73df41eb6f
More complete tests on module calls and a bunch of fixes (#525) 2023-10-17 09:42:48 +02:00
Louis Gesbert
7141734d47
Improve trace printing (#523) 2023-10-17 09:39:53 +02:00
Louis Gesbert
bd90555e96 The interpreter might return custom terms
since scope outputs may contain functions this shouldn't be excluded; functions
from the interpreter now reflect this
2023-10-13 16:16:45 +02:00
Louis Gesbert
3b0e576a24 Fix module name propagation 2023-10-13 16:13:02 +02:00