public final class QueryAnalyzer
extends java.lang.Object
Any client can instantiate this to statically analyze queries.
Query backends should share an instance obtained via IQueryBackendContext
to save resources.
Precondition: all involved queries must be initialized.
IQueryBackendContext
, or anticipate
potential future breakage when instantiating your own analyzer.Constructor and Description |
---|
QueryAnalyzer(IQueryMetaContext metaContext) |
Modifier and Type | Method and Description |
---|---|
java.util.Map<java.util.Set<PVariable>,java.util.Set<PVariable>> |
getFunctionalDependencies(java.util.Set<PConstraint> constraints,
boolean strict)
Functional dependency information, expressed on PVariables within a body, that the selected constraints imply.
|
java.util.Map<java.util.Set<java.lang.Integer>,java.util.Set<java.lang.Integer>> |
getProjectedFunctionalDependencies(PQuery query,
boolean strict)
Functional dependency information, expressed on query parameters, that the match set of the query is guaranteed to respect.
|
public QueryAnalyzer(IQueryMetaContext metaContext)
public java.util.Map<java.util.Set<java.lang.Integer>,java.util.Set<java.lang.Integer>> getProjectedFunctionalDependencies(PQuery query, boolean strict)
The type dependencies shall be expressed on the parameter index integers, NOT the PParameter
object.
strict
- if true, only "hard" dependencies are taken into account that are strictly enforced by the model representation;
if false, user-provided soft dependencies (@FunctionalDependency) are included as well, that are anticipated but not guaranteed by the storage mechanism;
use true if superfluous dependencies may taint the correctness of a computation, false if they would merely impact performanceFunctionalDependencyHelper
public java.util.Map<java.util.Set<PVariable>,java.util.Set<PVariable>> getFunctionalDependencies(java.util.Set<PConstraint> constraints, boolean strict)
constraints
- the set of constraints whose consequences will be analyzedstrict
- if true, only "hard" dependencies are taken into account that are strictly enforced by the model representation;
if false, user-provided soft dependencies (@FunctionalDependency) are included as well, that are anticipated but not guaranteed by the storage mechanism;
use true if superfluous dependencies may taint the correctness of a computation, false if they would merely impact performanceFunctionalDependencyHelper