示例#1
0
        /** Check if the NBA is empty.
         * @return true iff the NBA has no accepting run.
         */
        public bool emptinessCheck()
        {
            SCCs sccs = getSCCs();

#if VERBOSE
            std::cerr << sccs << "\n";

            std::cerr << " Reachability: " << std::endl;
            std::vector <BitSet> *reachable = sccs.getReachabilityForAllStates();
            for (unsigned int t = 0; t < reachable->size(); t++)
            {
                std::cerr << t << " -> " << (*reachable)[t] << std::endl;
            }
            delete reachable;
#endif

            for (int scc = 0; scc < sccs.countSCCs(); ++scc)
            {
                BitSet states_in_scc = sccs[scc];

                // check to see if there is an accepting state in this SCC
                //for (BitSetIterator it=BitSetIterator(states_in_scc); it!=BitSetIterator::end(states_in_scc); ++it)
                for (int it = BitSetIterator.start(states_in_scc); it != BitSetIterator.end(states_in_scc); it = BitSetIterator.increment(states_in_scc, it))
                {
                    int state = it;

#if VERBOSE
                    std::cerr << "Considering state " << state << std::endl;
#endif
                    if (_nba[state].isFinal())
                    {
                        // check to see if this SCC is a trivial SCC (can't reach itself)

#if VERBOSE
                        std::cerr << " +final";
                        std::cerr << " " << states_in_scc.cardinality();
#endif

                        if (states_in_scc.cardinality() == 1)
                        {
                            // there is only one state in this scc ...

#if VERBOSE
                            std::cerr << " +single";
#endif

                            if (sccs.stateIsReachable(state, state) == false)
                            {
                                // ... and it doesn't loop to itself
                                // -> can not guarantee accepting run

#if VERBOSE
                                std::cerr << " -no_loop" << std::endl;
#endif
                                continue;
                            }
                        }

                        // if we are here, the SCC has more than 1 state or
                        // exactly one self-looping state
                        //  -> accepting run

#if VERBOSE
                        std::cerr << "+acc" << std::endl;
#endif

                        // check that SCC can be reached from initial state
                        Debug.Assert(_nba.getStartState() != null);
                        if (sccs.stateIsReachable(_nba.getStartState().getName(), state))
                        {
#if VERBOSE
                            std::cerr << "Found accepting state = " << state << std::endl;
#endif
                            return(false);
                        }
#if VERBOSE
                        std::cerr << "Not reachable!" << std::endl;
#endif
                        continue;
                    }
                }
            }
            return(true);
        }
示例#2
0
 void FilterShaderCombinations(std::vector <SCacheCombination>& Cmbs, const std::vector <CShaderListFilter>& Filters);
示例#3
0
文件: item.cs 项目: 75912001/plane
 void load(el::lib_file_tab_txt_t& file_tab_txt, std::vector <std::string>& ref)
示例#4
0
 void AddGLCombinations(CShader *pSH, std::vector <SCacheCombination>& CmbsGL);