CATALA

NAME

catala - Compiler for Catala, a specification language for tax and social benefits computation rules.

SYNOPSIS

catala [COMMAND] FILE [OPTION]â¦

Use catala [COMMAND] --help for documentation on a specific command

DESCRIPTION

Catala is a domain-specific language for deriving faithful-by-construction algorithms from legislative texts.

COMMANDS

c [OPTION]⦠FILE

Generates an C translation of the Catala program.

dcalc [OPTION]⦠FILE

Prints a debugging verbatim of the default calculus intermediate representation of the Catala program. Use the -s option to restrict the output to a particular scope.

depends [--extension=EXT] [--include=DIR] [--prefix=PATH] [OPTION]â¦
FILE
[FILES]â¦

Lists the dependencies of the given catala files, in linking order. This includes recursive dependencies and is useful for linking an application in a target language. The space-separated list is printed to stdout. The names are printed as expected of module identifiers, i.e. capitalized. NOTE: the files specified are also included in the returned list.

exceptions [--include=DIR] [--scope=SCOPE] [--variable=VARIABLE]
[OPTION]⦠FILE

Prints the exception tree for the definitions of a particular variable, for debugging purposes. Use the -s option to select the scope and the -v option to select the variable. Use foo.bar to access state bar of variable foo or variable bar of subscope foo.

html [--output=OUTPUT] [--print-only-law] [--wrap] [OPTION]⦠FILE

Weaves an HTML literate programming output of the Catala program.

interpret [OPTION]⦠FILE

Runs the interpreter on the Catala program, executing the scope specified by the -s option assuming no additional external inputs.

latex [--output=OUTPUT] [--print-only-law] [--wrap] [OPTION]⦠FILE
[FILES]â¦

Weaves a LaTeX literate programming output of the Catala program.

lcalc [OPTION]⦠FILE

Prints a debugging verbatim of the lambda calculus intermediate representation of the Catala program. Use the -s option to restrict the output to a particular scope.

makefile [--output=OUTPUT] [OPTION]⦠FILE

Generates a Makefile-compatible list of the file dependencies of a Catala program.

ocaml [OPTION]⦠FILE

Generates an OCaml translation of the Catala program.

proof [OPTION]⦠FILE

Generates and proves verification conditions about the well-behaved execution of the Catala program.

pygmentize [OPTION]⦠FILE

This special command is a wrapper around the pygmentize command that enables support for colorising Catala code.

python [OPTION]⦠FILE

Generates a Python translation of the Catala program.

r [OPTION]⦠FILE

Generates an R translation of the Catala program.

scalc [OPTION]⦠FILE

Prints a debugging verbatim of the statement calculus intermediate representation of the Catala program. Use the -s option to restrict the output to a particular scope.

scopelang [--include=DIR] [--output=OUTPUT] [--scope=SCOPE] [OPTION]â¦
FILE

Prints a debugging verbatim of the scope language intermediate representation of the Catala program. Use the -s option to restrict the output to a particular scope.

typecheck [--check-invariants] [--include=DIR] [OPTION]⦠FILE

Parses and typechecks a Catala program, without interpreting it.

INSTALLED PLUGINS

api_web [OPTION]⦠FILE

Catala plugin for generating web APIs. It generates OCaml code before the associated [js_of_ocaml] wrapper.

explain [OPTION]⦠FILE

Generates a graph of the formulas that are used for a given execution of a scope

json_schema [OPTION]⦠FILE

Catala plugin for generating {{:https://json-schema.org} JSON schemas} used to build forms for the Catala website.

lazy [OPTION]⦠FILE

Experimental lazy evaluation (plugin)

python-plugin [OPTION]⦠FILE

This plugin is for demonstration purposes and should be equivalent to using the built-in Python backend

COMMON OPTIONS

-C DIR, --directory=DIR

Behave as if run from the given directory for file and error reporting. Does not affect resolution of files in arguments.

--color[=VAL] (default=always) (absent=auto or CATALA_COLOR env)

Allow output of colored and styled text. Use auto, to enable when the standard output is to a terminal, never to disable.

-d, --debug (absent CATALA_DEBUG env)

Prints debug information.

--disable-warnings

Disable all the warnings emitted by the compiler.

--help[=FMT] (default=auto)

Show this help in format FMT. The value FMT must be one of auto, pager, groff or plain. With auto, the format is pager or plain whenever the TERM env var is dumb or undefined.

-l LANG, --language=LANG

Locale variant of the input language to use when it can not be inferred from the file extension.

--message-format=VAL (absent=human)

Selects the format of error and warning messages emitted by the compiler. If set to human, the messages will be nicely displayed and meant to be read by a human. If set to gnu, the messages will be rendered according to the GNU coding standards.

-p NUM, --max-digits-printed=NUM (absent=20)

Maximum number of significant digits printed for decimal results.

--plugin-dir=DIR (absent CATALA_PLUGINS env)

Set the given directory to be searched for backend plugins.

-t, --trace (absent CATALA_TRACE env)

Displays a trace of the interpreter's computation or generates logging instructions in translate programs.

--version

Show version information.

(Deprecated) --unstyled

Removes styling (colors, etc.) from terminal output.

EXIT STATUS

catala exits with:

0

on success.

1

on error.

123

on indiscriminate errors reported on standard error.

124

on command line parsing errors.

125

on unexpected internal errors (bugs).

ENVIRONMENT

These environment variables affect the execution of catala:
CATALA_COLOR

See option --color.

CATALA_DEBUG

See option --debug.

CATALA_PLUGINS

See option --plugin-dir.

CATALA_TRACE

See option --trace.

AUTHORS

The authors are listed by alphabetical order:

Nicolas Chataing <nicolas.chataing@ens.fr>
Alain Delaët-Tixeuil <alain.delaet--tixeuil@inria.fr>
Aymeric Fromherz <aymeric.fromherz@inria.fr>
Louis Gesbert <louis.gesbert@ocamlpro.com>
Denis Merigoux <denis.merigoux@inria.fr>
Emile Rolley <erolley@tutamail.com>

EXAMPLES

catala Interpret -s Foo file.catala_en

catala Ocaml -o target/file.ml file.catala_en

BUGS

Please file bug reports at https://github.com/CatalaLang/catala/issues