You can say
all x: m.(Component <: belongsTo) | ...
Question
I have an Alloy model, that have 2 signatures which have a relation that have the same name.
sig Model {
components : set Component
}
sig Port extends Element {
belongsTo : Component
}
sig Component extends Element{
belongsTo : Model,
ports : set Port
}
When I try to access these relation threw join the solver throws me:
A type error has occured:
This name is ambiguous due to multiple matches:
field this/Port <: belongsTo
field this/Component <: belongsTo
Is there any way to specify explicitly that I want to access to the relation belongTo
of component and not the port one, when I do:
all m : m.belongsTo |
and m are models?
Thanks.
Solution
You can say
all x: m.(Component <: belongsTo) | ...