Prediction context documentation including graphs

This commit is contained in:
Sam Harwell 2013-01-21 06:39:32 -06:00
parent 2e693dc169
commit 0054cc020a
16 changed files with 922 additions and 10 deletions

View File

@ -0,0 +1,77 @@
digraph "" {
graph[dpi="60";compound="true"];
subgraph clusterA {
label="";
color="invis";
{ rank="same";
node[shape="invtriangle";margin="0.01,0.01"];
A_u1[label="u"];
A_v1[label="v"];
}
A_left[shape="record";label="{<a> | a} | {<b> | b}"];
{ edge[dir="back"];
A_u1:s -> A_left:a:n;
A_v1:s -> A_left:b:n;
}
}
subgraph AB {
temp0[color="invis";shape="point";label=""];
temp1[shape="none";label="+"];
temp0 -> temp1[style="invisible";dir="none"];
}
subgraph clusterB {
label="";
color="invis";
{ rank="same";
node[shape="invtriangle";margin="0.01,0.01"];
A_w1[label="w"];
A_x1[label="x"];
}
A_right[shape="record";label="{<c> | c} | {<d> | d}"];
{ edge[dir="back"];
A_w1:s -> A_right:c:n;
A_x1:s -> A_right:d:n;
}
}
subgraph BC {
node[color="invis";shape="point"];
temp2a;
{ rank="same";
temp2b;
temp2c;
}
temp2a -> temp2b[style="invisible";dir="none"];
temp2a -> temp2c[style="invisible";dir="none"];
temp2b -> temp2c[constraint="false";label="wwwwwww"];
}
subgraph clusterC {
label="";
color="invis";
{ rank="same";
node[shape="invtriangle";margin="0.01,0.01"];
A_u2[label="u"];
A_v2[label="v"];
A_w2[label="w"];
A_x2[label="x"];
}
A_result[shape="record";label="{<a> | a} | {<b> | b} | {<c> | c} | {<d> | d}"];
{ edge[dir="back"];
A_u2:s -> A_result:a:n;
A_v2:s -> A_result:b:n;
A_w2:s -> A_result:c:n;
A_x2:s -> A_result:d:n;
}
}
}

View File

@ -0,0 +1,72 @@
digraph "" {
graph[dpi="60";compound="true"];
subgraph clusterA {
label="";
color="invis";
{ rank="same";
node[shape="invtriangle";margin="0.01,0.01"];
A_u1[label="x"];
}
A_left[shape="record";label="{<a> | a}"];
{ edge[dir="back"];
A_u1:s -> A_left:a:n;
}
}
subgraph AB {
temp0[color="invis";shape="point";label=""];
temp1[shape="none";label="+"];
temp0 -> temp1[style="invisible";dir="none"];
}
subgraph clusterB {
label="";
color="invis";
{ rank="same";
node[shape="invtriangle";margin="0.01,0.01"];
A_w1[label="y"];
}
A_right[shape="record";label="{<a> | a}"];
{ edge[dir="back"];
A_w1:s -> A_right:a:n;
}
}
subgraph BC {
node[color="invis";shape="point"];
temp2a;
{ rank="same";
temp2b;
temp2c;
}
temp2a -> temp2b[style="invisible";dir="none"];
temp2a -> temp2c[style="invisible";dir="none"];
temp2b -> temp2c[constraint="false";label="wwwwwww"];
}
subgraph clusterC {
label="";
color="invis";
{ rank="same";
node[shape="invtriangle";margin="0.01,0.01"];
A_u2[label=""];
A_v2[label=""];
}
A_result[shape="record";label="{<x> | x} | {<y> | y}"];
A_ap[label="a'";shape="none"];
{ edge[dir="back"];
A_u2:s -> A_result:x:n;
A_v2:s -> A_result:y:n;
A_result:s -> A_ap:n;
}
}
}

View File

