function S = simple_paths(M) u0 = ''; q0 = M.q0; global S S = {''}; simple_sub(M,u0,q0); return function simple_sub(M,u0,q0) global S for s = M.ALF q1 = dfsa_delta(M,q0,s); if q1~=q0 u1 = [u0 s]; S{end+1} = u1; simple_sub(M,u1,q1) end end return function S = simple_paths0(M,u0) if ~exist('u0','var'), u0 = ''; end if length(M.Q)==1 S = {''}; else q0 = M.q0; S = {}; for s = M.ALF q1 = dfsa_delta(M,q0,s); if q1~=q0 Mq1 = M; Mq1.q0 = q1; Mq1 = minimize_dfsa(Mq1); Sq1 = simple_paths(Mq1); for i=1:length(Sq1) S{end+1} = Sq1{i}; S{end+1} = [s Sq1{i}]; end end end end return