for (int index = 0, n = processed.size(); index < n; index++) {
RuleAtom sharedAtom = processed.get(index);
int indexArg = sharedAtom.getAllArguments().indexOf(arg);
if (indexArg != -1) {
if (lastWME && index == n -1) {
return new WMENodeProvider(indexArg);
}
else {
return new TokenNodeProvider(index, indexArg);
}
}