/**
* @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.
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
if (promises.size() != 0)
ptr += sprintf(ptr, "[unresolved promise]");
if (ptr != buf)
- model_print("%s: %s\n", prefix ? prefix : "Infeasible", buf);
+ model_print("%s: %s", prefix ? prefix : "Infeasible", buf);
}
/**
* 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)
{
dumpGraph(buffername);
#endif
- model_print("Execution %d:", get_execution_number());
+ model_print("Execution trace %d:", get_execution_number());
if (isfeasibleprefix()) {
if (is_yieldblocked())
model_print(" YIELD BLOCKED");
if (scheduler->all_threads_sleeping())
model_print(" SLEEP-SET REDUNDANT");
- model_print("\n");
+ if (have_bug_reports())
+ model_print(" DETECTED BUG(S)");
} else
print_infeasibility(" INFEASIBLE");
+ model_print("\n");
+
print_list(&action_trace);
model_print("\n");
+
if (!promises.empty()) {
model_print("Pending promises:\n");
for (unsigned int i = 0; i < promises.size(); i++) {