From: Brian Norris Date: Fri, 20 Apr 2012 17:35:16 +0000 (-0700) Subject: model: add iteration routines for class Backtrack X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=cd3c3b85485b68891c2024b50c08443736aa7268;p=cdsspec-compiler.git model: add iteration routines for class Backtrack --- diff --git a/model.h b/model.h index 54144f3..db13601 100644 --- a/model.h +++ b/model.h @@ -49,15 +49,19 @@ public: Backtrack(ModelAction *d, action_list_t *t) { diverge = d; actionTrace = t; - //currentIterator = actionTrace->getFirst(); + iter = actionTrace->begin(); } ModelAction *get_diverge() { return diverge; } action_list_t *get_trace() { return actionTrace; } + void advance_state() { iter++; } + ModelAction *get_state() { + return iter == actionTrace->end() ? NULL : *iter; + } private: ModelAction *diverge; - /* unused for now; will be used when re-exploring this path? */ - //MyListElement *currentIterator; action_list_t *actionTrace; + /* points to position in actionTrace as we replay */ + action_list_t::iterator iter; }; class ModelChecker {