Commit 5005c436 authored by Pietro Abate's avatar Pietro Abate
Browse files

Merge branch 'apply-test' into tallying-debug

Conflicts:
	types/types.ml
	types/types.mli
parents 74afa407 844b8fb4
......@@ -17,3 +17,4 @@ true: -traverse
<tests/libtest/*Test.*>: pp(camlp4orf.opt), package(netstring), package(pcre), package(oUnit), package(ulex), package(num), package(camlp4.lib)
<tests/eval/src/main.*>: pp(camlp4orf.opt), package(netstring), package(pcre), package(oUnit), package(ulex), package(num), package(camlp4.lib)
<kim*.native>: pp(camlp4orf.opt), package(netstring), package(pcre), package(oUnit), package(ulex), package(num), package(camlp4.lib)
......@@ -4,6 +4,8 @@ open Lambda
type env = {
cu: Compunit.t option; (* None: toplevel *)
vars: var_loc Env.t;
sigma : sigma; (* symbolic substitutions (Lambda.sigma) *)
gamma : Types.Node.t IdMap.map; (* map of type variables to types *)
stack_size: int;
max_stack: int ref;
global_size: int
......@@ -11,7 +13,15 @@ type env = {
let global_size env = env.global_size
let mk cu = { cu = cu; vars = Env.empty; stack_size = 0; max_stack = ref 0; global_size = 0 }
let mk cu = {
cu = cu;
vars = Env.empty;
sigma = `List [];
gamma = IdMap.empty;
stack_size = 0;
max_stack = ref 0;
global_size = 0
}
let empty_toplevel = mk None
let empty x = mk (Some x)
......@@ -48,6 +58,12 @@ let enter_global_cu cu env x =
vars = Env.add x (Ext (cu,env.global_size)) env.vars;
global_size = env.global_size + 1 }
let rec domain = function
|`List l -> Types.Tallying.domain l
|`Comp (s1,s2) -> Var.Set.union (domain s1) (domain s2)
|`Sel(x,t,s) -> (domain s)
(* from intermediate explicitely typed language to Evaluation language (lambda) *)
let rec compile env e = compile_aux env e.Typed.exp_descr
and compile_aux env = function
| Typed.Forget (e,_) -> compile env e
......@@ -55,7 +71,12 @@ and compile_aux env = function
let d = Patterns.Compile.make_checker !t0 (Types.descr t) in
Check (compile env e, d)
| Typed.Var x -> Var (find x env)
| Typed.TVar x -> Var (find x env)
| Typed.TVar x ->
let v = find x env in
let polyvars = Var.Set.inter (domain(env.sigma)) (Types.all_vars(Types.descr (IdMap.assoc x env.gamma))) in
if Var.Set.is_empty polyvars then Var (v)
else TVar(v,env.sigma)
| Typed.Subst(e,sl) -> compile { env with sigma = `Comp(env.sigma,`List sl) } e
| Typed.ExtVar (cu,x,_) -> Var (find_ext cu x)
| Typed.Apply (e1,e2) -> Apply (compile env e1, compile env e2)
| Typed.Abstraction a -> compile_abstr env a
......@@ -97,10 +118,10 @@ and compile_aux env = function
NsTable (ns, compile_aux env e)
and compile_abstr env a =
let fun_env =
let fun_env, fun_name =
match a.Typed.fun_name with
| Some x -> Env.add x (Env 0) Env.empty
| None -> Env.empty in
| Some x -> Env.add x (Env 0) Env.empty, [x, Types.cons a.Typed.fun_typ]
| None -> Env.empty, [] in
let (slots,nb_slots,fun_env) =
List.fold_left
......@@ -120,24 +141,46 @@ and compile_abstr env a =
let slots = Array.of_list (List.rev slots) in
let env = { env with vars = fun_env; stack_size = 0; max_stack = ref 0 } in
let env = { env with vars = fun_env; gamma = (env.gamma @ fun_name);
stack_size = 0; max_stack = ref 0 } in
let body = compile_branches env a.Typed.fun_body in
Abstraction (slots, a.Typed.fun_iface, body, !(env.max_stack), true, List [[]])
let sigma = `Sel(a.Typed.fun_fv,a.Typed.fun_iface,env.sigma) in
let polyvars =
let vs =
List.fold_left (fun acc (t1,t2) ->
let ts1 = Types.all_vars t1 in
let ts2 = Types.all_vars t2 in
(Var.Set.union acc (Var.Set.union ts1 ts2))
) Var.Set.empty a.Typed.fun_iface
in
Var.Set.inter (domain(env.sigma)) vs
in
if Var.Set.is_empty polyvars then
Abstraction (slots, a.Typed.fun_iface, body, !(env.max_stack), false, sigma)
else
Abstraction (slots, a.Typed.fun_iface, body, !(env.max_stack), true, sigma)
and compile_branches env (brs : Typed.branches) =
(* Don't compile unused branches, because they have not been
type checked. *)
(* Don't compile unused branches, because they have not been type checked. *)
let used = List.filter (fun br -> br.Typed.br_used) brs.Typed.br_branches in
let b = List.map (compile_branch env) used in
(* here I need to pull type information from each pattern and then
* compute for each variable gamma(x) . I should be able to compute gamma(x)
* using the information computed in (disp,rhs) *)
let (disp,rhs) = Patterns.Compile.make_branches brs.Typed.br_typ b in
{ brs_stack_pos = env.stack_size;
brs_accept_chars = not (Types.Char.is_empty brs.Typed.br_accept);
brs_disp = disp;
brs_rhs = rhs }
brs_rhs = rhs
}
(* p_i / t_i -> br.Typed.br_pat / br.Typed.br_type
* p_i / t_i is used here to add elements to env.gamma *)
and compile_branch env br =
let env = List.fold_left enter_local env (Patterns.fv br.Typed.br_pat) in
(br.Typed.br_pat, compile env br.Typed.br_body)
let m = Patterns.filter (Types.descr (Patterns.accept br.Typed.br_pat)) br.Typed.br_pat in
let env = { env with gamma = IdMap.union_disj m env.gamma } in
(br.Typed.br_pat, compile env br.Typed.br_body )
let enter_globals env n = match env.cu with
| None -> List.fold_left enter_global_toplevel env n
......
......@@ -22,17 +22,19 @@ type var_loc =
(* Only for the toplevel *)
| Dummy
type sigma =
| List of Types.Tallying.CS.sl
| Comp of (sigma * sigma)
| Sel of (fv * Types.t * sigma)
(* only TVar (polymorphic type variable) and Abstraction have
* a sigma annotation *)
type sigma = [
| `List of Types.Tallying.CS.sl
| `Comp of (sigma * sigma)
| `Sel of (fv * (Types.t * Types.t) list * sigma) ]
type expr =
| Var of var_loc
| PVar of (var_loc * sigma)
| TVar of (var_loc * sigma)
| Apply of expr * expr
| Abstraction of var_loc array * (Types.t * Types.t) list * branches * int * bool * sigma
(* environment, interface, branches, size of locals *)
(* environment, interface, branches, size of locals, eval flag, substitutions *)
| Check of expr * Auto_pat.state
| Const of Value.t
| Pair of expr * expr
......
......@@ -22,14 +22,16 @@ type var_loc =
(* Only for the toplevel *)
| Dummy
type sigma =
| List of Types.Tallying.CS.sl
| Comp of (sigma * sigma)
| Sel of (fv * Types.t * sigma)
(* only TVar (polymorphic type variable) and Abstraction have
* a sigma annotation *)
type sigma = [
| `List of Types.Tallying.CS.sl
| `Comp of (sigma * sigma)
| `Sel of (fv * (Types.t * Types.t) list * sigma) ]
type expr =
| Var of var_loc
| PVar of (var_loc * sigma)
| TVar of (var_loc * sigma)
| Apply of expr * expr
| Abstraction of var_loc array * (Types.t * Types.t) list * branches * int * bool * sigma
(* environment, interface, branches, size of locals *)
......
......@@ -46,7 +46,7 @@ let register_cst op t v =
let register_fun op dom codom eval =
register_cst op
(Types.arrow (Types.cons dom) (Types.cons codom))
(Value.Abstraction (Some [(dom,codom)],eval))
(Value.Abstraction (Some [(dom,codom)],eval, `List([[]])))
let register_fun2 op dom1 dom2 codom eval =
let t2 = Types.arrow (Types.cons dom2) (Types.cons codom) in
......@@ -55,7 +55,7 @@ let register_fun2 op dom1 dom2 codom eval =
(Types.arrow (Types.cons dom1) (Types.cons t2))
(Value.Abstraction (Some [(dom1,t2)],(fun v1 ->
Value.Abstraction (iface2,
eval v1))))
eval v1, `List([[]]))), `List([[]])))
let register_op op ?(expect=Types.any) typ eval =
register_unary op
(fun tf _ _ -> let t = tf expect true in typ t)
......
open TypesOUnit;;
open Types;;
let and_size1 = ref ~-1
let arrow_size1 = ref ~-1
let and_size2 = ref ~-1
let arrow_size2 = ref ~-1
let init_counters () =
and_size1 := ~-1;
and_size2 := ~-1;
arrow_size1 := ~-1;
arrow_size2 := ~-1
let parse_typ s =
let and_size, arrow_size =
if !and_size2 = ~-1 then
and_size2,arrow_size2
else
and_size1,arrow_size1
in
and_size := 0; arrow_size := 0;
for i = 0 to String.length s - 2 do
match s.[i], s.[i+1] with
'&',_ -> incr and_size
| '-', '>' -> incr arrow_size
| _ -> ()
done;
let st = Stream.of_string s in
let astpat = Parser.pat st in
let nodepat = Typer.typ Builtin.env astpat in
Types.descr nodepat
;;
let funs =
(* List of pairs f, args where f is a function types expecting n arguments and
args is a list of n types *)
List.map (fun (f,a) ->
(parse_typ f, List.map parse_typ a,f,a))
Test_arity6.l;;
(* (* HERE Examples with higher order *)
["( `$A01 -> `$B01 ) -> `$A01 -> (`$B01)", [
" (`$C01 -> `$D01 ) ";
" (`$C01 )";
];
"( `$A11 -> `$B11 ) -> ( `$A12 -> `$B12 ) -> `$A11 -> `$A12 -> (`$B11, `$B12)", [
" (`$C11 -> `$D11 ) ";
" (`$C12 -> `$D12 ) ";
" (`$C11 )";
" (`$C12 )";
];
"( `$A21 -> `$B21 ) -> ( `$A22 -> `$B22 ) -> ( `$A23 -> `$B23 ) -> `$A21 -> `$A22 -> `$A23 -> (`$B21, `$B22, `$B23)", [
" (`$C21 -> `$D21 ) ";
" (`$C22 -> `$D22 ) ";
" (`$C23 -> `$D23 ) ";
" (`$C21 )";
" (`$C22 )";
" (`$C23 )";
];
"( `$A31 -> `$B31 ) -> ( `$A32 -> `$B32 ) -> ( `$A33 -> `$B33 ) -> ( `$A34 -> `$B34 ) -> `$A31 -> `$A32 -> `$A33 -> `$A34 -> (`$B31, `$B32, `$B33, `$B34)", [
" (`$C31 -> `$D31 ) ";
" (`$C32 -> `$D32 ) ";
" (`$C33 -> `$D33 ) ";
" (`$C34 -> `$D34 ) ";
" (`$C31 )";
" (`$C32 )";
" (`$C33 )";
" (`$C34 )";
];
"( `$A41 -> `$B41 ) -> ( `$A42 -> `$B42 ) -> ( `$A43 -> `$B43 ) -> ( `$A44 -> `$B44 ) -> ( `$A45 -> `$B45 ) -> `$A41 -> `$A42 -> `$A43 -> `$A44 -> `$A45 -> (`$B41, `$B42, `$B43, `$B44, `$B45)", [
" (`$C41 -> `$D41 ) ";
" (`$C42 -> `$D42 ) ";
" (`$C43 -> `$D43 ) ";
" (`$C44 -> `$D44 ) ";
" (`$C45 -> `$D45 ) ";
" (`$C41 )";
" (`$C42 )";
" (`$C43 )";
" (`$C44 )";
" (`$C45 )";
];
"( `$A51 -> `$B51 ) -> ( `$A52 -> `$B52 ) -> ( `$A53 -> `$B53 ) -> ( `$A54 -> `$B54 ) -> ( `$A55 -> `$B55 ) -> ( `$A56 -> `$B56 ) -> `$A51 -> `$A52 -> `$A53 -> `$A54 -> `$A55 -> `$A56 -> (`$B51, `$B52, `$B53, `$B54, `$B55, `$B56)", [
" (`$C51 -> `$D51 ) ";
" (`$C52 -> `$D52 ) ";
" (`$C53 -> `$D53 ) ";
" (`$C54 -> `$D54 ) ";
" (`$C55 -> `$D55 ) ";
" (`$C56 -> `$D56 ) ";
" (`$C51 )";
" (`$C52 )";
" (`$C53 )";
" (`$C54 )";
" (`$C55 )";
" (`$C56 )";
];
"( `$A61 -> `$B61 ) -> ( `$A62 -> `$B62 ) -> ( `$A63 -> `$B63 ) -> ( `$A64 -> `$B64 ) -> ( `$A65 -> `$B65 ) -> ( `$A66 -> `$B66 ) -> ( `$A67 -> `$B67 ) -> `$A61 -> `$A62 -> `$A63 -> `$A64 -> `$A65 -> `$A66 -> `$A67 -> (`$B61, `$B62, `$B63, `$B64, `$B65, `$B66, `$B67)", [
" (`$C61 -> `$D61 ) ";
" (`$C62 -> `$D62 ) ";
" (`$C63 -> `$D63 ) ";
" (`$C64 -> `$D64 ) ";
" (`$C65 -> `$D65 ) ";
" (`$C66 -> `$D66 ) ";
" (`$C67 -> `$D67 ) ";
" (`$C61 )";
" (`$C62 )";
" (`$C63 )";
" (`$C64 )";
" (`$C65 )";
" (`$C66 )";
" (`$C67 )";
];
"( `$A71 -> `$B71 ) -> ( `$A72 -> `$B72 ) -> ( `$A73 -> `$B73 ) -> ( `$A74 -> `$B74 ) -> ( `$A75 -> `$B75 ) -> ( `$A76 -> `$B76 ) -> ( `$A77 -> `$B77 ) -> ( `$A78 -> `$B78 ) -> `$A71 -> `$A72 -> `$A73 -> `$A74 -> `$A75 -> `$A76 -> `$A77 -> `$A78 -> (`$B71, `$B72, `$B73, `$B74, `$B75, `$B76, `$B77, `$B78)", [
" (`$C71 -> `$D71 ) ";
" (`$C72 -> `$D72 ) ";
" (`$C73 -> `$D73 ) ";
" (`$C74 -> `$D74 ) ";
" (`$C75 -> `$D75 ) ";
" (`$C76 -> `$D76 ) ";
" (`$C77 -> `$D77 ) ";
" (`$C78 -> `$D78 ) ";
" (`$C71 )";
" (`$C72 )";
" (`$C73 )";
" (`$C74 )";
" (`$C75 )";
" (`$C76 )";
" (`$C77 )";
" (`$C78 )";
];
"( `$A81 -> `$B81 ) -> ( `$A82 -> `$B82 ) -> ( `$A83 -> `$B83 ) -> ( `$A84 -> `$B84 ) -> ( `$A85 -> `$B85 ) -> ( `$A86 -> `$B86 ) -> ( `$A87 -> `$B87 ) -> ( `$A88 -> `$B88 ) -> ( `$A89 -> `$B89 ) -> `$A81 -> `$A82 -> `$A83 -> `$A84 -> `$A85 -> `$A86 -> `$A87 -> `$A88 -> `$A89 -> (`$B81, `$B82, `$B83, `$B84, `$B85, `$B86, `$B87, `$B88, `$B89)", [
" (`$C81 -> `$D81 ) ";
" (`$C82 -> `$D82 ) ";
" (`$C83 -> `$D83 ) ";
" (`$C84 -> `$D84 ) ";
" (`$C85 -> `$D85 ) ";
" (`$C86 -> `$D86 ) ";
" (`$C87 -> `$D87 ) ";
" (`$C88 -> `$D88 ) ";
" (`$C89 -> `$D89 ) ";
" (`$C81 )";
" (`$C82 )";
" (`$C83 )";
" (`$C84 )";
" (`$C85 )";
" (`$C86 )";
" (`$C87 )";
" (`$C88 )";
" (`$C89 )";
];
"( `$A91 -> `$B91 ) -> ( `$A92 -> `$B92 ) -> ( `$A93 -> `$B93 ) -> ( `$A94 -> `$B94 ) -> ( `$A95 -> `$B95 ) -> ( `$A96 -> `$B96 ) -> ( `$A97 -> `$B97 ) -> ( `$A98 -> `$B98 ) -> ( `$A99 -> `$B99 ) -> ( `$A910 -> `$B910 ) -> `$A91 -> `$A92 -> `$A93 -> `$A94 -> `$A95 -> `$A96 -> `$A97 -> `$A98 -> `$A99 -> `$A910 -> (`$B91, `$B92, `$B93, `$B94, `$B95, `$B96, `$B97, `$B98, `$B99, `$B910)", [
" (`$C91 -> `$D91 ) ";
" (`$C92 -> `$D92 ) ";
" (`$C93 -> `$D93 ) ";
" (`$C94 -> `$D94 ) ";
" (`$C95 -> `$D95 ) ";
" (`$C96 -> `$D96 ) ";
" (`$C97 -> `$D97 ) ";
" (`$C98 -> `$D98 ) ";
" (`$C99 -> `$D99 ) ";
" (`$C910 -> `$D910 ) ";
" (`$C91 )";
" (`$C92 )";
" (`$C93 )";
" (`$C94 )";
" (`$C95 )";
" (`$C96 )";
" (`$C97 )";
" (`$C98 )";
" (`$C99 )";
" (`$C910 )";
];
"( `$A101 -> `$B101 ) -> ( `$A102 -> `$B102 ) -> ( `$A103 -> `$B103 ) -> ( `$A104 -> `$B104 ) -> ( `$A105 -> `$B105 ) -> ( `$A106 -> `$B106 ) -> ( `$A107 -> `$B107 ) -> ( `$A108 -> `$B108 ) -> ( `$A109 -> `$B109 ) -> ( `$A1010 -> `$B1010 ) -> ( `$A1011 -> `$B1011 ) -> `$A101 -> `$A102 -> `$A103 -> `$A104 -> `$A105 -> `$A106 -> `$A107 -> `$A108 -> `$A109 -> `$A1010 -> `$A1011 -> (`$B101, `$B102, `$B103, `$B104, `$B105, `$B106, `$B107, `$B108, `$B109, `$B1010, `$B1011)", [
" (`$C101 -> `$D101 ) ";
" (`$C102 -> `$D102 ) ";
" (`$C103 -> `$D103 ) ";
" (`$C104 -> `$D104 ) ";
" (`$C105 -> `$D105 ) ";
" (`$C106 -> `$D106 ) ";
" (`$C107 -> `$D107 ) ";
" (`$C108 -> `$D108 ) ";
" (`$C109 -> `$D109 ) ";
" (`$C1010 -> `$D1010 ) ";
" (`$C1011 -> `$D1011 ) ";
" (`$C101 )";
" (`$C102 )";
" (`$C103 )";
" (`$C104 )";
" (`$C105 )";
" (`$C106 )";
" (`$C107 )";
" (`$C108 )";
" (`$C109 )";
" (`$C1010 )";
" (`$C1011 )";
];
"( `$A111 -> `$B111 ) -> ( `$A112 -> `$B112 ) -> ( `$A113 -> `$B113 ) -> ( `$A114 -> `$B114 ) -> ( `$A115 -> `$B115 ) -> ( `$A116 -> `$B116 ) -> ( `$A117 -> `$B117 ) -> ( `$A118 -> `$B118 ) -> ( `$A119 -> `$B119 ) -> ( `$A1110 -> `$B1110 ) -> ( `$A1111 -> `$B1111 ) -> ( `$A1112 -> `$B1112 ) -> `$A111 -> `$A112 -> `$A113 -> `$A114 -> `$A115 -> `$A116 -> `$A117 -> `$A118 -> `$A119 -> `$A1110 -> `$A1111 -> `$A1112 -> (`$B111, `$B112, `$B113, `$B114, `$B115, `$B116, `$B117, `$B118, `$B119, `$B1110, `$B1111, `$B1112)", [
" (`$C111 -> `$D111 ) ";
" (`$C112 -> `$D112 ) ";
" (`$C113 -> `$D113 ) ";
" (`$C114 -> `$D114 ) ";
" (`$C115 -> `$D115 ) ";
" (`$C116 -> `$D116 ) ";
" (`$C117 -> `$D117 ) ";
" (`$C118 -> `$D118 ) ";
" (`$C119 -> `$D119 ) ";
" (`$C1110 -> `$D1110 ) ";
" (`$C1111 -> `$D1111 ) ";
" (`$C1112 -> `$D1112 ) ";
" (`$C111 )";
" (`$C112 )";
" (`$C113 )";
" (`$C114 )";
" (`$C115 )";
" (`$C116 )";
" (`$C117 )";
" (`$C118 )";
" (`$C119 )";
" (`$C1110 )";
" (`$C1111 )";
" (`$C1112 )";
];
"( `$A121 -> `$B121 ) -> ( `$A122 -> `$B122 ) -> ( `$A123 -> `$B123 ) -> ( `$A124 -> `$B124 ) -> ( `$A125 -> `$B125 ) -> ( `$A126 -> `$B126 ) -> ( `$A127 -> `$B127 ) -> ( `$A128 -> `$B128 ) -> ( `$A129 -> `$B129 ) -> ( `$A1210 -> `$B1210 ) -> ( `$A1211 -> `$B1211 ) -> ( `$A1212 -> `$B1212 ) -> ( `$A1213 -> `$B1213 ) -> `$A121 -> `$A122 -> `$A123 -> `$A124 -> `$A125 -> `$A126 -> `$A127 -> `$A128 -> `$A129 -> `$A1210 -> `$A1211 -> `$A1212 -> `$A1213 -> (`$B121, `$B122, `$B123, `$B124, `$B125, `$B126, `$B127, `$B128, `$B129, `$B1210, `$B1211, `$B1212, `$B1213)", [
" (`$C121 -> `$D121 ) ";
" (`$C122 -> `$D122 ) ";
" (`$C123 -> `$D123 ) ";
" (`$C124 -> `$D124 ) ";
" (`$C125 -> `$D125 ) ";
" (`$C126 -> `$D126 ) ";
" (`$C127 -> `$D127 ) ";
" (`$C128 -> `$D128 ) ";
" (`$C129 -> `$D129 ) ";
" (`$C1210 -> `$D1210 ) ";
" (`$C1211 -> `$D1211 ) ";
" (`$C1212 -> `$D1212 ) ";
" (`$C1213 -> `$D1213 ) ";
" (`$C121 )";
" (`$C122 )";
" (`$C123 )";
" (`$C124 )";
" (`$C125 )";
" (`$C126 )";
" (`$C127 )";
" (`$C128 )";
" (`$C129 )";
" (`$C1210 )";
" (`$C1211 )";
" (`$C1212 )";
" (`$C1213 )";
];
"( `$A131 -> `$B131 ) -> ( `$A132 -> `$B132 ) -> ( `$A133 -> `$B133 ) -> ( `$A134 -> `$B134 ) -> ( `$A135 -> `$B135 ) -> ( `$A136 -> `$B136 ) -> ( `$A137 -> `$B137 ) -> ( `$A138 -> `$B138 ) -> ( `$A139 -> `$B139 ) -> ( `$A1310 -> `$B1310 ) -> ( `$A1311 -> `$B1311 ) -> ( `$A1312 -> `$B1312 ) -> ( `$A1313 -> `$B1313 ) -> ( `$A1314 -> `$B1314 ) -> `$A131 -> `$A132 -> `$A133 -> `$A134 -> `$A135 -> `$A136 -> `$A137 -> `$A138 -> `$A139 -> `$A1310 -> `$A1311 -> `$A1312 -> `$A1313 -> `$A1314 -> (`$B131, `$B132, `$B133, `$B134, `$B135, `$B136, `$B137, `$B138, `$B139, `$B1310, `$B1311, `$B1312, `$B1313, `$B1314)", [
" (`$C131 -> `$D131 ) ";
" (`$C132 -> `$D132 ) ";
" (`$C133 -> `$D133 ) ";
" (`$C134 -> `$D134 ) ";
" (`$C135 -> `$D135 ) ";
" (`$C136 -> `$D136 ) ";
" (`$C137 -> `$D137 ) ";
" (`$C138 -> `$D138 ) ";
" (`$C139 -> `$D139 ) ";
" (`$C1310 -> `$D1310 ) ";
" (`$C1311 -> `$D1311 ) ";
" (`$C1312 -> `$D1312 ) ";
" (`$C1313 -> `$D1313 ) ";
" (`$C1314 -> `$D1314 ) ";
" (`$C131 )";
" (`$C132 )";
" (`$C133 )";
" (`$C134 )";
" (`$C135 )";
" (`$C136 )";
" (`$C137 )";
" (`$C138 )";
" (`$C139 )";
" (`$C1310 )";
" (`$C1311 )";
" (`$C1312 )";
" (`$C1313 )";
" (`$C1314 )";
];
"( `$A141 -> `$B141 ) -> ( `$A142 -> `$B142 ) -> ( `$A143 -> `$B143 ) -> ( `$A144 -> `$B144 ) -> ( `$A145 -> `$B145 ) -> ( `$A146 -> `$B146 ) -> ( `$A147 -> `$B147 ) -> ( `$A148 -> `$B148 ) -> ( `$A149 -> `$B149 ) -> ( `$A1410 -> `$B1410 ) -> ( `$A1411 -> `$B1411 ) -> ( `$A1412 -> `$B1412 ) -> ( `$A1413 -> `$B1413 ) -> ( `$A1414 -> `$B1414 ) -> ( `$A1415 -> `$B1415 ) -> `$A141 -> `$A142 -> `$A143 -> `$A144 -> `$A145 -> `$A146 -> `$A147 -> `$A148 -> `$A149 -> `$A1410 -> `$A1411 -> `$A1412 -> `$A1413 -> `$A1414 -> `$A1415 -> (`$B141, `$B142, `$B143, `$B144, `$B145, `$B146, `$B147, `$B148, `$B149, `$B1410, `$B1411, `$B1412, `$B1413, `$B1414, `$B1415)", [
" (`$C141 -> `$D141 ) ";
" (`$C142 -> `$D142 ) ";
" (`$C143 -> `$D143 ) ";
" (`$C144 -> `$D144 ) ";
" (`$C145 -> `$D145 ) ";
" (`$C146 -> `$D146 ) ";
" (`$C147 -> `$D147 ) ";
" (`$C148 -> `$D148 ) ";
" (`$C149 -> `$D149 ) ";
" (`$C1410 -> `$D1410 ) ";
" (`$C1411 -> `$D1411 ) ";
" (`$C1412 -> `$D1412 ) ";
" (`$C1413 -> `$D1413 ) ";
" (`$C1414 -> `$D1414 ) ";
" (`$C1415 -> `$D1415 ) ";
" (`$C141 )";
" (`$C142 )";
" (`$C143 )";
" (`$C144 )";
" (`$C145 )";
" (`$C146 )";
" (`$C147 )";
" (`$C148 )";
" (`$C149 )";
" (`$C1410 )";
" (`$C1411 )";
" (`$C1412 )";
" (`$C1413 )";
" (`$C1414 )";
" (`$C1415 )";
];
]
;;
*)
(* (* HERE easy examples with Integers *)
[
"`$A01 -> Int", [
"Int";
];
"`$A11 -> `$A12 -> Int", [
"Int";
"Int";
];
"`$A21 -> `$A22 -> `$A23 -> Int", [
"Int";
"Int";
"Int";
];
"`$A31 -> `$A32 -> `$A33 -> `$A34 -> Int", [
"Int";
"Int";
"Int";
"Int";
];
"`$A41 -> `$A42 -> `$A43 -> `$A44 -> `$A45 -> Int", [
"Int";
"Int";
"Int";
"Int";
"Int";
];
"`$A51 -> `$A52 -> `$A53 -> `$A54 -> `$A55 -> `$A56 -> Int", [
"Int";
"Int";
"Int";
"Int";
"Int";
"Int";
];
"`$A61 -> `$A62 -> `$A63 -> `$A64 -> `$A65 -> `$A66 -> `$A67 -> Int", [
"Int";
"Int";
"Int";
"Int";
"Int";
"Int";
"Int";
];
"`$A71 -> `$A72 -> `$A73 -> `$A74 -> `$A75 -> `$A76 -> `$A77 -> `$A78 -> Int", [
"Int";
"Int";
"Int";
"Int";
"Int";
"Int";
"Int";
"Int";
];
"`$A81 -> `$A82 -> `$A83 -> `$A84 -> `$A85 -> `$A86 -> `$A87 -> `$A88 -> `$A89 -> Int", [
"Int";
"Int";
"Int";
"Int";
"Int";
"Int";
"Int";
"Int";
"Int";
];
"`$A91 -> `$A92 -> `$A93 -> `$A94 -> `$A95 -> `$A96 -> `$A97 -> `$A98 -> `$A99 -> `$A910 -> Int", [
"Int";
"Int";
"Int";
"Int";
"Int";
"Int";
"Int";
"Int";
"Int";
"Int";
];
"`$A101 -> `$A102 -> `$A103 -> `$A104 -> `$A105 -> `$A106 -> `$A107 -> `$A108 -> `$A109 -> `$A1010 -> `$A1011 -> Int", [
"Int";
"Int";
"Int";
"Int";
"Int";
"Int";
"Int";
"Int";
"Int";
"Int";
"Int";
];
"`$A111 -> `$A112 -> `$A113 -> `$A114 -> `$A115 -> `$A116 -> `$A117 -> `$A118 -> `$A119 -> `$A1110 -> `$A1111 -> `$A1112 -> Int", [
"Int";
"Int";
"Int";
"Int";
"Int";
"Int";
"Int";
"Int";
"Int";
"Int";
"Int";
"Int";
];
"`$A121 -> `$A122 -> `$A123 -> `$A124 -> `$A125 -> `$A126 -> `$A127 -> `$A128 -> `$A129 -> `$A1210 -> `$A1211 -> `$A1212 -> `$A1213 -> Int", [
"Int";
"Int";
"Int";
"Int";
"Int";
"Int";
"Int";
"Int";
"Int";
"Int";
"Int";
"Int";
"Int";
];
"`$A131 -> `$A132 -> `$A133 -> `$A134 -> `$A135 -> `$A136 -> `$A137 -> `$A138 -> `$A139 -> `$A1310 -> `$A1311 -> `$A1312 -> `$A1313 -> `$A1314 -> Int", [
"Int";
"Int";
"Int";
"Int";
"Int";
"Int";