nodestack: re-associate ModelAction/Node relationship
authorBrian Norris <banorris@uci.edu>
Mon, 25 Jun 2012 19:07:39 +0000 (12:07 -0700)
committerBrian Norris <banorris@uci.edu>
Mon, 25 Jun 2012 19:07:39 +0000 (12:07 -0700)
commit87273fd76240454e85a233c34b93463fa681480b
tree7fe021702f3e642f64c04b21578b3bd167c10eec
parent2fd874e12b6349b5543b9a3014b38b556c672623
nodestack: re-associate ModelAction/Node relationship

Currently, the Node that is returned by ModelAction::get_node() actually
represents the Node that is parent to the ModelAction. This works well for
some of the backtracking computations (since the backtracking set is held
in the parent Node), but it creates confusion when performing computations
such as the following:

 Node *node;
 ...
 ModelAction *act = node->get_action();
 Node *node2 = act->get_parent();

 ASSERT(node == node2); // Fails
 ASSERT(node->get_parent() == node2); // Succeeds

So this patch changes this behavior so that the first assertion (above)
succeeds and the second one fails. This is probably more desirable in the
long run.
model.cc
nodestack.cc