Interface ConjunctiveQueryWithNegatedParts
- All Superinterfaces:
Query
- All Known Implementing Classes:
DefaultConjunctiveQueryWithNegatedParts, RuleWrapper2ConjunctiveQueryWithNegatedParts
This interface represents a conjunctive query with negated parts. Such a query is composed of a set of atoms which must be true and other sets of atoms whose for each set at least one atom must be false.
In the following, X is the set of free variables (answer variables), Y the
set of variables that appear in the positive part minus X and Zi where i ∈
[1..n] the set of variables that appear only in the ith negated part. Note
that each variable from X and Y must appear in the positive part but only a
subpart of them may appear in each Zi. $ ∀i,j ∈ [1..n] such that i ≠ j, Zi ∩
Zj = ∅.
A conjunctive query with negated parts Q is formally defined as
∃Y∀Z1..Zn(Q+[X,Y] ∧ not(Q1[X,Y,Z1]) ∧ ... ∧ not(Qn[X,Y,Zn])) where Q+, Q1,
..., Qn are conjunctions of atoms over specified variable sets.
For example,
the query (b ^c ^ NOT(a,e) ^ NOT(a,f) ) answers true on {b,c}, {b,c,a},
{b,c,e,f}, {b,c,e}, {b,c,f} but not on {b,c,a,f} nor , {b,c,a,e}.
A mapping A from X to a set of terms is an answer to this query with respect to a set of facts iff A(Fq) is true, where Fq is the formula associated to Q.
- Author:
- Clément Sipieter (INRIA) <clement@6pi.fr>
-
Method Summary
Modifier and TypeMethodDescriptionvoidAppends this object representation to the provided builder.Get the answer variablesgetLabel()The label (the name) for this query.Get the set of facts which must be false (at least one).Get the set of facts which must be true.
-
Method Details
-
getLabel
-
getPositivePart
InMemoryAtomSet getPositivePart()Get the set of facts which must be true.- Returns:
- an atom set representing the atom conjunction of the query.
-
getNegatedParts
List<InMemoryAtomSet> getNegatedParts()Get the set of facts which must be false (at least one).- Returns:
- a list of atom sets representing negated conjunctions of atoms.
-
getAnswerVariables
-
appendTo
Appends this object representation to the provided builder.- Parameters:
sb- the target builder
-