agg.parser
Class ExcludePair

java.lang.Object
  extended by agg.parser.ExcludePair
All Implemented Interfaces:
CriticalPair
Direct Known Subclasses:
CriticalRulePairAtGraph, DependencyPair, LayeredExcludePair, PriorityExcludePair, SimpleExcludePair

public class ExcludePair
extends java.lang.Object
implements CriticalPair

This class contains the algorithm to decide if one rule excludes another rule.


Field Summary
protected  java.util.Vector<GraphObject> boundB1_l1
           
protected  java.util.Vector<GraphObject> boundB1_r1
           
protected  boolean checkDependencyCond2
           
protected  boolean complete
           
protected  boolean computable
           
protected  boolean consistencyCheck
           
protected  boolean consistentOnly
           
protected  java.util.Vector<GraphObject> contextC1_l1
           
protected  java.util.Vector<GraphObject> contextC1_r1
           
protected  boolean criticalNACOfR2exists
           
protected  boolean dangling
           
protected  boolean danglingEdge
           
protected  java.util.Vector<GraphObject> danglingEdges
           
protected  java.util.Vector<GraphObject> delete
           
protected  boolean dependencyCond1
           
protected  boolean dependencyCond2
           
protected  boolean equalVariableNameOfAttrMapping
           
protected  boolean essential
           
protected  GraGra grammar
           
protected  boolean ignoreIdenticalRules
           
protected  int levelOfTypeGraphCheck
           
protected  boolean maxOverlapping
           
protected  int maxOverlapSize
           
protected  boolean ownStrategy
           
protected  java.util.Vector<GraphObject> preservedChanged
           
protected  java.util.Vector<GraphObject> preservedK1_l1
           
protected  java.util.Vector<GraphObject> preservedK1_r1
           
protected  java.util.Vector<GraphObject> produce
           
protected  boolean reduce
           
 boolean reduceSameMatch
           
protected  boolean stop
           
protected  MorphCompletionStrategy strategy
           
 boolean strongAttrCheck
           
protected  java.util.Vector<Pair<Type,Pair<Type,Type>>> typesTG_L2
           
protected  java.util.Vector<Pair<Type,Pair<Type,Type>>> typesTG_NAC2
           
protected  java.util.Vector<Pair<Type,Pair<Type,Type>>> typesTG_PAC2
           
protected  boolean withInheritance
           
protected  boolean withNACs
           
protected  boolean withPACs
           
 
Fields inherited from interface agg.parser.CriticalPair
CONFLICT, CONFLICTFREE, DEPENDENCY, EXCLUDE, TRIGGER_DEPENDENCY, TRIGGER_SWITCH_DEPENDENCY
 
Constructor Summary
ExcludePair()
          Creates a new object to compute critical pairs.
 
Method Summary
protected  boolean attributeCheckFailed(Rule r1, Rule r2, Pair<OrdinaryMorphism,OrdinaryMorphism> overlapping, Pair<OrdinaryMorphism,OrdinaryMorphism> helpPair)
          Checks the attributes if they are critic.
protected  boolean checkGlobalNACsOfRule2(Rule r1, Rule r2)
           
protected  boolean checkGraphConsistency(Graph g, int l)
           
protected  void destroyOverlapping(Pair<OrdinaryMorphism,OrdinaryMorphism> p)
           
protected  void disableCheckOfGraphConstraints(TypeSet typeSet)
          Disable checking max multiplicity of types by setting level of type graph check on TypeSet.ENABLED (r.getTypeSet().setLevelOfTypeGraphCheck(TypeSet.ENABLED)) and disable checking graph consistency constraints.
 void dispose()
           
 void enableComplete(boolean enable)
           
 void enableConsistent(boolean enable, GraGra gragra)
           
 void enableEqualVariableNameOfAttrMapping(boolean enable)
           
 void enableIgnoreIdenticalRules(boolean b)
           
 void enableNACs(boolean enable)
          Deprecated. replaced by setMorphismCompletionStrategy(MorphCompletionStrategy strat)
 void enablePACs(boolean enable)
          Deprecated. replaced by setMorphismCompletionStrategy(MorphCompletionStrategy strat)
 void enableReduce(boolean enable)
           
 void enableReduceSameMatch(boolean enable)
           
 void enableStrongAttrCheck(boolean enable)
           
protected  OrdinaryMorphism extendLeftGraphByNAC(OrdinaryMorphism isoLeft, OrdinaryMorphism nac, boolean replaceConstantAttrByVariable)
           
protected  OrdinaryMorphism extendLeftGraphByPAC(OrdinaryMorphism isoLeft, OrdinaryMorphism pac, boolean replaceConstantAttrByVariable)
           
 int getNumberOfKindOfPairs()
          Returns the number of kind of pairs which will be distinguished.
 java.util.Vector<Pair<Pair<OrdinaryMorphism,OrdinaryMorphism>,Pair<OrdinaryMorphism,OrdinaryMorphism>>> isCritical(int kind, Rule r1, Rule r2)
          computes if there is a critical pair of a special kind.
