func PredictionModeGetStateToAltMap(configs ATNConfigSet) *AltDict {
	m := NewAltDict()
	for _, c := range configs.GetItems() {
		alts := m.Get(c.GetState().String())
		if alts == nil {
			alts = NewBitSet()
			m.put(c.GetState().String(), alts)
		}
		alts.(*BitSet).add(c.GetAlt())
	}
	return m
}
Get a map from state to alt subset from a configuration set. For each
configuration {@code c} in {@code configs}:

<pre>
map[c.{@link ATNConfig//state state}] U= c.{@link ATNConfig//alt alt}
</pre>
package antlr
const (
	PredictionModeSLL = 0
	PredictionModeLL = 1
	PredictionModeLLExactAmbigDetection = 2
)
func PredictionModehasSLLConflictTerminatingPrediction(mode int, configs ATNConfigSet) bool {
	if PredictionModeallConfigsInRuleStopStates(configs) {
		return true
	}
	if mode == PredictionModeSLL {
		if configs.HasSemanticContext() {
			dup := NewBaseATNConfigSet(false)
			for _, c := range configs.GetItems() {
				c = NewBaseATNConfig2(c, SemanticContextNone)
				dup.Add(c, nil)
			}
			configs = dup
		}
	}
	altsets := PredictionModegetConflictingAltSubsets(configs)
	return PredictionModehasConflictingAltSet(altsets) && !PredictionModehasStateAssociatedWithOneAlt(configs)
}
func PredictionModehasConfigInRuleStopState(configs ATNConfigSet) bool {
	for _, c := range configs.GetItems() {
		if _, ok := c.GetState().(*RuleStopState); ok {
			return true
		}
	}
	return false
}
func PredictionModeallConfigsInRuleStopStates(configs ATNConfigSet) bool {
	for _, c := range configs.GetItems() {
		if _, ok := c.GetState().(*RuleStopState); !ok {
			return false
		}
	}
	return true
}
func PredictionModeresolvesToJustOneViableAlt(altsets []*BitSet) int {
	return PredictionModegetSingleViableAlt(altsets)
}
func PredictionModeallSubsetsConflict(altsets []*BitSet) bool {
	return !PredictionModehasNonConflictingAltSet(altsets)
}
func PredictionModehasNonConflictingAltSet(altsets []*BitSet) bool {
	for i := 0; i < len(altsets); i++ {
		alts := altsets[i]
		if alts.length() == 1 {
			return true
		}
	}
	return false
}
func PredictionModehasConflictingAltSet(altsets []*BitSet) bool {
	for i := 0; i < len(altsets); i++ {
		alts := altsets[i]
		if alts.length() > 1 {
			return true
		}
	}
	return false
}
func PredictionModeallSubsetsEqual(altsets []*BitSet) bool {
	var first *BitSet
	for i := 0; i < len(altsets); i++ {
		alts := altsets[i]
		if first == nil {
			first = alts
		} else if alts != first {
			return false
		}
	}
	return true
}
func PredictionModegetUniqueAlt(altsets []*BitSet) int {
	all := PredictionModeGetAlts(altsets)
	if all.length() == 1 {
		return all.minValue()
	}
	return ATNInvalidAltNumber
}
func PredictionModeGetAlts(altsets []*BitSet) *BitSet {
	all := NewBitSet()
	for _, alts := range altsets {
		all.or(alts)
	}
	return all
}
func PredictionModegetConflictingAltSubsets(configs ATNConfigSet) []*BitSet {
	configToAlts := make(map[int]*BitSet)
	for _, c := range configs.GetItems() {
		key := 31 * c.GetState().GetStateNumber() + c.GetContext().hash()
		alts, ok := configToAlts[key]
		if !ok {
			alts = NewBitSet()
			configToAlts[key] = alts
		}
		alts.add(c.GetAlt())
	}
	values := make([]*BitSet, 0, 10)
	for _, v := range configToAlts {
		values = append(values, v)
	}
	return values
}