maude-help AT lists.siebelschool.illinois.edu
Subject: Maude-help mailing list
List archive
- From: Marc Boyer <Marc.Boyer AT onera.fr>
- To: Francisco Durán <duran AT lcc.uma.es>
- Cc: maude-help AT cs.uiuc.edu
- Subject: Re: [Maude-help] Parametrized list and subsorting...
- Date: Mon, 18 Jan 2010 16:42:27 +0100
- List-archive: <http://lists.cs.uiuc.edu/pipermail/maude-help>
- List-id: <maude-help.cs.uiuc.edu>
Francisco Durán a écrit :
I think that it is just that your list should be of sort List{NAT-COND-LTH}.
Yes, but I could want, in some part of the code, to
filter out the elements wrt a condition (<= 6) and
sometime latter, with another (odd numbers).
The problem is that I have a data structure (List)
and some common algorithms (sorting, filtering), and
I have to encode the alorithm in the sort/type.
But the problem seems to be even worst with LIST
and SORTABLE-LIST in Maude.
The following code works fine
fmod TEST-SORT-LIST is
protecting SORTABLE-LIST{Nat<} .
op l : -> List{Nat<} .
eq l = 3 4 2 8 6 9 3 2 .
endfm
red sort( l ) .
but this one no more does
fmod TEST-SORT-LIST is
protecting LIST{Nat} .
protecting SORTABLE-LIST{Nat<} .
op l : -> List{Nat<} .
eq l = 3 4 2 8 6 9 3 2 .
endfm
red sort( l ) .
neither this one
fmod TEST-SORT-LIST is
protecting LIST{Nat} .
protecting SORTABLE-LIST{Nat<} .
subsort List{Nat} < List{Nat<} .
op l : -> List{Nat<} .
eq l = 3 4 2 8 6 9 3 2 .
endfm
red sort( l ) .
--
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
- [Maude-help] Parametrized list and subsorting..., Marc Boyer, 01/18/2010
- Re: [Maude-help] Parametrized list and subsorting..., Francisco Durán, 01/18/2010
- Re: [Maude-help] Parametrized list and subsorting..., Marc Boyer, 01/18/2010
- Re: [Maude-help] Parametrized list and subsorting..., Francisco Durán, 01/18/2010
Archive powered by MHonArc 2.6.16.