Esempio n. 1
0
        public override Process ClearConstant(Dictionary<string, Expression> constMapping)
        {
            Expression[] newArgs = new Expression[Args.Length];
            for (int i = 0; i < Args.Length; i++)
            {
                Expression arg = Args[i].ClearConstant(constMapping);

                if (!arg.HasVar)
                    newArgs[i] = EvaluatorDenotational.Evaluate(arg, null);
                else
                    newArgs[i] = arg;
            }

            DefinitionRef newRef = new DefinitionRef(Name, newArgs);

            //this is a special cases happened in the middle of parsing, where the current Def is not initialized in the parser.
            //so need to put the newRef into the def list to initialize the Def once the parsing is done.
            if (Def == null)
            {
                //TreeWalker.dlist.Add(newRef);
                //TreeWalker.dtokens.Add(null);
            }
            else
            {
                newRef.Def = Def;
            }

            return newRef;
        }
Esempio n. 2
0
        public override Process ClearConstant(Dictionary <string, Expression> constMapping)
        {
            Expression[] newArgs = new Expression[Args.Length];
            for (int i = 0; i < Args.Length; i++)
            {
                Expression arg = Args[i].ClearConstant(constMapping);

                if (!arg.HasVar)
                {
                    newArgs[i] = EvaluatorDenotational.Evaluate(arg, null);
                }
                else
                {
                    newArgs[i] = arg;
                }
            }

            DefinitionRef newRef = new DefinitionRef(Name, newArgs);

            //this is a special cases happened in the middle of parsing, where the current Def is not initialized in the parser.
            //so need to put the newRef into the def list to initialize the Def once the parsing is done.
            if (Def == null)
            {
                //TreeWalker.dlist.Add(newRef);
                //TreeWalker.dtokens.Add(null);
            }
            else
            {
                newRef.Def = Def;
            }

            return(newRef);
        }
Esempio n. 3
0
        public static void Initialize(AssertionBase Assertion, DefinitionRef Process, SpecificationBase spec)
        {
            Specification Spec = spec as Specification;

            //get the relevant global variables; remove irrelevant variables so as to save memory;
            Valuation GlobalEnv = Spec.SpecValuation.GetVariableChannelClone(Process.GetGlobalVariables(), Process.GetChannels());

            //Initialize InitialStep
            Assertion.InitialStep = new Configuration(Process, Constants.INITIAL_EVENT, null, GlobalEnv, false);

            Assertion.MustAbstract = Process.MustBeAbstracted();
        }
Esempio n. 4
0
        public static void Initialize(AssertionRefinement Assertion, DefinitionRef ImplementationProcess, DefinitionRef SpecificationProcess, SpecificationBase spec)
        {
            Specification Spec = spec as Specification;

            //get the relevant global variables; remove irrelevant variables so as to save memory;
            List<string> varList = ImplementationProcess.GetGlobalVariables();
            varList.AddRange(SpecificationProcess.GetGlobalVariables());

            Valuation GlobalEnv = Spec.SpecValuation.GetVariableChannelClone(varList, ImplementationProcess.GetChannels());

            //Initialize InitialStep
            Assertion.InitialStep = new Configuration(ImplementationProcess, Constants.INITIAL_EVENT, null, GlobalEnv, false);
            Assertion.InitSpecStep = new Configuration(SpecificationProcess, Constants.INITIAL_EVENT, null, GlobalEnv, false);

            Assertion.MustAbstract = ImplementationProcess.MustBeAbstracted();
            if (SpecificationProcess.MustBeAbstracted())
            {
                throw new ParsingException(
                    "Process " + Assertion.SpecProcess + " has infinite states and therefore can not be used as a property model for refinement checking!", Assertion.AssertToken);
            }
        }
Esempio n. 5
0
 public KWSNAssertionDivergence(DefinitionRef processDef)
     : base()
 {
     Process = processDef;
 }
 public KWSNAssertionReachability(DefinitionRef processDef, string reachableState)
     : base(reachableState)
 {
     Process = processDef;
 }
Esempio n. 7
0
 public KWSNAssertionRefinement(DefinitionRef processDef, DefinitionRef target)
     : base()
 {
     ImplementationProcess = processDef;
     SpecificationProcess = target;
 }
 public KWSNAssertionReachabilityWith(DefinitionRef processDef, string reachableState, QueryConstraintType cont, Expression constraintCondition)
     : base(reachableState, cont, constraintCondition)
 {
     Process = processDef;
 }
Esempio n. 9
0
 public KWSNAssertionLTL(DefinitionRef processDef, string ltl)
     : base(ltl)
 {
     Process = processDef;
 }
Esempio n. 10
0
 public KWSNAssertionDeterminism(DefinitionRef processDef)
     : base()
 {
     Process = processDef;
 }
Esempio n. 11
0
 public KWSNAssertionDeadLock(DefinitionRef processDef, bool isNontermination)
     : base(isNontermination)
 {
     Process = processDef;
 }
Esempio n. 12
0
 public KWSNAssertionDeadLock(DefinitionRef processDef)
     : base()
 {
     Process = processDef;
 }