Skip to Content.
Sympa Menu

maude-help - Re: [Maude-help] list of objects in object moduls

maude-help AT lists.cs.illinois.edu

Subject: Maude-help mailing list

List archive

Re: [Maude-help] list of objects in object moduls


Chronological Thread 
  • From: Francisco Durán <duran AT lcc.uma.es>
  • To: Petr Vrchlavsky <vrchlavsky.petr AT gmail.com>
  • Cc: maude-help AT cs.uiuc.edu
  • Subject: Re: [Maude-help] list of objects in object moduls
  • Date: Mon, 26 Nov 2012 23:56:16 +0100
  • List-archive: <http://lists.cs.uiuc.edu/pipermail/maude-help/>
  • List-id: <maude-help.cs.uiuc.edu>

Hi Petr,

I'd keep the wheels as a lists of oids (references to these wheel objects).

(omod CAR is
pr LIST{Oid} . ---- there is a predefined view Oid in Maude from TRIV
to CONFIGURATION

class Car | wheel : List{Oid} .

You can then make sure that these four references are actually to wheel
object with a membership.

Best regards,

Francisco


On 26/11/2012, at 21:13, Petr Vrchlavsky wrote:

> Hi,
>
> I am new to the Maude and I come across a problem. I am trying to model ORM
> system with some data evolution features. I choose to use object-orientet
> maude.
> I cannot find out how to model list of objects in an example below there is
> a car which should have a collection of wheels. I would like to model this
> by a list of wheels, something like an array list in Java.
> Can you pleas give me an example how to model a list of wheels inside CAR
> modul? Thanx.
>
> (omod WHEEL is
>
> pr QID .
>
> subsort Qid < Oid .
>
> sort WheelSize .
> ops small big : -> WheelSize [ctor] .
> class Wheel | type : WheelSize .
>
> sort Decoration .
> ops nice bad : -> Decoration [ctor] .
> class DecoratedWheel | decoration : Decoration .
>
> subclass DecoratedWheel < Wheel .
>
> endom)
>
> (omod CAR is
>
> pr WHEEL .
> pr QID .
>
> subsort Qid < Oid .
> subsort WheelSize < Msg .
>
> class Car | wheel : Oid .
>
> msg getWheel : Oid -> Msg .
>
> vars M N : Oid .
> var W : Wheel .
> var D : Decoration .
> var S : WheelSize .
> var W : Wheel .
> var WS : WheelSize .
> var D : Decoration .
>
> rl [getWheel] : getWheel(M) < M : Car | wheel : N > < N : Wheel | >
> => < N : Wheel | > .
>
> msg getWheelSize : Oid -> WheelSize .
>
> rl [getWheelSize] : getWheelSize(M) < M : Wheel | type : WS > => WS .
>
> endom
> _______________________________________________
> 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