internal override boolean study(TreeInfo info) { int minL = info.minLength; int maxL = info.maxLength; boolean maxV = info.maxValid; int minL2 = Integer.MAX_VALUE; //arbitrary large enough num int maxL2 = -1; for (int n = 0; n < size; n++) { info.reset(); if (atoms[n] != null) atoms[n].study(info); minL2 = Math.min(minL2, info.minLength); maxL2 = Math.max(maxL2, info.maxLength); maxV = (maxV & info.maxValid); } minL += minL2; maxL += maxL2; info.reset(); conn.next.study(info); info.minLength += minL; info.maxLength += maxL; info.maxValid &= maxV; info.deterministic = false; return false; }
internal override boolean study(TreeInfo info) { int minL = info.minLength; int maxL = info.maxLength; boolean maxV = info.maxValid; info.reset(); yes.study(info); int minL2 = info.minLength; int maxL2 = info.maxLength; boolean maxV2 = info.maxValid; info.reset(); not.study(info); info.minLength = minL + Math.min(minL2, info.minLength); info.maxLength = maxL + Math.max(maxL2, info.maxLength); info.maxValid = (maxV & maxV2 & info.maxValid); info.deterministic = false; return next.study(info); }
internal override boolean study(TreeInfo info) { // Save original info int minL = info.minLength; int maxL = info.maxLength; boolean maxV = info.maxValid; boolean detm = info.deterministic; info.reset(); atom.study(info); int temp = info.minLength * cmin + minL; if (temp < minL) { temp = 0xFFFFFFF; // Arbitrary large number } info.minLength = temp; if (maxV & info.maxValid) { temp = info.maxLength * cmax + maxL; info.maxLength = temp; if (temp < maxL) { info.maxValid = false; } } else { info.maxValid = false; } if (info.deterministic && cmin == cmax) { info.deterministic = detm; } else { info.deterministic = false; } return next.study(info); }