程序代写代做代考 Haskell 11/9/2020 Grok | COMP30026 Practice Exam

11/9/2020 Grok | COMP30026 Practice Exam
Queson 7
Queson 7 Part A (1 mark)
Recall the reverse operaon on languages (over alphabet ) defined as follows:
In words, is the language of all strings appearing backwards in . As an example, if is then is .
Part A (1 mark)
Let be the language of the regular expression expression for ?
Instrucons
GiveyouranswerasaHaskellexpressionr7A :: RegExp.  Format
. What is a regular
RegExp.hs provides a regular expression type RegExp, and a parser for regular expressions,parseRE :: String -> RegExp.Usethistypetoenteryouranswer.
For example:
The regular expression may be entered as follows:
Star (Concat (Symbol ‘b’) (Symbol ‘a’)),or
parseRE “(ba)*”.
The regular expression may be entered as follows:
Concat (Symbol ‘a’) (Union EmptyStr (Concat (Symbol ‘a’) (Symbol ‘b’))),or
parseRE “a(eps | ab)”.
https://groklearning.com/learn/unimelb-comp30026-2020-s2/prac-exam/17/ 1/1
Cheng
)ba ∪ ε(a
∗)ab(
RA 1∗)1∪0(∪ε A
}110 ,10 ,0{ RL }011 ,01 ,0{ LL RL
.}i lla rof Σ ∈ ix ,L ∈ nx ⋯ 1x0x | 0x1x ⋯ nx{ = RL Σ