the translation into CHRs would be something like:
class C a b | a -> b
instance ctxt => C t1 t2
-->
C a b <=> infer_C a b, memo_C a b. (two roles)
infer_C a b <=> ctxt. (instance inference)
memo_C a b1, memo_C a b2 => b1=b2. (class FD)
so there'd be one preparatory inference rule to split all constraints
occurring in the process into their two roles, one inference rule for
each instance declaration, and one propagation rule for each FD.
the CHR succeeds if there are no non-memo constraints left.
to avoid misunderstandings: this is not yet complete. it is sufficient
for the example from the paper, because the FD-based improvements
there are triggered by the two goal constraints, but the translation also
needs to account for FD-related information taken from the instance
declarations.
claus
_______________________________________________
Haskell-prime mailing list
Haskell-prime@haskell.org
http://haskell.org/mailman/listinfo/haskell-prime