% -*- mode: latex; auto-revert-interval: 0.5 -*- \begin{tikzpicture}[->,>=stealth',shorten >=1pt,auto, node distance=4em, very thin,font={\scriptsize\bf}] \pgfdeclarelayer{background} \pgfdeclarelayer{foreground} \pgfsetlayers{background,main,foreground} \tikzstyle{basic-block} = [draw=black!50, fill=white, rectangle, minimum width=8.5em] \ifthenelse{\boolean{preview}} {\tikzstyle{block} = [basic-block]} {\tikzstyle{block} = [basic-block, drop shadow]} \tikzstyle{enter} = [block, ellipse, fill=red!20] \tikzstyle{guard} = [block, fill=yellow!20] \tikzstyle{newguard} = [block, fill=green!20] \tikzstyle{lbl} = [font={\scriptsize\it}, minimum width=0em] % \newboolean{loop-tree-step2} % \setboolean{loop-tree-step2}{false} \ifthenelse{\boolean{loop-tree-step2}} { \clip (-2.8, 2.1) rectangle (6.8,-6.9); } { \clip (-2.8, 2.0) rectangle (1.9,-6.8); } % plain nodes \node[enter, name=start] {loop($i_0$, $a_0$)} ; \node[guard, name=block1, below of=start] { \begin{tabular}{c} $t_0$ = int\_mod($i_0$, $2$) \\ $t_1$ = int\_is\_true($t_0$) \\ \ifthenelse{\boolean{loop-tree-step2}} { guard\_true($t_1$) } { \textcolor{blue}{guard\_true($t_1$)} } \\ \end{tabular} }; \node[guard, name=block2, below of=block1, node distance=5em] { \begin{tabular}{c} $a_1$ = int\_mul($a_0$, $2$) \\ $i_1$ = int\_add($i_0$, $1$) \\ $t_2$ = int\_lt($i_1$, $100$) \\ guard\_true($t_2$) \\ \end{tabular} }; \node[guard, name=block3, below of=block2] { jump($i_1$, $a_1$) }; \path (start.south) edge (block1.north) ; \path (block1.south) edge (block2.north) ; \path (block2.south) edge (block3.north) ; \path (block3.south) edge[distance=17em, out=230, in=110] (start.north) ; \ifthenelse{\boolean{loop-tree-step2}} { \node[newguard, name=block4, right=1em of block2] { \begin{tabular}{c} $a_3$ = int\_add($a_2$, $1$) \\ $i_3$ = int\_add($i_2$, $1$) \\ $t_3$ = int\_lt($i_3$, $100$) \\ guard\_true($t_3$) \\ \end{tabular} }; \node[newguard, name=block5, below of=block4] { jump($i_3$, $a_3$) }; \path (block1.south east) edge node[lbl] { \begin{tabular}{c} $i_2 \leftarrow i_0$ \\ $a_2 \leftarrow a_0$ \\ \end{tabular} } (block4.north) ; \path (block4.south) edge (block5.north) ; \path (block5.south) edge[out distance=22em, in distance=18em, out=320, in=70] (start.north) ; } {} \end{tikzpicture}