Interface ConjunctiveQueryWithNegatedParts

All Superinterfaces:
Query
All Known Implementing Classes:
DefaultConjunctiveQueryWithNegatedParts, RuleWrapper2ConjunctiveQueryWithNegatedParts

public interface ConjunctiveQueryWithNegatedParts extends Query

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 Details

    • getLabel

      String getLabel()
      The label (the name) for this query.
      Specified by:
      getLabel in interface Query
      Returns:
      the label of this query.
    • 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

      List<Term> getAnswerVariables()
      Get the answer variables
      Returns:
      an Collection of Term representing the answer variables.
    • appendTo

      void appendTo(StringBuilder sb)
      Appends this object representation to the provided builder.
      Parameters:
      sb - the target builder