+ * Returns whether the promise set is empty.
+ * @return true if we have explored all promise combinations.
+ */
+bool Node::promise_empty() const
+{
+ for (int i = resolve_promise_idx + 1; i < (int)resolve_promise.size(); i++)
+ if (i >= 0 && resolve_promise[i])
+ return false;
+ return true;
+}
+
+/** @brief Clear any promise-resolution information for this Node */
+void Node::clear_promise_resolutions()
+{
+ resolve_promise.clear();
+ resolve_promise_idx = -1;
+}
+
+/******************************* end promise **********************************/
+
+void Node::set_misc_max(int i)
+{
+ misc_max = i;
+}
+
+int Node::get_misc() const
+{
+ return misc_index;
+}
+
+bool Node::increment_misc()
+{
+ return (misc_index < misc_max) && ((++misc_index) < misc_max);
+}
+
+bool Node::misc_empty() const
+{
+ return (misc_index + 1) >= misc_max;
+}
+
+bool Node::is_enabled(Thread *t) const
+{
+ int thread_id = id_to_int(t->get_id());
+ return thread_id < num_threads && (enabled_array[thread_id] != THREAD_DISABLED);
+}
+
+enabled_type_t Node::enabled_status(thread_id_t tid) const
+{
+ int thread_id = id_to_int(tid);
+ if (thread_id < num_threads)
+ return enabled_array[thread_id];
+ else
+ return THREAD_DISABLED;
+}
+
+bool Node::is_enabled(thread_id_t tid) const
+{
+ int thread_id = id_to_int(tid);
+ return thread_id < num_threads && (enabled_array[thread_id] != THREAD_DISABLED);
+}
+
+bool Node::has_priority(thread_id_t tid) const
+{
+ return fairness[id_to_int(tid)].priority;
+}
+
+bool Node::has_priority_over(thread_id_t tid1, thread_id_t tid2) const
+{
+ return get_yield_data(id_to_int(tid1), id_to_int(tid2)) & YIELD_P;
+}
+
+/*********************************** read from ********************************/
+
+/**
+ * Get the current state of the may-read-from set iteration
+ * @return The read-from type we should currently be checking (past or future)
+ */
+read_from_type_t Node::get_read_from_status()
+{
+ if (read_from_status == READ_FROM_PAST && read_from_past.empty())
+ increment_read_from();
+ return read_from_status;
+}
+
+/**
+ * Iterate one step in the may-read-from iteration. This includes a step in
+ * reading from the either the past or the future.
+ * @return True if there is a new read-from to explore; false otherwise
+ */
+bool Node::increment_read_from()
+{
+ clear_promise_resolutions();
+ if (increment_read_from_past()) {
+ read_from_status = READ_FROM_PAST;
+ return true;
+ } else if (increment_read_from_promise()) {
+ read_from_status = READ_FROM_PROMISE;
+ return true;
+ } else if (increment_future_value()) {
+ read_from_status = READ_FROM_FUTURE;
+ return true;
+ }
+ read_from_status = READ_FROM_NONE;
+ return false;
+}
+
+/**
+ * @return True if there are any new read-froms to explore
+ */
+bool Node::read_from_empty() const
+{
+ return read_from_past_empty() &&
+ read_from_promise_empty() &&
+ future_value_empty();
+}
+
+/**
+ * Get the total size of the may-read-from set, including both past and future
+ * values
+ * @return The size of may-read-from
+ */
+unsigned int Node::read_from_size() const
+{
+ return read_from_past.size() +
+ read_from_promises.size() +
+ future_values.size();
+}
+
+/******************************* end read from ********************************/
+
+/****************************** read from past ********************************/
+
+/** @brief Prints info about read_from_past set */
+void Node::print_read_from_past()
+{
+ for (unsigned int i = 0; i < read_from_past.size(); i++)
+ read_from_past[i]->print();
+}
+
+/**
+ * Add an action to the read_from_past set.