Exemplo n.º 1
0
        /// <summary>
        /// Describe the state information, including original states if determinized, as well as counters.
        /// </summary>
        public override string DescribeState(int state)
        {
            string s;

            if (!stateDescr.TryGetValue(state, out s))
            {
                s = SpecialCharacters.S(stateDescr.Count);
                stateDescr[state] = s;
            }

            var mems = new List <int>(stateBuilder.GetMembers(state));

            mems.Sort();
            if (!__hidePowersets)
            {
                s += "\n" + "{";
                foreach (var q in mems)
                {
                    if (!s.EndsWith("{"))
                    {
                        s += ",";
                    }
                    s += SpecialCharacters.q(q);
                }
                s += "}";
            }
            var state_counters      = GetCountersOfState(state);
            var state_counters_list = new List <int>(state_counters);

            state_counters_list.Sort();
            foreach (var c in state_counters_list)
            {
                s += "\n";
                s += "(" + SpecialCharacters.c(c) + ")";
                //s += "(" + counters[c].LowerBound +
                //    SpecialCharacters.LEQ + SpecialCharacters.Cntr(c) + SpecialCharacters.LEQ + counters[c].UpperBound + ")";
                if (finalCounterSet.Contains(c))
                {
                    s += SpecialCharacters.XI_LOWERCASE + SpecialCharacters.ToSubscript(c);
                    s += SpecialCharacters.CHECKMARK;
                }
            }
            return(s);
        }
Exemplo n.º 2
0
        public override string DescribeState(int state)
        {
            string s;

            if (__hideDerivativesInViewer)
            {
                s = SpecialCharacters.q(state);
            }
            else
            {
                s = stateMap[state].ToString();
            }
            if (countingStates != null)
            {
                if (IsFinalState(state) && IsCountingState(state))
                {
                    s += "\n(";
                    var f = GetFinalStateCondition(state);
                    for (int i = 0; i < f.Length; i++)
                    {
                        if (i > 0)
                        {
                            s += SpecialCharacters.AND;
                        }
                        var op = f[i];
                        s += op.ToString();
                    }
                    s += ")" + SpecialCharacters.CHECKMARK;
                }
                else if (IsCountingState(state))
                {
                    s += "\n(" + SpecialCharacters.c(countingStates[state].CounterId) + ")";
                }
            }
            return(s);
        }