The Match property for an abstraction bind is used when the external player is of type PLBundle. Specifying the Match property in any other type of abstraction bind will be reported as an error by the UniCon compiler. This property specifies how the Member players of the PLBundle are matched to the players in the value of the MapsTo property. This matching is necessary because the UniCon compiler must know ultimately how each player in the interface of a component is implemented. This applies to the Member players of external PLBundle players as well. The Match property is used to provide the UniCon compiler with the mapping of the Member players to the MapsTo list entries.
In the abstraction bind, there are two forms of syntax for the value of the Match property. The first form is simply the keyword by_name. This is actually the default value if no Match property is specified. In this case, the UniCon compiler generates a list containing the players in the PLBundle. It then generates a list containing the players in the MapsTo property. If a player in a MapsTo property is a PLBundle, then the Member players are added to the list rather than the player itself. The UniCon compiler then processes the list of players from the MapsTo property. For each of these players, it searches the list of Member players from the external PLBundle player for a matching player (by looking for a name match). If it finds a match, the UniCon compiler attempts to bind the two players. If no match is found, the compiler does not bind them. In both cases, the compiler continues until each player in the MapsTo list has been examined. In the end, if there are any Member players in the external PLBundle that have not been bound, the UniCon compiler will report errors.
The second form of syntax for the value of the Match property for an abstraction bind is a list of relations. A relation is a comma-separated pair of player names. Each pair represents a specific match that the system designer has explicitly specified. The names of the players in each pair need not match. With this form of syntax for the Match property, the UniCon compiler binds each pair of players, regardless of whether or not the player names match. Then, it uses the Match (by_name) algorithm outlined above to form binds from the remaining players not specified in explicit matches.
The Match property for a PLBundler connector instantiation has the same two forms of value syntax as those of the abstraction bind: the value by_name, and a list of relations. The algorithm for matching with relations in a PLBundler connector instantiation is identical to the algorithm for matching with relations in an abstraction bind. The UniCon compiler treats each pair as an attempt at a connection with the appropriate connector type. For example, if a relation specifies a pair of players where one is of type RoutineDef and the other is of type RoutineCall, then the UniCon compiler will attempt to connect them with a ProcedureCall connector. The compiler will report appropriate error messages for any pairs that do not specify well-formed connections. Name mismatches are allowed in relations; the UniCon compiler will fix these mismatches at runtime by renaming both identifiers in the source code to a third, common identifier. This is done using C language macros, specified on the command line with the -D option during the source code compile of each file involved in the connection. When explicit matching using relations is completed, the
UniCon compiler attempts to create matches from the remaining players in the connection using the Match (by_name) algorithm for PLBundler connector instantiations outlined below.
For PLBundler connector instantations, the Match (by_name) algorithm is slightly different than the one for abstraction binds. This is because there may potentially be more than two sets of players involved that get matched one-for-one. There can potentially be many more than two participants in a PLBundler connection. Strewn throughout these participants, for example, may be many calls or uses of a particular routine or global data definition. A match must be made from these mini-sets of players that all share the same name. The algorithm is further compilated by the fact that not all participants in a PLBundler connection are PLBundle players; they can also be GlobalDataDef, GlobalDataUse,
RoutineCall, and RoutineDef players.
The algorithm for matching by name in a PLBundler connector instantiation proceeds as follows. Every Member player of every PLBundle participant, and every other participant in the PLBundler connection, is placed in a list. This list of players is sorted by name. The UniCon compiler then attempts to make a connection from each set of players with the same name from that list. The compiler will report errors associated with malformed connections. For example, each connection must have exactly one definition (i.e., RoutineDef or GlobalDataDef player) and at least one corresponding RoutineCall or GlobalDataUse player. Each set must also exclusively contain players of compatible types; all players must correspond to routine players, or they all must correspond to global data players.
The default value of the Match property is the keyword: by_name.
More than one specification of the Match property in a single property list is treated as a single specification with the union of all values in all of the specifications. However, if more than one Match property is specified, they must all have the same value syntax. In other words, they must all have the value by_name, or they must all be lists of relations.
ESTABLISH C-PLBundler WITH main.sort_routines AS participant sort.sort_routines AS participant /* with no Match attribute, Match (by_name) is assumed */ END C-PLBundlerThe following is equivalent to the above example:
ESTABLISH C-PLBundler WITH main.sort_routines AS participant sort.sort_routines AS participant MATCH (by_name) END C-PLBundlerNow, assume that main.sort_routines is a PLBundle player containing the following RoutineCall playerts: bubble, quick, merge, and sort. Also, assume that sort.sort_routines is a PLBundle player containing corresponding RoutineDef players with the following names: bubble_sort, quick_sort, merge_sort, and sort.
ESTABLISH C-PLBundler WITH main.sort_routines AS participant sort.sort_routines AS participant MATCH ((main.sort_routines.bubble, sort.sort_routines.bubble_sort), (main.sort_routines.quick, sort.sort_routines.quick_sort), (main.sort_routines.merge, sort.sort_routines.merge_sort)) END C-PLBundlerIn the above example, the UniCon compiler uses the Match (by_name) algorithm to form a ProcedureCall connection with the sort routines from each PLBundle player.
Lastly, the example below shows the Match property in an abstraction bind. Assume that the component in which this bind is defined has an external PLBundle player named Sort_Bundle. Assume further that this player defines five RoutineDef Member players: bubble, quick, merge, sort, and topological. Assume that the player
utilities.topological is a RoutineDef player.
BIND Sort_Bundle TO ABSTRACTION MAPSTO (sort.sort_routines, utilities.topological) MATCH ((Sort_Bundle.bubble, sort.sort_routines.bubble_sort), (Sort_Bundle.quick, sort.sort_routines.quick_sort), (Sort_Bundle.merge, sort.sort_routines.merge_sort)) END C-PLBundlerIn the above example, the UniCon compiler uses the Match (by_name) algorithm to bind Sort_Bundle.sort to sort.sort_routines.sort, and to bind Sort_Bundle.topological to utilities.topological.
Author:
Last Modified: May 12, 1996