sclass WeightedProduction { S a, b, c; // a + b = c; for subclassing, b = null double weight; S simplificationHint, plausibilityFunction; *() {} *(S *a, S *b, S *c, double *weight) {} *(S *a, S *c, double *weight) {} toString { ret a + (b == null ? "" : " + " + b) + " = " + c + appendSquareBracketStuff(simplificationHint); } }