Class QueryAnalyzer
java.lang.Object
tools.refinery.interpreter.matchers.psystem.analysis.QueryAnalyzer
Object responsible for computing and caching static query analysis results.
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.
- Since:
- 1.5
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetFunctionalDependencies
(Set<? extends PConstraint> constraints, boolean strict) Functional dependency information, expressed on PVariables within a body, that the selected constraints imply.getProjectedFunctionalDependencies
(PQuery query, boolean strict) Functional dependency information, expressed on query parameters, that the match set of the query is guaranteed to respect.
-
Constructor Details
-
QueryAnalyzer
-
-
Method Details
-
getProjectedFunctionalDependencies
public Map<Set<Integer>,Set<Integer>> getProjectedFunctionalDependencies(PQuery query, boolean strict) Functional dependency information, expressed on query parameters, that the match set of the query is guaranteed to respect.The type dependencies shall be expressed on the parameter index integers, NOT the
PParameter
object.- Parameters:
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 performance- Returns:
- a non-null map of functional dependencies on parameters that can be processed by
FunctionalDependencyHelper
- Since:
- 1.5
-
getFunctionalDependencies
public Map<Set<PVariable>,Set<PVariable>> getFunctionalDependencies(Set<? extends PConstraint> constraints, boolean strict) Functional dependency information, expressed on PVariables within a body, that the selected constraints imply.- Parameters:
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 performance- Returns:
- a non-null map of functional dependencies on PVariables that can be processed by
FunctionalDependencyHelper
- Since:
- 1.5
-