private void generateTruthTable(int n) {
        int rows = (int) Math.pow(2,n);			//get number of rows needed depending of how many symbols are there
        
        for (int i=0; i<rows; i++) {			//for each row
        	ArrayList<Integer> columnValuesTruthTable = new ArrayList<Integer>();	//stores values of each symbol and rules on one row
            for (int j=n-1; j>=0; j--) {
                columnValuesTruthTable.add((i/(int) Math.pow(2, j))%2);				//calculate value for particular symbol
            }
            truthTable.add(columnValuesTruthTable);									//add values to truth table
            for (String rule : rules) {												//for each rule
            	String[] splitSide = rule.split("=>");								//split sides of implication symbol
            	int resultVal;
            	if(splitSide[0].contains("&"))			//p1&p2 => c
            	{
            		String[] tempLeftSplit = splitSide[0].split("&");				//split left side into two symbols separated by &
            		String firstLeftSymbol = tempLeftSplit[0];				//p1	//first symbol on left side
            		String secondLeftSymbol = tempLeftSplit[1];				//p2	//second symbol on left side
            		String rightSide = splitSide[1];						//c		//symbol on the right side
            		
            		int valFirstLeftSymbol = getValueTruthTable(firstLeftSymbol, i);		//get value(0,1) of firstLeftSymbol from truth table
            		int valSecondLeftSymbol = getValueTruthTable(secondLeftSymbol, i);		//get value(0,1) of secondLeftSymbol from truth table
            		int valRightSideSymbol = getValueTruthTable(rightSide, i); 				//get value(0,1) of rightSideSymbol from truth table
            		
            		int valLeft = performConjunction(valFirstLeftSymbol, valSecondLeftSymbol);	//p1&p2	//perform conjunction on appropriate values
            																		//p1&p2 => c
            		resultVal = performImplication(valLeft, valRightSideSymbol);	//perform implication with value from above conjunction and rightSideSymbol
            	}
            	else										//p1 => c
            	{
            		String leftSide = splitSide[0];			//p1	//symbol on left side
            		String rightSide = splitSide[1];		//c		//symbol on right side
            		
            		int valLeftSideSymbol = getValueTruthTable(leftSide, i);	//p1	//get value(0,1) of leftSideSymbol from truth table
            		int valRightSideSymbol = getValueTruthTable(rightSide, i);	//c		//get value(0,1) of rightSideSymbol from truth table
            		
            		resultVal = performImplication(valLeftSideSymbol, valRightSideSymbol);	//p1 => c	//perform implication with appropriate values
            	}
            	columnValuesTruthTable.add(resultVal);		//add resultant value of rule in column values
            }
            truthTable.remove(i);							//remove previously added partial column values
            truthTable.add(columnValuesTruthTable);			//update truth table with complete column values
            checkRowTruthTable(i);							//check if current complete row is true
        }
    }