@ -0,0 +1,83 @@
digraph "" {
graph[dpi="60";compound="true"];
subgraph clusterA {
label="";
color="invis";
{ rank="same";
node[shape="invtriangle";margin="0.01,0.01"];
A_u1[label="u"];
A_v1[label="v"];
}
A_left[shape="record";label="{<a> | a} | {<b> | b}"];
{ edge[dir="back"];
A_u1:s -> A_left:a:n;
A_v1:s -> A_left:b:n;
}
}
subgraph AB {
temp0[color="invis";shape="point";label=""];
temp1[shape="none";label="+"];
temp0 -> temp1[style="invisible";dir="none"];
}
subgraph clusterB {
label="";
color="invis";
{ rank="same";
node[shape="invtriangle";margin="0.01,0.01"];
A_w1[label="w"];
A_x1[label="x"];
}
A_right[shape="record";label="{<b> | b} | {<d> | d}"];
{ edge[dir="back"];
A_w1:s -> A_right:b:n;
A_x1:s -> A_right:d:n;
}
}
subgraph BC {
node[color="invis";shape="point"];
temp2a;
{ rank="same";
temp2b;
temp2c;
}
temp2a -> temp2b[style="invisible";dir="none"];
temp2a -> temp2c[style="invisible";dir="none"];
temp2b -> temp2c[constraint="false";label="wwwwwww"];
}
subgraph clusterC {
label="";
color="invis";
{ rank="same";
node[shape="invtriangle";margin="0.01,0.01"];
A_u2[label="u"];
A_vw[shape="record";label="{<v> | v} | {<w> | w}"];
A_x2[label="x"];
}
{ rank="same";
node[shape="invtriangle";margin="0.01,0.01"];
A_vp[label=""];
A_wp[label=""];
}
A_result[shape="record";label="{<a> | a} | {<b> | b'} | {<d> | d}"];
{ edge[dir="back"];
A_u2:s -> A_result:a:n;
A_vw:s -> A_result:b:n;
A_x2:s -> A_result:d:n;
A_vp:s -> A_vw:v:n;
A_wp:s -> A_vw:w:n;
}
}
}

View File

@ -0,0 +1,75 @@
digraph "" {
graph[dpi="60";compound="true"];
subgraph clusterA {
label="";
color="invis";
{ rank="same";
node[shape="invtriangle";margin="0.01,0.01"];
A_u1[label="u"];
A_v1[label="v"];
}
A_left[shape="record";label="{<a> | a} | {<b> | b}"];
{ edge[dir="back"];
A_u1:s -> A_left:a:n;
A_v1:s -> A_left:b:n;
}
}
subgraph AB {
temp0[color="invis";shape="point";label=""];
temp1[shape="none";label="+"];
temp0 -> temp1[style="invisible";dir="none"];
}
subgraph clusterB {
label="";
color="invis";
{ rank="same";
node[shape="invtriangle";margin="0.01,0.01"];
A_w1[label="v"];
A_x1[label="x"];
}
A_right[shape="record";label="{<b> | b} | {<d> | d}"];
{ edge[dir="back"];
A_w1:s -> A_right:b:n;
A_x1:s -> A_right:d:n;
}
}
subgraph BC {
node[color="invis";shape="point"];
temp2a;
{ rank="same";
temp2b;
temp2c;
}
temp2a -> temp2b[style="invisible";dir="none"];
temp2a -> temp2c[style="invisible";dir="none"];
temp2b -> temp2c[constraint="false";label="wwwwwww"];
}
subgraph clusterC {
label="";
color="invis";
{ rank="same";
node[shape="invtriangle";margin="0.01,0.01"];
A_u2[label="u"];
A_v2[label="v"];
A_x2[label="x"];
}
A_result[shape="record";label="{<a> | a} | {<b> | b} | {<d> | d}"];
{ edge[dir="back"];
A_u2:s -> A_result:a:n;
A_v2:s -> A_result:b:n;
A_x2:s -> A_result:d:n;
}
}
}

View File

