Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation of defaults into a pure lambda calculus #73

Merged
merged 29 commits into from
Feb 12, 2021

Conversation

denismerigoux
Copy link
Contributor

@denismerigoux denismerigoux commented Jan 24, 2021

Todo list

  • Formalization
  • Update F* proof
  • Implementation
  • Tests
  • Doc? Add a nex \lambda_calculus.mldfile? UpdateREADME`?
  • Formally have src/catala/default_calculus/interpreter.ml use src/catala/runtime.ml functions to avoid duplication?

Overview

This PR adds an OCaml backend to the Catala compiler. The starting point is the default calculus representation, which is lowered into a lambda calculus (src/catala/lambda_calculus folder) with exceptions according to a compilation scheme described in a new section of the formalization PDF.

The lambda calculus is then translated to OCaml syntax in the src/catala/lambda_calculus/to_ocaml.ml file. This OCaml backend is used to create a new OCaml library, french_law, containing for now only the Allocations familiales computatation. A machinery is set up to export this library to JS using JS_of_ocaml and a wrapper that exposes a convenient signature when you just call the function with a JSON object describing all the inputs. The OCaml backend through the replication of the unit tests of the Allocations familiales example.

@denismerigoux denismerigoux marked this pull request as ready for review February 3, 2021 10:00
@denismerigoux denismerigoux merged commit af8a7b1 into master Feb 12, 2021
@denismerigoux denismerigoux deleted the compiling_defaults branch February 12, 2021 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant