Interface LogicStructure

All Known Subinterfaces:
ComplexLogicalFormula, QuantifiedFormula, Term<T>
All Known Implementing Classes:
AbaElement, AbaRule, AggregateAtom, AggregateElement, AggregateHead, ArithmeticTerm, ASPAtom, ASPBodyElement, ASPElement, ASPHead, ASPLiteral, ASPRule, AssociativeFolFormula, AssociativeFormulaSupport, Assumption, ChoiceElement, ChoiceHead, ClassicalHead, ComparativeAtom, ComplexLogicalFormulaAdapter, Conjunction, Constant, Contradiction, DefaultNegation, DefaultRule, DefeasibleInferenceRule, DefeasibleRule, DelpFact, DelpRule, Disjunction, Equivalence, ExclusiveDisjunction, ExistsQuantifiedFormula, FolAtom, FolFormula, ForallQuantifiedFormula, FunctionalTerm, Implication, Individual, InferenceRule, InferenceRule, MlFormula, MlnFormula, Necessity, Negation, Negation, NLPNot, NLPRule, NumberTerm, OptimizationElement, OptimizationStatement, Possibility, RelationalConditional, RelationalFormula, RelationalProbabilisticConditional, Sort, SpecialFormula, StrictInferenceRule, StrictNegation, StrictRule, StringTerm, Tautology, TermAdapter, Variable

public interface LogicStructure
This interface captures the common functionalities of formulas, sorts and terms. It allows to query for saved terms by using the type of the term it also forces sub classes to implement the toString() and clone() methods.
Author:
Tim Janus, Matthias Thimm
  • Method Summary

    Modifier and Type
    Method
    Description
    <C extends Term<?>>
    boolean
    Checks if this logical structure contains at least one term of type C.
    Set<Term<?>>
     
    <C extends Term<?>>
    Set<C>
    getTerms​(Class<C> cls)
    Processes the set containing all terms of type C.
  • Method Details

    • getTerms

      Set<Term<?>> getTerms()
      Returns:
      a set containing all terms of this logical structure
    • getTerms

      <C extends Term<?>> Set<C> getTerms(Class<C> cls)
      Processes the set containing all terms of type C. This method uses the equals method of the given Class and therefore does not add terms which are sub classes of type C to the set.
      Type Parameters:
      C - the type of terms
      Parameters:
      cls - The Class structure containing type information about the searched term
      Returns:
      A set containing all terms of type C of this logical structure
    • containsTermsOfType

      <C extends Term<?>> boolean containsTermsOfType(Class<C> cls)
      Checks if this logical structure contains at least one term of type C. This method is a shortcut for !getTerms(TermImplementation.class).isEmpty().
      Type Parameters:
      C - the type of terms
      Parameters:
      cls - The class structure representing the type C of the term.
      Returns:
      True if this logical structure contains at least one term of type C or false otherwise.