forked from 3breadt/UPB-ADT-Automata-Tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFSA_TableFillingMinimizer.cpp
692 lines (620 loc) · 21.1 KB
/
FSA_TableFillingMinimizer.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
/**
* @file FSA_TableFillingMinimizer.cpp
* @author Yacine Smaoui
*
* @brief implementation of the Table filling algorithm to minimize a finite states automaton
*/
#include <cstdlib>
#include "FSA_TableFillingMinimizer.h"
#define DISTINGUISHABLE 9
#define ELEMENT_ON_DIAG_MINTABLE 8
#define ELEMENT_TREATED 7
#define ERROR_STATE_NOT_FOUND 999
using namespace std;
/**
* @brief the main function to call to use the Table filling Algorithm for minimization
* steps in this implementation:
*
* 1)initialization of the minimization table
* 2)filling the minimization table by finding the distinguishable pairs of states
* 3)merging the distinguishable states in one equivalent state
*
* 4) finally the automat is written in a text file to see result.
*
* @param pAutomat the FSA to minimize
* @author Yacine Smaoui
*/
void TableFillingFSAMinimizer::minimize(FiniteStateAutomaton* pAutomat)
{
vector<string> allInputs;
int numberOfStates;
//getNumberOfStates
numberOfStates = getNumberOfStates(pAutomat);
allInputs= pAutomat->getEdgesFromTransitionList();
//vector< vector<int> > minTable (numberOfStates , vector<int>(numberOfStates));
vector<vector<StatesPair> > minTable (numberOfStates, vector<StatesPair>(numberOfStates));
initMinimizingTableStruct(pAutomat, &minTable);
printMinTableStruct(&minTable);
fillMinimizingTableStruct(&minTable,&allInputs, pAutomat);
printMinTableStruct(&minTable);
mergeStates(&minTable,pAutomat);
pAutomat->write("Beispieldateien/FSA-exampleFromMinimisingDocument_TotalFSA_minimized.txt");
}
/**
* @brief a method to print to contents of the minimization table used in this algorithm
* @param pMinTable
* @author Yacine Smaoui
*/
void TableFillingFSAMinimizer::printMinTableStruct(vector< vector<StatesPair> > * pMinTable)
{
for(unsigned int i=1; i < pMinTable->size() ; i++ )
{
cout << "(" << i << ")" ;
for(unsigned int j=0; j < i ; j++)
{
if((*pMinTable)[i][j].areDistinguishable)
{
cout << "D" << " " ;
}
else
{
cout << "N" << " " ;
}
if (j == i-1)
{
cout << endl;
}
}
}
}
/**
* @brief Initializing the minimization table, by marking all pairs of one accepting state and one rejecting state as distiguishable pairs of states
* @param pAutomat
* @param pMinTable
* @author Yacine Smaoui
*/
void TableFillingFSAMinimizer::initMinimizingTableStruct(FiniteStateAutomaton* pAutomat, vector< vector<StatesPair> >* pMinTable)
{
vector<State*>* pStates = pAutomat->getStateList();
bool stateIsFinal;
/**intialise Table*/
for(unsigned int i=0; i < pMinTable->size() ; ++i )
{
for(unsigned int j=0; j < i ; ++j) //(*pMinTable)[i].size()
{
(*pMinTable)[i][j].areDistinguishable= 0 ;
}
}
/**accepting states and rejecting states are distiguishable*/
for(unsigned int i = 0; i <pStates->size() ; i++) // until size/2 maybe better
{
stateIsFinal = (*pStates)[i]->isFinalState() ;
for(unsigned int j = 0; j <pStates->size() ; j++)
{
if(i != j)
{
if((*pStates)[j]->isFinalState() != stateIsFinal)
{
(*pMinTable)[i][j].areDistinguishable = 1;
}
}
}
}
}
/**
* @brief filling the Minimization Table by finding all distiguishable pairs of states using the algorithm.
* @param pMinTable the minimization table
* @param pAllInputs the inputs of all transitions in this FSA
* @param pAutomat the Automat to minimize
* @author Yacine Smaoui
*/
void TableFillingFSAMinimizer::fillMinimizingTableStruct(vector< vector<StatesPair> > * pMinTable , vector<string>* pAllInputs, FiniteStateAutomaton* pAutomat)
{
/** For every element in minTable*/
for(unsigned int i=1; i < pMinTable->size() ; i++ )
{
for(unsigned int j=0; j < i ; j++)
{
/**if it is not marked as distinguishable*/
if(!(*pMinTable)[i][j].areDistinguishable)
{
/** for every input */
for(unsigned int inputCounter = 0 ; inputCounter < pAllInputs->size(); inputCounter++)
{
string input = (*pAllInputs)[inputCounter];
/**get the next States of i, and j */
int stateFollowingI = getNextStateIndex(i,input,pAutomat);
int stateFollowingJ = getNextStateIndex(j,input,pAutomat);
if(stateFollowingI == ERROR_STATE_NOT_FOUND || stateFollowingJ == ERROR_STATE_NOT_FOUND)
{
cerr << "State not found, cannot proceed" << endl;
}
if(stateFollowingI < stateFollowingJ)
{
int temp = stateFollowingI;
stateFollowingI = stateFollowingJ;
stateFollowingJ = temp;
}
StatesPair* pReferenceToIJ = (&((*pMinTable)[i][j]));
if(!(*pMinTable)[stateFollowingI][stateFollowingJ].areDistinguishable)
{
/** add (i,j) to the dependencies of the following pair of states */
(*pMinTable)[stateFollowingI][stateFollowingJ].dependencies.push_back(pReferenceToIJ);
}
else
{
/** Mark (i,j) as distinguishable.. */
pReferenceToIJ->areDistinguishable = 1 ;
/**..and recursively mark all of its dependencies */
for(unsigned dependenciesCounter = 0 ; dependenciesCounter < pReferenceToIJ->dependencies.size(); dependenciesCounter++)
{
if(pReferenceToIJ->dependencies.size()>0)
{
pReferenceToIJ->dependencies[dependenciesCounter]->areDistinguishable =1 ;
}
}
}
}
}
}
}
}
/**
* @brief removes all states doubles in the given FSA
* @param pAutomat
* @author Yacine Smaoui
*/
void TableFillingFSAMinimizer::removeRedundantStates(FiniteStateAutomaton* pAutomat)
{
vector<State*>* pAutomatStates;
pAutomatStates = pAutomat->getStateList();
for(unsigned int i= 0 ; i< pAutomatStates->size() ; i++ )
{
for(unsigned int j=i+1 ; j<pAutomatStates->size(); j++)
{
if((*pAutomatStates)[i]->compare((*pAutomatStates)[j]) == 0)
{
pAutomatStates->erase(pAutomatStates->begin()+j);
}
}
}
}
/**
* @brief removes all Transitions doubles in the given FSA
* @param pAutomat
* @author Yacine Smaoui
*/
void TableFillingFSAMinimizer::removeRedundantTransitions(FiniteStateAutomaton* pAutomat)
{
vector<Transition*>* pAutomatTransitions;
pAutomatTransitions = pAutomat->getTransitions();
for(unsigned int i= 0 ; i< pAutomatTransitions->size() ; i++ )
{
for(unsigned int j=i+1 ; j<pAutomatTransitions->size(); j++)
{
if((*pAutomatTransitions)[i]->compare((*pAutomatTransitions)[j]) == 0)
{
pAutomatTransitions->erase(pAutomatTransitions->begin()+j);
}
}
}
}
/**
* @brief merges every pair of equivalent states into one state
*
* steps:
* 1) for every distinguishable pair of states, change the name and properties of both states, so that they become equal states
* the result of 1) is an FSA with redundant states and Transitions
* 2)remove all redundant states
* 3) remove all redundant transitions
*
*
* NB: what is not dealt with in this version of the merge method is:
* the transitivity of the relation "distinguishable": that means, if more than two states are equivalent.
*
* @param pMinTable
* @param pAutomat
* @author Yacine Smaoui
*/
void TableFillingFSAMinimizer::mergeStates(vector< vector<StatesPair> > * pMinTable, FiniteStateAutomaton* pAutomat)
{
vector<Transition*>* pAutomatTransitions;
pAutomatTransitions = pAutomat->getTransitions();
vector<State*>* pAutomatStates;
pAutomatStates = pAutomat->getStateList();
/**search for equivalent states in minTable*/
for(unsigned int i=1; i < pMinTable->size() ; i++ )
{
for(unsigned int j=0; j < i ; j++)
{
if(!(*pMinTable)[i][j].areDistinguishable)
{
string newName = (*pAutomatStates)[i]->getName() +","+(*pAutomatStates)[j]->getName();
for(unsigned transitionsCounter=0; transitionsCounter < pAutomatTransitions->size(); transitionsCounter++)
{
State* beginnigState = (*pAutomatTransitions)[transitionsCounter]->getBeginningState();
State* finishState = (*pAutomatTransitions)[transitionsCounter]->getFinishState();
if(beginnigState->compare((*pAutomatStates)[i])==0
|| beginnigState->compare((*pAutomatStates)[j]) == 0)
{
beginnigState->setName(newName);
if((*pAutomatStates)[i]->isFinalState() || (*pAutomatStates)[j]->isFinalState() )
{
beginnigState->setFinalState(true);
}
if((*pAutomatStates)[i]->isStartState() || (*pAutomatStates)[j]->isStartState() )
{
beginnigState->setStartState(true);
}
}
if(finishState->compare((*pAutomatStates)[i])==0
|| finishState->compare((*pAutomatStates)[j]) == 0)
{
finishState->setName(newName);
if((*pAutomatStates)[i]->isFinalState() || (*pAutomatStates)[j]->isFinalState() )
{
finishState->setFinalState(true);
}
if((*pAutomatStates)[i]->isStartState() || (*pAutomatStates)[j]->isStartState() )
{
finishState->setStartState(true);
}
}
}
if((*pAutomatStates)[i]->isFinalState() || (*pAutomatStates)[j]->isFinalState() )
{
(*pAutomatStates)[i]->setFinalState(true);
(*pAutomatStates)[j]->setFinalState(true);
}
if((*pAutomatStates)[i]->isStartState() || (*pAutomatStates)[j]->isStartState() )
{
(*pAutomatStates)[i]->setStartState(true);
(*pAutomatStates)[j]->setStartState(true);
}
(*pAutomatStates)[i]->setName(newName);
(*pAutomatStates)[j]->setName(newName);
}
}
}
removeRedundantStates(pAutomat);
removeRedundantTransitions(pAutomat);
}
/**
* @brief returns the next state to "StateIndex" for the given "input" in the FSA "pAutomat"
* @param stateIndex
* @param input
* @param pAutomat
* @return
* @author Yacine Smaoui
*/
int TableFillingFSAMinimizer::getNextStateIndex(int stateIndex, string input, FiniteStateAutomaton* pAutomat)
{
vector<Transition*>* pAutomatTransitions;
vector<State*>* pAutomatStates;
State* pTempValidState;
pAutomatTransitions = pAutomat->getTransitions();
pAutomatStates = pAutomat->getStateList();
unsigned int automatTransitionsSize = pAutomatTransitions->size() ;
for(unsigned int i=0 ; i < automatTransitionsSize ; i++)
{
int compareResult = (*pAutomatTransitions)[i]->getBeginningState()->compare((*pAutomatStates)[stateIndex]);
if(compareResult == 0
&& (*pAutomatTransitions)[i]->getEdgeName().compare(input) == 0)
{
pTempValidState = (*pAutomatTransitions)[i]->getFinishState();
return getIndexOfState(pTempValidState, pAutomat );
}
}
return ERROR_STATE_NOT_FOUND;
}
int TableFillingFSAMinimizer::getNumberOfStates(FiniteStateAutomaton* pAutomat)
{
return pAutomat->getStateList()->size();
}
/*=======================================================================================================================================================*/
/*=======================================================================================================================================================*/
/*===================The following Methods were used at first to implement the algorithm in one way but it didn't wowrk correctly========================*/
/*===================They are not deleted just in case someone can find the error and improve it========================================================*/
/*=======================================================================================================================================================*/
/*=======================================================================================================================================================*/
/**
* @brief a method to print to contents of the minimization table used in this algorithm
* @param pMinTable
* @author Yacine Smaoui
*/
void TableFillingFSAMinimizer::printMinTable(vector< vector<int> > * pMinTable)
{
for(unsigned int i=1; i < pMinTable->size() ; i++ )
{
cout << "(" << i << ")" ;
for(unsigned int j=0; j < i ; j++) //j < (*pMinTable)[i].size()
{
cout << (*pMinTable)[i][j] << " " ;
if (j == i-1) //(*pMinTable)[i].size()-1)
{
cout << endl;
}
}
}
}
/**
* @brief Initializing the minimization table, by marking all pairs of one accepting state and one rejecting state as distiguishable pairs of states
* @param pAutomat
* @param pMinTable
* @author Yacine Smaoui
*/
void TableFillingFSAMinimizer::initMinimizingTable(FiniteStateAutomaton* pAutomat, vector< vector<int> >* pMinTable)
{
vector<State*>* pStates = pAutomat->getStateList();
bool stateIsFinal;
/**intialise Table*/
for(unsigned int i=0; i < pMinTable->size() ; ++i )
{
for(unsigned int j=0; j < i ; ++j) //(*pMinTable)[i].size()
{
(*pMinTable)[i][j]= 0 ;
}
}
/**accepting states and rejecting states are distiguishable*/
for(unsigned int i = 0; i <pStates->size() ; i++) // until size/2 maybe better
{
stateIsFinal = (*pStates)[i]->isFinalState() ;
for(unsigned int j = 0; j <pStates->size() ; j++)
{
if(i != j)
{
if((*pStates)[j]->isFinalState() != stateIsFinal)
{
(*pMinTable)[i][j]= DISTINGUISHABLE;
}
}
}
}
}
/**
* @brief filling the Minimization Table by finding all distinguishable pairs of states using the algorithm.
* @param pMinTable the minimization table
* @param pAllInputs the inputs of all transitions in this FSA
* @param pAutomat the Automaton to minimize
* @author Yacine Smaoui
*/
int TableFillingFSAMinimizer::getIndexOfState(State* pState, FiniteStateAutomaton* pAutomat)
{
vector<State*>* pAutomatStates;
pAutomatStates = pAutomat->getStateList();
for(unsigned int i=0; i< pAutomatStates->size(); i++)
{
if(pState->compare((*pAutomatStates)[i]) == 0)
{
return i;
}
}
cerr << "State " << pState->getName() <<" not found: cannot continue minimization" << endl ;
exit(1);
return 0;
}
/**
* @brief search for every State that leads to the State with index stateIndex , through a sequence of "input"
*
* for example: A -1-> B -1-> C-1-> D
* A,B and C are the predecessor States of D with the input 1
*
* @param stateIndex
* @param input
* @param pAutomat
* @param pOutputVector
* @author Yacine Smaoui
*/
void TableFillingFSAMinimizer::searchForPredecessorState(int stateIndex, string input, FiniteStateAutomaton* pAutomat, vector<int>* pOutputVector)
{
vector<Transition*>* pAutomatTransitions;
vector<State*>* pAutomatStates;
State* pTempValidState;
int tempValidStateIndex;
pAutomatTransitions = pAutomat->getTransitions();
pAutomatStates = pAutomat->getStateList();
unsigned int automatTransitionsSize = pAutomatTransitions->size() ;
for(unsigned int i=0 ; i < automatTransitionsSize ; i++)
{
int compareResult = (*pAutomatTransitions)[i]->getFinishState()->compare((*pAutomatStates)[stateIndex]);
if(compareResult == 0
&& (*pAutomatTransitions)[i]->getEdgeName().compare(input) == 0)
{
pTempValidState = (*pAutomatTransitions)[i]->getBeginningState() ;
tempValidStateIndex = getIndexOfState(pTempValidState, pAutomat );
if(!existInIntVector(pOutputVector, tempValidStateIndex ))
{
pOutputVector->push_back(tempValidStateIndex);
}
// searchForPredecessorState(tempValidStateIndex, input, pAutomat, pOutputVector);
}
}
}
/**
* @brief mark as distiguishable all the pairs of states such as one is in pPredecessorsOfI and the other in pPredecessorsOfJ
* @param pMinTable
* @param pPredecessorsOfI
* @param pPredecessorsOfJ
* @return 1 if changes to MinTable are made, 0 if no changes are made
* @author Yacine Smaoui
*/
int TableFillingFSAMinimizer::markDistiguishableStates(vector< vector<int> > * pMinTable, vector<int>* pPredecessorsOfI, vector<int>* pPredecessorsOfJ )
{
int changeIsMade = 0;
/** For every pair of elements in pPredecessorsOfI and pPredecessorsOfJ */
for(unsigned int i = 0; i < pPredecessorsOfI->size(); i++)
{
for(unsigned int j = 0; j < pPredecessorsOfJ->size(); j++)
{
/**get Element in MinTable*/
int elementInMinTable;
if(pPredecessorsOfI[i] == pPredecessorsOfJ[j])
{
elementInMinTable = ELEMENT_ON_DIAG_MINTABLE;
}
else
{
if((*pPredecessorsOfI)[i] > (*pPredecessorsOfJ)[j])
{
elementInMinTable = (*pMinTable)[(*pPredecessorsOfI)[i]][(*pPredecessorsOfJ)[j]];
}
else
{
elementInMinTable = (*pMinTable)[(*pPredecessorsOfJ)[j]][(*pPredecessorsOfI)[i]];
}
}
/**Mark distiguishable states */
if(elementInMinTable == 0)
{
(*pMinTable)[(*pPredecessorsOfI)[i]][(*pPredecessorsOfJ)[j]] = DISTINGUISHABLE ;
(*pMinTable)[(*pPredecessorsOfJ)[j]][(*pPredecessorsOfI)[i]] = DISTINGUISHABLE ;
changeIsMade = 1 ;
}
else
{
//no change
}
}
}
return changeIsMade;
}
/**
* @brief filling the Minimization Table by finding all distiguishable pairs of states using the algorithm.
* @param pMinTable the minimization table
* @param pAllInputs the inputs of all transitions in this FSA
* @param pAutomat the Automat to minimize
* @author Yacine Smaoui
*/
void TableFillingFSAMinimizer::fillMinimizingTable(vector< vector<int> > * pMinTable , vector<string>* pAllInputs, FiniteStateAutomaton* pAutomat)
{
unsigned int minTableSize = pMinTable->size();
int numberOfStates = getNumberOfStates(pAutomat);
vector< vector<int> > doneTable (numberOfStates , vector<int>(numberOfStates));
vector<int> predecessorStatesOfI;
vector<int> predecessorStatesOfJ;
/**intialise DoneTable*/
for(unsigned int i=0; i < doneTable.size() ; ++i )
{
for(unsigned int j=0; j < i ; ++j) //(*pMinTable)[i].size()
{
doneTable[i][j]= 0 ;
}
}
/**for every pair of states (i,j) */
for(unsigned int i=0; i < minTableSize ; i++ )
{
for(unsigned int j=0; j < i ; j++)
{
int changeIsMade = 0;
/** if the pair is a pair of distinguishable states, and not already treated */
bool distinguishable = (*pMinTable)[i][j] == DISTINGUISHABLE ;
bool treated = doneTable[i][j] == ELEMENT_TREATED;
if(distinguishable && !treated)
{
/** for every input */
for(unsigned int inputsCounter =0 ; inputsCounter < pAllInputs->size(); inputsCounter++)
{
/** Add State indexes to Predecessors vectors */
predecessorStatesOfI.push_back(i);
predecessorStatesOfJ.push_back(j);
string input = (*pAllInputs)[inputsCounter];
searchForPredecessorState(i,input, pAutomat, &predecessorStatesOfI );
searchForPredecessorState(j,input, pAutomat, &predecessorStatesOfJ );
cout<< "======================================" << endl;
printIntVector(&predecessorStatesOfI);
cout << "-------------------------------------" <<endl;
printIntVector(&predecessorStatesOfJ);
cout<< "======================================" << endl;
changeIsMade = markDistiguishableStates(pMinTable,&predecessorStatesOfI, &predecessorStatesOfJ);
if(changeIsMade)
{
printMinTable(pMinTable);
}
predecessorStatesOfI.clear();
predecessorStatesOfJ.clear();
}
doneTable[i][j] = ELEMENT_TREATED;
if(changeIsMade)
{
i=0;
j=0;
}
}
}
}
}
/*=======================================================================================================================================================*/
/*=======================================================================================================================================================*/
/*===================The following Methods are just used to help doing some simple tasks: print, search,...==============================================*/
/*=======================================================================================================================================================*/
/*=======================================================================================================================================================*/
/**
*
* @param pVector
* @param element
* @return
* @author Yacine Smaoui
*/
bool TableFillingFSAMinimizer::existInIntVector(vector<int>* pVector, int element)
{
for (unsigned int i =0 ; i < pVector->size() ; i++)
{
if((*pVector)[i] == element)
{
return true;
}
}
return false ;
}
/**
*
* @param pVector
* @param element
* @return
* @author Yacine Smaoui
*/
bool TableFillingFSAMinimizer::existInStringVector(vector<string>* pVector, string element)
{
for (unsigned int i =0 ; i < pVector->size() ; i++)
{
if((*pVector)[i].compare(element) == 0 )
{
return true;
}
}
return false ;
}
/**
*
* @param v
* @author Yacine Smaoui
*/
void TableFillingFSAMinimizer::printIntVector(vector<int>* v)
{
for(unsigned int i = 0 ; i < v->size() ; i++ )
{
cout << (*v)[i] << " " ;
if(i== v->size() -1)
{
cout << endl;
}
}
}
/**
*
* @param pVector
* @author Yacine Smaoui
*/
void TableFillingFSAMinimizer::printStringVector(vector<string>* pVector)
{
cout << "Printing input vector" << endl;
cout << "Size: " << pVector->size() << endl;
for( unsigned int i = 0; i< pVector->size(); i++)
{
cout << (*pVector)[i] << " " ;
if (i == pVector->size() -1)
{
cout << endl;
}
}
}