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

Fatal error in ENFORCE rule at compile time. #1419

Open stefjoosten opened 1 year ago

stefjoosten commented 1 year ago

What happened

I was experimenting with enforcement rules in RAP4, when suddenly I got a fatal error. Since the script was without type errors, I expected it to pass fluently through the compiler.

The screenshot tells the entire story: afbeelding This is a fatal error, so this clearly is a bug.

Reproducing the error

  1. Log in to https://rap.tarski.nl
  2. Create a new script with the following contents:

    CONTEXT Issue1419
    
    CLASSIFY Ss ISA S
    CLASSIFY Uu ISA U
    
    RELATION r[S*T]
    RELATION s[T*U]
    RELATION t[Ss*Uu]
    
    ENFORCE t >: r;s
    
    ENDCONTEXT
  3. Compile this script Lo and behold, the fatal error appears.

Symptoms

In a first attempt to analyze this error, I noticed that the following script compiles without errors:

CONTEXT Issue1419

CLASSIFY Ss ISA S
CLASSIFY Uu ISA U

RELATION r[S*T]
RELATION s[T*U]
RELATION t[Ss*Uu]

ENFORCE t >: I[Ss];r;s;I[Uu]

ENDCONTEXT
hanjoosten commented 1 year ago

This obviously is a typecheck error, similar to the one @sjcjoosten fixed with https://github.com/AmpersandTarski/Ampersand/pull/1392. As he commented in that PR, he said that there were probably fewer errors than before. @sjcjoosten , could you please have a look at this new bug?

stefjoosten commented 3 months ago

I ran into the same mistake today, when using Ampersand-v4.6.2, which was called FROM ampersandtarski/prototype-framework:v1.14