source: Deliverables/Dissemination/final-review/wp5/Pics/ternary2.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: 960 bytes
Line 
1
2open Mlpost
3
4
5(* Helpers *)
6
7let tex = Box.tex ~dx:(Num.cm 0.2) ~dy:(Num.cm 0.2)
8
9let format_lang s = "$\\" ^ s ^ "$"
10let tex_list l = List.map tex (List.map format_lang l)
11
12let middle p1 p2 =
13  let p = Point.add p1 p2 in
14  Point.mult (Num.of_float 0.5) p
15
16let arrow tex c1 c2 =
17  let path = Path.pathp [Box.east c1 ; Box.west c2] in
18  Box.pic (Arrow.draw ~tex ~anchor:`Top path)
19
20
21(* Boxes *)
22
23let langs =
24  let texts = tex_list ["Clang" ; "Clight" ; "Clang" ; "Clight"] in
25  Box.hbox ~padding:(Num.cm 2.) texts
26
27
28(* Arrows *)
29
30let arrows =
31  let get_lang i = Box.nth i langs in
32  let arrow1 = arrow "CIL" (get_lang 0) (get_lang 1) in
33  let arrow2 = arrow "Instrument" (get_lang 1) (get_lang 2) in
34  let arrow3 = arrow "CIL" (get_lang 2) (get_lang 3) in
35  [arrow1 ; arrow2 ; arrow3]
36
37
38(* Ternary *)
39
40let ternary = Box.group (langs :: arrows)
41
42
43(* Output pictures *)
44
45let result = ternary
46let result = Box.draw result
47
48let _ = Metapost.emit "ternary2" result
Note: See TracBrowser for help on using the repository browser.