Class AbstractOperationCompiler
- java.lang.Object
-
- org.eclipse.viatra.query.runtime.localsearch.planner.compiler.AbstractOperationCompiler
-
- All Implemented Interfaces:
IOperationCompiler
- Direct Known Subclasses:
EMFOperationCompiler,GenericOperationCompiler
public abstract class AbstractOperationCompiler extends java.lang.Object implements IOperationCompiler
- Since:
- 1.7
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Set<CallWithAdornment>dependenciesprotected java.util.List<ISearchOperation>operationsprotected IQueryRuntimeContextruntimeContextprotected static java.lang.StringUNSUPPORTED_TYPE_MESSAGEprotected java.util.Map<PConstraint,java.util.Set<java.lang.Integer>>variableBindings
-
Constructor Summary
Constructors Constructor Description AbstractOperationCompiler(IQueryRuntimeContext runtimeContext)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.util.List<ISearchOperation>compile(SubPlan plan, java.util.Set<PParameter> boundParameters)Compiles a plan ofPOperations to a list of typeList<ISearchOperation>protected voidcreateCheck(AggregatorConstraint aggregator, java.util.Map<PVariable,java.lang.Integer> variableMapping)protected voidcreateCheck(ExpressionEvaluation expressionEvaluation, java.util.Map<PVariable,java.lang.Integer> variableMapping)protected voidcreateCheck(Inequality inequality, java.util.Map<PVariable,java.lang.Integer> variableMapping)protected voidcreateCheck(NegativePatternCall negativePatternCall, java.util.Map<PVariable,java.lang.Integer> variableMapping)protected voidcreateCheck(PatternMatchCounter counter, java.util.Map<PVariable,java.lang.Integer> variableMapping)protected abstract voidcreateCheck(TypeFilterConstraint typeConstraint, java.util.Map<PVariable,java.lang.Integer> variableMapping)protected voidcreateCheck(BinaryReflexiveTransitiveClosure binaryTransitiveClosure, java.util.Map<PVariable,java.lang.Integer> variableMapping)protected voidcreateCheck(BinaryTransitiveClosure binaryTransitiveClosure, java.util.Map<PVariable,java.lang.Integer> variableMapping)protected voidcreateCheck(ConstantValue constant, java.util.Map<PVariable,java.lang.Integer> variableMapping)protected voidcreateCheck(PositivePatternCall pCall, java.util.Map<PVariable,java.lang.Integer> variableMapping)protected abstract voidcreateCheck(TypeConstraint typeConstraint, java.util.Map<PVariable,java.lang.Integer> variableMapping)protected voidcreateExtend(AggregatorConstraint aggregator, java.util.Map<PVariable,java.lang.Integer> variableMapping)protected voidcreateExtend(ExpressionEvaluation expressionEvaluation, java.util.Map<PVariable,java.lang.Integer> variableMapping)protected voidcreateExtend(PatternMatchCounter patternMatchCounter, java.util.Map<PVariable,java.lang.Integer> variableMapping)protected voidcreateExtend(BinaryReflexiveTransitiveClosure binaryTransitiveClosure, java.util.Map<PVariable,java.lang.Integer> variableMapping)protected voidcreateExtend(BinaryTransitiveClosure binaryTransitiveClosure, java.util.Map<PVariable,java.lang.Integer> variableMapping)protected voidcreateExtend(ConstantValue constant, java.util.Map<PVariable,java.lang.Integer> variableMapping)protected voidcreateExtend(PositivePatternCall pCall, java.util.Map<PVariable,java.lang.Integer> variableMapping)protected abstract voidcreateExtend(TypeConstraint typeConstraint, java.util.Map<PVariable,java.lang.Integer> variableMapping)protected voidcreateExtendDispatcher(PConstraint pConstraint, java.util.Map<PVariable,java.lang.Integer> variableMapping)protected abstract voidcreateUnaryTypeCheck(IInputKey type, int position)java.util.Set<CallWithAdornment>getDependencies()Replaces previous method returningMatcherReferencejava.util.Map<PVariable,java.lang.Integer>getVariableMappings()
-
-
-
Field Detail
-
UNSUPPORTED_TYPE_MESSAGE
protected static final java.lang.String UNSUPPORTED_TYPE_MESSAGE
- See Also:
- Constant Field Values
-
operations
protected java.util.List<ISearchOperation> operations
-
dependencies
protected java.util.Set<CallWithAdornment> dependencies
-
variableBindings
protected java.util.Map<PConstraint,java.util.Set<java.lang.Integer>> variableBindings
-
runtimeContext
protected final IQueryRuntimeContext runtimeContext
-
-
Constructor Detail
-
AbstractOperationCompiler
public AbstractOperationCompiler(IQueryRuntimeContext runtimeContext)
-
-
Method Detail
-
createExtend
protected abstract void createExtend(TypeConstraint typeConstraint, java.util.Map<PVariable,java.lang.Integer> variableMapping)
-
createCheck
protected abstract void createCheck(TypeConstraint typeConstraint, java.util.Map<PVariable,java.lang.Integer> variableMapping)
- Throws:
ViatraQueryRuntimeException
-
createCheck
protected abstract void createCheck(TypeFilterConstraint typeConstraint, java.util.Map<PVariable,java.lang.Integer> variableMapping)
- Throws:
ViatraQueryRuntimeException
-
createUnaryTypeCheck
protected abstract void createUnaryTypeCheck(IInputKey type, int position)
- Throws:
ViatraQueryRuntimeException- Since:
- 2.0
-
compile
public java.util.List<ISearchOperation> compile(SubPlan plan, java.util.Set<PParameter> boundParameters)
Compiles a plan ofPOperations to a list of typeList<ISearchOperation>- Specified by:
compilein interfaceIOperationCompiler- Parameters:
plan-boundParameters-- Returns:
- an ordered list of POperations that make up the compiled search plan
- Throws:
ViatraQueryRuntimeException
-
createExtendDispatcher
protected void createExtendDispatcher(PConstraint pConstraint, java.util.Map<PVariable,java.lang.Integer> variableMapping)
-
getDependencies
public java.util.Set<CallWithAdornment> getDependencies()
Description copied from interface:IOperationCompilerReplaces previous method returningMatcherReference- Specified by:
getDependenciesin interfaceIOperationCompiler
-
getVariableMappings
public java.util.Map<PVariable,java.lang.Integer> getVariableMappings()
- Specified by:
getVariableMappingsin interfaceIOperationCompiler- Returns:
- the cached variable bindings for the previously created plan
-
createCheck
protected void createCheck(PatternMatchCounter counter, java.util.Map<PVariable,java.lang.Integer> variableMapping)
-
createCheck
protected void createCheck(PositivePatternCall pCall, java.util.Map<PVariable,java.lang.Integer> variableMapping)
-
createCheck
protected void createCheck(ConstantValue constant, java.util.Map<PVariable,java.lang.Integer> variableMapping)
-
createCheck
protected void createCheck(BinaryTransitiveClosure binaryTransitiveClosure, java.util.Map<PVariable,java.lang.Integer> variableMapping)
-
createCheck
protected void createCheck(BinaryReflexiveTransitiveClosure binaryTransitiveClosure, java.util.Map<PVariable,java.lang.Integer> variableMapping)
- Since:
- 2.0
-
createCheck
protected void createCheck(ExpressionEvaluation expressionEvaluation, java.util.Map<PVariable,java.lang.Integer> variableMapping)
-
createCheck
protected void createCheck(AggregatorConstraint aggregator, java.util.Map<PVariable,java.lang.Integer> variableMapping)
-
createCheck
protected void createCheck(NegativePatternCall negativePatternCall, java.util.Map<PVariable,java.lang.Integer> variableMapping)
-
createCheck
protected void createCheck(Inequality inequality, java.util.Map<PVariable,java.lang.Integer> variableMapping)
-
createExtend
protected void createExtend(PositivePatternCall pCall, java.util.Map<PVariable,java.lang.Integer> variableMapping)
-
createExtend
protected void createExtend(BinaryTransitiveClosure binaryTransitiveClosure, java.util.Map<PVariable,java.lang.Integer> variableMapping)
-
createExtend
protected void createExtend(BinaryReflexiveTransitiveClosure binaryTransitiveClosure, java.util.Map<PVariable,java.lang.Integer> variableMapping)
- Since:
- 2.0
-
createExtend
protected void createExtend(ConstantValue constant, java.util.Map<PVariable,java.lang.Integer> variableMapping)
-
createExtend
protected void createExtend(ExpressionEvaluation expressionEvaluation, java.util.Map<PVariable,java.lang.Integer> variableMapping)
-
createExtend
protected void createExtend(AggregatorConstraint aggregator, java.util.Map<PVariable,java.lang.Integer> variableMapping)
-
createExtend
protected void createExtend(PatternMatchCounter patternMatchCounter, java.util.Map<PVariable,java.lang.Integer> variableMapping)
-
-