コード例 #1
0
        // -- private member functions

        /** Check that symbol label is stutter insensitive,
         *  using nba and complement_nba */
        public bool is_stutter_insensitive(NBA nba, NBA nba_complement, APElement label)
        {
            NBA stutter_closed_nba = NBAStutterClosure.stutter_closure(nba, label);

            NBA product = NBA.product_automaton(stutter_closed_nba, nba_complement);

            NBAAnalysis analysis_product = new NBAAnalysis(product);
            bool        empty            = analysis_product.emptinessCheck();

            //  std::cerr << "NBA is " << (empty ? "empty" : "not empty") << std::endl;

            return(empty);
        }
コード例 #2
0
ファイル: NBA2DRA.cs プロジェクト: vu111293/pat-design
        public void convert(NBA nba, DRA dra_result, int limit)  //=0
        {
            if (nba.size() == 0 || nba.getStartState() == null)
            {
                // the NBA is empty -> construct DRA that is empty

                dra_result.constructEmpty();
                return;
            }

            if (_options.dba_check && nba.isDeterministic())
            {
                DBA2DRA.dba2dra(nba, dra_result);
                return;
            }

            if (_options.stutter_closure)
            {
                if (_stutter_information != null && !_stutter_information.isCompletelyInsensitive())
                {
                    //std::cerr <<
                    //"WARNING: NBA might not be 100% stutter insensitive, applying stutter closure can create invalid results!" <<
                    //std::endl;
                }

                NBA nba_closed = NBAStutterClosure.stutter_closure(nba);

                if (can_stutter())
                {
                    convert_safra_stuttered(nba_closed, dra_result, limit);
                    return;
                }

                convert_safra(nba_closed, dra_result, limit);
                return;
            }


            if (can_stutter())
            {
                convert_safra_stuttered(nba, dra_result, limit);
                return;
            }

            convert_safra(nba, dra_result, limit);

            return;
        }