[GAP Forum] mistake with Union

NIK NIK nik9kr at gmail.com
Wed Feb 27 13:55:39 GMT 2013


 Dear forum

 I 've find mistake with Union.
++++++++++++++++++++++++++++++++++++++++++++++
gap> r := [ [ 2 ], [  ], [ 1, 3 ], [ 4 ] ];
[ [ 2 ], [  ], [ 1, 3 ], [ 4 ] ]
gap> Union( r{[]} );
[  ]
gap>st:= Union( r{[1,3]} );
[ 1 .. 3 ]
++++++++++++++++++++++++++++++++++++++++++++++

 But I need the all elements in list st:=[1,2,3].

This mistake makes many troubles in package "Automata".
++++++++++++++++++++++++++++++++++++++++++++++
gap> Display(rb1);
   |  1       2       3          4
-----------------------------------------
 a | [ 2 ]           [ 1, 3 ]   [ 4 ]
 b | [ 3 ]   [ 1 ]              [ 2, 4 ]
Initial states:  [ 1, 3 ]
Accepting state: [ 1 ]
gap> ddrb1:=NFAtoDFA(rb1);
#I  Determinized 4 to 5
< deterministic automaton on 2 letters with 5 states >
gap> Display(ddrb1);
   |  1  2  3  4  5
--------------------
 a |  2  2  1  2  5
 b |  3  4  5  3  5
Initial state:    [ 1 ]
Accepting states: [ 1, 2, 4 ]
+++++++++++++++++++++++++++++++++++++++++++++++


Thank you.
Nikolai Krainyukov



More information about the Forum mailing list