In this work, we ask you to design a deterministic Finite Automaton (FA) to recognise arithmetic expressions.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

When we say arithmetic expression, we mean a kind of expression you can type in a very basic desk calculator. That is, neither variables nor brackets are allowed. It contains only numbers and four arithmetic operators, +, -, *, and /.

 

The following are some examples of arithmetic expression:

 

  1. Any number string with or without signs - e.g. 3, -1, +10, 3.14, -0.70 and 099.
  2. Number strings mixed with arithmetic operators - e.g. 3+5, -1+2*3, 7/10-0.7, and -1.4-+8.2.

 

An example of FA diagram for recognising a non-negative integer is given below. You may use it as a start point. You need to add a few more states and transitions to handle numbers with decimal point and signs (e.g. -5, +2, 0.21, -32.6, +99.05, but not the form 1.0E-3). Most importantly, you also need to add a few more things to deal with the arithmetic operators +, -, *, /.

AutoSave OFF
Home Insert Draw Design Layout
A A
Paste
Page 1 of 1
92.
Times New... V 12 V
B I
222 words
✓ ab x₂ x² A
v
References
Aa ✓
V
Mailings Review
=-=-1¹5 E
= = =
English (United Kingdom)
V
View
V
start
# A↓
W= worksheet2
Tell me
Accessibility: Investigate
In this work, we ask you to design a deterministic Finite Automaton (FA) to
recognise arithmetic expressions.
The following are some examples of arithmetic expression:
AaBbCcDdE
Emphasis
When we say arithmetic expression, we mean a kind of expression you can type in a
very basic desk calculator. That is, neither variables nor brackets are allowed. It
contains only numbers and four arithmetic operators, +, -, *, and /.
+, -
0-9
., +, -, *₂/
1 AaBbC 1.1 AaBb
Heading 1 Heading 2
1.
Any number string with or without signs - e.g. 3, -1, +10, 3.14, -0.70 and 099.
2. Number strings mixed with arithmetic operators - e.g. 3+5, -1+2*3, 7/10-0.7,
and -1.4-+8.2.
An example of FA diagram for recognising a non-negative integer is given below. You
may use it as a start point. You need to add a few more states and transitions to handle
numbers with decimal point and signs (e.g. -5, +2, 0.21, -32.6, +99.05, but not the form
1.0E-3). Most importantly, you also need to add a few more things to deal with the
arithmetic operators +, -, *,/.
AaBb CcDdF
Heading 3
AaBbCcDdEe
Heading 4
digit
0-9
Focus
AaBb CcDdF
Heading 5
E
Comments
Styles
Pane
I
Editing
Dictate
Editor
Share
+ 175%
Transcribed Image Text:AutoSave OFF Home Insert Draw Design Layout A A Paste Page 1 of 1 92. Times New... V 12 V B I 222 words ✓ ab x₂ x² A v References Aa ✓ V Mailings Review =-=-1¹5 E = = = English (United Kingdom) V View V start # A↓ W= worksheet2 Tell me Accessibility: Investigate In this work, we ask you to design a deterministic Finite Automaton (FA) to recognise arithmetic expressions. The following are some examples of arithmetic expression: AaBbCcDdE Emphasis When we say arithmetic expression, we mean a kind of expression you can type in a very basic desk calculator. That is, neither variables nor brackets are allowed. It contains only numbers and four arithmetic operators, +, -, *, and /. +, - 0-9 ., +, -, *₂/ 1 AaBbC 1.1 AaBb Heading 1 Heading 2 1. Any number string with or without signs - e.g. 3, -1, +10, 3.14, -0.70 and 099. 2. Number strings mixed with arithmetic operators - e.g. 3+5, -1+2*3, 7/10-0.7, and -1.4-+8.2. An example of FA diagram for recognising a non-negative integer is given below. You may use it as a start point. You need to add a few more states and transitions to handle numbers with decimal point and signs (e.g. -5, +2, 0.21, -32.6, +99.05, but not the form 1.0E-3). Most importantly, you also need to add a few more things to deal with the arithmetic operators +, -, *,/. AaBb CcDdF Heading 3 AaBbCcDdEe Heading 4 digit 0-9 Focus AaBb CcDdF Heading 5 E Comments Styles Pane I Editing Dictate Editor Share + 175%
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 1 images

Blurred answer
Knowledge Booster
Sets
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education