answersLogoWhite

0


Best Answer

letter -> [a-zA-Z]

digit -> [0-9]

identifier -> letter|_(letter|digit|_)

User Avatar

Wiki User

12y ago
This answer is:
User Avatar
User Avatar

Natnael wakjira

Lvl 1
5mo ago
Good

Add your answer:

Earn +20 pts
Q: How to design a DFA that accepts an identifier in c language?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Distinguish between dfa and nfa?

DFA stands for Deterministic finite automaton and NFA stands for Nondeterministic finite automaton.Formally, an automaton is made up of: were delta is the transition function. In a DFA, delta takes as input a state and letter and returns only one state. In an NFA, delta takes as input a state and letter but returns a set of states.An NFA accepts a word iff there exists a run of the automaton on it (intuitively, the automaton guesses an accepting run). A DFA has only one run on every word and therefore accepts a word iff the single run on it is accepting.


Can DFA simulate NFA?

Yes, any NFA can be converted into an equivalent DFA. because there is an equivalence in between an NFA and DFA


What is the difference between deterministic finite automata and non deterministic finite automata?

A deterministic Finite Automata)DFA will have a single possible output for a given input.The answer is deterministic because you can always feel what the output will be.A (Nondeterministic Finite Automata)NFA will have at least one input which will cause a "choice" to be made during a state transition,unlike a (deterministic Finite Automata)DFA one input can cause multiple outputs for a given (Nondeterministic Finite Automata)NFA.


Difference between deterministic finite automaton and non deterministic finite automaton?

The state machine described in the previous section is a deterministic finite automaton, in which each state is unique. What would make a finite automaton nondeterministic is if each state was not. For the example, if the state machine allowed the input to have any letter as the second letter for the word "person" to transition to the next, then the next state would not be unique, making it a nondeterministic finite automaton.


C program for implement DFA to all string of abb?

#include<stdio.h> #include<conio.h> void main() { int state[10]; int str[10],input[10]; char ch; int x[20]; int s,n,k=0,j,a,i,l,t,q=0,fs,b,nxt; clrscr(); printf("enter the no. states\n"); scanf("%d",&s); printf("enter the no.of i/ps\n"); scanf("%d",&n); for(i=0;i<s;i++) { printf("enter the state\n"); scanf("%d",&state[i]); printf("is it final state?... .y..1/n..0\n"); scanf("%d",&a); if(a==1) fs=state[i]; } printf("enter the i/ps\n"); for(i=0;i<n;i++) scanf("%d",&input[i]); printf("transition state\n"); for(i=0;i<s;i++) { for(j=0;j<n;j++) { printf("(q%d,%d)=q",state[i],input[j]); scanf("%d",&b); x[k]=b; k++; } } printf("enter the length of string\n"); scanf("%d",&l); printf("enter the i/p string\n"); for(i=0;i<l;i++) scanf("%d",&str[i]); for(i=0;i<l;i++) { t=0; do { if(str[i]==input[t]) { nxt=x[n*q+t]; for(j=0;j<s;j++) { if(nxt==state[j]) q=j; } t++; } else t++; } while(t!=n); } if(nxt==fs) printf("\n string is accepted\n"); else printf("\n not accepted\n"); getch(); }

Related questions

What is Minimum state automata?

A minimum automaton is the automaton that cannot be modeled with fewer states. Let a DFA D has n states that accepts a language L. If D is minimum then no other DFA can model L with number of states less than n.


Similarity bw NFA and DFA?

if a language is recognized by NFA then it can also be recognized by DFA so we can simply say that NFA=DFA


What is a DFA?

DFA is an abbreviotion of (DEPARTMENT OF FOREIGN AFFAIRS) Answer: Design for All (DfA) is about ensuring that environments, products, services and interfaces work for people of all ages and abilities. Design for All has recently become a mainstream issue because of ageing of population.


How do you get an appointment in dfa Robinson lipa?

Sir/Madame Greeting may available slot po kayo kahit sa december tbank you


L WW is a binary number divisible by 5?

Construct DFA for the language


What is Dfas?

DFA is an abbreviotion of (DEPARTMENT OF FOREIGN AFFAIRS) Answer: Design for All (DfA) is about ensuring that environments, products, services and interfaces work for people of all ages and abilities. Design for All has recently become a mainstream issue because of ageing of population.


Distinguish between dfa and nfa?

DFA stands for Deterministic finite automaton and NFA stands for Nondeterministic finite automaton.Formally, an automaton is made up of: were delta is the transition function. In a DFA, delta takes as input a state and letter and returns only one state. In an NFA, delta takes as input a state and letter but returns a set of states.An NFA accepts a word iff there exists a run of the automaton on it (intuitively, the automaton guesses an accepting run). A DFA has only one run on every word and therefore accepts a word iff the single run on it is accepting.


Construct a DFA for language AA union ab?

_a->Accept/>O-a->O\_b->Accept


When was DFA Records created?

DFA Records was created in 2001.


Where is dfa batangas?

from sta.rosa laguna,how to go to dfa batangas?


Can DFA simulate NFA?

Yes, any NFA can be converted into an equivalent DFA. because there is an equivalence in between an NFA and DFA


When was The DFA Remixes created?

The DFA Remixes was created in 2006-10.