-
Notifications
You must be signed in to change notification settings - Fork 0
/
copl120_new.ml
53 lines (53 loc) · 3.96 KB
/
copl120_new.ml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|- let rec map = fun f -> fun l -> match l with [] -> [] | x :: y -> f x :: map f y in map (fun x -> x < 3) (map (fun x -> x * 2) (4 :: 5 :: 1 :: [])) : bool list by T-LetRec{
map : ('a -> 'b) -> 'a list -> 'b list, f : 'a -> 'b |- fun l -> match l with [] -> [] | x :: y -> f x :: map f y : 'a list -> 'b list by T-Abs{
map : ('a -> 'b) -> 'a list -> 'b list, f : 'a -> 'b, l : 'a list |- match l with [] -> [] | x :: y -> f x :: map f y : 'b list by T-Match{
map : ('a -> 'b) -> 'a list -> 'b list, f : 'a -> 'b, l : 'a list |- l : 'a list by T-Var{};
map : ('a -> 'b) -> 'a list -> 'b list, f : 'a -> 'b, l : 'a list |- [] : 'b list by T-Nil{};
map : ('a -> 'b) -> 'a list -> 'b list, f : 'a -> 'b, l : 'a list, x : 'a, y : 'a list |- f x :: map f y : 'b list by T-Cons{
map : ('a -> 'b) -> 'a list -> 'b list, f : 'a -> 'b, l : 'a list, x : 'a, y : 'a list |- f x : 'b by T-App{
map : ('a -> 'b) -> 'a list -> 'b list, f : 'a -> 'b, l : 'a list, x : 'a, y : 'a list |- f : 'a -> 'b by T-Var{};
map : ('a -> 'b) -> 'a list -> 'b list, f : 'a -> 'b, l : 'a list, x : 'a, y : 'a list |- x : 'a by T-Var{}
};
map : ('a -> 'b) -> 'a list -> 'b list, f : 'a -> 'b, l : 'a list, x : 'a, y : 'a list |- map f y : 'b list by T-App{
map : ('a -> 'b) -> 'a list -> 'b list, f : 'a -> 'b, l : 'a list, x : 'a, y : 'a list |- map f : 'a list -> 'b list by T-App{
map : ('a -> 'b) -> 'a list -> 'b list, f : 'a -> 'b, l : 'a list, x : 'a, y : 'a list |- map : ('a -> 'b) -> 'a list -> 'b list by T-Var{};
map : ('a -> 'b) -> 'a list -> 'b list, f : 'a -> 'b, l : 'a list, x : 'a, y : 'a list |- f : 'a -> 'b by T-Var{}
};
map : ('a -> 'b) -> 'a list -> 'b list, f : 'a -> 'b, l : 'a list, x : 'a, y : 'a list |- y : 'a list by T-Var{}
}
}
}
};
map : 'a 'b 'c. ('a -> 'b) -> 'a list -> 'b list |- map (fun x -> x < 3) (map (fun x -> x * 2) (4 :: 5 :: 1 :: [])) : bool list by T-App{
map : 'a 'b 'c. ('a -> 'b) -> 'a list -> 'b list |- map (fun x -> x < 3) : int list -> bool list by T-App{
map : 'a 'b 'c. ('a -> 'b) -> 'a list -> 'b list |- map : (int -> bool) -> int list -> bool list by T-Var{};
map : 'a 'b 'c. ('a -> 'b) -> 'a list -> 'b list |- fun x -> x < 3 : int -> bool by T-Abs{
map : 'a 'b 'c. ('a -> 'b) -> 'a list -> 'b list, x : int |- x < 3 : bool by T-Lt{
map : 'a 'b 'c. ('a -> 'b) -> 'a list -> 'b list, x : int |- x : int by T-Var{};
map : 'a 'b 'c. ('a -> 'b) -> 'a list -> 'b list, x : int |- 3 : int by T-Int{}
}
}
};
map : 'a 'b 'c. ('a -> 'b) -> 'a list -> 'b list |- map (fun x -> x * 2) (4 :: 5 :: 1 :: []) : int list by T-App{
map : 'a 'b 'c. ('a -> 'b) -> 'a list -> 'b list |- map (fun x -> x * 2) : int list -> int list by T-App{
map : 'a 'b 'c. ('a -> 'b) -> 'a list -> 'b list |- map : (int -> int) -> int list -> int list by T-Var{};
map : 'a 'b 'c. ('a -> 'b) -> 'a list -> 'b list |- fun x -> x * 2 : int -> int by T-Abs{
map : 'a 'b 'c. ('a -> 'b) -> 'a list -> 'b list, x : int |- x * 2 : int by T-Mult{
map : 'a 'b 'c. ('a -> 'b) -> 'a list -> 'b list, x : int |- x : int by T-Var{};
map : 'a 'b 'c. ('a -> 'b) -> 'a list -> 'b list, x : int |- 2 : int by T-Int{}
}
}
};
map : 'a 'b 'c. ('a -> 'b) -> 'a list -> 'b list |- 4 :: 5 :: 1 :: [] : int list by T-Cons{
map : 'a 'b 'c. ('a -> 'b) -> 'a list -> 'b list |- 4 : int by T-Int{};
map : 'a 'b 'c. ('a -> 'b) -> 'a list -> 'b list |- 5 :: 1 :: [] : int list by T-Cons{
map : 'a 'b 'c. ('a -> 'b) -> 'a list -> 'b list |- 5 : int by T-Int{};
map : 'a 'b 'c. ('a -> 'b) -> 'a list -> 'b list |- 1 :: [] : int list by T-Cons{
map : 'a 'b 'c. ('a -> 'b) -> 'a list -> 'b list |- 1 : int by T-Int{};
map : 'a 'b 'c. ('a -> 'b) -> 'a list -> 'b list |- [] : int list by T-Nil{}
}
}
}
}
}
}