Example #1
0
 public NBA2DRA(Options_Safra options, bool detailedStates, StutterSensitivenessInformation stutter_information)
 {
     ; // nop
     _options = options;
     _detailed_states = detailedStates;
     _stutter_information = stutter_information;
 }
Example #2
0
 public NBA2DRA(Options_Safra options, bool detailedStates, StutterSensitivenessInformation stutter_information)
 {
     ; // nop
     _options             = options;
     _detailed_states     = detailedStates;
     _stutter_information = stutter_information;
 }
        public void setStutterInformation(StutterSensitivenessInformation stutter_information)
        {
            _stutter_information = stutter_information;

            //new StutterSensitivenessInformation(
            //new StutterSensitivenessInformation(
            StutterSensitivenessInformation left_stutter_info  = stutter_information;
            StutterSensitivenessInformation right_stutter_info = stutter_information;

            if (!stutter_information.isCompletelyInsensitive())
            {
                left_stutter_info.checkLTL(_left);
                right_stutter_info.checkLTL(_right);
            }

            if (!left_stutter_info.isCompletelyInsensitive())
            {
                left_stutter_info.checkPartial(_left_tree.getNBA(), buchiAutomata, _left.negate().toPNF(), _sched.getLTL2DRA());/////////////add buchiautomata
            }

            if (!right_stutter_info.isCompletelyInsensitive())
            {
                right_stutter_info.checkPartial(_right_tree.getNBA(), buchiAutomata, _right.negate().toPNF(), _sched.getLTL2DRA());///////add buchiautomata
            }

            _left_tree.setStutterInformation(left_stutter_info);
            _right_tree.setStutterInformation(right_stutter_info);
        }
Example #4
0
        //bool trueloop_check=true, bool detailed_states=false
        public static DA calculateUnionStuttered(DRA dra1, DRA dra2, StutterSensitivenessInformation stutter_information, bool trueloop_check, bool detailed_states)
        {
            if (dra1.isStreett() ||
                dra2.isStreett())
            {
                throw new Exception("Can not calculate union for Streett automata");
            }

            return DAUnionAlgorithm.calculateUnionStuttered(dra1, dra2, stutter_information, trueloop_check, detailed_states);
        }
Example #5
0
        //bool trueloop_check=true, bool detailed_states=false
        public static DA calculateUnionStuttered(DRA dra1, DRA dra2, StutterSensitivenessInformation stutter_information, bool trueloop_check, bool detailed_states)
        {
            if (dra1.isStreett() ||
                dra2.isStreett())
            {
                throw new Exception("Can not calculate union for Streett automata");
            }

            return(DAUnionAlgorithm.calculateUnionStuttered(dra1, dra2, stutter_information, trueloop_check, detailed_states));
        }
Example #6
0
        /** Constructor.
         * @param algo The Algorithm_t to use
         * @param da_result The result automaton
         * @param limit Limit the number of states in the result automaton?
         * @param detailed_states Generate detailed descriptions?
         * @param stutter_information Information about which symbols may be stuttered
         */
        public StutteredConvertorUnion(DAUnionAlgorithm algo, DRA da_result, int limit, bool detailed_states, StutterSensitivenessInformation stutter_information)
        {
            _da_result           = da_result;
            _limit               = limit;
            _algo                = algo;
            _detailed_states     = detailed_states;
            _stutter_information = stutter_information;

            //added by ly
            _state_mapper = new StateMapper <TreeWithAcceptance, DA_State>();
            _unprocessed  = new Stack <KeyValuePair <TreeWithAcceptance, DA_State> >();
        }
