Skip to Content.
Sympa Menu

maude-help - Re: [Maude-help] chained rules?

maude-help AT lists.cs.illinois.edu

Subject: Maude-help mailing list

List archive

Re: [Maude-help] chained rules?


Chronological Thread 
  • From: Todd Wilson <twilson AT csufresno.edu>
  • To: Michael George Hart <michael.george.hart AT gmail.com>
  • Cc: maude-help AT cs.uiuc.edu
  • Subject: Re: [Maude-help] chained rules?
  • Date: Tue, 18 May 2010 08:42:24 -0700
  • List-archive: <http://lists.cs.uiuc.edu/pipermail/maude-help>
  • List-id: <maude-help.cs.uiuc.edu>

How many different counters do you need? If it is not many, another
possible solution is to add one extra argument to your constructor(s)
for each counter that you need, have a top-level rule that takes your
original, external constructor and rewrites it to the extended, internal
one with 0s added, and have your rules just increment the counters when
they are less than 3, and finally do a rewrite and reset of the counters
when they reach 3.

Todd Wilson

Francisco Durán wrote, on 05/18/2010 12:56 AM:
> Hi,
>
> The only way I see to do such kind of things is using execution
> strategies. And I think it is not enough with the currently proposed
> strategy language, you'll need to use reflection. There you'l have
> absolute control on the execution process, although you'll have to pay
> the price.
>
> Cheers,
>
> Francisco
>
> On Mon, May 17, 2010 at 4:30 PM, Michael George Hart
> <michael.george.hart AT gmail.com>
> wrote:
>> I too would ber very interested in seeing how this can be done
>> On Monday 17 May 2010 09:24:17 am wilson wrote:
>>> Hello Maude Help,
>>>
>>> Is there an existing way of implementing "chained rules" in Maude?
>>>
>>> What I basically want is the conditional application of a rule depending
>>> on the previous application of another rule.
>>>
>>> For example
>>>
>>> rl [1] : ... .
>>> rl [2] : ... .
>>>
>>> I want rule 2 to be considered only if 1 was applied previously.
>>>
>>> I'm aiming in the long run to be able to "defer" the application of
>>> rewriting rules. For instance, I want a rule to be applied only on the
>>> third application possibility found. Thus I would need to count the
>>> instances the rule could have been applied. In pseudo C formalism,
>>> something like
>>>
>>> rl [mate-non-applied] :
>>> {
>>> equation => equation . --- do nothing
>>> iterator = iterator + 1
>>> }
>>>
>>> crl [mate-applied]:
>>> {
>>> equation => rewritten equation .
>>> iterator = 0
>>> }
>>> if iterator > 2 .
>>>
>>> I must admit, I'm having problems with making the rule "do nothing but
>>> increment the iterator". I could make the iteration a separate
>>> conditional rule, but then I can't make it dependent on the
>>> "application" of the "do nothing" rule(hence, my original question on
>>> "chained rules").
>>>
>>> Could this be done with current Maude? Or do I have to do some tweaking
>>> with the Maude source code?
>>>
>>> Thanks a lot, guys.
>>> _______________________________________________
>>> Maude-help mailing list
>>> Maude-help AT cs.uiuc.edu
>>> http://lists.cs.uiuc.edu/mailman/listinfo/maude-help
>>
>>
>> --
>> I, the unwilling, was led by the unqualified, to do the unbelievable for so
>> long with so little, that I attempted the impossible with nothing......"
>> _______________________________________________
>> 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