mirror of
https://github.com/CatalaLang/catala.git
synced 2024-09-19 00:15:39 +03:00
Remove useless field
This commit is contained in:
parent
349da741d4
commit
a1ab58478c
@ -20,7 +20,6 @@ open Ast
|
||||
module D = Dcalc.Ast
|
||||
|
||||
type 'm ctx = {
|
||||
decl_ctx : decl_ctx;
|
||||
name_context : string;
|
||||
globally_bound_vars : ('m expr, typ) Var.Map.t;
|
||||
}
|
||||
@ -320,7 +319,6 @@ let transform_closures_program (p : 'm program) : 'm program Bindlib.box =
|
||||
in
|
||||
let ctx =
|
||||
{
|
||||
decl_ctx = p.decl_ctx;
|
||||
name_context = Mark.remove (ScopeName.get_info name);
|
||||
globally_bound_vars = toplevel_vars;
|
||||
}
|
||||
@ -347,7 +345,6 @@ let transform_closures_program (p : 'm program) : 'm program Bindlib.box =
|
||||
let v, expr = Bindlib.unmbind binder in
|
||||
let ctx =
|
||||
{
|
||||
decl_ctx = p.decl_ctx;
|
||||
name_context = Mark.remove (TopdefName.get_info name);
|
||||
globally_bound_vars = toplevel_vars;
|
||||
}
|
||||
@ -361,7 +358,6 @@ let transform_closures_program (p : 'm program) : 'm program Bindlib.box =
|
||||
| Topdef (name, ty, expr) ->
|
||||
let ctx =
|
||||
{
|
||||
decl_ctx = p.decl_ctx;
|
||||
name_context = Mark.remove (TopdefName.get_info name);
|
||||
globally_bound_vars = toplevel_vars;
|
||||
}
|
||||
|
@ -28,7 +28,6 @@ type translation_config = {
|
||||
|
||||
type 'm ctxt = {
|
||||
func_dict : ('m L.expr, A.FuncName.t) Var.Map.t;
|
||||
decl_ctx : decl_ctx;
|
||||
var_dict : ('m L.expr, A.VarName.t) Var.Map.t;
|
||||
inside_definition_of : A.VarName.t option;
|
||||
context_name : string;
|
||||
@ -570,7 +569,6 @@ let rec translate_scope_body_expr
|
||||
let block, new_e =
|
||||
translate_expr
|
||||
{
|
||||
decl_ctx;
|
||||
func_dict;
|
||||
var_dict;
|
||||
inside_definition_of = None;
|
||||
@ -590,7 +588,6 @@ let rec translate_scope_body_expr
|
||||
| Assertion ->
|
||||
translate_statements
|
||||
{
|
||||
decl_ctx;
|
||||
func_dict;
|
||||
var_dict;
|
||||
inside_definition_of = Some let_var_id;
|
||||
@ -602,7 +599,6 @@ let rec translate_scope_body_expr
|
||||
let let_expr_stmts, new_let_expr =
|
||||
translate_expr
|
||||
{
|
||||
decl_ctx;
|
||||
func_dict;
|
||||
var_dict;
|
||||
inside_definition_of = Some let_var_id;
|
||||
@ -687,7 +683,6 @@ let translate_program ~(config : translation_config) (p : 'm L.program) :
|
||||
let ctxt =
|
||||
{
|
||||
func_dict;
|
||||
decl_ctx = p.decl_ctx;
|
||||
var_dict =
|
||||
List.fold_left2
|
||||
(fun map arg ((id, _), _) -> Var.Map.add arg id map)
|
||||
@ -726,7 +721,6 @@ let translate_program ~(config : translation_config) (p : 'm L.program) :
|
||||
let ctxt =
|
||||
{
|
||||
func_dict;
|
||||
decl_ctx = p.decl_ctx;
|
||||
var_dict;
|
||||
inside_definition_of = None;
|
||||
context_name = Mark.remove (TopdefName.get_info name);
|
||||
|
@ -17,13 +17,7 @@
|
||||
open Catala_utils
|
||||
open Definitions
|
||||
|
||||
type ('a, 'b, 'm) optimizations_ctx = {
|
||||
var_values :
|
||||
( (('a, 'b) dcalc_lcalc, 'm) gexpr,
|
||||
(('a, 'b) dcalc_lcalc, 'm) gexpr )
|
||||
Var.Map.t;
|
||||
decl_ctx : decl_ctx;
|
||||
}
|
||||
type ('a, 'b, 'm) optimizations_ctx = { decl_ctx : decl_ctx }
|
||||
|
||||
let all_match_cases_are_id_fun cases n =
|
||||
EnumConstructor.Map.for_all
|
||||
@ -281,7 +275,7 @@ let optimize_expr :
|
||||
(('a, 'b) dcalc_lcalc, 'm) gexpr ->
|
||||
(('a, 'b) dcalc_lcalc, 'm) boxed_gexpr =
|
||||
fun (decl_ctx : decl_ctx) (e : (('a, 'b) dcalc_lcalc, 'm) gexpr) ->
|
||||
optimize_expr { var_values = Var.Map.empty; decl_ctx } e
|
||||
optimize_expr { decl_ctx } e
|
||||
|
||||
let optimize_program (p : 'm program) : 'm program =
|
||||
Bindlib.unbox
|
||||
|
Loading…
Reference in New Issue
Block a user