diff --git a/compiler/dcalc/from_scopelang.ml b/compiler/dcalc/from_scopelang.ml index 3fbe8e3b..ccc26855 100644 --- a/compiler/dcalc/from_scopelang.ml +++ b/compiler/dcalc/from_scopelang.ml @@ -97,7 +97,7 @@ let merge_defaults rewriting *) (Expr.with_ty m_body ~pos:(Expr.mark_pos m_body) ty)) (Array.to_list vars) tys) - pos + tys pos in let ltrue = Expr.elit (LBool true) @@ -119,6 +119,7 @@ let merge_defaults let pos = Expr.mark_pos m in Expr.make_app caller [Expr.elit LUnit (Expr.with_ty m (Mark.add pos (TLit TUnit)))] + [TLit TUnit, pos] pos in let body = @@ -140,7 +141,7 @@ let tag_with_log_entry let m = mark_tany (Mark.get e) (Expr.pos e) in if Cli.globals.trace then - Expr.eapp (Expr.eop (Log (l, markings)) [TAny, Expr.pos e] m) [e] m + Expr.eappop ~op:(Log (l, markings)) ~tys:[TAny, Expr.pos e] ~args:[e] m else e (* In a list of exceptions, it is normally an error if more than a single one @@ -342,7 +343,11 @@ let rec translate_expr (ctx : 'm ctx) (e : 'm Scopelang.Ast.expr) : ] in (* calling_expr = scope_function scope_input_struct *) - let calling_expr = Expr.eapp called_func [single_arg] m in + let calling_expr = + Expr.eapp ~f:called_func ~args:[single_arg] + ~tys:[TStruct sc_sig.scope_sig_input_struct, pos] + m + in (* For the purposes of log parsing explained in Runtime.EventParser, we need to wrap this function call in a flurry of log tags. Specifically, we are mascarading this scope call as a function call. In a normal function @@ -389,30 +394,30 @@ let rec translate_expr (ctx : 'm ctx) (e : 'm Scopelang.Ast.expr) : let f_markings = [ScopeName.get_info scope; StructField.get_info field] in + let args = + List.mapi + (fun i (param_var, t_in) -> + tag_with_log_entry + (Expr.make_var param_var (Expr.with_ty m t_in)) + (VarDef + { + log_typ = Mark.remove t_in; + log_io_output = false; + log_io_input = OnlyInput; + }) + (f_markings + @ [Mark.add (Expr.pos e) ("input" ^ string_of_int i)])) + (List.combine params_vars ts_in) + in Expr.make_abs (Array.of_list params_vars) (tag_with_log_entry (tag_with_log_entry (Expr.eapp - (tag_with_log_entry original_field_expr BeginCall - f_markings) - (ListLabels.mapi (List.combine params_vars ts_in) - ~f:(fun i (param_var, t_in) -> - tag_with_log_entry - (Expr.make_var param_var - (Expr.with_ty m t_in)) - (VarDef - { - log_typ = Mark.remove t_in; - log_io_output = false; - log_io_input = OnlyInput; - }) - (f_markings - @ [ - Mark.add (Expr.pos e) - ("input" ^ string_of_int i); - ]))) - (Expr.with_ty m t_out)) + ~f: + (tag_with_log_entry original_field_expr BeginCall + f_markings) + ~args ~tys:ts_in (Expr.with_ty m t_out)) (VarDef { log_typ = Mark.remove t_out; @@ -468,7 +473,7 @@ let rec translate_expr (ctx : 'm ctx) (e : 'm Scopelang.Ast.expr) : [ScopeName.get_info scope; Mark.add (Expr.pos e) "direct"]) (Expr.pos e)) (Expr.pos e) - | EApp { f; args } -> + | EApp { f; args; tys } -> (* We insert various log calls to record arguments and outputs of user-defined functions belonging to scopes *) let e1_func = translate_expr ctx f in @@ -489,37 +494,36 @@ let rec translate_expr (ctx : 'm ctx) (e : 'm Scopelang.Ast.expr) : | m -> tag_with_log_entry e1_func BeginCall m in let new_args = List.map (translate_expr ctx) args in - let input_typs, output_typ = + let input_typs = List.map Mark.remove tys in + let output_typ = (* NOTE: this is a temporary solution, it works because it's assumed that - all function calls are from scope variables. However, this will change - -- for more information see + all function have explicit types. However, this will change -- for more + information see https://github.com/CatalaLang/catala/pull/280#discussion_r898851693. *) - let retrieve_in_and_out_typ_or_any var vars = + let retrieve_out_typ_or_any var vars = let _, typ, _ = ScopeVar.Map.find (Mark.remove var) vars in match typ with - | TArrow (marked_input_typ, marked_output_typ) -> - List.map Mark.remove marked_input_typ, Mark.remove marked_output_typ - | _ -> ListLabels.map new_args ~f:(fun _ -> TAny), TAny + | TArrow (_, marked_output_typ) -> Mark.remove marked_output_typ + | _ -> TAny in match Mark.remove f with | ELocation (ScopelangScopeVar { name = var }) -> - retrieve_in_and_out_typ_or_any var ctx.scope_vars + retrieve_out_typ_or_any var ctx.scope_vars | ELocation (SubScopeVar { alias; var; _ }) -> ctx.subscope_vars |> SubScopeName.Map.find (Mark.remove alias) - |> retrieve_in_and_out_typ_or_any var + |> retrieve_out_typ_or_any var | ELocation (ToplevelVar { name }) -> ( let typ = TopdefName.Map.find (Mark.remove name) ctx.decl_ctx.ctx_topdefs in match Mark.remove typ with - | TArrow (tin, (tout, _)) -> List.map Mark.remove tin, tout + | TArrow (_, (tout, _)) -> tout | _ -> Message.raise_spanned_error (Expr.pos e) "Application of non-function toplevel variable") - | _ -> ListLabels.map new_args ~f:(fun _ -> TAny), TAny + | _ -> TAny in - (* Message.emit_debug "new_args %d, input_typs: %d, input_typs %a" (List.length new_args) (List.length input_typs) (Format.pp_print_list Print.typ_debug) (List.map (Mark.add Pos.no_pos) input_typs); *) @@ -538,8 +542,7 @@ let rec translate_expr (ctx : 'm ctx) (e : 'm Scopelang.Ast.expr) : (m @ [Mark.add (Expr.pos e) ("input" ^ string_of_int i)]) | _ -> new_arg) in - - let new_e = Expr.eapp e1_func new_args m in + let new_e = Expr.eapp ~f:e1_func ~args:new_args ~tys m in let new_e = match markings with | [] -> new_e @@ -591,9 +594,12 @@ let rec translate_expr (ctx : 'm ctx) (e : 'm Scopelang.Ast.expr) : let v, _ = TopdefName.Map.find (Mark.remove name) ctx.toplevel_vars in Expr.evar v m else Expr.eexternal ~name:(Mark.map (fun n -> External_value n) name) m - | EOp { op = Add_dat_dur _; tys } -> - Expr.eop (Add_dat_dur ctx.date_rounding) tys m - | EOp { op; tys } -> Expr.eop (Operator.translate op) tys m + | EAppOp { op = Add_dat_dur _; args; tys } -> + let args = List.map (translate_expr ctx) args in + Expr.eappop ~op:(Add_dat_dur ctx.date_rounding) ~args ~tys m + | EAppOp { op; args; tys } -> + let args = List.map (translate_expr ctx) args in + Expr.eappop ~op:(Operator.translate op) ~args ~tys m | ( EVar _ | EAbs _ | ELit _ | EStruct _ | EStructAccess _ | ETuple _ | ETupleAccess _ | EInj _ | EEmptyError | EErrorOnEmpty _ | EArray _ | EIfThenElse _ ) as e -> @@ -818,7 +824,9 @@ let translate_rule in let call_expr = tag_with_log_entry - (Expr.eapp subscope_func [subscope_struct_arg] (mark_tany m pos_call)) + (Expr.eapp ~f:subscope_func ~args:[subscope_struct_arg] + ~tys:[TStruct called_scope_input_struct, Expr.mark_pos m] + (mark_tany m pos_call)) EndCall [ sigma_name, pos_sigma; diff --git a/compiler/dcalc/invariants.ml b/compiler/dcalc/invariants.ml index 36e82d66..80e40438 100644 --- a/compiler/dcalc/invariants.ml +++ b/compiler/dcalc/invariants.ml @@ -36,7 +36,8 @@ let check_invariant (inv : string * invariant_expr) (p : typed program) : bool = match inv p.decl_ctx e with | Ignore -> true | Fail -> - Message.raise_spanned_error (Expr.pos e) "%s failed\n\n%a" name + Message.raise_spanned_error (Expr.pos e) + "@[Invariant @{%s@} failed.@,%a@]" name (Print.expr ()) e | Pass -> incr ok; @@ -51,13 +52,12 @@ let check_invariant (inv : string * invariant_expr) (p : typed program) : bool = e') in assert (Bindlib.free_vars p' = Bindlib.empty_ctxt); - Message.emit_result "Invariant %s\n checked. result: [%d/%d]" name !ok - !total; + Message.emit_result "Invariant %s checked.@ result: [%d/%d]" name !ok !total; !result (* Structural invariant: no default can have as type A -> B *) let invariant_default_no_arrow () : string * invariant_expr = - ( __FUNCTION__, + ( "default_no_arrow", fun _ctx e -> match Mark.remove e with | EDefault _ -> begin @@ -67,19 +67,18 @@ let invariant_default_no_arrow () : string * invariant_expr = (* Structural invariant: no partial evaluation *) let invariant_no_partial_evaluation () : string * invariant_expr = - ( __FUNCTION__, + ( "no_partial_evaluation", fun _ctx e -> match Mark.remove e with - | EApp { f = EOp { op = Op.Log _; _ }, _; _ } -> - (* logs are differents. *) Pass - | EApp _ -> begin - match Mark.remove (Expr.ty e) with TArrow _ -> Fail | _ -> Pass - end + | EApp { f; args; _ } -> ( + match Mark.remove (Expr.ty f) with + | TArrow (tl, _) when List.length args = List.length tl -> Pass + | _ -> Fail) | _ -> Ignore ) (* Structural invariant: no function can return an function *) let invariant_no_return_a_function () : string * invariant_expr = - ( __FUNCTION__, + ( "no_return_a_function", fun _ctx e -> match Mark.remove e with | EAbs _ -> begin @@ -90,16 +89,12 @@ let invariant_no_return_a_function () : string * invariant_expr = | _ -> Ignore ) let invariant_app_inversion () : string * invariant_expr = - ( __FUNCTION__, + ( "app_inversion", fun _ctx e -> match Mark.remove e with - | EApp { f = EOp _, _; _ } -> Pass - | EApp { f = EAbs { binder; _ }, _; args } -> - if Bindlib.mbinder_arity binder = 1 && List.length args = 1 then Pass - else Fail + | EApp { f = EAbs { binder; _ }, _; args; _ } -> + if Bindlib.mbinder_arity binder = List.length args then Pass else Fail | EApp { f = EVar _, _; _ } -> Pass - | EApp { f = EApp { f = EOp { op = Op.Log _; _ }, _; args = _ }, _; _ } -> - Pass | EApp { f = EStructAccess _, _; _ } -> Pass | EApp { f = EExternal _, _; _ } -> Pass | EApp _ -> Fail @@ -107,7 +102,7 @@ let invariant_app_inversion () : string * invariant_expr = (** the arity of constructors when matching is always one. *) let invariant_match_inversion () : string * invariant_expr = - ( __FUNCTION__, + ( "match_inversion", fun _ctx e -> match Mark.remove e with | EMatch { cases; _ } -> @@ -207,7 +202,7 @@ let check_type_root ctx ty = | _ -> false let invariant_typing_defaults () : string * invariant_expr = - ( __FUNCTION__, + ( "typing_defaults", fun ctx e -> if check_type_root ctx (Expr.ty e) then Pass else ( diff --git a/compiler/desugared/disambiguate.ml b/compiler/desugared/disambiguate.ml index 917d4dd5..7403e8be 100644 --- a/compiler/desugared/disambiguate.ml +++ b/compiler/desugared/disambiguate.ml @@ -21,7 +21,7 @@ let expr ctx env e = (* The typer takes care of disambiguating: this consists in: - ensuring [EAbs.tys] doesn't contain any [TAny] - [EDStructAccess.name_opt] is always [Some] *) - (* Intermediate unboxings are fine since the last [untype] will rebox in + (* Intermediate unboxings are fine since the [check_expr] will rebox in depth *) Typing.check_expr ~leave_unresolved:false ctx ~env (Expr.unbox e) diff --git a/compiler/desugared/disambiguate.mli b/compiler/desugared/disambiguate.mli index 95718ade..27ed62b0 100644 --- a/compiler/desugared/disambiguate.mli +++ b/compiler/desugared/disambiguate.mli @@ -18,7 +18,8 @@ in the AST: - it fills the types of arguments in [EAbs] nodes, (untyped ones are - inserted during desugaring, e.g. by `let-in` constructs), + inserted during desugaring, e.g. by `let-in` constructs), as well as + [EApp] and [EAppOp] nodes - it resolves the structure names of [EDStructAccess] nodes. *) val program : Ast.program -> Ast.program diff --git a/compiler/desugared/from_surface.ml b/compiler/desugared/from_surface.ml index 794268d3..01d618bd 100644 --- a/compiler/desugared/from_surface.ml +++ b/compiler/desugared/from_surface.ml @@ -34,10 +34,18 @@ module Runtime = Runtime_ocaml.Runtime the operator suffixes for explicit typing. See {!modules: Shared_ast.Operator} for detail. *) -let translate_binop : S.binop -> Pos.t -> Ast.expr boxed = - fun op pos -> +let translate_binop : + S.binop Mark.pos -> + Pos.t -> + Ast.expr boxed -> + Ast.expr boxed -> + Ast.expr boxed = + fun (op, op_pos) pos lhs rhs -> let op_expr op tys = - Expr.eop op (List.map (Mark.add pos) tys) (Untyped { pos }) + Expr.eappop ~op + ~tys:(List.map (Mark.add op_pos) tys) + ~args:[lhs; rhs] + (Untyped { pos }) in match op with | S.And -> op_expr And [TLit TBool; TLit TBool] @@ -69,7 +77,7 @@ let translate_binop : S.binop -> Pos.t -> Ast.expr boxed = | S.KDec -> [TLit TRat; TLit TRat] | S.KMoney -> [TLit TMoney; TLit TRat] | S.KDate -> - Message.raise_spanned_error pos + Message.raise_spanned_error op_pos "This operator doesn't exist, dates can't be multiplied" | S.KDuration -> [TLit TDuration; TLit TInt]) | S.Div k -> @@ -80,7 +88,7 @@ let translate_binop : S.binop -> Pos.t -> Ast.expr boxed = | S.KDec -> [TLit TRat; TLit TRat] | S.KMoney -> [TLit TMoney; TLit TMoney] | S.KDate -> - Message.raise_spanned_error pos + Message.raise_spanned_error op_pos "This operator doesn't exist, dates can't be divided" | S.KDuration -> [TLit TDuration; TLit TDuration]) | S.Lt k | S.Lte k | S.Gt k | S.Gte k -> @@ -102,10 +110,12 @@ let translate_binop : S.binop -> Pos.t -> Ast.expr boxed = op_expr Eq [TAny; TAny] (* This is a truly polymorphic operator, not an overload *) | S.Neq -> assert false (* desugared already *) - | S.Concat -> op_expr Concat [TArray (TAny, pos); TArray (TAny, pos)] + | S.Concat -> op_expr Concat [TArray (TAny, op_pos); TArray (TAny, op_pos)] -let translate_unop (op : S.unop) pos : Ast.expr boxed = - let op_expr op ty = Expr.eop op [Mark.add pos ty] (Untyped { pos }) in +let translate_unop ((op, op_pos) : S.unop Mark.pos) pos arg : Ast.expr boxed = + let op_expr op ty = + Expr.eappop ~op ~tys:[Mark.add op_pos ty] ~args:[arg] (Untyped { pos }) + in match op with | S.Not -> op_expr Not (TLit TBool) | S.Minus k -> @@ -116,7 +126,7 @@ let translate_unop (op : S.unop) pos : Ast.expr boxed = | S.KDec -> TLit TRat | S.KMoney -> TLit TMoney | S.KDate -> - Message.raise_spanned_error pos + Message.raise_spanned_error op_pos "This operator doesn't exist, dates can't be negative" | S.KDuration -> TLit TDuration) @@ -251,20 +261,15 @@ let rec translate_expr | Binop ((((S.And | S.Or | S.Xor), _) as op), e1, e2) -> check_formula op e1; check_formula op e2; - let op_term = translate_binop (Mark.remove op) (Mark.get op) in - Expr.eapp op_term [rec_helper e1; rec_helper e2] emark + translate_binop op pos (rec_helper e1) (rec_helper e2) | IfThenElse (e_if, e_then, e_else) -> Expr.eifthenelse (rec_helper e_if) (rec_helper e_then) (rec_helper e_else) emark | Binop ((S.Neq, posn), e1, e2) -> (* Neq is just sugar *) rec_helper (Unop ((S.Not, posn), (Binop ((S.Eq, posn), e1, e2), posn)), pos) - | Binop ((op, pos), e1, e2) -> - let op_term = translate_binop op pos in - Expr.eapp op_term [rec_helper e1; rec_helper e2] emark - | Unop ((op, pos), e) -> - let op_term = translate_unop op pos in - Expr.eapp op_term [rec_helper e] emark + | Binop (op, e1, e2) -> translate_binop op pos (rec_helper e1) (rec_helper e2) + | Unop (op, e) -> translate_unop op pos (rec_helper e) | Literal l -> let lit = match l with @@ -416,8 +421,25 @@ let rec translate_expr in Expr.edstructaccess ~e ~field:(Mark.remove x) ~name_opt:(get_str ctxt path) emark) + | FunCall ((Builtin b, _), [arg]) -> + let op, ty = + match b with + | S.ToDecimal -> Op.ToRat, TAny + | S.ToMoney -> Op.ToMoney, TAny + | S.Round -> Op.Round, TAny + | S.Cardinal -> Op.Length, TArray (TAny, pos) + | S.GetDay -> Op.GetDay, TLit TDate + | S.GetMonth -> Op.GetMonth, TLit TDate + | S.GetYear -> Op.GetYear, TLit TDate + | S.FirstDayOfMonth -> Op.FirstDayOfMonth, TLit TDate + | S.LastDayOfMonth -> Op.LastDayOfMonth, TLit TDate + in + Expr.eappop ~op ~tys:[ty, pos] ~args:[rec_helper arg] emark + | S.Builtin _ -> + Message.raise_spanned_error pos "Invalid use of built-in: needs one operand" | FunCall (f, args) -> - Expr.eapp (rec_helper f) (List.map rec_helper args) emark + let args = List.map rec_helper args in + Expr.eapp ~f:(rec_helper f) ~args ~tys:[] emark | ScopeCall (((path, id), _), fields) -> if scope = None then Message.raise_spanned_error pos @@ -459,13 +481,19 @@ let rec translate_expr ScopeVar.Map.empty fields in Expr.escopecall ~scope:called_scope ~args:in_struct emark - | LetIn (x, e1, e2) -> - let v = Var.make (Mark.remove x) in - let local_vars = Ident.Map.add (Mark.remove x) v local_vars in - let tau = TAny, Mark.get x in + | LetIn (xs, e1, e2) -> + let vs = List.map (fun x -> Var.make (Mark.remove x)) xs in + let local_vars = + List.fold_left2 + (fun local_vars x v -> Ident.Map.add (Mark.remove x) v local_vars) + local_vars xs vs + in + let taus = List.map (fun x -> TAny, Mark.get x) xs in (* This type will be resolved in Scopelang.Desambiguation *) - let fn = Expr.make_abs [| v |] (rec_helper ~local_vars e2) [tau] pos in - Expr.eapp fn [rec_helper e1] emark + let f = + Expr.make_abs (Array.of_list vs) (rec_helper ~local_vars e2) taus pos + in + Expr.eapp ~f ~args:[rec_helper e1] ~tys:[] emark | StructLit (((path, s_name), _), fields) -> let ctxt = Name_resolution.module_ctx ctxt path in let s_uid = @@ -588,6 +616,7 @@ let rec translate_expr in Expr.ematch ~e:(rec_helper e1) ~name:enum_uid ~cases emark | ArrayLit es -> Expr.earray (List.map rec_helper es) emark + | Tuple es -> Expr.etuple (List.map rec_helper es) emark | CollectionOp (((S.Filter { f } | S.Map { f }) as op), collection) -> let collection = rec_helper collection in let param_name, predicate = f in @@ -599,15 +628,14 @@ let rec translate_expr [TAny, pos] pos in - Expr.eapp - (Expr.eop - (match op with - | S.Map _ -> Map - | S.Filter _ -> Filter - | _ -> assert false) - [TAny, pos; TAny, pos] - emark) - [f_pred; collection] emark + Expr.eappop + ~op: + (match op with + | S.Map _ -> Map + | S.Filter _ -> Filter + | _ -> assert false) + ~tys:[TAny, pos; TAny, pos] + ~args:[f_pred; collection] emark | CollectionOp ( S.AggregateArgExtremum { max; default; f = param_name, predicate }, collection ) -> @@ -633,19 +661,21 @@ let rec translate_expr rely on returning tuples here *) Expr.make_abs [| v1; v2 |] (Expr.eifthenelse - (Expr.eapp - (Expr.eop cmp_op - [TAny, pos_dft; TAny, pos_dft] - (Untyped { pos = pos_dft })) - [Expr.eapp f_pred [x1] emark; Expr.eapp f_pred [x2] emark] + (Expr.eappop ~op:cmp_op + ~tys:[TAny, pos_dft; TAny, pos_dft] + ~args: + [ + Expr.eapp ~f:f_pred ~args:[x1] ~tys:[] emark; + Expr.eapp ~f:f_pred ~args:[x2] ~tys:[] emark; + ] emark) x1 x2 emark) [TAny, pos; TAny, pos] pos in - Expr.eapp - (Expr.eop Reduce [TAny, pos; TAny, pos; TAny, pos] emark) - [reduce_f; default; collection] + Expr.eappop ~op:Reduce + ~tys:[TAny, pos; TAny, pos; TAny, pos] + ~args:[reduce_f; default; collection] emark | CollectionOp (((Exists { predicate } | Forall { predicate }) as op), collection) -> @@ -665,19 +695,18 @@ let rec translate_expr let acc = Expr.make_var acc_var (Untyped { pos = Mark.get param0 }) in Expr.eabs (Expr.bind [| acc_var; param |] - (Expr.eapp (translate_binop op pos) - [acc; rec_helper ~local_vars predicate] - emark)) + (translate_binop (op, pos) pos acc + (rec_helper ~local_vars predicate))) [TAny, pos; TAny, pos] emark in - Expr.eapp - (Expr.eop Fold [TAny, pos; TAny, pos; TAny, pos] emark) - [f; init; collection] emark + Expr.eappop ~op:Fold + ~tys:[TAny, pos; TAny, pos; TAny, pos] + ~args:[f; init; collection] emark | CollectionOp (AggregateExtremum { max; default }, collection) -> let collection = rec_helper collection in let default = rec_helper default in - let op = translate_binop (if max then S.Gt KPoly else S.Lt KPoly) pos in + let op = if max then S.Gt KPoly else S.Lt KPoly in let op_f = (* fun x1 x2 -> if op x1 x2 then x1 else x2 *) let vname = if max then "max" else "min" in @@ -685,13 +714,13 @@ let rec translate_expr let x1 = Expr.make_var v1 emark in let x2 = Expr.make_var v2 emark in Expr.make_abs [| v1; v2 |] - (Expr.eifthenelse (Expr.eapp op [x1; x2] emark) x1 x2 emark) + (Expr.eifthenelse (translate_binop (op, pos) pos x1 x2) x1 x2 emark) [TAny, pos; TAny, pos] pos in - Expr.eapp - (Expr.eop Reduce [TAny, pos; TAny, pos; TAny, pos] emark) - [op_f; default; collection] + Expr.eappop ~op:Reduce + ~tys:[TAny, pos; TAny, pos; TAny, pos] + ~args:[op_f; default; collection] emark | CollectionOp (AggregateSum { typ }, collection) -> let collection = rec_helper collection in @@ -715,13 +744,13 @@ let rec translate_expr let x1 = Expr.make_var v1 emark in let x2 = Expr.make_var v2 emark in Expr.make_abs [| v1; v2 |] - (Expr.eapp (translate_binop (S.Add KPoly) pos) [x1; x2] emark) + (translate_binop (S.Add KPoly, pos) pos x1 x2) [TAny, pos; TAny, pos] pos in - Expr.eapp - (Expr.eop Reduce [TAny, pos; TAny, pos; TAny, pos] emark) - [op_f; Expr.elit default_lit emark; collection] + Expr.eappop ~op:Reduce + ~tys:[TAny, pos; TAny, pos; TAny, pos] + ~args:[op_f; Expr.elit default_lit emark; collection] emark | MemCollection (member, collection) -> let param_var = Var.make "collection_member" in @@ -732,14 +761,15 @@ let rec translate_expr let acc = Expr.make_var acc_var emark in let f_body = let member = rec_helper member in - Expr.eapp - (Expr.eop Or [TLit TBool, pos; TLit TBool, pos] emark) - [ - Expr.eapp - (Expr.eop Eq [TAny, pos; TAny, pos] emark) - [member; param] emark; - acc; - ] + Expr.eappop ~op:Or + ~tys:[TLit TBool, pos; TLit TBool, pos] + ~args: + [ + Expr.eappop ~op:Eq + ~tys:[TAny, pos; TAny, pos] + ~args:[member; param] emark; + acc; + ] emark in let f = @@ -748,18 +778,9 @@ let rec translate_expr [TLit TBool, pos; TAny, pos] emark in - Expr.eapp - (Expr.eop Fold [TAny, pos; TAny, pos; TAny, pos] emark) - [f; init; collection] emark - | Builtin ToDecimal -> Expr.eop ToRat [TAny, pos] emark - | Builtin ToMoney -> Expr.eop ToMoney [TAny, pos] emark - | Builtin Round -> Expr.eop Round [TAny, pos] emark - | Builtin Cardinal -> Expr.eop Length [TArray (TAny, pos), pos] emark - | Builtin GetDay -> Expr.eop GetDay [TLit TDate, pos] emark - | Builtin GetMonth -> Expr.eop GetMonth [TLit TDate, pos] emark - | Builtin GetYear -> Expr.eop GetYear [TLit TDate, pos] emark - | Builtin FirstDayOfMonth -> Expr.eop FirstDayOfMonth [TLit TDate, pos] emark - | Builtin LastDayOfMonth -> Expr.eop LastDayOfMonth [TLit TDate, pos] emark + Expr.eappop ~op:Fold + ~tys:[TAny, pos; TAny, pos; TAny, pos] + ~args:[f; init; collection] emark and disambiguate_match_and_build_expression (scope : ScopeName.t option) @@ -906,12 +927,9 @@ let merge_conditions (default_pos : Pos.t) : Ast.expr boxed = match precond, cond with | Some precond, Some cond -> - let op_term = - Expr.eop And - [TLit TBool, default_pos; TLit TBool, default_pos] - (Mark.get cond) - in - Expr.eapp op_term [precond; cond] (Mark.get cond) + Expr.eappop ~op:And + ~tys:[TLit TBool, default_pos; TLit TBool, default_pos] + ~args:[precond; cond] (Mark.get cond) | Some precond, None -> Mark.remove precond, Untyped { pos = default_pos } | None, Some cond -> cond | None, None -> Expr.elit (LBool true) (Untyped { pos = default_pos }) @@ -1290,6 +1308,14 @@ let process_topdef in let body = translate_expr None None ctxt local_vars e in let args, tys = List.split args_tys in + let () = + match tys with + | [(Data (S.TTuple _), pos)] -> + Message.raise_spanned_error pos + "Defining arguments of a function as a tuple is not supported, \ + please name the individual arguments" + | _ -> () + in let e = Expr.make_abs (Array.of_list (List.map Mark.remove args)) diff --git a/compiler/desugared/name_resolution.ml b/compiler/desugared/name_resolution.ml index d60eb0c7..5d7293f6 100644 --- a/compiler/desugared/name_resolution.ml +++ b/compiler/desugared/name_resolution.ml @@ -315,6 +315,13 @@ let rec process_base_typ ( TArray (process_base_typ ctxt (Surface.Ast.Data (Mark.remove t), Mark.get t)), typ_pos ) + | Surface.Ast.Data (Surface.Ast.TTuple tl) -> + ( TTuple + (List.map + (fun t -> + process_base_typ ctxt (Surface.Ast.Data (Mark.remove t), Mark.get t)) + tl), + typ_pos ) | Surface.Ast.Data (Surface.Ast.Primitive prim) -> ( match prim with | Surface.Ast.Integer -> TLit TInt, typ_pos diff --git a/compiler/driver.ml b/compiler/driver.ml index 6bd434be..ffdb29ae 100644 --- a/compiler/driver.ml +++ b/compiler/driver.ml @@ -238,14 +238,14 @@ module Passes = struct "Option --avoid-exceptions is not compatible with option --trace" | true, _, Untyped _ -> Program.untype - (Lcalc.Compile_without_exceptions.translate_program + (Lcalc.From_dcalc.translate_program_without_exceptions (Shared_ast.Typing.program ~leave_unresolved:false prg)) | true, _, Typed _ -> - Lcalc.Compile_without_exceptions.translate_program prg + Lcalc.From_dcalc.translate_program_without_exceptions prg | false, _, Typed _ -> - Program.untype (Lcalc.Compile_with_exceptions.translate_program prg) + Program.untype (Lcalc.From_dcalc.translate_program_with_exceptions prg) | false, _, Untyped _ -> - Lcalc.Compile_with_exceptions.translate_program + Lcalc.From_dcalc.translate_program_with_exceptions (Shared_ast.Typing.program ~leave_unresolved:false prg) | _, _, Custom _ -> invalid_arg "Driver.Passes.lcalc" in diff --git a/compiler/lcalc/ast.ml b/compiler/lcalc/ast.ml index 722eca0e..9e5b9f90 100644 --- a/compiler/lcalc/ast.ml +++ b/compiler/lcalc/ast.ml @@ -20,107 +20,3 @@ type 'm naked_expr = (lcalc, 'm) naked_gexpr and 'm expr = (lcalc, 'm) gexpr type 'm program = 'm expr Shared_ast.program - -module OptionMonad = struct - let return ~(mark : 'a mark) e = - Expr.einj ~e ~cons:Expr.some_constr ~name:Expr.option_enum mark - - let empty ~(mark : 'a mark) = - Expr.einj ~e:(Expr.elit LUnit mark) ~cons:Expr.none_constr - ~name:Expr.option_enum mark - - let bind_var ~(mark : 'a mark) f x arg = - let cases = - EnumConstructor.Map.of_list - [ - ( Expr.none_constr, - let x = Var.make "_" in - Expr.eabs - (Expr.bind [| x |] - (Expr.einj ~e:(Expr.evar x mark) ~cons:Expr.none_constr - ~name:Expr.option_enum mark)) - [TLit TUnit, Expr.mark_pos mark] - mark ); - (* | None x -> None x *) - ( Expr.some_constr, - Expr.eabs (Expr.bind [| x |] f) [TAny, Expr.mark_pos mark] mark ) - (*| Some x -> f (where f contains x as a free variable) *); - ] - in - Expr.ematch ~e:arg ~name:Expr.option_enum ~cases mark - - let bind ~(mark : 'a mark) ~(var_name : string) f arg = - let x = Var.make var_name in - (* todo modify*) - bind_var f x arg ~mark - - let bind_cont ~(mark : 'a mark) ~(var_name : string) f arg = - let x = Var.make var_name in - bind_var (f x) x arg ~mark - - let mbind_mvar ~(mark : 'a mark) f xs args = - (* match e1, ..., en with | Some e1', ..., Some en' -> f (e1, ..., en) | _ - -> None *) - ListLabels.fold_left2 xs args ~f:(bind_var ~mark) - ~init:(Expr.eapp f (List.map (fun v -> Expr.evar v mark) xs) mark) - - let mbind ~(mark : 'a mark) ~(var_name : string) f args = - (* match e1, ..., en with | Some e1', ..., Some en' -> f (e1, ..., en) | _ - -> None *) - let vars = - ListLabels.mapi args ~f:(fun i _ -> - Var.make (Format.sprintf "%s_%i" var_name i)) - in - mbind_mvar f vars args ~mark - - let mbind_cont ~(mark : 'a mark) ~(var_name : string) f args = - let vars = - ListLabels.mapi args ~f:(fun i _ -> - Var.make (Format.sprintf "%s_%i" var_name i)) - in - ListLabels.fold_left2 vars args ~f:(bind_var ~mark) ~init:(f vars) - (* mbind_mvar (f vars) vars args ~mark *) - - let mmap_mvar ~(mark : 'a mark) f xs args = - (* match e1, ..., en with | Some e1', ..., Some en' -> f (e1, ..., en) | _ - -> None *) - ListLabels.fold_left2 xs args ~f:(bind_var ~mark) - ~init: - (Expr.einj - ~e:(Expr.eapp f (List.map (fun v -> Expr.evar v mark) xs) mark) - ~cons:Expr.some_constr ~name:Expr.option_enum mark) - - let map_var ~(mark : 'a mark) f x arg = mmap_mvar f [x] [arg] ~mark - - let map ~(mark : 'a mark) ~(var_name : string) f arg = - let x = Var.make var_name in - map_var f x arg ~mark - - let mmap ~(mark : 'a mark) ~(var_name : string) f args = - let vars = - ListLabels.mapi args ~f:(fun i _ -> - Var.make (Format.sprintf "%s_%i" var_name i)) - in - mmap_mvar f vars args ~mark - - let error_on_empty - ~(mark : 'a mark) - ~(var_name : string) - ?(toplevel = false) - arg = - let cases = - EnumConstructor.Map.of_list - [ - ( Expr.none_constr, - let x = Var.make "_" in - Expr.eabs - (Expr.bind [| x |] (Expr.eraise NoValueProvided mark)) - [TAny, Expr.mark_pos mark] - mark ); - (* | None x -> raise NoValueProvided *) - Expr.some_constr, Expr.fun_id ~var_name mark (* | Some x -> x*); - ] - in - if toplevel then Expr.ematch ~e:arg ~name:Expr.option_enum ~cases mark - else Expr.ematch ~e:arg ~name:Expr.option_enum ~cases mark -end diff --git a/compiler/lcalc/ast.mli b/compiler/lcalc/ast.mli index 7129b7ed..f7006f66 100644 --- a/compiler/lcalc/ast.mli +++ b/compiler/lcalc/ast.mli @@ -24,82 +24,3 @@ type 'm naked_expr = (lcalc, 'm) naked_gexpr and 'm expr = (lcalc, 'm) gexpr type 'm program = 'm expr Shared_ast.program - -(** {1 Option-related management}*) - -(** {2 Term building and management for the [option] monad}*) - -module OptionMonad : sig - val return : mark:'m mark -> ('a any, 'm) boxed_gexpr -> ('a, 'm) boxed_gexpr - val empty : mark:'m mark -> ('a any, 'm) boxed_gexpr - - val bind_var : - mark:'m mark -> - ('a any, 'm) boxed_gexpr -> - ('a, 'm) gexpr Var.t -> - ('a, 'm) boxed_gexpr -> - ('a, 'm) boxed_gexpr - - val bind : - mark:'m mark -> - var_name:string -> - ('a any, 'm) boxed_gexpr -> - ('a, 'm) boxed_gexpr -> - ('a, 'm) boxed_gexpr - - val bind_cont : - mark:'m mark -> - var_name:string -> - (('a any, 'm) gexpr Var.t -> ('a, 'm) boxed_gexpr) -> - ('a, 'm) boxed_gexpr -> - ('a, 'm) boxed_gexpr - - val mbind_mvar : - mark:'m mark -> - ('a any, 'm) boxed_gexpr -> - ('a, 'm) gexpr Var.t list -> - ('a, 'm) boxed_gexpr list -> - ('a, 'm) boxed_gexpr - - val mbind : - mark:'m mark -> - var_name:string -> - ('a any, 'm) boxed_gexpr -> - ('a, 'm) boxed_gexpr list -> - ('a, 'm) boxed_gexpr - - val mbind_cont : - mark:'m mark -> - var_name:string -> - (('a any, 'm) gexpr Var.t list -> ('a, 'm) boxed_gexpr) -> - ('a, 'm) boxed_gexpr list -> - ('a, 'm) boxed_gexpr - - val error_on_empty : - mark:'m mark -> - var_name:string -> - ?toplevel:bool -> - ((< exceptions : yes ; .. > as 'a), 'm) boxed_gexpr -> - ('a, 'm) boxed_gexpr - - val map : - mark:'m mark -> - var_name:string -> - ((< exceptions : no ; .. > as 'a), 'm) boxed_gexpr -> - ('a, 'm) boxed_gexpr -> - ('a, 'm) boxed_gexpr - - val mmap_mvar : - mark:'m mark -> - ('a any, 'm) boxed_gexpr -> - ('a, 'm) gexpr Var.t list -> - ('a, 'm) boxed_gexpr list -> - ('a, 'm) boxed_gexpr - - val mmap : - mark:'m mark -> - var_name:string -> - ('a any, 'm) boxed_gexpr -> - ('a, 'm) boxed_gexpr list -> - ('a, 'm) boxed_gexpr -end diff --git a/compiler/lcalc/closure_conversion.ml b/compiler/lcalc/closure_conversion.ml index 48ffd048..abe7a436 100644 --- a/compiler/lcalc/closure_conversion.ml +++ b/compiler/lcalc/closure_conversion.ml @@ -39,8 +39,7 @@ let rec transform_closures_expr : let m = Mark.get e in match Mark.remove e with | EStruct _ | EStructAccess _ | ETuple _ | ETupleAccess _ | EInj _ | EArray _ - | ELit _ | EExternal _ | EAssert _ | EOp _ | EIfThenElse _ | ERaise _ - | ECatch _ -> + | ELit _ | EExternal _ | EAssert _ | EIfThenElse _ | ERaise _ | ECatch _ -> Expr.map_gather ~acc:Var.Set.empty ~join:Var.Set.union ~f:(transform_closures_expr ctx) e @@ -59,7 +58,8 @@ let rec transform_closures_expr : let e = Expr.eabs (Expr.bind args - (Expr.eapp (Expr.rebox e) arg_vars (Expr.with_ty m tret))) + (Expr.eapp ~f:(Expr.rebox e) ~args:arg_vars ~tys:targs + (Expr.with_ty m tret))) targs m in let boxed = @@ -104,7 +104,7 @@ let rec transform_closures_expr : (free_vars, EnumConstructor.Map.empty) in free_vars, Expr.ematch ~e:new_e ~name ~cases:new_cases m - | EApp { f = EAbs { binder; tys }, e1_pos; args } -> + | EApp { f = EAbs { binder; tys }, e1_pos; args; _ } -> (* let-binding, we should not close these *) let vars, body = Bindlib.unmbind binder in let free_vars, new_body = (transform_closures_expr ctx) body in @@ -120,7 +120,9 @@ let rec transform_closures_expr : args (free_vars, []) in ( free_vars, - Expr.eapp (Expr.eabs new_binder (tys_as_tanys tys) e1_pos) new_args m ) + Expr.eapp + ~f:(Expr.eabs new_binder (tys_as_tanys tys) e1_pos) + ~args:new_args ~tys m ) | EAbs { binder; tys } -> (* λ x.t *) let binder_mark = m in @@ -143,11 +145,9 @@ let rec transform_closures_expr : (* let env = from_closure_env env in let arg0 = env.0 in ... *) let new_closure_body = Expr.make_let_in closure_env_var any_ty - (Expr.eapp - (Expr.eop Operator.FromClosureEnv - [TClosureEnv, binder_pos] - binder_mark) - [Expr.evar closure_env_arg_var binder_mark] + (Expr.eappop ~op:Operator.FromClosureEnv + ~tys:[TClosureEnv, binder_pos] + ~args:[Expr.evar closure_env_arg_var binder_mark] binder_mark) (Expr.make_multiple_let_in (Array.of_list extra_vars_list) @@ -155,9 +155,9 @@ let rec transform_closures_expr : (List.mapi (fun i _ -> Expr.etupleaccess - (Expr.evar closure_env_var binder_mark) - i - (List.length extra_vars_list) + ~e:(Expr.evar closure_env_var binder_mark) + ~index:i + ~size:(List.length extra_vars_list) binder_mark) extra_vars_list) new_body binder_pos) @@ -178,29 +178,27 @@ let rec transform_closures_expr : (Expr.etuple ((Bindlib.box_var code_var, binder_mark) :: [ - Expr.eapp - (Expr.eop Operator.ToClosureEnv - [TAny, Expr.pos e] - (Mark.get e)) - [ - (if extra_vars_list = [] then Expr.elit LUnit binder_mark - else - Expr.etuple - (List.map - (fun extra_var -> - Bindlib.box_var extra_var, binder_mark) - extra_vars_list) - m); - ] + Expr.eappop ~op:Operator.ToClosureEnv + ~tys:[TAny, Expr.pos e] + ~args: + [ + (if extra_vars_list = [] then Expr.elit LUnit binder_mark + else + Expr.etuple + (List.map + (fun extra_var -> + Bindlib.box_var extra_var, binder_mark) + extra_vars_list) + m); + ] (Mark.get e); ]) m) (Expr.pos e) ) - | EApp + | EAppOp { - f = - (EOp { op = HandleDefaultOpt | Fold | Map | Filter | Reduce; _ }, _) - as f; + op = (HandleDefaultOpt | Fold | Map | Filter | Reduce) as op; + tys; args; } -> (* Special case for some operators: its arguments shall remain thunks (which @@ -225,15 +223,16 @@ let rec transform_closures_expr : Var.Set.union free_vars new_free_vars, new_arg :: new_args) args (Var.Set.empty, []) in - free_vars, Expr.eapp (Expr.box f) new_args (Mark.get e) - | EApp { f = EOp _, _; _ } -> - (* This corresponds to an operator call, which we don't want to transform*) + free_vars, Expr.eappop ~op ~tys ~args:new_args (Mark.get e) + | EAppOp _ -> + (* This corresponds to an operator call, which we don't want to transform *) Expr.map_gather ~acc:Var.Set.empty ~join:Var.Set.union ~f:(transform_closures_expr ctx) e - | EApp { f = EVar v, f_m; args } when Var.Map.mem v ctx.globally_bound_vars -> + | EApp { f = EVar v, f_m; args; tys } + when Var.Map.mem v ctx.globally_bound_vars -> (* This corresponds to a scope or toplevel function call, which we don't - want to transform*) + want to transform *) let free_vars, new_args = List.fold_right (fun arg (free_vars, new_args) -> @@ -241,8 +240,8 @@ let rec transform_closures_expr : Var.Set.union free_vars new_free_vars, new_arg :: new_args) args (Var.Set.empty, []) in - free_vars, Expr.eapp (Expr.evar v f_m) new_args m - | EApp { f = e1; args } -> + free_vars, Expr.eapp ~f:(Expr.evar v f_m) ~args:new_args ~tys m + | EApp { f = e1; args; tys } -> let free_vars, new_e1 = (transform_closures_expr ctx) e1 in let code_env_var = Var.make "code_and_env" in let env_var = Var.make "env" in @@ -256,17 +255,21 @@ let rec transform_closures_expr : in let call_expr = let m1 = Mark.get e1 in - Expr.make_let_in code_var - (TAny, Expr.pos e) - (Expr.etupleaccess (Bindlib.box_var code_env_var, m1) 0 2 m) - (Expr.make_let_in env_var - (TAny, Expr.pos e) - (Expr.etupleaccess (Bindlib.box_var code_env_var, m1) 1 2 m) - (Expr.eapp - (Bindlib.box_var code_var, m1) - ((Bindlib.box_var env_var, m1) :: new_args) - m) - (Expr.pos e)) + let env_arg_ty = TClosureEnv, Expr.pos e1 in + Expr.make_multiple_let_in [| code_var; env_var |] + [TArrow (env_arg_ty :: tys, (TAny, Expr.pos e)), Expr.pos e; env_arg_ty] + [ + Expr.etupleaccess + ~e:(Bindlib.box_var code_env_var, m1) + ~index:0 ~size:2 m; + Expr.etupleaccess + ~e:(Bindlib.box_var code_env_var, m1) + ~index:1 ~size:2 m; + ] + (Expr.eapp + ~f:(Bindlib.box_var code_var, m1) + ~args:((Bindlib.box_var env_var, m1) :: new_args) + ~tys:(env_arg_ty :: tys) m) (Expr.pos e) in ( free_vars, @@ -464,7 +467,7 @@ let rec hoist_closures_expr : (collected_closures, EnumConstructor.Map.empty) in collected_closures, Expr.ematch ~e:new_e ~name ~cases:new_cases m - | EApp { f = EAbs { binder; tys }, e1_pos; args } -> + | EApp { f = EAbs { binder; tys }, e1_pos; args; _ } -> (* let-binding, we should not close these *) let vars, body = Bindlib.unmbind binder in let collected_closures, new_body = @@ -481,12 +484,13 @@ let rec hoist_closures_expr : args (collected_closures, []) in ( collected_closures, - Expr.eapp (Expr.eabs new_binder (tys_as_tanys tys) e1_pos) new_args m ) - | EApp + Expr.eapp + ~f:(Expr.eabs new_binder (tys_as_tanys tys) e1_pos) + ~args:new_args ~tys m ) + | EAppOp { - f = - (EOp { op = HandleDefaultOpt | Fold | Map | Filter | Reduce; _ }, _) - as f; + op = (HandleDefaultOpt | Fold | Map | Filter | Reduce) as op; + tys; args; } -> (* Special case for some operators: its arguments closures thunks because if @@ -514,7 +518,7 @@ let rec hoist_closures_expr : new_collected_closures @ collected_closures, new_arg :: new_args) args ([], []) in - collected_closures, Expr.eapp (Expr.box f) new_args (Mark.get e) + collected_closures, Expr.eappop ~op ~args:new_args ~tys (Mark.get e) | EAbs { tys; _ } -> (* this is the closure we want to hoist*) let closure_var = Var.make ("closure_" ^ name_context) in @@ -532,8 +536,8 @@ let rec hoist_closures_expr : ], Expr.make_var closure_var m ) | EApp _ | EStruct _ | EStructAccess _ | ETuple _ | ETupleAccess _ | EInj _ - | EArray _ | ELit _ | EAssert _ | EOp _ | EIfThenElse _ | ERaise _ | ECatch _ - | EVar _ -> + | EArray _ | ELit _ | EAssert _ | EAppOp _ | EIfThenElse _ | ERaise _ + | ECatch _ | EVar _ -> Expr.map_gather ~acc:[] ~join:( @ ) ~f:(hoist_closures_expr name_context) e | EExternal _ -> failwith "unimplemented" | _ -> . diff --git a/compiler/lcalc/compile_with_exceptions.ml b/compiler/lcalc/compile_with_exceptions.ml index c6b64091..f2c92361 100644 --- a/compiler/lcalc/compile_with_exceptions.ml +++ b/compiler/lcalc/compile_with_exceptions.ml @@ -53,16 +53,15 @@ let rec translate_default in let pos = Expr.mark_pos mark_default in let exceptions = - Expr.make_app - (Expr.eop Op.HandleDefault - [TAny, pos; TAny, pos; TAny, pos] - (Expr.no_mark mark_default)) - [ - Expr.earray exceptions mark_default; - Expr.thunk_term (translate_expr just) (Mark.get just); - Expr.thunk_term (translate_expr cons) (Mark.get cons); - ] - pos + Expr.eappop ~op:Op.HandleDefault + ~tys:[TAny, pos; TAny, pos; TAny, pos] + ~args: + [ + Expr.earray exceptions mark_default; + Expr.thunk_term (translate_expr just) (Mark.get just); + Expr.thunk_term (translate_expr cons) (Mark.get cons); + ] + mark_default in exceptions @@ -77,7 +76,10 @@ and translate_expr (e : 'm D.expr) : 'm A.expr boxed = | EDefault { excepts; just; cons } -> translate_default excepts just cons (Mark.get e) | EPureDefault e -> translate_expr e - | EOp { op; tys } -> Expr.eop (Operator.translate op) tys m + | EAppOp { op; args; tys } -> + Expr.eappop ~op:(Operator.translate op) + ~args:(List.map translate_expr args) + ~tys m | ( ELit _ | EApp _ | EArray _ | EVar _ | EExternal _ | EAbs _ | EIfThenElse _ | ETuple _ | ETupleAccess _ | EInj _ | EAssert _ | EStruct _ | EStructAccess _ | EMatch _ ) as e -> diff --git a/compiler/lcalc/compile_without_exceptions.ml b/compiler/lcalc/compile_without_exceptions.ml index 56176809..98e57ed8 100644 --- a/compiler/lcalc/compile_without_exceptions.ml +++ b/compiler/lcalc/compile_without_exceptions.ml @@ -59,36 +59,55 @@ let rec translate_default let exceptions = List.map translate_expr exceptions in let pos = Expr.mark_pos mark_default in let exceptions = - Expr.make_app - (Expr.eop Op.HandleDefaultOpt - [TAny, pos; TAny, pos; TAny, pos] - (Expr.no_mark mark_default)) - [ - Expr.earray exceptions mark_default; - (* In call-by-value programming languages, as lcalc, arguments are - evalulated before calling the function. Since we don't want to - execute the justification and conclusion while before checking every - exceptions, we need to thunk them. *) - Expr.thunk_term (translate_expr just) (Mark.get just); - Expr.thunk_term (translate_expr cons) (Mark.get cons); - ] - pos + Expr.eappop ~op:Op.HandleDefaultOpt + ~tys:[TAny, pos; TAny, pos; TAny, pos] + ~args: + [ + Expr.earray exceptions mark_default; + (* In call-by-value programming languages, as lcalc, arguments are + evalulated before calling the function. Since we don't want to + execute the justification and conclusion while before checking + every exceptions, we need to thunk them. *) + Expr.thunk_term (translate_expr just) (Mark.get just); + Expr.thunk_term (translate_expr cons) (Mark.get cons); + ] + mark_default in exceptions and translate_expr (e : 'm D.expr) : 'm A.expr boxed = let mark = Mark.get e in match Mark.remove e with - | EEmptyError -> Ast.OptionMonad.empty ~mark + | EEmptyError -> + Expr.einj ~e:(Expr.elit LUnit mark) ~cons:Expr.none_constr + ~name:Expr.option_enum mark | EErrorOnEmpty arg -> - Ast.OptionMonad.error_on_empty ~mark ~var_name:"arg" (translate_expr arg) + let cases = + EnumConstructor.Map.of_list + [ + ( Expr.none_constr, + let x = Var.make "_" in + Expr.eabs + (Expr.bind [| x |] (Expr.eraise NoValueProvided mark)) + [TAny, Expr.mark_pos mark] + mark ); + (* | None x -> raise NoValueProvided *) + Expr.some_constr, Expr.fun_id ~var_name:"arg" mark (* | Some x -> x*); + ] + in + Expr.ematch ~e:(translate_expr arg) ~name:Expr.option_enum ~cases mark | EDefault { excepts; just; cons } -> translate_default excepts just cons (Mark.get e) - | EPureDefault e -> Ast.OptionMonad.return ~mark (translate_expr e) + | EPureDefault e -> + Expr.einj ~e:(translate_expr e) ~cons:Expr.some_constr + ~name:Expr.option_enum mark (* As we need to translate types as well as terms, we cannot simply use [Expr.map] for terms that contains types. *) - | EOp { op; tys } -> - Expr.eop (Operator.translate op) (List.map translate_typ tys) mark + | EAppOp { op; tys; args } -> + Expr.eappop ~op:(Operator.translate op) + ~tys:(List.map translate_typ tys) + ~args:(List.map translate_expr args) + mark | EAbs { binder; tys } -> let vars, body = Bindlib.unmbind binder in let body = translate_expr body in diff --git a/compiler/lcalc/from_dcalc.ml b/compiler/lcalc/from_dcalc.ml index ec7601c3..98e49b4b 100644 --- a/compiler/lcalc/from_dcalc.ml +++ b/compiler/lcalc/from_dcalc.ml @@ -14,8 +14,21 @@ License for the specific language governing permissions and limitations under the License. *) +open Shared_ast + +let add_option_type ctx = + { + ctx with + ctx_enums = + EnumName.Map.add Expr.option_enum Expr.option_enum_config ctx.ctx_enums; + } + +let add_option_type_program prg = + { prg with decl_ctx = add_option_type prg.decl_ctx } + let translate_program_with_exceptions = Compile_with_exceptions.translate_program -let translate_program_without_exceptions = - Compile_without_exceptions.translate_program +let translate_program_without_exceptions prg = + let prg = add_option_type_program prg in + Compile_without_exceptions.translate_program prg diff --git a/compiler/lcalc/from_dcalc.mli b/compiler/lcalc/from_dcalc.mli index e4998e05..2a99ce1a 100644 --- a/compiler/lcalc/from_dcalc.mli +++ b/compiler/lcalc/from_dcalc.mli @@ -14,13 +14,15 @@ License for the specific language governing permissions and limitations under the License. *) +open Shared_ast + val translate_program_with_exceptions : - Shared_ast.typed Dcalc.Ast.program -> Shared_ast.untyped Ast.program + typed Dcalc.Ast.program -> untyped Ast.program (** Translation from the default calculus to the lambda calculus. This translation uses exceptions to handle empty default terms. *) val translate_program_without_exceptions : - Shared_ast.typed Dcalc.Ast.program -> Shared_ast.untyped Ast.program + typed Dcalc.Ast.program -> untyped Ast.program (** Translation from the default calculus to the lambda calculus. This translation uses an option monad to handle empty defaults terms. This transformation is one piece to permit to compile toward legacy languages diff --git a/compiler/lcalc/to_ocaml.ml b/compiler/lcalc/to_ocaml.ml index 1d408abb..e549bb1f 100644 --- a/compiler/lcalc/to_ocaml.ml +++ b/compiler/lcalc/to_ocaml.ml @@ -235,9 +235,7 @@ let format_var (fmt : Format.formatter) (v : 'm Var.t) : unit = let needs_parens (e : 'm expr) : bool = match Mark.remove e with - | EApp { f = EAbs _, _; _ } - | ELit (LBool _ | LUnit) - | EVar _ | ETuple _ | EOp _ -> + | EApp { f = EAbs _, _; _ } | ELit (LBool _ | LUnit) | EVar _ | ETuple _ -> false | _ -> true @@ -349,7 +347,7 @@ let rec format_expr (ctx : decl_ctx) (fmt : Format.formatter) (e : 'm expr) : e)) (EnumConstructor.Map.bindings cases) | ELit l -> Format.fprintf fmt "%a" format_lit (Mark.add (Expr.pos e) l) - | EApp { f = EAbs { binder; tys }, _; args } -> + | EApp { f = EAbs { binder; tys }, _; args; _ } -> let xs, body = Bindlib.unmbind binder in let xs_tau = List.map2 (fun x tau -> x, tau) (Array.to_list xs) tys in let xs_tau_arg = List.map2 (fun (x, tau) arg -> x, tau, arg) xs_tau args in @@ -371,14 +369,14 @@ let rec format_expr (ctx : decl_ctx) (fmt : Format.formatter) (e : 'm expr) : xs_tau format_expr body | EApp { - f = EApp { f = EOp { op = Log (BeginCall, info); _ }, _; args = [f] }, _; + f = EAppOp { op = Log (BeginCall, info); args = [f]; _ }, _; args = [arg]; + _; } when Cli.globals.trace -> Format.fprintf fmt "(log_begin_call@ %a@ %a)@ %a" format_uid_list info format_with_parens f format_with_parens arg - | EApp - { f = EOp { op = Log (VarDef var_def_info, info); _ }, _; args = [arg1] } + | EAppOp { op = Log (VarDef var_def_info, info); args = [arg1]; _ } when Cli.globals.trace -> Format.fprintf fmt "(log_variable_definition@ %a@ {io_input=%s;@ io_output=%b}@ (%a)@ %a)" @@ -390,42 +388,35 @@ let rec format_expr (ctx : decl_ctx) (fmt : Format.formatter) (e : 'm expr) : var_def_info.log_io_output typ_embedding_name (var_def_info.log_typ, Pos.no_pos) format_with_parens arg1 - | EApp { f = EOp { op = Log (PosRecordIfTrueBool, _); _ }, m; args = [arg1] } + | EAppOp { op = Log (PosRecordIfTrueBool, _); args = [arg1]; _ } when Cli.globals.trace -> - let pos = Expr.mark_pos m in + let pos = Expr.pos e in Format.fprintf fmt "(log_decision_taken@ @[{filename = \"%s\";@ start_line=%d;@ \ start_column=%d;@ end_line=%d; end_column=%d;@ law_headings=%a}@]@ %a)" (Pos.get_file pos) (Pos.get_start_line pos) (Pos.get_start_column pos) (Pos.get_end_line pos) (Pos.get_end_column pos) format_string_list (Pos.get_law_info pos) format_with_parens arg1 - | EApp { f = EOp { op = Log (EndCall, info); _ }, _; args = [arg1] } - when Cli.globals.trace -> + | EAppOp { op = Log (EndCall, info); args = [arg1]; _ } when Cli.globals.trace + -> Format.fprintf fmt "(log_end_call@ %a@ %a)" format_uid_list info format_with_parens arg1 - | EApp { f = EOp { op = Log _; _ }, _; args = [arg1] } -> + | EAppOp { op = Log _; args = [arg1]; _ } -> Format.fprintf fmt "%a" format_with_parens arg1 - | EApp - { - f = EOp { op = (HandleDefault | HandleDefaultOpt) as op; _ }, pos; - args; - } -> + | EAppOp { op = (HandleDefault | HandleDefaultOpt) as op; args; _ } -> + let pos = Expr.pos e in Format.fprintf fmt "@[%s@ @[{filename = \"%s\";@ start_line=%d;@ \ start_column=%d;@ end_line=%d; end_column=%d;@ law_headings=%a}@]@ %a@]" (Print.operator_to_string op) - (Pos.get_file (Expr.mark_pos pos)) - (Pos.get_start_line (Expr.mark_pos pos)) - (Pos.get_start_column (Expr.mark_pos pos)) - (Pos.get_end_line (Expr.mark_pos pos)) - (Pos.get_end_column (Expr.mark_pos pos)) - format_string_list - (Pos.get_law_info (Expr.mark_pos pos)) + (Pos.get_file pos) (Pos.get_start_line pos) (Pos.get_start_column pos) + (Pos.get_end_line pos) (Pos.get_end_column pos) format_string_list + (Pos.get_law_info pos) (Format.pp_print_list ~pp_sep:(fun fmt () -> Format.fprintf fmt "@ ") format_with_parens) args - | EApp { f; args } -> + | EApp { f; args; _ } -> Format.fprintf fmt "@[%a@ %a@]" format_with_parens f (Format.pp_print_list ~pp_sep:(fun fmt () -> Format.fprintf fmt "@ ") @@ -435,7 +426,12 @@ let rec format_expr (ctx : decl_ctx) (fmt : Format.formatter) (e : 'm expr) : Format.fprintf fmt "@[ if@ @[%a@]@ then@ @[%a@]@ else@ @[%a@]@]" format_with_parens cond format_with_parens etrue format_with_parens efalse - | EOp { op; _ } -> Format.pp_print_string fmt (Operator.name op) + | EAppOp { op; args; _ } -> + Format.fprintf fmt "@[%s@ %a@]" (Operator.name op) + (Format.pp_print_list + ~pp_sep:(fun fmt () -> Format.fprintf fmt "@ ") + format_with_parens) + args | EAssert e' -> Format.fprintf fmt "@[if@ %a@ then@ ()@ else@ raise (AssertionFailed @[ ELit (LBool false), m | ELit (LBool false), m -> ELit (LBool true), m - | EApp { f = EOp { op = Op.Not; _ }, _; args = [(e, _)] }, m -> e, m - | (EApp { f = EOp { op; tys }, mop; args = [e1; e2] }, m) as e -> ( + | EAppOp { op = Op.Not; args = [(e, _)] }, m -> e, m + | (EAppOp { op; tys; args = [e1; e2] }, m) as e -> ( match op with | Op.And -> - ( EApp - { - f = EOp { op = Op.Or; tys }, mop; - args = [bool_negation e1; bool_negation e2]; - }, - m ) + EAppOp { op = Op.Or; tys; args = [bool_negation e1; bool_negation e2] }, m | Op.Or -> - ( EApp - { - f = EOp { op = Op.And; tys }, mop; - args = [bool_negation e1; bool_negation e2]; - }, + ( EAppOp { op = Op.And; tys; args = [bool_negation e1; bool_negation e2] }, m ) | op -> ( match neg_op op with - | Some op -> EApp { f = EOp { op; tys }, mop; args = [e1; e2] }, m + | Some op -> EAppOp { op; tys; args = [e1; e2] }, m | None -> - ( EApp - { - f = EOp { op = Op.Not; tys = [TLit TBool, Expr.mark_pos m] }, m; - args = [e]; - }, + ( EAppOp { op = Op.Not; tys = [TLit TBool, Expr.mark_pos m]; args = [e] }, m ))) | (_, m) as e -> - ( EApp - { - f = EOp { op = Op.Not; tys = [TLit TBool, Expr.mark_pos m] }, m; - args = [e]; - }, - m ) + EAppOp { op = Op.Not; tys = [TLit TBool, Expr.mark_pos m]; args = [e] }, m let rec lazy_eval : decl_ctx -> Env.t -> laziness_level -> expr -> expr * Env.t = @@ -187,35 +169,16 @@ let rec lazy_eval : decl_ctx -> Env.t -> laziness_level -> expr -> expr * Env.t let r, env1 = lazy_eval ctx env1 llevel e in env_elt.reduced <- r, env1; r, Env.join env env1 - | EApp { f; args }, m -> ( + | EAppOp { op; args; tys }, m -> ( if (not llevel.eval_default) && not (List.equal Expr.equal args [ELit LUnit, m]) (* Applications to () encode thunked default terms *) then e0, env else - match eval_to_value env f with - | (EAbs { binder; _ }, _), env -> - let vars, body = Bindlib.unmbind binder in - log "@[@[{"; - let env = - Seq.fold_left2 - (fun env1 var e -> - log "@[LET %a = %a@]@ " Print.var_debug var Expr.format e; - Env.add var e env env1) - env (Array.to_seq vars) (List.to_seq args) - in - log "@]@[IN [%a]@]" (Print.expr ~debug:true ()) body; - let e, env = lazy_eval ctx env llevel body in - log "@]}"; - e, env - | ( ( EOp - { - op = (Op.Map | Op.Filter | Op.Reduce | Op.Fold | Op.Length) as op; - tys; - }, - m ), - env (* when not llevel.eval_op *) ) -> ( + match op with + | (Op.Map | Op.Filter | Op.Reduce | Op.Fold | Op.Length) as op -> ( + (* when not llevel.eval_op *) (* Distribute collection operations to the terms rather than use their runtime implementations *) let arr = List.hd (List.rev args) in @@ -223,27 +186,17 @@ let rec lazy_eval : decl_ctx -> Env.t -> laziness_level -> expr -> expr * Env.t let aty = List.hd (List.rev tys) in match eval_to_value env arr with | (EArray elts, _), env -> - let eapp f e = EApp { f; args = [e] }, m in + let eapp f e = EApp { f; args = [e]; tys = [] }, m in let empty_condition () = (* Is the expression [length(arr) = 0] *) let pos = Expr.mark_pos m in - ( EApp + ( EAppOp { - f = - ( EOp - { - op = Op.Eq_int_int; - tys = [TLit TInt, pos; TLit TInt, pos]; - }, - m ); + op = Op.Eq_int_int; + tys = [TLit TInt, pos; TLit TInt, pos]; args = [ - ( EApp - { - f = EOp { op = Op.Length; tys = [aty] }, m; - args = [arr]; - }, - m ); + EAppOp { op = Op.Length; tys = [aty]; args = [arr] }, m; ELit (LInt (Runtime.integer_of_int 0)), m; ]; }, @@ -274,14 +227,14 @@ let rec lazy_eval : decl_ctx -> Env.t -> laziness_level -> expr -> expr * Env.t | Op.Reduce, [f; _; _], elt0 :: elts -> let e = List.fold_left - (fun acc elt -> EApp { f; args = [acc; elt] }, m) + (fun acc elt -> EApp { f; args = [acc; elt]; tys = [] }, m) elt0 elts in e, env | Op.Fold, [f; base; _], elts -> let e = List.fold_left - (fun acc elt -> EApp { f; args = [acc; elt] }, m) + (fun acc elt -> EApp { f; args = [acc; elt]; tys = [] }, m) base elts in e, env @@ -292,8 +245,8 @@ let rec lazy_eval : decl_ctx -> Env.t -> laziness_level -> expr -> expr * Env.t (* We did a transformation (removing the outer operator), but further evaluation may be needed to guarantee that [llevel] is reached *) lazy_eval ctx env { llevel with eval_match = true } e - | _ -> (EApp { f; args }, m), env) - | ((EOp { op; _ }, m) as f), env -> + | _ -> (EAppOp { op; args; tys }, m), env) + | _ -> let env, args = List.fold_left_map (fun env e -> @@ -301,7 +254,7 @@ let rec lazy_eval : decl_ctx -> Env.t -> laziness_level -> expr -> expr * Env.t env, e) env args in - if not llevel.eval_op then (EApp { f; args }, m), env + if not llevel.eval_op then (EAppOp { op; args; tys }, m), env else let renv = ref env in (* Dirty workaround returning env and conds from evaluate_operator *) @@ -316,10 +269,32 @@ let rec lazy_eval : decl_ctx -> Env.t -> laziness_level -> expr -> expr * Env.t messages so we don't care. *) args in - e, !renv - (* fixme: this forwards eempty *) + e, !renv) + (* fixme: this forwards eempty *) + | EApp { f; args }, m -> ( + if + (not llevel.eval_default) + && not (List.equal Expr.equal args [ELit LUnit, m]) + (* Applications to () encode thunked default terms *) + then e0, env + else + match eval_to_value env f with + | (EAbs { binder; _ }, _), env -> + let vars, body = Bindlib.unmbind binder in + log "@[@[{"; + let env = + Seq.fold_left2 + (fun env1 var e -> + log "@[LET %a = %a@]@ " Print.var_debug var Expr.format e; + Env.add var e env env1) + env (Array.to_seq vars) (List.to_seq args) + in + log "@]@[IN [%a]@]" (Print.expr ~debug:true ()) body; + let e, env = lazy_eval ctx env llevel body in + log "@]}"; + e, env | e, _ -> error e "Invalid apply on %a" Expr.format e) - | (EAbs _ | ELit _ | EOp _ | EEmptyError), _ -> e0, env (* these are values *) + | (EAbs _ | ELit _ | EEmptyError), _ -> e0, env (* these are values *) | (EStruct _ | ETuple _ | EInj _ | EArray _), _ -> if not llevel.eval_struct then e0, env else @@ -358,7 +333,13 @@ let rec lazy_eval : decl_ctx -> Env.t -> laziness_level -> expr -> expr * Env.t concise expression to express that *) let e1, env = lazy_eval ctx env llevel - (EApp { f = EnumConstructor.Map.find cons cases; args = [e1] }, m) + ( EApp + { + f = EnumConstructor.Map.find cons cases; + args = [e1]; + tys = []; + }, + m ) in add_condition ~condition e1, env | e, _ -> error e "Invalid match argument %a" Expr.format e) @@ -559,12 +540,7 @@ let to_graph ctx env expr = let rec aux env g e = (* lazy_eval ctx env (result_level base_vars) e *) match Expr.skip_wrappers e with - | ( EApp - { - f = EOp { op = ToRat_int | ToRat_mon | ToMoney_rat; _ }, _; - args = [arg]; - }, - _ ) -> + | EAppOp { op = ToRat_int | ToRat_mon | ToMoney_rat; args = [arg]; _ }, _ -> aux env g arg (* we skip conversions *) | ELit l, _ -> @@ -576,7 +552,7 @@ let to_graph ctx env expr = let child, env = (Env.find var env).base in let g, child_v = aux env g child in G.add_edge g v child_v, v - | EApp { f = EOp { op = _; _ }, _; args }, _ -> + | EAppOp { op = _; args; _ }, _ -> let v = G.V.create e in let g = G.add_vertex g v in let g, children = List.fold_left_map (aux env) g args in @@ -682,12 +658,8 @@ let program_to_graph in let e = Mark.set m (Expr.skip_wrappers e) in match e with - | ( EApp - { - f = EOp { op = ToRat_int | ToRat_mon | ToMoney_rat; _ }, _; - args = [arg]; - }, - _ ) -> + | EAppOp { op = ToRat_int | ToRat_mon | ToMoney_rat; args = [arg]; tys }, _ + -> aux parent (g, var_vertices, env0) (Mark.set m arg) (* we skip conversions *) | ELit l, _ -> @@ -725,12 +697,7 @@ let program_to_graph let v = G.V.create e in let g = G.add_vertex g v in (g, var_vertices, env), v)) - | ( EApp - { - f = EOp { op = Map | Filter | Reduce | Fold; _ }, _; - args = _ :: args; - }, - _ ) -> + | EAppOp { op = Map | Filter | Reduce | Fold; args = _ :: args; _ }, _ -> (* First argument (which is a function) is ignored *) let v = G.V.create e in let g = G.add_vertex g v in @@ -739,7 +706,7 @@ let program_to_graph in ( (List.fold_left (fun g -> G.add_edge g v) g children, var_vertices, env), v ) - | EApp { f = EOp { op; _ }, _; args = [lhs; rhs] }, _ -> + | EAppOp { op; args = [lhs; rhs]; _ }, _ -> let v = G.V.create e in let g = G.add_vertex g v in let (g, var_vertices, env), lhs = @@ -771,7 +738,7 @@ let program_to_graph (G.E.create v { side = rhs_label; condition = false } rhs) in (g, var_vertices, env), v - | EApp { f = EOp { op = _; _ }, _; args }, _ -> + | EAppOp { op = _; args; _ }, _ -> let v = G.V.create e in let g = G.add_vertex g v in let (g, var_vertices, env), children = @@ -907,8 +874,7 @@ let rec graph_cleanup options g base_vars = (fun v g -> let succ = G.succ g v in match G.V.label v, succ, List.map G.V.label succ with - | (EApp { f = EOp _, _; _ }, _), [v2], [(EApp { f = EOp _, _; _ }, _)] - -> + | (EAppOp _, _), [v2], [(EAppOp _, _)] -> let g = List.fold_left (fun g e -> @@ -965,8 +931,7 @@ let rec graph_cleanup options g base_vars = (fun v g -> let succ = G.succ g v in match G.V.label v, succ, List.map G.V.label succ with - | (EApp { f = EOp _, _; _ }, _), [v2], [(EApp { f = EOp _, _; _ }, _)] - -> + | (EAppOp _, _), [v2], [(EAppOp _, _)] -> let g = List.fold_left (fun g e -> @@ -1254,7 +1219,7 @@ let to_dot lang ppf ctx env base_vars g ~base_src_url = else (* Constants *) [`Style `Filled; `Fillcolor 0x77aaff; `Shape `Note] | EStruct _, _ | EArray _, _ -> [`Shape `Record] - | EApp { f = EOp { op; _ }, _; _ }, _ -> ( + | EAppOp { op; _ }, _ -> ( match op_kind op with | `Sum | `Product | _ -> [`Shape `Box] (* | _ -> [] *)) | _ -> []) diff --git a/compiler/plugins/lazy_interp.ml b/compiler/plugins/lazy_interp.ml index 4dad71f5..5a78dd0e 100644 --- a/compiler/plugins/lazy_interp.ml +++ b/compiler/plugins/lazy_interp.ml @@ -89,7 +89,35 @@ let rec lazy_eval : r; v_env := r, env1); r, Env.join env env1 - | EApp { f; args }, m -> ( + | EAppOp { op; args; tys }, m -> + if + (not llevel.eval_default) + && not (List.equal Expr.equal args [ELit LUnit, m]) + (* Applications to () encode thunked default terms *) + then e0, env + else + let env, args = + List.fold_left_map + (fun env e -> + let e, env = lazy_eval ctx env llevel e in + env, e) + env args + in + if not llevel.eval_op then (EAppOp { op; args; tys }, m), env + else + let renv = ref env in + (* Dirty workaround returning env from evaluate_operator *) + let eval e = + let e, env = lazy_eval ctx !renv llevel e in + renv := env; + e + in + ( Interpreter.evaluate_operator eval op m Cli.En + (* Default language to English but this should not raise any error + messages so we don't care. *) + args, + !renv ) (* fixme: this forwards eempty *) + | EApp { f; args; tys }, m -> ( if (not llevel.eval_default) && not (List.equal Expr.equal args [ELit LUnit, m]) @@ -113,31 +141,8 @@ let rec lazy_eval : let e, env = lazy_eval ctx env llevel body in log "@]}"; e, env - | ((EOp { op; _ }, m) as f), env -> - let env, args = - List.fold_left_map - (fun env e -> - let e, env = lazy_eval ctx env llevel e in - env, e) - env args - in - if not llevel.eval_op then (EApp { f; args }, m), env - else - let renv = ref env in - (* Dirty workaround returning env from evaluate_operator *) - let eval e = - let e, env = lazy_eval ctx !renv llevel e in - renv := env; - e - in - ( Interpreter.evaluate_operator eval op m Cli.En - (* Default language to English but this should not raise any error - messages so we don't care. *) - args, - !renv ) - (* fixme: this forwards eempty *) | e, _ -> error e "Invalid apply on %a" Expr.format e) - | (EAbs _ | ELit _ | EOp _ | EEmptyError), _ -> e0, env (* these are values *) + | (EAbs _ | ELit _ | EEmptyError), _ -> e0, env (* these are values *) | (EStruct _ | ETuple _ | EInj _ | EArray _), _ -> if not llevel.eval_struct then e0, env else @@ -169,7 +174,9 @@ let rec lazy_eval : match eval_to_value env e with | (EInj { name = n; cons; e }, m), env when EnumName.equal name n -> lazy_eval ctx env llevel - (EApp { f = EnumConstructor.Map.find cons cases; args = [e] }, m) + ( EApp + { f = EnumConstructor.Map.find cons cases; args = [e]; tys = [] }, + m ) | e, _ -> error e "Invalid match argument %a" Expr.format e) | EDefault { excepts; just; cons }, m -> ( let excs = @@ -251,7 +258,7 @@ let interpret_program (prg : ('dcalc, 'm) gexpr program) (scope : ScopeName.t) : (StructName.Map.find scope_arg_struct ctx.ctx_structs)) m in - let e_app = Expr.eapp (Expr.box e) [application_arg] m in + let e_app = Expr.eapp ~f:(Expr.box e) ~args:[application_arg] ~tys:[] m in lazy_eval ctx env { value_level with eval_struct = true; eval_op = false } (Expr.unbox e_app) diff --git a/compiler/scalc/ast.ml b/compiler/scalc/ast.ml index 783e80cf..cffce5b0 100644 --- a/compiler/scalc/ast.ml +++ b/compiler/scalc/ast.ml @@ -37,9 +37,7 @@ let dead_value = VarName.fresh ("dead_value", Pos.no_pos) let handle_default = FuncName.fresh ("handle_default", Pos.no_pos) let handle_default_opt = FuncName.fresh ("handle_default_opt", Pos.no_pos) -type operator = - < overloaded : no ; monomorphic : yes ; polymorphic : yes ; resolved : yes > - Shared_ast.operator +type operator = Shared_ast.lcalc Shared_ast.operator type expr = naked_expr Mark.pos @@ -63,7 +61,7 @@ and naked_expr = | EArray of expr list | ELit of lit | EApp of { f : expr; args : expr list } - | EOp of operator + | EAppOp of { op : operator; args : expr list } type stmt = | SInnerFuncDef of { name : VarName.t Mark.pos; func : func } diff --git a/compiler/scalc/from_lcalc.ml b/compiler/scalc/from_lcalc.ml index f59b57fb..907dc20f 100644 --- a/compiler/scalc/from_lcalc.ml +++ b/compiler/scalc/from_lcalc.ml @@ -113,15 +113,27 @@ let rec translate_expr (ctxt : 'm ctxt) (expr : 'm L.expr) : A.block * A.expr = | ETupleAccess { e = e1; index; _ } -> let e1_stmts, new_e1 = translate_expr ctxt e1 in e1_stmts, (A.ETupleAccess { e1 = new_e1; index }, Expr.pos expr) - | EApp + | EAppOp { - f = EOp { op = Op.HandleDefaultOpt; tys = _ }, _binder_mark; + op = Op.HandleDefaultOpt; args = [_exceptions; _just; _cons]; + tys = _; } when ctxt.config.keep_special_ops -> (* This should be translated as a statement *) raise (NotAnExpr { needs_a_local_decl = true }) - | EApp { f = EAbs { binder; tys }, binder_mark; args } -> + | EAppOp { op; args; tys = _ } -> + let args_stmts, new_args = + List.fold_left + (fun (args_stmts, new_args) arg -> + let arg_stmts, new_arg = translate_expr ctxt arg in + arg_stmts @ args_stmts, new_arg :: new_args) + ([], []) args + in + (* FIXME: what happens if [arg] is not a tuple but reduces to one ? *) + let new_args = List.rev new_args in + args_stmts, (A.EAppOp { op; args = new_args }, Expr.pos expr) + | EApp { f = EAbs { binder; tys }, binder_mark; args; tys = _ } -> (* This defines multiple local variables at the time *) let binder_pos = Expr.mark_pos binder_mark in let vars, body = Bindlib.unmbind binder in @@ -177,7 +189,7 @@ let rec translate_expr (ctxt : 'm ctxt) (expr : 'm L.expr) : A.block * A.expr = in let rest_of_expr_stmts, rest_of_expr = translate_expr ctxt body in local_decls @ List.flatten def_blocks @ rest_of_expr_stmts, rest_of_expr - | EApp { f; args } -> + | EApp { f; args; tys = _ } -> let f_stmts, new_f = translate_expr ctxt f in let args_stmts, new_args = List.fold_left @@ -186,6 +198,7 @@ let rec translate_expr (ctxt : 'm ctxt) (expr : 'm L.expr) : A.block * A.expr = arg_stmts @ args_stmts, new_arg :: new_args) ([], []) args in + (* FIXME: what happens if [arg] is not a tuple but reduces to one ? *) let new_args = List.rev new_args in ( f_stmts @ args_stmts, (A.EApp { f = new_f; args = new_args }, Expr.pos expr) ) @@ -199,7 +212,6 @@ let rec translate_expr (ctxt : 'm ctxt) (expr : 'm L.expr) : A.block * A.expr = in let new_args = List.rev new_args in args_stmts, (A.EArray new_args, Expr.pos expr) - | EOp { op; _ } -> [], (A.EOp (Operator.translate op), Expr.pos expr) | ELit l -> [], (A.ELit l, Expr.pos expr) | _ -> raise (NotAnExpr { needs_a_local_decl = true }) with NotAnExpr { needs_a_local_decl } -> @@ -243,11 +255,8 @@ and translate_statements (ctxt : 'm ctxt) (block_expr : 'm L.expr) : A.block = (* Assertions are always encapsulated in a unit-typed let binding *) let e_stmts, new_e = translate_expr ctxt e in e_stmts @ [A.SAssert (Mark.remove new_e), Expr.pos block_expr] - | EApp - { - f = EOp { op = Op.HandleDefaultOpt; tys = _ }, _binder_mark; - args = [exceptions; just; cons]; - } + | EAppOp + { op = Op.HandleDefaultOpt; tys = _; args = [exceptions; just; cons] } when ctxt.config.keep_special_ops -> let exceptions = match Mark.remove exceptions with @@ -291,7 +300,7 @@ and translate_statements (ctxt : 'm ctxt) (block_expr : 'm L.expr) : A.block = }), Expr.pos block_expr ); ] - | EApp { f = EAbs { binder; tys }, binder_mark; args } -> + | EApp { f = EAbs { binder; tys }, binder_mark; args; _ } -> (* This defines multiple local variables at the time *) let binder_pos = Expr.mark_pos binder_mark in let vars, body = Bindlib.unmbind binder in diff --git a/compiler/scalc/print.ml b/compiler/scalc/print.ml index ca3ede55..cdc4ba84 100644 --- a/compiler/scalc/print.ml +++ b/compiler/scalc/print.ml @@ -75,15 +75,15 @@ let rec format_expr Format.fprintf fmt "@[%a@ %a@]" EnumConstructor.format cons format_expr e | ELit l -> Print.lit fmt l - | EApp { f = EOp ((Map | Filter) as op), _; args = [arg1; arg2] } -> + | EAppOp { op = (Map | Filter) as op; args = [arg1; arg2] } -> Format.fprintf fmt "@[%a@ %a@ %a@]" (Print.operator ~debug) op format_with_parens arg1 format_with_parens arg2 - | EApp { f = EOp op, _; args = [arg1; arg2] } -> + | EAppOp { op; args = [arg1; arg2] } -> Format.fprintf fmt "@[%a@ %a@ %a@]" format_with_parens arg1 (Print.operator ~debug) op format_with_parens arg2 - | EApp { f = EOp (Log _), _; args = [arg1] } when not debug -> + | EAppOp { op = Log _; args = [arg1] } when not debug -> Format.fprintf fmt "%a" format_with_parens arg1 - | EApp { f = EOp op, _; args = [arg1] } -> + | EAppOp { op; args = [arg1] } -> Format.fprintf fmt "@[%a@ %a@]" (Print.operator ~debug) op format_with_parens arg1 | EApp { f; args = [] } -> @@ -94,7 +94,12 @@ let rec format_expr ~pp_sep:(fun fmt () -> Format.fprintf fmt "@ ") format_with_parens) args - | EOp op -> Print.operator ~debug fmt op + | EAppOp { op; args } -> + Format.fprintf fmt "@[%a@ %a@]" (Print.operator ~debug) op + (Format.pp_print_list + ~pp_sep:(fun fmt () -> Format.fprintf fmt "@ ") + format_with_parens) + args let rec format_statement (decl_ctx : decl_ctx) diff --git a/compiler/scalc/to_c.ml b/compiler/scalc/to_c.ml index 1d84a942..95a277fd 100644 --- a/compiler/scalc/to_c.ml +++ b/compiler/scalc/to_c.ml @@ -403,40 +403,27 @@ let rec format_expression (ctx : decl_ctx) (fmt : Format.formatter) (e : expr) : (fun fmt e -> Format.fprintf fmt "%a" (format_expression ctx) e)) es | ELit l -> Format.fprintf fmt "%a" format_lit (Mark.copy e l) - | EApp { f = EOp ((Map | Filter) as op), _; args = [arg1; arg2] } -> + | EAppOp { op = (Map | Filter) as op; args = [arg1; arg2] } -> Format.fprintf fmt "%a(%a,@ %a)" format_op (op, Pos.no_pos) (format_expression ctx) arg1 (format_expression ctx) arg2 - | EApp { f = EOp Shared_ast.Operator.HandleDefaultOpt, _; args = [_; _] } -> - Format.fprintf fmt "handle_default_opt ..." - | EApp { f = EOp op, _; args = [arg1; arg2] } -> + | EAppOp { op; args = [arg1; arg2] } -> Format.fprintf fmt "(%a %a@ %a)" (format_expression ctx) arg1 format_op (op, Pos.no_pos) (format_expression ctx) arg2 - | EApp { f = EOp Not, _; args = [arg1] } -> + | EAppOp { op = Not; args = [arg1] } -> Format.fprintf fmt "%a %a" format_op (Not, Pos.no_pos) (format_expression ctx) arg1 - | EApp + | EAppOp { - f = EOp ((Minus_int | Minus_rat | Minus_mon | Minus_dur) as op), _; + op = (Minus_int | Minus_rat | Minus_mon | Minus_dur) as op; args = [arg1]; } -> Format.fprintf fmt "%a %a" format_op (op, Pos.no_pos) (format_expression ctx) arg1 - | EApp { f = EOp op, _; args = [arg1] } -> + | EAppOp { op; args = [arg1] } -> Format.fprintf fmt "%a(%a)" format_op (op, Pos.no_pos) (format_expression ctx) arg1 - | EApp { f = EOp HandleDefaultOpt, _; args = _ } -> + | EAppOp { op = HandleDefaultOpt | HandleDefault; args = _ } -> failwith "should not happen because of keep_special_ops" - | EApp { f = EOp (HandleDefault as op), pos; args } -> - Format.fprintf fmt - "%a(@[catala_position(filename=\"%s\",@ start_line=%d,@ \ - start_column=%d,@ end_line=%d, end_column=%d,@ law_headings=%a), %a)@]" - format_op (op, pos) (Pos.get_file pos) (Pos.get_start_line pos) - (Pos.get_start_column pos) (Pos.get_end_line pos) (Pos.get_end_column pos) - format_string_list (Pos.get_law_info pos) - (Format.pp_print_list - ~pp_sep:(fun fmt () -> Format.fprintf fmt ",@ ") - (format_expression ctx)) - args | EApp { f = EFunc x, pos; args } when Ast.FuncName.compare x Ast.handle_default = 0 || Ast.FuncName.compare x Ast.handle_default_opt = 0 -> @@ -456,7 +443,12 @@ let rec format_expression (ctx : decl_ctx) (fmt : Format.formatter) (e : expr) : ~pp_sep:(fun fmt () -> Format.fprintf fmt ",@ ") (format_expression ctx)) args - | EOp op -> Format.fprintf fmt "%a" format_op (op, Pos.no_pos) + | EAppOp { op; args } -> + Format.fprintf fmt "%a(@[%a)@]" format_op (op, Pos.no_pos) + (Format.pp_print_list + ~pp_sep:(fun fmt () -> Format.fprintf fmt ",@ ") + (format_expression ctx)) + args | ETuple _ | ETupleAccess _ -> Message.raise_internal_error "Tuple compilation to R unimplemented!" diff --git a/compiler/scalc/to_python.ml b/compiler/scalc/to_python.ml index 62b2ebba..bb746a59 100644 --- a/compiler/scalc/to_python.ml +++ b/compiler/scalc/to_python.ml @@ -307,21 +307,18 @@ let rec format_expression (ctx : decl_ctx) (fmt : Format.formatter) (e : expr) : (fun fmt e -> Format.fprintf fmt "%a" (format_expression ctx) e)) es | ELit l -> Format.fprintf fmt "%a" format_lit (Mark.copy e l) - | EApp { f = EOp ((Map | Filter) as op), _; args = [arg1; arg2] } -> + | EAppOp { op = (Map | Filter) as op; args = [arg1; arg2] } -> Format.fprintf fmt "%a(%a,@ %a)" format_op (op, Pos.no_pos) (format_expression ctx) arg1 (format_expression ctx) arg2 - | EApp { f = EOp op, _; args = [arg1; arg2] } -> + | EAppOp { op; args = [arg1; arg2] } -> Format.fprintf fmt "(%a %a@ %a)" (format_expression ctx) arg1 format_op (op, Pos.no_pos) (format_expression ctx) arg2 | EApp - { - f = EApp { f = EOp (Log (BeginCall, info)), _; args = [f] }, _; - args = [arg]; - } + { f = EAppOp { op = Log (BeginCall, info); args = [f] }, _; args = [arg] } when Cli.globals.trace -> Format.fprintf fmt "log_begin_call(%a,@ %a,@ %a)" format_uid_list info (format_expression ctx) f (format_expression ctx) arg - | EApp { f = EOp (Log (VarDef var_def_info, info)), _; args = [arg1] } + | EAppOp { op = Log (VarDef var_def_info, info); args = [arg1] } when Cli.globals.trace -> Format.fprintf fmt "log_variable_definition(%a,@ LogIO(input_io=InputIO.%s,@ \ @@ -333,34 +330,35 @@ let rec format_expression (ctx : decl_ctx) (fmt : Format.formatter) (e : expr) : | Runtime.Reentrant -> "Reentrant") (if var_def_info.log_io_output then "True" else "False") (format_expression ctx) arg1 - | EApp { f = EOp (Log (PosRecordIfTrueBool, _)), pos; args = [arg1] } + | EAppOp { op = Log (PosRecordIfTrueBool, _); args = [arg1] } when Cli.globals.trace -> + let pos = Mark.get e in Format.fprintf fmt "log_decision_taken(SourcePosition(filename=\"%s\",@ start_line=%d,@ \ start_column=%d,@ end_line=%d, end_column=%d,@ law_headings=%a), %a)" (Pos.get_file pos) (Pos.get_start_line pos) (Pos.get_start_column pos) (Pos.get_end_line pos) (Pos.get_end_column pos) format_string_list (Pos.get_law_info pos) (format_expression ctx) arg1 - | EApp { f = EOp (Log (EndCall, info)), _; args = [arg1] } - when Cli.globals.trace -> + | EAppOp { op = Log (EndCall, info); args = [arg1] } when Cli.globals.trace -> Format.fprintf fmt "log_end_call(%a,@ %a)" format_uid_list info (format_expression ctx) arg1 - | EApp { f = EOp (Log _), _; args = [arg1] } -> + | EAppOp { op = Log _; args = [arg1] } -> Format.fprintf fmt "%a" (format_expression ctx) arg1 - | EApp { f = EOp Not, _; args = [arg1] } -> + | EAppOp { op = Not; args = [arg1] } -> Format.fprintf fmt "%a %a" format_op (Not, Pos.no_pos) (format_expression ctx) arg1 - | EApp + | EAppOp { - f = EOp ((Minus_int | Minus_rat | Minus_mon | Minus_dur) as op), _; + op = (Minus_int | Minus_rat | Minus_mon | Minus_dur) as op; args = [arg1]; } -> Format.fprintf fmt "%a %a" format_op (op, Pos.no_pos) (format_expression ctx) arg1 - | EApp { f = EOp op, _; args = [arg1] } -> + | EAppOp { op; args = [arg1] } -> Format.fprintf fmt "%a(%a)" format_op (op, Pos.no_pos) (format_expression ctx) arg1 - | EApp { f = EOp ((HandleDefault | HandleDefaultOpt) as op), pos; args } -> + | EAppOp { op = (HandleDefault | HandleDefaultOpt) as op; args } -> + let pos = Mark.get e in Format.fprintf fmt "%a(@[SourcePosition(filename=\"%s\",@ start_line=%d,@ \ start_column=%d,@ end_line=%d, end_column=%d,@ law_headings=%a), %a)@]" @@ -390,7 +388,12 @@ let rec format_expression (ctx : decl_ctx) (fmt : Format.formatter) (e : expr) : ~pp_sep:(fun fmt () -> Format.fprintf fmt ",@ ") (format_expression ctx)) args - | EOp op -> Format.fprintf fmt "%a" format_op (op, Pos.no_pos) + | EAppOp { op; args } -> + Format.fprintf fmt "%a(@[%a)@]" format_op (op, Pos.no_pos) + (Format.pp_print_list + ~pp_sep:(fun fmt () -> Format.fprintf fmt ",@ ") + (format_expression ctx)) + args | ETuple _ | ETupleAccess _ -> Message.raise_internal_error "Tuple compilation to R unimplemented!" diff --git a/compiler/scalc/to_r.ml b/compiler/scalc/to_r.ml index d67b37f2..90005965 100644 --- a/compiler/scalc/to_r.ml +++ b/compiler/scalc/to_r.ml @@ -312,29 +312,30 @@ let rec format_expression (ctx : decl_ctx) (fmt : Format.formatter) (e : expr) : (fun fmt e -> Format.fprintf fmt "%a" (format_expression ctx) e)) es | ELit l -> Format.fprintf fmt "%a" format_lit (Mark.copy e l) - | EApp { f = EOp ((Map | Filter) as op), _; args = [arg1; arg2] } -> + | EAppOp { op = (Map | Filter) as op; args = [arg1; arg2] } -> Format.fprintf fmt "%a(%a,@ %a)" format_op (op, Pos.no_pos) (format_expression ctx) arg1 (format_expression ctx) arg2 - | EApp { f = EOp op, _; args = [arg1; arg2] } -> + | EAppOp { op; args = [arg1; arg2] } -> Format.fprintf fmt "(%a %a@ %a)" (format_expression ctx) arg1 format_op (op, Pos.no_pos) (format_expression ctx) arg2 - | EApp { f = EOp Not, _; args = [arg1] } -> + | EAppOp { op = Not; args = [arg1] } -> Format.fprintf fmt "%a %a" format_op (Not, Pos.no_pos) (format_expression ctx) arg1 - | EApp + | EAppOp { - f = EOp ((Minus_int | Minus_rat | Minus_mon | Minus_dur) as op), _; + op = (Minus_int | Minus_rat | Minus_mon | Minus_dur) as op; args = [arg1]; } -> Format.fprintf fmt "%a %a" format_op (op, Pos.no_pos) (format_expression ctx) arg1 - | EApp { f = EOp op, _; args = [arg1] } -> + | EAppOp { op; args = [arg1] } -> Format.fprintf fmt "%a(%a)" format_op (op, Pos.no_pos) (format_expression ctx) arg1 - | EApp { f = EOp HandleDefaultOpt, _; _ } -> + | EAppOp { op = HandleDefaultOpt; _ } -> Message.raise_internal_error "R compilation does not currently support the avoiding of exceptions" - | EApp { f = EOp (HandleDefault as op), pos; args } -> + | EAppOp { op = HandleDefault as op; args; _ } -> + let pos = Mark.get e in Format.fprintf fmt "%a(@[catala_position(filename=\"%s\",@ start_line=%d,@ \ start_column=%d,@ end_line=%d, end_column=%d,@ law_headings=%a), %a)@]" @@ -364,7 +365,12 @@ let rec format_expression (ctx : decl_ctx) (fmt : Format.formatter) (e : expr) : ~pp_sep:(fun fmt () -> Format.fprintf fmt ",@ ") (format_expression ctx)) args - | EOp op -> Format.fprintf fmt "%a" format_op (op, Pos.no_pos) + | EAppOp { op; args } -> + Format.fprintf fmt "%a(@[%a)@]" format_op (op, Pos.no_pos) + (Format.pp_print_list + ~pp_sep:(fun fmt () -> Format.fprintf fmt ",@ ") + (format_expression ctx)) + args | ETuple _ | ETupleAccess _ -> Message.raise_internal_error "Tuple compilation to R unimplemented!" diff --git a/compiler/scopelang/from_desugared.ml b/compiler/scopelang/from_desugared.ml index 2350e5b9..d454a1e9 100644 --- a/compiler/scopelang/from_desugared.ml +++ b/compiler/scopelang/from_desugared.ml @@ -38,9 +38,10 @@ let tag_with_log_entry (l : log_entry) (markings : Uid.MarkedString.info list) : untyped Ast.expr boxed = if Cli.globals.trace then - Expr.eapp - (Expr.eop (Log (l, markings)) [TAny, Expr.pos e] (Mark.get e)) - [e] (Mark.get e) + Expr.eappop + ~op:(Log (l, markings)) + ~tys:[TAny, Expr.pos e] + ~args:[e] (Mark.get e) else e let rec translate_expr (ctx : ctx) (e : D.expr) : untyped Ast.expr boxed = @@ -120,7 +121,7 @@ let rec translate_expr (ctx : ctx) (e : D.expr) : untyped Ast.expr boxed = (Expr.edefault ~excepts:[] ~just:(Expr.elit (LBool true) m) ~cons: (Expr.epuredefault - (Expr.make_app e' [Expr.evar arg m] pos) + (Expr.make_app e' [Expr.evar arg m] targs pos) m) m) targs pos @@ -130,22 +131,50 @@ let rec translate_expr (ctx : ctx) (e : D.expr) : untyped Ast.expr boxed = ScopeVar.Map.add v' e' args') args ScopeVar.Map.empty) m - | EApp { f = EOp { op; tys }, m1; args } -> + | EApp { f; tys; args } -> ( + (* Detuplification of function arguments *) + let pos = Expr.pos f in + let f = translate_expr ctx f in + match args, tys with + | [arg], [_] -> Expr.eapp ~f ~tys m ~args:[translate_expr ctx arg] + | [(ETuple args, _)], _ -> + assert (List.length args = List.length tys); + Expr.eapp ~f ~tys m ~args:(List.map (translate_expr ctx) args) + | [((EVar _, _) as arg)], ts -> + let size = List.length ts in + let args = + let e = translate_expr ctx arg in + List.init size (fun index -> Expr.etupleaccess ~e ~size ~index m) + in + Expr.eapp ~f ~tys m ~args + | [arg], ts -> + let size = List.length ts in + let v = Var.make "args" in + let e = Expr.evar v (Mark.get arg) in + let args = + List.init size (fun index -> Expr.etupleaccess ~e ~size ~index m) + in + Expr.make_let_in v (TTuple ts, pos) (translate_expr ctx arg) + (Expr.eapp ~f ~tys m ~args) + pos + | args, tys -> + assert (List.length args = List.length tys); + Expr.eapp ~f ~tys m ~args:(List.map (translate_expr ctx) args)) + | EAppOp { op; tys; args } -> let args = List.map (translate_expr ctx) args in Operator.kind_dispatch op - ~monomorphic:(fun op -> Expr.eapp (Expr.eop op tys m1) args m) - ~polymorphic:(fun op -> Expr.eapp (Expr.eop op tys m1) args m) + ~monomorphic:(fun op -> Expr.eappop ~op ~tys ~args m) + ~polymorphic:(fun op -> Expr.eappop ~op ~tys ~args m) ~overloaded:(fun op -> match Operator.resolve_overload ctx.decl_ctx (Mark.add (Expr.pos e) op) tys with - | op, `Straight -> Expr.eapp (Expr.eop op tys m1) args m + | op, `Straight -> Expr.eappop ~op ~tys ~args m | op, `Reversed -> - Expr.eapp (Expr.eop op (List.rev tys) m1) (List.rev args) m) - | EOp _ -> assert false (* Only allowed within [EApp] *) + Expr.eappop ~op ~tys:(List.rev tys) ~args:(List.rev args) m) | ( EStruct _ | EStructAccess _ | ETuple _ | ETupleAccess _ | EInj _ - | EMatch _ | ELit _ | EApp _ | EDefault _ | EPureDefault _ | EIfThenElse _ - | EArray _ | EEmptyError | EErrorOnEmpty _ ) as e -> + | EMatch _ | ELit _ | EDefault _ | EPureDefault _ | EIfThenElse _ | EArray _ + | EEmptyError | EErrorOnEmpty _ ) as e -> Expr.map ~f:(translate_expr ctx) (e, m) (** {1 Rule tree construction} *) diff --git a/compiler/shared_ast/definitions.ml b/compiler/shared_ast/definitions.ml index f18fdffe..3d0903ea 100644 --- a/compiler/shared_ast/definitions.ml +++ b/compiler/shared_ast/definitions.ml @@ -478,10 +478,14 @@ and ('a, 'b, 'm) base_gexpr = | EApp : { f : ('a, 'm) gexpr; args : ('a, 'm) gexpr list; + (** length may be 1 even if arity > 1 in desugared. scopelang performs + detuplification, so length = arity afterwards *) + tys : typ list; (** Set to [[]] before disambiguation *) } -> ('a, < .. >, 'm) base_gexpr - | EOp : { + | EAppOp : { op : 'b operator; + args : ('a, 'm) gexpr list; tys : typ list; } -> ('a, (< .. > as 'b), 'm) base_gexpr @@ -559,6 +563,7 @@ and ('a, 'b, 'm) base_gexpr = | EPureDefault : ('a, 'm) gexpr -> ('a, < defaultTerms : yes ; .. >, 'm) base_gexpr + (** "return" of a pure term, so that it can be typed as [default] *) | EEmptyError : ('a, < defaultTerms : yes ; .. >, 'm) base_gexpr | EErrorOnEmpty : ('a, 'm) gexpr diff --git a/compiler/shared_ast/expr.ml b/compiler/shared_ast/expr.ml index 9817f473..f44f39bc 100644 --- a/compiler/shared_ast/expr.ml +++ b/compiler/shared_ast/expr.ml @@ -112,7 +112,7 @@ let evar v mark = Mark.add mark (Bindlib.box_var v) let eexternal ~name mark = Mark.add mark (Bindlib.box (EExternal { name })) let etuple args = Box.appn args @@ fun args -> ETuple args -let etupleaccess e index size = +let etupleaccess ~e ~index ~size = assert (index < size); Box.app1 e @@ fun e -> ETupleAccess { e; index; size } @@ -122,9 +122,11 @@ let elit l mark = Mark.add mark (Bindlib.box (ELit l)) let eabs binder tys mark = Bindlib.box_apply (fun binder -> EAbs { binder; tys }) binder, mark -let eapp f args = Box.app1n f args @@ fun f args -> EApp { f; args } +let eapp ~f ~args ~tys = Box.app1n f args @@ fun f args -> EApp { f; args; tys } let eassert e1 = Box.app1 e1 @@ fun e1 -> EAssert e1 -let eop op tys = Box.app0 @@ EOp { op; tys } + +let eappop ~op ~args ~tys = + Box.appn args @@ fun args -> EAppOp { op; args; tys } let edefault ~excepts ~just ~cons = Box.app2n just cons excepts @@ -260,8 +262,8 @@ let none_constr = EnumConstructor.fresh ("ENone", Pos.no_pos) let some_constr = EnumConstructor.fresh ("ESome", Pos.no_pos) let option_enum_config = - EnumConstructor.Map.singleton none_constr (TLit TUnit, Pos.no_pos) - |> EnumConstructor.Map.add some_constr (TAny, Pos.no_pos) + EnumConstructor.Map.of_list + [none_constr, (TLit TUnit, Pos.no_pos); some_constr, (TAny, Pos.no_pos)] (* - Traversal functions - *) @@ -273,8 +275,8 @@ let map let m = Mark.get e in match Mark.remove e with | ELit l -> elit l m - | EApp { f = e1; args } -> eapp (f e1) (List.map f args) m - | EOp { op; tys } -> eop op tys m + | EApp { f = e1; args; tys } -> eapp ~f:(f e1) ~args:(List.map f args) ~tys m + | EAppOp { op; tys; args } -> eappop ~op ~tys ~args:(List.map f args) m | EArray args -> earray (List.map f args) m | EVar v -> evar (Var.translate v) m | EExternal { name } -> eexternal ~name m @@ -286,7 +288,7 @@ let map | EIfThenElse { cond; etrue; efalse } -> eifthenelse (f cond) (f etrue) (f efalse) m | ETuple args -> etuple (List.map f args) m - | ETupleAccess { e; index; size } -> etupleaccess (f e) index size m + | ETupleAccess { e; index; size } -> etupleaccess ~e:(f e) ~index ~size m | EInj { name; cons; e } -> einj ~name ~cons ~e:(f e) m | EAssert e1 -> eassert (f e1) m | EDefault { excepts; just; cons } -> @@ -322,10 +324,9 @@ let shallow_fold (acc : 'acc) : 'acc = let lfold x acc = List.fold_left (fun acc x -> f x acc) acc x in match Mark.remove e with - | ELit _ | EOp _ | EVar _ | EExternal _ | ERaise _ | ELocation _ | EEmptyError - -> - acc - | EApp { f = e; args } -> acc |> f e |> lfold args + | ELit _ | EVar _ | EExternal _ | ERaise _ | ELocation _ | EEmptyError -> acc + | EApp { f = e; args; _ } -> acc |> f e |> lfold args + | EAppOp { args; _ } -> acc |> lfold args | EArray args -> acc |> lfold args | EAbs { binder; tys = _ } -> let _, body = Bindlib.unmbind binder in @@ -367,11 +368,13 @@ let map_gather in match Mark.remove e with | ELit l -> acc, elit l m - | EApp { f = e1; args } -> + | EApp { f = e1; args; tys } -> let acc1, f = f e1 in let acc2, args = lfoldmap args in - join acc1 acc2, eapp f args m - | EOp { op; tys } -> acc, eop op tys m + join acc1 acc2, eapp ~f ~args ~tys m + | EAppOp { op; args; tys } -> + let acc, args = lfoldmap args in + acc, eappop ~op ~args ~tys m | EArray args -> let acc, args = lfoldmap args in acc, earray args m @@ -392,7 +395,7 @@ let map_gather acc, etuple args m | ETupleAccess { e; index; size } -> let acc, e = f e in - acc, etupleaccess e index size m + acc, etupleaccess ~e ~index ~size m | EInj { name; cons; e } -> let acc, e = f e in acc, einj ~name ~cons ~e m @@ -473,7 +476,7 @@ let untype e = map_marks ~f:(fun m -> Untyped { pos = mark_pos m }) e let is_value (type a) (e : (a, _) gexpr) = match Mark.remove e with - | ELit _ | EAbs _ | EOp _ | ERaise _ -> true + | ELit _ | EAbs _ | ERaise _ | ECustom _ | EExternal _ -> true | _ -> false let equal_lit (l1 : lit) (l2 : lit) = @@ -596,11 +599,15 @@ and equal : type a. (a, 't) gexpr -> (a, 't) gexpr -> bool = | ELit l1, ELit l2 -> l1 = l2 | EAbs { binder = b1; tys = tys1 }, EAbs { binder = b2; tys = tys2 } -> Type.equal_list tys1 tys2 && Bindlib.eq_mbinder equal b1 b2 - | EApp { f = e1; args = args1 }, EApp { f = e2; args = args2 } -> - equal e1 e2 && equal_list args1 args2 + | ( EApp { f = e1; args = args1; tys = tys1 }, + EApp { f = e2; args = args2; tys = tys2 } ) -> + equal e1 e2 && equal_list args1 args2 && Type.equal_list tys1 tys2 + | ( EAppOp { op = op1; args = args1; tys = tys1 }, + EAppOp { op = op2; args = args2; tys = tys2 } ) -> + Operator.equal op1 op2 + && equal_list args1 args2 + && Type.equal_list tys1 tys2 | EAssert e1, EAssert e2 -> equal e1 e2 - | EOp { op = op1; tys = tys1 }, EOp { op = op2; tys = tys2 } -> - Operator.equal op1 op2 && Type.equal_list tys1 tys2 | ( EDefault { excepts = exc1; just = def1; cons = cons1 }, EDefault { excepts = exc2; just = def2; cons = cons2 } ) -> equal def1 def2 && equal cons1 cons2 && equal_list exc1 exc2 @@ -640,7 +647,7 @@ and equal : type a. (a, 't) gexpr -> (a, 't) gexpr -> bool = ECustom { obj = obj2; targs = targs2; tret = tret2 } ) -> Type.equal_list targs1 targs2 && Type.equal tret1 tret2 && obj1 == obj2 | ( ( EVar _ | EExternal _ | ETuple _ | ETupleAccess _ | EArray _ | ELit _ - | EAbs _ | EApp _ | EAssert _ | EOp _ | EDefault _ | EPureDefault _ + | EAbs _ | EApp _ | EAppOp _ | EAssert _ | EDefault _ | EPureDefault _ | EIfThenElse _ | EEmptyError | EErrorOnEmpty _ | ERaise _ | ECatch _ | ELocation _ | EStruct _ | EDStructAccess _ | EStructAccess _ | EInj _ | EMatch _ | EScopeCall _ | ECustom _ ), @@ -656,11 +663,13 @@ let rec compare : type a. (a, _) gexpr -> (a, _) gexpr -> int = match[@ocamlformat "disable"] Mark.remove e1, Mark.remove e2 with | ELit l1, ELit l2 -> compare_lit l1 l2 - | EApp {f=f1; args=args1}, EApp {f=f2; args=args2} -> + | EApp {f=f1; args=args1; tys=tys1}, EApp {f=f2; args=args2; tys=tys2} -> compare f1 f2 @@< fun () -> - List.compare compare args1 args2 - | EOp {op=op1; tys=tys1}, EOp {op=op2; tys=tys2} -> + List.compare compare args1 args2 @@< fun () -> + List.compare Type.compare tys1 tys2 + | EAppOp {op=op1; args=args1; tys=tys1}, EAppOp {op=op2; args=args2; tys=tys2} -> Operator.compare op1 op2 @@< fun () -> + List.compare compare args1 args2 @@< fun () -> List.compare Type.compare tys1 tys2 | EArray a1, EArray a2 -> List.compare compare a1 a2 @@ -739,7 +748,7 @@ let rec compare : type a. (a, _) gexpr -> (a, _) gexpr -> int = invalid_arg "Custom block comparison" | ELit _, _ -> -1 | _, ELit _ -> 1 | EApp _, _ -> -1 | _, EApp _ -> 1 - | EOp _, _ -> -1 | _, EOp _ -> 1 + | EAppOp _, _ -> -1 | _, EAppOp _ -> 1 | EArray _, _ -> -1 | _, EArray _ -> 1 | EVar _, _ -> -1 | _, EVar _ -> 1 | EExternal _, _ -> -1 | _, EExternal _ -> 1 @@ -769,24 +778,14 @@ let rec free_vars : ('a, 't) gexpr -> ('a, 't) gexpr Var.Set.t = function Array.fold_right Var.Set.remove vs (free_vars body) | e -> shallow_fold (fun e -> Var.Set.union (free_vars e)) e Var.Set.empty -let rec skip_wrappers : type a. (a, 'm) gexpr -> (a, 'm) gexpr = function - | EApp { f = EOp { op = Log _; _ }, _; args = [e] }, _ -> skip_wrappers e - | EApp { f = EApp { f = EOp { op = Log _; _ }, _; args = [f] }, _; args }, m - -> - skip_wrappers (EApp { f; args }, m) - | EErrorOnEmpty e, _ -> skip_wrappers e - | EDefault { excepts = []; just = ELit (LBool true), _; cons = e }, _ -> - skip_wrappers e - | EPureDefault e, _ -> skip_wrappers e - | e -> e +(* This function is first defined in [Print], only for dependency reasons *) +let skip_wrappers : type a. (a, 'm) gexpr -> (a, 'm) gexpr = Print.skip_wrappers let remove_logging_calls e = let rec f e = let e, m = map ~f e in ( Bindlib.box_apply - (function - | EApp { f = EOp { op = Log _; _ }, _; args = [(arg, _)] } -> arg - | e -> e) + (function EAppOp { op = Log _; args = [(arg, _)]; _ } -> arg | e -> e) e, m ) in @@ -876,7 +875,7 @@ let format ppf e = Print.expr ~debug:false () ppf e let rec size : type a. (a, 't) gexpr -> int = fun e -> match Mark.remove e with - | EVar _ | EExternal _ | ELit _ | EOp _ | EEmptyError | ECustom _ -> 1 + | EVar _ | EExternal _ | ELit _ | EEmptyError | ECustom _ -> 1 | ETuple args -> List.fold_left (fun acc arg -> acc + size arg) 1 args | EArray args -> List.fold_left (fun acc arg -> acc + size arg) 1 args | ETupleAccess { e; _ } -> size e + 1 @@ -884,8 +883,9 @@ let rec size : type a. (a, 't) gexpr -> int = | EAssert e -> size e + 1 | EErrorOnEmpty e -> size e + 1 | EPureDefault e -> size e + 1 - | EApp { f; args } -> + | EApp { f; args; _ } -> List.fold_left (fun acc arg -> acc + size arg) (1 + size f) args + | EAppOp { args; _ } -> List.fold_left (fun acc arg -> acc + size arg) 2 args | EAbs { binder; _ } -> let _, body = Bindlib.unmbind binder in 1 + size body @@ -921,7 +921,19 @@ let make_abs xs e taus pos = in eabs (bind xs e) taus mark -let make_app e args pos = +let make_tuple el m0 = + match el with + | [] -> etuple [] (with_ty m0 (TTuple [], mark_pos m0)) + | el -> + let m = + fold_marks + (fun posl -> List.hd posl) + (fun ml -> TTuple (List.map (fun t -> t.ty) ml), (List.hd ml).pos) + (List.map (fun e -> Mark.get e) el) + in + etuple el m + +let make_app f args tys pos = let mark = fold_marks (fun _ -> pos) @@ -937,9 +949,9 @@ let make_app e args pos = Message.raise_internal_error "wrong type: found %a while expecting either an Arrow or Any" Print.typ_debug fty.ty)) - (List.map Mark.get (e :: args)) + (List.map Mark.get (f :: args)) in - eapp e args mark + eapp ~f ~args ~tys mark let make_erroronempty e = let mark = @@ -964,28 +976,22 @@ let thunk_term term mark = let empty_thunked_term mark = thunk_term (Bindlib.box EEmptyError, mark) mark let unthunk_term_nobox term mark = - Mark.add mark (EApp { f = term; args = [ELit LUnit, mark] }) + Mark.add mark + (EApp + { + f = term; + args = [ELit LUnit, mark]; + tys = [TLit TUnit, mark_pos mark]; + }) let make_let_in x tau e1 e2 mpos = - make_app (make_abs [| x |] e2 [tau] mpos) [e1] (pos e2) + make_app (make_abs [| x |] e2 [tau] mpos) [e1] [tau] (pos e2) let make_multiple_let_in xs taus e1s e2 mpos = - make_app (make_abs xs e2 taus mpos) e1s (pos e2) + make_app (make_abs xs e2 taus mpos) e1s taus (pos e2) let make_puredefault e = let mark = map_mark (fun pos -> pos) (fun ty -> TDefault ty, Mark.get ty) (Mark.get e) in epuredefault e mark - -let make_tuple el m0 = - match el with - | [] -> etuple [] (with_ty m0 (TTuple [], mark_pos m0)) - | el -> - let m = - fold_marks - (fun posl -> List.hd posl) - (fun ml -> TTuple (List.map (fun t -> t.ty) ml), (List.hd ml).pos) - (List.map (fun e -> Mark.get e) el) - in - etuple el m diff --git a/compiler/shared_ast/expr.mli b/compiler/shared_ast/expr.mli index 0fd5654e..9cc7e0d7 100644 --- a/compiler/shared_ast/expr.mli +++ b/compiler/shared_ast/expr.mli @@ -55,7 +55,11 @@ val subst : val etuple : ('a, 'm) boxed_gexpr list -> 'm mark -> ('a any, 'm) boxed_gexpr val etupleaccess : - ('a, 'm) boxed_gexpr -> int -> int -> 'm mark -> ('a any, 'm) boxed_gexpr + e:('a, 'm) boxed_gexpr -> + index:int -> + size:int -> + 'm mark -> + ('a any, 'm) boxed_gexpr val earray : ('a, 'm) boxed_gexpr list -> 'm mark -> ('a any, 'm) boxed_gexpr val elit : lit -> 'm mark -> ('a any, 'm) boxed_gexpr @@ -67,8 +71,9 @@ val eabs : ('a any, 'm) boxed_gexpr val eapp : - ('a, 'm) boxed_gexpr -> - ('a, 'm) boxed_gexpr list -> + f:('a, 'm) boxed_gexpr -> + args:('a, 'm) boxed_gexpr list -> + tys:typ list -> 'm mark -> ('a any, 'm) boxed_gexpr @@ -77,7 +82,12 @@ val eassert : 'm mark -> ((< assertions : yes ; .. > as 'a), 'm) boxed_gexpr -val eop : 'a operator -> typ list -> 'm mark -> ('a any, 'm) boxed_gexpr +val eappop : + op:'a operator -> + args:('a, 'm) boxed_gexpr list -> + tys:typ list -> + 'm mark -> + ('a any, 'm) boxed_gexpr val edefault : excepts:('a, 'm) boxed_gexpr list -> @@ -319,6 +329,7 @@ val make_abs : val make_app : ('a any, 'm) boxed_gexpr -> ('a, 'm) boxed_gexpr list -> + typ list -> Pos.t -> ('a any, 'm) boxed_gexpr diff --git a/compiler/shared_ast/interpreter.ml b/compiler/shared_ast/interpreter.ml index 810b6b29..72099fe6 100644 --- a/compiler/shared_ast/interpreter.ml +++ b/compiler/shared_ast/interpreter.ml @@ -169,7 +169,7 @@ let rec evaluate_operator (should not happen if the term was well-typed)%a" (Print.operator ~debug:true) op Expr.format - (EApp { f = EOp { op; tys = [] }, m; args }, m) + (EAppOp { op; tys = []; args }, m) in propagate_empty_error_list args @@ fun args -> @@ -193,21 +193,38 @@ let rec evaluate_operator | Map, [f; (EArray es, _)] -> EArray (List.map - (fun e' -> evaluate_expr (Mark.copy e' (EApp { f; args = [e'] }))) + (fun e' -> + evaluate_expr + (Mark.copy e' + (EApp { f; args = [e']; tys = [Expr.maybe_ty (Mark.get e')] }))) es) | Reduce, [_; default; (EArray [], _)] -> Mark.remove default | Reduce, [f; _; (EArray (x0 :: xn), _)] -> Mark.remove (List.fold_left (fun acc x -> - evaluate_expr (Mark.copy f (EApp { f; args = [acc; x] }))) + evaluate_expr + (Mark.copy f + (EApp + { + f; + args = [acc; x]; + tys = + [ + Expr.maybe_ty (Mark.get acc); Expr.maybe_ty (Mark.get x); + ]; + }))) x0 xn) | Concat, [(EArray es1, _); (EArray es2, _)] -> EArray (es1 @ es2) | Filter, [f; (EArray es, _)] -> EArray (List.filter (fun e' -> - match evaluate_expr (Mark.copy e' (EApp { f; args = [e'] })) with + match + evaluate_expr + (Mark.copy e' + (EApp { f; args = [e']; tys = [Expr.maybe_ty (Mark.get e')] })) + with | ELit (LBool b), _ -> b | _ -> Message.raise_spanned_error @@ -219,7 +236,18 @@ let rec evaluate_operator Mark.remove (List.fold_left (fun acc e' -> - evaluate_expr (Mark.copy e' (EApp { f; args = [acc; e'] }))) + evaluate_expr + (Mark.copy e' + (EApp + { + f; + args = [acc; e']; + tys = + [ + Expr.maybe_ty (Mark.get acc); + Expr.maybe_ty (Mark.get e'); + ]; + }))) init es) | (Length | Log _ | Eq | Map | Concat | Filter | Fold | Reduce), _ -> err () | Not, [(ELit (LBool b), _)] -> ELit (LBool (o_not b)) @@ -536,8 +564,9 @@ and val_to_runtime : let rec curry acc = function | [] -> let args = List.rev acc in + let tys = List.map (fun a -> Expr.maybe_ty (Mark.get a)) args in val_to_runtime eval_expr ctx tret - (try eval_expr ctx (EApp { f = v; args }, m) + (try eval_expr ctx (EApp { f = v; args; tys }, m) with CatalaException EmptyError -> raise Runtime.EmptyError) | targ :: targs -> Obj.repr (fun x -> @@ -594,7 +623,7 @@ let rec evaluate_expr : in let o = Runtime.lookup_value runtime_path in runtime_to_val (fun ctx -> evaluate_expr ctx lang) ctx m ty o - | EApp { f = e1; args } -> ( + | EApp { f = e1; args; _ } -> ( let e1 = evaluate_expr ctx lang e1 in let args = List.map (evaluate_expr ctx lang) args in propagate_empty_error e1 @@ -609,7 +638,6 @@ let rec evaluate_expr : "wrong function call, expected %d arguments, got %d" (Bindlib.mbinder_arity binder) (List.length args) - | EOp { op; _ } -> evaluate_operator (evaluate_expr ctx lang) op m lang args | ECustom { obj; targs; tret } -> (* Applies the arguments one by one to the curried form *) List.fold_left2 @@ -624,9 +652,11 @@ let rec evaluate_expr : Message.raise_spanned_error pos "function has not been reduced to a lambda at evaluation (should not \ happen if the term was well-typed") + | EAppOp { op; args; _ } -> + let args = List.map (evaluate_expr ctx lang) args in + evaluate_operator (evaluate_expr ctx lang) op m lang args | EAbs { binder; tys } -> Expr.unbox (Expr.eabs (Bindlib.box binder) tys m) | ELit _ as e -> Mark.add m e - | EOp { op; tys } -> Expr.unbox (Expr.eop (Operator.translate op) tys m) (* | EAbs _ as e -> Marked.mark m e (* these are values *) *) | EStruct { fields = es; name } -> let fields, es = List.split (StructField.Map.bindings es) in @@ -695,7 +725,10 @@ let rec evaluate_expr : "sum type index error (should not happen if the term was \ well-typed)" in - let new_e = Mark.add m (EApp { f = es_n; args = [e1] }) in + let ty = + EnumConstructor.Map.find cons (EnumName.Map.find name ctx.ctx_enums) + in + let new_e = Mark.add m (EApp { f = es_n; args = [e1]; tys = [ty] }) in evaluate_expr ctx lang new_e | _ -> Message.raise_spanned_error (Expr.pos e) @@ -780,19 +813,22 @@ and partially_evaluate_expr_for_assertion_failure_message : the AST while evaluating everything below. This makes for a good error message. *) match Mark.remove e with - | EApp { f = EOp ({ op = op_kind; _ } as op), m; args = [e1; e2] } - when match op_kind with - | And | Or | Xor | Eq | Lt_int_int | Lt_rat_rat | Lt_mon_mon - | Lt_dat_dat | Lt_dur_dur | Lte_int_int | Lte_rat_rat | Lte_mon_mon - | Lte_dat_dat | Lte_dur_dur | Gt_int_int | Gt_rat_rat | Gt_mon_mon - | Gt_dat_dat | Gt_dur_dur | Gte_int_int | Gte_rat_rat | Gte_mon_mon - | Gte_dat_dat | Gte_dur_dur | Eq_int_int | Eq_rat_rat | Eq_mon_mon - | Eq_dur_dur | Eq_dat_dat -> - true - | _ -> false -> - ( EApp + | EAppOp + { + args = [e1; e2]; + tys; + op = + ( And | Or | Xor | Eq | Lt_int_int | Lt_rat_rat | Lt_mon_mon + | Lt_dat_dat | Lt_dur_dur | Lte_int_int | Lte_rat_rat | Lte_mon_mon + | Lte_dat_dat | Lte_dur_dur | Gt_int_int | Gt_rat_rat | Gt_mon_mon + | Gt_dat_dat | Gt_dur_dur | Gte_int_int | Gte_rat_rat | Gte_mon_mon + | Gte_dat_dat | Gte_dur_dur | Eq_int_int | Eq_rat_rat | Eq_mon_mon + | Eq_dur_dur | Eq_dat_dat ) as op; + } -> + ( EAppOp { - f = EOp op, m; + op; + tys; args = [ partially_evaluate_expr_for_assertion_failure_message ctx lang e1; @@ -809,7 +845,8 @@ let addcustom e = ((d, e, c) interpr_kind, 't) gexpr -> ((d, e, yes) interpr_kind, 't) gexpr boxed = function | (ECustom _, _) as e -> Expr.map ~f e - | EOp { op; tys }, m -> Expr.eop (Operator.translate op) tys m + | EAppOp { op; tys; args }, m -> + Expr.eappop ~tys ~args:(List.map f args) ~op:(Operator.translate op) m | (EDefault _, _) as e -> Expr.map ~f e | (EPureDefault _, _) as e -> Expr.map ~f e | (EEmptyError, _) as e -> Expr.map ~f e @@ -840,7 +877,8 @@ let delcustom e = ((d, e, c) interpr_kind, 't) gexpr -> ((d, e, no) interpr_kind, 't) gexpr boxed = function | ECustom _, _ -> invalid_arg "Custom term remaining in evaluated term" - | EOp { op; tys }, m -> Expr.eop (Operator.translate op) tys m + | EAppOp { op; args; tys }, m -> + Expr.eappop ~tys ~args:(List.map f args) ~op:(Operator.translate op) m | (EDefault _, _) as e -> Expr.map ~f e | (EPureDefault _, _) as e -> Expr.map ~f e | (EEmptyError, _) as e -> Expr.map ~f e @@ -899,9 +937,9 @@ let interpret_program_lcalc p s : (Uid.MarkedString.info * ('a, 'm) gexpr) list (Expr.einj ~e:(Expr.elit LUnit mark_e) ~cons:Expr.none_constr ~name:Expr.option_enum mark_e) ty_in (Expr.mark_pos mark_e); - Expr.eapp - (Expr.eop Operator.ToClosureEnv [TClosureEnv, pos] mark_e) - [Expr.etuple [] mark_e] + Expr.eappop ~op:Operator.ToClosureEnv + ~args:[Expr.etuple [] mark_e] + ~tys:[TClosureEnv, pos] mark_e; ] mark_e @@ -918,6 +956,7 @@ let interpret_program_lcalc p s : (Uid.MarkedString.info * ('a, 'm) gexpr) list let to_interpret = Expr.make_app (Expr.box e) [Expr.estruct ~name:s_in ~fields:application_term mark_e] + [TStruct s_in, Expr.pos e] (Expr.pos e) in match Mark.remove (evaluate_expr ctx p.lang (Expr.unbox to_interpret)) with @@ -969,6 +1008,7 @@ let interpret_program_dcalc p s : (Uid.MarkedString.info * ('a, 'm) gexpr) list let to_interpret = Expr.make_app (Expr.box e) [Expr.estruct ~name:s_in ~fields:application_term mark_e] + [TStruct s_in, Expr.pos e] (Expr.pos e) in match Mark.remove (evaluate_expr ctx p.lang (Expr.unbox to_interpret)) with diff --git a/compiler/shared_ast/optimizations.ml b/compiler/shared_ast/optimizations.ml index 0d643f68..779717bd 100644 --- a/compiler/shared_ast/optimizations.ml +++ b/compiler/shared_ast/optimizations.ml @@ -100,61 +100,17 @@ let rec optimize_expr : the matches and the log calls are not preserved, which would be a good property *) match Mark.remove e with - | EApp - { - f = - ( EOp { op = Not; _ }, _ - | ( EApp - { - f = EOp { op = Log _; _ }, _; - args = [(EOp { op = Not; _ }, _)]; - }, - _ ) ) as op; - args = [e1]; - } -> ( + | EAppOp { op = Not; args = [(ELit (LBool b), _)]; _ } -> (* reduction of logical not *) - match e1 with - | ELit (LBool false), _ -> ELit (LBool true) - | ELit (LBool true), _ -> ELit (LBool false) - | e1 -> EApp { f = op; args = [e1] }) - | EApp - { - f = - ( EOp { op = Or; _ }, _ - | ( EApp - { - f = EOp { op = Log _; _ }, _; - args = [(EOp { op = Or; _ }, _)]; - }, - _ ) ) as op; - args = [e1; e2]; - } -> ( + ELit (LBool (not b)) + | EAppOp { op = Or; args = [(ELit (LBool b), _); (e, _)]; _ } + | EAppOp { op = Or; args = [(e, _); (ELit (LBool b), _)]; _ } -> (* reduction of logical or *) - match e1, e2 with - | (ELit (LBool false), _), new_e | new_e, (ELit (LBool false), _) -> - Mark.remove new_e - | (ELit (LBool true), _), _ | _, (ELit (LBool true), _) -> - ELit (LBool true) - | _ -> EApp { f = op; args = [e1; e2] }) - | EApp - { - f = - ( EOp { op = And; _ }, _ - | ( EApp - { - f = EOp { op = Log _; _ }, _; - args = [(EOp { op = And; _ }, _)]; - }, - _ ) ) as op; - args = [e1; e2]; - } -> ( + if b then ELit (LBool true) else e + | EAppOp { op = And; args = [(ELit (LBool b), _); (e, _)]; _ } + | EAppOp { op = And; args = [(e, _); (ELit (LBool b), _)]; _ } -> (* reduction of logical and *) - match e1, e2 with - | (ELit (LBool true), _), new_e | new_e, (ELit (LBool true), _) -> - Mark.remove new_e - | (ELit (LBool false), _), _ | _, (ELit (LBool false), _) -> - ELit (LBool false) - | _ -> EApp { f = op; args = [e1; e2] }) + if b then e else ELit (LBool false) | EMatch { e = EInj { e = e'; cons; name = n' }, _; cases; name = n } (* iota-reduction *) when EnumName.equal n n' -> ( @@ -206,7 +162,7 @@ let rec optimize_expr : cases1 cases2 in EMatch { e = arg; cases; name = n1 } - | EApp { f = EAbs { binder; _ }, _; args } + | EApp { f = EAbs { binder; _ }, _; args; _ } when binder_vars_used_at_most_once binder || List.for_all (function (EVar _ | ELit _), _ -> true | _ -> false) @@ -248,21 +204,13 @@ let rec optimize_expr : Mark.remove cons | ( [], ( ( ELit (LBool false) - | EApp - { - f = EOp { op = Log _; _ }, _; - args = [(ELit (LBool false), _)]; - } ), + | EAppOp { op = Log _; args = [(ELit (LBool false), _)]; _ } ), _ ) ) -> (* No exceptions and condition false *) EEmptyError | ( [except], ( ( ELit (LBool false) - | EApp - { - f = EOp { op = Log _; _ }, _; - args = [(ELit (LBool false), _)]; - } ), + | EAppOp { op = Log _; args = [(ELit (LBool false), _)]; _ } ), _ ) ) -> (* Single exception and condition false *) Mark.remove except @@ -271,12 +219,7 @@ let rec optimize_expr : { cond = ( ELit (LBool true), _ - | ( EApp - { - f = EOp { op = Log _; _ }, _; - args = [(ELit (LBool true), _)]; - }, - _ ) ); + | EAppOp { op = Log _; args = [(ELit (LBool true), _)]; _ }, _ ); etrue; _; } -> @@ -285,11 +228,7 @@ let rec optimize_expr : { cond = ( ( ELit (LBool false) - | EApp - { - f = EOp { op = Log _; _ }, _; - args = [(ELit (LBool false), _)]; - } ), + | EAppOp { op = Log _; args = [(ELit (LBool false), _)]; _ } ), _ ); efalse; _; @@ -300,40 +239,31 @@ let rec optimize_expr : cond; etrue = ( ( ELit (LBool btrue) - | EApp - { - f = EOp { op = Log _; _ }, _; - args = [(ELit (LBool btrue), _)]; - } ), + | EAppOp { op = Log _; args = [(ELit (LBool btrue), _)]; _ } ), _ ); efalse = ( ( ELit (LBool bfalse) - | EApp - { - f = EOp { op = Log _; _ }, _; - args = [(ELit (LBool bfalse), _)]; - } ), + | EAppOp { op = Log _; args = [(ELit (LBool bfalse), _)]; _ } ), _ ); } -> if btrue && not bfalse then Mark.remove cond else if (not btrue) && bfalse then - EApp - { - f = EOp { op = Not; tys = [TLit TBool, Expr.mark_pos mark] }, mark; - args = [cond]; - } + EAppOp + { op = Not; tys = [TLit TBool, Expr.mark_pos mark]; args = [cond] } (* note: this last call eliminates the condition & might skip log calls as well *) else (* btrue = bfalse *) ELit (LBool btrue) - | EApp { f = EOp { op = Op.Fold; _ }, _; args = [_f; init; (EArray [], _)] } - -> + | EAppOp { op = Op.Fold; args = [_f; init; (EArray [], _)]; _ } -> (*reduces a fold with an empty list *) Mark.remove init - | EApp - { f = EOp { op = Op.Fold; _ }, _; args = [f; init; (EArray [e'], _)] } - -> + | EAppOp + { + op = Op.Fold; + args = [f; init; (EArray [e'], _)]; + tys = [_; tinit; (TArray tx, _)]; + } -> (* reduces a fold with one element *) - EApp { f; args = [init; e'] } + EApp { f; args = [init; e']; tys = [tinit; tx] } | ECatch { body; exn; handler } -> ( (* peephole exception catching reductions *) match Mark.remove body, Mark.remove handler with diff --git a/compiler/shared_ast/print.ml b/compiler/shared_ast/print.ml index 782a436c..047ef7f1 100644 --- a/compiler/shared_ast/print.ml +++ b/compiler/shared_ast/print.ml @@ -374,7 +374,7 @@ module Precedence = struct fun e -> match Mark.remove e with | ELit _ -> Contained (* Todo: unop if < 0 *) - | EApp { f = EOp { op; _ }, _; _ } -> ( + | EAppOp { op; _ } -> ( match op with | Not | GetDay | GetMonth | GetYear | FirstDayOfMonth | LastDayOfMonth | Length | Log _ | Minus | Minus_int | Minus_rat | Minus_mon | Minus_dur @@ -411,7 +411,6 @@ module Precedence = struct | ToClosureEnv | FromClosureEnv -> App) | EApp _ -> App - | EOp _ -> Contained | EArray _ -> Contained | EVar _ -> Contained | EExternal _ -> Contained @@ -527,7 +526,7 @@ module ExprGen (C : EXPR_PARAM) = struct | ELit l -> C.lit fmt l | EApp { f = EAbs _, _; _ } -> let rec pr bnd_ctx colors fmt = function - | EApp { f = EAbs { binder; tys }, _; args }, _ -> + | EApp { f = EAbs { binder; tys }, _; args; _ }, _ -> let xs, body, bnd_ctx = Bindlib.unmbind_in bnd_ctx binder in let xs_tau = List.mapi (fun i tau -> xs.(i), tau) tys in let xs_tau_arg = @@ -563,19 +562,16 @@ module ExprGen (C : EXPR_PARAM) = struct Format.pp_close_box fmt (); punctuation fmt ")")) xs_tau punctuation "→" (rhs expr) body - | EApp - { f = EOp { op = (Map | Filter) as op; _ }, _; args = [arg1; arg2] } - -> + | EAppOp { op = (Map | Filter) as op; args = [arg1; arg2]; _ } -> Format.fprintf fmt "@[%a %a@ %a@]" operator op (lhs exprc) arg1 (rhs exprc) arg2 - | EApp { f = EOp { op = Log _ as op; _ }, _; args = [arg1] } -> + | EAppOp { op = Log _ as op; args = [arg1]; _ } -> Format.fprintf fmt "@[%a@ %a@]" operator op (rhs exprc) arg1 - | EApp { f = EOp { op = op0; _ }, _; args = [_; _] } -> + | EAppOp { op = op0; args = [_; _]; _ } -> let prec = Precedence.expr e in let rec pr colors fmt = function (* Flatten sequences of the same associative op *) - | EApp { f = EOp { op; _ }, _; args = [arg1; arg2] }, _ when op = op0 - -> ( + | EAppOp { op; args = [arg1; arg2]; _ }, _ when op = op0 -> ( (match prec with | Op (And | Or | Mul | Add | Div | Sub) -> lhs pr fmt arg1 | _ -> lhs exprc fmt arg1); @@ -590,9 +586,15 @@ module ExprGen (C : EXPR_PARAM) = struct Format.pp_open_hvbox fmt 0; pr colors fmt e; Format.pp_close_box fmt () - | EApp { f = EOp { op; _ }, _; args = [arg1] } -> + | EAppOp { op; args = [arg1]; _ } -> Format.fprintf fmt "@[%a@ %a@]" operator op (rhs exprc) arg1 - | EApp { f; args } -> + | EAppOp { op; args; _ } -> + Format.fprintf fmt "@[%a@ %a@]" operator op + (Format.pp_print_list + ~pp_sep:(fun fmt () -> Format.fprintf fmt "@ ") + (rhs exprc)) + args + | EApp { f; args; _ } -> Format.fprintf fmt "@[%a@ %a@]" (lhs exprc) f (Format.pp_print_list ~pp_sep:(fun fmt () -> Format.fprintf fmt "@ ") @@ -611,7 +613,6 @@ module ExprGen (C : EXPR_PARAM) = struct Format.pp_open_hvbox fmt 0; pr false fmt e; Format.pp_close_box fmt () - | EOp { op; _ } -> operator fmt op | EDefault { excepts; just; cons } -> if List.length excepts = 0 then Format.fprintf fmt "@[%a%a@ %a %a%a@]" @@ -734,7 +735,7 @@ module ExprConciseParam = struct let lit = lit let rec pre_map : type a. (a, 't) gexpr -> (a, 't) gexpr = function - | EApp { f = EOp { op = Log _; _ }, _; args = [e] }, _ -> pre_map e + | EAppOp { op = Log _; args = [e]; _ }, _ -> pre_map e | e -> e end @@ -929,6 +930,18 @@ let program ?(debug = false) fmt p = (* - User-facing value printer - *) +(* This function is re-exported from module [Expr], but defined here where it's + first needed *) +let rec skip_wrappers : type a. (a, 'm) gexpr -> (a, 'm) gexpr = function + | EAppOp { op = Log _; args = [e]; tys = _ }, _ -> skip_wrappers e + | EApp { f = EAppOp { op = Log _; args = [f]; _ }, _; args; tys }, m -> + skip_wrappers (EApp { f; args; tys }, m) + | EErrorOnEmpty e, _ -> skip_wrappers e + | EDefault { excepts = []; just = ELit (LBool true), _; cons = e }, _ -> + skip_wrappers e + | EPureDefault e, _ -> skip_wrappers e + | e -> e + module UserFacing = struct (* Refs: https://en.wikipedia.org/wiki/Wikipedia:Manual_of_Style/Dates_and_numbers#Grouping_of_digits @@ -1092,24 +1105,12 @@ module UserFacing = struct | EEmptyError -> Format.pp_print_string ppf "ø" | EAbs _ -> Format.pp_print_string ppf "" | EExternal _ -> Format.pp_print_string ppf "" - | EApp _ | EOp _ | EVar _ | EIfThenElse _ | EMatch _ | ETupleAccess _ + | EApp _ | EAppOp _ | EVar _ | EIfThenElse _ | EMatch _ | ETupleAccess _ | EStructAccess _ | EAssert _ | EDefault _ | EPureDefault _ | EErrorOnEmpty _ | ERaise _ | ECatch _ | ELocation _ | EScopeCall _ | EDStructAccess _ | ECustom _ -> fallback ppf e - (* This function is already in module [Expr], but [Expr] depends on this - module *) - let rec skip_wrappers : type a. (a, 'm) gexpr -> (a, 'm) gexpr = function - | EApp { f = EOp { op = Log _; _ }, _; args = [e] }, _ -> skip_wrappers e - | EApp { f = EApp { f = EOp { op = Log _; _ }, _; args = [f] }, _; args }, m - -> - skip_wrappers (EApp { f; args }, m) - | EErrorOnEmpty e, _ -> skip_wrappers e - | EDefault { excepts = []; just = ELit (LBool true), _; cons = e }, _ -> - skip_wrappers e - | e -> e - let expr : type a. Cli.backend_lang -> Format.formatter -> (a, 't) gexpr -> unit = fun lang -> diff --git a/compiler/shared_ast/print.mli b/compiler/shared_ast/print.mli index 3fd201e6..efdbe53d 100644 --- a/compiler/shared_ast/print.mli +++ b/compiler/shared_ast/print.mli @@ -125,3 +125,8 @@ module UserFacing : sig (** This combines the user-facing value printer and the generic expression printer to handle all AST nodes *) end + +(**/*) + +val skip_wrappers : ('a, 'm) gexpr -> ('a, 'm) gexpr +(** This is exported from [Expr], but first defined here for dependency reasons *) diff --git a/compiler/shared_ast/typing.ml b/compiler/shared_ast/typing.ml index d67f0344..02911eaf 100644 --- a/compiler/shared_ast/typing.ml +++ b/compiler/shared_ast/typing.ml @@ -327,7 +327,6 @@ let resolve_overload_ret_type Operator.overload_type ctx (Mark.add (Expr.pos e) op) (List.map (typ_to_ast ~leave_unresolved) tys) - (* We use [unsafe] because the error is caught below *) in ast_to_typ (Type.arrow_return op_ty) @@ -747,7 +746,7 @@ and typecheck_expr_top_down : (unionfind ~pos:e1 tuple_ty) e1 in - Expr.etupleaccess e1' index size context_mark + Expr.etupleaccess ~e:e1' ~index ~size context_mark | A.EAbs { binder; tys = t_args } -> if Bindlib.mbinder_arity binder <> List.length t_args then Message.raise_spanned_error (Expr.pos e) @@ -771,98 +770,84 @@ and typecheck_expr_top_down : in let binder' = Bindlib.bind_mvar xs' (Expr.Box.lift body') in Expr.eabs binder' (List.map (typ_to_ast ~leave_unresolved) tau_args) mark - | A.EApp { f = (EOp { op; tys }, _) as e1; args } -> + | A.EApp { f = e1; args; tys } -> + (* Here we type the arguments first (in order), to ensure we know the types + of the arguments if [f] is [EAbs] before disambiguation. This is also the + right order for the [let-in] form. *) + let t_args = + match tys with + | [] -> List.map (fun _ -> unionfind (TAny (Any.fresh ()))) args + | tys -> List.map ast_to_typ tys + in + let args' = + List.map2 (typecheck_expr_top_down ~leave_unresolved ctx env) t_args args + in + let t_args = + match t_args, tys with + | [t], [] -> ( + (* Handles typing before detuplification: if [tys] was not yet set, we + are allowed to destruct a tuple into multiple arguments (see + [Scopelang.from_desugared] for the corresponding code + transformation) *) + match UnionFind.get t with TTuple tys, _ -> tys | _ -> t_args) + | _ -> + if List.length t_args <> List.length args' then + Message.raise_spanned_error (Expr.pos e) + (match e1 with + | EAbs _, _ -> "This binds %d variables, but %d were provided." + | _ -> "This function application has %d arguments, but expects %d.") + (List.length t_args) (List.length args'); + + t_args + in + let t_func = unionfind ~pos:e1 (TArrow (t_args, tau)) in + let e1' = typecheck_expr_top_down ~leave_unresolved ctx env t_func e1 in + Expr.eapp ~f:e1' ~args:args' + ~tys:(List.map (typ_to_ast ~leave_unresolved) t_args) + context_mark + | A.EAppOp { op; tys; args } -> let t_args = List.map ast_to_typ tys in let t_func = unionfind (TArrow (t_args, tau)) in - let e1', args' = + let args = Operator.kind_dispatch op - ~polymorphic:(fun _ -> + ~polymorphic:(fun op -> (* Type the operator first, then right-to-left: polymorphic operators are required to allow the resolution of all type variables this way *) - let e1' = - typecheck_expr_top_down ~leave_unresolved ctx env t_func e1 - in - let args' = - List.rev_map2 - (typecheck_expr_top_down ~leave_unresolved ctx env) - (List.rev t_args) (List.rev args) - in - e1', args') - ~overloaded:(fun _ -> + unify ctx e (polymorphic_op_type (Mark.add pos_e op)) t_func; + List.rev_map2 + (typecheck_expr_top_down ~leave_unresolved ctx env) + (List.rev t_args) (List.rev args)) + ~overloaded:(fun op -> (* Typing the arguments first is required to resolve the operator *) let args' = List.map2 (typecheck_expr_top_down ~leave_unresolved ctx env) t_args args in - let e1' = - typecheck_expr_top_down ~leave_unresolved ctx env t_func e1 - in - e1', args') - ~monomorphic:(fun _ -> - (* Here it doesn't matter but may affect the error messages *) - let e1' = - typecheck_expr_top_down ~leave_unresolved ctx env t_func e1 - in - let args' = - List.map2 - (typecheck_expr_top_down ~leave_unresolved ctx env) - t_args args - in - e1', args') - ~resolved:(fun _ -> - (* This case should not fail *) - let e1' = - typecheck_expr_top_down ~leave_unresolved ctx env t_func e1 - in - let args' = - List.map2 - (typecheck_expr_top_down ~leave_unresolved ctx env) - t_args args - in - e1', args') - in - Expr.eapp e1' args' context_mark - | A.EApp { f = e1; args } -> - (* Here we type the arguments first (in order), to ensure we know the types - of the arguments if [f] is [EAbs] before disambiguation. This is also the - right order for the [let-in] form. *) - let t_args = List.map (fun _ -> unionfind (TAny (Any.fresh ()))) args in - let t_func = unionfind (TArrow (t_args, tau)) in - let args' = - List.map2 (typecheck_expr_top_down ~leave_unresolved ctx env) t_args args - in - let e1' = typecheck_expr_top_down ~leave_unresolved ctx env t_func e1 in - Expr.eapp e1' args' context_mark - | A.EOp { op; tys } -> - let tys' = List.map ast_to_typ tys in - let t_ret = unionfind (TAny (Any.fresh ())) in - let t_func = unionfind (TArrow (tys', t_ret)) in - unify ctx e t_func tau; - let tys, mark = - Operator.kind_dispatch op - ~polymorphic:(fun op -> - tys, mark_with_tau_and_unify (polymorphic_op_type (Mark.add pos_e op))) + unify ctx e tau + (resolve_overload_ret_type ~leave_unresolved ctx e op t_args); + args') ~monomorphic:(fun op -> - let mark = - mark_with_tau_and_unify - (ast_to_typ (Operator.monomorphic_type (Mark.add pos_e op))) - in - List.map (typ_to_ast ~leave_unresolved) tys', mark) - ~overloaded:(fun op -> - unify ctx e t_ret - (resolve_overload_ret_type ~leave_unresolved ctx e op tys'); - ( List.map (typ_to_ast ~leave_unresolved) tys', - A.Custom { A.custom = t_func; pos = pos_e } )) + (* Here it doesn't matter but may affect the error messages *) + unify ctx e + (ast_to_typ (Operator.monomorphic_type (Mark.add pos_e op))) + t_func; + List.map2 + (typecheck_expr_top_down ~leave_unresolved ctx env) + t_args args) ~resolved:(fun op -> - let mark = - mark_with_tau_and_unify - (ast_to_typ (Operator.resolved_type (Mark.add pos_e op))) - in - List.map (typ_to_ast ~leave_unresolved) tys', mark) + (* This case should not fail *) + unify ctx e + (ast_to_typ (Operator.resolved_type (Mark.add pos_e op))) + t_func; + List.map2 + (typecheck_expr_top_down ~leave_unresolved ctx env) + t_args args) in - Expr.eop op tys mark + (* All operator applications are monomorphised at this point *) + let tys = List.map (typ_to_ast ~leave_unresolved) t_args in + Expr.eappop ~op ~args ~tys context_mark | A.EDefault { excepts; just; cons } -> let cons' = typecheck_expr_top_down ~leave_unresolved ctx env tau cons in let just' = diff --git a/compiler/shared_ast/typing.mli b/compiler/shared_ast/typing.mli index f540ca63..a68e2392 100644 --- a/compiler/shared_ast/typing.mli +++ b/compiler/shared_ast/typing.mli @@ -61,9 +61,20 @@ val expr : filling the gaps ([TAny]) if any. Use [Expr.untype] first if this is not what you want. - Note that typing also transparently performs disambiguation of constructors: - [EDStructAccess] nodes are translated into [EStructAccess] with the suitable - structure and field idents (this only concerns [desugared] expressions). *) + Note that typing also transparently performs the following changes to the + AST nodes, outside of typing annotations: + - disambiguation of constructors: [EDStructAccess] nodes are translated into + [EStructAccess] with the suitable structure and field idents (this only + concerns [desugared] expressions). + - resolution of operator types, which are stored (monomorphised) back in the + [EAppOp] nodes + - resolution of function application input types on the [EApp] nodes, when + that was originally empty ([[]]): this documents the arity of the function + application, taking de-tuplification into account. + - [TAny] appearing within nodes are refined to more precise types, e.g. on + `EAbs` nodes (but be careful with this, it may only work for specific + structures of generated code ; [~leave_unresolved:false] checks that it + didn't cause problems) *) val check_expr : leave_unresolved:bool -> diff --git a/compiler/surface/ast.ml b/compiler/surface/ast.ml index e0ee7c96..380b43bf 100644 --- a/compiler/surface/ast.ml +++ b/compiler/surface/ast.ml @@ -55,6 +55,7 @@ and primitive_typ = and base_typ_data = | Primitive of primitive_typ | Collection of base_typ_data Mark.pos + | TTuple of base_typ_data Mark.pos list and base_typ = Condition | Data of base_typ_data @@ -180,13 +181,14 @@ and naked_expression = | FunCall of expression * expression list | ScopeCall of (path * uident Mark.pos) Mark.pos * (lident Mark.pos * expression) list - | LetIn of lident Mark.pos * expression * expression + | LetIn of lident Mark.pos list * expression * expression | Builtin of builtin_expression | Literal of literal | EnumInject of (path * uident Mark.pos) Mark.pos * expression option | StructLit of (path * uident Mark.pos) Mark.pos * (lident Mark.pos * expression) list | ArrayLit of expression list + | Tuple of expression list | Ident of path * lident Mark.pos | Dotted of expression * (path * lident Mark.pos) Mark.pos (** Dotted is for both struct field projection and sub-scope variables *) diff --git a/compiler/surface/parser.messages b/compiler/surface/parser.messages index a3f4e5c2..20e7055b 100644 --- a/compiler/surface/parser.messages +++ b/compiler/surface/parser.messages @@ -1,6 +1,6 @@ source_file: BEGIN_CODE DECLARATION ENUM UIDENT COLON ALT UIDENT CONTENT TEXT YEAR ## -## Ends in an error in state: 358. +## Ends in an error in state: 367. ## ## list(addpos(enum_decl_line)) -> enum_decl_line . list(addpos(enum_decl_line)) [ SCOPE END_CODE DECLARATION ] ## @@ -12,7 +12,7 @@ expected another enum case, or a new declaration or scope use source_file: BEGIN_CODE DECLARATION ENUM UIDENT COLON ALT UIDENT CONTENT YEAR ## -## Ends in an error in state: 354. +## Ends in an error in state: 363. ## ## option(preceded(CONTENT,addpos(typ))) -> CONTENT . typ_data [ SCOPE END_CODE DECLARATION ALT ] ## @@ -24,7 +24,7 @@ expected a content type source_file: BEGIN_CODE DECLARATION ENUM UIDENT COLON ALT UIDENT YEAR ## -## Ends in an error in state: 353. +## Ends in an error in state: 362. ## ## enum_decl_line -> ALT UIDENT . option(preceded(CONTENT,addpos(typ))) [ SCOPE END_CODE DECLARATION ALT ] ## @@ -36,7 +36,7 @@ expected a payload for your enum case, or another case or declaration source_file: BEGIN_CODE DECLARATION ENUM UIDENT COLON ALT YEAR ## -## Ends in an error in state: 352. +## Ends in an error in state: 361. ## ## enum_decl_line -> ALT . UIDENT option(preceded(CONTENT,addpos(typ))) [ SCOPE END_CODE DECLARATION ALT ] ## @@ -48,7 +48,7 @@ expected the name of an enum case source_file: BEGIN_CODE DECLARATION ENUM UIDENT COLON YEAR ## -## Ends in an error in state: 351. +## Ends in an error in state: 360. ## ## code_item -> DECLARATION ENUM UIDENT COLON . list(addpos(enum_decl_line)) [ SCOPE END_CODE DECLARATION ] ## @@ -60,7 +60,7 @@ expected an enum case source_file: BEGIN_CODE DECLARATION ENUM UIDENT YEAR ## -## Ends in an error in state: 350. +## Ends in an error in state: 359. ## ## code_item -> DECLARATION ENUM UIDENT . COLON list(addpos(enum_decl_line)) [ SCOPE END_CODE DECLARATION ] ## @@ -72,7 +72,7 @@ expected a colon source_file: BEGIN_CODE DECLARATION ENUM YEAR ## -## Ends in an error in state: 349. +## Ends in an error in state: 358. ## ## code_item -> DECLARATION ENUM . UIDENT COLON list(addpos(enum_decl_line)) [ SCOPE END_CODE DECLARATION ] ## @@ -84,7 +84,7 @@ expected the name of your enum source_file: BEGIN_CODE DECLARATION SCOPE UIDENT COLON YEAR ## -## Ends in an error in state: 312. +## Ends in an error in state: 321. ## ## code_item -> DECLARATION SCOPE UIDENT COLON . nonempty_list(addpos(scope_decl_item)) [ SCOPE END_CODE DECLARATION ] ## @@ -96,7 +96,7 @@ expected a context item introduced by "context" source_file: BEGIN_CODE DECLARATION SCOPE UIDENT YEAR ## -## Ends in an error in state: 311. +## Ends in an error in state: 320. ## ## code_item -> DECLARATION SCOPE UIDENT . COLON nonempty_list(addpos(scope_decl_item)) [ SCOPE END_CODE DECLARATION ] ## @@ -108,7 +108,7 @@ expected a colon followed by the list of context items of this scope source_file: BEGIN_CODE DECLARATION SCOPE YEAR ## -## Ends in an error in state: 310. +## Ends in an error in state: 319. ## ## code_item -> DECLARATION SCOPE . UIDENT COLON nonempty_list(addpos(scope_decl_item)) [ SCOPE END_CODE DECLARATION ] ## @@ -122,7 +122,7 @@ expected the name of the scope you are declaring source_file: BEGIN_CODE DECLARATION STRUCT UIDENT COLON CONDITION LIDENT DEPENDS YEAR ## -## Ends in an error in state: 297. +## Ends in an error in state: 306. ## ## struct_scope -> struct_scope_base DEPENDS . separated_nonempty_list(COMMA,var_content) [ SCOPE END_CODE DECLARATION DATA CONDITION ] ## struct_scope -> struct_scope_base DEPENDS . LPAREN separated_nonempty_list(COMMA,var_content) RPAREN [ SCOPE END_CODE DECLARATION DATA CONDITION ] @@ -135,7 +135,7 @@ expected the type of the parameter of this struct data function source_file: BEGIN_CODE DECLARATION STRUCT UIDENT COLON CONDITION LIDENT YEAR ## -## Ends in an error in state: 296. +## Ends in an error in state: 305. ## ## struct_scope -> struct_scope_base . DEPENDS separated_nonempty_list(COMMA,var_content) [ SCOPE END_CODE DECLARATION DATA CONDITION ] ## struct_scope -> struct_scope_base . DEPENDS LPAREN separated_nonempty_list(COMMA,var_content) RPAREN [ SCOPE END_CODE DECLARATION DATA CONDITION ] @@ -149,7 +149,7 @@ expected a new struct data, or another declaration or scope use source_file: BEGIN_CODE DECLARATION STRUCT UIDENT COLON CONDITION YEAR ## -## Ends in an error in state: 294. +## Ends in an error in state: 303. ## ## struct_scope_base -> CONDITION . lident [ SCOPE END_CODE DEPENDS DECLARATION DATA CONDITION ] ## @@ -161,7 +161,7 @@ expected the name of this struct condition source_file: BEGIN_CODE DECLARATION STRUCT UIDENT COLON DATA LIDENT CONTENT YEAR ## -## Ends in an error in state: 289. +## Ends in an error in state: 292. ## ## struct_scope_base -> DATA lident CONTENT . typ_data [ SCOPE END_CODE DEPENDS DECLARATION DATA CONDITION ] ## @@ -173,7 +173,7 @@ expected the type of this struct data source_file: BEGIN_CODE DECLARATION STRUCT UIDENT COLON DATA LIDENT YEAR ## -## Ends in an error in state: 288. +## Ends in an error in state: 291. ## ## struct_scope_base -> DATA lident . CONTENT typ_data [ SCOPE END_CODE DEPENDS DECLARATION DATA CONDITION ] ## @@ -185,7 +185,7 @@ expected the type of this struct data, introduced by the content keyword source_file: BEGIN_CODE DECLARATION STRUCT UIDENT COLON DATA YEAR ## -## Ends in an error in state: 287. +## Ends in an error in state: 290. ## ## struct_scope_base -> DATA . lident CONTENT typ_data [ SCOPE END_CODE DEPENDS DECLARATION DATA CONDITION ] ## @@ -197,7 +197,7 @@ expected the name of this struct data source_file: BEGIN_CODE DECLARATION STRUCT UIDENT COLON YEAR ## -## Ends in an error in state: 286. +## Ends in an error in state: 289. ## ## code_item -> DECLARATION STRUCT UIDENT COLON . list(addpos(struct_scope)) [ SCOPE END_CODE DECLARATION ] ## @@ -209,7 +209,7 @@ expected struct data or condition source_file: BEGIN_CODE DECLARATION STRUCT UIDENT YEAR ## -## Ends in an error in state: 285. +## Ends in an error in state: 288. ## ## code_item -> DECLARATION STRUCT UIDENT . COLON list(addpos(struct_scope)) [ SCOPE END_CODE DECLARATION ] ## @@ -221,7 +221,7 @@ expected a colon source_file: BEGIN_CODE DECLARATION STRUCT YEAR ## -## Ends in an error in state: 284. +## Ends in an error in state: 287. ## ## code_item -> DECLARATION STRUCT . UIDENT COLON list(addpos(struct_scope)) [ SCOPE END_CODE DECLARATION ] ## @@ -233,7 +233,7 @@ expected the struct name source_file: BEGIN_CODE DECLARATION YEAR ## -## Ends in an error in state: 283. +## Ends in an error in state: 286. ## ## code_item -> DECLARATION . STRUCT UIDENT COLON list(addpos(struct_scope)) [ SCOPE END_CODE DECLARATION ] ## code_item -> DECLARATION . SCOPE UIDENT COLON nonempty_list(addpos(scope_decl_item)) [ SCOPE END_CODE DECLARATION ] @@ -250,7 +250,7 @@ expected the kind of the declaration (struct, scope or enum) source_file: BEGIN_CODE SCOPE UIDENT COLON ASSERTION CARDINAL THEN ## -## Ends in an error in state: 241. +## Ends in an error in state: 247. ## ## assertion -> option(condition_consequence) expression . [ SCOPE RULE LABEL EXCEPTION END_CODE DEFINITION DECLARATION DATE ASSERTION ] ## expression -> expression . DOT qlident [ XOR WITH SCOPE RULE PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER LABEL GREATER_EQUAL GREATER FOR EXCEPTION EQUAL END_CODE DOT DIV DEFINITION DECLARATION DATE CONTAINS ASSERTION AND ] @@ -282,7 +282,7 @@ expected a new scope use item source_file: BEGIN_CODE SCOPE UIDENT COLON ASSERTION FIXED LIDENT BY YEAR ## -## Ends in an error in state: 238. +## Ends in an error in state: 244. ## ## assertion -> FIXED separated_nonempty_list(DOT,addpos(LIDENT)) BY . lident [ SCOPE RULE LABEL EXCEPTION END_CODE DEFINITION DECLARATION DATE ASSERTION ] ## @@ -294,7 +294,7 @@ expected the legislative text by which the value of the variable is fixed source_file: BEGIN_CODE SCOPE UIDENT COLON ASSERTION FIXED LIDENT WITH_V ## -## Ends in an error in state: 237. +## Ends in an error in state: 243. ## ## assertion -> FIXED separated_nonempty_list(DOT,addpos(LIDENT)) . BY lident [ SCOPE RULE LABEL EXCEPTION END_CODE DEFINITION DECLARATION DATE ASSERTION ] ## @@ -305,14 +305,14 @@ source_file: BEGIN_CODE SCOPE UIDENT COLON ASSERTION FIXED LIDENT WITH_V ## This implies that, although the LR(1) items shown above provide an ## accurate view of the past (what has been recognized so far), they ## may provide an INCOMPLETE view of the future (what was expected next). -## In state 225, spurious reduction of production separated_nonempty_list(DOT,addpos(LIDENT)) -> LIDENT +## In state 231, spurious reduction of production separated_nonempty_list(DOT,addpos(LIDENT)) -> LIDENT ## expected the legislative text by which the value of the variable is fixed source_file: BEGIN_CODE SCOPE UIDENT COLON ASSERTION FIXED YEAR ## -## Ends in an error in state: 236. +## Ends in an error in state: 242. ## ## assertion -> FIXED . separated_nonempty_list(DOT,addpos(LIDENT)) BY lident [ SCOPE RULE LABEL EXCEPTION END_CODE DEFINITION DECLARATION DATE ASSERTION ] ## @@ -324,7 +324,7 @@ expected the name of the variable that should be fixed source_file: BEGIN_CODE SCOPE UIDENT COLON ASSERTION UNDER_CONDITION TRUE THEN ## -## Ends in an error in state: 234. +## Ends in an error in state: 240. ## ## condition_consequence -> UNDER_CONDITION expression . CONSEQUENCE [ UIDENT TRUE SUM OUTPUT NOT MONEY_AMOUNT MONEY MINUS MINIMUM MAXIMUM MATCH LPAREN LIDENT LET LBRACKET INT_LITERAL IF FOR FILLED FALSE EXISTS DEFINED_AS DECIMAL_LITERAL DECIMAL DATE_LITERAL CARDINAL ] ## expression -> expression . DOT qlident [ XOR WITH PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER GREATER_EQUAL GREATER FOR EQUAL DOT DIV CONTAINS CONSEQUENCE AND ] @@ -356,7 +356,7 @@ expected a consequence for this definition under condition source_file: BEGIN_CODE SCOPE UIDENT COLON ASSERTION UNDER_CONDITION YEAR ## -## Ends in an error in state: 233. +## Ends in an error in state: 239. ## ## condition_consequence -> UNDER_CONDITION . expression CONSEQUENCE [ UIDENT TRUE SUM OUTPUT NOT MONEY_AMOUNT MONEY MINUS MINIMUM MAXIMUM MATCH LPAREN LIDENT LET LBRACKET INT_LITERAL IF FOR FILLED FALSE EXISTS DEFINED_AS DECIMAL_LITERAL DECIMAL DATE_LITERAL CARDINAL ] ## @@ -368,7 +368,7 @@ expected an expression for this condition source_file: BEGIN_CODE SCOPE UIDENT COLON ASSERTION VARIES LIDENT UNDER_CONDITION ## -## Ends in an error in state: 228. +## Ends in an error in state: 234. ## ## assertion -> VARIES separated_nonempty_list(DOT,addpos(LIDENT)) . WITH_V expression option(addpos(variation_type)) [ SCOPE RULE LABEL EXCEPTION END_CODE DEFINITION DECLARATION DATE ASSERTION ] ## @@ -379,14 +379,14 @@ source_file: BEGIN_CODE SCOPE UIDENT COLON ASSERTION VARIES LIDENT UNDER_CONDITI ## This implies that, although the LR(1) items shown above provide an ## accurate view of the past (what has been recognized so far), they ## may provide an INCOMPLETE view of the future (what was expected next). -## In state 225, spurious reduction of production separated_nonempty_list(DOT,addpos(LIDENT)) -> LIDENT +## In state 231, spurious reduction of production separated_nonempty_list(DOT,addpos(LIDENT)) -> LIDENT ## expected an indication about what this variable varies with source_file: BEGIN_CODE SCOPE UIDENT COLON ASSERTION VARIES LIDENT WITH_V YEAR ## -## Ends in an error in state: 229. +## Ends in an error in state: 235. ## ## assertion -> VARIES separated_nonempty_list(DOT,addpos(LIDENT)) WITH_V . expression option(addpos(variation_type)) [ SCOPE RULE LABEL EXCEPTION END_CODE DEFINITION DECLARATION DATE ASSERTION ] ## @@ -398,7 +398,7 @@ the variable varies with an expression that was expected here source_file: BEGIN_CODE SCOPE UIDENT COLON ASSERTION VARIES YEAR ## -## Ends in an error in state: 224. +## Ends in an error in state: 230. ## ## assertion -> VARIES . separated_nonempty_list(DOT,addpos(LIDENT)) WITH_V expression option(addpos(variation_type)) [ SCOPE RULE LABEL EXCEPTION END_CODE DEFINITION DECLARATION DATE ASSERTION ] ## @@ -410,7 +410,7 @@ expecting the name of the varying variable source_file: BEGIN_CODE SCOPE UIDENT COLON ASSERTION YEAR ## -## Ends in an error in state: 223. +## Ends in an error in state: 229. ## ## scope_item -> ASSERTION . assertion [ SCOPE RULE LABEL EXCEPTION END_CODE DEFINITION DECLARATION DATE ASSERTION ] ## @@ -422,7 +422,7 @@ expected an expression that shoud be asserted during execution source_file: BEGIN_CODE SCOPE UIDENT COLON DEFINITION LIDENT DEFINED_AS YEAR ## -## Ends in an error in state: 264. +## Ends in an error in state: 267. ## ## definition -> option(label) option(exception_to) DEFINITION separated_nonempty_list(DOT,addpos(LIDENT)) option(addpos(definition_parameters)) option(state) option(condition_consequence) DEFINED_AS . expression [ SCOPE RULE LABEL EXCEPTION END_CODE DEFINITION DECLARATION DATE ASSERTION ] ## @@ -434,7 +434,7 @@ expected an expression for the definition source_file: BEGIN_CODE SCOPE UIDENT COLON DEFINITION LIDENT OF LIDENT DECREASING ## -## Ends in an error in state: 255. +## Ends in an error in state: 180. ## ## separated_nonempty_list(COMMA,lident) -> lident . [ UNDER_CONDITION STATE NOT FILLED DEFINED_AS ] ## separated_nonempty_list(COMMA,lident) -> lident . COMMA separated_nonempty_list(COMMA,lident) [ UNDER_CONDITION STATE NOT FILLED DEFINED_AS ] @@ -447,7 +447,7 @@ expected an expression for defining this function, introduced by the defined as source_file: BEGIN_CODE SCOPE UIDENT COLON DEFINITION LIDENT WITH_V ## -## Ends in an error in state: 252. +## Ends in an error in state: 258. ## ## definition -> option(label) option(exception_to) DEFINITION separated_nonempty_list(DOT,addpos(LIDENT)) . option(addpos(definition_parameters)) option(state) option(condition_consequence) DEFINED_AS expression [ SCOPE RULE LABEL EXCEPTION END_CODE DEFINITION DECLARATION DATE ASSERTION ] ## @@ -458,14 +458,14 @@ source_file: BEGIN_CODE SCOPE UIDENT COLON DEFINITION LIDENT WITH_V ## This implies that, although the LR(1) items shown above provide an ## accurate view of the past (what has been recognized so far), they ## may provide an INCOMPLETE view of the future (what was expected next). -## In state 225, spurious reduction of production separated_nonempty_list(DOT,addpos(LIDENT)) -> LIDENT +## In state 231, spurious reduction of production separated_nonempty_list(DOT,addpos(LIDENT)) -> LIDENT ## expected the defined as keyword to introduce the definition of this variable source_file: BEGIN_CODE SCOPE UIDENT COLON DEFINITION YEAR ## -## Ends in an error in state: 251. +## Ends in an error in state: 257. ## ## definition -> option(label) option(exception_to) DEFINITION . separated_nonempty_list(DOT,addpos(LIDENT)) option(addpos(definition_parameters)) option(state) option(condition_consequence) DEFINED_AS expression [ SCOPE RULE LABEL EXCEPTION END_CODE DEFINITION DECLARATION DATE ASSERTION ] ## @@ -477,7 +477,7 @@ expected the name of the variable you want to define source_file: BEGIN_CODE SCOPE UIDENT COLON EXCEPTION LIDENT YEAR ## -## Ends in an error in state: 278. +## Ends in an error in state: 281. ## ## option(addpos(exception_to)) -> exception_to . [ RULE ] ## option(exception_to) -> exception_to . [ DEFINITION ] @@ -490,7 +490,7 @@ expected a rule or a definition after the exception declaration source_file: BEGIN_CODE SCOPE UIDENT COLON EXCEPTION YEAR ## -## Ends in an error in state: 247. +## Ends in an error in state: 253. ## ## exception_to -> EXCEPTION . option(lident) [ RULE DEFINITION ] ## @@ -502,7 +502,7 @@ expected the label to which the exception is referring back source_file: BEGIN_CODE SCOPE UIDENT COLON LABEL LIDENT DEFINED_AS ## -## Ends in an error in state: 246. +## Ends in an error in state: 252. ## ## definition -> option(label) . option(exception_to) DEFINITION separated_nonempty_list(DOT,addpos(LIDENT)) option(addpos(definition_parameters)) option(state) option(condition_consequence) DEFINED_AS expression [ SCOPE RULE LABEL EXCEPTION END_CODE DEFINITION DECLARATION DATE ASSERTION ] ## rule -> option(label) . option(addpos(exception_to)) RULE rule_expr option(state) option(condition_consequence) rule_consequence [ SCOPE RULE LABEL EXCEPTION END_CODE DEFINITION DECLARATION DATE ASSERTION ] @@ -515,7 +515,7 @@ expected a rule or a definition after the label declaration source_file: BEGIN_CODE SCOPE UIDENT COLON LABEL YEAR ## -## Ends in an error in state: 216. +## Ends in an error in state: 222. ## ## label -> LABEL . lident [ RULE EXCEPTION DEFINITION ] ## @@ -527,7 +527,7 @@ expected the name of the label source_file: BEGIN_CODE SCOPE UIDENT COLON RULE LIDENT DOT YEAR ## -## Ends in an error in state: 226. +## Ends in an error in state: 232. ## ## separated_nonempty_list(DOT,addpos(LIDENT)) -> LIDENT DOT . separated_nonempty_list(DOT,addpos(LIDENT)) [ WITH_V UNDER_CONDITION STATE OF NOT FILLED DEFINED_AS BY ] ## @@ -539,7 +539,7 @@ expected a struct field or a sub-scope context item after the dot source_file: BEGIN_CODE SCOPE UIDENT COLON RULE LIDENT NOT FALSE ## -## Ends in an error in state: 276. +## Ends in an error in state: 279. ## ## rule_consequence -> option(NOT) . FILLED [ SCOPE RULE LABEL EXCEPTION END_CODE DEFINITION DECLARATION DATE ASSERTION ] ## @@ -551,7 +551,7 @@ expected the filled keyword the this rule source_file: BEGIN_CODE SCOPE UIDENT COLON RULE LIDENT OF YEAR ## -## Ends in an error in state: 253. +## Ends in an error in state: 259. ## ## definition_parameters -> OF . separated_nonempty_list(COMMA,lident) [ UNDER_CONDITION STATE NOT FILLED DEFINED_AS ] ## @@ -563,7 +563,7 @@ expected the name of the parameter for this dependent variable source_file: BEGIN_CODE SCOPE UIDENT COLON RULE LIDENT WITH_V ## -## Ends in an error in state: 269. +## Ends in an error in state: 272. ## ## rule_expr -> separated_nonempty_list(DOT,addpos(LIDENT)) . option(addpos(definition_parameters)) [ UNDER_CONDITION STATE NOT FILLED ] ## @@ -574,14 +574,14 @@ source_file: BEGIN_CODE SCOPE UIDENT COLON RULE LIDENT WITH_V ## This implies that, although the LR(1) items shown above provide an ## accurate view of the past (what has been recognized so far), they ## may provide an INCOMPLETE view of the future (what was expected next). -## In state 225, spurious reduction of production separated_nonempty_list(DOT,addpos(LIDENT)) -> LIDENT +## In state 231, spurious reduction of production separated_nonempty_list(DOT,addpos(LIDENT)) -> LIDENT ## expected a condition or a consequence for this rule source_file: BEGIN_CODE SCOPE UIDENT COLON RULE LIDENT YEAR ## -## Ends in an error in state: 225. +## Ends in an error in state: 231. ## ## separated_nonempty_list(DOT,addpos(LIDENT)) -> LIDENT . [ WITH_V UNDER_CONDITION STATE OF NOT FILLED DEFINED_AS BY ] ## separated_nonempty_list(DOT,addpos(LIDENT)) -> LIDENT . DOT separated_nonempty_list(DOT,addpos(LIDENT)) [ WITH_V UNDER_CONDITION STATE OF NOT FILLED DEFINED_AS BY ] @@ -594,7 +594,7 @@ expected 'under condition' followed by a condition, 'equals' followed by the def source_file: BEGIN_CODE SCOPE UIDENT COLON RULE YEAR ## -## Ends in an error in state: 268. +## Ends in an error in state: 271. ## ## rule -> option(label) option(addpos(exception_to)) RULE . rule_expr option(state) option(condition_consequence) rule_consequence [ SCOPE RULE LABEL EXCEPTION END_CODE DEFINITION DECLARATION DATE ASSERTION ] ## @@ -606,7 +606,7 @@ expected the name of the variable subject to the rule source_file: BEGIN_CODE SCOPE UIDENT COLON YEAR ## -## Ends in an error in state: 215. +## Ends in an error in state: 221. ## ## code_item -> SCOPE UIDENT option(preceded(UNDER_CONDITION,expression)) COLON . nonempty_list(scope_item) [ SCOPE END_CODE DECLARATION ] ## @@ -748,32 +748,33 @@ expected a unit for this literal, or a valid operator to complete the expression source_file: BEGIN_CODE SCOPE UIDENT UNDER_CONDITION LPAREN TRUE THEN ## -## Ends in an error in state: 180. +## Ends in an error in state: 185. ## -## expression -> LPAREN expression . RPAREN [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RPAREN RBRACKET RBRACE PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER LABEL IS INCREASING IN GREATER_EQUAL GREATER FOR EXCEPTION EQUAL END_CODE ELSE DOT DIV DEFINITION DECREASING DECLARATION DATE CONTAINS CONSEQUENCE COMMA COLON ASSERTION AND ALT ] -## expression -> expression . DOT qlident [ XOR WITH RPAREN PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER GREATER_EQUAL GREATER FOR EQUAL DOT DIV CONTAINS AND ] -## expression -> expression . OF funcall_args [ XOR WITH RPAREN PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER GREATER_EQUAL GREATER FOR EQUAL DOT DIV CONTAINS AND ] -## expression -> expression . WITH constructor_binding [ XOR WITH RPAREN PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER GREATER_EQUAL GREATER FOR EQUAL DOT DIV CONTAINS AND ] -## expression -> expression . CONTAINS expression [ XOR WITH RPAREN PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER GREATER_EQUAL GREATER FOR EQUAL DOT DIV CONTAINS AND ] -## expression -> expression . FOR lident AMONG expression [ XOR WITH RPAREN PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER GREATER_EQUAL GREATER FOR EQUAL DOT DIV CONTAINS AND ] -## expression -> expression . MULT expression [ XOR WITH RPAREN PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER GREATER_EQUAL GREATER FOR EQUAL DOT DIV CONTAINS AND ] -## expression -> expression . DIV expression [ XOR WITH RPAREN PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER GREATER_EQUAL GREATER FOR EQUAL DOT DIV CONTAINS AND ] -## expression -> expression . PLUS expression [ XOR WITH RPAREN PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER GREATER_EQUAL GREATER FOR EQUAL DOT DIV CONTAINS AND ] -## expression -> expression . MINUS expression [ XOR WITH RPAREN PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER GREATER_EQUAL GREATER FOR EQUAL DOT DIV CONTAINS AND ] -## expression -> expression . PLUSPLUS expression [ XOR WITH RPAREN PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER GREATER_EQUAL GREATER FOR EQUAL DOT DIV CONTAINS AND ] -## expression -> expression . LESSER expression [ XOR WITH RPAREN PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER GREATER_EQUAL GREATER FOR EQUAL DOT DIV CONTAINS AND ] -## expression -> expression . LESSER_EQUAL expression [ XOR WITH RPAREN PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER GREATER_EQUAL GREATER FOR EQUAL DOT DIV CONTAINS AND ] -## expression -> expression . GREATER expression [ XOR WITH RPAREN PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER GREATER_EQUAL GREATER FOR EQUAL DOT DIV CONTAINS AND ] -## expression -> expression . GREATER_EQUAL expression [ XOR WITH RPAREN PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER GREATER_EQUAL GREATER FOR EQUAL DOT DIV CONTAINS AND ] -## expression -> expression . EQUAL expression [ XOR WITH RPAREN PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER GREATER_EQUAL GREATER FOR EQUAL DOT DIV CONTAINS AND ] -## expression -> expression . NOT_EQUAL expression [ XOR WITH RPAREN PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER GREATER_EQUAL GREATER FOR EQUAL DOT DIV CONTAINS AND ] -## expression -> expression . AND expression [ XOR WITH RPAREN PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER GREATER_EQUAL GREATER FOR EQUAL DOT DIV CONTAINS AND ] -## expression -> expression . OR expression [ XOR WITH RPAREN PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER GREATER_EQUAL GREATER FOR EQUAL DOT DIV CONTAINS AND ] -## expression -> expression . XOR expression [ XOR WITH RPAREN PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER GREATER_EQUAL GREATER FOR EQUAL DOT DIV CONTAINS AND ] -## expression -> expression . FOR lident AMONG expression SUCH THAT expression [ XOR WITH RPAREN PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER GREATER_EQUAL GREATER FOR EQUAL DOT DIV CONTAINS AND ] +## expression -> expression . DOT qlident [ XOR WITH RPAREN PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER GREATER_EQUAL GREATER FOR EQUAL DOT DIV CONTAINS COMMA AND ] +## expression -> expression . OF funcall_args [ XOR WITH RPAREN PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER GREATER_EQUAL GREATER FOR EQUAL DOT DIV CONTAINS COMMA AND ] +## expression -> expression . WITH constructor_binding [ XOR WITH RPAREN PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER GREATER_EQUAL GREATER FOR EQUAL DOT DIV CONTAINS COMMA AND ] +## expression -> expression . CONTAINS expression [ XOR WITH RPAREN PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER GREATER_EQUAL GREATER FOR EQUAL DOT DIV CONTAINS COMMA AND ] +## expression -> expression . FOR lident AMONG expression [ XOR WITH RPAREN PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER GREATER_EQUAL GREATER FOR EQUAL DOT DIV CONTAINS COMMA AND ] +## expression -> expression . MULT expression [ XOR WITH RPAREN PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER GREATER_EQUAL GREATER FOR EQUAL DOT DIV CONTAINS COMMA AND ] +## expression -> expression . DIV expression [ XOR WITH RPAREN PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER GREATER_EQUAL GREATER FOR EQUAL DOT DIV CONTAINS COMMA AND ] +## expression -> expression . PLUS expression [ XOR WITH RPAREN PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER GREATER_EQUAL GREATER FOR EQUAL DOT DIV CONTAINS COMMA AND ] +## expression -> expression . MINUS expression [ XOR WITH RPAREN PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER GREATER_EQUAL GREATER FOR EQUAL DOT DIV CONTAINS COMMA AND ] +## expression -> expression . PLUSPLUS expression [ XOR WITH RPAREN PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER GREATER_EQUAL GREATER FOR EQUAL DOT DIV CONTAINS COMMA AND ] +## expression -> expression . LESSER expression [ XOR WITH RPAREN PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER GREATER_EQUAL GREATER FOR EQUAL DOT DIV CONTAINS COMMA AND ] +## expression -> expression . LESSER_EQUAL expression [ XOR WITH RPAREN PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER GREATER_EQUAL GREATER FOR EQUAL DOT DIV CONTAINS COMMA AND ] +## expression -> expression . GREATER expression [ XOR WITH RPAREN PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER GREATER_EQUAL GREATER FOR EQUAL DOT DIV CONTAINS COMMA AND ] +## expression -> expression . GREATER_EQUAL expression [ XOR WITH RPAREN PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER GREATER_EQUAL GREATER FOR EQUAL DOT DIV CONTAINS COMMA AND ] +## expression -> expression . EQUAL expression [ XOR WITH RPAREN PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER GREATER_EQUAL GREATER FOR EQUAL DOT DIV CONTAINS COMMA AND ] +## expression -> expression . NOT_EQUAL expression [ XOR WITH RPAREN PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER GREATER_EQUAL GREATER FOR EQUAL DOT DIV CONTAINS COMMA AND ] +## expression -> expression . AND expression [ XOR WITH RPAREN PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER GREATER_EQUAL GREATER FOR EQUAL DOT DIV CONTAINS COMMA AND ] +## expression -> expression . OR expression [ XOR WITH RPAREN PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER GREATER_EQUAL GREATER FOR EQUAL DOT DIV CONTAINS COMMA AND ] +## expression -> expression . XOR expression [ XOR WITH RPAREN PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER GREATER_EQUAL GREATER FOR EQUAL DOT DIV CONTAINS COMMA AND ] +## expression -> expression . FOR lident AMONG expression SUCH THAT expression [ XOR WITH RPAREN PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER GREATER_EQUAL GREATER FOR EQUAL DOT DIV CONTAINS COMMA AND ] +## separated_nonempty_list(COMMA,expression) -> expression . [ RPAREN ] +## separated_nonempty_list(COMMA,expression) -> expression . COMMA separated_nonempty_list(COMMA,expression) [ RPAREN ] ## ## The known suffix of the stack is as follows: -## LPAREN expression +## expression ## unmatched parenthesis that should have been closed by here @@ -782,7 +783,7 @@ source_file: BEGIN_CODE SCOPE UIDENT UNDER_CONDITION LPAREN YEAR ## ## Ends in an error in state: 52. ## -## expression -> LPAREN . expression RPAREN [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RPAREN RBRACKET RBRACE PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER LABEL IS INCREASING IN GREATER_EQUAL GREATER FOR EXCEPTION EQUAL END_CODE ELSE DOT DIV DEFINITION DECREASING DECLARATION DATE CONTAINS CONSEQUENCE COMMA COLON ASSERTION AND ALT ] +## expression -> LPAREN . separated_nonempty_list(COMMA,expression) RPAREN [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RPAREN RBRACKET RBRACE PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER LABEL IS INCREASING IN GREATER_EQUAL GREATER FOR EXCEPTION EQUAL END_CODE ELSE DOT DIV DEFINITION DECREASING DECLARATION DATE CONTAINS CONSEQUENCE COMMA COLON ASSERTION AND ALT ] ## ## The known suffix of the stack is as follows: ## LPAREN @@ -837,7 +838,7 @@ expected a list element source_file: BEGIN_CODE SCOPE UIDENT UNDER_CONDITION MATCH TRUE WITH ALT YEAR ## -## Ends in an error in state: 184. +## Ends in an error in state: 190. ## ## nonempty_list(addpos(preceded(ALT,match_arm))) -> ALT . match_arm [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RPAREN RBRACKET RBRACE PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER LABEL IS INCREASING IN GREATER_EQUAL GREATER FOR EXCEPTION EQUAL END_CODE ELSE DOT DIV DEFINITION DECREASING DECLARATION DATE CONTAINS CONSEQUENCE COMMA COLON ASSERTION AND ALT ] ## nonempty_list(addpos(preceded(ALT,match_arm))) -> ALT . match_arm nonempty_list(addpos(preceded(ALT,match_arm))) [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RPAREN RBRACKET RBRACE PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER LABEL IS INCREASING IN GREATER_EQUAL GREATER FOR EXCEPTION EQUAL END_CODE ELSE DOT DIV DEFINITION DECREASING DECLARATION DATE CONTAINS CONSEQUENCE COMMA COLON ASSERTION AND ALT ] @@ -850,7 +851,7 @@ expected the name of the constructor for the enum case in the pattern matching source_file: BEGIN_CODE SCOPE UIDENT UNDER_CONDITION MATCH TRUE WITH YEAR ## -## Ends in an error in state: 183. +## Ends in an error in state: 189. ## ## expression -> expression WITH . constructor_binding [ XOR WITH PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER GREATER_EQUAL GREATER FOR EQUAL DOT DIV CONTAINS AND ] ## expression -> MATCH expression WITH . nonempty_list(addpos(preceded(ALT,match_arm))) [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RPAREN RBRACKET RBRACE PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER LABEL IS INCREASING IN GREATER_EQUAL GREATER FOR EXCEPTION EQUAL END_CODE ELSE DOT DIV DEFINITION DECREASING DECLARATION DATE CONTAINS CONSEQUENCE COMMA COLON ASSERTION AND ALT ] @@ -875,7 +876,7 @@ expected an expression to match with source_file: BEGIN_CODE SCOPE UIDENT UNDER_CONDITION TRUE YEAR ## -## Ends in an error in state: 213. +## Ends in an error in state: 219. ## ## expression -> expression . DOT qlident [ XOR WITH PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER GREATER_EQUAL GREATER FOR EQUAL DOT DIV CONTAINS COLON AND ] ## expression -> expression . OF funcall_args [ XOR WITH PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER GREATER_EQUAL GREATER FOR EQUAL DOT DIV CONTAINS COLON AND ] @@ -944,7 +945,7 @@ expected the name of the scope being used source_file: BEGIN_CODE YEAR ## -## Ends in an error in state: 399. +## Ends in an error in state: 408. ## ## source_file_item -> BEGIN_CODE . code END_CODE [ LAW_TEXT LAW_HEADING EOF BEGIN_METADATA BEGIN_DIRECTIVE BEGIN_CODE ] ## @@ -1005,8 +1006,8 @@ source_file: BEGIN_METADATA LAW_TEXT LAW_HEADING ## accurate view of the past (what has been recognized so far), they ## may provide an INCOMPLETE view of the future (what was expected next). ## In state 1, spurious reduction of production nonempty_list(LAW_TEXT) -> LAW_TEXT -## In state 378, spurious reduction of production law_text -> nonempty_list(LAW_TEXT) -## In state 379, spurious reduction of production option(law_text) -> law_text +## In state 387, spurious reduction of production law_text -> nonempty_list(LAW_TEXT) +## In state 388, spurious reduction of production option(law_text) -> law_text ## expected some law text or code block @@ -1312,7 +1313,7 @@ source_file: BEGIN_CODE SCOPE UIDENT UNDER_CONDITION LET YEAR ## ## Ends in an error in state: 54. ## -## expression -> LET . lident DEFINED_AS expression IN expression [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RPAREN RBRACKET RBRACE PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER LABEL IS INCREASING IN GREATER_EQUAL GREATER FOR EXCEPTION EQUAL END_CODE ELSE DOT DIV DEFINITION DECREASING DECLARATION DATE CONTAINS CONSEQUENCE COMMA COLON ASSERTION AND ALT ] +## expression -> LET . separated_nonempty_list(COMMA,lident) DEFINED_AS expression IN expression [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RPAREN RBRACKET RBRACE PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER LABEL IS INCREASING IN GREATER_EQUAL GREATER FOR EXCEPTION EQUAL END_CODE ELSE DOT DIV DEFINITION DECREASING DECLARATION DATE CONTAINS CONSEQUENCE COMMA COLON ASSERTION AND ALT ] ## ## The known suffix of the stack is as follows: ## LET @@ -1320,26 +1321,14 @@ source_file: BEGIN_CODE SCOPE UIDENT UNDER_CONDITION LET YEAR expected 'var equals expression' after 'let' -source_file: BEGIN_CODE SCOPE UIDENT UNDER_CONDITION LET LIDENT YEAR -## -## Ends in an error in state: 55. -## -## expression -> LET lident . DEFINED_AS expression IN expression [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RPAREN RBRACKET RBRACE PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER LABEL IS INCREASING IN GREATER_EQUAL GREATER FOR EXCEPTION EQUAL END_CODE ELSE DOT DIV DEFINITION DECREASING DECLARATION DATE CONTAINS CONSEQUENCE COMMA COLON ASSERTION AND ALT ] -## -## The known suffix of the stack is as follows: -## LET lident -## - -expected 'equals expression' after 'let' - source_file: BEGIN_CODE SCOPE UIDENT UNDER_CONDITION LET LIDENT DEFINED_AS YEAR ## ## Ends in an error in state: 56. ## -## expression -> LET lident DEFINED_AS . expression IN expression [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RPAREN RBRACKET RBRACE PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER LABEL IS INCREASING IN GREATER_EQUAL GREATER FOR EXCEPTION EQUAL END_CODE ELSE DOT DIV DEFINITION DECREASING DECLARATION DATE CONTAINS CONSEQUENCE COMMA COLON ASSERTION AND ALT ] +## expression -> LET separated_nonempty_list(COMMA,lident) DEFINED_AS . expression IN expression [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RPAREN RBRACKET RBRACE PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER LABEL IS INCREASING IN GREATER_EQUAL GREATER FOR EXCEPTION EQUAL END_CODE ELSE DOT DIV DEFINITION DECREASING DECLARATION DATE CONTAINS CONSEQUENCE COMMA COLON ASSERTION AND ALT ] ## ## The known suffix of the stack is as follows: -## LET lident DEFINED_AS +## LET separated_nonempty_list(COMMA,lident) DEFINED_AS ## expected an expression @@ -2959,11 +2948,11 @@ source_file: BEGIN_CODE SCOPE UIDENT UNDER_CONDITION LET LIDENT DEFINED_AS FALSE ## expression -> expression . AND expression [ XOR WITH PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER IN GREATER_EQUAL GREATER FOR EQUAL DOT DIV CONTAINS AND ] ## expression -> expression . OR expression [ XOR WITH PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER IN GREATER_EQUAL GREATER FOR EQUAL DOT DIV CONTAINS AND ] ## expression -> expression . XOR expression [ XOR WITH PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER IN GREATER_EQUAL GREATER FOR EQUAL DOT DIV CONTAINS AND ] -## expression -> LET lident DEFINED_AS expression . IN expression [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RPAREN RBRACKET RBRACE PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER LABEL IS INCREASING IN GREATER_EQUAL GREATER FOR EXCEPTION EQUAL END_CODE ELSE DOT DIV DEFINITION DECREASING DECLARATION DATE CONTAINS CONSEQUENCE COMMA COLON ASSERTION AND ALT ] +## expression -> LET separated_nonempty_list(COMMA,lident) DEFINED_AS expression . IN expression [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RPAREN RBRACKET RBRACE PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER LABEL IS INCREASING IN GREATER_EQUAL GREATER FOR EXCEPTION EQUAL END_CODE ELSE DOT DIV DEFINITION DECREASING DECLARATION DATE CONTAINS CONSEQUENCE COMMA COLON ASSERTION AND ALT ] ## expression -> expression . FOR lident AMONG expression SUCH THAT expression [ XOR WITH PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER IN GREATER_EQUAL GREATER FOR EQUAL DOT DIV CONTAINS AND ] ## ## The known suffix of the stack is as follows: -## LET lident DEFINED_AS expression +## LET separated_nonempty_list(COMMA,lident) DEFINED_AS expression ## expected the keyword 'in' @@ -2972,10 +2961,10 @@ source_file: BEGIN_CODE SCOPE UIDENT UNDER_CONDITION LET LIDENT DEFINED_AS UIDEN ## ## Ends in an error in state: 178. ## -## expression -> LET lident DEFINED_AS expression IN . expression [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RPAREN RBRACKET RBRACE PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER LABEL IS INCREASING IN GREATER_EQUAL GREATER FOR EXCEPTION EQUAL END_CODE ELSE DOT DIV DEFINITION DECREASING DECLARATION DATE CONTAINS CONSEQUENCE COMMA COLON ASSERTION AND ALT ] +## expression -> LET separated_nonempty_list(COMMA,lident) DEFINED_AS expression IN . expression [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RPAREN RBRACKET RBRACE PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER LABEL IS INCREASING IN GREATER_EQUAL GREATER FOR EXCEPTION EQUAL END_CODE ELSE DOT DIV DEFINITION DECREASING DECLARATION DATE CONTAINS CONSEQUENCE COMMA COLON ASSERTION AND ALT ] ## ## The known suffix of the stack is as follows: -## LET lident DEFINED_AS expression IN +## LET separated_nonempty_list(COMMA,lident) DEFINED_AS expression IN ## expected an expression @@ -3003,18 +2992,18 @@ source_file: BEGIN_CODE SCOPE UIDENT UNDER_CONDITION LET LIDENT DEFINED_AS UIDEN ## expression -> expression . AND expression [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RPAREN RBRACKET RBRACE PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER LABEL IS INCREASING IN GREATER_EQUAL GREATER FOR EXCEPTION EQUAL END_CODE ELSE DOT DIV DEFINITION DECREASING DECLARATION DATE CONTAINS CONSEQUENCE COMMA COLON ASSERTION AND ALT ] ## expression -> expression . OR expression [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RPAREN RBRACKET RBRACE PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER LABEL IS INCREASING IN GREATER_EQUAL GREATER FOR EXCEPTION EQUAL END_CODE ELSE DOT DIV DEFINITION DECREASING DECLARATION DATE CONTAINS CONSEQUENCE COMMA COLON ASSERTION AND ALT ] ## expression -> expression . XOR expression [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RPAREN RBRACKET RBRACE PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER LABEL IS INCREASING IN GREATER_EQUAL GREATER FOR EXCEPTION EQUAL END_CODE ELSE DOT DIV DEFINITION DECREASING DECLARATION DATE CONTAINS CONSEQUENCE COMMA COLON ASSERTION AND ALT ] -## expression -> LET lident DEFINED_AS expression IN expression . [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RPAREN RBRACKET RBRACE PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER LABEL IS INCREASING IN GREATER_EQUAL GREATER FOR EXCEPTION EQUAL END_CODE ELSE DOT DIV DEFINITION DECREASING DECLARATION DATE CONTAINS CONSEQUENCE COMMA COLON ASSERTION AND ALT ] +## expression -> LET separated_nonempty_list(COMMA,lident) DEFINED_AS expression IN expression . [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RPAREN RBRACKET RBRACE PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER LABEL IS INCREASING IN GREATER_EQUAL GREATER FOR EXCEPTION EQUAL END_CODE ELSE DOT DIV DEFINITION DECREASING DECLARATION DATE CONTAINS CONSEQUENCE COMMA COLON ASSERTION AND ALT ] ## expression -> expression . FOR lident AMONG expression SUCH THAT expression [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RPAREN RBRACKET RBRACE PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER LABEL IS INCREASING IN GREATER_EQUAL GREATER FOR EXCEPTION EQUAL END_CODE ELSE DOT DIV DEFINITION DECREASING DECLARATION DATE CONTAINS CONSEQUENCE COMMA COLON ASSERTION AND ALT ] ## ## The known suffix of the stack is as follows: -## LET lident DEFINED_AS expression IN expression +## LET separated_nonempty_list(COMMA,lident) DEFINED_AS expression IN expression ## expected a binary operator continuing the expression, or a keyword ending the expression and starting the next item source_file: BEGIN_CODE SCOPE UIDENT UNDER_CONDITION MATCH FALSE YEAR ## -## Ends in an error in state: 182. +## Ends in an error in state: 188. ## ## expression -> expression . DOT qlident [ XOR WITH PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER GREATER_EQUAL GREATER FOR EQUAL DOT DIV CONTAINS AND ] ## expression -> expression . OF funcall_args [ XOR WITH PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER GREATER_EQUAL GREATER FOR EQUAL DOT DIV CONTAINS AND ] @@ -3046,7 +3035,7 @@ expected 'with pattern -- : ...' source_file: BEGIN_CODE SCOPE UIDENT UNDER_CONDITION MATCH UIDENT WITH ALT WILDCARD YEAR ## -## Ends in an error in state: 185. +## Ends in an error in state: 191. ## ## match_arm -> WILDCARD . COLON expression [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RPAREN RBRACKET RBRACE PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER LABEL IS INCREASING IN GREATER_EQUAL GREATER FOR EXCEPTION EQUAL END_CODE ELSE DOT DIV DEFINITION DECREASING DECLARATION DATE CONTAINS CONSEQUENCE COMMA COLON ASSERTION AND ALT ] ## @@ -3058,7 +3047,7 @@ expected ':' followed by an expression source_file: BEGIN_CODE SCOPE UIDENT UNDER_CONDITION MATCH UIDENT WITH ALT WILDCARD COLON YEAR ## -## Ends in an error in state: 186. +## Ends in an error in state: 192. ## ## match_arm -> WILDCARD COLON . expression [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RPAREN RBRACKET RBRACE PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER LABEL IS INCREASING IN GREATER_EQUAL GREATER FOR EXCEPTION EQUAL END_CODE ELSE DOT DIV DEFINITION DECREASING DECLARATION DATE CONTAINS CONSEQUENCE COMMA COLON ASSERTION AND ALT ] ## @@ -3070,7 +3059,7 @@ expected an expression source_file: BEGIN_CODE SCOPE UIDENT UNDER_CONDITION MATCH UIDENT WITH ALT WILDCARD COLON FALSE YEAR ## -## Ends in an error in state: 187. +## Ends in an error in state: 193. ## ## expression -> expression . DOT qlident [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RPAREN RBRACKET RBRACE PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER LABEL IS INCREASING IN GREATER_EQUAL GREATER FOR EXCEPTION EQUAL END_CODE ELSE DOT DIV DEFINITION DECREASING DECLARATION DATE CONTAINS CONSEQUENCE COMMA COLON ASSERTION AND ALT ] ## expression -> expression . OF funcall_args [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RPAREN RBRACKET RBRACE PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER LABEL IS INCREASING IN GREATER_EQUAL GREATER FOR EXCEPTION EQUAL END_CODE ELSE DOT DIV DEFINITION DECREASING DECLARATION DATE CONTAINS CONSEQUENCE COMMA COLON ASSERTION AND ALT ] @@ -3102,7 +3091,7 @@ expected a binary operator continuing the expression, or a keyword ending the ex source_file: BEGIN_CODE SCOPE UIDENT UNDER_CONDITION MATCH UIDENT WITH ALT UIDENT XOR ## -## Ends in an error in state: 190. +## Ends in an error in state: 196. ## ## match_arm -> constructor_binding . COLON expression [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RPAREN RBRACKET RBRACE PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER LABEL IS INCREASING IN GREATER_EQUAL GREATER FOR EXCEPTION EQUAL END_CODE ELSE DOT DIV DEFINITION DECREASING DECLARATION DATE CONTAINS CONSEQUENCE COMMA COLON ASSERTION AND ALT ] ## @@ -3121,7 +3110,7 @@ expected a colon followed by an expression, as in '-- Case : ' source_file: BEGIN_CODE SCOPE UIDENT UNDER_CONDITION MATCH UIDENT WITH ALT UIDENT COLON YEAR ## -## Ends in an error in state: 191. +## Ends in an error in state: 197. ## ## match_arm -> constructor_binding COLON . expression [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RPAREN RBRACKET RBRACE PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER LABEL IS INCREASING IN GREATER_EQUAL GREATER FOR EXCEPTION EQUAL END_CODE ELSE DOT DIV DEFINITION DECREASING DECLARATION DATE CONTAINS CONSEQUENCE COMMA COLON ASSERTION AND ALT ] ## @@ -3133,7 +3122,7 @@ expected an expression source_file: BEGIN_CODE SCOPE UIDENT UNDER_CONDITION MATCH UIDENT WITH ALT UIDENT COLON FALSE YEAR ## -## Ends in an error in state: 192. +## Ends in an error in state: 198. ## ## expression -> expression . DOT qlident [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RPAREN RBRACKET RBRACE PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER LABEL IS INCREASING IN GREATER_EQUAL GREATER FOR EXCEPTION EQUAL END_CODE ELSE DOT DIV DEFINITION DECREASING DECLARATION DATE CONTAINS CONSEQUENCE COMMA COLON ASSERTION AND ALT ] ## expression -> expression . OF funcall_args [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RPAREN RBRACKET RBRACE PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER LABEL IS INCREASING IN GREATER_EQUAL GREATER FOR EXCEPTION EQUAL END_CODE ELSE DOT DIV DEFINITION DECREASING DECLARATION DATE CONTAINS CONSEQUENCE COMMA COLON ASSERTION AND ALT ] @@ -3166,7 +3155,7 @@ expected a binary operator, or the next case in the form '-- NextCase : expression . DOT qlident [ XOR WITH PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER GREATER_EQUAL GREATER FOR EQUAL DOT DIV CONTAINS AND ] ## expression -> expression . OF funcall_args [ XOR WITH PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER GREATER_EQUAL GREATER FOR EQUAL DOT DIV CONTAINS AND ] @@ -3198,7 +3187,7 @@ expected 'or if list empty then ' source_file: BEGIN_CODE SCOPE UIDENT UNDER_CONDITION MAXIMUM OF UIDENT OR YEAR ## -## Ends in an error in state: 195. +## Ends in an error in state: 201. ## ## expression -> MAXIMUM OF expression OR . IF LIST_EMPTY THEN expression [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RPAREN RBRACKET RBRACE PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER LABEL IS INCREASING IN GREATER_EQUAL GREATER FOR EXCEPTION EQUAL END_CODE ELSE DOT DIV DEFINITION DECREASING DECLARATION DATE CONTAINS CONSEQUENCE COMMA COLON ASSERTION AND ALT ] ## expression -> expression OR . expression [ XOR WITH PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER GREATER_EQUAL GREATER FOR EQUAL DOT DIV CONTAINS AND ] @@ -3211,7 +3200,7 @@ expected the form 'or if list empty then ' source_file: BEGIN_CODE SCOPE UIDENT UNDER_CONDITION MAXIMUM OF UIDENT OR IF YEAR ## -## Ends in an error in state: 196. +## Ends in an error in state: 202. ## ## expression -> MAXIMUM OF expression OR IF . LIST_EMPTY THEN expression [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RPAREN RBRACKET RBRACE PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER LABEL IS INCREASING IN GREATER_EQUAL GREATER FOR EXCEPTION EQUAL END_CODE ELSE DOT DIV DEFINITION DECREASING DECLARATION DATE CONTAINS CONSEQUENCE COMMA COLON ASSERTION AND ALT ] ## expression -> IF . expression THEN expression ELSE expression [ XOR WITH PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER GREATER_EQUAL GREATER FOR EQUAL DOT DIV CONTAINS AND ] @@ -3224,7 +3213,7 @@ expected the form 'or if list empty then ' source_file: BEGIN_CODE SCOPE UIDENT UNDER_CONDITION MAXIMUM OF UIDENT OR IF LIST_EMPTY YEAR ## -## Ends in an error in state: 197. +## Ends in an error in state: 203. ## ## expression -> MAXIMUM OF expression OR IF LIST_EMPTY . THEN expression [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RPAREN RBRACKET RBRACE PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER LABEL IS INCREASING IN GREATER_EQUAL GREATER FOR EXCEPTION EQUAL END_CODE ELSE DOT DIV DEFINITION DECREASING DECLARATION DATE CONTAINS CONSEQUENCE COMMA COLON ASSERTION AND ALT ] ## @@ -3236,7 +3225,7 @@ expected the form 'or if list empty then ' source_file: BEGIN_CODE SCOPE UIDENT UNDER_CONDITION MAXIMUM OF UIDENT OR IF LIST_EMPTY THEN YEAR ## -## Ends in an error in state: 198. +## Ends in an error in state: 204. ## ## expression -> MAXIMUM OF expression OR IF LIST_EMPTY THEN . expression [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RPAREN RBRACKET RBRACE PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER LABEL IS INCREASING IN GREATER_EQUAL GREATER FOR EXCEPTION EQUAL END_CODE ELSE DOT DIV DEFINITION DECREASING DECLARATION DATE CONTAINS CONSEQUENCE COMMA COLON ASSERTION AND ALT ] ## @@ -3248,7 +3237,7 @@ expected an expression, following the form 'or if list empty then ' source_file: BEGIN_CODE SCOPE UIDENT UNDER_CONDITION MAXIMUM OF UIDENT OR IF LIST_EMPTY THEN FALSE YEAR ## -## Ends in an error in state: 199. +## Ends in an error in state: 205. ## ## expression -> expression . DOT qlident [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RPAREN RBRACKET RBRACE PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER LABEL IS INCREASING IN GREATER_EQUAL GREATER FOR EXCEPTION EQUAL END_CODE ELSE DOT DIV DEFINITION DECREASING DECLARATION DATE CONTAINS CONSEQUENCE COMMA COLON ASSERTION AND ALT ] ## expression -> expression . OF funcall_args [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RPAREN RBRACKET RBRACE PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER LABEL IS INCREASING IN GREATER_EQUAL GREATER FOR EXCEPTION EQUAL END_CODE ELSE DOT DIV DEFINITION DECREASING DECLARATION DATE CONTAINS CONSEQUENCE COMMA COLON ASSERTION AND ALT ] @@ -3280,7 +3269,7 @@ expected a binary operator continuing the expression, or a keyword ending the ex source_file: BEGIN_CODE SCOPE UIDENT UNDER_CONDITION MINIMUM OF FALSE YEAR ## -## Ends in an error in state: 200. +## Ends in an error in state: 206. ## ## expression -> expression . DOT qlident [ XOR WITH PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER GREATER_EQUAL GREATER FOR EQUAL DOT DIV CONTAINS AND ] ## expression -> expression . OF funcall_args [ XOR WITH PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER GREATER_EQUAL GREATER FOR EQUAL DOT DIV CONTAINS AND ] @@ -3312,7 +3301,7 @@ expected 'or if list empty then ' source_file: BEGIN_CODE SCOPE UIDENT UNDER_CONDITION MINIMUM OF UIDENT OR YEAR ## -## Ends in an error in state: 201. +## Ends in an error in state: 207. ## ## expression -> MINIMUM OF expression OR . IF LIST_EMPTY THEN expression [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RPAREN RBRACKET RBRACE PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER LABEL IS INCREASING IN GREATER_EQUAL GREATER FOR EXCEPTION EQUAL END_CODE ELSE DOT DIV DEFINITION DECREASING DECLARATION DATE CONTAINS CONSEQUENCE COMMA COLON ASSERTION AND ALT ] ## expression -> expression OR . expression [ XOR WITH PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER GREATER_EQUAL GREATER FOR EQUAL DOT DIV CONTAINS AND ] @@ -3325,7 +3314,7 @@ expected the form 'or if list empty then ' source_file: BEGIN_CODE SCOPE UIDENT UNDER_CONDITION MINIMUM OF UIDENT OR IF YEAR ## -## Ends in an error in state: 202. +## Ends in an error in state: 208. ## ## expression -> MINIMUM OF expression OR IF . LIST_EMPTY THEN expression [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RPAREN RBRACKET RBRACE PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER LABEL IS INCREASING IN GREATER_EQUAL GREATER FOR EXCEPTION EQUAL END_CODE ELSE DOT DIV DEFINITION DECREASING DECLARATION DATE CONTAINS CONSEQUENCE COMMA COLON ASSERTION AND ALT ] ## expression -> IF . expression THEN expression ELSE expression [ XOR WITH PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER GREATER_EQUAL GREATER FOR EQUAL DOT DIV CONTAINS AND ] @@ -3338,7 +3327,7 @@ expected the form 'or if list empty then ' source_file: BEGIN_CODE SCOPE UIDENT UNDER_CONDITION MINIMUM OF UIDENT OR IF LIST_EMPTY YEAR ## -## Ends in an error in state: 203. +## Ends in an error in state: 209. ## ## expression -> MINIMUM OF expression OR IF LIST_EMPTY . THEN expression [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RPAREN RBRACKET RBRACE PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER LABEL IS INCREASING IN GREATER_EQUAL GREATER FOR EXCEPTION EQUAL END_CODE ELSE DOT DIV DEFINITION DECREASING DECLARATION DATE CONTAINS CONSEQUENCE COMMA COLON ASSERTION AND ALT ] ## @@ -3350,7 +3339,7 @@ expected the form 'or if list empty then ' source_file: BEGIN_CODE SCOPE UIDENT UNDER_CONDITION MINIMUM OF UIDENT OR IF LIST_EMPTY THEN YEAR ## -## Ends in an error in state: 204. +## Ends in an error in state: 210. ## ## expression -> MINIMUM OF expression OR IF LIST_EMPTY THEN . expression [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RPAREN RBRACKET RBRACE PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER LABEL IS INCREASING IN GREATER_EQUAL GREATER FOR EXCEPTION EQUAL END_CODE ELSE DOT DIV DEFINITION DECREASING DECLARATION DATE CONTAINS CONSEQUENCE COMMA COLON ASSERTION AND ALT ] ## @@ -3363,7 +3352,7 @@ expected an expression, following the form 'or if list empty then source_file: BEGIN_CODE SCOPE UIDENT UNDER_CONDITION MINIMUM OF UIDENT OR IF LIST_EMPTY THEN FALSE YEAR ## -## Ends in an error in state: 205. +## Ends in an error in state: 211. ## ## expression -> expression . DOT qlident [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RPAREN RBRACKET RBRACE PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER LABEL IS INCREASING IN GREATER_EQUAL GREATER FOR EXCEPTION EQUAL END_CODE ELSE DOT DIV DEFINITION DECREASING DECLARATION DATE CONTAINS CONSEQUENCE COMMA COLON ASSERTION AND ALT ] ## expression -> expression . OF funcall_args [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RPAREN RBRACKET RBRACE PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER LABEL IS INCREASING IN GREATER_EQUAL GREATER FOR EXCEPTION EQUAL END_CODE ELSE DOT DIV DEFINITION DECREASING DECLARATION DATE CONTAINS CONSEQUENCE COMMA COLON ASSERTION AND ALT ] @@ -3395,7 +3384,7 @@ expected a binary operator continuing the expression, or a keyword ending the ex source_file: BEGIN_CODE SCOPE UIDENT UNDER_CONDITION MINUS FALSE YEAR ## -## Ends in an error in state: 206. +## Ends in an error in state: 212. ## ## expression -> expression . DOT qlident [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RPAREN RBRACKET RBRACE PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER LABEL IS INCREASING IN GREATER_EQUAL GREATER FOR EXCEPTION EQUAL END_CODE ELSE DOT DIV DEFINITION DECREASING DECLARATION DATE CONTAINS CONSEQUENCE COMMA COLON ASSERTION AND ALT ] ## expression -> expression . OF funcall_args [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RPAREN RBRACKET RBRACE PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER LABEL IS INCREASING IN GREATER_EQUAL GREATER FOR EXCEPTION EQUAL END_CODE ELSE DOT DIV DEFINITION DECREASING DECLARATION DATE CONTAINS CONSEQUENCE COMMA COLON ASSERTION AND ALT ] @@ -3427,7 +3416,7 @@ expected a binary operator continuing the expression, or a keyword ending the ex source_file: BEGIN_CODE SCOPE UIDENT UNDER_CONDITION NOT FALSE YEAR ## -## Ends in an error in state: 207. +## Ends in an error in state: 213. ## ## expression -> expression . DOT qlident [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RPAREN RBRACKET RBRACE PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER LABEL IS INCREASING IN GREATER_EQUAL GREATER FOR EXCEPTION EQUAL END_CODE ELSE DOT DIV DEFINITION DECREASING DECLARATION DATE CONTAINS CONSEQUENCE COMMA COLON ASSERTION AND ALT ] ## expression -> expression . OF funcall_args [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RPAREN RBRACKET RBRACE PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER LABEL IS INCREASING IN GREATER_EQUAL GREATER FOR EXCEPTION EQUAL END_CODE ELSE DOT DIV DEFINITION DECREASING DECLARATION DATE CONTAINS CONSEQUENCE COMMA COLON ASSERTION AND ALT ] @@ -3459,7 +3448,7 @@ expected a binary operator continuing the expression, or a keyword ending the ex source_file: BEGIN_CODE SCOPE UIDENT UNDER_CONDITION UIDENT LBRACE ALT LIDENT COLON FALSE YEAR ## -## Ends in an error in state: 208. +## Ends in an error in state: 214. ## ## expression -> expression . DOT qlident [ XOR WITH RBRACE PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER GREATER_EQUAL GREATER FOR EQUAL DOT DIV CONTAINS AND ALT ] ## expression -> expression . OF funcall_args [ XOR WITH RBRACE PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER GREATER_EQUAL GREATER FOR EQUAL DOT DIV CONTAINS AND ALT ] @@ -3491,7 +3480,7 @@ expected another field in the form '-- : ', or a closing '}' br source_file: BEGIN_CODE SCOPE UIDENT UNDER_CONDITION SUM UIDENT OF FALSE YEAR ## -## Ends in an error in state: 212. +## Ends in an error in state: 218. ## ## expression -> expression . DOT qlident [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RPAREN RBRACKET RBRACE PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER LABEL IS INCREASING IN GREATER_EQUAL GREATER FOR EXCEPTION EQUAL END_CODE ELSE DOT DIV DEFINITION DECREASING DECLARATION DATE CONTAINS CONSEQUENCE COMMA COLON ASSERTION AND ALT ] ## expression -> expression . OF funcall_args [ XOR WITH WE_HAVE THEN SUCH SEMICOLON SCOPE RULE RPAREN RBRACKET RBRACE PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER LABEL IS INCREASING IN GREATER_EQUAL GREATER FOR EXCEPTION EQUAL END_CODE ELSE DOT DIV DEFINITION DECREASING DECLARATION DATE CONTAINS CONSEQUENCE COMMA COLON ASSERTION AND ALT ] @@ -3523,7 +3512,7 @@ expected a binary operator continuing the expression, or a keyword ending the ex source_file: BEGIN_CODE SCOPE UIDENT COLON ASSERTION VARIES LIDENT WITH_V FALSE YEAR ## -## Ends in an error in state: 230. +## Ends in an error in state: 236. ## ## assertion -> VARIES separated_nonempty_list(DOT,addpos(LIDENT)) WITH_V expression . option(addpos(variation_type)) [ SCOPE RULE LABEL EXCEPTION END_CODE DEFINITION DECLARATION DATE ASSERTION ] ## expression -> expression . DOT qlident [ XOR WITH SCOPE RULE PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER LABEL INCREASING GREATER_EQUAL GREATER FOR EXCEPTION EQUAL END_CODE DOT DIV DEFINITION DECREASING DECLARATION DATE CONTAINS ASSERTION AND ] @@ -3555,7 +3544,7 @@ expected a binary operator continuing the expression, or a keyword ending the ex source_file: BEGIN_CODE SCOPE UIDENT COLON ASSERTION UNDER_CONDITION UIDENT CONSEQUENCE YEAR ## -## Ends in an error in state: 240. +## Ends in an error in state: 246. ## ## assertion -> option(condition_consequence) . expression [ SCOPE RULE LABEL EXCEPTION END_CODE DEFINITION DECLARATION DATE ASSERTION ] ## @@ -3567,7 +3556,7 @@ expected either 'fulfilled' or 'not fulfilled' source_file: BEGIN_CODE SCOPE UIDENT COLON RULE LIDENT FILLED YEAR ## -## Ends in an error in state: 244. +## Ends in an error in state: 250. ## ## nonempty_list(scope_item) -> scope_item . [ SCOPE END_CODE DECLARATION ] ## nonempty_list(scope_item) -> scope_item . nonempty_list(scope_item) [ SCOPE END_CODE DECLARATION ] @@ -3580,7 +3569,7 @@ expected the next item in the scope, or the start of a new top-level decleration source_file: BEGIN_CODE SCOPE UIDENT COLON RULE LIDENT UNDER_CONDITION UIDENT CONSEQUENCE YEAR ## -## Ends in an error in state: 273. +## Ends in an error in state: 276. ## ## rule -> option(label) option(addpos(exception_to)) RULE rule_expr option(state) option(condition_consequence) . rule_consequence [ SCOPE RULE LABEL EXCEPTION END_CODE DEFINITION DECLARATION DATE ASSERTION ] ## @@ -3592,7 +3581,7 @@ expected either 'fulfilled' or 'not fulfilled' source_file: BEGIN_CODE SCOPE UIDENT COLON DEFINITION LIDENT STATE YEAR ## -## Ends in an error in state: 259. +## Ends in an error in state: 262. ## ## state -> STATE . lident [ UNDER_CONDITION STATE SCOPE OUTPUT NOT LIDENT INTERNAL INPUT FILLED END_CODE DEFINED_AS DECLARATION CONTEXT ] ## @@ -3604,7 +3593,7 @@ expected an identifier defining the name of the state source_file: BEGIN_CODE SCOPE UIDENT COLON RULE LIDENT STATE LIDENT YEAR ## -## Ends in an error in state: 272. +## Ends in an error in state: 275. ## ## rule -> option(label) option(addpos(exception_to)) RULE rule_expr option(state) . option(condition_consequence) rule_consequence [ SCOPE RULE LABEL EXCEPTION END_CODE DEFINITION DECLARATION DATE ASSERTION ] ## @@ -3616,7 +3605,7 @@ expected 'equals' then an expression defining the rule source_file: BEGIN_CODE SCOPE UIDENT COLON DEFINITION LIDENT STATE LIDENT YEAR ## -## Ends in an error in state: 262. +## Ends in an error in state: 265. ## ## definition -> option(label) option(exception_to) DEFINITION separated_nonempty_list(DOT,addpos(LIDENT)) option(addpos(definition_parameters)) option(state) . option(condition_consequence) DEFINED_AS expression [ SCOPE RULE LABEL EXCEPTION END_CODE DEFINITION DECLARATION DATE ASSERTION ] ## @@ -3628,7 +3617,7 @@ expected 'equals' then an expression defining the rule source_file: BEGIN_CODE SCOPE UIDENT COLON DEFINITION LIDENT UNDER_CONDITION UIDENT CONSEQUENCE YEAR ## -## Ends in an error in state: 263. +## Ends in an error in state: 266. ## ## definition -> option(label) option(exception_to) DEFINITION separated_nonempty_list(DOT,addpos(LIDENT)) option(addpos(definition_parameters)) option(state) option(condition_consequence) . DEFINED_AS expression [ SCOPE RULE LABEL EXCEPTION END_CODE DEFINITION DECLARATION DATE ASSERTION ] ## @@ -3640,7 +3629,7 @@ expected 'fulfilled' or 'not fulfilled' source_file: BEGIN_CODE SCOPE UIDENT COLON DEFINITION LIDENT DEFINED_AS FALSE YEAR ## -## Ends in an error in state: 265. +## Ends in an error in state: 268. ## ## definition -> option(label) option(exception_to) DEFINITION separated_nonempty_list(DOT,addpos(LIDENT)) option(addpos(definition_parameters)) option(state) option(condition_consequence) DEFINED_AS expression . [ SCOPE RULE LABEL EXCEPTION END_CODE DEFINITION DECLARATION DATE ASSERTION ] ## expression -> expression . DOT qlident [ XOR WITH SCOPE RULE PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER LABEL GREATER_EQUAL GREATER FOR EXCEPTION EQUAL END_CODE DOT DIV DEFINITION DECLARATION DATE CONTAINS ASSERTION AND ] @@ -3672,7 +3661,7 @@ expected a binary operator continuing the expression, or a keyword ending the ex source_file: BEGIN_CODE DECLARATION SCOPE UIDENT COLON CONTEXT YEAR ## -## Ends in an error in state: 317. +## Ends in an error in state: 326. ## ## scope_decl_item_attribute -> scope_decl_item_attribute_input . scope_decl_item_attribute_output [ LIDENT ] ## @@ -3684,7 +3673,7 @@ expected a variable name, optionally preceded by 'output' source_file: BEGIN_CODE DECLARATION SCOPE UIDENT COLON INTERNAL YEAR ## -## Ends in an error in state: 320. +## Ends in an error in state: 329. ## ## scope_decl_item -> scope_decl_item_attribute . lident CONTENT typ_data DEPENDS separated_nonempty_list(COMMA,var_content) list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ] ## scope_decl_item -> scope_decl_item_attribute . lident CONTENT typ_data DEPENDS LPAREN separated_nonempty_list(COMMA,var_content) RPAREN list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ] @@ -3701,7 +3690,7 @@ expected a variable name source_file: BEGIN_CODE DECLARATION SCOPE UIDENT COLON CONTEXT LIDENT YEAR ## -## Ends in an error in state: 321. +## Ends in an error in state: 330. ## ## scope_decl_item -> scope_decl_item_attribute lident . CONTENT typ_data DEPENDS separated_nonempty_list(COMMA,var_content) list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ] ## scope_decl_item -> scope_decl_item_attribute lident . CONTENT typ_data DEPENDS LPAREN separated_nonempty_list(COMMA,var_content) RPAREN list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ] @@ -3718,7 +3707,7 @@ expected either 'condition', or 'content' followed by the expected variable type source_file: BEGIN_CODE DECLARATION SCOPE UIDENT COLON CONTEXT LIDENT CONTENT YEAR ## -## Ends in an error in state: 322. +## Ends in an error in state: 331. ## ## scope_decl_item -> scope_decl_item_attribute lident CONTENT . typ_data DEPENDS separated_nonempty_list(COMMA,var_content) list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ] ## scope_decl_item -> scope_decl_item_attribute lident CONTENT . typ_data DEPENDS LPAREN separated_nonempty_list(COMMA,var_content) RPAREN list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ] @@ -3732,7 +3721,7 @@ expected a type source_file: BEGIN_CODE DECLARATION SCOPE UIDENT COLON CONTEXT LIDENT CONTENT BOOLEAN YEAR ## -## Ends in an error in state: 323. +## Ends in an error in state: 332. ## ## scope_decl_item -> scope_decl_item_attribute lident CONTENT typ_data . DEPENDS separated_nonempty_list(COMMA,var_content) list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ] ## scope_decl_item -> scope_decl_item_attribute lident CONTENT typ_data . DEPENDS LPAREN separated_nonempty_list(COMMA,var_content) RPAREN list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ] @@ -3747,7 +3736,7 @@ for the scope source_file: BEGIN_CODE DECLARATION SCOPE UIDENT COLON CONTEXT LIDENT CONTENT UIDENT DEPENDS YEAR ## -## Ends in an error in state: 324. +## Ends in an error in state: 333. ## ## scope_decl_item -> scope_decl_item_attribute lident CONTENT typ_data DEPENDS . separated_nonempty_list(COMMA,var_content) list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ] ## scope_decl_item -> scope_decl_item_attribute lident CONTENT typ_data DEPENDS . LPAREN separated_nonempty_list(COMMA,var_content) RPAREN list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ] @@ -3760,7 +3749,7 @@ expected a name and type for the dependency of this definition (' content source_file: BEGIN_CODE DECLARATION SCOPE UIDENT COLON CONTEXT LIDENT CONTENT UIDENT DEPENDS LPAREN YEAR ## -## Ends in an error in state: 325. +## Ends in an error in state: 334. ## ## scope_decl_item -> scope_decl_item_attribute lident CONTENT typ_data DEPENDS LPAREN . separated_nonempty_list(COMMA,var_content) RPAREN list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ] ## @@ -3772,7 +3761,7 @@ expected a name and type for the dependency of this definition (' content source_file: BEGIN_CODE DECLARATION SCOPE UIDENT COLON CONTEXT LIDENT CONTENT UIDENT DEPENDS LPAREN LIDENT CONTENT UIDENT STATE ## -## Ends in an error in state: 326. +## Ends in an error in state: 335. ## ## scope_decl_item -> scope_decl_item_attribute lident CONTENT typ_data DEPENDS LPAREN separated_nonempty_list(COMMA,var_content) . RPAREN list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ] ## @@ -3785,15 +3774,15 @@ source_file: BEGIN_CODE DECLARATION SCOPE UIDENT COLON CONTEXT LIDENT CONTENT UI ## may provide an INCOMPLETE view of the future (what was expected next). ## In state 21, spurious reduction of production quident -> UIDENT ## In state 30, spurious reduction of production primitive_typ -> quident -## In state 292, spurious reduction of production typ_data -> primitive_typ -## In state 303, spurious reduction of production separated_nonempty_list(COMMA,var_content) -> lident CONTENT typ_data +## In state 296, spurious reduction of production typ_data -> primitive_typ +## In state 312, spurious reduction of production separated_nonempty_list(COMMA,var_content) -> lident CONTENT typ_data ## expected a closing paren, or a comma followed by another argument specification source_file: BEGIN_CODE DECLARATION SCOPE UIDENT COLON CONTEXT LIDENT CONTENT UIDENT DEPENDS LPAREN LIDENT CONTENT UIDENT RPAREN YEAR ## -## Ends in an error in state: 327. +## Ends in an error in state: 336. ## ## scope_decl_item -> scope_decl_item_attribute lident CONTENT typ_data DEPENDS LPAREN separated_nonempty_list(COMMA,var_content) RPAREN . list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ] ## @@ -3805,7 +3794,7 @@ expected a 'state' declaration for the preceding declaration, or the next declar source_file: BEGIN_CODE DECLARATION SCOPE UIDENT COLON CONTEXT LIDENT CONDITION STATE LIDENT YEAR ## -## Ends in an error in state: 328. +## Ends in an error in state: 337. ## ## list(state) -> state . list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ] ## @@ -3818,7 +3807,7 @@ declaration for the scope source_file: BEGIN_CODE DECLARATION SCOPE UIDENT COLON CONTEXT LIDENT CONTENT UIDENT DEPENDS LIDENT CONTENT UIDENT DEFINED_AS ## -## Ends in an error in state: 331. +## Ends in an error in state: 340. ## ## scope_decl_item -> scope_decl_item_attribute lident CONTENT typ_data DEPENDS separated_nonempty_list(COMMA,var_content) . list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ] ## @@ -3831,15 +3820,15 @@ source_file: BEGIN_CODE DECLARATION SCOPE UIDENT COLON CONTEXT LIDENT CONTENT UI ## may provide an INCOMPLETE view of the future (what was expected next). ## In state 21, spurious reduction of production quident -> UIDENT ## In state 30, spurious reduction of production primitive_typ -> quident -## In state 292, spurious reduction of production typ_data -> primitive_typ -## In state 303, spurious reduction of production separated_nonempty_list(COMMA,var_content) -> lident CONTENT typ_data +## In state 296, spurious reduction of production typ_data -> primitive_typ +## In state 312, spurious reduction of production separated_nonempty_list(COMMA,var_content) -> lident CONTENT typ_data ## expected the next declaration for the scope source_file: BEGIN_CODE DECLARATION SCOPE UIDENT COLON CONTEXT LIDENT CONDITION YEAR ## -## Ends in an error in state: 334. +## Ends in an error in state: 343. ## ## scope_decl_item -> scope_decl_item_attribute lident CONDITION . DEPENDS separated_nonempty_list(COMMA,var_content) list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ] ## scope_decl_item -> scope_decl_item_attribute lident CONDITION . DEPENDS LPAREN separated_nonempty_list(COMMA,var_content) RPAREN list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ] @@ -3853,7 +3842,7 @@ expected the next declaration for the scope source_file: BEGIN_CODE DECLARATION SCOPE UIDENT COLON CONTEXT LIDENT CONDITION DEPENDS YEAR ## -## Ends in an error in state: 335. +## Ends in an error in state: 344. ## ## scope_decl_item -> scope_decl_item_attribute lident CONDITION DEPENDS . separated_nonempty_list(COMMA,var_content) list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ] ## scope_decl_item -> scope_decl_item_attribute lident CONDITION DEPENDS . LPAREN separated_nonempty_list(COMMA,var_content) RPAREN list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ] @@ -3866,7 +3855,7 @@ expected the form 'depends on content ' source_file: BEGIN_CODE DECLARATION SCOPE UIDENT COLON CONTEXT LIDENT CONDITION DEPENDS LPAREN YEAR ## -## Ends in an error in state: 336. +## Ends in an error in state: 345. ## ## scope_decl_item -> scope_decl_item_attribute lident CONDITION DEPENDS LPAREN . separated_nonempty_list(COMMA,var_content) RPAREN list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ] ## @@ -3878,7 +3867,7 @@ expected the form 'depends on ( content [, content source_file: BEGIN_CODE DECLARATION SCOPE UIDENT COLON CONTEXT LIDENT CONDITION DEPENDS LPAREN LIDENT CONTENT UIDENT STATE ## -## Ends in an error in state: 337. +## Ends in an error in state: 346. ## ## scope_decl_item -> scope_decl_item_attribute lident CONDITION DEPENDS LPAREN separated_nonempty_list(COMMA,var_content) . RPAREN list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ] ## @@ -3891,15 +3880,15 @@ source_file: BEGIN_CODE DECLARATION SCOPE UIDENT COLON CONTEXT LIDENT CONDITION ## may provide an INCOMPLETE view of the future (what was expected next). ## In state 21, spurious reduction of production quident -> UIDENT ## In state 30, spurious reduction of production primitive_typ -> quident -## In state 292, spurious reduction of production typ_data -> primitive_typ -## In state 303, spurious reduction of production separated_nonempty_list(COMMA,var_content) -> lident CONTENT typ_data +## In state 296, spurious reduction of production typ_data -> primitive_typ +## In state 312, spurious reduction of production separated_nonempty_list(COMMA,var_content) -> lident CONTENT typ_data ## expected a closing paren, or a comma followed by another argument declaration (', content ') source_file: BEGIN_CODE DECLARATION SCOPE UIDENT COLON CONTEXT LIDENT CONDITION DEPENDS LPAREN LIDENT CONTENT UIDENT RPAREN YEAR ## -## Ends in an error in state: 338. +## Ends in an error in state: 347. ## ## scope_decl_item -> scope_decl_item_attribute lident CONDITION DEPENDS LPAREN separated_nonempty_list(COMMA,var_content) RPAREN . list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ] ## @@ -3911,7 +3900,7 @@ expected the next definition in scope source_file: BEGIN_CODE DECLARATION SCOPE UIDENT COLON LIDENT YEAR ## -## Ends in an error in state: 345. +## Ends in an error in state: 354. ## ## scope_decl_item -> lident . SCOPE quident [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ] ## @@ -3923,7 +3912,7 @@ expected the form ' scope ', or a scope variable declaration source_file: BEGIN_CODE DECLARATION SCOPE UIDENT COLON LIDENT SCOPE YEAR ## -## Ends in an error in state: 346. +## Ends in an error in state: 355. ## ## scope_decl_item -> lident SCOPE . quident [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ] ## @@ -3935,7 +3924,7 @@ expected a scope name source_file: BEGIN_CODE DECLARATION LIDENT YEAR ## -## Ends in an error in state: 360. +## Ends in an error in state: 369. ## ## code_item -> DECLARATION lident . CONTENT typ_data DEPENDS separated_nonempty_list(COMMA,var_content) option(opt_def) [ SCOPE END_CODE DECLARATION ] ## code_item -> DECLARATION lident . CONTENT typ_data DEPENDS LPAREN separated_nonempty_list(COMMA,var_content) RPAREN option(opt_def) [ SCOPE END_CODE DECLARATION ] @@ -3949,7 +3938,7 @@ expected 'content ' source_file: BEGIN_CODE DECLARATION LIDENT CONTENT YEAR ## -## Ends in an error in state: 361. +## Ends in an error in state: 370. ## ## code_item -> DECLARATION lident CONTENT . typ_data DEPENDS separated_nonempty_list(COMMA,var_content) option(opt_def) [ SCOPE END_CODE DECLARATION ] ## code_item -> DECLARATION lident CONTENT . typ_data DEPENDS LPAREN separated_nonempty_list(COMMA,var_content) RPAREN option(opt_def) [ SCOPE END_CODE DECLARATION ] @@ -3963,7 +3952,7 @@ expected a type source_file: BEGIN_CODE DECLARATION LIDENT CONTENT BOOLEAN YEAR ## -## Ends in an error in state: 362. +## Ends in an error in state: 371. ## ## code_item -> DECLARATION lident CONTENT typ_data . DEPENDS separated_nonempty_list(COMMA,var_content) option(opt_def) [ SCOPE END_CODE DECLARATION ] ## code_item -> DECLARATION lident CONTENT typ_data . DEPENDS LPAREN separated_nonempty_list(COMMA,var_content) RPAREN option(opt_def) [ SCOPE END_CODE DECLARATION ] @@ -3978,7 +3967,7 @@ expected 'equals ', optionally preceded by 'depends on content source_file: BEGIN_CODE DECLARATION LIDENT CONTENT UIDENT DEPENDS YEAR ## -## Ends in an error in state: 363. +## Ends in an error in state: 372. ## ## code_item -> DECLARATION lident CONTENT typ_data DEPENDS . separated_nonempty_list(COMMA,var_content) option(opt_def) [ SCOPE END_CODE DECLARATION ] ## code_item -> DECLARATION lident CONTENT typ_data DEPENDS . LPAREN separated_nonempty_list(COMMA,var_content) RPAREN option(opt_def) [ SCOPE END_CODE DECLARATION ] @@ -3991,7 +3980,7 @@ expected a variable name, following the form 'depends on content ' source_file: BEGIN_CODE DECLARATION LIDENT CONTENT UIDENT DEPENDS LPAREN YEAR ## -## Ends in an error in state: 364. +## Ends in an error in state: 373. ## ## code_item -> DECLARATION lident CONTENT typ_data DEPENDS LPAREN . separated_nonempty_list(COMMA,var_content) RPAREN option(opt_def) [ SCOPE END_CODE DECLARATION ] ## @@ -4003,7 +3992,7 @@ expected a variable name, following the form 'depends on ( content , source_file: BEGIN_CODE DECLARATION LIDENT CONTENT UIDENT DEPENDS LPAREN LIDENT CONTENT UIDENT DEFINED_AS ## -## Ends in an error in state: 365. +## Ends in an error in state: 374. ## ## code_item -> DECLARATION lident CONTENT typ_data DEPENDS LPAREN separated_nonempty_list(COMMA,var_content) . RPAREN option(opt_def) [ SCOPE END_CODE DECLARATION ] ## @@ -4016,8 +4005,8 @@ source_file: BEGIN_CODE DECLARATION LIDENT CONTENT UIDENT DEPENDS LPAREN LIDENT ## may provide an INCOMPLETE view of the future (what was expected next). ## In state 21, spurious reduction of production quident -> UIDENT ## In state 30, spurious reduction of production primitive_typ -> quident -## In state 292, spurious reduction of production typ_data -> primitive_typ -## In state 303, spurious reduction of production separated_nonempty_list(COMMA,var_content) -> lident CONTENT typ_data +## In state 296, spurious reduction of production typ_data -> primitive_typ +## In state 312, spurious reduction of production separated_nonempty_list(COMMA,var_content) -> lident CONTENT typ_data ## expected ')', or ',' followed by another argument declaration in the form ' @@ -4025,7 +4014,7 @@ content ' source_file: BEGIN_CODE DECLARATION LIDENT CONTENT UIDENT DEPENDS LPAREN LIDENT CONTENT UIDENT RPAREN YEAR ## -## Ends in an error in state: 366. +## Ends in an error in state: 375. ## ## code_item -> DECLARATION lident CONTENT typ_data DEPENDS LPAREN separated_nonempty_list(COMMA,var_content) RPAREN . option(opt_def) [ SCOPE END_CODE DECLARATION ] ## @@ -4037,7 +4026,7 @@ expected 'equals ' source_file: BEGIN_CODE DECLARATION LIDENT CONTENT UIDENT DEPENDS LPAREN LIDENT CONTENT UIDENT RPAREN DEFINED_AS YEAR ## -## Ends in an error in state: 367. +## Ends in an error in state: 376. ## ## option(opt_def) -> DEFINED_AS . expression [ SCOPE END_CODE DECLARATION ] ## @@ -4049,7 +4038,7 @@ expected an expression source_file: BEGIN_CODE DECLARATION LIDENT CONTENT UIDENT DEPENDS LIDENT YEAR ## -## Ends in an error in state: 301. +## Ends in an error in state: 310. ## ## separated_nonempty_list(COMMA,var_content) -> lident . CONTENT typ_data [ STATE SCOPE RPAREN OUTPUT LIDENT INTERNAL INPUT END_CODE DEFINED_AS DECLARATION DATA CONTEXT CONDITION ] ## separated_nonempty_list(COMMA,var_content) -> lident . CONTENT typ_data COMMA separated_nonempty_list(COMMA,var_content) [ STATE SCOPE RPAREN OUTPUT LIDENT INTERNAL INPUT END_CODE DEFINED_AS DECLARATION DATA CONTEXT CONDITION ] @@ -4062,7 +4051,7 @@ expected 'content ' source_file: BEGIN_CODE DECLARATION LIDENT CONTENT UIDENT DEPENDS LIDENT CONTENT YEAR ## -## Ends in an error in state: 302. +## Ends in an error in state: 311. ## ## separated_nonempty_list(COMMA,var_content) -> lident CONTENT . typ_data [ STATE SCOPE RPAREN OUTPUT LIDENT INTERNAL INPUT END_CODE DEFINED_AS DECLARATION DATA CONTEXT CONDITION ] ## separated_nonempty_list(COMMA,var_content) -> lident CONTENT . typ_data COMMA separated_nonempty_list(COMMA,var_content) [ STATE SCOPE RPAREN OUTPUT LIDENT INTERNAL INPUT END_CODE DEFINED_AS DECLARATION DATA CONTEXT CONDITION ] @@ -4075,7 +4064,7 @@ expected a type source_file: BEGIN_CODE DECLARATION LIDENT CONTENT UIDENT DEPENDS LIDENT CONTENT BOOLEAN YEAR ## -## Ends in an error in state: 303. +## Ends in an error in state: 312. ## ## separated_nonempty_list(COMMA,var_content) -> lident CONTENT typ_data . [ STATE SCOPE RPAREN OUTPUT LIDENT INTERNAL INPUT END_CODE DEFINED_AS DECLARATION DATA CONTEXT CONDITION ] ## separated_nonempty_list(COMMA,var_content) -> lident CONTENT typ_data . COMMA separated_nonempty_list(COMMA,var_content) [ STATE SCOPE RPAREN OUTPUT LIDENT INTERNAL INPUT END_CODE DEFINED_AS DECLARATION DATA CONTEXT CONDITION ] @@ -4088,7 +4077,7 @@ expected 'equals ' source_file: BEGIN_CODE DECLARATION LIDENT CONTENT UIDENT DEPENDS LIDENT CONTENT UIDENT COMMA YEAR ## -## Ends in an error in state: 304. +## Ends in an error in state: 313. ## ## separated_nonempty_list(COMMA,var_content) -> lident CONTENT typ_data COMMA . separated_nonempty_list(COMMA,var_content) [ STATE SCOPE RPAREN OUTPUT LIDENT INTERNAL INPUT END_CODE DEFINED_AS DECLARATION DATA CONTEXT CONDITION ] ## @@ -4100,7 +4089,7 @@ expected the definition of another argument in the form ' content ' source_file: BEGIN_CODE DECLARATION LIDENT CONTENT UIDENT DEPENDS LIDENT CONTENT UIDENT DEFINED_AS FALSE YEAR ## -## Ends in an error in state: 368. +## Ends in an error in state: 377. ## ## expression -> expression . DOT qlident [ XOR WITH SCOPE PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER GREATER_EQUAL GREATER FOR EQUAL END_CODE DOT DIV DECLARATION CONTAINS AND ] ## expression -> expression . OF funcall_args [ XOR WITH SCOPE PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER GREATER_EQUAL GREATER FOR EQUAL END_CODE DOT DIV DECLARATION CONTAINS AND ] @@ -4132,7 +4121,7 @@ expected a binary operator continuing the expression, or a keyword ending the ex source_file: BEGIN_DIRECTIVE YEAR ## -## Ends in an error in state: 380. +## Ends in an error in state: 389. ## ## source_file_item -> BEGIN_DIRECTIVE . directive END_DIRECTIVE [ LAW_TEXT LAW_HEADING EOF BEGIN_METADATA BEGIN_DIRECTIVE BEGIN_CODE ] ## @@ -4144,7 +4133,7 @@ expected a directive, e.g. 'Include: ' source_file: BEGIN_DIRECTIVE LAW_INCLUDE YEAR ## -## Ends in an error in state: 390. +## Ends in an error in state: 399. ## ## directive -> LAW_INCLUDE . COLON nonempty_list(DIRECTIVE_ARG) option(AT_PAGE) [ END_DIRECTIVE ] ## @@ -4156,7 +4145,7 @@ expected ':', then a file name or 'JORFTEXTNNNNNNNNNNNN' source_file: BEGIN_DIRECTIVE LAW_INCLUDE COLON YEAR ## -## Ends in an error in state: 391. +## Ends in an error in state: 400. ## ## directive -> LAW_INCLUDE COLON . nonempty_list(DIRECTIVE_ARG) option(AT_PAGE) [ END_DIRECTIVE ] ## @@ -4168,7 +4157,7 @@ expected a file name or 'JORFTEXTNNNNNNNNNNNN' source_file: BEGIN_DIRECTIVE LAW_INCLUDE COLON DIRECTIVE_ARG YEAR ## -## Ends in an error in state: 392. +## Ends in an error in state: 401. ## ## nonempty_list(DIRECTIVE_ARG) -> DIRECTIVE_ARG . [ END_DIRECTIVE AT_PAGE ] ## nonempty_list(DIRECTIVE_ARG) -> DIRECTIVE_ARG . nonempty_list(DIRECTIVE_ARG) [ END_DIRECTIVE AT_PAGE ] @@ -4181,7 +4170,7 @@ expected a page specification in the form '@p.', or a newline source_file: BEGIN_DIRECTIVE LAW_INCLUDE COLON DIRECTIVE_ARG AT_PAGE YEAR ## -## Ends in an error in state: 397. +## Ends in an error in state: 406. ## ## source_file_item -> BEGIN_DIRECTIVE directive . END_DIRECTIVE [ LAW_TEXT LAW_HEADING EOF BEGIN_METADATA BEGIN_DIRECTIVE BEGIN_CODE ] ## @@ -4193,7 +4182,7 @@ expected a newline source_file: LAW_HEADING YEAR ## -## Ends in an error in state: 402. +## Ends in an error in state: 411. ## ## source_file -> source_file_item . source_file [ # ] ## diff --git a/compiler/surface/parser.mly b/compiler/surface/parser.mly index 3ab879f9..cb19cece 100644 --- a/compiler/surface/parser.mly +++ b/compiler/surface/parser.mly @@ -120,6 +120,11 @@ let primitive_typ := let typ_data := | t = primitive_typ ; | LIST ; t = addpos(typ_data) ; +| LPAREN ; tl = separated_nonempty_list(COMMA,addpos(typ_data)) ; RPAREN ; { + match tl with + | [t, _] -> t + | ts -> TTuple ts +} let typ == t = typ_data ; @@ -167,7 +172,11 @@ let naked_expression == | l = literal ; { Literal l } -| LPAREN ; e = expression ; RPAREN ; +| LPAREN ; el = separated_nonempty_list(COMMA, expression) ; RPAREN ; { + match el with + | [e] -> Paren e + | es -> Tuple es +} | e = expression ; DOT ; i = addpos(qlident) ; | CARDINAL ; { @@ -245,10 +254,10 @@ let naked_expression == ELSE ; e3 = expression ; { IfThenElse (e1, e2, e3) } %prec let_expr -| LET ; id = lident ; +| LET ; ids = separated_nonempty_list(COMMA,lident) ; DEFINED_AS ; e1 = expression ; IN ; e2 = expression ; { - LetIn (id, e1, e2) + LetIn (ids, e1, e2) } %prec let_expr | i = lident ; AMONG ; coll = expression ; diff --git a/compiler/verification/conditions.ml b/compiler/verification/conditions.ml index d2269bd1..fabf5eb0 100644 --- a/compiler/verification/conditions.ml +++ b/compiler/verification/conditions.ml @@ -38,15 +38,10 @@ let rec conjunction_exprs (exprs : typed expr list) (mark : typed mark) : match exprs with | [] -> ELit (LBool true), mark | hd :: tl -> - ( EApp + ( EAppOp { - f = - ( EOp - { - op = And; - tys = [TLit TBool, Expr.pos hd; TLit TBool, Expr.pos hd]; - }, - mark ); + op = And; + tys = [TLit TBool, Expr.pos hd; TLit TBool, Expr.pos hd]; args = [hd; conjunction_exprs tl mark]; }, mark ) @@ -57,27 +52,17 @@ let conjunction (args : vc_return list) (mark : typed mark) : vc_return = in List.fold_left (fun acc arg -> - ( EApp + ( EAppOp { - f = - ( EOp - { - op = And; - tys = [TLit TBool, Expr.pos acc; TLit TBool, Expr.pos arg]; - }, - mark ); + op = And; + tys = [TLit TBool, Expr.pos acc; TLit TBool, Expr.pos arg]; args = [arg; acc]; }, mark )) acc list let negation (arg : vc_return) (mark : typed mark) : vc_return = - ( EApp - { - f = EOp { op = Not; tys = [TLit TBool, Expr.pos arg] }, mark; - args = [arg]; - }, - mark ) + EAppOp { op = Not; tys = [TLit TBool, Expr.pos arg]; args = [arg] }, mark let disjunction (args : vc_return list) (mark : typed mark) : vc_return = let acc, list = @@ -85,15 +70,10 @@ let disjunction (args : vc_return list) (mark : typed mark) : vc_return = in List.fold_left (fun (acc : vc_return) arg -> - ( EApp + ( EAppOp { - f = - ( EOp - { - op = Or; - tys = [TLit TBool, Expr.pos acc; TLit TBool, Expr.pos arg]; - }, - mark ); + op = Or; + tys = [TLit TBool, Expr.pos acc; TLit TBool, Expr.pos arg]; args = [arg; acc]; }, mark )) @@ -117,7 +97,7 @@ let match_and_ignore_outer_reentrant_default (ctx : ctx) (e : typed expr) : | EErrorOnEmpty ( EDefault { - excepts = [(EApp { f = EVar x, _; args = [(ELit LUnit, _)] }, _)]; + excepts = [(EApp { f = EVar x, _; args = [(ELit LUnit, _)]; _ }, _)]; just = ELit (LBool true), _; cons; }, @@ -196,9 +176,9 @@ let rec generate_vc_must_not_return_empty (ctx : ctx) (e : typed expr) : (* Per default calculus semantics, you cannot call a function with an argument that evaluates to the empty error. Thus, all variable evaluate to non-empty-error terms. *) - | ELit _ | EOp _ -> + | ELit _ -> Mark.copy e (ELit (LBool true)) - | EApp { f; args } -> + | EApp { f; args; _ } -> (* Invariant: For the [EApp] case, we assume here that function calls never return empty error, which implies all functions have been checked never to return empty errors. *) @@ -250,7 +230,7 @@ let rec generate_vc_must_not_return_conflict (ctx : ctx) (e : typed expr) : | EAbs { binder; _ } -> let _vars, body = Bindlib.unmbind binder in (generate_vc_must_not_return_conflict ctx) body - | EVar _ | ELit _ | EOp _ -> Mark.copy e (ELit (LBool true)) + | EVar _ | ELit _ -> Mark.copy e (ELit (LBool true)) | EDefault { excepts; just; cons } -> (* never returns conflict if and only if: - neither e1 nor ... nor en nor ejust nor econs return conflict - there is diff --git a/compiler/verification/z3backend.real.ml b/compiler/verification/z3backend.real.ml index 2db4e0bc..f5c47fb3 100644 --- a/compiler/verification/z3backend.real.ml +++ b/compiler/verification/z3backend.real.ml @@ -437,9 +437,9 @@ let rec translate_op : let ill_formed () = Format.kasprintf failwith "[Z3 encoding] Ill-formed operator application: %a" Shared_ast.Expr.format - (Shared_ast.Expr.eapp - (Shared_ast.Expr.eop op [] (Untyped { pos = Pos.no_pos })) - (List.map Shared_ast.Expr.untype args) + (Shared_ast.Expr.eappop ~op + ~args:(List.map Shared_ast.Expr.untype args) + ~tys:[] (Untyped { pos = Pos.no_pos }) |> Shared_ast.Expr.unbox) in @@ -458,10 +458,7 @@ let rec translate_op : failwith "[Z3 encoding] ternary operator application not supported" (* Special case for GetYear comparisons *) | ( Lt_int_int, - [ - (EApp { f = EOp { op = GetYear; _ }, _; args = [e1] }, _); - (ELit (LInt n), _); - ] ) -> + [(EAppOp { op = GetYear; args = [e1]; _ }, _); (ELit (LInt n), _)] ) -> let n = Runtime.integer_to_int n in let ctx, e1 = translate_expr ctx e1 in let e2 = @@ -472,10 +469,7 @@ let rec translate_op : days *) ctx, Arithmetic.mk_lt ctx.ctx_z3 e1 e2 | ( Lte_int_int, - [ - (EApp { f = EOp { op = GetYear; _ }, _; args = [e1] }, _); - (ELit (LInt n), _); - ] ) -> + [(EAppOp { op = GetYear; args = [e1]; _ }, _); (ELit (LInt n), _)] ) -> let ctx, e1 = translate_expr ctx e1 in let nb_days = if is_leap_year n then 365 else 364 in let n = Runtime.integer_to_int n in @@ -489,10 +483,7 @@ let rec translate_op : in ctx, Arithmetic.mk_le ctx.ctx_z3 e1 e2 | ( Gt_int_int, - [ - (EApp { f = EOp { op = GetYear; _ }, _; args = [e1] }, _); - (ELit (LInt n), _); - ] ) -> + [(EAppOp { op = GetYear; args = [e1]; _ }, _); (ELit (LInt n), _)] ) -> let ctx, e1 = translate_expr ctx e1 in let nb_days = if is_leap_year n then 365 else 364 in let n = Runtime.integer_to_int n in @@ -506,10 +497,7 @@ let rec translate_op : in ctx, Arithmetic.mk_gt ctx.ctx_z3 e1 e2 | ( Gte_int_int, - [ - (EApp { f = EOp { op = GetYear; _ }, _; args = [e1] }, _); - (ELit (LInt n), _); - ] ) -> + [(EAppOp { op = GetYear; args = [e1]; _ }, _); (ELit (LInt n), _)] ) -> let n = Runtime.integer_to_int n in let ctx, e1 = translate_expr ctx e1 in let e2 = @@ -519,11 +507,7 @@ let rec translate_op : be directly translated as >= in the Z3 encoding using the number of days *) ctx, Arithmetic.mk_ge ctx.ctx_z3 e1 e2 - | ( Eq, - [ - (EApp { f = EOp { op = GetYear; _ }, _; args = [e1] }, _); - (ELit (LInt n), _); - ] ) -> + | Eq, [(EAppOp { op = GetYear; args = [e1]; _ }, _); (ELit (LInt n), _)] -> let n = Runtime.integer_to_int n in let ctx, e1 = translate_expr ctx e1 in let min_date = @@ -733,9 +717,9 @@ and translate_expr (ctx : context) (vc : typed expr) : context * Expr.expr = | EArray _ -> failwith "[Z3 encoding] EArray unsupported" | ELit l -> ctx, translate_lit ctx l | EAbs _ -> failwith "[Z3 encoding] EAbs unsupported" - | EApp { f = head; args } -> ( + | EAppOp { op; args; _ } -> translate_op ctx op args + | EApp { f = head; args; _ } -> ( match Mark.remove head with - | EOp { op; _ } -> translate_op ctx op args | EVar v -> let (Typed { ty = f_ty; _ }) = Mark.get head in let ctx, fd = find_or_create_funcdecl ctx v f_ty in @@ -762,7 +746,6 @@ and translate_expr (ctx : context) (vc : typed expr) : context * Expr.expr = "[Z3 encoding] EApp node: Catala function calls should only include \ operators or function names") | EAssert e -> translate_expr ctx e - | EOp _ -> failwith "[Z3 encoding] EOp unsupported" | EDefault _ -> failwith "[Z3 encoding] EDefault unsupported" | EPureDefault _ -> failwith "[Z3 encoding] EPureDefault unsupported" | EIfThenElse { cond = e_if; etrue = e_then; efalse = e_else } -> diff --git a/examples/aides_logement/tests/tests_calcul_al_accession_propriete.catala_fr b/examples/aides_logement/tests/tests_calcul_al_accession_propriete.catala_fr index cfa8b4cc..56f0263a 100644 --- a/examples/aides_logement/tests/tests_calcul_al_accession_propriete.catala_fr +++ b/examples/aides_logement/tests/tests_calcul_al_accession_propriete.catala_fr @@ -74,24 +74,12 @@ champ d'application Exemple2: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [29344/29344] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [771/771] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [4571/4571] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [3046/3046] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [4571/4571] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [1396/1396] +[RESULT] Invariant typing_defaults checked. result: [25044/25044] +[RESULT] Invariant match_inversion checked. result: [771/771] +[RESULT] Invariant app_inversion checked. result: [271/271] +[RESULT] Invariant no_return_a_function checked. result: [3046/3046] +[RESULT] Invariant no_partial_evaluation checked. result: [271/271] +[RESULT] Invariant default_no_arrow checked. result: [1396/1396] [RESULT] Typechecking successful! ``` diff --git a/examples/aides_logement/tests/tests_calcul_al_locatif.catala_fr b/examples/aides_logement/tests/tests_calcul_al_locatif.catala_fr index ef652d55..47184e87 100644 --- a/examples/aides_logement/tests/tests_calcul_al_locatif.catala_fr +++ b/examples/aides_logement/tests/tests_calcul_al_locatif.catala_fr @@ -127,24 +127,12 @@ champ d'application Exemple4 : ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [29687/29687] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [771/771] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [4574/4574] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [3046/3046] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [4574/4574] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [1460/1460] +[RESULT] Invariant typing_defaults checked. result: [25388/25388] +[RESULT] Invariant match_inversion checked. result: [771/771] +[RESULT] Invariant app_inversion checked. result: [275/275] +[RESULT] Invariant no_return_a_function checked. result: [3046/3046] +[RESULT] Invariant no_partial_evaluation checked. result: [275/275] +[RESULT] Invariant default_no_arrow checked. result: [1460/1460] [RESULT] Typechecking successful! ``` diff --git a/examples/aides_logement/tests/tests_calcul_al_logement_foyer.catala_fr b/examples/aides_logement/tests/tests_calcul_al_logement_foyer.catala_fr index ebba93ff..cb7d0b4b 100644 --- a/examples/aides_logement/tests/tests_calcul_al_logement_foyer.catala_fr +++ b/examples/aides_logement/tests/tests_calcul_al_logement_foyer.catala_fr @@ -33,24 +33,12 @@ champ d'application CasTest1: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [29117/29117] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [771/771] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [4563/4563] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [3046/3046] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [4563/4563] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [1356/1356] +[RESULT] Invariant typing_defaults checked. result: [24823/24823] +[RESULT] Invariant match_inversion checked. result: [771/771] +[RESULT] Invariant app_inversion checked. result: [269/269] +[RESULT] Invariant no_return_a_function checked. result: [3046/3046] +[RESULT] Invariant no_partial_evaluation checked. result: [269/269] +[RESULT] Invariant default_no_arrow checked. result: [1356/1356] [RESULT] Typechecking successful! ``` diff --git a/examples/aides_logement/tests/tests_invariants.catala_fr b/examples/aides_logement/tests/tests_invariants.catala_fr index 85cc7719..b0ee873b 100644 --- a/examples/aides_logement/tests/tests_invariants.catala_fr +++ b/examples/aides_logement/tests/tests_invariants.catala_fr @@ -5,23 +5,11 @@ ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [28966/28966] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [771/771] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [4557/4557] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [3046/3046] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [4557/4557] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [1332/1332] +[RESULT] Invariant typing_defaults checked. result: [24676/24676] +[RESULT] Invariant match_inversion checked. result: [771/771] +[RESULT] Invariant app_inversion checked. result: [267/267] +[RESULT] Invariant no_return_a_function checked. result: [3046/3046] +[RESULT] Invariant no_partial_evaluation checked. result: [267/267] +[RESULT] Invariant default_no_arrow checked. result: [1332/1332] [RESULT] Typechecking successful! ``` diff --git a/examples/allocations_familiales/tests/test_invariants.catala_fr b/examples/allocations_familiales/tests/test_invariants.catala_fr index 6a448b56..b7a3ba8f 100644 --- a/examples/allocations_familiales/tests/test_invariants.catala_fr +++ b/examples/allocations_familiales/tests/test_invariants.catala_fr @@ -5,23 +5,11 @@ ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [3971/3971] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [18/18] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [802/802] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [96/96] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [802/802] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [284/284] +[RESULT] Invariant typing_defaults checked. result: [3195/3195] +[RESULT] Invariant match_inversion checked. result: [18/18] +[RESULT] Invariant app_inversion checked. result: [26/26] +[RESULT] Invariant no_return_a_function checked. result: [96/96] +[RESULT] Invariant no_partial_evaluation checked. result: [26/26] +[RESULT] Invariant default_no_arrow checked. result: [284/284] [RESULT] Typechecking successful! ``` \ No newline at end of file diff --git a/tests/test_arithmetic/good/priorities.catala_en b/tests/test_arithmetic/good/priorities.catala_en index 10b66d37..23a544da 100644 --- a/tests/test_arithmetic/good/priorities.catala_en +++ b/tests/test_arithmetic/good/priorities.catala_en @@ -16,24 +16,12 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [75/75] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [13/13] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [13/13] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [8/8] +[RESULT] Invariant typing_defaults checked. result: [62/62] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [0/0] +[RESULT] Invariant no_return_a_function checked. result: [0/0] +[RESULT] Invariant no_partial_evaluation checked. result: [0/0] +[RESULT] Invariant default_no_arrow checked. result: [8/8] [RESULT] Typechecking successful! ``` diff --git a/tests/test_arithmetic/good/trivial.catala_en b/tests/test_arithmetic/good/trivial.catala_en index 91afbb87..d68e023c 100644 --- a/tests/test_arithmetic/good/trivial.catala_en +++ b/tests/test_arithmetic/good/trivial.catala_en @@ -10,24 +10,12 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [16/16] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [2/2] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [2/2] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [2/2] +[RESULT] Invariant typing_defaults checked. result: [14/14] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [0/0] +[RESULT] Invariant no_return_a_function checked. result: [0/0] +[RESULT] Invariant no_partial_evaluation checked. result: [0/0] +[RESULT] Invariant default_no_arrow checked. result: [2/2] [RESULT] Typechecking successful! ``` diff --git a/tests/test_array/bad/fold_error.catala_en b/tests/test_array/bad/fold_error.catala_en index c4169ada..b7309aa5 100644 --- a/tests/test_array/bad/fold_error.catala_en +++ b/tests/test_array/bad/fold_error.catala_en @@ -16,10 +16,10 @@ $ catala Interpret -s A I don't know how to apply operator >= on types integer and money -┌─⯈ tests/test_array/bad/fold_error.catala_en:10.50-10.52: +┌─⯈ tests/test_array/bad/fold_error.catala_en:10.48-10.55: └──┐ 10 │ definition list_high_count equals number of (m >= $7) for m among list - │ ‾‾ + │ ‾‾‾‾‾‾‾ └─ Article Type integer coming from expression: diff --git a/tests/test_array/good/aggregation.catala_en b/tests/test_array/good/aggregation.catala_en index b2471c77..ef663608 100644 --- a/tests/test_array/good/aggregation.catala_en +++ b/tests/test_array/good/aggregation.catala_en @@ -27,24 +27,12 @@ scope B: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [121/121] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [18/18] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [7/7] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [18/18] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [10/10] +[RESULT] Invariant typing_defaults checked. result: [104/104] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [1/1] +[RESULT] Invariant no_return_a_function checked. result: [7/7] +[RESULT] Invariant no_partial_evaluation checked. result: [1/1] +[RESULT] Invariant default_no_arrow checked. result: [10/10] [RESULT] Typechecking successful! ``` diff --git a/tests/test_array/good/aggregation_2.catala_en b/tests/test_array/good/aggregation_2.catala_en index 675917fe..1cd71686 100644 --- a/tests/test_array/good/aggregation_2.catala_en +++ b/tests/test_array/good/aggregation_2.catala_en @@ -33,24 +33,12 @@ scope B: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [115/115] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [16/16] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [7/7] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [16/16] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [7/7] +[RESULT] Invariant typing_defaults checked. result: [105/105] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [6/6] +[RESULT] Invariant no_return_a_function checked. result: [7/7] +[RESULT] Invariant no_partial_evaluation checked. result: [6/6] +[RESULT] Invariant default_no_arrow checked. result: [7/7] [RESULT] Typechecking successful! ``` diff --git a/tests/test_array/good/aggregation_3.catala_en b/tests/test_array/good/aggregation_3.catala_en index 5ead6901..c1bda541 100644 --- a/tests/test_array/good/aggregation_3.catala_en +++ b/tests/test_array/good/aggregation_3.catala_en @@ -35,24 +35,12 @@ scope S: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [225/225] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [46/46] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [14/14] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [46/46] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [2/2] +[RESULT] Invariant typing_defaults checked. result: [181/181] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [2/2] +[RESULT] Invariant no_return_a_function checked. result: [14/14] +[RESULT] Invariant no_partial_evaluation checked. result: [2/2] +[RESULT] Invariant default_no_arrow checked. result: [2/2] [RESULT] Typechecking successful! ``` diff --git a/tests/test_array/good/concatenation.catala_en b/tests/test_array/good/concatenation.catala_en index 165ffe8b..ac3b1d00 100644 --- a/tests/test_array/good/concatenation.catala_en +++ b/tests/test_array/good/concatenation.catala_en @@ -14,24 +14,12 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [39/39] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [3/3] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [3/3] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [4/4] +[RESULT] Invariant typing_defaults checked. result: [36/36] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [0/0] +[RESULT] Invariant no_return_a_function checked. result: [0/0] +[RESULT] Invariant no_partial_evaluation checked. result: [0/0] +[RESULT] Invariant default_no_arrow checked. result: [4/4] [RESULT] Typechecking successful! ``` diff --git a/tests/test_array/good/filter.catala_en b/tests/test_array/good/filter.catala_en index d648f26d..8e9d33a4 100644 --- a/tests/test_array/good/filter.catala_en +++ b/tests/test_array/good/filter.catala_en @@ -20,24 +20,12 @@ scope B: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [41/41] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [5/5] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [1/1] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [5/5] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [4/4] +[RESULT] Invariant typing_defaults checked. result: [37/37] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [1/1] +[RESULT] Invariant no_return_a_function checked. result: [1/1] +[RESULT] Invariant no_partial_evaluation checked. result: [1/1] +[RESULT] Invariant default_no_arrow checked. result: [4/4] [RESULT] Typechecking successful! ``` diff --git a/tests/test_array/good/filter_map.catala_en b/tests/test_array/good/filter_map.catala_en index 1e91ceec..0c9a026f 100644 --- a/tests/test_array/good/filter_map.catala_en +++ b/tests/test_array/good/filter_map.catala_en @@ -21,24 +21,12 @@ scope B: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [57/57] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [7/7] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [2/2] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [7/7] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [6/6] +[RESULT] Invariant typing_defaults checked. result: [51/51] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [1/1] +[RESULT] Invariant no_return_a_function checked. result: [2/2] +[RESULT] Invariant no_partial_evaluation checked. result: [1/1] +[RESULT] Invariant default_no_arrow checked. result: [6/6] [RESULT] Typechecking successful! ``` diff --git a/tests/test_array/good/fold.catala_en b/tests/test_array/good/fold.catala_en index 675917fe..1cd71686 100644 --- a/tests/test_array/good/fold.catala_en +++ b/tests/test_array/good/fold.catala_en @@ -33,24 +33,12 @@ scope B: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [115/115] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [16/16] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [7/7] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [16/16] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [7/7] +[RESULT] Invariant typing_defaults checked. result: [105/105] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [6/6] +[RESULT] Invariant no_return_a_function checked. result: [7/7] +[RESULT] Invariant no_partial_evaluation checked. result: [6/6] +[RESULT] Invariant default_no_arrow checked. result: [7/7] [RESULT] Typechecking successful! ``` diff --git a/tests/test_array/good/map.catala_en b/tests/test_array/good/map.catala_en index d36df95f..73d6d9cf 100644 --- a/tests/test_array/good/map.catala_en +++ b/tests/test_array/good/map.catala_en @@ -14,24 +14,12 @@ scope B: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [28/28] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [2/2] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [1/1] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [2/2] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [4/4] +[RESULT] Invariant typing_defaults checked. result: [26/26] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [0/0] +[RESULT] Invariant no_return_a_function checked. result: [1/1] +[RESULT] Invariant no_partial_evaluation checked. result: [0/0] +[RESULT] Invariant default_no_arrow checked. result: [4/4] [RESULT] Typechecking successful! ``` diff --git a/tests/test_array/good/simple.catala_en b/tests/test_array/good/simple.catala_en index 9fe96131..49005887 100644 --- a/tests/test_array/good/simple.catala_en +++ b/tests/test_array/good/simple.catala_en @@ -25,24 +25,12 @@ scope B: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [96/96] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [13/13] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [3/3] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [13/13] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [10/10] +[RESULT] Invariant typing_defaults checked. result: [84/84] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [1/1] +[RESULT] Invariant no_return_a_function checked. result: [3/3] +[RESULT] Invariant no_partial_evaluation checked. result: [1/1] +[RESULT] Invariant default_no_arrow checked. result: [10/10] [RESULT] Typechecking successful! ``` diff --git a/tests/test_array/good/simpler.catala_en b/tests/test_array/good/simpler.catala_en index 88aacdc1..03a81b30 100644 --- a/tests/test_array/good/simpler.catala_en +++ b/tests/test_array/good/simpler.catala_en @@ -14,24 +14,12 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [39/39] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [5/5] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [1/1] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [5/5] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [4/4] +[RESULT] Invariant typing_defaults checked. result: [34/34] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [0/0] +[RESULT] Invariant no_return_a_function checked. result: [1/1] +[RESULT] Invariant no_partial_evaluation checked. result: [0/0] +[RESULT] Invariant default_no_arrow checked. result: [4/4] [RESULT] Typechecking successful! ``` diff --git a/tests/test_array/good/simplest.catala_en b/tests/test_array/good/simplest.catala_en index 7e4e1256..6a8a5051 100644 --- a/tests/test_array/good/simplest.catala_en +++ b/tests/test_array/good/simplest.catala_en @@ -12,24 +12,12 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [13/13] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [2/2] +[RESULT] Invariant typing_defaults checked. result: [13/13] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [0/0] +[RESULT] Invariant no_return_a_function checked. result: [0/0] +[RESULT] Invariant no_partial_evaluation checked. result: [0/0] +[RESULT] Invariant default_no_arrow checked. result: [2/2] [RESULT] Typechecking successful! ``` diff --git a/tests/test_bool/good/test_bool.catala_en b/tests/test_bool/good/test_bool.catala_en index 79a23f99..ed675cff 100644 --- a/tests/test_bool/good/test_bool.catala_en +++ b/tests/test_bool/good/test_bool.catala_en @@ -15,24 +15,12 @@ scope TestBool: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [47/47] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [4/4] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [4/4] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [7/7] +[RESULT] Invariant typing_defaults checked. result: [45/45] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [2/2] +[RESULT] Invariant no_return_a_function checked. result: [0/0] +[RESULT] Invariant no_partial_evaluation checked. result: [2/2] +[RESULT] Invariant default_no_arrow checked. result: [7/7] [RESULT] Typechecking successful! ``` diff --git a/tests/test_bool/good/test_precedence.catala_en b/tests/test_bool/good/test_precedence.catala_en index 4bfe7599..99f69efb 100644 --- a/tests/test_bool/good/test_precedence.catala_en +++ b/tests/test_bool/good/test_precedence.catala_en @@ -12,24 +12,12 @@ scope TestBool: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [30/30] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [5/5] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [5/5] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [3/3] +[RESULT] Invariant typing_defaults checked. result: [26/26] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [1/1] +[RESULT] Invariant no_return_a_function checked. result: [0/0] +[RESULT] Invariant no_partial_evaluation checked. result: [1/1] +[RESULT] Invariant default_no_arrow checked. result: [3/3] [RESULT] Typechecking successful! ``` diff --git a/tests/test_bool/good/test_xor.catala_en b/tests/test_bool/good/test_xor.catala_en index 8d190e86..68f0dbc7 100644 --- a/tests/test_bool/good/test_xor.catala_en +++ b/tests/test_bool/good/test_xor.catala_en @@ -18,24 +18,12 @@ scope TestXor: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [85/85] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [8/8] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [8/8] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [12/12] +[RESULT] Invariant typing_defaults checked. result: [81/81] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [4/4] +[RESULT] Invariant no_return_a_function checked. result: [0/0] +[RESULT] Invariant no_partial_evaluation checked. result: [4/4] +[RESULT] Invariant default_no_arrow checked. result: [12/12] [RESULT] Typechecking successful! ``` diff --git a/tests/test_date/good/durations.catala_en b/tests/test_date/good/durations.catala_en index 5f71c807..80fd15e9 100644 --- a/tests/test_date/good/durations.catala_en +++ b/tests/test_date/good/durations.catala_en @@ -27,24 +27,12 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [85/85] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [7/7] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [7/7] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [14/14] +[RESULT] Invariant typing_defaults checked. result: [78/78] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [0/0] +[RESULT] Invariant no_return_a_function checked. result: [0/0] +[RESULT] Invariant no_partial_evaluation checked. result: [0/0] +[RESULT] Invariant default_no_arrow checked. result: [14/14] [RESULT] Typechecking successful! ``` diff --git a/tests/test_date/good/rounding_option_en.catala_en b/tests/test_date/good/rounding_option_en.catala_en index 0756c3f5..b6bd5069 100644 --- a/tests/test_date/good/rounding_option_en.catala_en +++ b/tests/test_date/good/rounding_option_en.catala_en @@ -26,24 +26,12 @@ scope Test: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [51/51] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [5/5] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [2/2] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [5/5] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [4/4] +[RESULT] Invariant typing_defaults checked. result: [49/49] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [3/3] +[RESULT] Invariant no_return_a_function checked. result: [2/2] +[RESULT] Invariant no_partial_evaluation checked. result: [3/3] +[RESULT] Invariant default_no_arrow checked. result: [4/4] [RESULT] Typechecking successful! ``` diff --git a/tests/test_date/good/rounding_option_fr.catala_fr b/tests/test_date/good/rounding_option_fr.catala_fr index 91fe9e60..06a0f054 100644 --- a/tests/test_date/good/rounding_option_fr.catala_fr +++ b/tests/test_date/good/rounding_option_fr.catala_fr @@ -26,24 +26,12 @@ champ d'application Test: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [51/51] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [5/5] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [2/2] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [5/5] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [4/4] +[RESULT] Invariant typing_defaults checked. result: [49/49] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [3/3] +[RESULT] Invariant no_return_a_function checked. result: [2/2] +[RESULT] Invariant no_partial_evaluation checked. result: [3/3] +[RESULT] Invariant default_no_arrow checked. result: [4/4] [RESULT] Typechecking successful! ``` diff --git a/tests/test_date/good/simple.catala_en b/tests/test_date/good/simple.catala_en index 7d2ea369..aec9e2e7 100644 --- a/tests/test_date/good/simple.catala_en +++ b/tests/test_date/good/simple.catala_en @@ -16,24 +16,12 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [58/58] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [4/4] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [4/4] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [9/9] +[RESULT] Invariant typing_defaults checked. result: [57/57] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [3/3] +[RESULT] Invariant no_return_a_function checked. result: [0/0] +[RESULT] Invariant no_partial_evaluation checked. result: [3/3] +[RESULT] Invariant default_no_arrow checked. result: [9/9] [RESULT] Typechecking successful! ``` diff --git a/tests/test_dec/good/infinite_precision.catala_en b/tests/test_dec/good/infinite_precision.catala_en index 67201499..a3198927 100644 --- a/tests/test_dec/good/infinite_precision.catala_en +++ b/tests/test_dec/good/infinite_precision.catala_en @@ -18,24 +18,12 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [96/96] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [12/12] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [12/12] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [12/12] +[RESULT] Invariant typing_defaults checked. result: [88/88] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [4/4] +[RESULT] Invariant no_return_a_function checked. result: [0/0] +[RESULT] Invariant no_partial_evaluation checked. result: [4/4] +[RESULT] Invariant default_no_arrow checked. result: [12/12] [RESULT] Typechecking successful! ``` diff --git a/tests/test_dec/good/rounding.catala_en b/tests/test_dec/good/rounding.catala_en index 8af72747..3b19f969 100644 --- a/tests/test_dec/good/rounding.catala_en +++ b/tests/test_dec/good/rounding.catala_en @@ -18,24 +18,12 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [41/41] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [2/2] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [2/2] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [8/8] +[RESULT] Invariant typing_defaults checked. result: [39/39] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [0/0] +[RESULT] Invariant no_return_a_function checked. result: [0/0] +[RESULT] Invariant no_partial_evaluation checked. result: [0/0] +[RESULT] Invariant default_no_arrow checked. result: [8/8] [RESULT] Typechecking successful! ``` diff --git a/tests/test_dec/good/simple.catala_en b/tests/test_dec/good/simple.catala_en index ee35f880..3cacf6aa 100644 --- a/tests/test_dec/good/simple.catala_en +++ b/tests/test_dec/good/simple.catala_en @@ -18,24 +18,12 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [70/70] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [5/5] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [5/5] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [11/11] +[RESULT] Invariant typing_defaults checked. result: [68/68] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [3/3] +[RESULT] Invariant no_return_a_function checked. result: [0/0] +[RESULT] Invariant no_partial_evaluation checked. result: [3/3] +[RESULT] Invariant default_no_arrow checked. result: [11/11] [RESULT] Typechecking successful! ``` diff --git a/tests/test_dec/good/zero_after_comma.catala_en b/tests/test_dec/good/zero_after_comma.catala_en index a41f4639..0ae6167a 100644 --- a/tests/test_dec/good/zero_after_comma.catala_en +++ b/tests/test_dec/good/zero_after_comma.catala_en @@ -15,24 +15,12 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [48/48] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [5/5] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [5/5] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [6/6] +[RESULT] Invariant typing_defaults checked. result: [45/45] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [2/2] +[RESULT] Invariant no_return_a_function checked. result: [0/0] +[RESULT] Invariant no_partial_evaluation checked. result: [2/2] +[RESULT] Invariant default_no_arrow checked. result: [6/6] [RESULT] Typechecking successful! ``` diff --git a/tests/test_default/good/mutliple_definitions.catala_en b/tests/test_default/good/mutliple_definitions.catala_en index 87d1f417..0f42dedc 100644 --- a/tests/test_default/good/mutliple_definitions.catala_en +++ b/tests/test_default/good/mutliple_definitions.catala_en @@ -24,24 +24,12 @@ $ catala Typecheck --check-invariants └─┐ 6 │ definition w equals 3 │ ‾‾‾‾‾‾‾‾‾‾‾‾ -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [14/14] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [3/3] +[RESULT] Invariant typing_defaults checked. result: [14/14] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [0/0] +[RESULT] Invariant no_return_a_function checked. result: [0/0] +[RESULT] Invariant no_partial_evaluation checked. result: [0/0] +[RESULT] Invariant default_no_arrow checked. result: [3/3] [RESULT] Typechecking successful! ``` diff --git a/tests/test_enum/good/disambiguated_cases.catala_en b/tests/test_enum/good/disambiguated_cases.catala_en index 362ad386..123a9e2d 100644 --- a/tests/test_enum/good/disambiguated_cases.catala_en +++ b/tests/test_enum/good/disambiguated_cases.catala_en @@ -25,24 +25,12 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [62/62] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [1/1] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [3/3] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [2/2] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [3/3] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [9/9] +[RESULT] Invariant typing_defaults checked. result: [62/62] +[RESULT] Invariant match_inversion checked. result: [1/1] +[RESULT] Invariant app_inversion checked. result: [3/3] +[RESULT] Invariant no_return_a_function checked. result: [2/2] +[RESULT] Invariant no_partial_evaluation checked. result: [3/3] +[RESULT] Invariant default_no_arrow checked. result: [9/9] [RESULT] Typechecking successful! ``` diff --git a/tests/test_enum/good/quick_pattern_check.catala_en b/tests/test_enum/good/quick_pattern_check.catala_en index d8206a48..5ff96800 100644 --- a/tests/test_enum/good/quick_pattern_check.catala_en +++ b/tests/test_enum/good/quick_pattern_check.catala_en @@ -20,24 +20,12 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [66/66] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [2/2] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [3/3] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [4/4] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [3/3] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [9/9] +[RESULT] Invariant typing_defaults checked. result: [66/66] +[RESULT] Invariant match_inversion checked. result: [2/2] +[RESULT] Invariant app_inversion checked. result: [3/3] +[RESULT] Invariant no_return_a_function checked. result: [4/4] +[RESULT] Invariant no_partial_evaluation checked. result: [3/3] +[RESULT] Invariant default_no_arrow checked. result: [9/9] [RESULT] Typechecking successful! ``` diff --git a/tests/test_enum/good/simple.catala_en b/tests/test_enum/good/simple.catala_en index 75b896e2..59594bf0 100644 --- a/tests/test_enum/good/simple.catala_en +++ b/tests/test_enum/good/simple.catala_en @@ -20,24 +20,12 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [43/43] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [1/1] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [2/2] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [2/2] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [2/2] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [6/6] +[RESULT] Invariant typing_defaults checked. result: [43/43] +[RESULT] Invariant match_inversion checked. result: [1/1] +[RESULT] Invariant app_inversion checked. result: [2/2] +[RESULT] Invariant no_return_a_function checked. result: [2/2] +[RESULT] Invariant no_partial_evaluation checked. result: [2/2] +[RESULT] Invariant default_no_arrow checked. result: [6/6] [RESULT] Typechecking successful! ``` diff --git a/tests/test_enum/good/wildcard.catala_en b/tests/test_enum/good/wildcard.catala_en index bfc0b71f..200ba9f8 100644 --- a/tests/test_enum/good/wildcard.catala_en +++ b/tests/test_enum/good/wildcard.catala_en @@ -40,24 +40,12 @@ scope Simple_case_2: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [90/90] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [2/2] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [4/4] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [6/6] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [4/4] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [12/12] +[RESULT] Invariant typing_defaults checked. result: [90/90] +[RESULT] Invariant match_inversion checked. result: [2/2] +[RESULT] Invariant app_inversion checked. result: [4/4] +[RESULT] Invariant no_return_a_function checked. result: [6/6] +[RESULT] Invariant no_partial_evaluation checked. result: [4/4] +[RESULT] Invariant default_no_arrow checked. result: [12/12] [RESULT] Typechecking successful! ``` diff --git a/tests/test_exception/good/context_with_default.catala_en b/tests/test_exception/good/context_with_default.catala_en index 24ecafa5..deaae1b9 100644 --- a/tests/test_exception/good/context_with_default.catala_en +++ b/tests/test_exception/good/context_with_default.catala_en @@ -19,24 +19,12 @@ scope Bar: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [48/48] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [3/3] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [1/1] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [3/3] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [8/8] +[RESULT] Invariant typing_defaults checked. result: [47/47] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [2/2] +[RESULT] Invariant no_return_a_function checked. result: [1/1] +[RESULT] Invariant no_partial_evaluation checked. result: [2/2] +[RESULT] Invariant default_no_arrow checked. result: [8/8] [RESULT] Typechecking successful! ``` diff --git a/tests/test_exception/good/double_definition.catala_en b/tests/test_exception/good/double_definition.catala_en index 8434806a..441e6e06 100644 --- a/tests/test_exception/good/double_definition.catala_en +++ b/tests/test_exception/good/double_definition.catala_en @@ -27,24 +27,12 @@ $ catala Typecheck --check-invariants 8 │ definition x equals 1 │ ‾‾‾‾‾‾‾‾‾‾‾‾ └─ Foo -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [14/14] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [3/3] +[RESULT] Invariant typing_defaults checked. result: [14/14] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [0/0] +[RESULT] Invariant no_return_a_function checked. result: [0/0] +[RESULT] Invariant no_partial_evaluation checked. result: [0/0] +[RESULT] Invariant default_no_arrow checked. result: [3/3] [RESULT] Typechecking successful! ``` diff --git a/tests/test_exception/good/duplicate_labels.catala_en b/tests/test_exception/good/duplicate_labels.catala_en index 9ea01f0b..cde93198 100644 --- a/tests/test_exception/good/duplicate_labels.catala_en +++ b/tests/test_exception/good/duplicate_labels.catala_en @@ -22,24 +22,12 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [59/59] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [5/5] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [5/5] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [10/10] +[RESULT] Invariant typing_defaults checked. result: [56/56] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [2/2] +[RESULT] Invariant no_return_a_function checked. result: [0/0] +[RESULT] Invariant no_partial_evaluation checked. result: [2/2] +[RESULT] Invariant default_no_arrow checked. result: [10/10] [RESULT] Typechecking successful! ``` diff --git a/tests/test_exception/good/exception.catala_en b/tests/test_exception/good/exception.catala_en index a2090585..1dd98f89 100644 --- a/tests/test_exception/good/exception.catala_en +++ b/tests/test_exception/good/exception.catala_en @@ -16,24 +16,12 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [28/28] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [1/1] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [1/1] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [6/6] +[RESULT] Invariant typing_defaults checked. result: [28/28] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [1/1] +[RESULT] Invariant no_return_a_function checked. result: [0/0] +[RESULT] Invariant no_partial_evaluation checked. result: [1/1] +[RESULT] Invariant default_no_arrow checked. result: [6/6] [RESULT] Typechecking successful! ``` diff --git a/tests/test_exception/good/exceptions_squared.catala_en b/tests/test_exception/good/exceptions_squared.catala_en index d9104a89..402405f5 100644 --- a/tests/test_exception/good/exceptions_squared.catala_en +++ b/tests/test_exception/good/exceptions_squared.catala_en @@ -20,24 +20,12 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [37/37] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [1/1] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [1/1] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [9/9] +[RESULT] Invariant typing_defaults checked. result: [37/37] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [1/1] +[RESULT] Invariant no_return_a_function checked. result: [0/0] +[RESULT] Invariant no_partial_evaluation checked. result: [1/1] +[RESULT] Invariant default_no_arrow checked. result: [9/9] [RESULT] Typechecking successful! ``` diff --git a/tests/test_exception/good/grouped_exceptions.catala_en b/tests/test_exception/good/grouped_exceptions.catala_en index f97675bf..82bb62d2 100644 --- a/tests/test_exception/good/grouped_exceptions.catala_en +++ b/tests/test_exception/good/grouped_exceptions.catala_en @@ -50,24 +50,12 @@ scope Benefit: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [61/61] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [4/4] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [4/4] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [10/10] +[RESULT] Invariant typing_defaults checked. result: [59/59] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [2/2] +[RESULT] Invariant no_return_a_function checked. result: [0/0] +[RESULT] Invariant no_partial_evaluation checked. result: [2/2] +[RESULT] Invariant default_no_arrow checked. result: [10/10] [RESULT] Typechecking successful! ``` diff --git a/tests/test_exception/good/groups_of_exceptions.catala_en b/tests/test_exception/good/groups_of_exceptions.catala_en index 8e970274..d8f2d9e8 100644 --- a/tests/test_exception/good/groups_of_exceptions.catala_en +++ b/tests/test_exception/good/groups_of_exceptions.catala_en @@ -44,24 +44,12 @@ scope Test: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [84/84] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [7/7] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [7/7] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [15/15] +[RESULT] Invariant typing_defaults checked. result: [78/78] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [1/1] +[RESULT] Invariant no_return_a_function checked. result: [0/0] +[RESULT] Invariant no_partial_evaluation checked. result: [1/1] +[RESULT] Invariant default_no_arrow checked. result: [15/15] [RESULT] Typechecking successful! ``` diff --git a/tests/test_exception/good/same_label_two_variables.catala_en b/tests/test_exception/good/same_label_two_variables.catala_en index 7201a383..9281e553 100644 --- a/tests/test_exception/good/same_label_two_variables.catala_en +++ b/tests/test_exception/good/same_label_two_variables.catala_en @@ -23,24 +23,12 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [67/67] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [4/4] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [4/4] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [12/12] +[RESULT] Invariant typing_defaults checked. result: [66/66] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [3/3] +[RESULT] Invariant no_return_a_function checked. result: [0/0] +[RESULT] Invariant no_partial_evaluation checked. result: [3/3] +[RESULT] Invariant default_no_arrow checked. result: [12/12] [RESULT] Typechecking successful! ``` diff --git a/tests/test_exception/good/split_unlabeled_exception.catala_en b/tests/test_exception/good/split_unlabeled_exception.catala_en index 636c5ecd..f7ecd61d 100644 --- a/tests/test_exception/good/split_unlabeled_exception.catala_en +++ b/tests/test_exception/good/split_unlabeled_exception.catala_en @@ -18,24 +18,12 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [28/28] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [1/1] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [1/1] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [6/6] +[RESULT] Invariant typing_defaults checked. result: [28/28] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [1/1] +[RESULT] Invariant no_return_a_function checked. result: [0/0] +[RESULT] Invariant no_partial_evaluation checked. result: [1/1] +[RESULT] Invariant default_no_arrow checked. result: [6/6] [RESULT] Typechecking successful! ``` diff --git a/tests/test_exception/good/two_exceptions_same_outcome.catala_en b/tests/test_exception/good/two_exceptions_same_outcome.catala_en index 694eed4f..05e8f177 100644 --- a/tests/test_exception/good/two_exceptions_same_outcome.catala_en +++ b/tests/test_exception/good/two_exceptions_same_outcome.catala_en @@ -24,24 +24,12 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [45/45] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [2/2] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [2/2] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [10/10] +[RESULT] Invariant typing_defaults checked. result: [43/43] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [0/0] +[RESULT] Invariant no_return_a_function checked. result: [0/0] +[RESULT] Invariant no_partial_evaluation checked. result: [0/0] +[RESULT] Invariant default_no_arrow checked. result: [10/10] [RESULT] Typechecking successful! ``` diff --git a/tests/test_exception/good/two_unlabeled_exceptions.catala_en b/tests/test_exception/good/two_unlabeled_exceptions.catala_en index 0919370b..7f1a47e0 100644 --- a/tests/test_exception/good/two_unlabeled_exceptions.catala_en +++ b/tests/test_exception/good/two_unlabeled_exceptions.catala_en @@ -21,24 +21,12 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [55/55] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [2/2] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [2/2] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [12/12] +[RESULT] Invariant typing_defaults checked. result: [55/55] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [2/2] +[RESULT] Invariant no_return_a_function checked. result: [0/0] +[RESULT] Invariant no_partial_evaluation checked. result: [2/2] +[RESULT] Invariant default_no_arrow checked. result: [12/12] [RESULT] Typechecking successful! ``` diff --git a/tests/test_exception/good/unlabeled_exception.catala_en b/tests/test_exception/good/unlabeled_exception.catala_en index b1dc925e..6fa2bbd5 100644 --- a/tests/test_exception/good/unlabeled_exception.catala_en +++ b/tests/test_exception/good/unlabeled_exception.catala_en @@ -15,24 +15,12 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [28/28] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [1/1] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [1/1] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [6/6] +[RESULT] Invariant typing_defaults checked. result: [28/28] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [1/1] +[RESULT] Invariant no_return_a_function checked. result: [0/0] +[RESULT] Invariant no_partial_evaluation checked. result: [1/1] +[RESULT] Invariant default_no_arrow checked. result: [6/6] [RESULT] Typechecking successful! ``` diff --git a/tests/test_exception/good/unsorted_unlabeled_exceptions.catala_en b/tests/test_exception/good/unsorted_unlabeled_exceptions.catala_en index 396740da..173d6ddd 100644 --- a/tests/test_exception/good/unsorted_unlabeled_exceptions.catala_en +++ b/tests/test_exception/good/unsorted_unlabeled_exceptions.catala_en @@ -21,24 +21,12 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [55/55] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [2/2] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [2/2] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [12/12] +[RESULT] Invariant typing_defaults checked. result: [55/55] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [2/2] +[RESULT] Invariant no_return_a_function checked. result: [0/0] +[RESULT] Invariant no_partial_evaluation checked. result: [2/2] +[RESULT] Invariant default_no_arrow checked. result: [12/12] [RESULT] Typechecking successful! ``` diff --git a/tests/test_func/good/closure_conversion.catala_en b/tests/test_func/good/closure_conversion.catala_en index 92b789fd..79ea94b3 100644 --- a/tests/test_func/good/closure_conversion.catala_en +++ b/tests/test_func/good/closure_conversion.catala_en @@ -15,30 +15,18 @@ scope S: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [28/28] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [2/2] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [1/1] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [2/2] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [4/4] +[RESULT] Invariant typing_defaults checked. result: [27/27] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [1/1] +[RESULT] Invariant no_return_a_function checked. result: [1/1] +[RESULT] Invariant no_partial_evaluation checked. result: [1/1] +[RESULT] Invariant default_no_arrow checked. result: [4/4] [RESULT] Typechecking successful! ``` ```catala-test-inline $ catala Lcalc --avoid-exceptions -O --closure-conversion - +type Eoption = | ENone of unit | ESome of any type S_in = { x_in: bool; } diff --git a/tests/test_func/good/closure_conversion_reduce.catala_en b/tests/test_func/good/closure_conversion_reduce.catala_en index 3a4c9897..d3c03e05 100644 --- a/tests/test_func/good/closure_conversion_reduce.catala_en +++ b/tests/test_func/good/closure_conversion_reduce.catala_en @@ -15,24 +15,12 @@ scope S: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [29/29] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [4/4] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [3/3] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [4/4] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [2/2] +[RESULT] Invariant typing_defaults checked. result: [27/27] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [2/2] +[RESULT] Invariant no_return_a_function checked. result: [3/3] +[RESULT] Invariant no_partial_evaluation checked. result: [2/2] +[RESULT] Invariant default_no_arrow checked. result: [2/2] [RESULT] Typechecking successful! ``` diff --git a/tests/test_func/good/closure_return.catala_en b/tests/test_func/good/closure_return.catala_en index 7e4fabf4..4351199a 100644 --- a/tests/test_func/good/closure_return.catala_en +++ b/tests/test_func/good/closure_return.catala_en @@ -13,30 +13,18 @@ scope S: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [18/18] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [1/1] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [1/1] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [1/1] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [2/2] +[RESULT] Invariant typing_defaults checked. result: [17/17] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [0/0] +[RESULT] Invariant no_return_a_function checked. result: [1/1] +[RESULT] Invariant no_partial_evaluation checked. result: [0/0] +[RESULT] Invariant default_no_arrow checked. result: [2/2] [RESULT] Typechecking successful! ``` ```catala-test-inline $ catala Lcalc --avoid-exceptions -O --closure-conversion - +type Eoption = | ENone of unit | ESome of any type S_in = { x_in: bool; } diff --git a/tests/test_func/good/closure_through_scope.catala_en b/tests/test_func/good/closure_through_scope.catala_en index a23d8bb8..9cc75341 100644 --- a/tests/test_func/good/closure_through_scope.catala_en +++ b/tests/test_func/good/closure_through_scope.catala_en @@ -21,24 +21,12 @@ scope T: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [44/44] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [3/3] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [1/1] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [3/3] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [6/6] +[RESULT] Invariant typing_defaults checked. result: [43/43] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [2/2] +[RESULT] Invariant no_return_a_function checked. result: [1/1] +[RESULT] Invariant no_partial_evaluation checked. result: [2/2] +[RESULT] Invariant default_no_arrow checked. result: [6/6] [RESULT] Typechecking successful! ``` diff --git a/tests/test_func/good/context_func.catala_en b/tests/test_func/good/context_func.catala_en index 1401fa40..d4ee4c20 100644 --- a/tests/test_func/good/context_func.catala_en +++ b/tests/test_func/good/context_func.catala_en @@ -19,24 +19,12 @@ scope B: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [49/49] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [6/6] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [2/2] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [6/6] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [5/5] +[RESULT] Invariant typing_defaults checked. result: [45/45] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [2/2] +[RESULT] Invariant no_return_a_function checked. result: [2/2] +[RESULT] Invariant no_partial_evaluation checked. result: [2/2] +[RESULT] Invariant default_no_arrow checked. result: [5/5] [RESULT] Typechecking successful! ``` diff --git a/tests/test_func/good/func.catala_en b/tests/test_func/good/func.catala_en index 38504f29..e9c632b4 100644 --- a/tests/test_func/good/func.catala_en +++ b/tests/test_func/good/func.catala_en @@ -25,24 +25,12 @@ scope R: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [116/116] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [12/12] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [4/4] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [12/12] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [15/15] +[RESULT] Invariant typing_defaults checked. result: [110/110] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [6/6] +[RESULT] Invariant no_return_a_function checked. result: [4/4] +[RESULT] Invariant no_partial_evaluation checked. result: [6/6] +[RESULT] Invariant default_no_arrow checked. result: [15/15] [RESULT] Typechecking successful! ``` diff --git a/tests/test_func/good/param_consistency.catala_en b/tests/test_func/good/param_consistency.catala_en index e4187abc..1dbf3419 100644 --- a/tests/test_func/good/param_consistency.catala_en +++ b/tests/test_func/good/param_consistency.catala_en @@ -16,24 +16,12 @@ scope S: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [37/37] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [5/5] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [1/1] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [5/5] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [5/5] +[RESULT] Invariant typing_defaults checked. result: [33/33] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [1/1] +[RESULT] Invariant no_return_a_function checked. result: [1/1] +[RESULT] Invariant no_partial_evaluation checked. result: [1/1] +[RESULT] Invariant default_no_arrow checked. result: [5/5] [RESULT] Typechecking successful! ``` diff --git a/tests/test_func/good/scope_call_func_struct_closure.catala_en b/tests/test_func/good/scope_call_func_struct_closure.catala_en index e246f944..72b54546 100644 --- a/tests/test_func/good/scope_call_func_struct_closure.catala_en +++ b/tests/test_func/good/scope_call_func_struct_closure.catala_en @@ -44,30 +44,18 @@ two closures in Foo.r are different even with optimizations enabled. ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [133/133] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [15/15] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [10/10] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [15/15] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [11/11] +[RESULT] Invariant typing_defaults checked. result: [130/130] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [12/12] +[RESULT] Invariant no_return_a_function checked. result: [10/10] +[RESULT] Invariant no_partial_evaluation checked. result: [12/12] +[RESULT] Invariant default_no_arrow checked. result: [11/11] [RESULT] Typechecking successful! ``` ```catala-test-inline $ catala Lcalc --avoid-exceptions -O --closure-conversion - +type Eoption = | ENone of unit | ESome of any type Result = { r: ((closure_env, integer) → integer * closure_env); diff --git a/tests/test_io/good/all_io.catala_en b/tests/test_io/good/all_io.catala_en index 9d324692..4d1189cc 100644 --- a/tests/test_io/good/all_io.catala_en +++ b/tests/test_io/good/all_io.catala_en @@ -21,24 +21,12 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [73/73] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [7/7] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [7/7] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [10/10] +[RESULT] Invariant typing_defaults checked. result: [68/68] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [2/2] +[RESULT] Invariant no_return_a_function checked. result: [0/0] +[RESULT] Invariant no_partial_evaluation checked. result: [2/2] +[RESULT] Invariant default_no_arrow checked. result: [10/10] [RESULT] Typechecking successful! ``` diff --git a/tests/test_io/good/condition_only_input.catala_en b/tests/test_io/good/condition_only_input.catala_en index e1ec2e76..69217783 100644 --- a/tests/test_io/good/condition_only_input.catala_en +++ b/tests/test_io/good/condition_only_input.catala_en @@ -18,24 +18,12 @@ scope B: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [35/35] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [2/2] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [2/2] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [4/4] +[RESULT] Invariant typing_defaults checked. result: [34/34] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [1/1] +[RESULT] Invariant no_return_a_function checked. result: [0/0] +[RESULT] Invariant no_partial_evaluation checked. result: [1/1] +[RESULT] Invariant default_no_arrow checked. result: [4/4] [RESULT] Typechecking successful! ``` diff --git a/tests/test_io/good/subscope.catala_en b/tests/test_io/good/subscope.catala_en index 8b0f9fcb..07b5fedb 100644 --- a/tests/test_io/good/subscope.catala_en +++ b/tests/test_io/good/subscope.catala_en @@ -24,24 +24,12 @@ scope B: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [66/66] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [5/5] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [1/1] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [5/5] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [9/9] +[RESULT] Invariant typing_defaults checked. result: [63/63] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [2/2] +[RESULT] Invariant no_return_a_function checked. result: [1/1] +[RESULT] Invariant no_partial_evaluation checked. result: [2/2] +[RESULT] Invariant default_no_arrow checked. result: [9/9] [RESULT] Typechecking successful! ``` diff --git a/tests/test_literate/good/test_grave_char_en.catala_en b/tests/test_literate/good/test_grave_char_en.catala_en index e9e20a2b..e80bad28 100644 --- a/tests/test_literate/good/test_grave_char_en.catala_en +++ b/tests/test_literate/good/test_grave_char_en.catala_en @@ -31,24 +31,12 @@ int main(void) { return 0; } ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [19/19] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [1/1] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [1/1] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [3/3] +[RESULT] Invariant typing_defaults checked. result: [19/19] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [1/1] +[RESULT] Invariant no_return_a_function checked. result: [0/0] +[RESULT] Invariant no_partial_evaluation checked. result: [1/1] +[RESULT] Invariant default_no_arrow checked. result: [3/3] [RESULT] Typechecking successful! ``` diff --git a/tests/test_literate/good/test_grave_char_fr.catala_fr b/tests/test_literate/good/test_grave_char_fr.catala_fr index 5e481932..74dfe71b 100644 --- a/tests/test_literate/good/test_grave_char_fr.catala_fr +++ b/tests/test_literate/good/test_grave_char_fr.catala_fr @@ -31,24 +31,12 @@ int main(void) { return 0; } ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [19/19] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [1/1] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [1/1] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [3/3] +[RESULT] Invariant typing_defaults checked. result: [19/19] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [1/1] +[RESULT] Invariant no_return_a_function checked. result: [0/0] +[RESULT] Invariant no_partial_evaluation checked. result: [1/1] +[RESULT] Invariant default_no_arrow checked. result: [3/3] [RESULT] Typechecking successful! ``` diff --git a/tests/test_metadata/good/test_markup_refactoring.catala_en b/tests/test_metadata/good/test_markup_refactoring.catala_en index bbed496b..0b7c1058 100644 --- a/tests/test_metadata/good/test_markup_refactoring.catala_en +++ b/tests/test_metadata/good/test_markup_refactoring.catala_en @@ -32,24 +32,12 @@ scope S2: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [40/40] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [2/2] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [2/2] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [6/6] +[RESULT] Invariant typing_defaults checked. result: [40/40] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [2/2] +[RESULT] Invariant no_return_a_function checked. result: [0/0] +[RESULT] Invariant no_partial_evaluation checked. result: [2/2] +[RESULT] Invariant default_no_arrow checked. result: [6/6] [RESULT] Typechecking successful! ``` diff --git a/tests/test_modules/good/mod_def.catala_en b/tests/test_modules/good/mod_def.catala_en index ba73d7a5..a4ab5dde 100644 --- a/tests/test_modules/good/mod_def.catala_en +++ b/tests/test_modules/good/mod_def.catala_en @@ -31,24 +31,12 @@ scope S: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [25/25] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [1/1] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [1/1] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [1/1] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [4/4] +[RESULT] Invariant typing_defaults checked. result: [24/24] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [0/0] +[RESULT] Invariant no_return_a_function checked. result: [1/1] +[RESULT] Invariant no_partial_evaluation checked. result: [0/0] +[RESULT] Invariant default_no_arrow checked. result: [4/4] [RESULT] Typechecking successful! ``` diff --git a/tests/test_modules/good/mod_def_context.catala_en b/tests/test_modules/good/mod_def_context.catala_en index cbed5e57..87678836 100644 --- a/tests/test_modules/good/mod_def_context.catala_en +++ b/tests/test_modules/good/mod_def_context.catala_en @@ -60,24 +60,12 @@ scope Stest: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [210/210] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [21/21] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [17/17] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [21/21] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [22/22] +[RESULT] Invariant typing_defaults checked. result: [207/207] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [18/18] +[RESULT] Invariant no_return_a_function checked. result: [17/17] +[RESULT] Invariant no_partial_evaluation checked. result: [18/18] +[RESULT] Invariant default_no_arrow checked. result: [22/22] [RESULT] Typechecking successful! ``` diff --git a/tests/test_modules/good/mod_middle.catala_en b/tests/test_modules/good/mod_middle.catala_en index 8e065982..0793d59e 100644 --- a/tests/test_modules/good/mod_middle.catala_en +++ b/tests/test_modules/good/mod_middle.catala_en @@ -21,24 +21,12 @@ scope S: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [70/70] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [9/9] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [2/2] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [9/9] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [7/7] +[RESULT] Invariant typing_defaults checked. result: [65/65] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [4/4] +[RESULT] Invariant no_return_a_function checked. result: [2/2] +[RESULT] Invariant no_partial_evaluation checked. result: [4/4] +[RESULT] Invariant default_no_arrow checked. result: [7/7] [RESULT] Typechecking successful! ``` diff --git a/tests/test_modules/good/mod_use.catala_en b/tests/test_modules/good/mod_use.catala_en index d3c07376..54644895 100644 --- a/tests/test_modules/good/mod_use.catala_en +++ b/tests/test_modules/good/mod_use.catala_en @@ -27,24 +27,12 @@ scope T2: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [79/79] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [7/7] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [7/7] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [8/8] +[RESULT] Invariant typing_defaults checked. result: [74/74] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [2/2] +[RESULT] Invariant no_return_a_function checked. result: [0/0] +[RESULT] Invariant no_partial_evaluation checked. result: [2/2] +[RESULT] Invariant default_no_arrow checked. result: [8/8] [RESULT] Typechecking successful! ``` diff --git a/tests/test_modules/good/mod_use2.catala_en b/tests/test_modules/good/mod_use2.catala_en index 77ad73e0..9228a70e 100644 --- a/tests/test_modules/good/mod_use2.catala_en +++ b/tests/test_modules/good/mod_use2.catala_en @@ -19,24 +19,12 @@ scope T: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [49/49] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [1/1] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [1/1] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [1/1] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [8/8] +[RESULT] Invariant typing_defaults checked. result: [49/49] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [1/1] +[RESULT] Invariant no_return_a_function checked. result: [1/1] +[RESULT] Invariant no_partial_evaluation checked. result: [1/1] +[RESULT] Invariant default_no_arrow checked. result: [8/8] [RESULT] Typechecking successful! ``` diff --git a/tests/test_modules/good/mod_use3.catala_en b/tests/test_modules/good/mod_use3.catala_en index 6f06adae..bf2de102 100644 --- a/tests/test_modules/good/mod_use3.catala_en +++ b/tests/test_modules/good/mod_use3.catala_en @@ -23,24 +23,12 @@ scope T: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [49/49] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [1/1] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [1/1] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [1/1] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [8/8] +[RESULT] Invariant typing_defaults checked. result: [49/49] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [1/1] +[RESULT] Invariant no_return_a_function checked. result: [1/1] +[RESULT] Invariant no_partial_evaluation checked. result: [1/1] +[RESULT] Invariant default_no_arrow checked. result: [8/8] [RESULT] Typechecking successful! ``` diff --git a/tests/test_modules/good/mod_use_context.catala_en b/tests/test_modules/good/mod_use_context.catala_en index aa166012..af8fe75a 100644 --- a/tests/test_modules/good/mod_use_context.catala_en +++ b/tests/test_modules/good/mod_use_context.catala_en @@ -44,24 +44,12 @@ scope TestCall: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [148/148] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [17/17] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [16/16] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [17/17] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [13/13] +[RESULT] Invariant typing_defaults checked. result: [146/146] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [15/15] +[RESULT] Invariant no_return_a_function checked. result: [16/16] +[RESULT] Invariant no_partial_evaluation checked. result: [15/15] +[RESULT] Invariant default_no_arrow checked. result: [13/13] [RESULT] Typechecking successful! ``` diff --git a/tests/test_modules/good/output/mod_def.ml b/tests/test_modules/good/output/mod_def.ml index 4a2d5a4e..91e4d782 100644 --- a/tests/test_modules/good/output/mod_def.ml +++ b/tests/test_modules/good/output/mod_def.ml @@ -30,12 +30,15 @@ let s (s_in: S_in.t) : S.t = let sr_: money = try (handle_default - {filename = ""; start_line=0; start_column=1; - end_line=0; end_column=1; law_headings=[]} + {filename = "tests/test_modules/good/mod_def.catala_en"; + start_line=16; start_column=10; end_line=16; end_column=12; + law_headings=["Test modules + inclusions 1"]} ([|(fun (_: unit) -> handle_default - {filename = ""; start_line=0; start_column=1; - end_line=0; end_column=1; law_headings=[]} ([||]) + {filename = "tests/test_modules/good/mod_def.catala_en"; + start_line=16; start_column=10; + end_line=16; end_column=12; + law_headings=["Test modules + inclusions 1"]} ([||]) (fun (_: unit) -> true) (fun (_: unit) -> money_of_cents_string "100000"))|]) (fun (_: unit) -> false) (fun (_: unit) -> raise EmptyError)) @@ -47,12 +50,15 @@ let s (s_in: S_in.t) : S.t = let e1_: Enum1.t = try (handle_default - {filename = ""; start_line=0; start_column=1; - end_line=0; end_column=1; law_headings=[]} + {filename = "tests/test_modules/good/mod_def.catala_en"; + start_line=17; start_column=10; end_line=17; end_column=12; + law_headings=["Test modules + inclusions 1"]} ([|(fun (_: unit) -> handle_default - {filename = ""; start_line=0; start_column=1; - end_line=0; end_column=1; law_headings=[]} ([||]) + {filename = "tests/test_modules/good/mod_def.catala_en"; + start_line=17; start_column=10; + end_line=17; end_column=12; + law_headings=["Test modules + inclusions 1"]} ([||]) (fun (_: unit) -> true) (fun (_: unit) -> Enum1.Maybe ()))|]) (fun (_: unit) -> false) (fun (_: unit) -> raise EmptyError)) with diff --git a/tests/test_money/bad/no_mingle.catala_en b/tests/test_money/bad/no_mingle.catala_en index f3b5760e..0fa32b57 100644 --- a/tests/test_money/bad/no_mingle.catala_en +++ b/tests/test_money/bad/no_mingle.catala_en @@ -18,10 +18,10 @@ $ catala Interpret -s A I don't know how to apply operator * on types money and money -┌─⯈ tests/test_money/bad/no_mingle.catala_en:12.26-12.27: +┌─⯈ tests/test_money/bad/no_mingle.catala_en:12.24-12.29: └──┐ 12 │ definition z equals (x * y) - │ ‾ + │ ‾‾‾‾‾ └─ Article Type money coming from expression: diff --git a/tests/test_money/good/literal_parsing.catala_en b/tests/test_money/good/literal_parsing.catala_en index 09fce237..5e174fd4 100644 --- a/tests/test_money/good/literal_parsing.catala_en +++ b/tests/test_money/good/literal_parsing.catala_en @@ -15,24 +15,12 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [27/27] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [2/2] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [2/2] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [4/4] +[RESULT] Invariant typing_defaults checked. result: [25/25] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [0/0] +[RESULT] Invariant no_return_a_function checked. result: [0/0] +[RESULT] Invariant no_partial_evaluation checked. result: [0/0] +[RESULT] Invariant default_no_arrow checked. result: [4/4] [RESULT] Typechecking successful! ``` diff --git a/tests/test_money/good/simple.catala_en b/tests/test_money/good/simple.catala_en index affc6ede..2c30fbcd 100644 --- a/tests/test_money/good/simple.catala_en +++ b/tests/test_money/good/simple.catala_en @@ -16,24 +16,12 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [64/64] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [6/6] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [6/6] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [9/9] +[RESULT] Invariant typing_defaults checked. result: [61/61] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [3/3] +[RESULT] Invariant no_return_a_function checked. result: [0/0] +[RESULT] Invariant no_partial_evaluation checked. result: [3/3] +[RESULT] Invariant default_no_arrow checked. result: [9/9] [RESULT] Typechecking successful! ``` diff --git a/tests/test_name_resolution/good/let_in.catala_en b/tests/test_name_resolution/good/let_in.catala_en index 54ebb4f8..8d0beefc 100644 --- a/tests/test_name_resolution/good/let_in.catala_en +++ b/tests/test_name_resolution/good/let_in.catala_en @@ -29,24 +29,12 @@ scope S: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [64/64] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [7/7] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [3/3] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [7/7] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [6/6] +[RESULT] Invariant typing_defaults checked. result: [62/62] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [5/5] +[RESULT] Invariant no_return_a_function checked. result: [3/3] +[RESULT] Invariant no_partial_evaluation checked. result: [5/5] +[RESULT] Invariant default_no_arrow checked. result: [6/6] [RESULT] Typechecking successful! ``` diff --git a/tests/test_name_resolution/good/let_in2.catala_en b/tests/test_name_resolution/good/let_in2.catala_en index 18efba54..7e2abbc6 100644 --- a/tests/test_name_resolution/good/let_in2.catala_en +++ b/tests/test_name_resolution/good/let_in2.catala_en @@ -17,24 +17,12 @@ scope S: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [28/28] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [4/4] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [2/2] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [4/4] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [3/3] +[RESULT] Invariant typing_defaults checked. result: [27/27] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [3/3] +[RESULT] Invariant no_return_a_function checked. result: [2/2] +[RESULT] Invariant no_partial_evaluation checked. result: [3/3] +[RESULT] Invariant default_no_arrow checked. result: [3/3] [RESULT] Typechecking successful! ``` @@ -75,19 +63,23 @@ let s (s_in: S_in.t) : S.t = let a_: bool = try (handle_default - {filename = ""; start_line=0; start_column=1; - end_line=0; end_column=1; law_headings=[]} - ([|(fun (_: unit) -> a_ ())|]) (fun (_: unit) -> true) + {filename = "tests/test_name_resolution/good/let_in2.catala_en"; + start_line=7; start_column=18; end_line=7; end_column=19; + law_headings=["Article"]} ([|(fun (_: unit) -> a_ ())|]) + (fun (_: unit) -> true) (fun (_: unit) -> try (handle_default - {filename = ""; start_line=0; start_column=1; - end_line=0; end_column=1; law_headings=[]} + {filename = "tests/test_name_resolution/good/let_in2.catala_en"; + start_line=7; start_column=18; end_line=7; end_column=19; + law_headings=["Article"]} ([|(fun (_: unit) -> handle_default - {filename = ""; start_line=0; start_column=1; - end_line=0; end_column=1; law_headings=[]} ( - [||]) (fun (_: unit) -> true) + {filename = "tests/test_name_resolution/good/let_in2.catala_en"; + start_line=7; start_column=18; + end_line=7; end_column=19; + law_headings=["Article"]} ([||]) + (fun (_: unit) -> true) (fun (_: unit) -> (let a_ : bool = false in (let a_ : bool = (o_or a_ true) in diff --git a/tests/test_name_resolution/good/out_of_order.catala_en b/tests/test_name_resolution/good/out_of_order.catala_en index c1a5f40a..63939799 100644 --- a/tests/test_name_resolution/good/out_of_order.catala_en +++ b/tests/test_name_resolution/good/out_of_order.catala_en @@ -22,24 +22,12 @@ scope S: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [41/41] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [2/2] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [2/2] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [6/6] +[RESULT] Invariant typing_defaults checked. result: [41/41] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [2/2] +[RESULT] Invariant no_return_a_function checked. result: [0/0] +[RESULT] Invariant no_partial_evaluation checked. result: [2/2] +[RESULT] Invariant default_no_arrow checked. result: [6/6] [RESULT] Typechecking successful! ``` diff --git a/tests/test_name_resolution/good/toplevel_defs.catala_en b/tests/test_name_resolution/good/toplevel_defs.catala_en index c83eaac1..6866fb50 100644 --- a/tests/test_name_resolution/good/toplevel_defs.catala_en +++ b/tests/test_name_resolution/good/toplevel_defs.catala_en @@ -23,24 +23,12 @@ scope S: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [32/32] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [3/3] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [3/3] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [4/4] +[RESULT] Invariant typing_defaults checked. result: [29/29] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [0/0] +[RESULT] Invariant no_return_a_function checked. result: [0/0] +[RESULT] Invariant no_partial_evaluation checked. result: [0/0] +[RESULT] Invariant default_no_arrow checked. result: [4/4] [RESULT] Typechecking successful! ``` @@ -447,18 +435,21 @@ def s2(s2_in:S2In): decimal_of_string("100.")) def temp_a_4(_:Unit): return True - return handle_default(SourcePosition(filename="", start_line=0, - start_column=1, end_line=0, end_column=1, - law_headings=[]), [], temp_a_4, temp_a_3) - temp_a_5 = handle_default(SourcePosition(filename="", start_line=0, - start_column=1, end_line=0, end_column=1, - law_headings=[]), [temp_a_2], temp_a_1, - temp_a) + return handle_default(SourcePosition(filename="tests/test_name_resolution/good/toplevel_defs.catala_en", + start_line=50, start_column=10, + end_line=50, end_column=11, + law_headings=["Test toplevel function defs"]), [], + temp_a_4, temp_a_3) + temp_a_5 = handle_default(SourcePosition(filename="tests/test_name_resolution/good/toplevel_defs.catala_en", + start_line=50, start_column=10, + end_line=50, end_column=11, + law_headings=["Test toplevel function defs"]), [temp_a_2], + temp_a_1, temp_a) except EmptyError: temp_a_5 = dead_value raise NoValueProvided(SourcePosition(filename="tests/test_name_resolution/good/toplevel_defs.catala_en", - start_line=62, start_column=10, - end_line=62, end_column=11, + start_line=50, start_column=10, + end_line=50, end_column=11, law_headings=["Test toplevel function defs"])) a = temp_a_5 return S2(a = a) @@ -476,18 +467,21 @@ def s3(s3_in:S3In): decimal_of_string("55."))) def temp_a_10(_:Unit): return True - return handle_default(SourcePosition(filename="", start_line=0, - start_column=1, end_line=0, end_column=1, - law_headings=[]), [], temp_a_10, temp_a_9) - temp_a_11 = handle_default(SourcePosition(filename="", start_line=0, - start_column=1, end_line=0, end_column=1, - law_headings=[]), [temp_a_8], temp_a_7, - temp_a_6) + return handle_default(SourcePosition(filename="tests/test_name_resolution/good/toplevel_defs.catala_en", + start_line=70, start_column=10, + end_line=70, end_column=11, + law_headings=["Test function def with two args"]), [], + temp_a_10, temp_a_9) + temp_a_11 = handle_default(SourcePosition(filename="tests/test_name_resolution/good/toplevel_defs.catala_en", + start_line=70, start_column=10, + end_line=70, end_column=11, + law_headings=["Test function def with two args"]), [temp_a_8], + temp_a_7, temp_a_6) except EmptyError: temp_a_11 = dead_value raise NoValueProvided(SourcePosition(filename="tests/test_name_resolution/good/toplevel_defs.catala_en", - start_line=82, start_column=10, - end_line=82, end_column=11, + start_line=70, start_column=10, + end_line=70, end_column=11, law_headings=["Test function def with two args"])) a_1 = temp_a_11 return S3(a = a_1) @@ -503,18 +497,21 @@ def s4(s4_in:S4In): return (glob5 + decimal_of_string("1.")) def temp_a_16(_:Unit): return True - return handle_default(SourcePosition(filename="", start_line=0, - start_column=1, end_line=0, end_column=1, - law_headings=[]), [], temp_a_16, temp_a_15) - temp_a_17 = handle_default(SourcePosition(filename="", start_line=0, - start_column=1, end_line=0, end_column=1, - law_headings=[]), [temp_a_14], temp_a_13, - temp_a_12) + return handle_default(SourcePosition(filename="tests/test_name_resolution/good/toplevel_defs.catala_en", + start_line=93, start_column=10, + end_line=93, end_column=11, + law_headings=["Test inline defs in toplevel defs"]), [], + temp_a_16, temp_a_15) + temp_a_17 = handle_default(SourcePosition(filename="tests/test_name_resolution/good/toplevel_defs.catala_en", + start_line=93, start_column=10, + end_line=93, end_column=11, + law_headings=["Test inline defs in toplevel defs"]), [temp_a_14], + temp_a_13, temp_a_12) except EmptyError: temp_a_17 = dead_value raise NoValueProvided(SourcePosition(filename="tests/test_name_resolution/good/toplevel_defs.catala_en", - start_line=105, start_column=10, - end_line=105, end_column=11, + start_line=93, start_column=10, + end_line=93, end_column=11, law_headings=["Test inline defs in toplevel defs"])) a_2 = temp_a_17 return S4(a = a_2) @@ -530,13 +527,16 @@ def s(s_in:SIn): return (glob1 * glob1) def temp_a_22(_:Unit): return True - return handle_default(SourcePosition(filename="", start_line=0, - start_column=1, end_line=0, end_column=1, - law_headings=[]), [], temp_a_22, temp_a_21) - temp_a_23 = handle_default(SourcePosition(filename="", start_line=0, - start_column=1, end_line=0, end_column=1, - law_headings=[]), [temp_a_20], temp_a_19, - temp_a_18) + return handle_default(SourcePosition(filename="tests/test_name_resolution/good/toplevel_defs.catala_en", + start_line=7, start_column=10, + end_line=7, end_column=11, + law_headings=["Test basic toplevel values defs"]), [], + temp_a_22, temp_a_21) + temp_a_23 = handle_default(SourcePosition(filename="tests/test_name_resolution/good/toplevel_defs.catala_en", + start_line=7, start_column=10, + end_line=7, end_column=11, + law_headings=["Test basic toplevel values defs"]), [temp_a_20], + temp_a_19, temp_a_18) except EmptyError: temp_a_23 = dead_value raise NoValueProvided(SourcePosition(filename="tests/test_name_resolution/good/toplevel_defs.catala_en", @@ -554,13 +554,16 @@ def s(s_in:SIn): return glob2 def temp_b_4(_:Unit): return True - return handle_default(SourcePosition(filename="", start_line=0, - start_column=1, end_line=0, end_column=1, - law_headings=[]), [], temp_b_4, temp_b_3) - temp_b_5 = handle_default(SourcePosition(filename="", start_line=0, - start_column=1, end_line=0, end_column=1, - law_headings=[]), [temp_b_2], temp_b_1, - temp_b) + return handle_default(SourcePosition(filename="tests/test_name_resolution/good/toplevel_defs.catala_en", + start_line=8, start_column=10, + end_line=8, end_column=11, + law_headings=["Test basic toplevel values defs"]), [], + temp_b_4, temp_b_3) + temp_b_5 = handle_default(SourcePosition(filename="tests/test_name_resolution/good/toplevel_defs.catala_en", + start_line=8, start_column=10, + end_line=8, end_column=11, + law_headings=["Test basic toplevel values defs"]), [temp_b_2], + temp_b_1, temp_b) except EmptyError: temp_b_5 = dead_value raise NoValueProvided(SourcePosition(filename="tests/test_name_resolution/good/toplevel_defs.catala_en", diff --git a/tests/test_name_resolution/good/toplevel_defs_simple.catala_en b/tests/test_name_resolution/good/toplevel_defs_simple.catala_en index 5a5a2f27..58f35707 100644 --- a/tests/test_name_resolution/good/toplevel_defs_simple.catala_en +++ b/tests/test_name_resolution/good/toplevel_defs_simple.catala_en @@ -14,24 +14,12 @@ scope S: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [14/14] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [1/1] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [1/1] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [2/2] +[RESULT] Invariant typing_defaults checked. result: [13/13] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [0/0] +[RESULT] Invariant no_return_a_function checked. result: [0/0] +[RESULT] Invariant no_partial_evaluation checked. result: [0/0] +[RESULT] Invariant default_no_arrow checked. result: [2/2] [RESULT] Typechecking successful! ``` diff --git a/tests/test_proof/good/array_length.catala_en b/tests/test_proof/good/array_length.catala_en index 236126b7..63869b38 100644 --- a/tests/test_proof/good/array_length.catala_en +++ b/tests/test_proof/good/array_length.catala_en @@ -15,24 +15,12 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [34/34] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [4/4] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [4/4] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [5/5] +[RESULT] Invariant typing_defaults checked. result: [30/30] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [0/0] +[RESULT] Invariant no_return_a_function checked. result: [0/0] +[RESULT] Invariant no_partial_evaluation checked. result: [0/0] +[RESULT] Invariant default_no_arrow checked. result: [5/5] [RESULT] Typechecking successful! ``` diff --git a/tests/test_proof/good/assert.catala_en b/tests/test_proof/good/assert.catala_en index e9204d50..32ffb70d 100644 --- a/tests/test_proof/good/assert.catala_en +++ b/tests/test_proof/good/assert.catala_en @@ -26,24 +26,12 @@ scope Foo: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [58/58] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [12/12] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [12/12] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [4/4] +[RESULT] Invariant typing_defaults checked. result: [46/46] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [0/0] +[RESULT] Invariant no_return_a_function checked. result: [0/0] +[RESULT] Invariant no_partial_evaluation checked. result: [0/0] +[RESULT] Invariant default_no_arrow checked. result: [4/4] [RESULT] Typechecking successful! ``` diff --git a/tests/test_proof/good/dates_get_year.catala_en b/tests/test_proof/good/dates_get_year.catala_en index 281d5f88..d990df1e 100644 --- a/tests/test_proof/good/dates_get_year.catala_en +++ b/tests/test_proof/good/dates_get_year.catala_en @@ -17,24 +17,12 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [66/66] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [14/14] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [14/14] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [7/7] +[RESULT] Invariant typing_defaults checked. result: [52/52] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [0/0] +[RESULT] Invariant no_return_a_function checked. result: [0/0] +[RESULT] Invariant no_partial_evaluation checked. result: [0/0] +[RESULT] Invariant default_no_arrow checked. result: [7/7] [RESULT] Typechecking successful! ``` diff --git a/tests/test_proof/good/dates_simple.catala_en b/tests/test_proof/good/dates_simple.catala_en index 50387841..bcc61ca3 100644 --- a/tests/test_proof/good/dates_simple.catala_en +++ b/tests/test_proof/good/dates_simple.catala_en @@ -17,24 +17,12 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [54/54] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [8/8] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [8/8] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [7/7] +[RESULT] Invariant typing_defaults checked. result: [46/46] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [0/0] +[RESULT] Invariant no_return_a_function checked. result: [0/0] +[RESULT] Invariant no_partial_evaluation checked. result: [0/0] +[RESULT] Invariant default_no_arrow checked. result: [7/7] [RESULT] Typechecking successful! ``` diff --git a/tests/test_proof/good/direct_scope_call.catala_en b/tests/test_proof/good/direct_scope_call.catala_en index 8b18d2e2..e44244c9 100644 --- a/tests/test_proof/good/direct_scope_call.catala_en +++ b/tests/test_proof/good/direct_scope_call.catala_en @@ -18,24 +18,12 @@ scope Foo: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [40/40] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [4/4] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [2/2] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [4/4] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [4/4] +[RESULT] Invariant typing_defaults checked. result: [39/39] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [3/3] +[RESULT] Invariant no_return_a_function checked. result: [2/2] +[RESULT] Invariant no_partial_evaluation checked. result: [3/3] +[RESULT] Invariant default_no_arrow checked. result: [4/4] [RESULT] Typechecking successful! ``` diff --git a/tests/test_proof/good/direct_scope_call_with_context.catala_en b/tests/test_proof/good/direct_scope_call_with_context.catala_en index 273a0793..e4daac80 100644 --- a/tests/test_proof/good/direct_scope_call_with_context.catala_en +++ b/tests/test_proof/good/direct_scope_call_with_context.catala_en @@ -19,24 +19,12 @@ scope Foo: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [56/56] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [5/5] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [3/3] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [5/5] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [7/7] +[RESULT] Invariant typing_defaults checked. result: [55/55] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [4/4] +[RESULT] Invariant no_return_a_function checked. result: [3/3] +[RESULT] Invariant no_partial_evaluation checked. result: [4/4] +[RESULT] Invariant default_no_arrow checked. result: [7/7] [RESULT] Typechecking successful! ``` diff --git a/tests/test_proof/good/duration.catala_en b/tests/test_proof/good/duration.catala_en index 9c4e077f..bddc381a 100644 --- a/tests/test_proof/good/duration.catala_en +++ b/tests/test_proof/good/duration.catala_en @@ -15,24 +15,12 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [34/34] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [4/4] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [4/4] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [5/5] +[RESULT] Invariant typing_defaults checked. result: [30/30] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [0/0] +[RESULT] Invariant no_return_a_function checked. result: [0/0] +[RESULT] Invariant no_partial_evaluation checked. result: [0/0] +[RESULT] Invariant default_no_arrow checked. result: [5/5] [RESULT] Typechecking successful! ``` diff --git a/tests/test_proof/good/enums-arith.catala_en b/tests/test_proof/good/enums-arith.catala_en index 7cc79041..3cc2b41e 100644 --- a/tests/test_proof/good/enums-arith.catala_en +++ b/tests/test_proof/good/enums-arith.catala_en @@ -30,24 +30,12 @@ $ catala Typecheck --check-invariants 5 │ -- C content boolean │ ‾ └─ Test -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [40/40] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [2/2] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [2/2] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [4/4] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [2/2] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [5/5] +[RESULT] Invariant typing_defaults checked. result: [38/38] +[RESULT] Invariant match_inversion checked. result: [2/2] +[RESULT] Invariant app_inversion checked. result: [0/0] +[RESULT] Invariant no_return_a_function checked. result: [4/4] +[RESULT] Invariant no_partial_evaluation checked. result: [0/0] +[RESULT] Invariant default_no_arrow checked. result: [5/5] [RESULT] Typechecking successful! ``` diff --git a/tests/test_proof/good/enums-nonbool.catala_en b/tests/test_proof/good/enums-nonbool.catala_en index 410361d7..dffcd6cb 100644 --- a/tests/test_proof/good/enums-nonbool.catala_en +++ b/tests/test_proof/good/enums-nonbool.catala_en @@ -30,24 +30,12 @@ $ catala Typecheck --check-invariants 5 │ -- C content boolean │ ‾ └─ Test -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [37/37] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [2/2] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [1/1] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [4/4] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [1/1] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [5/5] +[RESULT] Invariant typing_defaults checked. result: [36/36] +[RESULT] Invariant match_inversion checked. result: [2/2] +[RESULT] Invariant app_inversion checked. result: [0/0] +[RESULT] Invariant no_return_a_function checked. result: [4/4] +[RESULT] Invariant no_partial_evaluation checked. result: [0/0] +[RESULT] Invariant default_no_arrow checked. result: [5/5] [RESULT] Typechecking successful! ``` diff --git a/tests/test_proof/good/enums.catala_en b/tests/test_proof/good/enums.catala_en index e1ab04c5..5c4ac463 100644 --- a/tests/test_proof/good/enums.catala_en +++ b/tests/test_proof/good/enums.catala_en @@ -29,24 +29,12 @@ $ catala Typecheck --check-invariants 5 │ -- C content boolean │ ‾ └─ Test -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [34/34] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [2/2] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [4/4] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [5/5] +[RESULT] Invariant typing_defaults checked. result: [34/34] +[RESULT] Invariant match_inversion checked. result: [2/2] +[RESULT] Invariant app_inversion checked. result: [0/0] +[RESULT] Invariant no_return_a_function checked. result: [4/4] +[RESULT] Invariant no_partial_evaluation checked. result: [0/0] +[RESULT] Invariant default_no_arrow checked. result: [5/5] [RESULT] Typechecking successful! ``` diff --git a/tests/test_proof/good/enums_inj.catala_en b/tests/test_proof/good/enums_inj.catala_en index c4b878fc..7de0836c 100644 --- a/tests/test_proof/good/enums_inj.catala_en +++ b/tests/test_proof/good/enums_inj.catala_en @@ -19,24 +19,12 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [31/31] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [2/2] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [2/2] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [5/5] +[RESULT] Invariant typing_defaults checked. result: [29/29] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [0/0] +[RESULT] Invariant no_return_a_function checked. result: [0/0] +[RESULT] Invariant no_partial_evaluation checked. result: [0/0] +[RESULT] Invariant default_no_arrow checked. result: [5/5] [RESULT] Typechecking successful! ``` diff --git a/tests/test_proof/good/enums_unit.catala_en b/tests/test_proof/good/enums_unit.catala_en index 4da05cfe..ea58a08b 100644 --- a/tests/test_proof/good/enums_unit.catala_en +++ b/tests/test_proof/good/enums_unit.catala_en @@ -23,24 +23,12 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [33/33] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [2/2] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [4/4] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [5/5] +[RESULT] Invariant typing_defaults checked. result: [33/33] +[RESULT] Invariant match_inversion checked. result: [2/2] +[RESULT] Invariant app_inversion checked. result: [0/0] +[RESULT] Invariant no_return_a_function checked. result: [4/4] +[RESULT] Invariant no_partial_evaluation checked. result: [0/0] +[RESULT] Invariant default_no_arrow checked. result: [5/5] [RESULT] Typechecking successful! ``` diff --git a/tests/test_proof/good/functions.catala_en b/tests/test_proof/good/functions.catala_en index 1f4b0568..bc51ddfa 100644 --- a/tests/test_proof/good/functions.catala_en +++ b/tests/test_proof/good/functions.catala_en @@ -16,24 +16,12 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [48/48] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [7/7] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [1/1] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [7/7] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [7/7] +[RESULT] Invariant typing_defaults checked. result: [44/44] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [3/3] +[RESULT] Invariant no_return_a_function checked. result: [1/1] +[RESULT] Invariant no_partial_evaluation checked. result: [3/3] +[RESULT] Invariant default_no_arrow checked. result: [7/7] [RESULT] Typechecking successful! ``` diff --git a/tests/test_proof/good/let_in_condition.catala_en b/tests/test_proof/good/let_in_condition.catala_en index 572b50a9..73a718a2 100644 --- a/tests/test_proof/good/let_in_condition.catala_en +++ b/tests/test_proof/good/let_in_condition.catala_en @@ -15,24 +15,12 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [13/13] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [1/1] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [1/1] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [1/1] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [2/2] +[RESULT] Invariant typing_defaults checked. result: [13/13] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [1/1] +[RESULT] Invariant no_return_a_function checked. result: [1/1] +[RESULT] Invariant no_partial_evaluation checked. result: [1/1] +[RESULT] Invariant default_no_arrow checked. result: [2/2] [RESULT] Typechecking successful! ``` diff --git a/tests/test_proof/good/money.catala_en b/tests/test_proof/good/money.catala_en index 4332c56a..59981f50 100644 --- a/tests/test_proof/good/money.catala_en +++ b/tests/test_proof/good/money.catala_en @@ -17,24 +17,12 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [54/54] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [8/8] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [8/8] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [7/7] +[RESULT] Invariant typing_defaults checked. result: [46/46] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [0/0] +[RESULT] Invariant no_return_a_function checked. result: [0/0] +[RESULT] Invariant no_partial_evaluation checked. result: [0/0] +[RESULT] Invariant default_no_arrow checked. result: [7/7] [RESULT] Typechecking successful! ``` diff --git a/tests/test_proof/good/no_vars.catala_en b/tests/test_proof/good/no_vars.catala_en index 3cbab215..dc82e5f0 100644 --- a/tests/test_proof/good/no_vars.catala_en +++ b/tests/test_proof/good/no_vars.catala_en @@ -12,24 +12,12 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [31/31] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [7/7] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [7/7] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [2/2] +[RESULT] Invariant typing_defaults checked. result: [24/24] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [0/0] +[RESULT] Invariant no_return_a_function checked. result: [0/0] +[RESULT] Invariant no_partial_evaluation checked. result: [0/0] +[RESULT] Invariant default_no_arrow checked. result: [2/2] [RESULT] Typechecking successful! ``` diff --git a/tests/test_proof/good/rationals.catala_en b/tests/test_proof/good/rationals.catala_en index 71ff1607..385a76bf 100644 --- a/tests/test_proof/good/rationals.catala_en +++ b/tests/test_proof/good/rationals.catala_en @@ -15,24 +15,12 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [34/34] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [4/4] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [4/4] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [5/5] +[RESULT] Invariant typing_defaults checked. result: [30/30] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [0/0] +[RESULT] Invariant no_return_a_function checked. result: [0/0] +[RESULT] Invariant no_partial_evaluation checked. result: [0/0] +[RESULT] Invariant default_no_arrow checked. result: [5/5] [RESULT] Typechecking successful! ``` diff --git a/tests/test_proof/good/simple_vars.catala_en b/tests/test_proof/good/simple_vars.catala_en index e35b48b6..5bb0409b 100644 --- a/tests/test_proof/good/simple_vars.catala_en +++ b/tests/test_proof/good/simple_vars.catala_en @@ -18,24 +18,12 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [49/49] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [4/4] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [4/4] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [9/9] +[RESULT] Invariant typing_defaults checked. result: [45/45] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [0/0] +[RESULT] Invariant no_return_a_function checked. result: [0/0] +[RESULT] Invariant no_partial_evaluation checked. result: [0/0] +[RESULT] Invariant default_no_arrow checked. result: [9/9] [RESULT] Typechecking successful! ``` diff --git a/tests/test_proof/good/structs.catala_en b/tests/test_proof/good/structs.catala_en index 9eef8b04..4cd6c24a 100644 --- a/tests/test_proof/good/structs.catala_en +++ b/tests/test_proof/good/structs.catala_en @@ -22,24 +22,12 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [48/48] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [6/6] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [6/6] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [5/5] +[RESULT] Invariant typing_defaults checked. result: [42/42] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [0/0] +[RESULT] Invariant no_return_a_function checked. result: [0/0] +[RESULT] Invariant no_partial_evaluation checked. result: [0/0] +[RESULT] Invariant default_no_arrow checked. result: [5/5] [RESULT] Typechecking successful! ``` diff --git a/tests/test_scope/good/191_fix_record_name_confusion.catala_en b/tests/test_scope/good/191_fix_record_name_confusion.catala_en index bcc736a9..320a6d38 100644 --- a/tests/test_scope/good/191_fix_record_name_confusion.catala_en +++ b/tests/test_scope/good/191_fix_record_name_confusion.catala_en @@ -19,24 +19,12 @@ scope ScopeB: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [25/25] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [1/1] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [1/1] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [4/4] +[RESULT] Invariant typing_defaults checked. result: [25/25] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [1/1] +[RESULT] Invariant no_return_a_function checked. result: [0/0] +[RESULT] Invariant no_partial_evaluation checked. result: [1/1] +[RESULT] Invariant default_no_arrow checked. result: [4/4] [RESULT] Typechecking successful! ``` diff --git a/tests/test_scope/good/grand_parent_caller.catala_en b/tests/test_scope/good/grand_parent_caller.catala_en index 24c53334..41da8d54 100644 --- a/tests/test_scope/good/grand_parent_caller.catala_en +++ b/tests/test_scope/good/grand_parent_caller.catala_en @@ -33,24 +33,12 @@ scope C: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [126/126] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [7/7] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [3/3] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [7/7] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [19/19] +[RESULT] Invariant typing_defaults checked. result: [126/126] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [7/7] +[RESULT] Invariant no_return_a_function checked. result: [3/3] +[RESULT] Invariant no_partial_evaluation checked. result: [7/7] +[RESULT] Invariant default_no_arrow checked. result: [19/19] [RESULT] Typechecking successful! ``` diff --git a/tests/test_scope/good/nothing.catala_en b/tests/test_scope/good/nothing.catala_en index f76fac49..888d96b6 100644 --- a/tests/test_scope/good/nothing.catala_en +++ b/tests/test_scope/good/nothing.catala_en @@ -16,24 +16,12 @@ $ catala Typecheck --check-invariants 5 │ output bar content integer │ ‾‾‾ └─ Test -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [6/6] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [1/1] +[RESULT] Invariant typing_defaults checked. result: [6/6] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [0/0] +[RESULT] Invariant no_return_a_function checked. result: [0/0] +[RESULT] Invariant no_partial_evaluation checked. result: [0/0] +[RESULT] Invariant default_no_arrow checked. result: [1/1] [RESULT] Typechecking successful! ``` diff --git a/tests/test_scope/good/scope_call.catala_en b/tests/test_scope/good/scope_call.catala_en index 9347240e..7941bc2c 100644 --- a/tests/test_scope/good/scope_call.catala_en +++ b/tests/test_scope/good/scope_call.catala_en @@ -24,24 +24,12 @@ scope Foo: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [90/90] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [12/12] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [5/5] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [12/12] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [6/6] +[RESULT] Invariant typing_defaults checked. result: [85/85] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [7/7] +[RESULT] Invariant no_return_a_function checked. result: [5/5] +[RESULT] Invariant no_partial_evaluation checked. result: [7/7] +[RESULT] Invariant default_no_arrow checked. result: [6/6] [RESULT] Typechecking successful! ``` diff --git a/tests/test_scope/good/scope_call2.catala_en b/tests/test_scope/good/scope_call2.catala_en index f74e815e..be2b5f36 100644 --- a/tests/test_scope/good/scope_call2.catala_en +++ b/tests/test_scope/good/scope_call2.catala_en @@ -22,24 +22,12 @@ scope Titi: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [94/94] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [9/9] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [7/7] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [9/9] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [11/11] +[RESULT] Invariant typing_defaults checked. result: [93/93] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [8/8] +[RESULT] Invariant no_return_a_function checked. result: [7/7] +[RESULT] Invariant no_partial_evaluation checked. result: [8/8] +[RESULT] Invariant default_no_arrow checked. result: [11/11] [RESULT] Typechecking successful! ``` diff --git a/tests/test_scope/good/scope_call3.catala_en b/tests/test_scope/good/scope_call3.catala_en index d51f9fa2..9a5ee2a2 100644 --- a/tests/test_scope/good/scope_call3.catala_en +++ b/tests/test_scope/good/scope_call3.catala_en @@ -20,24 +20,12 @@ scope RentComputation: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [69/69] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [9/9] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [6/6] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [9/9] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [8/8] +[RESULT] Invariant typing_defaults checked. result: [67/67] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [7/7] +[RESULT] Invariant no_return_a_function checked. result: [6/6] +[RESULT] Invariant no_partial_evaluation checked. result: [7/7] +[RESULT] Invariant default_no_arrow checked. result: [8/8] [RESULT] Typechecking successful! ``` diff --git a/tests/test_scope/good/scope_call4.catala_en b/tests/test_scope/good/scope_call4.catala_en index 5bac957c..511fe4f8 100644 --- a/tests/test_scope/good/scope_call4.catala_en +++ b/tests/test_scope/good/scope_call4.catala_en @@ -26,24 +26,12 @@ scope RentComputation: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [129/129] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [19/19] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [13/13] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [19/19] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [13/13] +[RESULT] Invariant typing_defaults checked. result: [126/126] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [16/16] +[RESULT] Invariant no_return_a_function checked. result: [13/13] +[RESULT] Invariant no_partial_evaluation checked. result: [16/16] +[RESULT] Invariant default_no_arrow checked. result: [13/13] [RESULT] Typechecking successful! ``` diff --git a/tests/test_scope/good/simple.catala_en b/tests/test_scope/good/simple.catala_en index 3e0daa57..24530258 100644 --- a/tests/test_scope/good/simple.catala_en +++ b/tests/test_scope/good/simple.catala_en @@ -12,24 +12,12 @@ scope Foo: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [10/10] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [2/2] +[RESULT] Invariant typing_defaults checked. result: [10/10] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [0/0] +[RESULT] Invariant no_return_a_function checked. result: [0/0] +[RESULT] Invariant no_partial_evaluation checked. result: [0/0] +[RESULT] Invariant default_no_arrow checked. result: [2/2] [RESULT] Typechecking successful! ``` diff --git a/tests/test_scope/good/sub_scope.catala_en b/tests/test_scope/good/sub_scope.catala_en index f419ab2f..17e1f9df 100644 --- a/tests/test_scope/good/sub_scope.catala_en +++ b/tests/test_scope/good/sub_scope.catala_en @@ -27,24 +27,12 @@ scope B: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [140/140] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [9/9] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [6/6] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [9/9] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [17/17] +[RESULT] Invariant typing_defaults checked. result: [138/138] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [7/7] +[RESULT] Invariant no_return_a_function checked. result: [6/6] +[RESULT] Invariant no_partial_evaluation checked. result: [7/7] +[RESULT] Invariant default_no_arrow checked. result: [17/17] [RESULT] Typechecking successful! ``` diff --git a/tests/test_scope/good/sub_sub_scope.catala_en b/tests/test_scope/good/sub_sub_scope.catala_en index f863227a..acfbf8ad 100644 --- a/tests/test_scope/good/sub_sub_scope.catala_en +++ b/tests/test_scope/good/sub_sub_scope.catala_en @@ -34,24 +34,12 @@ scope C: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [153/153] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [11/11] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [7/7] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [11/11] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [19/19] +[RESULT] Invariant typing_defaults checked. result: [150/150] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [8/8] +[RESULT] Invariant no_return_a_function checked. result: [7/7] +[RESULT] Invariant no_partial_evaluation checked. result: [8/8] +[RESULT] Invariant default_no_arrow checked. result: [19/19] [RESULT] Typechecking successful! ``` diff --git a/tests/test_scope/good/subscope_function_arg_not_defined.catala_en b/tests/test_scope/good/subscope_function_arg_not_defined.catala_en index 03cc12ff..bdbda6a7 100644 --- a/tests/test_scope/good/subscope_function_arg_not_defined.catala_en +++ b/tests/test_scope/good/subscope_function_arg_not_defined.catala_en @@ -21,24 +21,12 @@ scope Caller: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [75/75] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [6/6] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [3/3] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [6/6] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [9/9] +[RESULT] Invariant typing_defaults checked. result: [74/74] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [5/5] +[RESULT] Invariant no_return_a_function checked. result: [3/3] +[RESULT] Invariant no_partial_evaluation checked. result: [5/5] +[RESULT] Invariant default_no_arrow checked. result: [9/9] [RESULT] Typechecking successful! ``` diff --git a/tests/test_scope/good/subscope_function_arg_not_defined2.catala_en b/tests/test_scope/good/subscope_function_arg_not_defined2.catala_en index 259d95b8..fa9ab2f4 100644 --- a/tests/test_scope/good/subscope_function_arg_not_defined2.catala_en +++ b/tests/test_scope/good/subscope_function_arg_not_defined2.catala_en @@ -23,24 +23,12 @@ scope Caller: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [96/96] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [6/6] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [4/4] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [6/6] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [16/16] +[RESULT] Invariant typing_defaults checked. result: [95/95] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [5/5] +[RESULT] Invariant no_return_a_function checked. result: [4/4] +[RESULT] Invariant no_partial_evaluation checked. result: [5/5] +[RESULT] Invariant default_no_arrow checked. result: [16/16] [RESULT] Typechecking successful! ``` diff --git a/tests/test_struct/good/ambiguous_fields.catala_en b/tests/test_struct/good/ambiguous_fields.catala_en index 6be47cd5..2d1cc598 100644 --- a/tests/test_struct/good/ambiguous_fields.catala_en +++ b/tests/test_struct/good/ambiguous_fields.catala_en @@ -27,24 +27,12 @@ $ catala Typecheck --check-invariants 7 │ declaration structure Bar: │ ‾‾‾ └─ Article -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [20/20] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [4/4] +[RESULT] Invariant typing_defaults checked. result: [20/20] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [0/0] +[RESULT] Invariant no_return_a_function checked. result: [0/0] +[RESULT] Invariant no_partial_evaluation checked. result: [0/0] +[RESULT] Invariant default_no_arrow checked. result: [4/4] [RESULT] Typechecking successful! ``` diff --git a/tests/test_struct/good/nested3.catala_en b/tests/test_struct/good/nested3.catala_en index 09873fb3..f7bd470a 100644 --- a/tests/test_struct/good/nested3.catala_en +++ b/tests/test_struct/good/nested3.catala_en @@ -38,24 +38,12 @@ scope B: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [84/84] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [4/4] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [1/1] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [4/4] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [9/9] +[RESULT] Invariant typing_defaults checked. result: [84/84] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [4/4] +[RESULT] Invariant no_return_a_function checked. result: [1/1] +[RESULT] Invariant no_partial_evaluation checked. result: [4/4] +[RESULT] Invariant default_no_arrow checked. result: [9/9] [RESULT] Typechecking successful! ``` diff --git a/tests/test_struct/good/same_name_fields.catala_en b/tests/test_struct/good/same_name_fields.catala_en index 82d16091..9ddae43b 100644 --- a/tests/test_struct/good/same_name_fields.catala_en +++ b/tests/test_struct/good/same_name_fields.catala_en @@ -27,24 +27,12 @@ $ catala Typecheck --check-invariants 7 │ declaration structure Bar: │ ‾‾‾ └─ Article -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [39/39] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [2/2] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [2/2] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [6/6] +[RESULT] Invariant typing_defaults checked. result: [39/39] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [2/2] +[RESULT] Invariant no_return_a_function checked. result: [0/0] +[RESULT] Invariant no_partial_evaluation checked. result: [2/2] +[RESULT] Invariant default_no_arrow checked. result: [6/6] [RESULT] Typechecking successful! ``` diff --git a/tests/test_struct/good/simple.catala_en b/tests/test_struct/good/simple.catala_en index da6bde9c..dcc4bc70 100644 --- a/tests/test_struct/good/simple.catala_en +++ b/tests/test_struct/good/simple.catala_en @@ -21,24 +21,12 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [44/44] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [3/3] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [3/3] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [6/6] +[RESULT] Invariant typing_defaults checked. result: [43/43] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [2/2] +[RESULT] Invariant no_return_a_function checked. result: [0/0] +[RESULT] Invariant no_partial_evaluation checked. result: [2/2] +[RESULT] Invariant default_no_arrow checked. result: [6/6] [RESULT] Typechecking successful! ``` diff --git a/tests/test_tuples/good/tuples.catala_en b/tests/test_tuples/good/tuples.catala_en new file mode 100644 index 00000000..b0d064d4 --- /dev/null +++ b/tests/test_tuples/good/tuples.catala_en @@ -0,0 +1,55 @@ + +```catala +declaration structure Str: + data x1 content (integer, date) + +declaration enumeration En: + -- One content Str + -- Two content (integer, Str) + +declaration str content Str equals + Str { --x1: (12, |2001-01-01|) } + +declaration f2 content decimal + depends on str content Str, + en content En + equals + match en with pattern + -- One of str1: + let a, w equals str.x1 in + let b, w equals str1.x1 in + a / b + -- Two of z: + let z1, z2 equals z in z1 / 2 + +declaration scope Test: + output o content (date, decimal) + +scope Test: + definition o equals + (|2001-01-03|, + f2 of str, Two content (12, str)) +``` + +```catala-test-inline +$ catala typecheck --check-invariants +[RESULT] Invariant typing_defaults checked. result: [59/59] +[RESULT] Invariant match_inversion checked. result: [1/1] +[RESULT] Invariant app_inversion checked. result: [6/6] +[RESULT] Invariant no_return_a_function checked. result: [8/8] +[RESULT] Invariant no_partial_evaluation checked. result: [6/6] +[RESULT] Invariant default_no_arrow checked. result: [2/2] +[RESULT] Typechecking successful! +``` + +```catala-test-inline +$ catala interpret -s Test +[RESULT] Computation successful! Results: +[RESULT] o = [2001-01-03; 6.0] +``` + +```catala-test-inline +$ catala interpret_lcalc -s Test +[RESULT] Computation successful! Results: +[RESULT] o = [2001-01-03; 6.0] +``` diff --git a/tests/test_typing/bad/err3.catala_en b/tests/test_typing/bad/err3.catala_en index 76aecd5e..b7424a6c 100644 --- a/tests/test_typing/bad/err3.catala_en +++ b/tests/test_typing/bad/err3.catala_en @@ -24,10 +24,10 @@ Error during typechecking, incompatible types: └─⯈ decimal This expression has type integer: -┌─⯈ tests/test_typing/bad/err3.catala_en:10.42-10.43: +┌─⯈ tests/test_typing/bad/err3.catala_en:10.23-10.45: └──┐ 10 │ definition a equals number of (z ++ z) * 2 - │ ‾ + │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ Expected type decimal coming from expression: ┌─⯈ tests/test_typing/bad/common.catala_en:15.20-15.27: @@ -53,10 +53,10 @@ Error during typechecking, incompatible types: └─⯈ decimal This expression has type integer: -┌─⯈ tests/test_typing/bad/err3.catala_en:10.42-10.43: +┌─⯈ tests/test_typing/bad/err3.catala_en:10.23-10.45: └──┐ 10 │ definition a equals number of (z ++ z) * 2 - │ ‾ + │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ Expected type decimal coming from expression: ┌─⯈ tests/test_typing/bad/common.catala_en:15.20-15.27: diff --git a/tests/test_typing/good/common.catala_en b/tests/test_typing/good/common.catala_en index 94d90f67..e7b92878 100644 --- a/tests/test_typing/good/common.catala_en +++ b/tests/test_typing/good/common.catala_en @@ -49,24 +49,12 @@ $ catala Typecheck --check-invariants └─┐ 2 │ declaration enumeration Enum: │ ‾‾‾‾ -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [16/16] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [2/2] +[RESULT] Invariant typing_defaults checked. result: [16/16] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [0/0] +[RESULT] Invariant no_return_a_function checked. result: [0/0] +[RESULT] Invariant no_partial_evaluation checked. result: [0/0] +[RESULT] Invariant default_no_arrow checked. result: [2/2] [RESULT] Typechecking successful! ``` diff --git a/tests/test_typing/good/overload.catala_en b/tests/test_typing/good/overload.catala_en index d8a28b53..6efa2bb3 100644 --- a/tests/test_typing/good/overload.catala_en +++ b/tests/test_typing/good/overload.catala_en @@ -61,24 +61,12 @@ scope S: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [581/581] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [148/148] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [148/148] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [32/32] +[RESULT] Invariant typing_defaults checked. result: [433/433] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [0/0] +[RESULT] Invariant no_return_a_function checked. result: [0/0] +[RESULT] Invariant no_partial_evaluation checked. result: [0/0] +[RESULT] Invariant default_no_arrow checked. result: [32/32] [RESULT] Typechecking successful! ``` diff --git a/tests/test_variable_state/good/simple.catala_en b/tests/test_variable_state/good/simple.catala_en index 2e4a6c79..defc42eb 100644 --- a/tests/test_variable_state/good/simple.catala_en +++ b/tests/test_variable_state/good/simple.catala_en @@ -19,24 +19,12 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [32/32] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [2/2] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [2/2] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [6/6] +[RESULT] Invariant typing_defaults checked. result: [30/30] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [0/0] +[RESULT] Invariant no_return_a_function checked. result: [0/0] +[RESULT] Invariant no_partial_evaluation checked. result: [0/0] +[RESULT] Invariant default_no_arrow checked. result: [6/6] [RESULT] Typechecking successful! ``` diff --git a/tests/test_variable_state/good/subscope.catala_en b/tests/test_variable_state/good/subscope.catala_en index c646907b..13e83d54 100644 --- a/tests/test_variable_state/good/subscope.catala_en +++ b/tests/test_variable_state/good/subscope.catala_en @@ -34,24 +34,12 @@ scope B: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] -Invariant Dcalc__Invariants.invariant_typing_defaults - checked. result: [85/85] -[RESULT] -Invariant Dcalc__Invariants.invariant_match_inversion - checked. result: [0/0] -[RESULT] -Invariant Dcalc__Invariants.invariant_app_inversion - checked. result: [5/5] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_return_a_function - checked. result: [1/1] -[RESULT] -Invariant Dcalc__Invariants.invariant_no_partial_evaluation - checked. result: [5/5] -[RESULT] -Invariant Dcalc__Invariants.invariant_default_no_arrow - checked. result: [15/15] +[RESULT] Invariant typing_defaults checked. result: [82/82] +[RESULT] Invariant match_inversion checked. result: [0/0] +[RESULT] Invariant app_inversion checked. result: [2/2] +[RESULT] Invariant no_return_a_function checked. result: [1/1] +[RESULT] Invariant no_partial_evaluation checked. result: [2/2] +[RESULT] Invariant default_no_arrow checked. result: [15/15] [RESULT] Typechecking successful! ```