Example #7
0
        /** Constructor.
         * @param algo The Algorithm_t to use
         * @param da_result The result automaton
         * @param limit Limit the number of states in the result automaton?
         * @param detailed_states Generate detailed descriptions?
         * @param stutter_information Information about which symbols may be stuttered
         */
        public StutteredConvertorUnion(DAUnionAlgorithm algo, DRA da_result, int limit, bool detailed_states, StutterSensitivenessInformation stutter_information)
        {
            _da_result = da_result;
            _limit = limit;
            _algo = algo;
            _detailed_states = detailed_states;
            _stutter_information = stutter_information;

            //added by ly
            _state_mapper = new StateMapper<TreeWithAcceptance, DA_State>();
            _unprocessed = new Stack<KeyValuePair<TreeWithAcceptance, DA_State>>();
        }
        public void setStutterInformation(StutterSensitivenessInformation stutter_information)
        {
            _stutter_information = stutter_information;
            if (_tree_normal != null)
            {
                _tree_normal.setStutterInformation(_stutter_information);
            }

            if (_tree_union != null)
            {
                _tree_union.setStutterInformation(_stutter_information);
            }
        }
Example #9
0
        /**
         * Convert an NBA to a DRA using Safra's algorithm.
         * If limit is specified (>0), the conversion is
         * aborted with LimitReachedException when the number of
         * states exceeds the limit.
         * @param nba the formula
         * @param limit a limit on the number of states (0 for no limit)
         * @param detailedStates save detailed interal information (Safra trees)
         *                       in the generated states
         * @param stutter_information Information about the symbols that can be stuttered
         * @return a shared_ptr to the created DRA
         */
        public DRA nba2dra(NBA nba, int limit, bool detailedStates, StutterSensitivenessInformation stutter_information)
        {
            DRA dra = new DRA(nba.getAPSet_cp());

            NBA2DRA nba2dra = new NBA2DRA(_safra_opt, detailedStates, stutter_information);

            try
            {
                nba2dra.convert(nba, dra, limit);
            }
            catch (LimitReachedException e)
            {
                //dra.reset();
                // rethrow to notify caller
                //throw;
            }

            return dra;
        }
Example #10
0
        /**
         * Convert an NBA to a DRA using Safra's algorithm.
         * If limit is specified (>0), the conversion is
         * aborted with LimitReachedException when the number of
         * states exceeds the limit.
         * @param nba the formula
         * @param limit a limit on the number of states (0 for no limit)
         * @param detailedStates save detailed interal information (Safra trees)
         *                       in the generated states
         * @param stutter_information Information about the symbols that can be stuttered
         * @return a shared_ptr to the created DRA
         */
        public DRA nba2dra(NBA nba, int limit, bool detailedStates, StutterSensitivenessInformation stutter_information)
        {
            DRA dra = new DRA(nba.getAPSet_cp());

            NBA2DRA nba2dra = new NBA2DRA(_safra_opt, detailedStates, stutter_information);

            try
            {
                nba2dra.convert(nba, dra, limit);
            }
            catch (LimitReachedException e)
            {
                //dra.reset();
                // rethrow to notify caller
                //throw;
            }

            return(dra);
        }
Example #11
0
        /** Calculate the union of two DA, using stuttering if possible. If the DAs are not compact, they are made compact.
         * @param da_1 The first DA
         * @param da_2 the second DA
         * @param stutter_information information about the symbols where stuttering is allowed
         * @param trueloop_check Check for trueloops?
         * @param detailed_states Generate detailed descriptions of the states? */
        //bool trueloop_check=true, bool detailed_states=false
        public static DA calculateUnionStuttered(DA da_1, DA da_2, StutterSensitivenessInformation stutter_information, bool trueloop_check, bool detailed_states)
        {
            //if (!da_1.isCompact()) {
            //  da_1.makeCompact();
            //}

            //if (!da_2.isCompact()) {
            //  da_2.makeCompact();
            //}

            //typedef DAUnionAlgorithm<DA_t> algo_t;
            DAUnionAlgorithm dua = new DAUnionAlgorithm(da_1, da_2, trueloop_check, detailed_states);

            //<algo_t, DA_t>
            StutteredNBA2DAUnion generator = new StutteredNBA2DAUnion(detailed_states, stutter_information);

            generator.convert(dua, dua.getResultDA(), 0);

            return(dua.getResultDA());
        }
Example #12
0
        public void setStutterInformation(StutterSensitivenessInformation stutter_information)
        {
            _stutter_information = stutter_information;
            if (_tree_normal != null)
            {
                _tree_normal.setStutterInformation(_stutter_information);
            }

            if (_tree_union != null)
            {
                _tree_union.setStutterInformation(_stutter_information);
            }
        }
