private List<RenameTarget> prioritizedRenameTargets() {
        Map<IntermediateOperation, Integer> constraintsPerOperation = new HashMap<>();

        for (var constraint : constraints.entrySet()) {
            constraintsPerOperation.compute(constraint.getKey().operation,
                                            (operation, count) -> count == null ? 1 : ++count);
        }
        List<IntermediateOperation> prioritizedOperations =
                constraintsPerOperation.entrySet().stream()
                                                  .sorted(Comparator.comparingInt(entry -> - entry.getValue()))
                                                  .map(Map.Entry::getKey)
                                                  .toList();

        List<RenameTarget> targets = new ArrayList<>();
        for (IntermediateOperation operation : prioritizedOperations) {
            for (int i = 0; i < operation.inputs().size(); i++) {
                Optional<OrderedTensorType> inputType = operation.inputs().get(i).type();
                if (inputType.isEmpty()) continue;
                for (String dimensionName : inputType.get().dimensionNames()) {
                    RenameTarget target = new RenameTarget(operation, i, dimensionName, graph);
                    targets.add(target);
                }
            }
        }
        return targets;
    }
Removes soft constraints and returns whether something was removed
model-integration/src/main/java/ai/vespa/rankingexpression/importer/DimensionRenamer.java