Class FOQueryImpl<Formula extends FOFormula>

java.lang.Object
fr.inria.rules.dlgpemodel.HasItemInfoImpl
fr.inria.rules.dlgpemodel.SentenceImpl
fr.inria.rules.integraal.model.query.impl.FOQueryImpl<Formula>
Type Parameters:
Formula - the formula type wrapped by the query
All Implemented Interfaces:
fr.inria.rules.dlgpemodel.api.sentences.HasItemInfo, fr.inria.rules.dlgpemodel.api.sentences.IPrintable, fr.inria.rules.dlgpemodel.api.sentences.IQuery, fr.inria.rules.dlgpemodel.api.sentences.ISentence, Labeled, Printable, Sentence, Substitutable<FOQuery<Formula>>, FOQuery<Formula>, Query

public class FOQueryImpl<Formula extends FOFormula> extends fr.inria.rules.dlgpemodel.SentenceImpl implements FOQuery<Formula>
Abstract class for FOQueries. This is used to factor common code to queries such as label or getters.
Author:
Florent Tornil
  • Field Summary

    Fields inherited from interface fr.inria.rules.dlgpemodel.api.sentences.HasItemInfo

    IDENT

    Fields inherited from interface fr.inria.rules.dlgpemodel.api.sentences.IPrintable

    WRITER

    Fields inherited from interface Labeled

    NOLABEL
  • Constructor Summary

    Constructors
    Constructor
    Description
    FOQueryImpl(String label, Formula formula, Collection<Variable> answer_variables, TermPartition equalities)
    Constructor using a label
  • Method Summary

    Modifier and Type
    Method
    Description
    applySubstitution(Substitution substitution, boolean evaluate)
    Applies the given substitution to this object.
    boolean
     
    Returns the ordered answer variables of this query.
    fr.inria.rules.dlgpemodel.api.formulas.IFormula
     
    Returns the formula that defines the query body.
    Deprecated.
    The variable equalities represent equalities between variables of this query.
    int
     
    void
    Deprecated.
    Renders this object in DLGP form.
     

    Methods inherited from class fr.inria.rules.dlgpemodel.SentenceImpl

    getPatterns, setPatterns

    Methods inherited from class fr.inria.rules.dlgpemodel.HasItemInfoImpl

    getItemInfo, setItemInfo

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface fr.inria.rules.dlgpemodel.api.sentences.HasItemInfo

    getIdentifier, getInfo, getItemInfo, setIdentifier, setInfo, setItemInfo

    Methods inherited from interface fr.inria.rules.dlgpemodel.api.sentences.IPrintable

    toDLGPE

    Methods inherited from interface fr.inria.rules.dlgpemodel.api.sentences.ISentence

    setPatterns

    Methods inherited from interface Sentence

    getPatterns

    Methods inherited from interface Substitutable

    applySubstitution
  • Constructor Details

    • FOQueryImpl

      public FOQueryImpl(String label, Formula formula, Collection<Variable> answer_variables, TermPartition equalities)
      Constructor using a label
      Parameters:
      label - the label of this query
      formula - the formula of this query
      answer_variables - the list of answer variables
      equalities - the equalities of the query variables
  • Method Details

    • getBody

      public fr.inria.rules.dlgpemodel.api.formulas.IFormula getBody()
      Specified by:
      getBody in interface fr.inria.rules.dlgpemodel.api.sentences.IQuery
    • getAnswerVariables

      public Collection<Variable> getAnswerVariables()
      Description copied from interface: Query
      Returns the ordered answer variables of this query.
      Specified by:
      getAnswerVariables in interface fr.inria.rules.dlgpemodel.api.sentences.IQuery
      Specified by:
      getAnswerVariables in interface Query
      Returns:
      an ordered collection of variable representing the variables of this query that are used as answers.
    • getVariableEqualities

      public TermPartition getVariableEqualities()
      Description copied from interface: FOQuery
      The variable equalities represent equalities between variables of this query.
      These equalities are represented by a partition of the terms of the query. An empty partition mean that no equalities are expressed.
      Specified by:
      getVariableEqualities in interface FOQuery<Formula extends FOFormula>
      Returns:
      the partition of the terms of this query representing variable equalities.
    • getFormula

      public Formula getFormula()
      Description copied from interface: FOQuery
      Returns the formula that defines the query body.
      Specified by:
      getFormula in interface FOQuery<Formula extends FOFormula>
      Returns:
      the first order formula that represents this first order query
    • getLabel

      @Deprecated public String getLabel()
      Deprecated.
      //////////////////////////////////////////////
      Specified by:
      getLabel in interface Labeled
      Specified by:
      getLabel in interface Sentence
      Returns:
      the label of this object
    • setLabel

      @Deprecated public void setLabel(String label) throws UnsupportedOperationException
      Deprecated.
      Description copied from interface: Labeled
      Updates the current label.
      Specified by:
      setLabel in interface Labeled
      Specified by:
      setLabel in interface Sentence
      Parameters:
      label - the new label
      Throws:
      UnsupportedOperationException
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • applySubstitution

      public FOQuery<Formula> applySubstitution(Substitution substitution, boolean evaluate)
      Description copied from interface: Substitutable
      Applies the given substitution to this object.
      Specified by:
      applySubstitution in interface Substitutable<Formula extends FOFormula>
      Parameters:
      substitution - the substitution to apply
      evaluate - whether evaluable subterms should be forced
      Returns:
      a new instance with the substitution applied
    • toDLGP

      public String toDLGP()
      Description copied from interface: Printable
      Renders this object in DLGP form.
      Specified by:
      toDLGP in interface Printable
      Returns:
      the DLGP serialization