% Creator: Finomaton 1.0
% Creation-Date: Tue Mar 04 22:23:35 CET 2008

input boxes
% Breadth of arrowheads (MetaPost default is 45)
ahangle := 30;
% 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 \strut A etex);
s1.c = (58.8, -61.8);
drawboxed(s1);

circleit.s3(btex \strut B etex);
s3.c = (127.2, -61.8);
drawboxed(s3);

circleit.s5(btex \strut C etex);
s5.c = (94.2, -123.6);
drawboxed(s5);
draw fullcircle scaled 0.85(ypart s5.n - ypart s5.s) shifted s5.c;


% Next, draw the lines
p8 = directionpoint dir 231 of bpath s1..controls (32.4, -41.4) and (47.4, -28.2)..directionpoint dir 204 of bpath s1;
drawarrow p8;
label.ulft(btex b etex, point 0.5 of p8);

p13 = directionpoint dir 151 of bpath s3..controls (140.4, -30.6) and (155.4, -43.2)..directionpoint dir 126 of bpath s3;
drawarrow p13;
label.urt(btex c etex, point 0.5 of p13);

p18 = (s1.c)..controls .5[(s1.c),(93.6, -34.8)] and .5[(93.6, -34.8),(s3.c)]..(s3.c) cutbefore bpath s1 cutafter bpath s3;
drawarrow p18;
label.top(btex a etex, point 0.5 of p18);

p22 = (s3.c)..controls .5[(s3.c),(94.8, -89.4)] and .5[(94.8, -89.4),(s1.c)]..(s1.c) cutbefore bpath s3 cutafter bpath s1;
drawarrow p22;
label.top(btex a etex, point 0.5 of p22);

p26 = (s3.c)..controls .5[(s3.c),(143.4, -109.8)] and .5[(143.4, -109.8),(s5.c)]..(s5.c) cutbefore bpath s3 cutafter bpath s5;
drawarrow p26;
label.lrt(btex $\varepsilon$, b etex, point 0.5 of p26);

p30 = (s5.c)..controls .5[(s5.c),(90.6, -83.4)] and .5[(90.6, -83.4),(s3.c)]..(s3.c) cutbefore bpath s5 cutafter bpath s3;
drawarrow p30;
label.lrt(btex a, b etex, point 0.5 of p30);

p34 = (s1.c)..controls .5[(s1.c),(40.2, -111.6)] and .5[(40.2, -111.6),(s5.c)]..(s5.c) cutbefore bpath s1 cutafter bpath s5;
drawarrow p34;
label.llft(btex a etex, point 0.5 of p34);

p38 = (s5.c)..controls .5[(s5.c),(93.0, -84.0)] and .5[(93.0, -84.0),(s1.c)]..(s1.c) cutbefore bpath s5 cutafter bpath s1;
drawarrow p38;
label.llft(btex b etex, point 0.5 of p38);

p42 = directionpoint dir 339 of bpath s5..controls (84.6, -153.0) and (102.6, -153.0)..directionpoint dir 375 of bpath s5;
drawarrow p42;
label.bot(btex c etex, point 0.5 of p42);

drawarrow (39.6, -70.8)..controls .5[(39.6, -70.8),(43.2, -68.4)] and .5[(43.2, -68.4),(s1.c)]..(s1.c) cutafter bpath s1;

drawarrow (145.2, -71.4)..controls .5[(145.2, -71.4),(142.2, -68.4)] and .5[(142.2, -68.4),(s3.c)]..(s3.c) cutafter bpath s3;


% Finally, create labels

endfig;
end
