• Tidak ada hasil yang ditemukan

PDF Andrew Mertz and William Slough

N/A
N/A
Nguyễn Gia Hào

Academic year: 2023

Membagikan "PDF Andrew Mertz and William Slough"

Copied!
6
0
0

Teks penuh

(1)

JFlap2TikZ

Andrew Mertz and William Slough

Introduction

JFlap is an excellent piece of software for experimenting with finite state machines, Turing machines and exploring many aspects of the theory of computation. JFlap2TikZ is a groovy script that converts a JFlap jfffile representing a finite automaton, push down automaton, or Turing machine to LATEX file depicting the automaton graphically using TikZ.

Requirements

To use JFlap2TikZ you will need Java installed. Additionally you may find it useful to have groovy in- stalled as well. You will need to download either JFlap2TikZ.jar (if you only have Java installed) or JFlap2TikZ.groovy(if you also have groovy installed).

Usage

JFlap2TikZis invoked from the command line, using Java java -jar JFlap2TikZ.jar example.jff

or using groovy

groovy JFlap2TikZ.groovy example.jff

Note that in either case the output will be written to the console. Redirect the output or copy and paste as needed. Here is the full usage information.

usage: JFlap2TikZ [-g] [-h] [-r] [-s scale] [-z size] filename -g,--grid Round positions so that they are on a grid -h,--help Show usage information and quit

-r,--rotate rotate labels along edges

-s,--scale <arg> 1 pixel in JFlap = scale points in LaTeX (default is 1.0)

-z,--gridsize <arg> Set the spacing of the grid (default is 20.0)

Examples

The following figures show machines from the bookJFLAP: An Interactive Formal Languages and Automata Package being converted to TikZ using JFlap2TikZ. Note that JFlap2TikZ currently ignores JFlap state annotations. Furthermore, not all JFlap files will be converted perfectly. You may have to adjust the scale and/or gridsize or edit the resulting TikZ code to achieve the effect you want. However, JFlap2TikZ should provide a good starting point.

(2)

Figure 1: ex0.1a.jff

q3

q2

q1

q0

a λ

b

a

a

Figure 2: ex0.1a.jffconverted to TikZ using default values

(3)

JFlap2TikZ v1.0 3

q3

q2 q1

q0

a λ

b

a

a

Figure 3: ex0.1a.jff converted to TikZ using a scale of 2

q3

q2 q1

q0

a λ

b

a

a

Figure 4: ex0.1a.jffconverted to TikZ using a gridsize of 100

(4)

Figure 5: ex9-anbncn.jff

(5)

JFlap2TikZ v1.0 5

q2

q7

q5

q0

q3

q9

q10 q4

q1

q8 q6

c:l, L a : a, L

b : b, L c : c, L

a : a, L b : b, L c : c, L

# : #, L l: l, R

c : c, R

b : b, R

# : #, R

a : a, R

# : #, R c : c, R

b : b, R a : a, R

#: #, R

l: l , R l: l, L

a:l,R

b : #, R

#:#, R

l: l, L

c:c,R b : #,R

l:l,S

l: l, L

Figure 6: ex9-anbncn.jff converted to TikZ using a gridsize of 50 and label rotations on

(6)

of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER

LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Referensi

Dokumen terkait

SELAMAT SIANG HARI INI SAYA AKAN MEMBERIKAN MATERI TENTANG PASAR INDUSTRI/BISNIS SEBAGAI MATERI TERAKHIR DAN LATIHAN SOAL UNTUK KE BAHAS MASING- MASING. File Materi

1.1.2 For the purposes of this Licence, unless the contrary intention appears: ‘Act’ means the Environmental Protection Act 1986; ‘annual period’ means the inclusive period from 1