Previously, I defined two simple signatures so that I can know which car does this wheel belong to.
sig Car{
wheels: some Wheel
}
sig Wheel{
BelongCar:one Car,
}{
BelongCar=this.~@wheels
}
However, when I put them into different modules, the analyzer will give the error "Circular dependency in module import". So how should I define the relations between Car and Wheels without the module dependency error?
\\in C.als
module C
open W
sig Car{
wheels: some Wheel
}
\\in W.als
module W
open C
sig Wheel{
BelongCar:one Car,
}{
BelongCar=this.~@wheels
}
As the error states, you try to open module W from module C which, in turns opens module W, which ...
To avoid this I can directly see 3 solutions, either:
OR
define the relation between car and wheels in a third module.
OR
We might be able to help you better if you tell us more about your requirements. Why the heck would you like to divide those two notions into two separate modules ?