}
@Override
protected Constantness constness(TPreptimeContext context, int inputIndex, LazyList<? extends TPreptimeValue> values) {
assert inputIndex == 0 : inputIndex + " for " + values; // 0 should be enough to fully answer the question
ValueSource indexVal = constSource(values, 0);
if (indexVal == null)
return Constantness.NOT_CONST;
if (indexVal.isNull())
return Constantness.CONST;
int answerIndex = indexVal.getInt32();
if (answerIndex < 1 || answerIndex >= values.size())
return Constantness.CONST; // answer is null
ValueSource answer = constSource(values, answerIndex);
return answer == null ? Constantness.NOT_CONST : Constantness.CONST;
}