private IntItem instantiateRangeItem(List<OperatorNode<ExpressionOperator>> args,
                                         OperatorNode<ExpressionOperator> spec) {
        Preconditions.checkArgument(args.size() == 3,
                "Expected 3 arguments, got %s.", args.size());

        Number lowerArg = getRangeBound(args.get(1));
        Number upperArg = getRangeBound(args.get(2));
        String bounds = getAnnotation(spec, BOUNDS, String.class, null,
                                      "whether bounds should be open or closed");
        // TODO: add support for implicit transforms
        if (bounds == null) {
            return new RangeItem(lowerArg, upperArg, getIndex(args.get(0)));
        } else {
            Limit from;
            Limit to;
            switch (bounds) {
                case BOUNDS_OPEN -> {
                    from = new Limit(lowerArg, false);
                    to = new Limit(upperArg, false);
                }
                case BOUNDS_LEFT_OPEN -> {
                    from = new Limit(lowerArg, false);
                    to = new Limit(upperArg, true);
                }
                case BOUNDS_RIGHT_OPEN -> {
                    from = new Limit(lowerArg, true);
                    to = new Limit(upperArg, false);
                }
                default ->
                        throw newUnexpectedArgumentException(bounds, BOUNDS_OPEN, BOUNDS_LEFT_OPEN, BOUNDS_RIGHT_OPEN);
            }
            return new IntItem(from, to, getIndex(args.get(0)));
        }
    }
Build a "pure" not, without any positive terms.
container-search/src/main/java/com/yahoo/search/yql/YqlParser.java