Prolog code for finite state automata

Prolog code for - discussed in class mauto,S mfinal(S mauto[X|T,S[O|R mtrans(S,X,O,Snext,mauto(T,Snext,R%transition and output function

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
%Prolog code for finite state automata, discussed in class auto([],S) :- final(S). auto([X|T],S) :- trans(S,X,Snext),auto(T,Snext). %transition function trans(s1,a,s2). trans(s2,b,s1). %final state final(s2). %Prolog code for finite state automata with output,
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: % discussed in class mauto(,S,) :- mfinal(S). mauto([X|T],S, [O|R]) :- mtrans(S,X,O,Snext),mauto(T,Snext,R). %transition and output function mtrans(s1,a,x,s2). mtrans(s2,b,y,s1). %final states mfinal(s2)....
View Full Document

This note was uploaded on 12/12/2009 for the course SE 3306 taught by Professor Nhut during the Spring '09 term at University of Texas at Dallas, Richardson.

Ask a homework question - tutors are online