AmpersandTarski / Ampersand

Build database applications faster than anyone else, and keep your data pollution free as a bonus.
http://ampersandtarski.github.io/
GNU General Public License v3.0
40 stars 8 forks source link

Strange error message #1466

Closed stefjoosten closed 4 months ago

stefjoosten commented 5 months ago

What happened

I compiled the following script with

CONTEXT Sets IN ENGLISH

elem :: Element * Set   
isSubsetOf :: Set * Set [RFX,ASY,TRN]

ROLE ExecEngine MAINTAINS AutodeletefromisSubsetOf
RULE AutodeletefromisSubsetOf LABEL "Auto delete from isSubsetOf": isSubsetOf |- -elem~ ! elem 
VIOLATION (TXT "{EX} DelPair;isSubsetOf;Set;", SRC I, TXT ";Set;", TGT I)
MEANING "If set S1 is a subset of set S2, then all elements of S1 are also elements of S2"

ENDCONTEXT

I got a surprising error message. At best, the text of the error is wrong because the double quote after MEANING is correct. At worst, this script is wrong. However, I cannot spot the mistake in this script.

sjo % ampersand check Sets.adl
/Users/sjo00577/git/ampersand-models/Sets.adl:9:9 error:
  unexpected double-quoted string "If set S1 is a subset of set S2, then all elements of S1 are also elements of S2"
  expecting operator '.'
ExitFailure 10
sjo % 

What I expected

I expected this to be a correct script.

Version of ampersand that was used

Ampersand-v5.0.0 [feature/labels-in-ADL-files:662580d51] This bug was found in the ampersand-models repo. The script above is an expert from git/ampersand-models/ServiceDesk/Sets/Sets.adl.

Steps to reproduce

1. 2. 3. 4.

Screenshot / Video

Context / Source of ampersand script

hanjoosten commented 4 months ago

Unfortunately, in the RULE statement, there is an order of the MEANING and VIOLATION part. The MEANING must come first.