Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/GAP/pkg/automata/   (GAP Algebra Version 4.15.1©)  Datei vom 30.7.2024 mit Größe 837 B image not shown  

Quelle  EXAMPLES   Sprache: unbekannt

 
********************************
*********** Automata ***********
To give an automaton to GAP use the function Automaton

gap> Automaton("det",3,2,[ [ 030 ], [ 230 ] ],[ 3 ],[ 13 ]);;

A random function is also available

gap> x := RandomAutomaton("det",3,2);;Display(x);
   |  1  2  3
--------------
 a |     3
 b |  2  3
Initial state:    [ 3 ]
Accepting states: [ 13 ]

Now using Print and String you obtain

gap> Print(String(x));
Automaton("det",3,"ab",[ [ 030 ], [ 230 ] ],[ 3 ],[ 13 ]);;

and through the use of copy/paste and some small changes it is easy to give your favourite automaton to GAP.

********************************************
*********** Rational Expressions ***********
To give a rational expression to GAP use the function RationalExpression

gap> RationalExpression("aUba*","ab");
aUba*

[Dauer der Verarbeitung: 0.11 Sekunden, vorverarbeitet 2026-06-19]