app/models/run.rb
# assign parent to cluster_tree for partial arrow
# if arrow shows different parent than cluster's registered one, the arrow is to odd_arrows.
assign parent to cluster_tree for partial arrow
if arrow shows different parent than cluster's registered one, the arrow is to odd_arrows.
assign parent to cluster_tree for partial arrow if arrow shows different parent than cluster ' s registered one the arrow is to odd_arrows .
def assign_parent_to_cluster_tree(cluster_hedge, arrow, odd_arrows)
      arrow.blank? and return
      arrow.is_a? Set and return arrow.each do |a| assign_parent_to_cluster_tree(cluster_hedge, a, odd_arrows) end
      op, pre_value_ref, pos_value_ref, cond = arrow.op.name, arrow.pre_value_ref, arrow.pos_value_ref, arrow.cond
      pre_value_ref, pos_value_ref = pos_value_ref, pre_value_ref if op.end_with?('~')
      pre_join, pos_join = 
        detect_or_add_variable_to_cluster_hedge([pre_value_ref.entity, pos_value_ref.entity], cluster_hedge)  
      fail "literal cannot be an entity for partial association" unless pre_join && pos_join
      if pos_join.cluster_tree.parent.nil?
        pos_join.cluster_tree.parent = pre_join.cluster_tree
        pre_join.cluster_tree.children << pos_join.cluster_tree
      end
      if pos_join.cluster_tree.parent == pre_join.cluster_tree
        pos_join.cluster_tree.conditions << cond    
      else
        odd_arrows << arrow 
      end
    end
def assign_parent_to_cluster_tree ( cluster_hedge , arrow , odd_arrows ) arrow . blank? and return arrow . is_a? Set and return arrow . each do | a | assign_parent_to_cluster_tree ( cluster_hedge , a , odd_arrows ) end op , pre_value_ref , pos_value_ref , cond = arrow . op . name , arrow . pre_value_ref , arrow . pos_value_ref , arrow . cond pre_value_ref , pos_value_ref = pos_value_ref , pre_value_ref if op . end_with? ( '~' ) pre_join , pos_join = detect_or_add_variable_to_cluster_hedge ( [ pre_value_ref . entity , pos_value_ref . entity ] , cluster_hedge ) fail "literal cannot be an entity for partial association" unless pre_join && pos_join if pos_join . cluster_tree . parent . nil? pos_join . cluster_tree . parent = pre_join . cluster_tree pre_join . cluster_tree . children << pos_join . cluster_tree end if pos_join . cluster_tree . parent == pre_join . cluster_tree pos_join . cluster_tree . conditions << cond else odd_arrows << arrow end end
assign parent to cluster_tree for partial arrow
if arrow shows different parent than cluster's registered one, the arrow is to odd_arrows.
assign parent to cluster_tree for partial arrow if arrow shows different parent than cluster ' s registered one the arrow is to odd_arrows .
#      return if arrow.blank? #      return arrow.each do |a| assign_parent_to_cluster_tree(cluster_hedge, a, odd_arrows) end if arrow.is_a? Set
cluster_hedge
<not_specific>
arrow
<not_specific>
odd_arrows
<not_specific>