Skip to Content.
Sympa Menu

maude-help - [Maude-help] Problem defining operations with objects in full Maude

maude-help AT lists.cs.illinois.edu

Subject: Maude-help mailing list

List archive

[Maude-help] Problem defining operations with objects in full Maude


Chronological Thread 
  • From: Alanna Zito <zito AT cs.queensu.ca>
  • To: maude-help AT peepal.cs.uiuc.edu
  • Cc:
  • Subject: [Maude-help] Problem defining operations with objects in full Maude
  • Date: Tue, 30 May 2006 14:56:08 -0400
  • List-archive: <http://maude.cs.uiuc.edu/pipermail/maude-help>
  • List-id: Maude help list <maude-help.maude.cs.uiuc.edu>


I am trying to define some operations that take two objects and return true if the objects match or are equal (based on certain criteria). I have been able to define similar operations and equations that take sorts, but when I try to do something equivalent with classes, I get a parse error when I try to load the module - I can't figure out if it's just a syntax error that I'm missing, or if I'm trying to do something illegal. Here is a simple example of what I am trying to do (where two Properties "match" if they have the same value for the attribute "lower"):

(omod TEST is
protecting BOOL .
protecting NAT .
class Property | lower : Nat .
op matches : Property Property -> Bool .

vars P1, P2 : Oid .
var L : Nat .

eq matches ( < P1 : Property | lower : L > , < P2 : Property | lower : L > ) = true .
eq matches ( X:Property , Y:Property ) = false [owise] .
endom)

This gives the error

Warning: Parse error in (matches(< <---*HERE*
Error: no parse for eq matches(< P1 : Property | lower : L >,< P2 : Property |
lower : L >) ~ true

Does anyone know what I'm doing wrong, or if there's a better way to do this?

Thank you,

Alanna









Archive powered by MHonArc 2.6.16.

Top of Page