Skip to Content.
Sympa Menu

maude-help - [Maude-help] why have syntax error when same as example in book

maude-help AT lists.cs.illinois.edu

Subject: Maude-help mailing list

List archive

[Maude-help] why have syntax error when same as example in book


Chronological Thread 
  • From: Lee Martin CCNP <tesleft AT hotmail.com>
  • To: "maude-help AT cs.uiuc.edu" <maude-help AT cs.uiuc.edu>
  • Subject: [Maude-help] why have syntax error when same as example in book
  • Date: Thu, 8 May 2014 21:44:56 +0800
  • Importance: Normal
  • List-archive: <http://lists.cs.uiuc.edu/pipermail/maude-help/>
  • List-id: <maude-help.cs.uiuc.edu>

book All about maude page 133

Maude> load vend2.maude
Warning: "vend2.maude", line 4 (mod VENDING-MACHINE): syntax error

vend2.maude
mod VENDING-MACHINE is
    including VENDING-MACHINE-SIGNATURE .
    var M : Marking .
    r1 [add-q] : M => M q .
    r1 [add-$] : M => M $ .
    r1 [buy-c] : $ => c .
    r1 [buy-a] : $ => a q .
    r1 [change] : q q q q => $ .
 endm

vend1.maude
fmod VENDING-MACHINE-SIGNATURE is
    sorts Coin Item Marking .
    subsorts Coin Item < Marking .
    op __ : Marking Marking -> Marking [assoc comm id: null] .
    op null : -> Marking .
    op $ : -> Coin [format (r! o)] .
    op q : -> Coin [format (r! o)] .
    op a : -> Coin [format (b! o)] .
    op c : -> Coin [format (b! o)] .
 endfm



Archive powered by MHonArc 2.6.16.

Top of Page