[project @ 2003-12-17 11:29:40 by simonpj]
-----------------------------------------------------
Fix a subtle loop in the context-reduction machinery
----------------------------------------------------
This bug was provoked by a recent change: when trying to prove
a constraint C, TcSimplify.reduce now adds C to the database before
trying to prove C, thus building recursive dictionaries.
Two bugs
a) If we add C's superclasses (which we were) we can now build a
bogusly-recursive dictionary (see Note [SUPERCLASS-LOOP]).
Solution: in reduce, add C only (via addIrred NoSCs) and then
later use addWanted to add its definition plus SCs.
b) Since we can have recursive definitions, the superclass-loop
handling machinery (findAllDeps) must carry its visited-set
with it (which it was not doing before)
The main file is TcSimplify; but I modified a bunch of others to
take advantage of new function extendVarSetList