@ -0,0 +1,87 @@
digraph "" {
graph[dpi="60";compound="true"];
subgraph clusterA {
label="";
color="invis";
{ rank="same";
node[shape="invtriangle";margin="0.01,0.01"];
A_u1[label="u"];
A_v1[label="v"];
}
A_left[shape="record";label="{<a> | a} | {<b> | b}"];
{ edge[dir="back"];
A_u1:s -> A_left:a:n;
A_v1:s -> A_left:b:n;
}
}
subgraph AB {
temp0[color="invis";shape="point";label=""];
temp1[shape="none";label="+"];
temp0 -> temp1[style="invisible";dir="none"];
}
subgraph clusterB {
label="";
color="invis";
{ rank="same";
node[shape="invtriangle";margin="0.01,0.01"];
A_w1[label="v"];
A_x1[label="u"];
}
A_right[shape="record";label="{<b> | b} | {<d> | d}"];
{ edge[dir="back"];
A_w1:s -> A_right:b:n;
A_x1:s -> A_right:d:n;
}
}
subgraph BC {
node[color="invis";shape="point"];
temp2a;
{ rank="same";
temp2b;
temp2c;
}
temp2a -> temp2b[style="invisible";dir="none"];
temp2a -> temp2c[style="invisible";dir="none"];
temp2b -> temp2c[constraint="false";label="wwwwwww"];
}
subgraph clusterC {
label="";
color="invis";
subgraph clusterSubC {
node[group="";shape="invtriangle";margin="0.01,0.01"];
A_u2[label="u"];
{ rank="same";
A_ut1[color="invis";shape="point";width="0.00000001"];
A_v2[label="v"];
A_ut2[color="invis";shape="point";width="0.00000001"];
}
A_ut1 -> A_v2 -> A_ut2[style="invisible",dir="none"];
A_u2 -> A_v2[style="invisible",dir="none"];
}
A_result[shape="record";label="{<a> | a} | {<b> | b} | {<d> | d}"];
{ edge[dir="back"];
A_u2:sw -> A_ut1:n;
A_v2:s -> A_result:b:n;
A_u2:se -> A_ut2:n;
A_v2:s -> A_result:n[style="invisible",dir="none"];
}
{ edge[dir="none";constraint="false"];
A_ut1:s -> A_result:a:n;
A_ut2:s -> A_result:d:n;
}
}
}

View File

@ -0,0 +1,46 @@
digraph "" {
graph[dpi="60";compound="true"];
subgraph L {
node[shape="none"];
lefttree[label=""];
left[label="$"];
lefttree -> left[style="invisible";dir="none"];
}
subgraph AB {
optree[shape="none";label=""];
temp1[shape="none";label="+"];
optree -> temp1[style="invisible";dir="none"];
}
subgraph R {
righttree[shape="none";label=""];
right[shape="invtriangle";label="x"];
righttree -> right[style="invisible";dir="none"];
}
subgraph BC {
node[color="invis";shape="point"];
temp2a;
{ rank="same";
temp2b;
temp2c;
}
temp2a -> temp2b[style="invisible";dir="none"];
temp2a -> temp2c[style="invisible";dir="none"];
temp2b -> temp2c[constraint="false";label="wwwwwww"];
}
subgraph Res {
node[shape="none"];
resulttree[shape="invtriangle";label=""];
result[shape="record";label="{ | $} | {<x> | x}"];
resulttree -> result:x:n[dir="back"];
}
}

View File

@ -0,0 +1,27 @@
digraph "" {
graph[dpi="60";compound="true"];
subgraph L {
left[shape="none";label="$"];
}
subgraph AB {
temp1[shape="none";label="+"];
}
subgraph R {
right[shape="none";label="$"];
}
subgraph BC {
node[color="invis";shape="point"];
temp2b;
temp2c;
temp2b -> temp2c[constraint="false";label="wwwwwww"];
}
subgraph Res {
result[shape="none";label="$"];
}
}

View File

@ -0,0 +1,52 @@
digraph "" {
graph[dpi="60";compound="true"];
subgraph L {
node[shape="none"];
lefttree[label=""];
left[label="$"];
leftroot[label="a"];
lefttree -> left[style="invisible";dir="none"];
left -> leftroot[dir="back"];
}
subgraph AB {
optree[shape="none";label=""];
temp1[shape="none";label="+"];
optree -> temp1[style="invisible";dir="none"];
}
subgraph R {
righttree[shape="none";label=""];
right[shape="invtriangle";label="x"];
rightroot[shape="none";label="a"];
righttree -> right[style="invisible";dir="none"];
right -> rightroot[dir="back"];
}
subgraph BC {
node[color="invis";shape="point"];
temp2a;
{ rank="same";
temp2b;
temp2c;
}
temp2a -> temp2b[style="invisible";dir="none"];
temp2a -> temp2c[style="invisible";dir="none"];
temp2b -> temp2c[constraint="false";label="wwwwwww"];
}
subgraph Res {
node[shape="none"];
resulttree[shape="invtriangle";label=""];
result[shape="record";label="{ | $} | {<x> | x}"];
resultroot[label="a'"];
resulttree -> result:x:n[dir="back"];
result -> resultroot[dir="back"];
}
}

View File

