Skip to Content.
Sympa Menu

maude-help - Re: [Maude-help] metaXmatch & getContext

maude-help AT lists.cs.illinois.edu

Subject: Maude-help mailing list

List archive

Re: [Maude-help] metaXmatch & getContext


Chronological Thread 
  • From: "Pierre Fourès" <pierre.foures AT gmail.com>
  • To: "Francisco Durán" <duran AT lcc.uma.es>
  • Cc: Maude Help Mailing List <maude-help AT maude.cs.uiuc.edu>
  • Subject: Re: [Maude-help] metaXmatch & getContext
  • Date: Thu, 18 Dec 2008 15:26:18 +0100
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:references; b=Bsp32vl+5rECp7lnJxBR3//Jh2wPSIb8HCxTZ2EdQZoXjUC20o4AsC6Ru3wRin/VQQ 2SbJiem0xr4NBHgezdB85kezisAg5Sh9a2kylg8quhwRnAKU6mCv/ZISWT/G6hQN/2nH DGKgUmdy6WLha2BNIhjNymBSxOFkCy3qCDe64=
  • List-archive: <http://maude.cs.uiuc.edu/pipermail/maude-help>
  • List-id: Maude help list <maude-help.maude.cs.uiuc.edu>

Thanks Francisco,


This was quite obvious indeed but i couldn't get my mind to work it out. I'm quite new to maude and rewriting logic and often block on easy issues. I think this was the "getContext()" who made me think like in object oriented programming and confused me while using the rewriting logic.


By the way, I now use the substituted values found by the metaXmatch instead of simply replacing the [] by 'nullThread.Thread]. I proceed quite the same way as you did and I got this :


    op getSubst : Substitution Variable -> Term .


    ceq getSubst((Sub ; Sub'), V)

      = (getSubst(Sub, V); getSubst(Sub', V))

      if Sub =/= none /\ Sub' =/= none .


    eq getSubst((V <- T), V) = T .

    eq getSubst(Sub, V) = none [owise] .


And I use it like that :  getSubst(getSubstitution(tmpMatch), 'Tb:Trans) to retrieve the value.


It works fine this way but I was wondering if it was the by way to achieve it or if it's a cleaner way to retrieve the values ?


Thanks again for unlocking me,


Regards,

Pierre Fourès.



2008/12/16 Francisco Durán <duran AT lcc.uma.es>
The important equation was missing...


fmod FOO is
 pr META-LEVEL .

 var F : Qid .
 var C : Constant .
 var V : Variable .
 vars GTL GTL' : GTermList .
 var T : Term .

 op newTerm : Context Term -> Term .
 eq newTerm(F[GTL], T) = F[newTerm(GTL, T)] .
 eq newTerm(C, T) = C .
 eq newTerm(V, T) = V .
 eq newTerm([], T) = T .

 ceq newTerm((GTL, GTL'), T)
   = (newTerm(GTL, T), newTerm(GTL', T))
   if GTL =/= empty /\ GTL' =/= empty .
endfm

red newTerm('`[_`,_`,_`]['null.Marking,'nullTransition.Trans,[]], 'nullThread.Thread) .

Paco





Archive powered by MHonArc 2.6.16.

Top of Page