code: public Factor getRootFactor(ExpressionTree tree, VariableNumMap expressionVar) {
      List<Assignment> roots = Lists.newArrayList();
      if (tree.getSubstitutions().size() == 0) {
        roots.add(expressionVar.outcomeArrayToAssignment(tree.getExpressionNode()));
      } else {
        for (ExpressionTree substitution : tree.getSubstitutions()) {
          roots.add(expressionVar.outcomeArrayToAssignment(substitution.getExpressionNode()));
        }
      }
  
      return TableFactor.pointDistribution(expressionVar, roots.toArray(new Assignment[0]));
    }
docs: This method is a hack that enables the use of the "substitutions"
  field of ExpressionTree at the root of the CFG parse. In the future,
  these substitutions should be handled using unary rules in the
  CFG parser.