A Reactive Implementation of \textit{Pos} Using ROBDDs

The subject of groundness analysis for (constraint) logic programs has been widely studied, and interesting domains have been proposed. \textit{Pos} has been recognized has the most suitable domain for capturing the kind of dependencies arising in groundness analysis. Its (by now standard) implementation is based on \emph{reduced ordered binary-decision diagrams} (ROBDDs), a well-known symbolic representation for Boolean functions. Even though several authors have reported positive experiences using ROBDDs for groundness analysis, in the literature there is no reference to the problem of the efficient detection of those variable which are deemed to be ground in the context of a ROBDD. This is not surprising, since most currently implemented analyzers need to derive this information only \emph{at the end} of the analysis and only for presentation purposes. Things are much different when this information is required \emph{during} the analysis. This need arises when dealing with languages which employ some sort of \emph{delay mechanism}, which are typically based on groundness conditions. In these cases, the \emph{na\"\i{}f} approaches are too inefficient, since the abstract interpreter must quickly (and often) decide whether a constraint is delayed or not. Fast access to ground variables is also necessary when aliasing analysis is performed using a domain not keeping track of ground dependencies. In this paper we introduce and study the problem, proposing two possible solutions. The second one, besides making possible the quick detection of ground variables, has also the effect of keeping the ROBDDs as small as possible, improving the efficiency of groundness analysis in itself.