maude-help AT lists.siebelschool.illinois.edu
Subject: Maude-help mailing list
List archive
- From: Francisco Durán <duran AT lcc.uma.es>
- To: Edgar Honing <ephoning AT gmail.com>
- Cc: maude-help AT cs.uiuc.edu
- Subject: Re: [Maude-help] full maude tuples usage
- Date: Thu, 15 Apr 2010 09:53:58 +0200
- List-archive: <http://lists.cs.uiuc.edu/pipermail/maude-help>
- List-id: <maude-help.cs.uiuc.edu>
Hi Edgar,
I don't think you are doing anything wrong, it is just that you are
getting some conflict you need to take care of.
What is happening is that you are getting two operators
op (_,_) : Nat Nat -> Tuple{Nat, Nat} .
op (_,_) : List{Nat} List{Nat} -> Tuple{List{Nat}, List{Nat}} .
for which, as the message given indicates, you have the same domain
kinds but a different range kind. The problem is that if you have a
term like (2, 3) it can be both a Tuple{Nat, Nat} and a
Tuple{List{Nat}, List{Nat}}.
Depending on what you need you may go for making the range sorts
related (Tuple{Nat, Nat} < Tuple{List{Nat}, List{Nat}}) or just making
the operators different, e.g., with
(fmod SOMETYPES is
pr TUPLE[2]{Nat,Nat} .
pr TUPLE[2]{List{Nat},List{Nat}} * (op `(_`,_`) to `[_`,_`]) .
endfm)
Cheers,
Francisco
On Thu, Apr 15, 2010 at 7:34 AM, Edgar Honing
<ephoning AT gmail.com>
wrote:
> Hi,
>
> In the context of trying to implement some standard func. programming idioms
> (such as fold/zip/zipWith/etc.) I have a need for parameterized types/sorts
> for such constructs as lists of 2-tuples and 2-tuples of lists. When trying
> to define these I keep getting presented with the following warning
> (followed up by parsing issues):
>
> Warning: <metalevel>: declaration for `(_`,_`) has the same domain kinds as
> the declaration on <metalevel> but a different range kind.
>
> In order to try and get to the bottom of this I came up with the following
> minimalistic full maude text that results in this same problem:
>
>
> (view List{A :: TRIV} from TRIV to LIST{A} is
> sort Elt to List{A} .
> endv)
>
> (fmod SOMETYPES is
> pr TUPLE[2]{Nat,Nat} .
> pr TUPLE[2]{List{Nat},List{Nat}} .
> endfm)
>
> (red (1,2) .) <- gives parse error
> (red (1 2,3 4) .) <- gives parse error
>
>
> Changing 'pr TUPLE[2]{Nat,Nat} .' to, say, 'pr TUPLE[2]{String,String} .',
> or 'pr TUPLE[2]{Nat,String} .' avoids this "clash" / warning + parsing
> issue.
> Any pointers on what I am doing wrong / how to resolve this would be much
> appreciated!
>
> Thanks much in advance,
> Edgar
>
> _______________________________________________
> Maude-help mailing list
> Maude-help AT cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/maude-help
>
>
- [Maude-help] full maude tuples usage, Edgar Honing, 04/15/2010
- Re: [Maude-help] full maude tuples usage, Francisco Durán, 04/15/2010
- Re: [Maude-help] full maude tuples usage, Edgar Honing, 04/15/2010
- Message not available
- Re: [Maude-help] full maude tuples usage, Francisco Durán, 04/15/2010
- Re: [Maude-help] full maude tuples usage, Edgar Honing, 04/15/2010
- Re: [Maude-help] full maude tuples usage, Francisco Durán, 04/15/2010
- Re: [Maude-help] full maude tuples usage, Francisco Durán, 04/15/2010
Archive powered by MHonArc 2.6.16.