//All groundLiterals
/*r*/
GroundLiteral r1r1 = new GroundLiteral(new GroundPredicate("SIMR("+r1+","+r1+")"),false, false,null);
GroundLiteral r2r2 = new GroundLiteral(new GroundPredicate("SIMR("+r2+","+r2+")"),false, false,null);
GroundLiteral r1r2 = new GroundLiteral(new GroundPredicate("SIMR("+r1+","+r2+")"),false, false,null);
GroundLiteral r2r1 = new GroundLiteral(new GroundPredicate("SIMR("+r2+","+r1+")"),false, false,null);
GroundLiteral op2_r1r2t = new GroundLiteral(new GroundPredicate("OP2R_tag("+r1+","+r2+")"),false, false,null);
GroundLiteral op2_r1r2u = new GroundLiteral(new GroundPredicate("OP2R_res("+r1+","+r2+")"),false, false,null);
GroundLiteral op1_r1r2t1 = new GroundLiteral(new GroundPredicate("OP1R_tag1("+r1+","+r2+")"),false, false,null);
GroundLiteral op1_r1r2u1 = new GroundLiteral(new GroundPredicate("OP1R_res1("+r1+","+r2+")"),false, false,null);
GroundLiteral op1_r1r2t2 = new GroundLiteral(new GroundPredicate("OP1R_tag2("+r1+","+r2+")"),false, false,null);
GroundLiteral op1_r1r2u2 = new GroundLiteral(new GroundPredicate("OP1R_res2("+r1+","+r2+")"),false, false,null);
/*u*/
GroundLiteral uIuI = new GroundLiteral(new GroundPredicate("SIMU("+uI+","+uI+")"),false, false,null);
GroundLiteral uIIuII = new GroundLiteral(new GroundPredicate("SIMU("+uII+","+uII+")"),false, false,null);
GroundLiteral uIIIuIII = new GroundLiteral(new GroundPredicate("SIMU("+uIII+","+uIII+")"),false, false,null);
GroundLiteral uIuII = new GroundLiteral(new GroundPredicate("SIMU("+uI+","+uII+")"),false, false,null);
GroundLiteral uIIuI = new GroundLiteral(new GroundPredicate("SIMU("+uII+","+uI+")"),false, false,null);
GroundLiteral uIuIII = new GroundLiteral(new GroundPredicate("SIMU("+uI+","+uIII+")"),false, false,null);
GroundLiteral uIIIuI = new GroundLiteral(new GroundPredicate("SIMU("+uIII+","+uI+")"),false, false,null);
GroundLiteral uIIuIII = new GroundLiteral(new GroundPredicate("SIMU("+uII+","+uIII+")"),false, false,null);
GroundLiteral uIIIuII = new GroundLiteral(new GroundPredicate("SIMU("+uIII+","+uII+")"),false, false,null);
/*t*/
GroundLiteral tAtA = new GroundLiteral(new GroundPredicate("SIMT("+tA+","+tA+")"),false, false,null);
GroundLiteral tBtB = new GroundLiteral(new GroundPredicate("SIMT("+tB+","+tB+")"),false, false,null);
GroundLiteral tCtC = new GroundLiteral(new GroundPredicate("SIMT("+tC+","+tC+")"),false, false,null);
GroundLiteral tDtD = new GroundLiteral(new GroundPredicate("SIMT("+tD+","+tD+")"),false, false,null);
GroundLiteral tAtB = new GroundLiteral(new GroundPredicate("SIMT("+tA+","+tB+")"),false, false,null);
GroundLiteral tBtA = new GroundLiteral(new GroundPredicate("SIMT("+tB+","+tA+")"),false, false,null);
GroundLiteral tAtC = new GroundLiteral(new GroundPredicate("SIMT("+tA+","+tC+")"),false, false,null);
GroundLiteral tCtA = new GroundLiteral(new GroundPredicate("SIMT("+tC+","+tA+")"),false, false,null);
GroundLiteral tAtD = new GroundLiteral(new GroundPredicate("SIMT("+tA+","+tD+")"),false, false,null);
GroundLiteral tDtA = new GroundLiteral(new GroundPredicate("SIMT("+tD+","+tA+")"),false, false,null);
GroundLiteral tBtC = new GroundLiteral(new GroundPredicate("SIMT("+tB+","+tC+")"),false, false,null);
GroundLiteral tCtB = new GroundLiteral(new GroundPredicate("SIMT("+tC+","+tB+")"),false, false,null);
GroundLiteral tBtD = new GroundLiteral(new GroundPredicate("SIMT("+tB+","+tD+")"),false, false,null);
GroundLiteral tDtB = new GroundLiteral(new GroundPredicate("SIMT("+tD+","+tB+")"),false, false,null);
GroundLiteral tCtD = new GroundLiteral(new GroundPredicate("SIMT("+tC+","+tD+")"),false, false,null);
GroundLiteral tDtC = new GroundLiteral(new GroundPredicate("SIMT("+tD+","+tC+")"),false, false,null);
ArrayList<GroundRule> rules = new ArrayList<GroundRule>();
//JACCARD GEMIDDELD
ArrayList<FaspFuzzyExpression> l1 = new ArrayList<FaspFuzzyExpression>(); l1.add(new LattVal(1.0));
ArrayList<FaspFuzzyExpression> l0 = new ArrayList<FaspFuzzyExpression>(); l0.add(new LattVal(0.0));
ArrayList<FaspFuzzyExpression> lr1r2 = new ArrayList<FaspFuzzyExpression>(); lr1r2.add(new LattVal(0.41667));
ArrayList<FaspFuzzyExpression> luIuII = new ArrayList<FaspFuzzyExpression>(); luIuII.add(new LattVal(0.625));
ArrayList<FaspFuzzyExpression> luIuIII = new ArrayList<FaspFuzzyExpression>(); luIuIII.add(new LattVal(0.66667));
ArrayList<FaspFuzzyExpression> luIIuIII = new ArrayList<FaspFuzzyExpression>(); luIIuIII.add(new LattVal(0.325));
ArrayList<FaspFuzzyExpression> ltAtB = new ArrayList<FaspFuzzyExpression>(); ltAtB.add(new LattVal(0.25));
ArrayList<FaspFuzzyExpression> ltAtC = new ArrayList<FaspFuzzyExpression>(); ltAtC.add(new LattVal(0.41667));
ArrayList<FaspFuzzyExpression> ltAtD = new ArrayList<FaspFuzzyExpression>(); ltAtD.add(new LattVal(0.5));
ArrayList<FaspFuzzyExpression> ltBtC = new ArrayList<FaspFuzzyExpression>(); ltBtC.add(new LattVal(0.58333));
ArrayList<FaspFuzzyExpression> ltBtD = new ArrayList<FaspFuzzyExpression>(); ltBtD.add(new LattVal(0.75));
ArrayList<FaspFuzzyExpression> ltCtD = new ArrayList<FaspFuzzyExpression>(); ltCtD.add(new LattVal(0.83333));
/*r*/
rules.add(new GroundRegularRule(r1r1,l1,new ID()));
rules.add(new GroundRegularRule(r2r2,l1,new ID()));
rules.add(new GroundRegularRule(r1r2,lr1r2,new ID()));
rules.add(new GroundRegularRule(r2r1,lr1r2,new ID()));
/*u*/
rules.add(new GroundRegularRule(uIuI,l1,new ID()));
rules.add(new GroundRegularRule(uIIuII,l1,new ID()));
rules.add(new GroundRegularRule(uIIIuIII,l1,new ID()));
rules.add(new GroundRegularRule(uIuII,luIuII,new ID()));
rules.add(new GroundRegularRule(uIIuI,luIuII,new ID()));
rules.add(new GroundRegularRule(uIuIII,luIuIII,new ID()));
rules.add(new GroundRegularRule(uIIIuI,luIuIII,new ID()));
rules.add(new GroundRegularRule(uIIuIII,luIIuIII,new ID()));
rules.add(new GroundRegularRule(uIIIuII,luIIuIII,new ID()));
/*t*/
rules.add(new GroundRegularRule(tAtA,l1,new ID()));
rules.add(new GroundRegularRule(tBtB,l1,new ID()));
rules.add(new GroundRegularRule(tCtC,l1,new ID()));
rules.add(new GroundRegularRule(tDtD,l1,new ID()));
rules.add(new GroundRegularRule(tAtB,ltAtB,new ID()));
rules.add(new GroundRegularRule(tBtA,ltAtB,new ID()));
rules.add(new GroundRegularRule(tAtC,ltAtC,new ID()));
rules.add(new GroundRegularRule(tCtA,ltAtC,new ID()));
rules.add(new GroundRegularRule(tAtD,ltAtD,new ID()));
rules.add(new GroundRegularRule(tDtA,ltAtD,new ID()));
rules.add(new GroundRegularRule(tBtC,ltBtC,new ID()));
rules.add(new GroundRegularRule(tCtB,ltBtC,new ID()));
rules.add(new GroundRegularRule(tBtD,ltBtD,new ID()));
rules.add(new GroundRegularRule(tDtB,ltBtD,new ID()));
rules.add(new GroundRegularRule(tCtD,ltCtD,new ID()));
rules.add(new GroundRegularRule(tDtC,ltCtD,new ID()));
//RECURSIEVE REGELS
/*R*/
/**RT**/
ArrayList<FaspFuzzyExpression> op1_r1r2t1_list = new ArrayList<FaspFuzzyExpression>();
for(String tag1 : map_res_on_tag.get(r1)){
ArrayList<FaspFuzzyExpression> max_r1r2t1_list = new ArrayList<FaspFuzzyExpression>();
for(String tag2 : map_res_on_tag.get(r2)){
max_r1r2t1_list.add(new GroundLiteral(new GroundPredicate("SIMT("+tag1+","+tag2+")"),false, false,null));
}
GroundLiteral maxTR = new GroundLiteral(new GroundPredicate("MAXTR(tag2|"+tag1+")"),false, false,null);
rules.add(new GroundRegularRule(maxTR, max_r1r2t1_list,new MULTIMAX()));
op1_r1r2t1_list.add(maxTR);
}
rules.add(new GroundRegularRule(op1_r1r2t1, op1_r1r2t1_list, op1));
ArrayList<FaspFuzzyExpression> op1_r1r2t2_list = new ArrayList<FaspFuzzyExpression>();
for(String tag2 : map_res_on_tag.get(r2)){
ArrayList<FaspFuzzyExpression> max_r1r2t2_list = new ArrayList<FaspFuzzyExpression>();
for(String tag1 : map_res_on_tag.get(r1)){
max_r1r2t2_list.add(new GroundLiteral(new GroundPredicate("SIMT("+tag2+","+tag1+")"),false, false,null));
}
GroundLiteral maxTR = new GroundLiteral(new GroundPredicate("MAXTR(tag1|"+tag2+")"),false, false,null);
rules.add(new GroundRegularRule(maxTR, max_r1r2t2_list, new MULTIMAX()));
op1_r1r2t2_list.add(maxTR);
}
rules.add(new GroundRegularRule(op1_r1r2t2, op1_r1r2t2_list, op1));
ArrayList<FaspFuzzyExpression> op2_r1r2t_list = new ArrayList<FaspFuzzyExpression>();
op2_r1r2t_list.add(op1_r1r2t1); op2_r1r2t_list.add(op1_r1r2t2);
rules.add(new GroundRegularRule(op2_r1r2t, op2_r1r2t_list, op2));
/**RU**/
ArrayList<FaspFuzzyExpression> op1_r1r2u1_list = new ArrayList<FaspFuzzyExpression>();
for(String user1 : map_res_on_user.get(r1)){
ArrayList<FaspFuzzyExpression> max_r1r2u1_list = new ArrayList<FaspFuzzyExpression>();
for(String user2 : map_res_on_user.get(r2)){
max_r1r2u1_list.add(new GroundLiteral(new GroundPredicate("SIMU("+user1+","+user2+")"),false, false,null));
}
GroundLiteral maxUR = new GroundLiteral(new GroundPredicate("MAXUR(user2|"+user1+")"),false, false,null);
rules.add(new GroundRegularRule(maxUR, max_r1r2u1_list,new MULTIMAX()));
op1_r1r2u1_list.add(maxUR);
}
rules.add(new GroundRegularRule(op1_r1r2u1, op1_r1r2u1_list, op1));
ArrayList<FaspFuzzyExpression> op1_r1r2u2_list = new ArrayList<FaspFuzzyExpression>();
for(String user2 : map_res_on_user.get(r2)){
ArrayList<FaspFuzzyExpression> max_r1r2u2_list = new ArrayList<FaspFuzzyExpression>();
for(String user1 : map_res_on_user.get(r1)){
max_r1r2u2_list.add(new GroundLiteral(new GroundPredicate("SIMU("+user2+","+user1+")"),false, false,null));
}
GroundLiteral maxUR = new GroundLiteral(new GroundPredicate("MAXTR(user1|"+user2+")"),false, false,null);
rules.add(new GroundRegularRule(maxUR, max_r1r2u2_list, new MULTIMAX()));
op1_r1r2u2_list.add(maxUR);
}
rules.add(new GroundRegularRule(op1_r1r2u2, op1_r1r2u2_list, op1));
ArrayList<FaspFuzzyExpression> op2_r1r2u_list = new ArrayList<FaspFuzzyExpression>();
op2_r1r2u_list.add(op1_r1r2u1); op2_r1r2u_list.add(op1_r1r2u2);
rules.add(new GroundRegularRule(op2_r1r2u, op2_r1r2u_list, op2));
/**Rop3**/
ArrayList<FaspFuzzyExpression> op3_r1r2_list = new ArrayList<FaspFuzzyExpression>();
op3_r1r2_list.add(op2_r1r2u); op3_r1r2_list.add(op2_r1r2u);
rules.add(new GroundRegularRule(r1r2, op3_r1r2_list, op3));
rules.add(new GroundRegularRule(r2r1, op3_r1r2_list, op3));
/*U*/
String[] users = map_user_on_tag.keySet().toArray(new String[0]);
for(int i=0; i< users.length; i++){
for(int j=i+1; j< users.length; j++){
/**UT**/
ArrayList<FaspFuzzyExpression> op1_u1u2t1_list = new ArrayList<FaspFuzzyExpression>();
for(String tag1 : map_user_on_tag.get(users[i])){
ArrayList<FaspFuzzyExpression> max_u1u2t1_list = new ArrayList<FaspFuzzyExpression>();
for(String tag2 : map_user_on_tag.get(users[j])){
max_u1u2t1_list.add(new GroundLiteral(new GroundPredicate("SIMT("+tag1+","+tag2+")"),false, false,null));
}
GroundLiteral maxTU = new GroundLiteral(new GroundPredicate("MAXTU(tag2|"+tag1+")"),false, false,null);
rules.add(new GroundRegularRule(maxTU, max_u1u2t1_list,new MULTIMAX()));
op1_u1u2t1_list.add(maxTU);
}
GroundLiteral op1_u1u2t1 = new GroundLiteral(new GroundPredicate("OP1U_tag1("+users[i]+","+users[j]+")"),false, false,null);
rules.add(new GroundRegularRule(op1_u1u2t1, op1_u1u2t1_list, op1));
ArrayList<FaspFuzzyExpression> op1_u1u2t2_list = new ArrayList<FaspFuzzyExpression>();
for(String tag2 : map_user_on_tag.get(users[j])){
ArrayList<FaspFuzzyExpression> max_u1u2t2_list = new ArrayList<FaspFuzzyExpression>();
for(String tag1 : map_user_on_tag.get(users[i])){
max_u1u2t2_list.add(new GroundLiteral(new GroundPredicate("SIMT("+tag2+","+tag1+")"),false, false,null));
}
GroundLiteral maxTU = new GroundLiteral(new GroundPredicate("MAXTR(tag1|"+tag2+")"),false, false,null);
rules.add(new GroundRegularRule(maxTU, max_u1u2t2_list, new MULTIMAX()));
op1_u1u2t2_list.add(maxTU);
}
GroundLiteral op1_u1u2t2 = new GroundLiteral(new GroundPredicate("OP1U_tag2("+users[i]+","+users[j]+")"),false, false,null);
rules.add(new GroundRegularRule(op1_u1u2t2, op1_u1u2t2_list, op1));
ArrayList<FaspFuzzyExpression> op2_u1u2t_list = new ArrayList<FaspFuzzyExpression>();
op2_u1u2t_list.add(op1_u1u2t1); op2_u1u2t_list.add(op1_u1u2t2);
GroundLiteral op2_u1u2t = new GroundLiteral(new GroundPredicate("OP2U_tag("+users[i]+","+users[j]+")"),false, false,null);
rules.add(new GroundRegularRule(op2_u1u2t, op2_u1u2t_list, op2));
/**UR**/
ArrayList<FaspFuzzyExpression> op1_u1u2r1_list = new ArrayList<FaspFuzzyExpression>();
for(String res1 : map_user_on_res.get(users[i])){
ArrayList<FaspFuzzyExpression> max_u1u2r1_list = new ArrayList<FaspFuzzyExpression>();
for(String res2 : map_user_on_res.get(users[j])){
max_u1u2r1_list.add(new GroundLiteral(new GroundPredicate("SIMR("+res1+","+res2+")"),false, false,null));
}
GroundLiteral maxRU = new GroundLiteral(new GroundPredicate("MAXRU(res2|"+res1+")"),false, false,null);
rules.add(new GroundRegularRule(maxRU, max_u1u2r1_list,new MULTIMAX()));
op1_u1u2r1_list.add(maxRU);
}
GroundLiteral op1_u1u2r1 = new GroundLiteral(new GroundPredicate("OP1U_res1("+users[i]+","+users[j]+")"),false, false,null);
rules.add(new GroundRegularRule(op1_u1u2r1, op1_u1u2r1_list, op1));
ArrayList<FaspFuzzyExpression> op1_u1u2r2_list = new ArrayList<FaspFuzzyExpression>();
for(String res2 : map_user_on_res.get(users[j])){
ArrayList<FaspFuzzyExpression> max_u1u2r2_list = new ArrayList<FaspFuzzyExpression>();
for(String res1 : map_user_on_res.get(users[i])){
max_u1u2r2_list.add(new GroundLiteral(new GroundPredicate("SIMR("+res2+","+res1+")"),false, false,null));
}
GroundLiteral maxRU = new GroundLiteral(new GroundPredicate("MAXRU(res1|"+res2+")"),false, false,null);
rules.add(new GroundRegularRule(maxRU, max_u1u2r2_list,new MULTIMAX()));
op1_u1u2r2_list.add(maxRU);
}
GroundLiteral op1_u1u2r2 = new GroundLiteral(new GroundPredicate("OP1U_res2("+users[i]+","+users[j]+")"),false, false,null);
rules.add(new GroundRegularRule(op1_u1u2r1, op1_u1u2r1_list, op1));
GroundLiteral op2_u1u2r = new GroundLiteral(new GroundPredicate("OP2U_res("+users[i]+","+users[j]+")"),false, false,null);
ArrayList<FaspFuzzyExpression> op2_u1u2r_list = new ArrayList<FaspFuzzyExpression>();
op2_u1u2r_list.add(op1_r1r2u1); op2_u1u2r_list.add(op1_u1u2r2);
rules.add(new GroundRegularRule(op2_u1u2r, op2_u1u2r_list, op2));
/**Uop3**/
GroundLiteral op3_u1u2 = new GroundLiteral(new GroundPredicate("SIMU("+users[i]+","+users[j]+")"),false, false,null);
GroundLiteral op3_u2u1 = new GroundLiteral(new GroundPredicate("SIMU("+users[j]+","+users[i]+")"),false, false,null);
ArrayList<FaspFuzzyExpression> op3_u1u2_list = new ArrayList<FaspFuzzyExpression>();
op3_u1u2_list.add(op2_u1u2t); op3_u1u2_list.add(op2_u1u2r);
rules.add(new GroundRegularRule(op3_u1u2, op3_u1u2_list, op3));
rules.add(new GroundRegularRule(op3_u2u1, op3_u1u2_list, op3));
}
}
/*T*/
String[] tags = map_tag_on_user.keySet().toArray(new String[0]);
for(int i=0; i<tags.length; i++){
for(int j=i+1; j< tags.length; j++){
/**TU**/
ArrayList<FaspFuzzyExpression> op1_t1t2u1_list = new ArrayList<FaspFuzzyExpression>();
for(String user1 : map_tag_on_user.get(tags[i])){
ArrayList<FaspFuzzyExpression> max_t1t2u1_list = new ArrayList<FaspFuzzyExpression>();
for(String user2 : map_tag_on_user.get(tags[j])){
max_t1t2u1_list.add(new GroundLiteral(new GroundPredicate("SIMU("+user1+","+user2+")"),false, false,null));
}
GroundLiteral maxUT = new GroundLiteral(new GroundPredicate("MAXUT(user2|"+user1+")"),false, false,null);
rules.add(new GroundRegularRule(maxUT, max_t1t2u1_list,new MULTIMAX()));
op1_t1t2u1_list.add(maxUT);
}
GroundLiteral op1_t1t2u1 = new GroundLiteral(new GroundPredicate("OP1T_user1("+tags[i]+","+tags[j]+")"),false, false,null);
rules.add(new GroundRegularRule(op1_t1t2u1, op1_t1t2u1_list, op1));
ArrayList<FaspFuzzyExpression> op1_t1t2u2_list = new ArrayList<FaspFuzzyExpression>();
for(String user2 : map_tag_on_user.get(tags[j])){
ArrayList<FaspFuzzyExpression> max_t1t2u2_list = new ArrayList<FaspFuzzyExpression>();
for(String user1 : map_tag_on_user.get(tags[i])){
max_t1t2u2_list.add(new GroundLiteral(new GroundPredicate("SIMU("+user2+","+user1+")"),false, false,null));
}
GroundLiteral maxUT = new GroundLiteral(new GroundPredicate("MAXUT(user1|"+user2+")"),false, false,null);
rules.add(new GroundRegularRule(maxUT, max_t1t2u2_list,new MULTIMAX()));
op1_t1t2u2_list.add(maxUT);
}
GroundLiteral op1_t1t2u2 = new GroundLiteral(new GroundPredicate("OP1T_user2("+tags[i]+","+tags[j]+")"),false, false,null);
rules.add(new GroundRegularRule(op1_t1t2u2, op1_t1t2u2_list, op1));
ArrayList<FaspFuzzyExpression> op2_t1t2u_list = new ArrayList<FaspFuzzyExpression>();
op2_t1t2u_list.add(op1_t1t2u1); op2_t1t2u_list.add(op1_t1t2u2);
GroundLiteral op2_t1t2u = new GroundLiteral(new GroundPredicate("OP2T_user("+tags[i]+","+tags[j]+")"),false, false,null);
rules.add(new GroundRegularRule(op2_t1t2u, op2_t1t2u_list, op2));
/**TR**/
ArrayList<FaspFuzzyExpression> op1_t1t2r1_list = new ArrayList<FaspFuzzyExpression>();
for(String res1 : map_tag_on_res.get(tags[i])){
ArrayList<FaspFuzzyExpression> max_t1t2r1_list = new ArrayList<FaspFuzzyExpression>();
for(String res2 : map_tag_on_res.get(tags[j])){
max_t1t2r1_list.add(new GroundLiteral(new GroundPredicate("SIMR("+res1+","+res2+")"),false, false,null));
}
GroundLiteral maxUR = new GroundLiteral(new GroundPredicate("MAXUR(res2|"+res1+")"),false, false,null);
rules.add(new GroundRegularRule(maxUR, max_t1t2r1_list,new MULTIMAX()));
op1_t1t2r1_list.add(maxUR);
}
GroundLiteral op1_t1t2r1 = new GroundLiteral(new GroundPredicate("OP1T_res1("+tags[i]+","+tags[j]+")"),false, false,null);
rules.add(new GroundRegularRule(op1_t1t2r1, op1_t1t2r1_list, op1));
ArrayList<FaspFuzzyExpression> op1_t1t2r2_list = new ArrayList<FaspFuzzyExpression>();
for(String res2 : map_tag_on_res.get(tags[j])){
ArrayList<FaspFuzzyExpression> max_t1t2r2_list = new ArrayList<FaspFuzzyExpression>();
for(String res1 : map_tag_on_res.get(tags[i])){
max_t1t2r2_list.add(new GroundLiteral(new GroundPredicate("SIMR("+res2+","+res1+")"),false, false,null));
}
GroundLiteral maxUR = new GroundLiteral(new GroundPredicate("MAXUR(res1|"+res2+")"),false, false,null);
rules.add(new GroundRegularRule(maxUR, max_t1t2r2_list,new MULTIMAX()));
op1_t1t2r2_list.add(maxUR);
}
GroundLiteral op1_t1t2r2 = new GroundLiteral(new GroundPredicate("OP1T_res2("+tags[i]+","+tags[j]+")"),false, false,null);
rules.add(new GroundRegularRule(op1_t1t2r2, op1_t1t2r2_list, op1));
ArrayList<FaspFuzzyExpression> op2_t1t2r_list = new ArrayList<FaspFuzzyExpression>();
op2_t1t2r_list.add(op1_t1t2r1); op2_t1t2r_list.add(op1_t1t2r2);
GroundLiteral op2_t1t2r = new GroundLiteral(new GroundPredicate("OP2T_res("+tags[i]+","+tags[j]+")"),false, false,null);
rules.add(new GroundRegularRule(op2_t1t2r, op2_t1t2r_list, op2));
/**Top3**/
GroundLiteral op3_t1t2 = new GroundLiteral(new GroundPredicate("SIMT("+tags[i]+","+tags[j]+")"),false, false,null);
GroundLiteral op3_t2t1 = new GroundLiteral(new GroundPredicate("SIMT("+tags[j]+","+tags[i]+")"),false, false,null);
ArrayList<FaspFuzzyExpression> op3_t1t2_list = new ArrayList<FaspFuzzyExpression>();
op3_t1t2_list.add(op2_t1t2u); op3_t1t2_list.add(op2_t1t2r);
rules.add(new GroundRegularRule(op3_t1t2, op3_t1t2_list, op3));
rules.add(new GroundRegularRule(op3_t2t1, op3_t1t2_list, op3));
}