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

No match in record selector aavtxt #1308

Closed stefjoosten closed 2 years ago

stefjoosten commented 2 years ago

What happened

I compiled the following script in RAP

CONTEXT Issue1308

RELATION r[X*A]
RELATION s[X*X]

POPULATION r[X*A] CONTAINS [(1, "a5"), (3, "a2"), (2, "a5") ]

RULE s=r;r~

REPRESENT X TYPE INTEGER
ENDCONTEXT

I got the following error message

image

What I expected

I expected an error message from Ampersand, recognizable by a locator (file, line number, character number). I might have expected a fatal, recognizable by the word "fatal", if we have a software mistake in the compiler. I never expected this error, which seems to be an error generated by the Haskell runtime system. It is surprising, because we should have caught it with a fatal.

Version of ampersand that was used

Ampersand-v4.3.0 [no git info], build time: 15-Aug-21 06:06:02 UTC. This is the current RAP on https://rap.cs.ou.nl

Steps to reproduce

  1. log in into https://rap.cs.ou.nl
  2. Create a new script
  3. Copy paste the above
  4. Compile
hanjoosten commented 2 years ago

Ok. Lets drill this down. First of all, version 4.3.0 is an old version. It is of august 2021. Please upgrade your version.

Having said that, I tried to reproduce it in the current main version (v4.7.0):

tl;dr: Cannot reproduce.

vscode@75ad3f88ceff:/workspaces/Ampersand/testing/Travis/testcases/Bugs/Fixed/Other$ ampersand check Issue-1308.adl 
/workspaces/Ampersand/testing/Travis/testcases/Bugs/Fixed/Other/Issue-1308.adl:8:1 error:
  There are 5 violations of RULE "rule@/workspaces/Ampersand/testing/Travis/testcases/Bugs/Fixed/Other/Issue-1308.adl:8:6":
    (1, 1)
    (1, 2)
    (2, 1)
    (2, 2)
    (3, 3)
ExitFailure 10

Also other commands didt't yeald the fatal error:

vscode@75ad3f88ceff:/workspaces/Ampersand/testing/Travis/testcases/Bugs/Fixed/Other$ ampersand proto Issue-1308.adl              
/workspaces/Ampersand/testing/Travis/testcases/Bugs/Fixed/Other/Issue-1308.adl:8:1 error:
  There are 5 violations of RULE "rule@/workspaces/Ampersand/testing/Travis/testcases/Bugs/Fixed/Other/Issue-1308.adl:8:6":
    (1, 1)
    (1, 2)
    (2, 1)
    (2, 2)
    (3, 3)
ExitFailure 10

and

vscode@75ad3f88ceff:/workspaces/Ampersand/testing/Travis/testcases/Bugs/Fixed/Other$ ampersand documentation --format docx Issue-1308.adl --no-graphics
Generating functional design document for Issue1308...
Generating docx to : ./Issue-1308.docx
Undefined cross-reference: eq:ConceptualAnalysisrelation--8081579715712121143
Undefined cross-reference: eq:ConceptualAnalysisrelation--9081971684057046399
[WARNING] Could not fetch resource ./images/CDRulerule_64_47workspaces_47Ampersand_47testing_47Travis_47testcases_47Bugs_47Fixed_47Other_47Issue_451308_46adl_588_586.png: PandocResourceNotFound "./images/CDRulerule_64_47workspaces_47Ampersand_47testing_47Travis_47testcases_47Bugs_47Fixed_47Other_47Issue_451308_46adl_588_586.png"
[WARNING] Could not fetch resource ./images/LogicalDataModel.png: PandocResourceNotFound "./images/LogicalDataModel.png"
[WARNING] Could not fetch resource ./images/TechnicalDataModel.png: PandocResourceNotFound "./images/TechnicalDataModel.png"
hanjoosten commented 2 years ago

Ok. I went deep. I went back to recompile version 4.3.0. With this version, I was able to reproduce:

vscode@75ad3f88ceff:/workspaces/Ampersand$ ampersand --version
Ampersand-v4.3.0 [ampersand4.3:02faaad85*]
vscode@75ad3f88ceff:/workspaces/Ampersand$ ampersand check testing/Travis/testcases/Bugs/Fixed/Other/Issue-1308.adl
No match in record selector aavtxt
ampersand: No match in record selector aavtxt
hanjoosten commented 2 years ago

Conclusion: This bug has been solved.