model: add write-to-promise edges
authorBrian Norris <banorris@uci.edu>
Tue, 5 Feb 2013 22:10:06 +0000 (14:10 -0800)
committerBrian Norris <banorris@uci.edu>
Wed, 6 Feb 2013 21:44:39 +0000 (13:44 -0800)
Assume that any time a promise exists, is compatible with a store, and
is exclusive to the same thread as the store, that it is mod-ordered
after that store. This should never produce cycles, until we decide to
begin satisfying promises. At that point, if there's a cycle, then we
must either merge nodes (i.e., the store must satisfy that promise) or
else we discard the execution for the moment and perform the
satisfaction at a later point in the search space.

model.cc

index 6739d2c85ee2ca51dd3963c471c811e12f0711b3..691ab832519d11dff2515dfe313884da05ef7382 100644 (file)
--- a/model.cc
+++ b/model.cc
@@ -1808,6 +1808,15 @@ bool ModelChecker::w_modification_order(ModelAction *curr)
                }
        }
 
+       /*
+        * All compatible, thread-exclusive promises must be ordered after any
+        * concrete stores to the same thread, or else they can be merged with
+        * this store later
+        */
+       for (unsigned int i = 0; i < promises->size(); i++)
+               if ((*promises)[i]->is_compatible_exclusive(curr))
+                       added = mo_graph->addEdge(curr, (*promises)[i]) || added;
+
        return added;
 }