private bool CanDropQueryXRelation(QueryX qx, Relation re) { var(p1, c1) = GetHeadTail(qx); var(p2, c2) = re.GetHeadTail(); return(p1 == p2 || c1 == c2 || p1 == c2 || c1 == p2); }
internal bool ComputeXRelationDrop(ComputeX cx, Relation rx, bool doDrop) { if (_relation_ComputeX_QueryX.TryGetChild(cx, out QueryX qx1) && _relation_Store_ComputeX.TryGetParent(cx, out Store st) && !_relation_QueryX_QueryX.HasChildLink(qx1)) { var(head, tail) = rx.GetHeadTail(); if (st == head || st == tail) { if (doDrop) { _queryXManager.AddComputeXQueryX(cx, qx1, rx, st == tail); } return(true); } } return(false); }
internal bool QueryRelationDrop(QueryX qx1, Relation r2, bool doDrop) { if (_relation_Relation_QueryX.TryGetParent(qx1, out Relation r1)) { var(_, t1) = r1.GetHeadTail(); var(h2, t2) = r2.GetHeadTail(); if (t1 == h2 || t1 == t2) { if (doDrop) { qx1.IsTail = false; var qx2 = new QueryX(this, QueryType.Value); qx2.IsReversed = t1 == t2; ItemCreated.Record(Owner, qx2); ItemLinked.Record(Owner, _relation_QueryX_QueryX, qx1, qx2); ItemLinked.Record(Owner, _relation_Relation_QueryX, r2, qx2); } return(true); } } return(false); }