Signed-off-by: Jim Pryor <profjim@jimpryor.net>
2. Throughout this problem, assume that we have
2. Throughout this problem, assume that we have
- let rec omega x = omega x;;
+ let rec blackhole x = blackhole x;;
All of the following are well-typed.
Which ones terminate? What are the generalizations?
All of the following are well-typed.
Which ones terminate? What are the generalizations?
+ fun () -> blackhole ();;
- (fun () -> omega ()) ();;
+ (fun () -> blackhole ()) ();;
- if true then omega else omega;;
+ if true then blackhole else blackhole;;
- if false then omega else omega;;
+ if false then blackhole else blackhole;;
- if true then omega else omega ();;
+ if true then blackhole else blackhole ();;
- if false then omega else omega ();;
+ if false then blackhole else blackhole ();;
- if true then omega () else omega;;
+ if true then blackhole () else blackhole;;
- if false then omega () else omega;;
+ if false then blackhole () else blackhole;;
- if true then omega () else omega ();;
+ if true then blackhole () else blackhole ();;
- if false then omega () else omega ();;
+ if false then blackhole () else blackhole ();;
+ let _ = blackhole in 2;;
- let _ = omega () in 2;;
+ let _ = blackhole () in 2;;
3. This problem is to begin thinking about controlling order of evaluation.
The following expression is an attempt to make explicit the
3. This problem is to begin thinking about controlling order of evaluation.
The following expression is an attempt to make explicit the
- let rec omega x = omega x in
- if true then omega else omega ();;
+ let rec blackhole x = blackhole x in
+ if true then blackhole else blackhole ();;
- let rec omega x = omega x in
+ let rec blackhole x = blackhole x in
- let y = omega in
- let n = omega () in
+ let y = blackhole in
+ let n = blackhole () in
match b with true -> y | false -> n;;
does not terminate. Incidentally, `match bool with true -> yes |
match b with true -> y | false -> n;;
does not terminate. Incidentally, `match bool with true -> yes |