List<String> generateVariants(){
  String prefix=formatPrefix();
  String suffix=formatSuffix();
  ArrayList<String> variants=new ArrayList<>();
  if (inputs.length > 0) {
    for (    String var : recurseVariants(0)) {
      variants.add(prefix + ", " + var+ suffix);
    }
  }
 else {
    assert inputs.length == 0;
    variants.add(prefix + suffix);
  }
  return variants;
}

List < String > generateVariants ( ) { String prefix = formatPrefix ( ) ; String suffix = formatSuffix ( ) ; ArrayList < String > variants = new ArrayList < > ( ) ; if ( inputs . length > 0 ) { for ( String var : recurseVariants ( 0 ) ) { variants . add ( prefix + ", " + var + suffix ) ; } } else { assert inputs . length == 0 ; variants . add ( prefix + suffix ) ; } return variants ; }
recursively generate all the variants of this rule pattern . currently that just means to swap the inputs for commutative rules , producing all possible permutations .
