Tip of the day
News
Instructions
Objective
Write a haskell assignment program that allows users to implement and define regular expressions.
Requirements and Specifications
For each of the three variables, write a regular expression (as a string) corresponding to the DFAs given below. Ensure that the regex you provide can be parsed using the parser provided in REP.hs.
For example,
*REP> parse (pREof pAlphabet) "A*B*"
Just (RSeq (RStar (RSym A)) (RStar (RSym B)))
You may use any of the posted sample code to check your answers, but only submit the regular expressions themselves.
regex1 should correspond to this DFA:
regex2 should correspond to this DFA:
regex3 should correspond to this DFA:
Screenshots of output
Source Code
module HW5 where-- imports added for doing tests in ghciimport Parserimport REimport REPregex1 = "(B|A+B)*"regex2 = "A+B+|B+A+|e"regex3 = "(BA)*(e|AA(BA|AA(BA)*AA)*(e|AA(BA)*))"
Related Samples
Discover Haskell Assignment Samples: Explore our curated collection showcasing Haskell solutions for functional programming challenges. From basic functions to monads and type systems, each sample illustrates elegant programming techniques. Enhance your Haskell skills and deepen your understanding with practical examples designed to aid student learning.
Haskell
Word Count
4362 Words
Writer Name:Dr. Liam Patel
Total Orders:600
Satisfaction rate:
Haskell
Word Count
6608 Words
Writer Name:John Williams
Total Orders:900
Satisfaction rate:
Haskell
Word Count
5340 Words
Writer Name:Dr. Samantha Taylor
Total Orders:715
Satisfaction rate:
Haskell
Word Count
6469 Words
Writer Name:Dr. Samantha Taylor
Total Orders:715
Satisfaction rate:
Haskell
Word Count
4143 Words
Writer Name:Prof. Liam Reynolds
Total Orders:685
Satisfaction rate:
Haskell
Word Count
4466 Words
Writer Name:Nadia Dubois
Total Orders:682
Satisfaction rate:
Haskell
Word Count
6071 Words
Writer Name:Dr. Samantha Bennett
Total Orders:812
Satisfaction rate:
Haskell
Word Count
4841 Words
Writer Name:Dr. Chloe Wong
Total Orders:941
Satisfaction rate:
Haskell
Word Count
4266 Words
Writer Name:David Lee
Total Orders:764
Satisfaction rate:
Haskell
Word Count
12138 Words
Writer Name:Professor Anderson
Total Orders:700
Satisfaction rate:
Haskell
Word Count
3767 Words
Writer Name:Professor Marcus Johnson
Total Orders:600
Satisfaction rate:
Haskell
Word Count
5726 Words
Writer Name:Nadia Dubois
Total Orders:682
Satisfaction rate:
Haskell
Word Count
11881 Words
Writer Name:Professor Marcus Johnson
Total Orders:600
Satisfaction rate:
Haskell
Word Count
3752 Words
Writer Name:Dr. Chen Wang
Total Orders:521
Satisfaction rate:
Haskell
Word Count
5102 Words
Writer Name:Dr. Benjamin
Total Orders:812
Satisfaction rate:
Haskell
Word Count
7728 Words
Writer Name:Liam Chen
Total Orders:750
Satisfaction rate:
Haskell
Word Count
5512 Words
Writer Name:Dr. Chloe Wong
Total Orders:941
Satisfaction rate:
Haskell
Word Count
987 Words
Writer Name:David Lee
Total Orders:764
Satisfaction rate:
Haskell
Word Count
4978 Words
Writer Name:Professor Marcus Johnson
Total Orders:600
Satisfaction rate:
Haskell
Word Count
4716 Words
Writer Name:Professor Marcus Johnson
Total Orders:600
Satisfaction rate: