1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Andreas93 [3]
3 years ago
6

Create a C language program that can be used to construct any arbitrary Deterministic Finite Automaton corresponding to the FDA

definition above. a. Create structs for the: automaton, a state, and a transition. For example, the automaton should have a "states" field, which captures its set of states as a linked list.
Engineering
1 answer:
otez555 [7]3 years ago
5 0

Answer:

see the explanation

Explanation:

/* C Program to construct Deterministic Finite Automaton */

#include <stdio.h>

#include <DFA.h>

#include <stdlib.h>

#include <math.h>

#include <string.h>

#include <stdbool.h>

struct node{

struct node *initialStateID0;

struct node *presentStateID1;

};

printf("Please enter the total number of states:");

scanf("%d",&count);

//To create the Deterministic Finite Automata

DFA* create_dfa DFA(){

  q=(struct node *)malloc(sizeof(struct node)*count);

  dfa->initialStateID = -1;

  dfa->presentStateID = -1;

  dfa->totalNumOfStates = 0;

  return dfa;

}

//To make the next transition

void NextTransition(DFA* dfa, char c)

{

  int tID;

  for (tID = 0; tID < pPresentState->numOfTransitions; tID++){

       if (pPresentState->transitions[tID].condition(c))

      {

          dfa->presentStateID = pPresentState->transitions[tID].toStateID;

          return;

      }

  }

  dfa->presentStateID = pPresentState->defaultToStateID;

}

//To Add the state to DFA by using number of states

void State_add (DFA* pDFA, DFAState* newState)

{  

  newState->ID = pDFA->numOfStates;

  pDFA->states[pDFA->numOfStates] = newState;

  pDFA->numOfStates++;

}

void transition_Add (DFA* dfa, int fromStateID, int(*condition)(char), int toStateID)

{

  DFAState* state = dfa->states[fromStateID];

  state->transitions[state->numOfTransitions].toStateID = toStateID;

  state->numOfTransitions++;

}

void reset(DFA* dfa)

{

  dfa->presentStateID = dfa->initialStateID;

}

You might be interested in
A 60-cm-high, 40-cm-diameter cylindrical water tank is being transported on a level road. The highest acceleration anticipated i
dlinn [17]

Answer:

h_{max} = 51.8 cm

Explanation:

given data:

height of tank = 60cm

diameter of tank =40cm

accelration = 4 m/s2

suppose x- axis - direction of motion

z -axis - vertical direction

\theta = water surface angle with horizontal surface

a_x =accelration in x direction

a_z =accelration in z direction

slope in xz plane is

tan\theta = \frac{a_x}{g +a_z}

tan\theta = \frac{4}{9.81+0}

tan\theta =0.4077

the maximum height of water surface at mid of inclination is

\Delta h = \frac{d}{2} tan\theta

            =\frac{0.4}{2}0.4077

\Delta h  0.082 cm

the maximu height of wwater to avoid spilling is

h_{max} = h_{tank} -\Delta h

            = 60 - 8.2

h_{max} = 51.8 cm

the height requird if no spill water is h_{max} = 51.8 cm

3 0
4 years ago
Any one here play animal crossing new horizons<br> if so wanna play
Oksanka [162]

Answer:

That's your Q seriously. Your funny. I don't have animal crossing but I do have league of legends.

Explanation:

8 0
3 years ago
Read 2 more answers
Gold and silver rings can receive an arc and turn molten. True or False
liubo4ka [24]
The answer is False!
The answer is false
8 0
3 years ago
Read 2 more answers
Natural ventilation uses primarily
Zolol [24]

Natural ventilation unlike fan forced ventilation uses the natural forces of wind and buoyancy to deliver fresh air into buildings

8 0
2 years ago
The engineer must place a catch basin at the north west corner of the yard of a subdivision lot. The catchment area will be calc
castortr0y [4]

Answer:

A = true.

Explanation:

The statement made in the Question or problem above is TRUE/correct. The term known as " catch basin" is an important and essential part of the drainage system that is should be built in a community(whether housing community, industrial community or commercial community).

The catch basin is very important because it helps in making sure that they act as sieve to get all the dirt such as leaves from water running on the surface(runoffs).

5 0
3 years ago
Other questions:
  • A jetliner flying at an altitude of 10,000 m has a Mach number of 0.5. If the jetliner has to drop down to 1000 m but still main
    11·1 answer
  • Vapor lock occurs when the gasoline is cooled and forms a gel, preventing fuel flow and
    7·2 answers
  • A structural component in the form of a wide plate is to be fabricated from a steel alloy that has a plane-strain fracture tough
    10·1 answer
  • What is matrix ? answer plzzz 27 point you got answer​
    15·2 answers
  • Why won't Brainly let me make a account or log in? It's always telling me that it can't take my registration at this time or it
    9·1 answer
  • Air enters a turbine with a stagnation pressure of 900 kPa and a stagnation temperature of 658K, and it is expanded to a stagnat
    9·1 answer
  • Determine if the fluid is satisfied​
    10·1 answer
  • -Electronic control modules can easily evaluate the voltage and current levels of circuits to which they are connected and deter
    15·1 answer
  • Hi gospelgamer10 lol
    9·2 answers
  • In the engineering design and prototyping process, what is the advantage of drawings and symbols over written descriptions?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!