Copyright © 1999-2001 University Of Saarland, Germany

GaniFA

The GaniFA applet visualizes and animates the following algorithms: GaniFA is customizable through a large set of parameters. In particular, it is possible to visualize only some of the algorithms and to pass a finite automaton or a regular expression as well as an input word to the applet.

Customizing GaniFA

GaniFA can be customized through a large set of different parameters. The applet is included in a Web page with the <EMBED> tag as shown in the following program fragment. This example illuminates the use of the parameters too, which are defined in the following paragraphs. Test this example here.
... 
    <EMBED 
      TYPE = "application/x-java-applet;version=1.2" 
      CODE = ganimal.applications.ganifa.VisualApplet.class 
      ARCHIVE = ganifa.jar
      WIDTH = 600 
      HEIGHT = 35
    
      RegEdit = "on"
      RegExp = "(a|b)"  
      Language = "E"
    
      StepNFAVis = "on"
      StepCheck1 = "off"
      StepEEpVis = "off"
      StepCheck2 = "off"
      StepDEAVis = "off"
      StepCheck3 = "off"
      StepMinVis = "off"
      StepCheck4 = "off"> 
...
This is a working example for the Netscape Navigator. In case of Internet Explorer, the applet has to be included with the <OBJECT> tag. A HTML specification of using Java Plug-in is given on SUN's Java Plug-in Homepage. The GaniFA JAR-file can be downloaded for free.

General Parameters

These parameters determine general aspects, which are important for embedding the applet into own HTML pages.
BgColor
determines the background color of the applet using the RGB color model.
Language
determines the language of all textual output in the visualization ("G" - German, "E" - English).
Foresight
determines whether foresighted layout (see below) is used for drawing the transition graph of an automaton.
Parameter Description Domain Default
bgcolor Background color #<R><G><B> "#c0c0c0"
Language Language {"G", "E"} "G"
Foresight Layout {"on", "off"} "off"

Startup Parameters

The following parameters influence the behavior of the applet when starting the visualizations, e.g. whether the user has to first click at a button to start the visualization and whether there are fields for him to enter regular expressions and input words.
StartButton
determines whether the visualization is started immediatedly ("off") or after clicking at a button ("on"). This parameter is automatically set to "on", if one of the parameters RegEdit or WordEdit is set to "on".
RegEdit
determines whether there is an input field for a regular expression ("on") or not ("off").
WordEdit
determines whether there is an input field for an input word ("on") or not ("off") to simulate the computations of the automata with.
RegExp
determines the regular expression to start with, if RegEdit is "off" and the default value in the input field, if RegEdit is "on".
Word
determines the input word to simulate the computations of the automata with, if WordEdit is "off" and the default value in the input field, if WordEdit is "on".
Parameter Description Domain Default
StartButton Start button {"on", "off"} "off"
RegEdit Input field of RA {"on", "off"} "off"
WordEdit Input field of word {"on", "off"} "off"
RegExp Reg. expression <RA> ""
Word Input word $\Sigma ^{*}$ ""

Format of Regular Expressions

Sub-expressions in regular expression read by the applet must always be enclosed in parentheses "(" and ")". "|" is used as the OR operator. The character "*" can be used as the Kleene star. The concatenation of two regular expression is represented by writting them one after another. As $\varepsilon$ the character "@" is used. All other characters can be used as elements of the alphabet $\Sigma$. For example (IaI|IbI)*(ccc|@) and (((a)|b)|c) are regular expressions, which can be read by the applet.

Parameters to select Algorithms

The parameters in this group determine, which algorithms are visualized. Whatever visualization is switched on, all generation algorithms are performed and the output of one algorithm is used as the input for the next one.
StepNFAVis
Generation of a NFA from an RE. If a finite automaton is given as a parameter of the applet, this visualization can not be switched on.
StepCheck1
Visualization of a computation of the NFA.
StepEEpVis
Removal of $\varepsilon$-transitions.
StepCheck2
Visualization of a computation of the NFA without $\varepsilon$-transitions.
StepDFAVis
Transformation of a NFA without $\varepsilon$-transitions into a deterministic finite automaton (DFA)
StepCheck3
Visualization of a computation of the DFA.
StepMinVis
Transformation of a DFA into a minimal DFA.
StepCheck4
Visualization of a computation of the minimal DFA.
Parameter Description Domain Default
StepNFAVis RE $\rightarrow$NFA {"on", "off"} "off"
StepCheck1 Sim: NFA {"on", "off"} "off"
StepEEpvis Del. $\varepsilon$-edges {"on", "off"} "off"
StepCheck2 Sim: NFA w.o. $\varepsilon$-edges {"on", "off"} "off"
StepDFAVis NFA $\rightarrow$DFA {"on", "off"} "off"
StepCheck3 Sim: DFA {"on", "off"} "off"
StepMinVis MinDFA {"on", "off"} "off"
StepCheck4 Sim: MinDFA {"on", "off"} "off"

Parameters to define Finite Automata

Instead of providing a regular expression it is also possible to specify a NFA or DFA in the parameters of the applet. The applet uses the parameter StateNr to detect, whether a finite automaton is specified. If this parameter is not given, it will use regular expressions to start with. If StateNr is given, the values of the parameters InitialState, FinalState and From must be set and the parameters RegEdit and RegExp will be ignored.
StateNr
contains the index of the last state. The automaton has states with indices 0 to the value of StateNr.
InitialState
is the index of the start state. The automata we consider here have only a single start state.
FinalStates
contains the set of final states. The indices of these states can be listed in arbitray order separated by " ", ",", ";" and ":".
From<n>
defines the transitions from state n to other states, Thus the parameter From0, From1, ..., From<StateNr> are read. A single transition is encoded by a symbol from $\Sigma$ and the index of the state it leads to. The value of the above parameters is a list of such transitions separated by " ", ",", ";" and ":".
Parameter Description Domain Default
StateNr Max. state index #<Number> ""
InitialState Initial state <Number> "0"
FinalStates Final states <F1>...<Fn> ""
From<Nr> Transitions <Sym><State>... ""



Stephan Diehl, Andreas Kerren and Torsten Weller
FR-6.2 Informatik, Universität des Saarlandes,
Postfach 15 11 50 , 66041 Saarbrücken, GERMANY,
Email: {diehl, kerren}@cs.uni-sb.de