Interface FOFormula

All Superinterfaces:
fr.inria.rules.dlgpemodel.api.formulas.IFormula, fr.inria.rules.dlgpemodel.api.sentences.IPrintable, Substitutable<FOFormula>, TermCompound
All Known Subinterfaces:
Atom, ComputedAtom, FOFormulaConjunction, FOFormulaDisjunction, FOFormulaNegation
All Known Implementing Classes:
AtomImpl, CompoundFOFormula, ComputedAtomImpl, FOConjunctionFactBaseWrapper, FOConjunctionImpl, FODisjunctionImpl, FONegationImpl

public sealed interface FOFormula extends Substitutable<FOFormula>, TermCompound, fr.inria.rules.dlgpemodel.api.formulas.IFormula permits Atom, FOFormulaConjunction, FOFormulaDisjunction, FOFormulaNegation, CompoundFOFormula
This interface represents a first order formula of atoms.
Author:
Florent Tornil
  • Field Summary

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

    WRITER
  • Method Summary

    Modifier and Type
    Method
    Description
    Applies a substitution without evaluating nested functions.
    applySubstitution(Substitution substitution, boolean evaluate)
    Applies a substitution to this formula.
    The given set does not represent any meaning on the formula as conjunctions, disjunctions and negations will be merged together.
    Makes a boolean query out of the given formula.
    Creates a deep copy of this formula.
    Streams the predicates used by this formula.
    default boolean
    Indicates whether this formula node is atomic.
    default boolean
    Indicates whether this formula node is a conjunction.
    default boolean
    Indicates whether this formula node is a disjunction.
    default boolean
    Indicates whether this formula node is a negation.

    Methods inherited from interface fr.inria.rules.dlgpemodel.api.formulas.IFormula

    exports

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

    toDLGPE
  • Method Details

    • isConjunction

      default boolean isConjunction()
      Indicates whether this formula node is a conjunction.
      Returns:
      true iff this node of the formula is a conjunction
    • isDisjunction

      default boolean isDisjunction()
      Indicates whether this formula node is a disjunction.
      Returns:
      true iff this node of the formula is a disjunction
    • isNegation

      default boolean isNegation()
      Indicates whether this formula node is a negation.
      Returns:
      true iff this node of the formula is a negation
    • isAtomic

      default boolean isAtomic()
      Indicates whether this formula node is atomic.
      Returns:
      true iff this node of the formula is a leaf
    • asAtomSet

      Set<Atom> asAtomSet()
      The given set does not represent any meaning on the formula as conjunctions, disjunctions and negations will be merged together.
      This should only be used to prepare some indexes
      Returns:
      the set of all the atoms of this formula
    • asBooleanQuery

      default FOQuery<FOFormula> asBooleanQuery()
      Makes a boolean query out of the given formula. Implementations of the interface can make use of memoization.
      Returns:
      a boolean query corresponding to the formula
    • getPredicates

      Stream<Predicate> getPredicates()
      Streams the predicates used by this formula.
      Returns:
      the set of all the predicates of the atoms of this formula
    • applySubstitution

      FOFormula applySubstitution(Substitution substitution)
      Applies a substitution without evaluating nested functions.
      Specified by:
      applySubstitution in interface Substitutable<FOFormula>
      Parameters:
      substitution - the substitution to apply
      Returns:
      the substituted formula
    • applySubstitution

      FOFormula applySubstitution(Substitution substitution, boolean evaluate)
      Applies a substitution to this formula.
      Specified by:
      applySubstitution in interface Substitutable<FOFormula>
      Parameters:
      substitution - the substitution to apply
      evaluate - whether evaluable functions should be evaluated
      Returns:
      the substituted formula
    • copy

      FOFormula copy()
      Creates a deep copy of this formula.
      Returns:
      a detached copy of this formula