Commit 737de7f2 authored by SPARSA ROYCHOWDHURY's avatar SPARSA ROYCHOWDHURY

28/9/17:

1. created a matrix of the size transition x clocks to know for this transition this is the current reset reset point.
parent 568f036b
...@@ -61,7 +61,9 @@ extern char A; // number of events or actions in the timed system ...@@ -61,7 +61,9 @@ extern char A; // number of events or actions in the timed system
extern char AS; // number of stack symbols in the timed system extern char AS; // number of stack symbols in the timed system
extern transition *transitions; // transitions of the timed system extern transition *transitions; // transitions of the timed system
extern char **recent_matrix; // contains the information about latest reset transition of a given clock of a given time. The rows
// represent the transition for which we are finding the relation and the columns are the clocks whose reset points we are calculating
extern char* clock_reset; // contains clocks reset transitions at any point of time i index indicates that i+1 clocks data.
extern vector<vector<short> > prevtrans; // prevtrans[i] : list of previous transitions for state i extern vector<vector<short> > prevtrans; // prevtrans[i] : list of previous transitions for state i
extern vector<vector<short> > nexttrans; // nexttrans[i] : list of next transitions for state i extern vector<vector<short> > nexttrans; // nexttrans[i] : list of next transitions for state i
......
...@@ -24,7 +24,8 @@ short T; // number of transitions in the timed system ...@@ -24,7 +24,8 @@ short T; // number of transitions in the timed system
char X; // number of clocks in the timed system char X; // number of clocks in the timed system
char A; // number of events or actions in the timed system char A; // number of events or actions in the timed system
char AS; // number of stack symbols in the timed system char AS; // number of stack symbols in the timed system
char **recent_matrix;
char* clock_reset;
transition *transitions; // transitions of the timed system transition *transitions; // transitions of the timed system
vector<vector<short int> > prevtrans; // prevtrans[i] : list of previous transitions for state i vector<vector<short int> > prevtrans; // prevtrans[i] : list of previous transitions for state i
vector<vector<short int> > nexttrans; // nexttrans[i] : list of next transitions for state i vector<vector<short int> > nexttrans; // nexttrans[i] : list of next transitions for state i
...@@ -134,8 +135,23 @@ void inputSystem() { ...@@ -134,8 +135,23 @@ void inputSystem() {
transitions = new transition[T+1]; // allocate memory for transitions transitions = new transition[T+1]; // allocate memory for transitions
tiimeinfile >> x; // #clocks tiimeinfile >> x; // #clocks
X = x; X = x;
clock_reset = new char[X];
for(int i = 0; i < X; i++)
{
clock_reset[i] = 0; // the first reset points of every clocks is 0th transition.
}
recent_matrix = new char*[T+1];
for(int i = 0; i < T+1 ; i++)
{
recent_matrix[i] = new char[X];
}
for(int i = 0; i <X; i++)
{
recent_matrix[0][i] = clock_reset[i];
}
tiimeinfile >> x; // #actions tiimeinfile >> x; // #actions
A = x; A = x;
...@@ -246,6 +262,7 @@ void inputSystem() { ...@@ -246,6 +262,7 @@ void inputSystem() {
exit(1); exit(1);
} }
reset |= a32[x]; // set x-th bit of 'reset' to '1' reset |= a32[x]; // set x-th bit of 'reset' to '1'
clock_reset[x] = i;
} }
// read stack operation number, 0 : nop, 1 : push, 2 : pop, 3 : pop & push // read stack operation number, 0 : nop, 1 : push, 2 : pop, 3 : pop & push
...@@ -369,7 +386,12 @@ void inputSystem() { ...@@ -369,7 +386,12 @@ void inputSystem() {
if(reset & a32[j]) // if j-th clock has been reset at i-th transitions // forget this if(reset & a32[j]) // if j-th clock has been reset at i-th transitions // forget this
resettrans[j].push_back(i); resettrans[j].push_back(i);
} }
for(int m = 0; m <X; m++)
{
recent_matrix[i][m] = clock_reset[m]; //Updating the matrix
}
} }
delete clock_reset;
prevtrans.resize(S+1); // #rows = S+1 in the 2D vector prevtrans and nexttrans // forget this prevtrans.resize(S+1); // #rows = S+1 in the 2D vector prevtrans and nexttrans // forget this
nexttrans.resize(S+1); // forget this nexttrans.resize(S+1); // forget this
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment