Skip to Content.
Sympa Menu

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

maude-help AT lists.cs.illinois.edu

Subject: Maude-help mailing list

List archive

[Maude-help] A problem with Typed Lists


Chronological Thread 
  • From: Narsis Amini <narsisa90 AT yahoo.com>
  • To: maude-help AT cs.uiuc.edu
  • Subject: [Maude-help] A problem with Typed Lists
  • Date: Sun, 1 Aug 2010 01:40:24 -0700 (PDT)
  • List-archive: <http://lists.cs.uiuc.edu/pipermail/maude-help>
  • List-id: <maude-help.cs.uiuc.edu>

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




Archive powered by MHonArc 2.6.16.

Top of Page