KRunState: handling the case that the result term can be non-ground, which is often the case for test generation