#include <stdlib.h>
#include <stdlib.h>
#include <bdd.h>
#include <bvec.h>
#include <cmath>
#include <iostream>
#include <bitset>
#include <set>
#include <algorithm>  
#include "ConfigFile.h"
#include "./../working_dir/config.h"
#include "loadme.h"
#include "bag.h"
#include "set.h"
#include "bag.cpp"
#include "set.cpp"
#include "setbag.h"
#include "pfa.h"
#include <iterator>
#include <utility>
#include <string>


using namespace std;

void my_gbc_handler(int pre, bddGbcStat *stat)
{
  bdd_default_gbchandler(NULL, stat);
}


int main()
{

//bddGbcStat *s;

#include "./../working_dir/config.h"


bdd_init(1000000,100000);
bdd_setcacheratio(64);
//bdd_setmaxincrease(5000); // 500000 solitaire
bdd_setvarnum(number_of_vars*2);
bdd_autoreorder(BDD_REORDER_WIN2ITE);

// garbage collection, turn off -- set it to NULL
bdd_gbc_hook 	(NULL); 

// read configuration from a file.



levels = number_of_vars - occ_bitsize;

bdd zero = bddfalse;

FAMILY ZEROSET;
FAMILY ONESET;
ONESET.insert(bddfalse);
//string names[1000];


#include "./../working_dir/includeFiles.h"




//cout << "Result of the given query is: " << endl;
//#include "/tmp/queries.h"

FAMILY::iterator iFAMILY;
FAMILY testSet1,testSet2, testSet3,testSet4, testSet5, testSet6;

//testSet1.insert(a);
//testSet2.insert(b);
//testSet3.insert(c);
//testSet4 = PLUS(testSet1,testSet2);
//testSet5 = DOT(testSet4,testSet3);
//testSet3 = DOT(testSet1,testSet2);

//cout << "results of setIsMember manually: " << setIsMember(a , a&b) << endl;

//testSet.insert(e);

//FAMILY powerset = powerSet(testSet);
//for (iFAMILY = powSet.begin(); iFAMILY != powSet.end(); iFAMILY++ )  bdd_printdot(*iFAMILY);
//cout << "----------------- \n The Result PowerSet is: \n" << endl;
//for (iFAMILY = powerset.begin(); iFAMILY != powerset.end(); iFAMILY++ )
//{
//   bdd_printdot(*iFAMILY);
//
//}

//cout << "The size of the POWERSET is: " <<  powerset.size() << endl;



//cout << "testSet1 contents ----------------" << endl;
//for (iFAMILY = testSet1.begin(); iFAMILY != testSet1.end(); iFAMILY++ )
//{
//   bdd_printdot(*iFAMILY);
//
//}

//cout << "testSet3 contents ----------------" << endl;
//for (iFAMILY = testSet3.begin(); iFAMILY != testSet3.end(); iFAMILY++ )
//{
//   bdd_printdot(*iFAMILY);
//
//}


//cout << "isSubfamily value:   " << isSubFamily(testSet3,testSet1) << endl;
//cout << "Refines value for 5 refines 4:    " << refines(testSet4,testSet5) << endl;

bdd_done();

}

