Assignment 9: Finite-state Automata

Deadline: 27th January, 14:00 CET

In this assignment, we will work with finite state automata, use it for an implementation of the trie data structure and implement a minimization method. A class representing the FSA is available to you with various methods already implemented, and so is a small lexicon.

For a more detailed description, please attend the lab session on Friday, 17th of January.

Starter code

Exercises

Exercise 1

Implement the method insert_words() which reads a list of words from a given file, uses the FSA class as a way to insert all words into a trie. The resulting trie (FSA) should be a DFA, where arc labels are letters as in the following figure showing an example trie with words walk, walks, wall, walls, want, wants, work and works.

Exercise 2

Implement the method minimize(). You can use any of the minimization methods discussed in the class.

Wrapping up

Do not forget to