Class BasePConstraint
- java.lang.Object
-
- org.eclipse.viatra.query.runtime.matchers.psystem.BasePConstraint
-
- All Implemented Interfaces:
PConstraint,PTraceable
- Direct Known Subclasses:
DeferredPConstraint,EnumerablePConstraint
public abstract class BasePConstraint extends java.lang.Object implements PConstraint
-
-
Field Summary
Fields Modifier and Type Field Description protected PBodypBody-
Fields inherited from interface org.eclipse.viatra.query.runtime.matchers.psystem.PConstraint
COMPARE_BY_MONOTONOUS_ID
-
-
Constructor Summary
Constructors Constructor Description BasePConstraint(PBody pBody, java.util.Set<PVariable> affectedVariables)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidcheckSanity()voiddelete()protected abstract voiddoReplaceVariable(PVariable obsolete, PVariable replacement)java.util.Set<PVariable>getAffectedVariables()All variables affected by this constraint.PBodygetBody()java.util.Map<java.util.Set<PVariable>,java.util.Set<PVariable>>getFunctionalDependencies(IQueryMetaContext context)A (preferably minimal) cover of known functional dependencies between variables.intgetMonotonousID()Returns an integer ID that is guaranteed to increase strictly monotonously for constraints within a pBody.PBodygetPSystem()For backwards compatibility.voidreplaceVariable(PVariable obsolete, PVariable replacement)java.lang.StringtoString()protected abstract java.lang.StringtoStringRest()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.viatra.query.runtime.matchers.psystem.PConstraint
getDeducedVariables
-
-
-
-
Field Detail
-
pBody
protected PBody pBody
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
toStringRest
protected abstract java.lang.String toStringRest()
-
getAffectedVariables
public java.util.Set<PVariable> getAffectedVariables()
Description copied from interface:PConstraintAll variables affected by this constraint.- Specified by:
getAffectedVariablesin interfacePConstraint
-
getFunctionalDependencies
public java.util.Map<java.util.Set<PVariable>,java.util.Set<PVariable>> getFunctionalDependencies(IQueryMetaContext context)
Description copied from interface:PConstraintA (preferably minimal) cover of known functional dependencies between variables.- Specified by:
getFunctionalDependenciesin interfacePConstraint- Returns:
- non-trivial functional dependencies in the form of {variables} --> {variables}, where dependencies with the same lhs are unified.
-
replaceVariable
public void replaceVariable(PVariable obsolete, PVariable replacement)
- Specified by:
replaceVariablein interfacePConstraint
-
doReplaceVariable
protected abstract void doReplaceVariable(PVariable obsolete, PVariable replacement)
-
delete
public void delete()
- Specified by:
deletein interfacePConstraint
-
checkSanity
public void checkSanity()
- Specified by:
checkSanityin interfacePConstraint
-
getBody
public PBody getBody()
- Specified by:
getBodyin interfacePConstraint- Returns:
- the query body this constraint belongs to
- Since:
- 2.1
-
getMonotonousID
public int getMonotonousID()
Description copied from interface:PConstraintReturns an integer ID that is guaranteed to increase strictly monotonously for constraints within a pBody.- Specified by:
getMonotonousIDin interfacePConstraint
-
-