Skip to Content.
Sympa Menu

maude-help - Re: [Maude-help] A problem with Typed Lists

maude-help AT lists.cs.illinois.edu

Subject: Maude-help mailing list

List archive

Re: [Maude-help] A problem with Typed Lists


Chronological Thread 
  • From: Daniel Romero <danielomarromero AT gmail.com>
  • To: "maude-help AT cs.uiuc.edu" <maude-help AT cs.uiuc.edu>
  • Subject: Re: [Maude-help] A problem with Typed Lists
  • Date: Sun, 01 Aug 2010 11:38:31 +0200
  • List-archive: <http://lists.cs.uiuc.edu/pipermail/maude-help>
  • List-id: <maude-help.cs.uiuc.edu>

I checked the code with Maude 2.4 for Linux, and I don't have problem.
The parser of the code is ok.

Do you have problem in the code or in an example?
Can you send the example used?

Daniel Romero

Narsis Amini wrote:
Dear All,
I have the following spec which defines typed lists
but it is not parsed correctly.
I use Maude 2.4 running on a Windows workstation.
would you please help me with this problem?
fmod LIST-CONS{X :: TRIV} is
protecting NAT .
sorts NeList{X} List{X} .
subsort NeList{X} < List{X} .
op [] : -> List{X} [ctor] .
op _:_ : X$Elt List{X} -> NeList{X} [ctor] .
op tail : NeList{X} -> List{X} .
op head : NeList{X} -> X$Elt .
vars E E' : X$Elt .
var N : Nat .
vars L L' L'' : List{X} .
eq tail(E : L) = L .
eq head(E : L) = E .
op _ ++ _ : List{X} List{X} -> List{X} .
op length : List{X} -> Nat .
op reverse : List{X} -> List{X} .
eq [] ++ L = L .
eq (E : L) ++ L' = E : (L ++ L') .
eq length([]) = 0 .
eq length(E : L) = 1 + length(L) .
eq reverse([]) = [] .
eq reverse(E : L) = reverse(L) ++ (E : []) .
endfm
fmod MYCONF is
pr BOOL .
pr INT .
pr FLOAT .
protecting STRING .
inc LIST-CONS { String } .
protecting META-LEVEL .
sorts Msg MsgQ event .
op bcastMsg : List{String} Msg -> Msg .
endfm


------------------------------------------------------------------------

_______________________________________________
Maude-help mailing list
Maude-help AT cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/maude-help





Archive powered by MHonArc 2.6.16.

Top of Page