Skip to Content.
Sympa Menu

maude-help - Re: [Maude-help] Wadler's expression problem and Maude

maude-help AT lists.cs.illinois.edu

Subject: Maude-help mailing list

List archive

Re: [Maude-help] Wadler's expression problem and Maude


Chronological Thread 
  • From: pbrowne <Patrick.Browne AT comp.dit.ie>
  • To: Michael Katelman <katelman AT uiuc.edu>
  • Cc: maude-help AT cs.uiuc.edu
  • Subject: Re: [Maude-help] Wadler's expression problem and Maude
  • Date: Thu, 31 Dec 2009 21:49:21 +0000
  • List-archive: <http://lists.cs.uiuc.edu/mailman/private/maude-help>
  • List-id: <maude-help.cs.uiuc.edu>

Michael,
The expression problem can be described as the ability to add new
variants (either constructors or methods) to a data type (or sort)
without changing the existing code. The Haskell and OO language issues
are well described at:
http://stackoverflow.com/questions/870919/why-are-haskell-algebraic-data-types-closed


With respect to Maude, here is my current *opinion*
I *think* Maude supports subsort polymorphism that allows us to use
elements of a subsort in the function’s rank (arity and co-arity).
I *think* the Maude allows functions to be inherited and overridden in a
subsort (a bit like overriding and inheritance in object oriented
languages methods).
Therefore I *think* that a Maude sort can be extended by subsorting and
adding a new method.

I *think* that a new constructor could be added to an existing sort by
importing in a using rather than protecting mode.
So I (perhaps incorrectly) conclude that Maude does not suffer from the
expression problem.


!!!!Happy new year to all on the Maude list!!!!
Pat



Michael Katelman wrote:
> Pat,
>
> Could you clarify exactly what the "expression problem" is? I am
> having difficulty following the wikipedia entry.
>
> Since you mentioned type classes (a la Haskell), perhaps it's relevant
> to note that while ad-hoc overloading of functions is allowed in
> Maude, the situation is somewhat different from Haskell's type
> classes. Haskell's type classes are used to support a sort of
> restricted polymorphism where the type signature quantifies over a
> subset of all types with the same overloaded operators, but the
> "type-system" of Maude is not polymorphic; in the sense that the
> signatures of functions cannot have universal quantifiers over
> "types", like in Haskell.
>
> At least that's my take on how the two are related.
>
> -Mike
>
> On Thu, Dec 31, 2009 at 5:44 AM, pbrowne
> <Patrick.Browne AT comp.dit.ie>
> wrote:
>> hi,
>> I have a question concerning Wadler's expression problem[1] for
>> algebraic data types. In relation to Haskells type classes is easy to
>> add a new operations on existing data types, it requires only the
>> definition of a new function. All the old functions on those types
>> continue to work unchanged. On the other hand, it is difficult to add
>> new structure to an existing data type: it requires the addition of a
>> new constructor for the existing data type.
>>
>> Questions:
>> 1)Does expression problem exist in Maude?
>> 2)If it does not exist in Maude, is there an illustrative example
>> available?
>>
>>
>> Pat
>>
>> [1]http://en.wikipedia.org/wiki/Expression_Problem
>>
>> _______________________________________________
>> Maude-help mailing list
>> Maude-help AT cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/maude-help
>>
> _______________________________________________
> 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