Example #13
0
        //typedef typename DA_t::acceptance_condition_type Acceptance;

        /** Constructor.
         * detailed_states Generate detailed descriptions for the states?
         * stutter_information Information which symbols may be stuttered
         */
        public StutteredNBA2DAUnion(bool detailed_states, StutterSensitivenessInformation stutter_information)
        {
            _detailed_states     = detailed_states;
            _stutter_information = stutter_information;
            Debug.Assert(_stutter_information != null);
        }
Example #14
0
        /** Generate the tree */
        public override void generateTree()
        {
            LTL2DSTAR_Tree_Rabin rabin = null;
            LTL2DSTAR_Tree_Streett streett = null;

            if (_options.automata == automata_type.RABIN || _options.automata == automata_type.RABIN_AND_STREETT)
            {
                rabin = new LTL2DSTAR_Tree_Rabin(_ltl, buchiAutomata, _options, _sched);
            }

            if (_options.automata == automata_type.STREETT || _options.automata == automata_type.RABIN_AND_STREETT)
            {
                streett = new LTL2DSTAR_Tree_Streett(_ltl.negate().toPNF(), buchiAutomata, _options, _sched);
            }

            if (rabin != null && streett != null)
            {
                int rabin_est = rabin.guestimate();
                int streett_est = streett.guestimate();

                //if (_options.verbose_scheduler) {
                //  std::cerr << "NBA-Estimates: Rabin: "<<rabin_est <<
                //    " Streett: " << streett_est << std::endl;
                //}

                if (rabin_est <= streett_est)
                {
                    addChild(rabin);
                    addChild(streett);
                }
                else
                {
                    addChild(streett);
                    addChild(rabin);
                }
            }
            else
            {
                if (rabin != null)
                    addChild(rabin);
                if (streett != null)
                    addChild(streett);
            }

            if (_options.opt_safra.stutter)
            {
                StutterSensitivenessInformation stutter_information = new StutterSensitivenessInformation();
                stutter_information.checkLTL(_ltl);

                if (!stutter_information.isCompletelyInsensitive() && _options.opt_safra.partial_stutter_check)
                {
                    NBA nba = null;
                    NBA complement_nba = null;
                    if (rabin != null)
                    {
                        nba = rabin.getNBA();
                    }
                    else if (streett != null)
                    {
                        nba = streett.getNBA();
                    }

                    if (rabin != null && streett != null)
                    {
                        complement_nba = streett.getNBA();
                    }

                    if (nba == null)
                    {
                        stutter_information.checkPartial(_ltl, buchiAutomata, _sched.getLTL2DRA());//////////add buchiAutomata
                    }
                    else if (complement_nba == null)
                    {
                        stutter_information.checkPartial(nba, buchiAutomata, _ltl.negate().toPNF(), _sched.getLTL2DRA());///////////add buchiAutomata
                    }
                    else
                    {
                        stutter_information.checkNBAs(nba, complement_nba);
                    }
                }

                if (rabin != null)
                {
                    rabin.setStutterInformation(stutter_information);
                }
                if (streett != null)
                {
                    streett.setStutterInformation(stutter_information);
                }
            }
        }
Example #15
0
 public void setStutterInformation(StutterSensitivenessInformation stutter_information)
 {
     _stutter_information = stutter_information;
     _tree_rabin.setStutterInformation(stutter_information);
 }
Example #16
0
 //typedef typename DA_t::acceptance_condition_type Acceptance;
 /** Constructor.
  * detailed_states Generate detailed descriptions for the states?
  * stutter_information Information which symbols may be stuttered
  */
 public StutteredNBA2DAUnion(bool detailed_states, StutterSensitivenessInformation stutter_information)
 {
     _detailed_states = detailed_states;
     _stutter_information = stutter_information;
     Debug.Assert(_stutter_information != null);
 }
 public void setStutterInformation(StutterSensitivenessInformation stutter_information)
 {
     _stutter_information = stutter_information;
     _tree_rabin.setStutterInformation(stutter_information);
 }
