source: Deliverables/Dissemination/final-review/wp5/Pics/symbolic.ml @ 3282

Last change on this file since 3282 was 3282, checked in by regisgia, 7 years ago
  • WP5 slides for the final review.
File size: 1.1 KB
Line 
1
2open Mlpost
3
4
5(* Helpers *)
6
7let tex = Box.tex ~dx:(Num.cm 0.1) ~dy:(Num.cm 0.1)
8
9
10(* Boxes *)
11
12let source = tex "\\begin{tabular}{c}Source\\end{tabular}"
13
14let labelled_source =
15  tex "\\begin{tabular}{c}Labelled\\\\source\\end{tabular}"
16
17let labelled_asm =
18  tex "\\begin{tabular}{c}Labelled\\\\assembly\\end{tabular}"
19
20let concrete_costs =
21  tex ("\\begin{tabular}{c}\\textbf{Concrete}\\\\" ^
22       "\\textbf{costs}\\end{tabular}")
23
24let boxes =
25  let l1 =
26    Box.hbox_list ~padding:(Num.cm 2.2)
27      [source ; labelled_source ; labelled_asm] in
28  let l2 =
29    Box.hbox_list ~padding:(Num.cm 1.) [List.nth l1 2 ; concrete_costs] in
30  Box.group (l1 @ [List.nth l2 1])
31
32
33(* Arrows *)
34
35let nth i = Box.nth i boxes
36
37let arrow tex i j =
38  let p1 = Box.east (nth i) in
39  let p2 = Box.west (nth j) in
40  Arrow.draw ~tex ~anchor:`Top (Path.pathp ~style:Path.jLine [p1 ; p2])
41
42let arrows =
43  List.map Box.pic [arrow "Labelling" 0 1 ; arrow "Compilation" 1 2 ;
44                    arrow "" 2 3]
45
46
47(* Symbolic *)
48
49let symbolic = Box.group (boxes :: arrows)
50
51
52(* Output pictures *)
53
54let result = Box.draw symbolic
55
56let _ = Metapost.emit "symbolic" result
Note: See TracBrowser for help on using the repository browser.