code: private Set<String> getConditionsSet(List<Function> atoms, AliasIndex index, boolean processShared) {
  
  		Set<String> conditions = new LinkedHashSet<>();
  		if (processShared) {
  			// guohui: After normalization, do we have shared variables?
  			// TODO: should we remove this ??
  			Set<Variable> currentLevelVariables = new LinkedHashSet<>();
  			for (Function atom : atoms) {
  	 			// assume that no variables are shared across deeper levels of
  	 			// nesting (through Join or LeftJoin atoms), it will not call itself
  	 			// recursively. Nor across upper levels.
  				collectVariableReferencesWithLeftJoin(currentLevelVariables, atom);
  			}
  			Set<String> conditionsSharedVariables = getConditionsSharedVariables(currentLevelVariables, index);
  			conditions.addAll(conditionsSharedVariables);
  		}
  
  		Set<String> eqConstants = getEqConditionsForConstants(atoms, index);
  		conditions.addAll(eqConstants);
  
  		Set<String> booleanConditions = getBooleanConditions(atoms, index);
  		conditions.addAll(booleanConditions);
  
  		return conditions;
  	}
docs: Generates all the conditions on the given atoms, e.g., shared variables
  and boolean conditions. This string can then be used to form a WHERE or
  an ON clause.
  
  <p>
  The method assumes that no variable in this list (or nested ones) referes
  to an upper level one.