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

PURPOSE statement needed for ENFORCE #1300

Open stefjoosten opened 2 years ago

stefjoosten commented 2 years ago

Problem

I cannot write a PURPOSE for the current implementation of ENFORCE statements. This forces me to go back to the ExecEngine syntax, where I can label the rule and add a purpose using that label.

Proposal

I propose to add an optional label to ENFORCE rules, just like ordinary rules.

So I can write:

   ENFORCE Maakbuddy : buddy[Gastgezin*Vrijwilliger] >: gastgezin~;(intaker-aanmelding~;buddy;V)
   PURPOSE RULE Maakbuddy
   {+ Initieel is de intaker ook meteen de buddy, omdat de intaker de initiële band met het gastgezin opbouwt.
   Daarom vult het systeem standaard de intaker in als het buddy-veld leeg is.
   +}
hanjoosten commented 2 years ago

One ENFORCE statement can lead to more than one RULE. What effect do you expect/wish that the label would have? I guess it has something to do with the generated document?

stefjoosten commented 2 years ago

Good point! We have a new situation here. One ENFORCE rule is a single rule in the perception of the user, but it yields two separate quads (i.e. execution engine rules). This is a first in Ampersand. However, future extensions may have the same effect: multiple quads for one rule. So, the documentation must treat each ENFORCE rule as a single user-defined rule. The prototype, however, may have multiple automated rules as a result of ENFORCE rules.