I am very new to JetBrains MPS and I'm having trouble with the constraints definition.
So what I have:
- Concept "Component" with children "Port[0..n]"
- Root Concept "ComponentList" where several Components and its ports can be defined
- A smart-reference "PortReference" which links to the Ports defined above
What I would like to have:
- A concept "Instance" which references to a single "Component" and which has a children collection of "PortReferences".
- These "PortReferences" shall be allowed to point only to those "Ports" that are children of the referenced "Component"
Now, my problem:
It is possible to reference to ports, which are not children of the respective Component.
So, I suppose I have to define a constraint to get my problem solved... I tried the user guide, the calculator and the constants tutorial. Likely it is a very simple thing, but I really don't get it at the moment... :-\
I would appreciate for any help. Thank you in advance.