File:Example derivation of a term from a regular tree grammar.pdf

Summary

Description
English: Illustrates the derivation of an example term from an regular tree grammar given in en:Regular_tree_grammar#Examples.
Date
Source Own work
Author Jochen Burghardt
Other versions

2-dimensional: File:Example derivation of a term from a regular tree grammar.pdf File:Example derivation of a term from a regular tree grammar svg.svg,

3-dimensional: File:Example derivation tree of a term from a regular tree grammar.pdf File:Example derivation tree of a term from a regular tree grammar svg.svg
LaTeX source code
 \documentclass[12pt]{article}
 \usepackage[pdftex]{color}
 \usepackage[paperwidth=250mm,paperheight=25mm]{geometry}
 \setlength{\topmargin}{-36mm}
 \setlength{\textwidth}{30cm}
 \setlength{\textheight}{26cm}
 \setlength{\evensidemargin}{-2.7cm}
 \setlength{\oddsidemargin}{-2.5cm}
 \setlength{\parindent}{0cm}
 \setlength{\parskip}{1ex}
 \setlength{\unitlength}{1mm}
 \sloppy
 \begin{document}

 % foreground
 \definecolor{fN}       {rgb}{0.40,0.00,0.00}   % nonterminal
 \definecolor{fT}       {rgb}{0.00,0.00,0.20}   % terminal
 \definecolor{fM}       {rgb}{0.00,0.00,0.00}   % meta symbols
 \definecolor{fB}       {rgb}{0.00,0.00,0.20}   % branch line

 % background
 \definecolor{bT}       {rgb}{0.90,0.90,0.90}   % term
 \definecolor{bR}       {rgb}{0.99,0.90,0.90}   % redex

 \begin{picture}(250,20)

 \thicklines

 \textcolor{bR}{\put(05,22){\makebox(0,0)[tl]{\rule{10mm}{04mm}}}}%
 \textcolor{fN}{\put(10,20){\makebox(0,0){BList}}}%

 \textcolor{fM}{\put(20,20){\makebox(0,0){$\Rightarrow$}}}%

 \textcolor{bT}{\put(25,22){\makebox(0,0)[tl]{\rule{30mm}{14mm}}}}%
 \textcolor{bR}{\put(25,12){\makebox(0,0)[tl]{\rule{10mm}{04mm}}}}%
 \textcolor{fT}{\put(40,20){\makebox(0,0){cons}}}%
 \textcolor{fB}{\put(38,18){\vector(-1,-1){6}}}%
 \textcolor{fB}{\put(42,18){\vector(1,-1){6}}}%
 \textcolor{fN}{\put(30,10){\makebox(0,0){Bool}}}%
 \textcolor{fN}{\put(50,10){\makebox(0,0){BList}}}%

 \textcolor{fM}{\put(60,20){\makebox(0,0){$\Rightarrow$}}}%

 \textcolor{bT}{\put(65,22){\makebox(0,0)[tl]{\rule{30mm}{14mm}}}}%
 \textcolor{bR}{\put(85,12){\makebox(0,0)[tl]{\rule{10mm}{04mm}}}}%
 \textcolor{fT}{\put(80,20){\makebox(0,0){cons}}}%
 \textcolor{fB}{\put(78,18){\vector(-1,-1){6}}}%
 \textcolor{fB}{\put(82,18){\vector(1,-1){6}}}%
 \textcolor{fT}{\put(70,10){\makebox(0,0){false}}}%
 \textcolor{fN}{\put(90,10){\makebox(0,0){BList}}}%

 \textcolor{fM}{\put(100,20){\makebox(0,0){$\Rightarrow$}}}%

 \textcolor{bT}{\put(105,22){\makebox(0,0)[tl]{\rule{40mm}{24mm}}}}%
 \textcolor{bR}{\put(115,2){\makebox(0,0)[tl]{\rule{10mm}{04mm}}}}%
 \textcolor{fT}{\put(120,20){\makebox(0,0){cons}}}%
 \textcolor{fB}{\put(118,18){\vector(-1,-1){6}}}%
 \textcolor{fB}{\put(122,18){\vector(1,-1){6}}}%
 \textcolor{fT}{\put(110,10){\makebox(0,0){false}}}%
 \textcolor{fT}{\put(130,10){\makebox(0,0){cons}}}%
 \textcolor{fB}{\put(128,8){\vector(-1,-1){6}}}%
 \textcolor{fB}{\put(132,8){\vector(1,-1){6}}}%
 \textcolor{fN}{\put(120,0){\makebox(0,0){Bool}}}%
 \textcolor{fN}{\put(140,0){\makebox(0,0){BList}}}%

 \textcolor{fM}{\put(150,20){\makebox(0,0){$\Rightarrow$}}}%

 \textcolor{bT}{\put(155,22){\makebox(0,0)[tl]{\rule{40mm}{24mm}}}}%
 \textcolor{bR}{\put(185,2){\makebox(0,0)[tl]{\rule{10mm}{04mm}}}}%
 \textcolor{fT}{\put(170,20){\makebox(0,0){cons}}}%
 \textcolor{fB}{\put(168,18){\vector(-1,-1){6}}}%
 \textcolor{fB}{\put(172,18){\vector(1,-1){6}}}%
 \textcolor{fT}{\put(160,10){\makebox(0,0){false}}}%
 \textcolor{fT}{\put(180,10){\makebox(0,0){cons}}}%
 \textcolor{fB}{\put(178,8){\vector(-1,-1){6}}}%
 \textcolor{fB}{\put(182,8){\vector(1,-1){6}}}%
 \textcolor{fT}{\put(170,0){\makebox(0,0){true}}}%
 \textcolor{fN}{\put(190,0){\makebox(0,0){BList}}}%

 \textcolor{fM}{\put(200,20){\makebox(0,0){$\Rightarrow$}}}%

 \textcolor{bT}{\put(205,22){\makebox(0,0)[tl]{\rule{40mm}{24mm}}}}%
 \textcolor{fT}{\put(220,20){\makebox(0,0){cons}}}%
 \textcolor{fB}{\put(218,18){\vector(-1,-1){6}}}%
 \textcolor{fB}{\put(222,18){\vector(1,-1){6}}}%
 \textcolor{fT}{\put(210,10){\makebox(0,0){false}}}%
 \textcolor{fT}{\put(230,10){\makebox(0,0){cons}}}%
 \textcolor{fB}{\put(228,8){\vector(-1,-1){6}}}%
 \textcolor{fB}{\put(232,8){\vector(1,-1){6}}}%
 \textcolor{fT}{\put(220,0){\makebox(0,0){true}}}%
 \textcolor{fT}{\put(240,0){\makebox(0,0){nil}}}%

 \end{picture}

 \end{document}

Licensing

I, the copyright holder of this work, hereby publish it under the following license:
w:en:Creative Commons
attribution share alike
This file is licensed under the Creative Commons Attribution-Share Alike 3.0 Unported license.
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  • share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.
Category:CC-BY-SA-3.0#Example%20derivation%20of%20a%20term%20from%20a%20regular%20tree%20grammar.pdf
Category:Self-published work Category:Files by User:Jochen Burghardt Category:Formal languages Category:Images with LaTeX source code Category:Tree structures
Category:CC-BY-SA-3.0 Category:Files by User:Jochen Burghardt Category:Formal languages Category:Images with LaTeX source code Category:Pages using deprecated source tags Category:Self-published work Category:Tree structures