@Override
    public String toString(ToStringContext<NAMETYPE> context) {
        StringBuilder b = new StringBuilder(argument.toString(context));
        if (context.typeContext().isEmpty()
            && subspaceAddress.size() == 1 && subspaceAddress.get(0).dimension().isEmpty()) { // use short forms
            if (subspaceAddress.get(0).index().isPresent())
                b.append("[").append(subspaceAddress.get(0).index().get().toString(context)).append("]");
            else
                b.append("{").append(subspaceAddress.get(0).label().get()).append("}");
        }
        else { // general form
            b.append("{").append(subspaceAddress.stream()
                                                .map(i -> i.toString(context, this))
                                                .collect(Collectors.joining(", "))).append("}");
        }
        return b.toString();
    }
Returns the subset of the given address which is present in the subspace type
vespajlib/src/main/java/com/yahoo/tensor/functions/Slice.java