# File lib/ruote/tree_dot.rb, line 50
  def self.children_to_dot(expid, exp)

    exp_name = exp[0]
    child_count = exp[2].size

    i = -1

    a = exp[2].collect do |child|
      i += 1
      branch_to_dot("#{expid}_#{i}", child)
    end

    if child_count > 0 # there are children

      if %w[ concurrence if ].include?(exp_name)

        (0..child_count - 1).each do |i|
          a << "  \"#{expid}\" -> \"#{expid}_#{i}\";"
          a << "  \"#{expid}_#{i}\" -> \"#{expid}\";"
        end

      else

        a << "  \"#{expid}\" -> \"#{expid}_0\";"
        a << "  \"#{expid}_#{child_count -1}\" -> \"#{expid}\";"

        (0..child_count - 2).each do |i|
          a << "  \"#{expid}_#{i}\" -> \"#{expid}_#{i + 1}\";"
        end
      end
    end

    a
  end