promise: add Promise::get_index function
[model-checker.git] / promise.cc
index 26a1095f4440a4b65d80dd67917da2f423ab28fe..29e261f04086dca1891d12934bb75596af03000a 100644 (file)
@@ -166,3 +166,9 @@ bool Promise::same_location(const ModelAction *act) const
 {
        return get_reader(0)->same_var(act);
 }
+
+/** @brief Get this Promise's index within the execution's promise array */
+int Promise::get_index() const
+{
+       return model->get_promise_number(this);
+}