Set-sharing is redundant for pair-sharing
Theoretical Computer Science
Although the usual goal of sharing analysis is to detect which pairs of variables share, the standard choice for sharing analysis is a domain that characterizes set-sharing. In this paper, we question, apparently for the first time, whether this domain is over-complex for pair-sharing analysis. We show that the answer is yes. By defining an equivalence relation over the set-sharing domain we obtain a simpler domain, reducing the complexity of the abstract unification procedure. We present
... inary experimental results, showing that, in practice, our domain compares favorably with the set-sharing one over a wide range of benchmark programs. Introduction In logic programming, a knowledge of sharing between variables is important for optimizations such as the exploitation of parallelism. Today, talking about sharing analysis for logic programs is almost the same as talking about the set-sharing domain Sharing of Jacobs and Langen [11, 12] . The adequacy of this domain is not normally questioned. Researchers appear to be more concerned as to which add-ons are best: linearity, freeness, depth-k abstract substitutions and so on    13, 14, 16] rather than whether it is the optimal domain for the sharing information under investigation. What is the reason for this "standard" choice? Well, the set-sharing domain is quite accurate: when integrated with linearity information it is strictly more precise than its old challenger, the pair-sharing domain ASub of Søndergaard  . Indeed, Sharing encodes a lot of information. As a consequence, it is quite difficult to understand: taking an abstract element and writing down its concretization (namely, the concrete substitutions that are approximated by it) is a hard task. So the question arises: is this complexity actually needed for an accurate sharing analysis? Before answering this question we must agree on what the purpose of sharing analysis is. This paper relies on the following Assumption: The goal of sharing analysis for logic programs is to detect which pairs of variables are definitely independent (namely, they cannot be bound to terms having one or more variables in common). The work of R. Bagnara and P. M. Hill has been supported by EPSRC under grant GR/L19515.