return GdlPool.getDistinct(arg1, arg2);
}
else if(gdl instanceof GdlNot)
{
GdlNot not = (GdlNot)gdl;
GdlLiteral body = (GdlLiteral)getInstantiationAux(not.getBody(), varInstantiation);
return GdlPool.getNot(body);
}
else if(gdl instanceof GdlOr)
{
GdlOr or = (GdlOr)gdl;
List<GdlLiteral> body = new ArrayList<GdlLiteral>();
for(int i=0; i<or.arity(); i++)
{
body.add((GdlLiteral)getInstantiationAux(or.get(i), varInstantiation));
}
return GdlPool.getOr(body);
}
else if(gdl instanceof GdlProposition)
{
return gdl;
}
else if(gdl instanceof GdlConstant)
{
return gdl;
}
else if(gdl instanceof GdlFunction)
{
GdlFunction func = (GdlFunction)gdl;
List<GdlTerm> body = new ArrayList<GdlTerm>();
for(int i=0; i<func.arity(); i++)
{
body.add((GdlTerm)getInstantiationAux(func.get(i), varInstantiation));
}
return GdlPool.getFunction(func.getName(), body);
}
else if(gdl instanceof GdlVariable)
{