% Creator: Finomaton 1.0
% Creation-Date: Sun Mar 09 14:33:49 CET 2008

input boxes
% Breadth of arrowheads (MetaPost default is 45)
ahangle := 35;
% Length of arrowheads (MetaPost default is 4bp)
ahlength := 4;
beginfig(1);
% for temporary paths (might be unused)
path p[];

% First, define and draw all the states
circleit.s1(btex L etex);
s1.c = (85.0, -82.0);
pickup pencircle scaled 1.2bp;
drawboxed(s1);
pickup defaultpen;

circleit.s3("L1");
s3.c = (257.5, -82.0);
drawboxed(s3);
draw fullcircle scaled 0.85(ypart s3.n - ypart s3.s) shifted s3.c;

circleit.s5("L2");
s5.c = (434.0, -79.5);
drawboxed(s5);
draw fullcircle scaled 0.85(ypart s5.n - ypart s5.s) shifted s5.c;

circleit.s9("L4");
s9.c = (258.0, -201.5);
drawboxed(s9);

circleit.s38("L3");
s38.c = (85.0, -207.0);
drawboxed(s38);
draw fullcircle scaled 0.85(ypart s38.n - ypart s38.s) shifted s38.c;

circleit.s70("L5");
s70.c = (436.0, -205.0);
drawboxed(s70);

circleit.s72("L6");
s72.c = (85.0, -317.0);
drawboxed(s72);

circleit.s74("L7");
s74.c = (260.5, -321.0);
drawboxed(s74);

circleit.s76("L8");
s76.c = (446.0, -322.0);
drawboxed(s76);


% Next, draw the lines
p30 = (s1.c)..controls .5[(s1.c),(169.0, -82.5)] and .5[(169.0, -82.5),(s3.c)]..(s3.c) cutbefore bpath s1 cutafter bpath s3;
drawarrow p30;
label.top(btex a etex, point 0.5 of p30);

p46 = (s1.c)..controls .5[(s1.c),(267.5, -32.0)] and .5[(267.5, -32.0),(s5.c)]..(s5.c) cutbefore bpath s1 cutafter bpath s5;
drawarrow p46;
label.top(btex b etex, point 0.5 of p46);

p55 = (s1.c)..controls .5[(s1.c),(64.5, -149.5)] and .5[(64.5, -149.5),(s38.c)]..(s38.c) cutbefore bpath s1 cutafter bpath s38;
drawarrow p55;
label.lft(btex c etex, point 0.5 of p55);

p65 = (s3.c)..controls .5[(s3.c),(246.5, -144.5)] and .5[(246.5, -144.5),(s9.c)]..(s9.c) cutbefore bpath s3 cutafter bpath s9;
drawarrow p65;
label.lft(btex a etex, point 0.5 of p65);

p84 = (s9.c)..controls .5[(s9.c),(165.0, -160.5)] and .5[(165.0, -160.5),(s1.c)]..(s1.c) cutbefore bpath s9 cutafter bpath s1;
drawarrow p84;
label.bot(btex a etex, point 0.5 of p84);

p90 = (s3.c)..controls .5[(s3.c),(353.5, -135.5)] and .5[(353.5, -135.5),(s70.c)]..(s70.c) cutbefore bpath s3 cutafter bpath s70;
drawarrow p90;
label.top(btex b etex, point 0.5 of p90);

p94 = (s3.c)..controls .5[(s3.c),(162.5, -206.0)] and .5[(162.5, -206.0),(s72.c)]..(s72.c) cutbefore bpath s3 cutafter bpath s72;
drawarrow p94;
label.top(btex c etex, point 0.5 of p94);

p98 = (s5.c)..controls .5[(s5.c),(254.0, -296.0)] and .5[(254.0, -296.0),(s72.c)]..(s72.c) cutbefore bpath s5 cutafter bpath s72;
drawarrow p98;
label.top(btex c etex, point 0.5 of p98);

p102 = (s5.c)..controls .5[(s5.c),(441.0, -156.5)] and .5[(441.0, -156.5),(s70.c)]..(s70.c) cutbefore bpath s5 cutafter bpath s70;
drawarrow p102;
label.lft(btex b etex, point 0.5 of p102);

p106 = (s38.c)..controls .5[(s38.c),(70.5, -249.0)] and .5[(70.5, -249.0),(s72.c)]..(s72.c) cutbefore bpath s38 cutafter bpath s72;
drawarrow p106;
label.lft(btex c etex, point 0.5 of p106);

p111 = (s9.c)..controls .5[(s9.c),(243.0, -272.5)] and .5[(243.0, -272.5),(s74.c)]..(s74.c) cutbefore bpath s9 cutafter bpath s74;
drawarrow p111;
label.lft(btex b etex, point 0.5 of p111);

p115 = (s9.c)..controls .5[(s9.c),(368.0, -260.5)] and .5[(368.0, -260.5),(s76.c)]..(s76.c) cutbefore bpath s9 cutafter bpath s76;
drawarrow p115;
label.top(btex c etex, point 0.5 of p115);

p119 = (s70.c)..controls .5[(s70.c),(358.0, -290.5)] and .5[(358.0, -290.5),(s74.c)]..(s74.c) cutbefore bpath s70 cutafter bpath s74;
drawarrow p119;
label.top(btex b etex, point 0.5 of p119);

p123 = (s70.c)..controls .5[(s70.c),(446.5, -262.5)] and .5[(446.5, -262.5),(s76.c)]..(s76.c) cutbefore bpath s70 cutafter bpath s76;
drawarrow p123;
label.lft(btex c etex, point 0.5 of p123);

p129 = (s72.c)..controls .5[(s72.c),(258.5, -371.0)] and .5[(258.5, -371.0),(s76.c)]..(s76.c) cutbefore bpath s72 cutafter bpath s76;
drawarrow p129;
label.top(btex c etex, point 0.5 of p129);

p133 = (s74.c)..controls .5[(s74.c),(390.0, -216.5)] and .5[(390.0, -216.5),(s5.c)]..(s5.c) cutbefore bpath s74 cutafter bpath s5;
drawarrow p133;
label.bot(btex b etex, point 0.5 of p133);

p137 = (s74.c)..controls .5[(s74.c),(180.0, -248.5)] and .5[(180.0, -248.5),(s38.c)]..(s38.c) cutbefore bpath s74 cutafter bpath s38;
drawarrow p137;
label.bot(btex c etex, point 0.5 of p137);

p141 = (442.7443184554284, -330.95518575599317)..controls .5[(442.7443184554284, -330.95518575599317),(152.5, -463.5)] and .5[(152.5, -463.5),(86.21869343405147, -216.4254615164132)]..(86.21869343405147, -216.4254615164132);
drawarrow p141;
label.bot(btex c etex, point 0.5 of p141);


% Finally, create labels

endfig;
end
