Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > 5e1854624d3bc613bdd0dd13d1ef9ac7 > files > 845

gap-system-4.4.12-5mdv2010.0.i586.rpm

  
  B Drawing automata
  
  The  drawing  of  graphs described here uses graphviz [DEGKNW02], a software
  for  drawing  graphs  developed  at  AT  &  T  Labs, that can be obtained at
  http://www.graphviz.org/.
  
  
  B.1 Installing some external programs
  
  In   order   to   create   the   drawings   you   should   install  graphviz
  (http://www.graphviz.org/) and to view them you should install one of evince
  (http://www.gnome.org/projects/evince/),                                 ggv
  (http://directory.fsf.org/GNU/ggv.html),                              gsview
  (http://pages.cs.wisc.edu/~ghost/gsview/)                or               gv
  (http://www.gnu.org/software/gv/).
  
  
  B.2 Functions to draw automata
  
  B.2-1 DrawAutomaton
  
  > DrawAutomaton( A[, state_names, L, file] ) _______________________function
  
  This  function  draws automaton A. The arguments state_names, L and file are
  optional.
  
  An  automaton with n states will be drawn with numbers 1 to n written inside
  the  corresponding  graph  node.  The  argument  state_names  is a list of n
  strings  which  will  be the new text written inside the corresponding graph
  node.
  
  The argument L is a list of lists of integers, each of which specifies a set
  of states to be drawn in a different color.
  
  The argument file is a string that specifies the name of the file containing
  the drawing. If it is not give, it defaults to "automaton".
  
  ---------------------------  Example  ----------------------------
    gap> x:=Automaton("det",3,2,[ [ 2, 3, 0 ], [ 0, 1, 2 ] ],[ 1 ],[ 1, 2, 3 ]);;
    gap> DrawAutomaton(x,"file_name");
    Displaying file: /tmp/tmp.Rj0v1s/file_name.dot.ps
    
    gap> DrawAutomaton(x,["st 1", "2", "C"],"file_name");
    Displaying file: /tmp/tmp.BCH3FO/file_name.dot.ps
    
    gap> DrawAutomaton(x,["st 1", "2", "C"],[[2],[1,3]]);
    Displaying file: /tmp/tmp.LPnJMq/automaton.dot.ps
  ------------------------------------------------------------------
  
  The  output  of  the  three  previous  DrawAutomaton  commands  would be the
  following diagrams displayed in a ghostview window, respectively.
  
  B.2-2 DrawAutomata
  
  > DrawAutomata( A, B[, file] ) _____________________________________function
  
  This  function tests if automaton  A  is a subautomaton of  B  in which case
  draws    B    highlighting  the edges not in  A  by drawing them in a dotted
  style, while the others are drawn in a plain style.
  
  B.2-3 DrawGraph
  
  > DrawGraph( G[, file] ) ___________________________________________function
  
  Draws a graph specified as an adjacency list G.
  
  B.2-4 DrawSCCAutomaton
  
  > DrawSCCAutomaton( A[, state_names, L, file] ) ____________________function
  
  Draws  automaton    A   and highlights it's strongly connected components by
  drawing the other edges in a dotted style.
  
  The  optional  arguments  state_names,  L  and  file  are  as  described  in
  DrawAutomaton (B.2-1).
  
  
  B.3 Drawings output formats
  
  Since  drawings  are mostly used in the SgpViz package, please refer to that
  package's                                                             manual
  (http://www.gap-system.org/Manuals/pkg/sgpviz/doc/manual.html)   section  of
  the same name.
  
  
  B.4 Drawings extra graph attributes
  
  Since  drawings  are mostly used in the SgpViz package, please refer to that
  package's                                                             manual
  (http://www.gap-system.org/Manuals/pkg/sgpviz/doc/manual.html)   section  of
  the same name.