question: 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 ; }
target:  Recursively generate all the variants of this rule pattern. Currently that just means to swap the inputs for commutative rules, producing all possible permutations.