Hi,
depending on what the plugin does, it is not too hard to get into a loop. For example, the plugin could keep generating things like: x > 5, x + 1 > 5, x + 2 > 5, x + 3 > 5. Of course, this is not a good plan, but one has to be careful to avoid doing it accidentally. I think that a good general guideline for plugin behavior is like this:
- Avoid generating new variables
- Only generate constrains of the form: `x = y` or `x = K`: these always make things more defined and could help another solver to make progress
- These two ensure that eventually you will run out of new things to generate.
- It is occasionally useful to also generate more complex equations: (e.g. x = y + 1), but then one needs to be careful to ensure progress.
Despite this, I also don't think that plugins need to be told how many times they've been called: it seems hard for a plugin author to know what to do with this number. Besides, a buggy plugin could also get stuck in loops in other ways (e.g., get stuck in some internal loop, without going back to GHC).
-Iavor