protected  java.util.Vector<Pair<Pair<OrdinaryMorphism,OrdinaryMorphism>,Pair<OrdinaryMorphism,OrdinaryMorphism>>> isExclude(Rule r1, Rule r2)
          Checks if the first rule exclude the second rule.
protected  void resetCheckOfGraphConstraints(TypeSet typeSet)
          Reset the level of type graph check and the value of graph consistency check.
protected  void ruleChangesAttributes(Rule r1, Rule r2, java.util.Vector<GraphObject> context, java.util.Vector<GraphObject> boundary, java.util.Vector<GraphObject> preserved, java.util.Hashtable<AttrType,java.util.Vector<Pair<ValueMember,ValueMember>>> changedAttrs, java.util.Vector<Pair<Type,Pair<Type,Type>>> neededTypes)
           
protected  void setGraGra(GraGra grammar)
           
 void setMorphismCompletionStrategy(MorphCompletionStrategy strat)
           
 void stop()
           
protected  void unsetAllTransientAttrValuesOfOverlapGrah(Graph g)
           
protected  void unsetAllTransientAttrValuesOfRule(Rule r)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

computable

protected boolean computable

checkDependencyCond2

protected boolean checkDependencyCond2

dependencyCond1

protected boolean dependencyCond1

dependencyCond2

protected boolean dependencyCond2

withNACs

protected boolean withNACs

withPACs

protected boolean withPACs

complete

protected boolean complete

reduce

protected boolean reduce

maxOverlapping

protected boolean maxOverlapping

maxOverlapSize

protected int maxOverlapSize

reduceSameMatch

public boolean reduceSameMatch

consistentOnly

protected boolean consistentOnly

dangling

protected boolean dangling

strategy

protected MorphCompletionStrategy strategy

ownStrategy

protected boolean ownStrategy

ignoreIdenticalRules

protected boolean ignoreIdenticalRules

grammar

protected GraGra grammar

stop

protected boolean stop

typesTG_L2

protected final java.util.Vector<Pair<Type,Pair<Type,Type>>> typesTG_L2

typesTG_NAC2

protected final java.util.Vector<Pair<Type,Pair<Type,Type>>> typesTG_NAC2

typesTG_PAC2

protected final java.util.Vector<Pair<Type,Pair<Type,Type>>> typesTG_PAC2

contextC1_l1

protected final java.util.Vector<GraphObject> contextC1_l1

boundB1_l1

protected final java.util.Vector<GraphObject> boundB1_l1

preservedK1_l1

protected final java.util.Vector<GraphObject> preservedK1_l1

contextC1_r1

protected final java.util.Vector<GraphObject> contextC1_r1

boundB1_r1

protected final java.util.Vector<GraphObject> boundB1_r1

preservedK1_r1

protected final java.util.Vector<GraphObject> preservedK1_r1

delete

protected final java.util.Vector<GraphObject> delete

produce

protected final java.util.Vector<GraphObject> produce

preservedChanged

protected final java.util.Vector<GraphObject> preservedChanged

danglingEdges

protected final java.util.Vector<GraphObject> danglingEdges

criticalNACOfR2exists

protected boolean criticalNACOfR2exists

essential

protected boolean essential

strongAttrCheck

public boolean strongAttrCheck

levelOfTypeGraphCheck

protected int levelOfTypeGraphCheck

consistencyCheck

protected boolean consistencyCheck

withInheritance

protected boolean withInheritance

equalVariableNameOfAttrMapping

protected boolean equalVariableNameOfAttrMapping

danglingEdge

protected boolean danglingEdge
Constructor Detail

ExcludePair

public ExcludePair()
Creates a new object to compute critical pairs.

Method Detail

dispose

public void dispose()

stop

public void stop()

setGraGra

protected void setGraGra(GraGra grammar)

getNumberOfKindOfPairs

public int getNumberOfKindOfPairs()
Returns the number of kind of pairs which will be distinguished. There must be at least two kind of pairs. That means one kind has no conflicts and the second kind has conflicts.

Specified by:
getNumberOfKindOfPairs in interface CriticalPair
Returns:
The number of available algorithims.

enableComplete

public void enableComplete(boolean enable)

enableNACs

public void enableNACs(boolean enable)
Deprecated. replaced by setMorphismCompletionStrategy(MorphCompletionStrategy strat)

Whether NACs are enabled or not this decision is done by the NAC property bit of the morphism completion strategy: withNACs = strategy.getProperties().get(CompletionPropertyBits.NAC);


enablePACs

