Exemplo n.º 1
0
    public bool Get(int state)
    {
        var a = f.Get(state);
        var b = g.Get(state);

        return(a && b);
    }
Exemplo n.º 2
0
    private void Evaluate(TransitionSystem transitionSystem, int state)
    {
        if (Get(state))
        {
            // we have already evaluated this state
            return;
        }

        if (!f.Get(state))
        {
            // f does not hold (bad)
            return;
        }

        // f holds in this state (good)
        Set(state);
        EvaluatePredecessors(transitionSystem, state);
    }
    private bool Evaluate(TransitionSystem transitionSystem, bool[] checkedStates, bool[] markedStates, int state)
    {
        if (checkedStates[state])
        {
            // we have already evaluated this state
            return(Get(state));
        }

        if (markedStates[state])
        {
            // we have reached a previously marked state
            // therefore detecting a cycle along which f holds
            return(true);
        }

        if (!f.Get(state))
        {
            // f does not hold here (bad)
            return(false);
        }

        // check if there is a path starting in the current state along which f holds for every state
        markedStates[state] = true;
        for (int i = 0; i < numStates; i++)
        {
            if (transitionSystem.HasTransition(state, i))
            {
                if (Evaluate(transitionSystem, checkedStates, markedStates, i))
                {
                    // found a path along which f holds for every state
                    // therefore prepend the current state
                    Set(state);
                    break;
                }
            }
        }
        markedStates[state]  = false;
        checkedStates[state] = true;

        return(Get(state));
    }
Exemplo n.º 4
0
 public bool Get(int state)
 {
     return(!f.Get(state));
 }
Exemplo n.º 5
0
 public bool Get(int state)
 {
     return(!existsFuture.Get(state));
 }