Exemplo n.º 1
0
        public override void RunVerification()
        {
            if (QueryConstraintType == QueryConstraintType.NONE)
            {
                base.RunVerification();
            }
            else
            {
                MDP mdp = BuildMDP();

                if (!CancelRequested)
                {
                    switch (QueryConstraintType)
                    {
                    case QueryConstraintType.PROB:
                        Max = 1 - mdp.MinProbability(VerificationOutput);
                        mdp.ResetNonTargetState();
                        Min = 1 - mdp.MaxProbability(VerificationOutput);
                        break;

                    case QueryConstraintType.PMAX:
                        Max = 1 - mdp.MinProbability(VerificationOutput);
                        break;

                    case QueryConstraintType.PMIN:
                        Min = 1 - mdp.MaxProbability(VerificationOutput);
                        break;
                    }

                    if (Min == 1)
                    {
                        VerificationOutput.VerificationResult = VerificationResultType.VALID;
                    }
                    else if (Max == 0)
                    {
                        VerificationOutput.VerificationResult = VerificationResultType.INVALID;
                    }
                    else
                    {
                        VerificationOutput.VerificationResult = VerificationResultType.WITHPROBABILITY;
                    }
                }
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Run the verification and get the result.
        /// </summary>
        /// <returns></returns>
        public override void RunVerification()
        {
            if (ConstraintType == QueryConstraintType.NONE)
            {
                base.RunVerification();
                return;
            }

            MDP mdp = BuildMDP(); //GetTransitionRelation();

            //MDP mdp = BuildDTMCSSZ(); //GetTransitionRelation();
            if (!CancelRequested)
            {
                switch (ConstraintType)
                {
                case QueryConstraintType.PROB:
                    Min = mdp.MinProbability(VerificationOutput);
                    mdp.ResetNonTargetState();
                    Max = mdp.MaxProbability(VerificationOutput);
                    break;

                case QueryConstraintType.PMAX:
                    Max = mdp.MaxProbability(VerificationOutput);
                    break;

                case QueryConstraintType.PMIN:
                    Min = mdp.MinProbability(VerificationOutput);
                    break;
                }

                if (Min == 1)
                {
                    this.VerificationOutput.VerificationResult = VerificationResultType.VALID;
                }
                else if (Max == 0)
                {
                    this.VerificationOutput.VerificationResult = VerificationResultType.INVALID;
                }
                else
                {
                    this.VerificationOutput.VerificationResult = VerificationResultType.WITHPROBABILITY;
                }
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Run the verification and get the result.
        /// </summary>
        /// <returns></returns>
        public override void RunVerification()
        {
            if (ConstraintType == QueryConstraintType.NONE)
            {
                base.RunVerification();
                return;
            }
            MDP mdp = null;

            if (SelectedEngineName == Constants.ENGINE_MDP_SEARCH)
            {
                mdp = BuildMDP(); //GetTransitionRelation();
            }
            else if (SelectedEngineName == Constants.ENGINE_MDP_ANTICHAIN_SEARCH)
            {
                mdp = BuildMDPSubset();
                //mdp = BuildMDPAntiChain_L();
                //mdp = BuildMDPAntiChain_S();
            }
            //
            if (!CancelRequested)
            {
                if (SelectedEngineName == Constants.ENGINE_MDP_SEARCH)
                {
                    switch (ConstraintType)
                    {
                    case QueryConstraintType.PROB:
                        Min = 1 - mdp.MaxProbability(VerificationOutput);
                        mdp.ResetNonTargetState();
                        Max = 1 - mdp.MinProbability(VerificationOutput);
                        break;

                    case QueryConstraintType.PMAX:
                        Max = 1 - mdp.MinProbability(VerificationOutput);
                        break;

                    case QueryConstraintType.PMIN:
                        Min = 1 - mdp.MaxProbability(VerificationOutput);
                        break;
                    }
                }
                else if (SelectedEngineName == Constants.ENGINE_MDP_ANTICHAIN_SEARCH)
                {
                    switch (ConstraintType)
                    {
                    case QueryConstraintType.PROB:
                        Min = 1 - mdp.MaxProbability(VerificationOutput, true);
                        mdp.ResetNonTargetState();
                        Max = 1 - mdp.MinProbability(VerificationOutput, true);
                        break;

                    case QueryConstraintType.PMAX:
                        Max = 1 - mdp.MinProbability(VerificationOutput, true);
                        break;

                    case QueryConstraintType.PMIN:
                        Min = 1 - mdp.MaxProbability(VerificationOutput, true);
                        break;
                    }
                }

                if (Min == 1)
                {
                    VerificationOutput.VerificationResult = VerificationResultType.VALID;
                }
                else if (Max == 0)
                {
                    VerificationOutput.VerificationResult = VerificationResultType.INVALID;
                }
                else
                {
                    VerificationOutput.VerificationResult = VerificationResultType.WITHPROBABILITY;
                }
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// Run the verification and get the result.
        /// </summary>
        /// <returns></returns>
        public override void RunVerification()
        {
            if (ConstraintType == QueryConstraintType.NONE)
            {
                 base.RunVerification();
                 return;
            }

            if (IsSafety)
            {
                RunVerificationSafety();
                return;
            }

            if (!IsNegateLiveness)
            {
                RunVerificationNegate();
                return;
            }

            if (SelectedEngineName == Constants.ENGINE_MDP_SEARCH)
            {

                switch (ConstraintType)
                {
                    case QueryConstraintType.PROB:
                        DRA = NegativeDRA;
                        BuildMDP(); //note this function is just used to calculate the maximal probability.
                        Min = 1 - mdp.MaxProbability(VerificationOutput);

                        DRA = PositiveDRA;
                        BuildMDP();
                        Max = mdp.MaxProbability(VerificationOutput);

                        break;
                    case QueryConstraintType.PMAX:
                        DRA = PositiveDRA;
                        BuildMDP();
                        Max = mdp.MaxProbability(VerificationOutput);
                        break;
                    case QueryConstraintType.PMIN:
                        if (AlmostFair) //note add by ssz
                        {
                            DRA = PositiveDRA;
                            BuildMDP();
                            Min = mdp.MinProbability(VerificationOutput);
                        }
                        else
                        {
                            DRA = NegativeDRA;
                            BuildMDP();
                            Min = 1 - mdp.MaxProbability(VerificationOutput);
                        }
                        break;
                }
            }
            else if (SelectedEngineName == Constants.ENGINE_MDP_MEC_SEARCH)
            {

                switch (ConstraintType)
                {
                    case QueryConstraintType.PROB:
                        DRA = NegativeDRA;
                        BuildMD_ImprovedTarjan(); //note this function is just used to calculate the maximal probability.
                        Min = 1 - mdp.MaxProbability(VerificationOutput);

                        DRA = PositiveDRA;
                        BuildMD_ImprovedTarjan();
                        Max = mdp.MaxProbability(VerificationOutput);

                        break;
                    case QueryConstraintType.PMAX:
                        DRA = PositiveDRA;
                        //BuildMDP();
                        BuildMD_ImprovedTarjan();
                        Max = mdp.MaxProbability(VerificationOutput);
                        break;
                    case QueryConstraintType.PMIN:
                        if (AlmostFair) //note add by ssz
                        {
                            DRA = PositiveDRA;
                            BuildMD_ImprovedTarjan();
                            Min = mdp.MinProbability(VerificationOutput);
                        }
                        else
                        {
                            DRA = NegativeDRA;
                            BuildMD_ImprovedTarjan();
                            Min = 1 - mdp.MaxProbability(VerificationOutput);
                        }
                        break;
                }
            }
            else if (SelectedEngineName == Constants.ENGINE_MDP_SIM_SEARCH)
            {
                switch (ConstraintType)
                {
                    case QueryConstraintType.PROB:
                        DRA = NegativeDRA;
                        BuildMDP(); //note this function is just used to calculate the maximal probability.
                        mdp = mdp.ComputeGCPP(VerificationOutput);
                        Min = 1 - mdp.MaxProbability(VerificationOutput);

                        DRA = PositiveDRA;
                        BuildMDP();
                        mdp = mdp.ComputeGCPP(VerificationOutput);
                        Max = mdp.MaxProbability(VerificationOutput);

                        break;
                    case QueryConstraintType.PMAX:
                        DRA = PositiveDRA;
                        BuildMDP();
                        mdp = mdp.ComputeGCPP(VerificationOutput);
                        Max = mdp.MaxProbability(VerificationOutput);
                        break;
                    case QueryConstraintType.PMIN:
                        if (AlmostFair) //note add by ssz
                        {
                            DRA = PositiveDRA;
                            BuildMDP();
                            mdp = mdp.ComputeGCPP(VerificationOutput);
                            Min = mdp.MinProbability(VerificationOutput);
                        }
                        else
                        {
                            DRA = NegativeDRA;
                            BuildMDP();
                            mdp = mdp.ComputeGCPP(VerificationOutput);
                            Min = 1 - mdp.MaxProbability(VerificationOutput);
                        }
                        break;
                }
            }

            if (Min == 1)
            {
                VerificationOutput.VerificationResult = VerificationResultType.VALID;
            }
            else if (Max == 0)
            {
                VerificationOutput.VerificationResult = VerificationResultType.INVALID;
            }
            else
            {
                VerificationOutput.VerificationResult = VerificationResultType.WITHPROBABILITY;
            }
        }