}
ArrayList<Transformation> allRules = new ArrayList<>(Arrays.asList(rules));
allRules.add(0, EliminateMetricsTransformation.ELIMINATE_METRICS);
Transformation simplification = new TransformationCollection(allRules);
ArrayList<Expression> reducedSystem = new ArrayList<>();
for (Tensor equation : zeroReduced) {
int count = ITERATION_LIMIT;
do {
for (Expression solution : generalSolutions)
equation = solution.transform(equation);
equation = ExpandTransformation.expand(equation, simplification);
equation = simplification.transform(equation);
equation = CollectNonScalarsTransformation.collectNonScalars(equation);
if (!TensorUtils.containsSimpleTensors(equation, varsNames))
break;
} while (count-- > 0);