Desugared.Ast
Abstract syntax tree of the desugared representation
module ScopeDef : sig ... end
Inside a scope, a definition can refer either to a scope def, or a subscope def
module AssertionName :
Catala_utils.Uid.Id with type info = Catala_utils.Uid.MarkedString.info
type expr = ( Shared_ast.desugared, Shared_ast.untyped ) Shared_ast.gexpr
See Shared_ast.naked_gexpr
for the complete definition
type location = Shared_ast.desugared Shared_ast.glocation
type exception_situation =
| BaseCase |
| ExceptionToLabel of Shared_ast.LabelName.t Catala_utils.Mark.pos |
| ExceptionToRule of Shared_ast.RuleName.t Catala_utils.Mark.pos |
type label_situation =
| ExplicitlyLabeled of Shared_ast.LabelName.t Catala_utils.Mark.pos |
| Unlabeled |
type rule = {
rule_id : Shared_ast.RuleName.t; |
rule_just : expr Shared_ast.boxed; |
rule_cons : expr Shared_ast.boxed; |
rule_parameter : (expr Shared_ast.Var.t Catala_utils.Mark.pos * Shared_ast.typ)
list
Catala_utils.Mark.pos
option; |
rule_exception : exception_situation; |
rule_label : label_situation; |
}
val empty_rule :
Catala_utils.Pos.t ->
(Catala_utils.Uid.MarkedString.info * Shared_ast.typ) list
Catala_utils.Mark.pos
option ->
rule
val always_false_rule :
Catala_utils.Pos.t ->
(Catala_utils.Uid.MarkedString.info * Shared_ast.typ) list
Catala_utils.Mark.pos
option ->
rule
type assertion = expr Shared_ast.boxed
type meta_assertion =
| FixedBy of reference_typ Catala_utils.Mark.pos |
| VariesWith of unit * variation_typ Catala_utils.Mark.pos option |
type io_input =
This type characterizes the three levels of visibility for a given scope variable with regards to the scope's input and possible redefinitions inside the scope..
type io = {
io_output : bool Catala_utils.Mark.pos; | (*
|
io_input : io_input Catala_utils.Mark.pos; |
}
Characterization of the input/output status of a scope variable.
type scope_def = {
scope_def_rules : rule Shared_ast.RuleName.Map.t; |
scope_def_typ : Shared_ast.typ; |
scope_def_parameters : (Catala_utils.Uid.MarkedString.info * Shared_ast.typ)
list
Catala_utils.Mark.pos
option; |
scope_def_is_condition : bool; |
scope_def_io : io; |
}
type scope = {
scope_vars : var_or_states Shared_ast.ScopeVar.Map.t; |
scope_sub_scopes : Shared_ast.ScopeName.t Shared_ast.SubScopeName.Map.t; |
scope_uid : Shared_ast.ScopeName.t; |
scope_defs : scope_def ScopeDef.Map.t; |
scope_assertions : assertion AssertionName.Map.t; |
scope_options : catala_option Catala_utils.Mark.pos list; |
scope_meta_assertions : meta_assertion list; |
}
type program = {
program_scopes : scope Shared_ast.ScopeName.Map.t; |
program_topdefs : (expr * Shared_ast.typ) Shared_ast.TopdefName.Map.t; |
program_ctx : Shared_ast.decl_ctx; |
}
val locations_used : expr -> LocationSet.t
val free_variables :
rule Shared_ast.RuleName.Map.t ->
Catala_utils.Pos.t ScopeDef.Map.t