| 193 | |
| 194 | template<class Tracer> |
| 195 | forceinline void |
| 196 | Path<Tracer>::unwind(int l, Tracer& t) { |
| 197 | assert((ds[l].space() == nullptr) || ds[l].space()->failed()); |
| 198 | int n = ds.entries(); |
| 199 | if (t) { |
| 200 | for (int i=l; i<n; i++) { |
| 201 | Path<Tracer>::Edge& top = ds.top(); |
| 202 | unsigned int fa = (i != l) ? top.alt() + 1 : top.alt(); |
| 203 | for (unsigned int a = fa; a < top.choice()->alternatives(); a++) { |
| 204 | SearchTracer::EdgeInfo ei(t.wid(),top.nid(),a); |
| 205 | t.skip(ei); |
| 206 | } |
| 207 | ds.pop().dispose(); |
| 208 | } |
| 209 | } else { |
| 210 | for (int i=l; i<n; i++) |
| 211 | ds.pop().dispose(); |
| 212 | } |
| 213 | assert(ds.entries() == l); |
| 214 | } |
| 215 | |
| 216 | template<class Tracer> |
| 217 | inline void |