@ -0,0 +1,39 @@
digraph "" {
graph[dpi="60";compound="true"];
subgraph L {
node[shape="none"];
left[label="$"];
leftroot[label="a"];
left -> leftroot[dir="back"];
}
subgraph AB {
temp1[shape="none";label="+"];
}
subgraph R {
right[shape="invtriangle";label="x"];
rightroot[shape="none";label="b"];
right -> rightroot[dir="back"];
}
subgraph BC {
node[color="invis";shape="point"];
temp2b;
temp2c;
temp2b -> temp2c[constraint="false";label="wwwwwww"];
}
subgraph Res {
node[shape="none"];
result[label="$"];
resultroot[shape="record";label="{<a> | a} | {<b> | b}"];
result -> resultroot:a:n[dir="back"];
result -> resultroot:b:n[dir="back"];
}
}

View File

@ -0,0 +1,38 @@
digraph "" {
graph[dpi="60";compound="true"];
subgraph L {
node[shape="none"];
left[label="$"];
leftroot[label="a"];
left -> leftroot[dir="back"];
}
subgraph AB {
temp1[shape="none";label="+"];
}
subgraph R {
right[shape="invtriangle";label="x"];
rightroot[shape="none";label="a"];
right -> rightroot[dir="back"];
}
subgraph BC {
node[color="invis";shape="point"];
temp2b;
temp2c;
temp2b -> temp2c[constraint="false";label="wwwwwww"];
}
subgraph Res {
node[shape="none"];
result[label="$"];
resultroot[label="a"];
result -> resultroot[dir="back"];
}
}

View File

@ -0,0 +1,27 @@
digraph "" {
graph[dpi="60";compound="true"];
subgraph L {
left[shape="none";label="$"];
}
subgraph AB {
temp1[shape="none";label="+"];
}
subgraph R {
right[shape="invtriangle";label="x"];
}
subgraph BC {
node[color="invis";shape="point"];
temp2b;
temp2c;
temp2b -> temp2c[constraint="false";label="wwwwwww"];
}
subgraph Res {
result[shape="none";label="$"];
}
}

View File

@ -0,0 +1,40 @@
digraph "" {
graph[dpi="60";compound="true"];
subgraph L {
node[shape="none"];
left[shape="invtriangle";label="x"];
leftroot[label="a"];
left -> leftroot[dir="back"];
}
subgraph AB {
temp1[shape="none";label="+"];
}
subgraph R {
right[shape="invtriangle";label="y"];
rightroot[shape="none";label="b"];
right -> rightroot[dir="back"];
}
subgraph BC {
node[color="invis";shape="point"];
temp2b;
temp2c;
temp2b -> temp2c[constraint="false";label="wwwwwww"];
}
subgraph clusterRes {
color="invis";
resulttree1[shape="invtriangle";label="x"];
resulttree2[shape="invtriangle";label="y"];
result[shape="record";label="{<a> | a} | {<b> | b}"];
resulttree1:s -> result:a:n[dir="back"];
resulttree2:s -> result:b:n[dir="back"];
}
}

View File

@ -0,0 +1,39 @@
digraph "" {
graph[dpi="60";compound="true"];
subgraph L {
node[shape="none"];
left[shape="invtriangle";label="x"];
leftroot[label="a"];
left -> leftroot[dir="back"];
}
subgraph AB {
temp1[shape="none";label="+"];
}
subgraph R {
right[shape="invtriangle";label="x"];
rightroot[shape="none";label="b"];
right -> rightroot[dir="back"];
}
subgraph BC {
node[color="invis";shape="point"];
temp2b;
temp2c;
temp2b -> temp2c[constraint="false";label="wwwwwww"];
}
subgraph clusterRes {
color="invis";
resulttree[shape="invtriangle";label="x"];
result[shape="record";label="{<a> | a} | {<b> | b}"];
resulttree -> result:a:n[dir="back"];
resulttree -> result:b:n[dir="back"];
}
}

View File

