fn decompose_constraint_node(&mut self, lhs: NodeIndex, rhs: NodeIndex) {
        let rhs_is_ptr = match self.g[rhs] {
            ConstraintNode::Intersect => {
                let operands = self.operands(&rhs);
                for op in &operands {
                    self.g.update_edge(lhs, *op, ConstraintEdge::SubType);
                }
                false
            }
            ConstraintNode::Ptr => true,
            _ => false,
        };

        let lhs_is_ptr = match self.g[lhs] {
            ConstraintNode::Union => {
                let lhs_operands = self.operands(&lhs);
                let mut subtype_relations = Vec::new();
                let mut edges = self
                    .g
                    .neighbors_directed(lhs, EdgeDirection::Incoming)
                    .detach();
                while let Some(edge) = edges.next_edge(&self.g) {
                    if let ConstraintEdge::SubType = self.g[edge] {
                        let (_, target) = self.g.edge_endpoints(edge).expect("");
                        self.g.remove_edge(edge);
                        subtype_relations.push(target);
                    }
                }
                for rhs_op in subtype_relations {
                    for lhs_op in &lhs_operands {
                        self.g.update_edge(*lhs_op, rhs_op, ConstraintEdge::SubType);
                    }
                }
                false
            }
            ConstraintNode::Ptr => true,
            _ => false,
        };

        if lhs_is_ptr && rhs_is_ptr {
            let lhs_inner = self.inner_type(lhs);
            let rhs_inner = self.inner_type(rhs);
            self.g
                .update_edge(lhs_inner, rhs_inner, ConstraintEdge::SubType);
        }
    }
// This function decomposes the first node and adds the appropriate edges to
// the other node.
This function decomposes the first node and adds the appropriate edges to
the other node.
This function decomposes the first node and adds the appropriate edges to the other node .
fn decompose_constraint_node(&mut self, lhs: NodeIndex, rhs: NodeIndex) {
        let rhs_is_ptr = match self.g[rhs] {
            ConstraintNode::Intersect => {
                let operands = self.operands(&rhs);
                for op in &operands {
                    self.g.update_edge(lhs, *op, ConstraintEdge::SubType);
                }
                false
            }
            ConstraintNode::Ptr => true,
            _ => false,
        };
        let lhs_is_ptr = match self.g[lhs] {
            ConstraintNode::Union => {
                let lhs_operands = self.operands(&lhs);
                let mut subtype_relations = Vec::new();
                let mut edges = self
                    .g
                    .neighbors_directed(lhs, EdgeDirection::Incoming)
                    .detach();
                while let Some(edge) = edges.next_edge(&self.g) {
                    if let ConstraintEdge::SubType = self.g[edge] {
                        let (_, target) = self.g.edge_endpoints(edge).expect("");
                        self.g.remove_edge(edge);
                        subtype_relations.push(target);
                    }
                }
                for rhs_op in subtype_relations {
                    for lhs_op in &lhs_operands {
                        self.g.update_edge(*lhs_op, rhs_op, ConstraintEdge::SubType);
                    }
                }
                false
            }
            ConstraintNode::Ptr => true,
            _ => false,
        };
        if lhs_is_ptr && rhs_is_ptr {
            let lhs_inner = self.inner_type(lhs);
            let rhs_inner = self.inner_type(rhs);
            self.g
                .update_edge(lhs_inner, rhs_inner, ConstraintEdge::SubType);
        }
    }
fn decompose_constraint_node ( & mut self , lhs : NodeIndex , rhs : NodeIndex ) { let rhs_is_ptr = match self . g [ rhs ] { ConstraintNode :: Intersect => { let operands = self . operands ( & rhs ) ; for op in & operands { self . g . update_edge ( lhs , * op , ConstraintEdge :: SubType ) ; } false } ConstraintNode :: Ptr => true , _ => false , } ; let lhs_is_ptr = match self . g [ lhs ] { ConstraintNode :: Union => { let lhs_operands = self . operands ( & lhs ) ; let mut subtype_relations = Vec :: new ( ) ; let mut edges = self . g . neighbors_directed ( lhs , EdgeDirection :: Incoming ) . detach ( ) ; while let Some ( edge ) = edges . next_edge ( & self . g ) { if let ConstraintEdge :: SubType = self . g [ edge ] { let ( _ , target ) = self . g . edge_endpoints ( edge ) . expect ( " " ) ; self . g . remove_edge ( edge ) ; subtype_relations . push ( target ) ; } } for rhs_op in subtype_relations { for lhs_op in & lhs_operands { self . g . update_edge ( * lhs_op , rhs_op , ConstraintEdge :: SubType ) ; } } false } ConstraintNode :: Ptr => true , _ => false , } ; if lhs_is_ptr && rhs_is_ptr { let lhs_inner = self . inner_type ( lhs ) ; let rhs_inner = self . inner_type ( rhs ) ; self . g . update_edge ( lhs_inner , rhs_inner , ConstraintEdge :: SubType ) ; } }
This function decomposes the first node and adds the appropriate edges to
the other node.
This function decomposes the first node and adds the appropriate edges to the other node .
&mut self
lhs
NodeIndex
rhs
NodeIndex
&mut self
lhs
NodeIndex
rhs
NodeIndex