-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compute missing tuples in transitive closure #718
Compute missing tuples in transitive closure #718
Conversation
I would still like to know what goes wrong in the old implementation. I don't think you ever need to do both pre and post composition to get the correct results. All of the following fixed point equations should be correct (i.e. have the same LFP):
I assume that this remains correct, even when avoiding composition of mutually exclusive pairs. |
If mutual exclusion is used in composition, then the last equation has the largest fixed point among them. Example:
The tuple The old implementation produces an incorrect result in the following example:
The old implementation initializes |
I suspect that there's either something small overlooked or my assumption about |
Interesting example.
Yes, that's why I suggested it. IIRC, the Datalog implementation gave larger results and I wanted to match those by making this computation larger as well. But I take from your reply that this gives results larger than what Datalog produces.
This should not happen since you would start with a wrong approximation of the old transitive closure here.
Now I believe that
In particular, the iterations should thus be of the shape EDIT: Doesn't your example already explain the likely issue? Your Datalog implementation uses the quadratic TC formulation and is thus less precise. Even when using the linear formulations, |
Yes, that's why I wrote it. I don't understand why EDIT: I mean |
Keep in mind the definition I showed you from the SAS paper was about the encoding, not the RA. The first datalog implementation was using |
All those formulations have the same least fixed point if you do not consider mutex pairs (however, the linear versions are often nicer(*)). However, this fact seems to change if you add mutex pairs because
Yes, (*) The various versions of the fixed point equation only coincide in their least fixed point, but not in their other fixed points. |
I think I start understanding it. Please correct me if I'm wrong. A precise transitive closure
Because of that we have a freedom of choosing the equation which would restrict the may set most. At the same time, the must sets for all equations are the same because the execution implication is transitive. I.e., the quadratic definition does not spoil the must set with unsound tuples.
If my understanding is correct, I suggest addressing this issue with the following adjustment:
It should compute the left closure ( EDIT: The version above may have termination issues.
|
Yes, the endpoints of every path that contains some mutual exclusive events should not be counted. Getting this most precise result likely requires you to explicitly iterate over all possible paths, which is far too expensive. The fixed point iteration is less precise because you have to make the mutual exclusion judgement based only on a few events in each iteration rather than on the whole path.
Yes, the must-set might not be affected that much by the different FP formulation. However, I think this might be more related to the fact that the must-set is very likely to be acyclic. Indeed, the composition of must-sets is not associative so different composition orders of the various FP formulations already induce different results but IIRC this only happens on cyclic relations. The OOPSLA paper about RA mentions this problem and I make use of acyclicity in my proof IIRC.
EDIT: Similar to must-set composition, I believe may-set composition with the mutex filter is not associative. This naturally explains why different fixed point formulations lead to different results. |
I don't know what this version is supposed to compute but it is not precisely
Since EDIT: I was saving on lines of code and suggested an incorrect version again (
|
You are right that my version is wrong. I missed the fact that in the FP equation |
This is an interesting one. The issue is that XRA may cause |
Would providing an empty |
Yes, but I think it is better to make |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
f6d10e2
into
hernanponcedeleon:development
Co-authored-by: Dmitry Ivanov <[email protected]>
No description provided.