11/9/2020 Grok | COMP30026 Practice Exam
Ques on 5 Part B (4 marks)
Ques on 5 Part B (4 marks)
Construct a DFA which recognises the language of the regular expression
Make sure your automaton is complete and determinis c. It does not need to be minimal.
Instruc ons
GiveyouranswerasaHaskellexpressiondfa5B :: DFA. Format
The Haskell type DFA is defined in DFA.hs, and it is familiar to you from two worksheets, as well as from Assignment 2.
For example, this DFA:
can be represented as follows:
dfa = ([1,2], “ab”, t, 1, [2])
where
t = [ ((1,’a’),2)
, ((1,’b’),1)
, ((2,’a’),1)
, ((2,’b’),2)
]
Visualisa on WealsoprovidetheDFAvisualiseryouarefamiliarwith.DrawyourDFAdfa :: DFA
withvisDFA dfa.
https://groklearning.com/learn/unimelb-comp30026-2020-s2/prac-exam/13/ 1/1
Cheng
.
∗)ab(∗)ba(