package catala

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type backend_lang =
  1. | En
  2. | Fr
  3. | Pl
type backend_option_builtin = [
  1. | `Latex
  2. | `Makefile
  3. | `Html
  4. | `Interpret
  5. | `Typecheck
  6. | `OCaml
  7. | `Python
  8. | `Scalc
  9. | `Lcalc
  10. | `Dcalc
  11. | `Scopelang
  12. | `Proof
]
type 'a backend_option = [
  1. | backend_option_builtin
  2. | `Plugin of 'a
]
val backend_option_to_string : string backend_option -> string

backend_option_to_string backend returns the string representation of the given backend.

val backend_option_of_string : string -> string backend_option

backend_option_of_string backend returns the backend_option corresponding to the backend string.

Configuration globals

val source_files : string list Stdlib.ref

Source files to be compiled

val locale_lang : backend_lang Stdlib.ref
val contents : string Stdlib.ref
val debug_flag : bool Stdlib.ref
val style_flag : bool Stdlib.ref

Styles the terminal output

val optimize_flag : bool Stdlib.ref
val max_prec_digits : int Stdlib.ref

Max number of digits to show for decimal results

val trace_flag : bool Stdlib.ref
val disable_counterexamples : bool Stdlib.ref

Disables model-generated counterexamples for proofs that fail.

val avoid_exceptions_flag : bool Stdlib.ref

Avoids using try ... with exceptions when compiling the default calculus.

CLI terms

val file : string Cmdliner.Term.t
val debug : bool Cmdliner.Term.t
val unstyled : bool Cmdliner.Term.t
val trace_opt : bool Cmdliner.Term.t
val wrap_weaved_output : bool Cmdliner.Term.t
val print_only_law : bool Cmdliner.Term.t
val backend : string Cmdliner.Term.t
val plugins_dirs : string list Cmdliner.Term.t
val language : string option Cmdliner.Term.t
val max_prec_digits_opt : int option Cmdliner.Term.t
val ex_scope : string option Cmdliner.Term.t
val output : string option Cmdliner.Term.t
type when_enum =
  1. | Auto
  2. | Always
  3. | Never

The usual auto/always/never option argument

type options = {
  1. debug : bool;
  2. color : when_enum;
  3. wrap_weaved_output : bool;
  4. avoid_exceptions : bool;
  5. backend : string;
  6. plugins_dirs : string list;
  7. language : string option;
  8. max_prec_digits : int option;
  9. trace : bool;
  10. disable_counterexamples : bool;
  11. optimize : bool;
  12. ex_scope : string option;
  13. output_file : string option;
  14. closure_conversion : bool;
  15. print_only_law : bool;
}

Command-line application

val options : options Cmdliner.Term.t
val catala_t : (string -> options -> 'a) -> 'a Cmdliner.Term.t

Main entry point: catala_t file options

val set_option_globals : options -> unit
val version : string

Terminal formatting

Markers

val with_style : ANSITerminal.style list -> ('a, unit, string) Stdlib.format -> 'a
val format_with_style : ANSITerminal.style list -> Stdlib.Format.formatter -> string -> unit
val call_unstyled : (unit -> 'a) -> 'a

call_unstyled f calls the function f with the style_flag set to false during the execution.

val debug_marker : unit -> string
val error_marker : unit -> string
val warning_marker : unit -> string
val result_marker : unit -> string
val log_marker : unit -> string

Printers

All the printers below print their argument after the correct marker

val concat_with_line_depending_prefix_and_suffix : (int -> string) -> (int -> string) -> string list -> string
val add_prefix_to_each_line : string -> (int -> string) -> string

The int argument of the prefix corresponds to the line number, starting at 0

val debug_print : ('a, Stdlib.out_channel, unit) Stdlib.format -> 'a
val debug_format : ('a, Stdlib.Format.formatter, unit) Stdlib.format -> 'a
val error_print : ('a, Stdlib.out_channel, unit) Stdlib.format -> 'a
val warning_print : ('a, Stdlib.out_channel, unit) Stdlib.format -> 'a
val result_print : ('a, Stdlib.out_channel, unit) Stdlib.format -> 'a
val result_format : ('a, Stdlib.Format.formatter, unit) Stdlib.format -> 'a
val log_print : ('a, Stdlib.out_channel, unit) Stdlib.format -> 'a
val log_format : ('a, Stdlib.Format.formatter, unit) Stdlib.format -> 'a