*To*: cl-isabelle-users at lists.cam.ac.uk*Subject*: Re: [isabelle] Arity limitations of type classes?*From*: Brian Huffman <brianh at cs.pdx.edu>*Date*: Sat, 29 Nov 2008 16:18:02 -0800*In-reply-to*: <492CD723.9070308@cse.unsw.edu.au>*References*: <492CD723.9070308@cse.unsw.edu.au>*User-agent*: Internet Messaging Program (IMP) H3 (4.1.6)

Hi Rafal,

axclass a axclass b axclass c instance bit0 :: (a) b sorry instance bit0 :: (c) b oops (* FAIL *)

axclass a axclass b axclass c instance a < c sorry instance bit0 :: (a) b sorry instance bit0 :: (c) b sorry

axclass a axclass b axclass c axclass a_or_c instance a < a_or_c instance c < a_or_c instance bit0 :: (a_or_c) b sorry instance bit0 :: (a) b sorry instance bit0 :: (c) b sorry Hope this helps, - Brian Quoting Rafal Kolanski <rafalk at cse.unsw.edu.au>:

Greetings, I am working with a situation where I want to state that words with certain properties on their lengths are members of a type class. However, there seems to be no way to state that a type constructor (in this case bit0) takes a type class into two different ones. So if we have words_of_length_2, we can say that: instance bit0 :: (words_of_length_4) words_of_length_2 If the length is 4, then we know it's divisible by 4: instance bit0 :: (words_of_length_2) words_div_4 but also instance bit0 :: (words_div_2) words_div_4 at this point, we are stuck, as the above line will have problems with arity. In general, anything of this form doesn't seem to work: axclass a axclass b axclass c instance bit0 :: (a) b sorry instance bit0 :: (c) b oops (* FAIL *) Looking at the papers didn't really enlighten. Is this a fundamental limitation on type classes? Is there any way to get around it? Yours Sincerely, Rafal Kolanski.

**Follow-Ups**:**Re: [isabelle] Arity limitations of type classes?***From:*Rafal Kolanski

**References**:**[isabelle] Arity limitations of type classes?***From:*Rafal Kolanski

- Previous by Date: [isabelle] conversion in Isabelle
- Next by Date: Re: [isabelle] Arity limitations of type classes?
- Previous by Thread: Re: [isabelle] Arity limitations of type classes?
- Next by Thread: Re: [isabelle] Arity limitations of type classes?
- Cl-isabelle-users November 2008 archives indexes sorted by: [ thread ] [ subject ] [ author ] [ date ]
- Cl-isabelle-users list archive Table of Contents
- More information about the Cl-isabelle-users mailing list