set_backtracking(curr);
}
-/** @returns whether the current trace is feasible. */
+/** @returns whether the current partial trace is feasible. */
bool ModelChecker::isfeasible() {
return !cyclegraph->checkForCycles() && !failed_promise;
}
-/** Returns whether the current trace is feasible. */
+/** Returns whether the current completed trace is feasible. */
bool ModelChecker::isfinalfeasible() {
return isfeasible() && promises->size()==0;
}
}
-/** Resolve promises. */
+/** Resolve the given promises. */
void ModelChecker::resolve_promises(ModelAction *write) {
for(unsigned int i=0, promise_index=0;promise_index<promises->size(); i++) {
}
}
+/** Compute the set of promises that could potentially be satisfied by
+ * this action. */
+
void ModelChecker::compute_promises(ModelAction *curr) {
for(unsigned int i=0;i<promises->size();i++) {
Promise * promise=(*promises)[i];
(*it)->print();
}
+/** This method sets a promise to explore meeting with the given
+ * node.
+ * @param i is the promise index.
+ */
+
void Node::set_promise(uint32_t i) {
if (i>=promises.size())
promises.resize(i+1,0);
promises[i]=1;
}
+/** This method looks up whether a given promise should be satisfied
+ * by this node.
+ *
+ * @param i is the promise index.
+ * @return true if the promise should be satisfied by the given model action.
+ */
+
bool Node::get_promise(uint32_t i) {
return (promises[i]==2);
}
+/** This method increments to the next combination of promises.
+ *
+ * @return true if we have a valid combination.
+ */
+
bool Node::increment_promise() {
for (unsigned int i=0;i<promises.size();i++) {
if (promises[i]==1) {
return false;
}
+/** This method returns whether the promise set is empty.
+ *
+ * @return true if we have explored all promise combinations.
+ */
+
bool Node::promise_empty() {
for (unsigned int i=0;i<promises.size();i++)
if (promises[i]==1)