[Maude-help] Opposite sorting: a bug in the SORTABLE-LIST code ?
Marc Boyer
Marc.Boyer at onera.fr
Fri Mar 19 07:30:38 CDT 2010
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
--
Marc Boyer, Ingenieur de recherche ONERA
Tel: (33) 5.62.25.26.36 DTIM
Fax: (33) 5.62.25.26.52 2, av Edouard Belin
http://www.onera.fr/staff/marc-boyer/ 31055 TOULOUSE Cedex 4
More information about the Maude-help
mailing list