%%% A very simple hmm %%% - illustrating extended with abstract implemementation. %%% %%% Developed in the PRISM system by Henning Christiansen, November 2006 %%% http://www.ruc.dk/~henning values(s0,[s1+rattle,s2+rattle,stop+nothing]). values(s1,[s0+rattle,s1+rattle,s4+crunch,stop+nothing]). values(s2,[s0+rattle,s3+crunch,stop+nothing]). values(s3,[s2+crunch,s3+rattle,s4+squeak,stop+nothing]). values(s4,[s1+crunch,s3+squeak,s5+crunch,s6+rattle,stop+nothing]). values(s5,[s4+crunch,s5+rattle,s6+squeak,stop+nothing]). values(s6,[s4+rattle,s5+squeak,s6+rattle,stop+nothing]). %% no set_ss as we know nothing specific %% PRISM assumes even distribution when nothing is given target(hmm,1). hmm(S):- hmm(S,_). hmm(S,Where):- hmm(S,s0,Where). hmm(S,From,Final):- msw(From,Next+Sound), (Next=stop -> S=[], Final=From ; S=[Sound|Sx], hmm(Sx,Next,Final)).