Ampersand icon indicating copy to clipboard operation
Ampersand copied to clipboard

`IDENT` statement is not implemented as the RULE it is syntax sugar for.

Open RieksJ opened this issue 5 years ago • 7 comments

Using Ampersand-v3.16.0 [feature/578-navbar:c3acfc3d1], there is no problem in compiling the following script:

CONTEXT "Issue #950"

IDENT BFs: BF(bfOrg,bfName)

bfOrg  :: BF * Org  [UNI]
bfName :: BF * Name [UNI]

POPULATION BF CONTAINS  [ "BF_Fin", "BF_V1622" ]

ENDCONTEXT

I would expect that after installation, the IDENT statement would produce an invariant error, because both BFs, i.e. BF_Fin and BF_V1622, have the same (missing) Org and the same (missing) Name, as is shown when inspecting the database:

afbeelding

Notes:

  • Adding the rule RULE "Ident BFs": bfOrg<>bfOrg~ /\ bfName<>bfName~ |- I[BF] to the script results in the actual production of the error I expected. This means that the code generated for IDENT and for the rule that it is syntax sugar for, are different.
  • I wonder what this says about our software development street. I'm pretty sure we have been at this point with the IDENT statement years before. And even if not, before now I was confident that basic situations as these would be caught by the sentinel. How stable are we?

RieksJ avatar May 06 '19 05:05 RieksJ