# File lib/ruote/dboard/mutation.rb, line 188 def walk_concurrence(fexp, ftree, tree) if ftree[2].size != tree[2].size # # that's lazy, but why not? # # we could add/apply a new child... register(MutationPoint.new(fexp.fei, tree, :re_apply)) else # # if there is a least one child that replied and whose # tree must be changes, then re-apply the whole concurrence # # else try to re-apply only the necessary branch (walk them) branches = ftree[2].zip(tree[2]).each_with_object([]) { |(ft, t), a| # # match child expressions (if not yet replied) with current tree (ft) # and desired tree (t) # cfei = fexp.children[a.size] cexp = cfei ? @ps.fexp(cfei) : nil a << [ cexp, ft, t ] # }.select { |cexp, ft, t| # # only keep diverging branches # ft != t } branches.each do |cexp, ft, t| next if cexp # there is at least one branch that replied, # this forces re-apply for the whole concurrence register(MutationPoint.new(fexp.fei, tree, :re_apply)) return end branches.each do |cexp, ft, t| # # we're left with divering branches that haven't yet replied, # let's walk to register the mutation point deep into it walk(cexp, t) end end end