Well, as one can expect, the problem is NP-complete even when processes do not communicate with each other. One can define subclasses of predicates such as stable predicates, linear predicates, and observer-independent predicates for efficient detection under special cases. These results are shown in
C. M. Chase, V. K. Garg,Efficient Detection of Global Predicates in a Distributed System, Distributed Computing, Vol. 11, No. 4, 1998, pp. 169 -- 189.Postscript
Now assume that the global predicate B is given in a disjunctive normal form boolean expression of local predicates. It is sufficient to detect conjunction of local predicates to detect B. The first algorithm to detect conjunctive predicates is given in
V. K. Garg, B. Waldecker,Detection of Weak Unstable Predicates in Distributed Programs, IEEE Transactions on Parallel and Distributed Systems, Vol. 5, No. 3, March 1994, pp. 299-307. Abstract ........... Postscript
Examples of predicates that can be detected efficiently includes
(P1 is red) and (P2 is red),
(P1 is at line 65) and (variable x in P2 is negative).
A distributed algorithm appears as
V. K. Garg, C. Chase, Distributed Detection of Conjunctive Predicates,Proc. IEEE International Conference on Distributed Computing Systems, Vancouver,Canada, June 1995, pp. 423 - 430.Abstract ...........Postscript
In many cases, the predicate may refer to the state of the channels. For example, termination can be modeled as "all processes are passive" and "all channels are empty." Algorithms to detect channel predicates is given in
The paper uses a restriction on predicates called linearity. A global predicate B is linear if whenever the predicate evaluates false on a global state G, there exists an event e such that unless that event is executed the predicate can never become true. The predicate satisfies Efficient Advancement Property if the event e can be determined in polynomial time. Any linear predicate with efficient advancement property can be detected efficiently.
The definition of linearity turns out to be equivalent to meet-closure.
A global predicate B is meet-closed if the following holds:
for all consistent global states G,H: B(G) and B(H) imply that B(G meet H).
The meet-closure implies that there exists a "least" global state that satisfies B whenever B is true in a computation.
What is the predicate is not linear? A class of predicates, called relational predicates, or bounded sum predicates is explored in
A. I. Tomlinson, V. K. Garg,Monitoring Functions on Global States of Distributed Programs Journal of Parallel and Distributed Computing Vol. 41, No. 2, March 1997, pp. 173 -- 189.Abstract ...........Postscript
This paper allows detection of predicates of the form x1+x2+...+xn >= k.
E. Fromentin, M. Raynal, V. K. Garg, A. I. Tomlinson, On the fly testing of Regular Patterns in distributed computations, Proc. 23rd International Conference on ParallelProcessing, St. Charles, Illinois, August 1994, pp. 2:73-76.Abstract ...........Postscript
Another approach is based on a recursive poset logic described in
A. I. Tomlinson, V. K. Garg, Observation of Software for Distributed Systems with RCL,Proc. 15th Conference on the Foundations of SoftwareTechnology & Theoretical Computer Science, Bangalore, India, Lecture Notes in Computer Science1026, Springer-Verlag, Dec. 1995, pp. 195 - 209.Abstract ...........Postscript