A pushdown automaton is a 7-tuple M- (Q, y, T, qo, Zo, A, o), where: 1. Qis a fi
ID: 3813946 • Letter: A
Question
A pushdown automaton is a 7-tuple M- (Q, y, T, qo, Zo, A, o), where: 1. Qis a finite set of states; 2. The input and stack alphabets and T are finite sets; 3. qo E Q is the initial state; 4. Zo E T is the initial stack symbol; 5. A CQ is the set of accepting states; 6. The transition function is o: Qx (Su{A) x T the set of finite subsets of Q x T*. Note: Because values of are sets, M may be nondeterministic. A move requires that there be at least one symbol on the stack. In fact, Zo is the one on the stack initially. A configuration of a PDA is a triple (q, x, ou), where: 1. q e Q is the current state; 2. x E is the portion of the input string that has not yet been read; 3. The contents of the stack is o E T* (the convention will be that the top corresponds to the leftmost symbol). We write (p, x, o) HM (a, y, B) to mean that one of the possible moves in the first configuration takes M to the second. If M- (Q, Y, T, qo, Zo, A, 6) and x E y, the string x is accepted by Mif (qo, x, Zo) HM (q, A, o) for some a E T and some q E A. Sometimes a string accepted by Mis said to be accepted byfinal state, because acceptance does not depend on the final stack contents at a Example: A PDA for AnBn is M (Q, S, T, go, Zo, A, 8) where Q {go, q1, q2, q3, A fgo, q3), and the transitions are shown in this table:Explanation / Answer
# embody <iostream.h>
# embody <fstream.h>
# embody <string.h>
# embody <stdio.h>
# embody <conio.h>
/**************************************************************************///--------------------------------- Node -------------------------------///**************************************************************************/class Node
;
# outline MAX_ENTRIES twenty five
Node* HashTable[MAX_ENTRIES]=;
Node* Top[MAX_ENTRIES]=;
/**************************************************************************///------------------------ generate_hash_key( ) ------------------------///**************************************************************************/constint generate_hash_key(constchar* sData)
come iHashKey;
}
/**************************************************************************///--------------------------- insert_sData( ) ---------------------------///**************************************************************************/void insert_sData( )
else
cout<<" Pres any key to come to Menu. ";
getch( );
}
/**************************************************************************///---------------------------- print_sData( ) ---------------------------///**************************************************************************/void print_sData( )
if(flag)
cout<<" *** The Search part is found "<<flag<<" times.";
}
if(!flag)
cout<<" *** The Search part isn't found."<<endl;
cout<<" Pres any key to come to Menu. ";
getch( );
}
/**************************************************************************///--------------------------- show_working( ) --------------------------///**************************************************************************/void show_working( )