@ -0,0 +1,54 @@
digraph "" {
graph[dpi="60";compound="true"];
subgraph L {
node[shape="none"];
lefttree[label=""];
left[shape="invtriangle";label="x"];
leftroot[label="a"];
lefttree -> left[style="invisible";dir="none"];
left -> leftroot[dir="back"];
}
subgraph AB {
optree[shape="none";label=""];
temp1[shape="none";label="+"];
optree -> temp1[style="invisible";dir="none"];
}
subgraph R {
righttree[shape="none";label=""];
right[shape="invtriangle";label="y"];
rightroot[shape="none";label="a"];
righttree -> right[style="invisible";dir="none"];
right -> rightroot[dir="back"];
}
subgraph BC {
node[color="invis";shape="point"];
temp2a;
{ rank="same";
temp2b;
temp2c;
}
temp2a -> temp2b[style="invisible";dir="none"];
temp2a -> temp2c[style="invisible";dir="none"];
temp2b -> temp2c[constraint="false";label="wwwwwww"];
}
subgraph clusterRes {
color="invis";
resulttree1[shape="invtriangle";label=""];
resulttree2[shape="invtriangle";label=""];
result[shape="record";label="{<x> | x} | {<y> | y}"];
resultroot[shape="none";label="a'"];
resulttree1:s -> result:x:n[dir="back"];
resulttree2:s -> result:y:n[dir="back"];
result -> resultroot[dir="back"];
}
}

View File

@ -0,0 +1,38 @@
digraph "" {
graph[dpi="60";compound="true"];
subgraph L {
node[shape="none"];
left[shape="invtriangle";label="x"];
leftroot[label="a"];
left -> leftroot[dir="back"];
}
subgraph AB {
temp1[shape="none";label="+"];
}
subgraph R {
right[shape="invtriangle";label="x"];
rightroot[shape="none";label="a"];
right -> rightroot[dir="back"];
}
subgraph BC {
node[color="invis";shape="point"];
temp2b;
temp2c;
temp2b -> temp2c[constraint="false";label="wwwwwww"];
}
subgraph clusterRes {
color="invis";
result[shape="invtriangle";label="x"];
resultroot[shape="none";label="a"];
result -> resultroot[dir="back"];
}
}

View File

