Previous: System composition is recursive, Up: Well-formedness – System [Contents][Index]
external port to non-external portThere is a restriction in the binding of external ports: when an external requires port of a system Component is bound, the other side of the binding must be an external requires port also (this is only possible when that is a port of a sub Component). In the example below some errors are reported.
interface i {
in void e ();
behavior {
on e: {}
}
}
component c1 {
provides i p;
requires external i r1;
requires external i r2;
behavior {
on p.e (): {}
}
}
component c2 {
provides i p;
behavior {
on p.e (): {}
}
}
component s1 {
provides i p;
requires i r;
system {
c1 ci1;
c2 ci2;
p <=> ci1.p;
ci1.r1 <=> r;
ci1.r2 <=> ci2.p;
}
}
component s2 {
provides i p1;
provides i p2;
requires external i r1;
requires external i r2;
system {
s1 si1;
p1 <=> si1.p;
p2 <=> r2;
r1 <=> si1.r;
}
}
This results in the following error message:
binding-mismatch-external.dzn:45:5: error: cannot bind non-external port
`r' to external port `r1'
binding-mismatch-external.dzn:26:3: info: port `r' defined here
binding-mismatch-external.dzn:39:3: info: port `r1' defined here