function [b,u] = randstrinpt(M) % returns a random string accepted by pt-lang M X0 = simple_paths(M); RR = {}; for i=1:length(X0) if run_dfsa(M,X0{i}) RR{end+1} = spath2cell(M,X0{i}); end end if empty_fsa(M) b = 0; u = ''; else b = 1; x = randel(RR); x = x{1}; u = sample_from_sp(x,0); end return