private ArrayList<ASTatom> fetchExpressions(SimpleNode n,
			boolean ignoreLocals) {


		// ignore choice rules and aggregates in case ignore locals was set to
		// true
		ArrayList<ASTatom> result = new ArrayList<ASTatom>();
		if (ignoreLocals
				&& (n.getId() == ElpsTranslatorTreeConstants.JJTAGGREGATE || n
						.getId() == ElpsTranslatorTreeConstants.JJTCHOICE_RULE)) {
			return result;
		}

		if (n.getId() == ElpsTranslatorTreeConstants.JJTARITHMETICTERM) {
			// we are only interested in arithmetic terms which are not
			// supported by DLV ,i.e, it those with operation signs
			if (n.toString().indexOf('-') != -1
					|| n.toString().indexOf('+') != -1
					|| n.toString().indexOf('*') != -1
					|| n.toString().indexOf('/') != -1) {
				ASTterm newTerm=exprSplitter.split((ASTarithmeticTerm)n,result);
				ASTvar newVar=new ASTvar(ElpsTranslatorTreeConstants.JJTVAR);
				newVar.image=newTerm.toString();
				n.jjtAddChild(newVar, 0);

			}
		}

		for (int i = 0; i < n.jjtGetNumChildren(); i++) {
			result.addAll(fetchExpressions((SimpleNode) (n.jjtGetChild(i)),
					ignoreLocals));
		}
		return result;
	}