-
Notifications
You must be signed in to change notification settings - Fork 0
/
copl96.ml
45 lines (45 loc) · 2.97 KB
/
copl96.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
|- let compose = fun f -> fun g -> fun x -> f (g x) in
let p = fun x -> if x then 3 else 4 in
let q = fun x -> x < 4 in
compose p q : int -> int by T-Let{
|- fun f -> fun g -> fun x -> f (g x) : (bool -> int) -> (int -> bool) -> int -> int by T-Fun{
f : bool -> int |- fun g -> fun x -> f (g x) : (int -> bool) -> int -> int by T-Fun{
f : bool -> int, g : int -> bool |- fun x -> f (g x) : int -> int by T-Fun{
f : bool -> int, g : int -> bool, x : int |- f (g x) : int by T-App{
f : bool -> int, g : int -> bool, x : int |- f : bool -> int by T-Var{};
f : bool -> int, g : int -> bool, x : int |- g x : bool by T-App{
f : bool -> int, g : int -> bool, x : int |- g : int -> bool by T-Var{};
f : bool -> int, g : int -> bool, x : int |- x : int by T-Var{}
}
}
}
}
};
compose : (bool -> int) -> (int -> bool) -> int -> int |- let p = fun x -> if x then 3 else 4 in
let q = fun x -> x < 4 in
compose p q : int -> int by T-Let{
compose : (bool -> int) -> (int -> bool) -> int -> int |- fun x -> if x then 3 else 4 : bool -> int by T-Fun{
compose : (bool -> int) -> (int -> bool) -> int -> int, x : bool |- if x then 3 else 4 : int by T-If{
compose : (bool -> int) -> (int -> bool) -> int -> int, x : bool |- x : bool by T-Var{};
compose : (bool -> int) -> (int -> bool) -> int -> int, x : bool |- 3 : int by T-Int{};
compose : (bool -> int) -> (int -> bool) -> int -> int, x : bool |- 4 : int by T-Int{}
}
};
compose : (bool -> int) -> (int -> bool) -> int -> int, p : bool -> int |- let q = fun x -> x < 4 in
compose p q : int -> int by T-Let{
compose : (bool -> int) -> (int -> bool) -> int -> int, p : bool -> int |- fun x -> x < 4 : int -> bool by T-Fun{
compose : (bool -> int) -> (int -> bool) -> int -> int, p : bool -> int, x : int |- x < 4 : bool by T-Lt{
compose : (bool -> int) -> (int -> bool) -> int -> int, p : bool -> int, x : int |- x : int by T-Var{};
compose : (bool -> int) -> (int -> bool) -> int -> int, p : bool -> int, x : int |- 4 : int by T-Int{}
}
};
compose : (bool -> int) -> (int -> bool) -> int -> int, p : bool -> int, q : int -> bool |- compose p q : int -> int by T-App{
compose : (bool -> int) -> (int -> bool) -> int -> int, p : bool -> int, q : int -> bool |- compose p : (int -> bool) -> int -> int by T-App{
compose : (bool -> int) -> (int -> bool) -> int -> int, p : bool -> int, q : int -> bool |- compose : (bool -> int) -> (int -> bool) -> int -> int by T-Var{};
compose : (bool -> int) -> (int -> bool) -> int -> int, p : bool -> int, q : int -> bool |- p : bool -> int by T-Var{}
};
compose : (bool -> int) -> (int -> bool) -> int -> int, p : bool -> int, q : int -> bool |- q : int -> bool by T-Var{}
}
}
}
}