Skip to Content.
Sympa Menu

maude-help - Re: [Maude-help] About TYPE CONVERSION in Maude

maude-help AT lists.cs.illinois.edu

Subject: Maude-help mailing list

List archive

Re: [Maude-help] About TYPE CONVERSION in Maude


Chronological Thread 
  • From: Steven Eker <eker AT csl.sri.com>
  • To: maude-help AT peepal.cs.uiuc.edu
  • Cc: maude-help AT peepal.cs.uiuc.edu
  • Subject: Re: [Maude-help] About TYPE CONVERSION in Maude
  • Date: Mon, 15 Dec 2008 12:40:37 -0800
  • List-archive: <http://maude.cs.uiuc.edu/pipermail/maude-help>
  • List-id: Maude help list <maude-help.maude.cs.uiuc.edu>

On Sunday 14 December 2008 21:25, ZHANG Min wrote:
> Dear ALL:
>
> I'm not sure if it is a stupid question. But I feel trapped in it.
> I'm trying converting a number of Nat into a Qid. How can we do that in
> Maude. Does Maude support such kind of type conversion? For example, how
> can I get a '2 of Qid from the number 2 of Nat? Is there someone giving
> me some hints about it?
>
> Thanks!!

You need to protect both QID and CONVERSION. You convert the Nat to a base 10
String and then convert the string to a Qid:

Maude> fmod FOO is pr QID . pr CONVERSION . endfm
Maude> red qid(string(2, 10)) .
reduce in FOO : qid(string(2, 10)) .
rewrites: 2 in 0ms cpu (0ms real) (~ rewrites/second)
result Qid: '2

Steven




Archive powered by MHonArc 2.6.16.

Top of Page