@ -48,11 +48,16 @@ import java.util.Map;
public abstract class PredictionContext implements Iterable<SingletonPredictionContext>,
Comparable<PredictionContext> // to sort node lists by id
{
/** Represents $ in local ctx prediction, which means wildcard. *+x = *. */
/**
* Represents {@code $} in local context prediction, which means wildcard.
* {@code *+x = *}.
*/
public static final EmptyPredictionContext EMPTY = new EmptyPredictionContext();
/** Represents $ in an array in full ctx mode, when $ doesn't mean wildcard:
* $ + x = [$,x]. Here, $ = EMPTY_RETURN_STATE.
/**
* Represents {@code $} in an array in full context mode, when {@code $}
* doesn't mean wildcard: {@code $ + x = [$,x]}. Here,
* {@code $} = {@link #EMPTY_RETURN_STATE}.
*/
public static final int EMPTY_RETURN_STATE = Integer.MAX_VALUE;
@ -97,7 +102,7 @@ public abstract class PredictionContext implements Iterable<SingletonPredictionC
public abstract int getReturnState(int index);
/** This means only the {@link #EMPTY} context is in set */
/** This means only the {@link #EMPTY} context is in set. */
public boolean isEmpty() {
return this == EMPTY;
}
@ -153,7 +158,42 @@ public abstract class PredictionContext implements Iterable<SingletonPredictionC
rootIsWildcard, mergeCache);
}
// http://www.antlr.org/wiki/download/attachments/32014352/singleton-merge.png
/**
* Merge two {@link SingletonPredictionContext} instances.
*
* <p/>
*
* Stack tops equal, parents merge is same; return left graph.<br/>
* <embed src="images/SingletonMerge_SameRootSamePar.svg" type="image/svg+xml"/>
*
* <p/>
*
* Same stack top, parents differ; merge parents giving array node, then
* remainders of those graphs. A new root node is created to point to the
* merged parents.<br/>
* <embed src="images/SingletonMerge_SameRootDiffPar.svg" type="image/svg+xml"/>
*
* <p/>
*
* Different stack tops pointing to same parent. Make array node for the
* root where both element in the root point to the same (original)
* parent.<br/>
* <embed src="images/SingletonMerge_DiffRootSamePar.svg" type="image/svg+xml"/>
*
* <p/>
*
* Different stack tops pointing to different parents. Make array node for
* the root where each element points to the corresponding original
* parent.<br/>
* <embed src="images/SingletonMerge_DiffRootDiffPar.svg" type="image/svg+xml"/>
*
* @param a the first {@link SingletonPredictionContext}
* @param b the second {@link SingletonPredictionContext}
* @param rootIsWildcard {@code true} if this is a local-context merge,
* otherwise false to indicate a full-context merge
* @param mergeCache
* @return
*/
public static PredictionContext mergeSingletons(
SingletonPredictionContext a,
SingletonPredictionContext b,
@ -220,9 +260,56 @@ public abstract class PredictionContext implements Iterable<SingletonPredictionC
}
}
// http://www.antlr.org/wiki/download/attachments/32014352/local-ctx-root-merge.png
// http://www.antlr.org/wiki/download/attachments/32014352/full-ctx-root-merge.png
/** Handle case where at least one of a or b is $ (EMPTY) */
/**
* Handle case where at least one of {@code a} or {@code b} is
* {@link #EMPTY}. In the following diagrams, the symbol {@code $} is used
* to represent {@link #EMPTY}.
*
* <h2>Local-Context Merges</h2>
*
* These local-context merge operations are used when {@code rootIsWildcard}
* is true.
*
* <p/>
*
* {@link #EMPTY} is superset of any graph; return {@link #EMPTY}.<br/>
* <embed src="images/LocalMerge_EmptyRoot.svg" type="image/svg+xml"/>
*
* <p/>
*
* {@link #EMPTY} and anything is {@code #EMPTY}, so merged parent is
* {@code #EMPTY}; return left graph.<br/>
* <embed src="images/LocalMerge_EmptyParent.svg" type="image/svg+xml"/>
*
* <p/>
*
* Special case of last merge if local context.<br/>
* <embed src="images/LocalMerge_DiffRoots.svg" type="image/svg+xml"/>
*
* <h2>Full-Context Merges</h2>
*
* These full-context merge operations are used when {@code rootIsWildcard}
* is false.
*
* <p/>
*
* <embed src="images/FullMerge_EmptyRoots.svg" type="image/svg+xml"/>
*
* <p/>
*
* Must keep all contexts; {@link #EMPTY} in array is a special value (and
* null parent).<br/>
* <embed src="images/FullMerge_EmptyRoot.svg" type="image/svg+xml"/>
*
* <p/>
*
* <embed src="images/FullMerge_SameRoot.svg" type="image/svg+xml"/>
*
* @param a the first {@link SingletonPredictionContext}
* @param b the second {@link SingletonPredictionContext}
* @param rootIsWildcard {@code true} if this is a local-context merge,
* otherwise false to indicate a full-context merge
*/
public static PredictionContext mergeRoot(SingletonPredictionContext a,
SingletonPredictionContext b,
boolean rootIsWildcard)
@ -251,7 +338,35 @@ public abstract class PredictionContext implements Iterable<SingletonPredictionC
return null;
}
// http://www.antlr.org/wiki/download/attachments/32014352/array-merge.png
/**
* Merge two {@link ArrayPredictionContext} instances.
*
* <p/>
*
* Different tops, different parents.<br/>
* <embed src="images/ArrayMerge_DiffTopDiffPar.svg" type="image/svg+xml"/>
*
* <p/>
*
* Shared top, same parents.<br/>
* <embed src="images/ArrayMerge_ShareTopSamePar.svg" type="image/svg+xml"/>
*
* <p/>
*
* Shared top, different parents.<br/>
* <embed src="images/ArrayMerge_ShareTopDiffPar.svg" type="image/svg+xml"/>
*
* <p/>
*
* Shared top, all shared parents.<br/>
* <embed src="images/ArrayMerge_ShareTopSharePar.svg" type="image/svg+xml"/>
*
* <p/>
*
* Equal tops, merge parents and reduce top to
* {@link SingletonPredictionContext}.<br/>
* <embed src="images/ArrayMerge_EqualTop.svg" type="image/svg+xml"/>
*/
public static PredictionContext mergeArrays(
ArrayPredictionContext a,
ArrayPredictionContext b,
@ -361,7 +476,10 @@ public abstract class PredictionContext implements Iterable<SingletonPredictionC
return M;
}
/** make pass over all M parents; merge any equals() ones */
/**
* Make pass over all <em>M</em> {@code parents}; merge any {@code equals()}
* ones.
*/
protected static void combineCommonParents(PredictionContext[] parents) {
Map<PredictionContext, PredictionContext> uniqueParents =
new HashMap<PredictionContext, PredictionContext>();