stress_opt_seq.cd 872 Bytes
Newer Older
1
type T = [ `A? `B? `C? `D? `E? `F? `G? `H? `I? `J?
2
           `K? `L? `M? `N? `O? `P? `Q? `R? `S? `T? ];;
3

4
(*
5
let fun f (Any -> T) T & x -> x | x -> f x;;
6

7
debug compile Any T;;
8
*)
9

10 11 12 13 14 15
debug compile T
P1 where
  P1 = (`A & (a := 1), P2) | (a := 2) & P2 and
  P2 = (`B & (b := 1), P3) | (b := 2) & P3 and
  P3 = (`C & (c := 1), P4) | (c := 2) & P4 and
  P4 = (`D & (d := 1), P5) | (d := 2) & P5 and
16 17 18 19 20 21 22
  P5 = (`E & (e := 1), P6) | (e := 2) & P6 and
  P6 = (`F & (f := 1), P7) | (f := 2) & P7 and
  P7 = (`G & (g := 1), P8) | (g := 2) & P8 and
  P8 = (`H & (h := 1), P9) | (h := 2) & P9 and

  P9 = `nil;;

23

24
(*
25
match [ `A `B `C ] with (P1 where
26 27 28 29
  P1 = (`A & (a := '1'), P2) | (a := '2') & P2 and
  P2 = (`B & (b := '1'), P3) | (b := '2') & P3 and
  P3 = (`C & (c := '1'), P4) | (c := '2') & P4 and
  P4 = (`D & (d := '1'), P5) | (d := '2') & P5 and
30
  P5 = `nil) -> (a,b,c,d);;
31
*)