/*
* 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> instance;
private LinkedList<Protocols> prot;
private ObjectList objList;
public CSPVerificationRules(LinkedList<Instance> i,LinkedList<Protocols> p, ObjectList lt) {
this.instance = i;
this.prot = p;
this.objList = lt;
}
public ArrayList<FDRResult> RuleInterleaveIsDeadlockFree(){
cir = new CreatorRuleInterleaveComposition(instance, objList);
cir.creatorRule();
analyRul = new AnalyseRuleInterleave(instance);
return analyRul.resultRule();
}
public ArrayList<FDRResult> RuleCommunicationIsDeadlockFree() throws InterruptedException{
comm = new CreatorRuleCommunicationComposition(instance, prot, objList);
comm.creatorRule();
analComm = new AnalyseRuleCommunication(instance, prot);
return analComm.resultRule();
}
public ArrayList<FDRResult> 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<FDRResult> 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();
}
}