[OS X TeX] pushdown automata?

Ross Moore ross at ics.mq.edu.au
Mon Jan 19 04:31:03 CET 2009


Hi Art,

On 19/01/2009, at 12:46 PM, Art Werschulz wrote:

> Hi.
>
> Any suggestions for drawing pushdown automata using TiKZ (or some  
> other LaTeX-friendly package)?  Something like the following (which  
> will only look good in a monospaced font):
>
> +---------+
> | State   |-------+
> | control |       |
> +---------+       V
>     |	       +---------------+
>     |          | a | a | b | b |
>     |          +---------------+
>     V
>   +---+
>   | x |
>   +---+
>   | y |
>   +---+
>   | z |
>   +---+

It can be done in just a few lines of Xy-pic coding:

\usepackage[all]{xy}

\framebox{%
  \def\wdth{.6cm} % dimension of a cell, adjust to suit
  \xygraph{
    []*!C++[F-]\txt{State\\Control}
    ( ?-[rr] : [d]*=<\wdth>[F-]{a}  % 1st item in the tape
        % further items to the right
       (?!{+R*=<\wdth>!L[F-]{a}+R*=<\wdth>!L[F-]{b}+R*=<\wdth>!L[F-]{b}
               +R*++!L{\dots}})
    , ?: [d]*=<\wdth>!U[F-]{x}   % top item in the stack
        % further items below
       (?!{+D*=<\wdth>!U[F-]{y}+D*=<\wdth>!U[F-]{z}+D*+!U{\vdots}})
    )}}

-------------- next part --------------
A non-text attachment was scrubbed...
Name: texshop_image.jpeg
Type: image/jpeg
Size: 20771 bytes
Desc: not available
URL: <http://tug.org/pipermail/macostex-archives/attachments/20090119/36ce7dc7/attachment.jpeg>
-------------- next part --------------



>
> Thanks.

Hope this helps,

	Ross

>
> Art Werschulz
> 207 Stoughton Avenue, Cranford  NJ 07016-2838
> (908) 272-1146
>
>
>
> ----------- Please Consult the Following Before Posting -----------
> TeX FAQ: http://www.tex.ac.uk/faq
> List Reminders and Etiquette: http://email.esm.psu.edu/mac-tex/
> List Archive: http://tug.org/pipermail/macostex-archives/
> TeX on Mac OS X Website: http://mactex-wiki.tug.org/
> List Info: http://email.esm.psu.edu/mailman/listinfo/macosx-tex
>

------------------------------------------------------------------------
Ross Moore                                       ross at maths.mq.edu.au
Mathematics Department                           office: E7A-419
Macquarie University                             tel: +61 (0)2 9850 8955
Sydney, Australia  2109                          fax: +61 (0)2 9850 8114
------------------------------------------------------------------------





More information about the macostex-archives mailing list