0

I'm trying to construct the Definite Finite Automata of a real number, that is defined as a string leading with an optional '+' or '-', followed by a single zero or non-empty sequence of digits that doesn't start with a zero. This is followed by a decimal point, which is followed by a non-empty sequence of digits.

I constructed the regular expression: /[+ | -]?(O | ([1-9][0-9]*)).[0-9]+/

It can be tested on this site: http://rubular.com/

I'm really unsure on how to go about constructing a DFA, especially considering that there must be a defined state corresponding to each input on the transition table.

2 Answers2

0

This picture might be a solution

DFA for the regex given

sdwaraki
  • 382
  • 1
  • 4
  • 12
0

You can find the DFA from the following website: http://hackingoff.com/compilers/regular-expression-to-nfa-dfa

enter image description here

Riyafa Abdul Hameed
  • 7,417
  • 6
  • 40
  • 55