Example #18
0
 public void setStutterInformation(StutterSensitivenessInformation stutter_information)
 {
     _stutter_information = stutter_information;
 }
 public void setStutterInformation(StutterSensitivenessInformation stutter_information)
 {
     _stutter_information = stutter_information;
 }
        /** Generate the tree */
        public override void generateTree()
        {
            LTL2DSTAR_Tree_Rabin   rabin   = null;
            LTL2DSTAR_Tree_Streett streett = null;

            if (_options.automata == automata_type.RABIN || _options.automata == automata_type.RABIN_AND_STREETT)
            {
                rabin = new LTL2DSTAR_Tree_Rabin(_ltl, buchiAutomata, _options, _sched);
            }

            if (_options.automata == automata_type.STREETT || _options.automata == automata_type.RABIN_AND_STREETT)
            {
                streett = new LTL2DSTAR_Tree_Streett(_ltl.negate().toPNF(), buchiAutomata, _options, _sched);
            }

            if (rabin != null && streett != null)
            {
                int rabin_est   = rabin.guestimate();
                int streett_est = streett.guestimate();

                //if (_options.verbose_scheduler) {
                //  std::cerr << "NBA-Estimates: Rabin: "<<rabin_est <<
                //    " Streett: " << streett_est << std::endl;
                //}

                if (rabin_est <= streett_est)
                {
                    addChild(rabin);
                    addChild(streett);
                }
                else
                {
                    addChild(streett);
                    addChild(rabin);
                }
            }
            else
            {
                if (rabin != null)
                {
                    addChild(rabin);
                }
                if (streett != null)
                {
                    addChild(streett);
                }
            }


            if (_options.opt_safra.stutter)
            {
                StutterSensitivenessInformation stutter_information = new StutterSensitivenessInformation();
                stutter_information.checkLTL(_ltl);

                if (!stutter_information.isCompletelyInsensitive() && _options.opt_safra.partial_stutter_check)
                {
                    NBA nba            = null;
                    NBA complement_nba = null;
                    if (rabin != null)
                    {
                        nba = rabin.getNBA();
                    }
                    else if (streett != null)
                    {
                        nba = streett.getNBA();
                    }

                    if (rabin != null && streett != null)
                    {
                        complement_nba = streett.getNBA();
                    }

                    if (nba == null)
                    {
                        stutter_information.checkPartial(_ltl, buchiAutomata, _sched.getLTL2DRA());//////////add buchiAutomata
                    }
                    else if (complement_nba == null)
                    {
                        stutter_information.checkPartial(nba, buchiAutomata, _ltl.negate().toPNF(), _sched.getLTL2DRA());///////////add buchiAutomata
                    }
                    else
                    {
                        stutter_information.checkNBAs(nba, complement_nba);
                    }
                }

                if (rabin != null)
                {
                    rabin.setStutterInformation(stutter_information);
                }
                if (streett != null)
                {
                    streett.setStutterInformation(stutter_information);
                }
            }
        }
Example #21
0
        public void setStutterInformation(StutterSensitivenessInformation stutter_information)
        {
            _stutter_information = stutter_information;

            //new StutterSensitivenessInformation(
            //new StutterSensitivenessInformation(
            StutterSensitivenessInformation left_stutter_info = stutter_information;
            StutterSensitivenessInformation right_stutter_info = stutter_information;

            if (!stutter_information.isCompletelyInsensitive())
            {
                left_stutter_info.checkLTL(_left);
                right_stutter_info.checkLTL(_right);
            }

            if (!left_stutter_info.isCompletelyInsensitive())
            {
                left_stutter_info.checkPartial(_left_tree.getNBA(), buchiAutomata, _left.negate().toPNF(), _sched.getLTL2DRA());/////////////add buchiautomata
            }

            if (!right_stutter_info.isCompletelyInsensitive())
            {
                right_stutter_info.checkPartial(_right_tree.getNBA(), buchiAutomata, _right.negate().toPNF(), _sched.getLTL2DRA());///////add buchiautomata
            }

            _left_tree.setStutterInformation(left_stutter_info);
            _right_tree.setStutterInformation(right_stutter_info);
        }