let overBitstring (connection,n_node,port) graph =
let or_node = DG.findnode connection.sourceid graph
and n_node_out = DG.nodefoldoutedges graph (fun y a -> y::a) n_node []
and id_node = {nname=Id; id = NewName.get (); inputs = PortMap.empty; inside=n_node.inside; updims=RLMap.empty; otherdims=Array.of_list []}
and new_edge_id = NewName.get ()
and graph_ref = ref graph
in
graph_ref := DG.addnode id_node !graph_ref;
graph_ref := new_source_edge n_node_out id_node.id !graph_ref;
graph_ref:= DG.addedge ({sourceid=n_node.id; nameforudg=NewName.get (); lblmap = mkcnstlblmap n_node.inside},id_node.id,PortText) !graph_ref;
if (nodedesc n_node.nname).contracts then
begin
let longor_node = {nname = LongOr; id = NewName.get (); inputs = PortMap.empty; inside = n_node.inside; updims = n_node.updims; otherdims = Array.of_list []}
and new2_edge_id = NewName.get ()
in
graph_ref := DG.addnode longor_node !graph_ref;
graph_ref := DG.addedge ({sourceid = or_node.id; nameforudg = new2_edge_id; lblmap = connection.lblmap}, longor_node.id, PortSingleB) !graph_ref;
graph_ref := DG.addedge ({sourceid = longor_node.id; nameforudg = new_edge_id; lblmap = mkcnstlblmap n_node.inside}, id_node.id, PortSingleB) !graph_ref
end else
begin
graph_ref := DG.addedge ({sourceid = or_node.id; nameforudg=new_edge_id; lblmap = connection.lblmap},id_node.id,PortSingleB) !graph_ref
end;
Left !graph_ref