package catala

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Reference interpreter for the default calculus

val evaluate_operator : (((< < monomorphic : Shared_ast__.Definitions.yes ; polymorphic : Shared_ast__.Definitions.yes ; overloaded : Shared_ast__.Definitions.no ; resolved : Shared_ast__.Definitions.yes ; syntacticNames : Shared_ast__.Definitions.no ; scopeVarStates : Shared_ast__.Definitions.no ; scopeVarSimpl : Shared_ast__.Definitions.no ; explicitScopes : Shared_ast__.Definitions.no ; assertions : Shared_ast__.Definitions.yes > ; defaultTerms : _ ; exceptions : _ ; custom : _ > as 'a, < < monomorphic : Shared_ast__.Definitions.yes ; polymorphic : Shared_ast__.Definitions.yes ; overloaded : Shared_ast__.Definitions.no ; resolved : Shared_ast__.Definitions.yes ; syntacticNames : Shared_ast__.Definitions.no ; scopeVarStates : Shared_ast__.Definitions.no ; scopeVarSimpl : Shared_ast__.Definitions.no ; explicitScopes : Shared_ast__.Definitions.no ; assertions : Shared_ast__.Definitions.yes > ; defaultTerms : _ ; exceptions : _ ; custom : _ > as 'a, 'm) Shared_ast__.Definitions.base_gexpr, 'm Shared_ast__.Definitions.mark) Catala_utils.Mark.ed -> (('a, 'a, 'm) Shared_ast__.Definitions.base_gexpr, 'm Shared_ast__.Definitions.mark) Catala_utils.Mark.ed) -> 'a Shared_ast__.Definitions.Op.t Catala_utils.Mark.pos -> 'm Shared_ast__.Definitions.mark -> Catala_utils.Global.backend_lang -> (('a, 'a, 'm) Shared_ast__.Definitions.base_gexpr, 'm Shared_ast__.Definitions.mark) Catala_utils.Mark.ed list -> (('a, 'a, 'm) Shared_ast__.Definitions.base_gexpr, 'm Shared_ast__.Definitions.mark) Catala_utils.Mark.ed

Evaluates the result of applying the given operator to the given arguments, which are expected to be already reduced to values. The first argument is used to evaluate expressions and called when reducing e.g. the map operator.

val evaluate_expr : Shared_ast__.Definitions.decl_ctx -> Catala_utils.Global.backend_lang -> ((< < monomorphic : Shared_ast__.Definitions.yes ; polymorphic : Shared_ast__.Definitions.yes ; overloaded : Shared_ast__.Definitions.no ; resolved : Shared_ast__.Definitions.yes ; syntacticNames : Shared_ast__.Definitions.no ; scopeVarStates : Shared_ast__.Definitions.no ; scopeVarSimpl : Shared_ast__.Definitions.no ; explicitScopes : Shared_ast__.Definitions.no ; assertions : Shared_ast__.Definitions.yes > ; defaultTerms : 'a ; exceptions : 'b ; custom : _ >, < < monomorphic : Shared_ast__.Definitions.yes ; polymorphic : Shared_ast__.Definitions.yes ; overloaded : Shared_ast__.Definitions.no ; resolved : Shared_ast__.Definitions.yes ; syntacticNames : Shared_ast__.Definitions.no ; scopeVarStates : Shared_ast__.Definitions.no ; scopeVarSimpl : Shared_ast__.Definitions.no ; explicitScopes : Shared_ast__.Definitions.no ; assertions : Shared_ast__.Definitions.yes > ; defaultTerms : 'a ; exceptions : 'b ; custom : _ >, 'm) Shared_ast__.Definitions.base_gexpr, 'm Shared_ast__.Definitions.mark) Catala_utils.Mark.ed -> ((< < monomorphic : Shared_ast__.Definitions.yes ; polymorphic : Shared_ast__.Definitions.yes ; overloaded : Shared_ast__.Definitions.no ; resolved : Shared_ast__.Definitions.yes ; syntacticNames : Shared_ast__.Definitions.no ; scopeVarStates : Shared_ast__.Definitions.no ; scopeVarSimpl : Shared_ast__.Definitions.no ; explicitScopes : Shared_ast__.Definitions.no ; assertions : Shared_ast__.Definitions.yes > ; defaultTerms : 'a ; exceptions : 'b ; custom : Shared_ast__.Definitions.yes >, < < monomorphic : Shared_ast__.Definitions.yes ; polymorphic : Shared_ast__.Definitions.yes ; overloaded : Shared_ast__.Definitions.no ; resolved : Shared_ast__.Definitions.yes ; syntacticNames : Shared_ast__.Definitions.no ; scopeVarStates : Shared_ast__.Definitions.no ; scopeVarSimpl : Shared_ast__.Definitions.no ; explicitScopes : Shared_ast__.Definitions.no ; assertions : Shared_ast__.Definitions.yes > ; defaultTerms : 'a ; exceptions : 'b ; custom : Shared_ast__.Definitions.yes >, 'm) Shared_ast__.Definitions.base_gexpr, 'm Shared_ast__.Definitions.mark) Catala_utils.Mark.ed

Evaluates an expression according to the semantics of the default calculus.

val interpret_program_dcalc : ((< monomorphic : Shared_ast__.Definitions.yes ; polymorphic : Shared_ast__.Definitions.yes ; overloaded : Shared_ast__.Definitions.no ; resolved : Shared_ast__.Definitions.yes ; syntacticNames : Shared_ast__.Definitions.no ; scopeVarStates : Shared_ast__.Definitions.no ; scopeVarSimpl : Shared_ast__.Definitions.no ; explicitScopes : Shared_ast__.Definitions.no ; assertions : Shared_ast__.Definitions.yes ; defaultTerms : Shared_ast__.Definitions.yes ; exceptions : Shared_ast__.Definitions.no ; custom : Shared_ast__.Definitions.no >, < monomorphic : Shared_ast__.Definitions.yes ; polymorphic : Shared_ast__.Definitions.yes ; overloaded : Shared_ast__.Definitions.no ; resolved : Shared_ast__.Definitions.yes ; syntacticNames : Shared_ast__.Definitions.no ; scopeVarStates : Shared_ast__.Definitions.no ; scopeVarSimpl : Shared_ast__.Definitions.no ; explicitScopes : Shared_ast__.Definitions.no ; assertions : Shared_ast__.Definitions.yes ; defaultTerms : Shared_ast__.Definitions.yes ; exceptions : Shared_ast__.Definitions.no ; custom : Shared_ast__.Definitions.no >, 'm) Shared_ast__.Definitions.base_gexpr, 'm Shared_ast__.Definitions.mark) Catala_utils.Mark.ed Shared_ast__.Definitions.program -> Shared_ast__.Definitions.ScopeName.t -> (Catala_utils.Uid.MarkedString.info * ((< < monomorphic : Shared_ast__.Definitions.yes ; polymorphic : Shared_ast__.Definitions.yes ; overloaded : Shared_ast__.Definitions.no ; resolved : Shared_ast__.Definitions.yes ; syntacticNames : Shared_ast__.Definitions.no ; scopeVarStates : Shared_ast__.Definitions.no ; scopeVarSimpl : Shared_ast__.Definitions.no ; explicitScopes : Shared_ast__.Definitions.no ; assertions : Shared_ast__.Definitions.yes > ; defaultTerms : Shared_ast__.Definitions.yes ; exceptions : Shared_ast__.Definitions.no ; custom : Shared_ast__.Definitions.yes >, < < monomorphic : Shared_ast__.Definitions.yes ; polymorphic : Shared_ast__.Definitions.yes ; overloaded : Shared_ast__.Definitions.no ; resolved : Shared_ast__.Definitions.yes ; syntacticNames : Shared_ast__.Definitions.no ; scopeVarStates : Shared_ast__.Definitions.no ; scopeVarSimpl : Shared_ast__.Definitions.no ; explicitScopes : Shared_ast__.Definitions.no ; assertions : Shared_ast__.Definitions.yes > ; defaultTerms : Shared_ast__.Definitions.yes ; exceptions : Shared_ast__.Definitions.no ; custom : Shared_ast__.Definitions.yes >, 'm) Shared_ast__.Definitions.base_gexpr, 'm Shared_ast__.Definitions.mark) Catala_utils.Mark.ed) list

Interprets a program. This function expects an expression typed as a function whose argument are all thunked. The function is executed by providing for each argument a thunked empty default. Returns a list of all the computed values for the scope variables of the executed scope.

val interpret_program_lcalc : ((< monomorphic : Shared_ast__.Definitions.yes ; polymorphic : Shared_ast__.Definitions.yes ; overloaded : Shared_ast__.Definitions.no ; resolved : Shared_ast__.Definitions.yes ; syntacticNames : Shared_ast__.Definitions.no ; scopeVarStates : Shared_ast__.Definitions.no ; scopeVarSimpl : Shared_ast__.Definitions.no ; explicitScopes : Shared_ast__.Definitions.no ; assertions : Shared_ast__.Definitions.yes ; defaultTerms : Shared_ast__.Definitions.no ; exceptions : Shared_ast__.Definitions.yes ; custom : Shared_ast__.Definitions.no >, < monomorphic : Shared_ast__.Definitions.yes ; polymorphic : Shared_ast__.Definitions.yes ; overloaded : Shared_ast__.Definitions.no ; resolved : Shared_ast__.Definitions.yes ; syntacticNames : Shared_ast__.Definitions.no ; scopeVarStates : Shared_ast__.Definitions.no ; scopeVarSimpl : Shared_ast__.Definitions.no ; explicitScopes : Shared_ast__.Definitions.no ; assertions : Shared_ast__.Definitions.yes ; defaultTerms : Shared_ast__.Definitions.no ; exceptions : Shared_ast__.Definitions.yes ; custom : Shared_ast__.Definitions.no >, 'm) Shared_ast__.Definitions.base_gexpr, 'm Shared_ast__.Definitions.mark) Catala_utils.Mark.ed Shared_ast__.Definitions.program -> Shared_ast__.Definitions.ScopeName.t -> (Catala_utils.Uid.MarkedString.info * ((< < monomorphic : Shared_ast__.Definitions.yes ; polymorphic : Shared_ast__.Definitions.yes ; overloaded : Shared_ast__.Definitions.no ; resolved : Shared_ast__.Definitions.yes ; syntacticNames : Shared_ast__.Definitions.no ; scopeVarStates : Shared_ast__.Definitions.no ; scopeVarSimpl : Shared_ast__.Definitions.no ; explicitScopes : Shared_ast__.Definitions.no ; assertions : Shared_ast__.Definitions.yes > ; defaultTerms : Shared_ast__.Definitions.no ; exceptions : Shared_ast__.Definitions.yes ; custom : Shared_ast__.Definitions.yes >, < < monomorphic : Shared_ast__.Definitions.yes ; polymorphic : Shared_ast__.Definitions.yes ; overloaded : Shared_ast__.Definitions.no ; resolved : Shared_ast__.Definitions.yes ; syntacticNames : Shared_ast__.Definitions.no ; scopeVarStates : Shared_ast__.Definitions.no ; scopeVarSimpl : Shared_ast__.Definitions.no ; explicitScopes : Shared_ast__.Definitions.no ; assertions : Shared_ast__.Definitions.yes > ; defaultTerms : Shared_ast__.Definitions.no ; exceptions : Shared_ast__.Definitions.yes ; custom : Shared_ast__.Definitions.yes >, 'm) Shared_ast__.Definitions.base_gexpr, 'm Shared_ast__.Definitions.mark) Catala_utils.Mark.ed) list

Interprets a program. This function expects an expression typed as a function whose argument are all thunked. The function is executed by providing for each argument a thunked empty default. Returns a list of all the computed values for the scope variables of the executed scope.

val delcustom : ((< < monomorphic : Shared_ast__.Definitions.yes ; polymorphic : Shared_ast__.Definitions.yes ; overloaded : Shared_ast__.Definitions.no ; resolved : Shared_ast__.Definitions.yes ; syntacticNames : Shared_ast__.Definitions.no ; scopeVarStates : Shared_ast__.Definitions.no ; scopeVarSimpl : Shared_ast__.Definitions.no ; explicitScopes : Shared_ast__.Definitions.no ; assertions : Shared_ast__.Definitions.yes > ; defaultTerms : 'a ; exceptions : 'b ; custom : 'c >, < < monomorphic : Shared_ast__.Definitions.yes ; polymorphic : Shared_ast__.Definitions.yes ; overloaded : Shared_ast__.Definitions.no ; resolved : Shared_ast__.Definitions.yes ; syntacticNames : Shared_ast__.Definitions.no ; scopeVarStates : Shared_ast__.Definitions.no ; scopeVarSimpl : Shared_ast__.Definitions.no ; explicitScopes : Shared_ast__.Definitions.no ; assertions : Shared_ast__.Definitions.yes > ; defaultTerms : 'a ; exceptions : 'b ; custom : 'c >, 'm) Shared_ast__.Definitions.base_gexpr, 'm Shared_ast__.Definitions.mark) Catala_utils.Mark.ed -> ((< < monomorphic : Shared_ast__.Definitions.yes ; polymorphic : Shared_ast__.Definitions.yes ; overloaded : Shared_ast__.Definitions.no ; resolved : Shared_ast__.Definitions.yes ; syntacticNames : Shared_ast__.Definitions.no ; scopeVarStates : Shared_ast__.Definitions.no ; scopeVarSimpl : Shared_ast__.Definitions.no ; explicitScopes : Shared_ast__.Definitions.no ; assertions : Shared_ast__.Definitions.yes > ; defaultTerms : 'a ; exceptions : 'b ; custom : Shared_ast__.Definitions.no >, < < monomorphic : Shared_ast__.Definitions.yes ; polymorphic : Shared_ast__.Definitions.yes ; overloaded : Shared_ast__.Definitions.no ; resolved : Shared_ast__.Definitions.yes ; syntacticNames : Shared_ast__.Definitions.no ; scopeVarStates : Shared_ast__.Definitions.no ; scopeVarSimpl : Shared_ast__.Definitions.no ; explicitScopes : Shared_ast__.Definitions.no ; assertions : Shared_ast__.Definitions.yes > ; defaultTerms : 'a ; exceptions : 'b ; custom : Shared_ast__.Definitions.no >, 'm) Shared_ast__.Definitions.base_gexpr, 'm Shared_ast__.Definitions.mark) Catala_utils.Mark.ed

Runtime check that the term contains no custom terms (raises Invalid_argument if that is the case

val load_runtime_modules : _ Shared_ast__.Definitions.program -> unit

Dynlink the runtime modules required by the given program, in order to make them callable by the interpreter.

OCaml

Innovation. Community. Security.