Exemplo n.º 1
0
        /// <summary>
        /// Evaluates the reachable state space of a transition system given a initial state.
        /// </summary>
        /// <param name="I">The Bdd representing the initial state of the system.</param>
        /// <param name="T">The Bdd representing all possible transition in the system.</param>
        /// <param name="bpl">A list of variable pairs that represent pre- and post-states.</param>
        /// <returns>The Bdd representing the reachable state space.</returns>
        public static Bdd ReachableStates(Bdd I, Bdd T, BddPairList bpl)
        {
            Bdd Rp;
            Bdd R = new Bdd(false);

            do
            {
                Rp = R;
                R  = I | ExecuteTransition(R, T, bpl);
            }while (!R.Equals(Rp));
            return(R);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Evaluates the number of transitions it takes to reach a state from a given initial
        /// state in a transition system.
        /// </summary>
        /// <param name="I">The Bdd representing the initial state of the system.</param>
        /// <param name="E">The state that what to be reached.</param>
        /// <param name="T">The Bdd representing all possible transition in the system.</param>
        /// <param name="bpl">A list of variable pairs that represent pre- and post-states.</param>
        /// <returns>Number of transitions needed. -1 if no trace exists.</returns>
        public static int Tracelength(Bdd I, Bdd E, Bdd T, BddPairList bpl)
        {
            int tracelength = 0;
            Bdd Rp, test;
            Bdd R = I;

            do
            {
                Rp   = R;
                R    = I | ExecuteTransition(R, T, bpl);
                test = E >= R;
                if (R.Equals(Rp) & test.U != Kernel.bddtrue)
                {
                    return(-1);
                }
                tracelength++;
            }while (test.U != Kernel.bddtrue);
            return(tracelength);
        }