CS606 Compiler Construction Assignment 1 Solution 2017

Task 1: [Marks = 10]

∑ = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}

Write a RE that would accept any number that is divisible to digit 4.

For example; If I enter string 21356496 then RE would accept this number as it is divisible to 4. And if I would pass / enter string 531487 then suggested RE would not accept this string as it is not divisible to 4.

Note:

–          String pass to RE would be of any length

–          Consider table of 4 (including 4 * 0 = 0) to find a pattern

–          You may also allowed to sub divide ∑ into more than one sets but name these language sets accordingly and also mention in your assignment solution.

Task 2: [Marks = 5]

Draw a FA that correspond to RE in Task 1.

DOWNLOAD SOLUTION HERE
loading...