/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package CSP_ANALYSE; import RULES.CreatorRuleCommunicationComposition; import RULES.CreatorRuleInterleaveComposition; import LOGIC.Instance; import LOGIC.ObjectList; import LOGIC.Protocols; import RULES.CreatorRuleFeedbackComposition; import RULES.CreatorRuleReflexiveComposition; import java.util.ArrayList; import java.util.LinkedList; /** * * @author sarah */ public class CSPVerificationRules { private CreatorRuleInterleaveComposition cir; private AnalyseRuleInterleave analyRul; private CreatorRuleCommunicationComposition comm; private AnalyseRuleCommunication analComm; private CreatorRuleFeedbackComposition feed; private AnalyseRuleFeedback analyFeed; private CreatorRuleReflexiveComposition ref; private AnalyseRuleReflexive analyref; private LinkedList instance; private LinkedList prot; private ObjectList objList; public CSPVerificationRules(LinkedList i,LinkedList p, ObjectList lt) { this.instance = i; this.prot = p; this.objList = lt; } public ArrayList RuleInterleaveIsDeadlockFree(){ cir = new CreatorRuleInterleaveComposition(instance, objList); cir.creatorRule(); analyRul = new AnalyseRuleInterleave(instance); return analyRul.resultRule(); } public ArrayList RuleCommunicationIsDeadlockFree() throws InterruptedException { comm = new CreatorRuleCommunicationComposition(instance, prot, objList); comm.creatorRule(); analComm = new AnalyseRuleCommunication(instance, prot); return analComm.resultRule(); } public ArrayList RuleFeedbackIsDeadlockFree() throws InterruptedException{ feed = new CreatorRuleFeedbackComposition(instance, prot, objList); //comm = new CreatorRuleCommunicationComposition(instance, prot, objList); feed.creatorRule(); //comm.creatorRule(); analyFeed = new AnalyseRuleFeedback(instance, prot); //analComm = new AnalyseRuleCommunication(instance, prot); return analyFeed.resultRule(); } public ArrayList RuleReflexiveIsDeadlockFree() throws InterruptedException{ ref = new CreatorRuleReflexiveComposition(instance, prot, objList); //comm = new CreatorRuleCommunicationComposition(instance, prot, objList); ref.creatorRule(); //comm.creatorRule(); analyref = new AnalyseRuleReflexive(instance, prot); //analComm = new AnalyseRuleCommunication(instance, prot); return analyref.resultRule(); } }