Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 1 Define L to be the set of strings that represent numbers in a modified version of Java. The goal in this problem is

image text in transcribed

Question 1 Define L to be the set of strings that represent numbers in a modified version of Java. The goal in this problem is to define a regular expression and an NFA for L. To precisely define L, let the set of digits be 1=(0, 1, 2, . . . , 9), and define the set of signs to be 2 {+,-). Then L = L1 U L2 U L3, where: L1 is the set of all strings that are decimal integer numbers. Specifically, L consists of strings that start with an optional sign, followed by one or more digits. Examples of strings in L are "02", "+9" . and "-241". L2 is the set of all strings that are floating-point numbers that are not in exponential notation. Specifically, L2 consists of strings that start with an optional sign, followed by zero or more digits, followed by a decimal point, and end with zero or more digits, where there must be at least one digit in the string. Examples of strings in L2 are "13231", "Z8" and ".124". All strings in L2 have . exactly one decimal point. La is the set of all strings that are floating-point numbers in exponential notation. Specifically, L; consists of strings that start with a string from Li or L2, followed by "E" or "e", and end with a string . from L. Examples of strings in L3 are "-80.1E-083", "+8.E5" and "1e+31". Assume that there is no limit on the number of digits in a string in L. Also, we do not allow for the suffixes L, I, F, f, D, d, at the end of numbers to denote types (long integers, floats, and doubles). Define as the alphabet of all printable characters on a computer keyboard (no control characters), except for parentheses to avoid confusion. (a) Give a regular expression for Li (define the language L]). Also, give an NFA and a DFA for L1 over the alphabet . (b) Give a regular expression for L2. Also, give an NFA for L2 over the alphabet 2 (c) Give a regular expression for L3. Also, give an NFA for L3 over the alphabet 2 (d) Give a regular expression for the language L. Also, give an NFA for L over the alphabet

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Object Databases The Essentials

Authors: Mary E. S. Loomis

1st Edition

020156341X, 978-0201563412

More Books

Students also viewed these Databases questions

Question

=+b) Does the boxplot nominate any outliers?

Answered: 1 week ago

Question

Have you eliminated jargon and unexplained acronyms?

Answered: 1 week ago