* append rule to outputString
*/
String rule;
for(int xi=0;xi<variablesInList.size();xi++){
for(int yi=0;yi<variablesInList.size();yi++){
BoundVariable x=variablesInList.get(xi);
BoundVariable y=variablesInList.get(yi);
if(!x.getOriginalString().equals(y.getOriginalString())){
rule=("(* "+x.getName()+" *) "+templateRulemap.get(x.getName()).getTemplate()).replace("?x", x.getOriginalString());
rule=rule.replace("?y",y.getOriginalString());
//avoid duplicate rules
if(!output2.contains(rule)){
/*
* avoid rules that are already implied through symmetry.
* e.g.:
* (x sameAs y) and (y sameAs x) in diff2 and diff3.
* And(factA factB) and And(factB factA) in prp-adp and cax adc.
*/
rule=("(* "+x.getName()+" *) "+templateRulemap.get(x.getName()).getTemplate()).replace("?y", x.getOriginalString());
rule=rule.replace("?x",y.getOriginalString());
if(!output2.contains(rule)){
output2+=("\n"+rule);
output.append("\n"+rule);
InferenceRulesGenerator.rulesEmitted++;