Class NegationFOQueryEvaluator<QD extends QueryableData>
java.lang.Object
fr.inria.rules.integraal.query_evaluation.negation.NegationFOQueryEvaluator<QD>
- Type Parameters:
QD- the queryable data type handled by this evaluator
- All Implemented Interfaces:
FOQueryEvaluator<FOFormulaNegation, QD>, QueryEvaluator<FOQuery<? extends FOFormulaNegation>, QD>
public class NegationFOQueryEvaluator<QD extends QueryableData>
extends Object
implements FOQueryEvaluator<FOFormulaNegation, QD>
Evaluator for ¬φ. It delegates the evaluation of the
inner formula φ to another evaluator and returns the logical negation of
its existence :
- if φ has at least one homomorphism compatible with the current pre-mapping, the result stream is empty ;
- otherwise the stream contains a single empty
Substitution.
- Author:
- Guillaume Perution-Kihli
-
Constructor Summary
ConstructorsConstructorDescriptionNegationFOQueryEvaluator(FOQueryEvaluator<FOFormula, QD> innerEvaluator) Creates a negation evaluator delegating positive subqueries to the supplied evaluator. -
Method Summary
Modifier and TypeMethodDescriptionevaluate(FOQuery<? extends FOFormulaNegation> query, QD data, Collection<Variable> mustBeGround, Substitution preHomomorphism) Evaluates a first-order query against a data source.PreparedFOQuery<? extends FOFormulaNegation, QD> prepareQuery(FOQuery<? extends FOFormulaNegation> query, QD data, Collection<Variable> mustBeGround) Creates a prepared first-order query bound to a data source and ground-term policy.toString()Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface FOQueryEvaluator
prepareQueryMethods inherited from interface QueryEvaluator
countAnswers, countHomomorphism, evaluate, evaluate, existAnswer, existAnswer, existHomomorphism, existHomomorphism, homomorphism, homomorphism, postprocessResult, postprocessResult
-
Constructor Details
-
NegationFOQueryEvaluator
Creates a negation evaluator delegating positive subqueries to the supplied evaluator.- Parameters:
innerEvaluator- the evaluator used for the inner positive formula
-
-
Method Details
-
toString
-
prepareQuery
public PreparedFOQuery<? extends FOFormulaNegation, QD> prepareQuery(FOQuery<? extends FOFormulaNegation> query, QD data, Collection<Variable> mustBeGround) Description copied from interface:FOQueryEvaluatorCreates a prepared first-order query bound to a data source and ground-term policy.- Specified by:
prepareQueryin interfaceFOQueryEvaluator<FOFormulaNegation, QD extends QueryableData>- Specified by:
prepareQueryin interfaceQueryEvaluator<FOQuery<? extends FOFormulaNegation>, QD extends QueryableData>- Parameters:
query- the query to preparedata- the data source against which the query will runmustBeGround- variables constrained to ground answers- Returns:
- a prepared query wrapper
-
evaluate
public Stream<Substitution> evaluate(FOQuery<? extends FOFormulaNegation> query, QD data, Collection<Variable> mustBeGround, Substitution preHomomorphism) throws EvaluationException Description copied from interface:FOQueryEvaluatorEvaluates a first-order query against a data source.- Specified by:
evaluatein interfaceFOQueryEvaluator<FOFormulaNegation, QD extends QueryableData>- Specified by:
evaluatein interfaceQueryEvaluator<FOQuery<? extends FOFormulaNegation>, QD extends QueryableData>- Parameters:
query- the query to evaluatedata- the data source against which the query is evaluatedmustBeGround- 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
-