public void enablePACs(boolean enable)
Deprecated. replaced by setMorphismCompletionStrategy(MorphCompletionStrategy strat)

Whether PACs are enabled or not this decision is done by the PAC property bit of the morphism completion strategy: withPACs = strategy.getProperties().get(CompletionPropertyBits.PAC);


enableReduce

public void enableReduce(boolean enable)

enableReduceSameMatch

public void enableReduceSameMatch(boolean enable)

enableStrongAttrCheck

public void enableStrongAttrCheck(boolean enable)

enableEqualVariableNameOfAttrMapping

public void enableEqualVariableNameOfAttrMapping(boolean enable)

enableConsistent

public void enableConsistent(boolean enable,
                             GraGra gragra)

setMorphismCompletionStrategy

public void setMorphismCompletionStrategy(MorphCompletionStrategy strat)

enableIgnoreIdenticalRules

public void enableIgnoreIdenticalRules(boolean b)

isCritical

public java.util.Vector<Pair<Pair<OrdinaryMorphism,OrdinaryMorphism>,Pair<OrdinaryMorphism,OrdinaryMorphism>>> isCritical(int kind,
                                                                                                                          Rule r1,
                                                                                                                          Rule r2)
                                                                                                                   throws InvalidAlgorithmException
computes if there is a critical pair of a special kind. Remenber if ther isn null is returned if the pair is not critical otherwiser a object which can explain in which way this pair is critical. One possible object can be a Vector of overlaping graphs. If a kind kind is requested which cannot be computed a InvalidAlgorithmException is thrown.

Specified by:
isCritical in interface CriticalPair
Parameters:
kind - specifies the kind of critical pair
r1 - defines the first part which can be critical
r2 - the second part which can be critical
Returns:
The object which is critic of the two rules
Throws:
InvalidAlgorithmException - Thrown if a illegal algorithm is selected.

isExclude

protected java.util.Vector<Pair<Pair<OrdinaryMorphism,OrdinaryMorphism>,Pair<OrdinaryMorphism,OrdinaryMorphism>>> isExclude(Rule r1,
                                                                                                                            Rule r2)
Checks if the first rule exclude the second rule.

Parameters:
r1 - The first rule.
r2 - The second rule.
Returns:
All critic object of this pair.

disableCheckOfGraphConstraints

protected void disableCheckOfGraphConstraints(TypeSet typeSet)
Disable checking max multiplicity of types by setting level of type graph check on TypeSet.ENABLED (r.getTypeSet().setLevelOfTypeGraphCheck(TypeSet.ENABLED)) and disable checking graph consistency constraints.

Parameters:
r -

resetCheckOfGraphConstraints

protected void resetCheckOfGraphConstraints(TypeSet typeSet)
Reset the level of type graph check and the value of graph consistency check.

Parameters:
r -

checkGlobalNACsOfRule2

protected boolean checkGlobalNACsOfRule2(Rule r1,
                                         Rule r2)

destroyOverlapping

protected void destroyOverlapping(Pair<OrdinaryMorphism,OrdinaryMorphism> p)

ruleChangesAttributes

protected void ruleChangesAttributes(Rule r1,
                                     Rule r2,
                                     java.util.Vector<GraphObject> context,
                                     java.util.Vector<GraphObject> boundary,
                                     java.util.Vector<GraphObject> preserved,
                                     java.util.Hashtable<AttrType,java.util.Vector<Pair<ValueMember,ValueMember>>> changedAttrs,
                                     java.util.Vector<Pair<Type,Pair<Type,Type>>> neededTypes)

extendLeftGraphByNAC

protected OrdinaryMorphism extendLeftGraphByNAC(OrdinaryMorphism isoLeft,
                                                OrdinaryMorphism nac,
                                                boolean replaceConstantAttrByVariable)

extendLeftGraphByPAC

protected OrdinaryMorphism extendLeftGraphByPAC(OrdinaryMorphism isoLeft,
                                                OrdinaryMorphism pac,
                                                boolean replaceConstantAttrByVariable)

checkGraphConsistency

protected boolean checkGraphConsistency(Graph g,
                                        int l)

attributeCheckFailed

protected boolean attributeCheckFailed(Rule r1,
                                       Rule r2,
                                       Pair<OrdinaryMorphism,OrdinaryMorphism> overlapping,
                                       Pair<OrdinaryMorphism,OrdinaryMorphism> helpPair)
Checks the attributes if they are critic.

Parameters:
r1 - The first rule
r2 - The second rule
overlapping - The pair of overlapping morphisms
Returns:
true if r1 excludes r2

unsetAllTransientAttrValuesOfOverlapGrah

protected void unsetAllTransientAttrValuesOfOverlapGrah(Graph g)

unsetAllTransientAttrValuesOfRule

protected void unsetAllTransientAttrValuesOfRule(Rule r)