public override PetriNet 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) { } else { newRef.Def = Def; } return(newRef); }
public override PetriNet 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) { } else { newRef.Def = Def; } return newRef; }
/// <summary> /// return the initial configuration of the given startingProcess, this is used by the simulator /// </summary> /// <param name="startingProcess"></param> /// <returns></returns> public override ConfigurationBase SimulationInitialization(string startingProcess) { Definition def = DefinitionDatabase[startingProcess]; DefinitionRef defref = new DefinitionRef(def.Name, new Expression[0]) { Def = def }; return(new PNConfiguration(defref, Constants.INITIAL_EVENT, null, SpecValuation, false, this)); }
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 PNConfiguration(ImplementationProcess, Constants.INITIAL_EVENT, null, GlobalEnv, false, spec); Assertion.InitSpecStep = new PNConfiguration(SpecificationProcess, Constants.INITIAL_EVENT, null, GlobalEnv, false, spec); 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); } }
public PNAssertionReachabilityWith(DefinitionRef processDef, string reachableState, QueryConstraintType cont, Expression constraintCondition) : base(reachableState, cont, constraintCondition) { Process = processDef; }
/// <summary> /// return the initial configuration of the given startingProcess, this is used by the simulator /// </summary> /// <param name="startingProcess"></param> /// <returns></returns> public override ConfigurationBase SimulationInitialization(string startingProcess) { Definition def = DefinitionDatabase[startingProcess]; DefinitionRef defref = new DefinitionRef(def.Name, new Expression[0]) { Def = def }; return new PNConfiguration(defref, Constants.INITIAL_EVENT, null, SpecValuation, false, this); }
public PNAssertionLTL(DefinitionRef processDef, string ltl) : base(ltl) { Process = processDef; }
public PNAssertionReachability(DefinitionRef processDef, string reachableState) : base(reachableState) { Process = processDef; }