Module Shared_ast.Interpreter

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 ; resolvedNames : Shared_ast__Definitions.yes ; scopeVarStates : Shared_ast__Definitions.no ; scopeVarSimpl : Shared_ast__Definitions.no ; explicitScopes : Shared_ast__Definitions.no ; assertions : Shared_ast__Definitions.yes ; defaultTerms : _ ; exceptions : _ > 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 ; resolvedNames : Shared_ast__Definitions.yes ; scopeVarStates : Shared_ast__Definitions.no ; scopeVarSimpl : Shared_ast__Definitions.no ; explicitScopes : Shared_ast__Definitions.no ; assertions : Shared_ast__Definitions.yes ; defaultTerms : _ ; exceptions : _ > 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 -> 'm Shared_ast__Definitions.mark -> ( ( '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 -> ( ( < 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 ; resolvedNames : Shared_ast__Definitions.yes ; scopeVarStates : Shared_ast__Definitions.no ; scopeVarSimpl : Shared_ast__Definitions.no ; explicitScopes : Shared_ast__Definitions.no ; assertions : Shared_ast__Definitions.yes ; defaultTerms : 'a ; exceptions : 'b >, < 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 ; resolvedNames : Shared_ast__Definitions.yes ; scopeVarStates : Shared_ast__Definitions.no ; scopeVarSimpl : Shared_ast__Definitions.no ; explicitScopes : Shared_ast__Definitions.no ; assertions : Shared_ast__Definitions.yes ; defaultTerms : 'a ; exceptions : 'b >, '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 ; resolvedNames : Shared_ast__Definitions.yes ; scopeVarStates : Shared_ast__Definitions.no ; scopeVarSimpl : Shared_ast__Definitions.no ; explicitScopes : Shared_ast__Definitions.no ; assertions : Shared_ast__Definitions.yes ; defaultTerms : 'a ; exceptions : 'b >, < 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 ; resolvedNames : Shared_ast__Definitions.yes ; scopeVarStates : Shared_ast__Definitions.no ; scopeVarSimpl : Shared_ast__Definitions.no ; explicitScopes : Shared_ast__Definitions.no ; assertions : Shared_ast__Definitions.yes ; defaultTerms : 'a ; exceptions : 'b >, '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 ; resolvedNames : Shared_ast__Definitions.yes ; 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 >, < 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 ; resolvedNames : Shared_ast__Definitions.yes ; 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 >, '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 ; resolvedNames : Shared_ast__Definitions.yes ; 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 >, < 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 ; resolvedNames : Shared_ast__Definitions.yes ; 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 >, '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 ; resolvedNames : Shared_ast__Definitions.yes ; 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 >, < 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 ; resolvedNames : Shared_ast__Definitions.yes ; 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 >, '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 ; resolvedNames : Shared_ast__Definitions.yes ; 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 >, < 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 ; resolvedNames : Shared_ast__Definitions.yes ; 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 >, '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.