4.1.10.2. rule/CompositionMatch¶
- class mod.RCMatch¶
A class for interactively constructing match between two rules used for composition. That is, for two rules \(p_1 = (L_1 \leftarrow K_1 \rightarrow R_1)\) and \(p_2 = (L_2 \leftarrow K_2 \rightarrow R_2)\), an object represents match between \(R_1\) and \(L_2\) which indicates a common subgraph \(R_1 \leftarrow M \rightarrow L_2\).
- __init__(rFirst, rSecond, labelSettings=LabelSettings(LabelType.String, LabelRelation.Specialisation))¶
Construct an empty overlap.
- Parameters:
rFirst (Rule) – the first rule \(p_1\).
rSecond (Rule) – the second rule \(p_2\).
labelSettings (LabelSettings) – the settings to use for the morphisms \(R_1 \leftarrow M \rightarrow L_2\).
- Raises:
LogicError – if either rule is
None
.
- __str__()¶
- labelSettings¶
(Read-only) The settings for the morphisms in the match.
- Type:
- __getitem__(vFirst)¶
- __getitem__(vSecond)
- Parameters:
vFirst (Rule.RightGraph.Vertex) – a vertex of \(R_1\) to return the mapped vertex for.
vSecond (Rule.LeftGraph.Vertex) – a vertex of \(L_2\) to return the mapped vertex for.
- Returns:
the vertex the given vertex is mapped to, or a null vertex if it is not mapped.
- Raises:
LogicError – if either vertex is a null vertex.
LogicError – if either vertex does not belong to their respective rules.
- void push(vFirst, vSecond)
Extend the common subgraph (match) of \(R_1\) and \(L_2\) by identifying the given vertices from each of the graphs.
- Raises:
LogicError – if either vertex is a null vertex.
LogicError – if either vertex does not belong to their respective rules.
LogicError – if either vertex is already mapped.
LogicError – if the extension of the match is infeasible.
- pop()¶
Pop the latest pushed vertex pair.
- Raises:
LogicError – if
self.size == 0
.
- compose(*, verbose=False)¶
- composeAll(*, maximum=False, verbose=False)¶
- Parameters:
- Returns:
the composition of the two rules along enumerated matches. The enumerated matches are all those that are extensions of the current match, and the match it self.
- Return type: