FSA for Noun Phrase: Solution
You were asked to construct a finite state automaton recognizing those English noun phrases that can be built from the words the, a, wizard, witch, broomstick, hermione, harry, ron, with, fast. A possible FSA is:
This FSA is described in Prolog as below.
initial(1).
final(3).
arc(1,2,a).
arc(1,2,the).
arc(2,2,brave).
arc(2,2,fast).
arc(2,3,witch).
arc(2,3,wizard).
arc(2,3,broomstick).
arc(2,3,rat).
arc(1,3,harry).
arc(1,3,ron).
arc(1,3,hermione).
arc(3,1,with).
Use the fsa recognizer in recognise2.pl