I wonder if this cascade of IF ELSE could be replaced by something similar to this:
```
bool need_of_change = td ? (s->valid == BUSY || s->valid == VALID) : (s->valid == TDBUSY || s->valid == TDVALID));
if (need_of_change) {
		int delta = td : -1 : 1;
		chunk_state_change(c->goal, c->goal,
			c->allvalidcopies, c->allvalidcopies,
			c->regularvalidcopies, c->regularvalidcopies + delta);
		c->regularvalidcopies += delta;
}
switch(s->valid) {
	VALIID:
	TDVALID:
		s->valid = td ? TDVALID : VALID; 
		break;
	TDBUSY:
	BUSY:	s->valid = td ? TDBUSY : BUSY; 
		break;
}


```