Class UnfoldingAtomicFOQueryEvaluator<QD extends QueryableData>
java.lang.Object
fr.inria.rules.integraal.query_evaluation.atomic.UnfoldingAtomicFOQueryEvaluator<QD>
- Type Parameters:
QD- the queried data type
- All Implemented Interfaces:
FOQueryEvaluator<Atom,QD>, QueryEvaluator<FOQuery<? extends Atom>, QD>
public class UnfoldingAtomicFOQueryEvaluator<QD extends QueryableData>
extends Object
implements FOQueryEvaluator<Atom,QD>
Evaluates an Atomic FOQuery using the <= condition given from a rule compilation
Given a factbase F an atomic query A and unfold(A) = {A′, A′′, A′′′} The ≲-homomorphism(A, F) ≡ homomorphism(A′, F) homomorphism(A′′, F) homomorphism(A′′′, F)
Given a factbase F an atomic query A and unfold(A) = {A′, A′′, A′′′} The ≲-homomorphism(A, F) ≡ homomorphism(A′, F) homomorphism(A′′, F) homomorphism(A′′′, F)
- Author:
- Florent Tornil
-
Constructor Summary
ConstructorsConstructorDescriptionUnfoldingAtomicFOQueryEvaluator(RuleCompilation compilation) Constructor using a compilation
Using the AtomicFOQueryEvaluator by defaultUnfoldingAtomicFOQueryEvaluator(RuleCompilation compilation, FOQueryEvaluator<Atom, QD> atomicEvaluator) Constructor using a compilation and a specific atomic query evaluator -
Method Summary
Modifier and TypeMethodDescriptionevaluate(FOQuery<? extends Atom> query, QD queryableData, Collection<Variable> vars, Substitution preHomomorphism) Proceeds by first unfolding the atomic queries, and then by answering every unfolding.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface FOQueryEvaluator
prepareQuery, prepareQueryMethods inherited from interface QueryEvaluator
countAnswers, countHomomorphism, evaluate, evaluate, existAnswer, existAnswer, existHomomorphism, existHomomorphism, homomorphism, homomorphism, postprocessResult, postprocessResult
-
Constructor Details
-
UnfoldingAtomicFOQueryEvaluator
Constructor using a compilation
Using the AtomicFOQueryEvaluator by default- Parameters:
compilation- the rule compilation to compute homomorphisms according to
-
UnfoldingAtomicFOQueryEvaluator
public UnfoldingAtomicFOQueryEvaluator(RuleCompilation compilation, FOQueryEvaluator<Atom, QD> atomicEvaluator) Constructor using a compilation and a specific atomic query evaluator- Parameters:
compilation- the rule compilation to compute homomorphisms according toatomicEvaluator- the evaluator for unfolded queries
-
-
Method Details
-
evaluate
public Stream<Substitution> evaluate(FOQuery<? extends Atom> query, QD queryableData, Collection<Variable> vars, Substitution preHomomorphism) throws EvaluationException Proceeds by first unfolding the atomic queries, and then by answering every unfolding.- Specified by:
evaluatein interfaceFOQueryEvaluator<Atom, QD extends QueryableData>- Specified by:
evaluatein interfaceQueryEvaluator<FOQuery<? extends Atom>, QD extends QueryableData>- Parameters:
query- the query to evaluatequeryableData- the data source against which the query is evaluatedvars- variables constrained to constant answerspreHomomorphism- a partial substitution to extend- Returns:
- a stream of substitutions answering the query
- Throws:
EvaluationException- if the evaluation cannot be completed
-