ex_rwRule_distrib.tex 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. \begin{tikzpicture}[>=latex, node distance=1cm, on grid, auto]
  2. \tikzstyle{node}=[fill=white, text centered]
  3. % \begin{scope}
  4. \node [node] (lmult) {$\times$};
  5. \path (lmult)+(-1.0,-1) node (lx) [node] {$x$};
  6. \path (lmult)+(1.0,-1) node (lplus) [node] {$+$};
  7. \path (lplus)+(-0.7,-1) node (ly) [node] {$y$};
  8. \path (lplus)+(0.7,-1) node (lz) [node] {$z$};
  9. % \end{scope}
  10. % Draw arrows between elements
  11. \path [draw, -] (lmult.south)+(-0.2,0.0) -- node [above] {} (lx);
  12. \path [draw, -] (lmult.south)+(0.2,0.0) -- node [above] {} (lplus);
  13. \path [draw, -] (lplus.south)+(-0.2,0.0)-- node [above] {} (ly);
  14. \path [draw, -] (lplus.south)+(0.2,0.0)-- node [above] {} (lz);
  15. \node [node] (center) [right of=lmult,xshift=1.5cm] {} ;
  16. \path (center)+(0.0,-1) node (arr) [node] {$\longrightarrow$} ;
  17. % \begin{scope}
  18. \node [node] (rplus) [right of=center,xshift=1.5cm] {$+$};
  19. \path (rplus)+(-1.0,-1) node (rmult1) [node] {$\times$};
  20. \path (rmult1)+(-0.7,-1) node (rx1) [node] {$x$};
  21. \path (rmult1)+(0.7,-1) node (ry) [node] {$y$};
  22. \path (rplus)+(1.0,-1) node (rmult2) [node] {$\times$};
  23. \path (rmult2)+(-0.7,-1) node (rx2) [node] {$x$};
  24. \path (rmult2)+(0.7,-1) node (rz) [node] {$z$};
  25. % \end{scope}
  26. % Draw arrows between elements
  27. \path [draw, -] (rplus.south)+(-0.2,0.0) -- node [above] {} (rmult1);
  28. \path [draw, -] (rplus.south)+(0.2,0.0) -- node [above] {} (rmult2);
  29. \path [draw, -] (rmult1.south)+(-0.2,0.0)-- node [above] {} (rx1);
  30. \path [draw, -] (rmult1.south)+(0.2,0.0)-- node [above] {} (ry);
  31. \path [draw, -] (rmult2.south)+(-0.2,0.0)-- node [above] {} (rx2);
  32. \path [draw, -] (rmult2.south)+(0.2,0.0)-- node [above] {} (rz);
  33. %\path (plus) -- (mult1) node [midway] {$\longrightarrow$};
  34. \end{tikzpicture}
  35. %\caption{}
  36. %
  37. %x*(y+z) -> (x*y)+(x*z)
  38. %
  39. % * +
  40. % / \ / \
  41. %x + -> * *
  42. % /\ /\ /\
  43. % y z x y x z