Skip to Content.
Sympa Menu

maude-help - Re: [Maude-help] How to set precedence to rule??

maude-help AT lists.cs.illinois.edu

Subject: Maude-help mailing list

List archive

Re: [Maude-help] How to set precedence to rule??


Chronological Thread 
  • From: "Franco Brusatti" <fbrusatti AT gmail.com>
  • To: zhangmin <minzhang AT sjtu.edu.cn>
  • Cc: maude-help <maude-help AT maude.cs.uiuc.edu>
  • Subject: Re: [Maude-help] How to set precedence to rule??
  • Date: Mon, 4 Jun 2007 11:03:19 -0300
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=AnvAzNpbewFCyPsU+nLN7NcVquzJRqIPnT0NWZV9Z1uVdWyI7x80SjC6XR4tQChAfiSrSJAw5RtZUZWHPJfKH3gZCH0kvMKs84zeUx7miwUtp45/xlwTLZo2rScdA6VWFI6pFzNKutPLFwlWZcFEFUMuo3qk8z6DnKo28ALVKwk=
  • List-archive: <http://maude.cs.uiuc.edu/pipermail/maude-help>
  • List-id: Maude help list <maude-help.maude.cs.uiuc.edu>

The precedence can be handled with the attribute "prec" and with the "gathering patterns".

The precedence attribute take a value as an argument. A value greater than other have smaller precedence.

The gathering pattern of an operator restricts the precedences of terms that are allowed as arguments.

* "E" means that the argument must have a precedence value lower or equal that the precedence value of the operator.
* "e" means that the argument must have a precedence value strictly lower than the precedence value of the operator.
* "&" means that the operator allows any precedence value for the corresponding argument.

A simple example

 fmod MY-NAT-3 is
    sort Nat .
    ops 1 2 3 : -> Nat .
    op _+_ : Nat Nat -> Nat [prec 33 gather (E e)] .
    op _*_ : Nat Nat -> Nat [prec 31 gather (E e)] .
  endfm

I hope that this information gives you some help. Greetings

On 6/2/07, zhangmin <minzhang AT sjtu.edu.cn > wrote:
Dear All:

I'm designing a module which has several rule and conditional rule. If two or more rules can be executed at the same time, I want one of them is executed while others are not executed. How can I achieve this? Any advice will be appreciated.

zhangmin
minzhang AT sjtu.edu.cn
2007-06-02

_______________________________________________
Maude-help mailing list
Maude-help AT maude.cs.uiuc.edu
http://maude.cs.uiuc.edu/cgi-bin/mailman/listinfo/maude-help




--
--
Chino Brusatti


Archive powered by MHonArc 2.6.16.

Top of Page