IOness Inference and canonical names¶
In CertSAFE, Exported Names are not explicitly set to be either an input or output to the diagram they are in. Instead, CertSAFE automatically infers whether the Exported Name should act as an input or an output. This feature is called IOness Inference and is part of the static analysis that CertSAFE performs.
If an Exported Name is connected to a producer, either directly or through wire network, then that Exported Name will be treated as an output to the diagram. If an Exported Name is connected to a consumer and has no connections to any producer, then that Exported Name will be treated as an input to the diagram.
If an Exported Name is connected to another Exported Name, or to a Network Annotation, then regardless of what else is connected to the Exported Name, it will show up as an error in CertSAFE. In CertSAFE, each wire network can only have one name on it, and both Exported Names and Network Annotations are methods of naming wire networks.
If it is desirable to have two different parts of a wire network have different names, then use the buffer component to break the wire network into two different wire networks. A buffer component does not affect the value being passed into it. Instead, what the buffer component does is copy a value from one wire network to another. The buffer component has no state, and only facilitates the copying of a value from one wire network to another.
In instance mode, it is possible for a wire network to have two different Exported Names. This happens when an Exported Name in a stitch or diagram is connected to a composite unit’s consumer pin. The wire network in the parent diagram has one name, while the wire network in child composite unit has a different name, and the two networks get merged in instance mode. CertSAFE requires all wire networks to only have one name associated with them. To resolve this issue, CertSAFE uses Canonical Names.
When such a scenario happens, CertSAFE gives the wire network the name of the highest level composite unit. For example, if we have the following parent diagram:
And the child diagram is defined as followed:
Then setting the parent diagram as root and navigating to the child diagram in instance mode will show that the Exported names C and D have been changed to its parents A and B, as shown below:
Child Instance In Parent
If it is desirable to see the original names of the diagram, simply mouse over the original exported names in the diagram, or revert back to definition mode. If it is desirable to know where the name for that Exported Name comes from, merely looking at the name in instance mode will tell you, as above the name is the path to the composite unit that the name is being drawn from. In the above instanced diagram, both variables have a “□” symbol above them, meaning those names come from the root diagram.