예제 #1
0
        private static Case buildSynchNext(SMVModel nuSMV)
        {
            Case     newCase  = new Case();
            CaseLine caseLine = new CaseLine();

            foreach (var module in nuSMV.Modules)
            {
                string next  = SMVKeys.NEXT + "(" + module.Instance.Name + "." + CustomVariables.TURN + ")";
                string ready = TurnStates.READY;
                caseLine.Rule.AppendBoolExpression(new BoolExp(next, NuSMV.RelationalOperator.EQUAL, ready), BinaryOperator.AND);
                if (module.HasDivisionRule)
                {
                    foreach (var childIntstance in module.ChildInstances)
                    {
                        next  = SMVKeys.NEXT + "(" + childIntstance.Name + "." + CustomVariables.TURN + ")";
                        ready = TurnStates.READY;
                        caseLine.Rule.AppendBoolExpression(new BoolExp(next, NuSMV.RelationalOperator.EQUAL, ready), BinaryOperator.AND);
                    }
                }
            }
            caseLine.Result = new Expression(SynchStates.EXCHANGE);
            newCase.CaseLines.Add(caseLine);
            newCase.CaseLines.Add(BRulesStandardVar.trueCaseLine(SynchStates.BUSY));
            return(newCase);
        }
예제 #2
0
        private static Case buildPStepNext(SMVModel nuSMV)
        {
            Case     newCase  = new Case();
            CaseLine caseLine = new CaseLine();
            //_sync = _EXCH
            ICondition synchIsExch = new BoolExp(CustomVariables.SYNCH, NuSMV.RelationalOperator.EQUAL, SynchStates.EXCHANGE);

            caseLine.Rule.Condition = synchIsExch;
            caseLine.Result         = new Expression(Truth.TRUE);
            newCase.CaseLines.Add(caseLine);
            newCase.CaseLines.Add(BRulesStandardVar.trueCaseLine(Truth.FALSE));
            return(newCase);
        }