code: public HeadedSyntacticCategory getCanonicalForm(Map<Integer, Integer> relabeling) {
      Preconditions.checkArgument(relabeling.size() == 0);
      int[] relabeledVariables = canonicalizeVariableArray(semanticVariables, relabeling);
      return new HeadedSyntacticCategory(syntacticCategory.getCanonicalForm(), relabeledVariables, rootIndex);
    }
docs: Gets a canonical representation of this category that treats each
  variable number as an equivalence class. The canonical form
  relabels variables in the category such that all categories with
  the same variable equivalence relations have the same canonical
  form.
  
  @param relabeling the relabeling applied to variables in this to
  produce the relabeled category.
  @return