Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An automatic rule produces a yellow violation #1436

Open
stefjoosten opened this issue Aug 20, 2023 · 2 comments
Open

An automatic rule produces a yellow violation #1436

stefjoosten opened this issue Aug 20, 2023 · 2 comments
Assignees
Labels
bug Indicates an unexpected problem or unintended behavior component:code generator priority:normal

Comments

@stefjoosten
Copy link
Contributor

What happened

I got a yellow error message:
image
I traced it back to the following code fragment:

ENFORCE realization[CommunicationNetwork*ApplicationInterface] >: realization;I[ApplicationComponent];serving

I have checked that the relations mentioned in this rule exists:

RELATION realization[CommunicationNetwork*ApplicationComponent]
RELATION realization[CommunicationNetwork*ApplicationInterface]
RELATION serving[ApplicationComponent*ApplicationInterface]

The type checker accepted this rule, hence code was generated and the error could occur.

What I expected

  1. I expected this rule would not produce a (yellow) runtime error because it is an enforcement rule. However, it did (see screenshot above).
  2. I expected this error to appear in the prototype log. However, there wasn't a shred of it...

Version of Ampersand that was used

The example used Ampersandtarski/prototype-framework:v1.17 as a base container.

@stefjoosten stefjoosten added priority:normal bug Indicates an unexpected problem or unintended behavior component:code generator labels Aug 20, 2023
@hanjoosten
Copy link
Member

Could you supply a reproducer?

@stefjoosten
Copy link
Contributor Author

stefjoosten commented Aug 28, 2023

Analysis

It is not the ENFORCE syntax. I tried:

ROLE ExecEngine MAINTAINS serving
RULE serving : realization;I[ApplicationComponent];serving
               |- realization[CommunicationNetwork*ApplicationInterface]
VIOLATION (TXT "{EX} InsPair;realization;CommunicationNetwork;", SRC I, TXT ";ApplicationInterface;", TGT I)

with exactly the same result. However, now I did get the following log output:

EXECENGINE.INFO: InsPair(realization,Platform,id-3111baed624645bd87068eda7e1a28de,ApplicationComponent,id-65b1bbb7d0d44a76bb29bff324254216) [] {"request_id":"ea323ae053"}

Notice how the code has stealthily changed the type of the relation realization[CommunicationNetwork*ApplicationInterface] into realization[CommunicationNetwork*ApplicationComponent].
The concept ApplicationComponent is sandwiched between two other concepts

CLASSIFY ApplicationInterface ISA ApplicationComponent
CLASSIFY ApplicationComponent, ApplicationInterface ISA ArchiObject

I can sense a diagnosis coming up. I need to run some more tests to validate my hypothesis.

@stefjoosten stefjoosten changed the title An enforcement rule produces a yellow violation An automatic rule produces a yellow violation Aug 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior component:code generator priority:normal
Projects
None yet
Development

No branches or pull requests

2 participants