-/** Simplify/canonicalize expression containing indexed objects. This
- * performs contraction of dummy indices where possible and checks whether
- * the free indices in sums are consistent.
- *
- * @param e The expression to be simplified
- * @return simplified expression */
-ex simplify_indexed(const ex & e);
-
-/** Simplify/canonicalize expression containing indexed objects. This
- * performs contraction of dummy indices where possible, checks whether
- * the free indices in sums are consistent, and automatically replaces
- * scalar products by known values if desired.
- *
- * @param e The expression to be simplified
- * @param sp Scalar products to be replaced automatically
- * @return simplified expression */
-ex simplify_indexed(const ex & e, const scalar_products & sp);
+/** More reliable version of the form. The former assumes that e is an
+ * expanded epxression. */
+exvector get_all_dummy_indices_safely(const ex & e);
+
+/** Returns b with all dummy indices, which are listed in va, renamed
+ * if modify_va is set to TRUE all dummy indices of b will be appended to va */
+ex rename_dummy_indices_uniquely(exvector & va, const ex & b, bool modify_va = false);
+
+/** Returns b with all dummy indices, which are common with a, renamed */
+ex rename_dummy_indices_uniquely(const ex & a, const ex & b);
+
+/** Same as above, where va and vb contain the indices of a and b and are sorted */
+ex rename_dummy_indices_uniquely(const exvector & va, const exvector & vb, const ex & b);