private boolean isEqual(Formula g) {
		// If the two Formulas' constructors are the same, they may be equal.
		if (constructor == g.constructor) {
			// variables for the equality of the successors
			boolean firstSucEqual;
			boolean secondSucEqual;
			// a switch for the possible constructors
			switch (constructor) {
			// Zeroth case: The Formula represents a constant.
			case 0:
				// If the other Formula also represents a constant, the equality of
				// their values is checked.
				return (value == g.value);
			// First case: The Formula represents a variable.
			case 1:
				// If the other Formula also represents a variable, the equality of
				// the variables is checked.
				return (var == g.var);
			// Second case: The Formula represents a logical negation.
			case 2:
				// If the other Formula also represents a logical negation, the 
				// equality of their successors is checked. 
				return firstSuccessor.isEqual(g.firstSuccessor);
			// Third case: The Formula represents a logical conjunction.
			case 3:
				// If the other Formula also represents a logical conjunction, the 
				// equality of their successors is checked.
				firstSucEqual = firstSuccessor.isEqual(g.firstSuccessor);
				secondSucEqual = secondSuccessor.isEqual(g.secondSuccessor);
				return (firstSucEqual && secondSucEqual);
			// Fourth case: The Formula represents a logical disjunction.
			case 4:
				// If the other Formula also represents a logical disjunction, the 
				// equality of their successors is checked.
				firstSucEqual = firstSuccessor.isEqual(g.firstSuccessor);
				secondSucEqual = secondSuccessor.isEqual(g.secondSuccessor);
				return (firstSucEqual && secondSucEqual);
			// Default case: None of the given constructors was used.
			default:
				// Equality can't be checked and false is returned.
				return false;
			}
		}
		// If the two Formulas' constructors aren't the same, they aren't equal.
		else return false;
	}