maude-help AT lists.siebelschool.illinois.edu
Subject: Maude-help mailing list
List archive
- From: Steven Eker <eker AT csl.sri.com>
- To: maude-help AT cs.uiuc.edu
- Cc: Marc Boyer <Marc.Boyer AT onera.fr>
- Subject: Re: [Maude-help] Opposite sorting: a bug in the SORTABLE-LIST code ?
- Date: Mon, 22 Mar 2010 16:41:00 -0700
- List-archive: <http://lists.cs.uiuc.edu/pipermail/maude-help>
- List-id: <maude-help.cs.uiuc.edu>
Your first view does not map the infix < operator; what you probably intended
was:
view Nat> from STRICT-TOTAL-ORDER to NAT is
sort Elt to Nat .
op _<_ to _>_ .
endv
Steven
On Friday 19 March 2010, Marc Boyer wrote:
> Dear all,
>
> I was tring to sort a list of Nat in reverse order, but I can't
> make it works...
>
> Here is a minimal example:
>
> **** Defining a view were the order is the reverse of
> view Nat> from STRICT-TOTAL-ORDER to NAT is
> sort Elt to Nat .
> op < to > .
> endv
>
> **** Testing
> fmod REV-SORT-NAT is
> protecting SORTABLE-LIST{Nat>} .
> op l> : -> List{Nat>} .
> eq l> = 1 3 .
> endfm
>
> red sort( l> ) .
>
> *** The output is
> result NeList{Nat>}: 1 3
>
> But if I replace the view definition by
>
> view Nat> from STRICT-TOTAL-ORDER to NAT is
> sort Elt to Nat .
> op X:Elt < Y:Elt to term ( X:Nat > Y:Nat ).
> endv
>
> Then, it works...
>
> What's appening ?
>
> Regards,
> Marc Boyer
>
- [Maude-help] Opposite sorting: a bug in the SORTABLE-LIST code ?, Marc Boyer, 03/19/2010
- Re: [Maude-help] Opposite sorting: a bug in the SORTABLE-LIST code ?, Steven Eker, 03/22/2010
Archive powered by MHonArc 2.6.16.