dbis-uibk / relax

RelaX - a relational algebra calculator
http://dbis-uibk.github.io/relax/
MIT License
280 stars 96 forks source link

Feature request: Increasing tolerance for missing whitespaces for relational algebra #169

Closed mafo3186 closed 2 years ago

mafo3186 commented 2 years ago

Would it make sense to increase the tolerance of RelaX for missing whitespaces when using symbols for operations in relational algebra?

We already implemented it in our fork, but I do hesitate to create a pull request, because I am not sure yet, if the changes of the relational algebra grammar really work fine for all cases. I would appreciate if someone checked it. In our fork we changed the grammar of relational algebra in this commit: https://github.com/mafo3186/relax/commit/9b7818c750f3c86dc8cea62d4df115f2248c5cb2 gh pages: mafo3186/relax with gist

This works anyway (with whitespaces)

π Name, SSN (
    σ month(date(Bdate)) = month(now()) ∧ 
        day(date(Bdate)) = day(now()) (
            STUDENT
     )
)

After changing the RA-grammar, this works, too:

πName,SSN(σ month(date(Bdate))=month(now())∧day(date(Bdate))=day(now())(STUDENT))

There are still required whitespaces in cases like this (operater "=" comparing attributes): could anybody explain, why? πName,CourseId(σSTUDENT.SSN=ENROLL.SSN (STUDENT⨯ENROLL))

Whithout whitespace, there will still be an error: πName,CourseId(σSTUDENT.SSN=ENROLL.SSN(STUDENT⨯ENROLL)) Error:

Fehler: in Zeile 1: Expected "(", "gamma", "pi", "rho", "sigma", "tau", "{", "γ", "π", "ρ", "σ", "τ", or relationName but "=" found.

Any kind of help would be welcome. If you think, this might be a good additional feature, we would appreciate the integration in the original tool.


Note: I did not fetch the upstream with the last 11 commits, because I could not solve the conflicts (yet) and also am unable to run the newest release of relax locally (yet).

Background: We (HSD, eild.nrw) make our students use RelaX to learn relational algebra. Our evaluation revealed that they were annoyed by error messages which do not lead to finding the error. We discovered that in most cases the message was triggered by missing whitespaces between operators or brackets, without telling that whitespace was missing. We could not figure out why there should be spaces and decided to change the grammar.

Since I'm new to the community, I welcome any hints if I should do anything differently.

r-prem commented 2 years ago

@mafo3186 If you create a pull request, I will gladly take a look at it.

mafo3186 commented 2 years ago

@r-prem Thank you, sounds great! Before I do it: Is there by chance any way to create a pull request without fetching the upstream first? I guess not.

I did not fetch the upstream with the last 11 commits, because I could not solve the conflicts (yet) and also am unable to run the newest release of relax locally (yet).

I will try again today.