Commit 67a3c636 authored by SPARSA ROYCHOWDHURY's avatar SPARSA ROYCHOWDHURY

25/10/17:

1. Solved a serious Bug in reduce2 
2. But still have to find the special case bug.
Sparsa Roychowdhury
parent 431808ab
No preview for this file type
......@@ -62,7 +62,9 @@ public:
~CircuitFinder()
{
for(int i = 0;i < N; i++)
{
delete[] relmatrix[i];
}
delete[] relmatrix;
}
bool run(); //start the run
......
3 2 1 0 0
1
3
1 2 0 0 1
1
0
2 3 0 1 0
1 1 1 1 1
0
digraph finite_state_machine {
node [shape = point ]; qi0;
node [shape = doublecircle];3;
node [shape=circle];
qi0 -> 0;
0 -> 1 [ label = "{tn:0,x1:=0}" ];
1 -> 2 [ label = "{tn:1,x1:=0}" ];
2 -> 3 [ label = "{tn:2,1<x1<1}" ];
}
\ No newline at end of file
......@@ -13,5 +13,5 @@
0
2 3 0 1 0
1 1 0 2 0
1 1 0 2 1
0
4 3 2 0 0
1
4
1 2 0 0 1
1
0
2 3 0 1 0
1 0 0 1 1
0
3 4 0 2 0
1 1 1 -1 1
2 0 0 1 1
0
digraph finite_state_machine {
node [shape = point ]; qi0;
node [shape = doublecircle];4;
node [shape=circle];
qi0 -> 0;
0 -> 1 [ label = "{tn:0,x1:=0,x2:=0}" ];
1 -> 2 [ label = "{tn:1,x1:=0}" ];
2 -> 3 [ label = "{tn:2,0<=x1<1}" ];
3 -> 4 [ label = "{tn:3,1<x1<inf,0<=x2<1}" ];
}
\ No newline at end of file
......@@ -52,7 +52,7 @@ inline unsigned int p2(unsigned int x) {
// string to integer conversion
int str_to_int(string s) {
int sum = 0;
for(int i=0; i < s.size(); i++) {
for(unsigned int i=0; i < s.size(); i++) {
sum = sum*10 + s[i]-'0';
}
return sum;
......@@ -84,7 +84,7 @@ int main(int argc, char *argv[]) {
////**********////
setGlobal(argv[1]); // set all the global variables
bool b,b1;
bool b;
if(argc >= 3) { // If there is any arguments for special kind of TPDA
......
CC := g++
CFLAG := -lm -fopenmp -Wall -std=c++14
CFLAG := -lm -fopenmp -std=c++14
SRC := ./src
OBJ := ./obj
INC := ./include
......@@ -30,7 +30,7 @@ $(OBJ)/pds.o : $(SRC)/pds.cpp
$(CC) $(GDB) -I $(INC) -c $(SRC)/pds.cpp -o $(OBJ)/pds.o $(CFLAG)
drawsystem : $(OBJ)/drawsystem.o $(OBJ)/treeBitOperations.o
$(CC $(GDB) $(OBJ)/drawsystem.o $(OBJ)/treeBitOperations.o -o drawsystem $(CFLAG)
$(CC) $(GDB) $(OBJ)/drawsystem.o $(OBJ)/treeBitOperations.o -o drawsystem $(CFLAG)
$(OBJ)/drawsystem.o : $(SRC)/drawsystem.cpp
$(CC) $(GDB) -I $(INC) -c $(SRC)/drawsystem.cpp -o $(OBJ)/drawsystem.o $(CFLAG)
......
......@@ -45,7 +45,7 @@ bool** pushDone;
// make a dfs from a reset transition to find some checked transition for clock x
void getChecker(short int acttran, bool *visit, short int i, char x, bool *flag) {
short int s = transitions[i].target;
for(int j=0; j < nexttrans[s].size(); j++) {
for(unsigned int j=0; j < nexttrans[s].size(); j++) {
short int t = nexttrans[s][j];
if( isChecked(x, t) && !(*flag) && acttran == t) {
......@@ -72,7 +72,7 @@ void getChecker(short int acttran, bool *visit, short int i, char x, bool *flag)
void getresecktrans() {
bool *visit = new bool[T+1];
int i,j;
unsigned int i,j;
resecktrans.resize(X+1);
bool flag = false;
......@@ -101,7 +101,7 @@ void getresecktrans() {
// if d1 and d2 are valid pair of reset-check for only clock x1(used for one clock + one stack special tpda)
bool isPossibleReset(char d1, char d2){
for(char i=0; i < possibleresets[d2].size(); i++) {
for(unsigned int i=0; i < possibleresets[d2].size(); i++) {
if(d1 == (possibleresets[d2][i]) )
return true;
}
......@@ -171,7 +171,7 @@ void inputSystem() {
transitions[0].openl =0;
transitions[0].openu = 0;
// Reset all clocks at 0-th transition
transitions[0].reset = ( b32[X] & (~1) );
transitions[0].reset = ( b32[int(X)] & (~1) );
resettrans.resize(X+1); // used for earlier code
checktrans.resize(X+1); // used for earlier
......@@ -407,10 +407,10 @@ void inputSystem() {
//******* forget this
pushDone = new bool*[T+1];
for(char t=0; t <= T; t++){
for(unsigned int t=0; t <= T; t++){
pushDone[t] = new bool[M];
for(char w=0; w < M; w++) {
pushDone[t][w] = false;
pushDone[t][int(w)] = false;
}
}
......@@ -532,7 +532,7 @@ void print_system() {
// is clock x has been reset at transition d
bool isReset(char x, short int d) {
if( (transitions[d].reset) & a32[x])
if( (transitions[d].reset) & a32[ int(x)])
return true;
return false;
}
......@@ -540,7 +540,7 @@ bool isReset(char x, short int d) {
// is clock x has been checked at transition delta
bool isChecked(char x, short int d) {
if( (transitions[d].guard) & a32[x])
if( (transitions[d].guard) & a32[ int(x)])
return true;
return false;
}
......
This diff is collapsed.
......@@ -57,7 +57,7 @@ string inttobinary(int x) {
// initialization of the integer arrays a,b and c defined above
void setBits() {
char i;
unsigned int i;
unsigned int x32=1,y32=1;
......
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