Re: FDs and confluence

2006-04-15 Thread Iavor Diatchki
Hello, On 4/13/06, Ross Paterson <[EMAIL PROTECTED]> wrote: > They are equivalent, but C [a] b d, Num c and C [a] c d, Num c are not. I agree that this is the case if you are thinking of "forall a b c d. (C [a] b d, Num c) <=> (C [a] c d, Num c)" Here is a counter example (assume we also add an i

Re: FDs and confluence

2006-04-13 Thread Ross Paterson
On Thu, Apr 13, 2006 at 05:10:36PM -0700, Iavor Diatchki wrote: > > > I understand the reduction steps. Are you saying that the problem is > > > that the two sets are not syntactically equal? To me this does not > > > seem important: we just end up with two different ways to say the same > > > t

Re: FDs and confluence

2006-04-13 Thread Iavor Diatchki
Hello, > > I understand the reduction steps. Are you saying that the problem is > > that the two sets are not syntactically equal? To me this does not > > seem important: we just end up with two different ways to say the same > > thing (i.e., they are logically equivalent). > > If c were mentio

Re: FDs and confluence

2006-04-13 Thread Ross Paterson
On Thu, Apr 13, 2006 at 12:07:53PM -0700, Iavor Diatchki wrote: > On 4/12/06, Claus Reinke <[EMAIL PROTECTED]> wrote: > > that's why Ross chose a fresh variable in FD range position: > > in the old translation, the class-based FD improvement rule no > > longer applies after reduction because there'

Re: FDs and confluence

2006-04-13 Thread Iavor Diatchki
Hello, On 4/12/06, Claus Reinke <[EMAIL PROTECTED]> wrote: > that's why Ross chose a fresh variable in FD range position: > in the old translation, the class-based FD improvement rule no > longer applies after reduction because there's only one C constraint > left, and the instance-based FD improv

Re: FDs and confluence

2006-04-13 Thread Tom Schrijvers
On Thu, 13 Apr 2006, Claus Reinke wrote: (btw, in a real implementation, I wouldn't expect the memo constraints to enter the constraint store at all - they are just a CHR-based way to express a memo table, hence the name; as, in fact, I explained before even starting that alternative translati

RE: FDs and confluence

2006-04-13 Thread Simon Peyton-Jones
| there are interesting problems in FDs, but it seems that the confluence | problems were merely problems of the old translation, not anything | inherent in FDs! I really had hoped we had put that phantom to rest. Claus You're doing a lot of work here, which is great. Why not write a paper? Even

Re: FDs and confluence

2006-04-12 Thread Claus Reinke
that's why Ross chose a fresh variable in FD range position: in the old translation, the class-based FD improvement rule no longer applies after reduction because there's only one C constraint left, and the instance-based FD improvement rule will only instantiate the 'b' or 'c' in the constrain

Re: FDs and confluence

2006-04-12 Thread Iavor Diatchki
Hello, I have been trying to follow this discussion, but I cannot quite understand the problem. On 4/10/06, Ross Paterson <[EMAIL PROTECTED]> wrote: > One of the problems with the relaxed coverage condition implemented > by GHC and Hugs is a loss of confluence. Here is a slightly cut-down > versi

Re: FDs and confluence

2006-04-12 Thread Claus Reinke
Do you have a revised set of restrictions on the form of instances? sure, but you won't like them any better now than the last time I mentioned them:-) - as for confluence, none of the restrictions seem necessary without FDs, type class inference proceeds by _matching_ of instance head

Re: FDs and confluence

2006-04-12 Thread Claus Reinke
thanks, Tom! indeed, for that old thread on an alternative translation, which forked from an even older thread, I put aside all my wishlist and simply focussed on removing what I considered anomalies in the operationalisation of type classes with FDs via CHR in the old translation. the CHR re

Re: FDs and confluence

2006-04-12 Thread Tom Schrijvers
On Mon, Apr 10, 2006 at 02:39:18PM +0100, Claus Reinke wrote: class B a b | a -> b class C a b c | a -> b instance B a b => C [a] b Bool Starting from a constraint set C [a] b Bool, C [a] c d, [...] CHR-alt: B a b <=> infer_B a b, memo_B a b. memo_B a b1, memo_B a b2 ==>b1=b2. C a b c <=> i

Re: FDs and confluence

2006-04-12 Thread Ross Paterson
On Mon, Apr 10, 2006 at 02:39:18PM +0100, Claus Reinke wrote: > >class B a b | a -> b > >class C a b c | a -> b > > > >instance B a b => C [a] b Bool > > > >Starting from a constraint set C [a] b Bool, C [a] c d, [...] > > CHR-alt: > > B a b <=> infer_B a b, memo_B a b. > memo_B a b1, memo_B a b2

Re: FDs and confluence

2006-04-11 Thread Ross Paterson
On Mon, Apr 10, 2006 at 06:48:35PM +0100, Claus Reinke wrote: > note also that we are talking about different things here: I am talking > about FD consistency, you are talking about the FD consistency condition. That would explain a few things. > as this example shows once again, there are insta

Re: FDs and confluence

2006-04-10 Thread isaac jones
On Mon, 2006-04-10 at 14:39 +0100, Claus Reinke wrote: > > (see the FunctionalDependencies page for background omitted here) > > which seems to ignore much of the discussion of confluence we had > here some weeks ago? I thought this list was for communication with > the committee, and since the

Re: FDs and confluence

2006-04-10 Thread tom . schrijvers
On Mon, 10 Apr 2006, Claus Reinke wrote: (see the FunctionalDependencies page for background omitted here) which seems to ignore much of the discussion of confluence we had here some weeks ago? I thought this list was for communication with the committee, and since the ticket exists, I had b

Re: FDs and confluence

2006-04-10 Thread Claus Reinke
there is no implication that d=Bool (you could add: 'instance B a b => C [a] b Char' without violating FD consistency). These instances (alpha-renamed): instance B a1 b1 => C [a1] b1 Bool instance B a2 b2 => C [a2] b2 Char violate the consistency condition: a substitution that unifies a1 and a

RE: FDs and confluence

2006-04-10 Thread Simon Peyton-Jones
Interesting! It'd be great if you've found a simpler more uniform rule. (Which you seem to be getting rather good at.)Let's see if you can convince Martin, first, and then articulate the proposed rules. I'll look fwd to that. Simon | -Original Message- | From: [EMAIL PROTECTED] [mai

Re: FDs and confluence

2006-04-10 Thread Ross Paterson
On Mon, Apr 10, 2006 at 02:39:18PM +0100, Claus Reinke wrote: > >instance B a b => C [a] b Bool > > > >Starting from a constraint set C [a] b Bool, C [a] c d, > > there is no implication that d=Bool > (you could add: 'instance B a b => C [a] b Char' without violating > FD consistency). These inst

Re: FDs and confluence

2006-04-10 Thread Claus Reinke
(see the FunctionalDependencies page for background omitted here) which seems to ignore much of the discussion of confluence we had here some weeks ago? I thought this list was for communication with the committee, and since the ticket exists, I had been hoping that the type class subcommitte

Re: FDs and confluence

2006-04-10 Thread Ross Paterson
On Mon, Apr 10, 2006 at 05:49:15PM +0800, Martin Sulzmann wrote: > Ross Paterson writes: > > 1) consider the two constraint sets equivalent, since they describe > >the same set of ground instances, or > > That's troublesome for (complete) type inference. > Two constraint stores are equivalen