X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=execution.cc;h=53aa5212f0b017622d0c284f1cbc765e0620fddd;hb=26010e1410faa0dcefc8d384872bc0210cc0be92;hp=07866fe804a308054c716ae4eb92ba146cd53e15;hpb=fb6d374952284313141eaee75ecd322209d152db;p=model-checker.git diff --git a/execution.cc b/execution.cc index 07866fe..53aa521 100644 --- a/execution.cc +++ b/execution.cc @@ -755,12 +755,13 @@ bool ModelExecution::process_mutex(ModelAction *curr) /** * @brief Check if the current pending promises allow a future value to be sent * - * If one of the following is true: - * (a) there are no pending promises - * (b) the reader and writer do not cross any promises - * Then, it is safe to pass a future value back now. + * It is unsafe to pass a future value back if there exists a pending promise Pr + * such that: * - * Otherwise, we must save the pending future value until (a) or (b) is true + * reader --exec-> Pr --exec-> writer + * + * If such Pr exists, we must save the pending future value until Pr is + * resolved. * * @param writer The operation which sends the future value. Must be a write. * @param reader The operation which will observe the value. Must be a read. @@ -769,8 +770,6 @@ bool ModelExecution::process_mutex(ModelAction *curr) bool ModelExecution::promises_may_allow(const ModelAction *writer, const ModelAction *reader) const { - if (promises.empty()) - return true; for (int i = promises.size() - 1; i >= 0; i--) { ModelAction *pr = promises[i]->get_reader(0); //reader is after promise...doesn't cross any promise @@ -1820,6 +1819,7 @@ bool ModelExecution::thin_air_constraint_may_allow(const ModelAction *writer, co * require compiler support): * * If X --hb-> Y --mo-> Z, then X should not read from Z. + * If X --hb-> Y, A --rf-> Y, and A --mo-> Z, then X should not read from Z. */ bool ModelExecution::mo_may_allow(const ModelAction *writer, const ModelAction *reader) {