Skip to Content.
Sympa Menu

maude-help - Re: [Maude-help] abstract data types

maude-help AT lists.cs.illinois.edu

Subject: Maude-help mailing list

List archive

Re: [Maude-help] abstract data types


Chronological Thread 
  • From: Marc Boyer <Marc.Boyer AT onera.fr>
  • To: Morandi Benjamin <benjamin.morandi AT inf.ethz.ch>
  • Cc: "maude-help AT cs.uiuc.edu" <maude-help AT cs.uiuc.edu>
  • Subject: Re: [Maude-help] abstract data types
  • Date: Mon, 29 Aug 2011 14:42:02 +0200
  • List-archive: <http://lists.cs.uiuc.edu/pipermail/maude-help>
  • List-id: <maude-help.cs.uiuc.edu>

Le 25/08/2011 17:49, Morandi Benjamin a écrit :
We are implementing a structural operational semantics in Maude. In this
semantics, the state of a program is modeled as an abstract data type
(ADT). The ADT consists of constructors that return a new ADT instance,
queries that take an ADT instance to return the state of the instance,
and commands that take an ADT instance to return another ADT instance
with a modified state. Axioms describe the effect of constructors,
commands, and queries.

The OBJECT ADT serves as an example. It has the following query
returning the type of an object:

type: TYPE

It also has a constructor that creates a new instance with a certain type t:

make: TYPE -> OBJECT

axioms

type (make (t:TYPE)) = t

I understand that I should define a functional module for the OBJECT
ADT. However, I am not sure how to implement the ADT axioms. Does anyone
have a suggestion?

I do not know exactly what is your complete need, but here is a simple example that seems to match you example.

fmod ADT is

sort Type .
sort Object .

op make : Type -> Object .
op type : Object -> Type .

ops int float : -> Type .

var t : Type .
eq type( make( t ) ) = t .
endfm

red type( make( int ) ) .
red type( make( float ) ) .


--
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




Archive powered by MHonArc 2.6.16.

Top of Page