Record Class FONegationImpl

java.lang.Object
java.lang.Record
fr.inria.rules.integraal.model.formula.impl.FONegationImpl
Record Components:
element - the negated formula
All Implemented Interfaces:
fr.inria.rules.dlgpemodel.api.formulas.IFormula, fr.inria.rules.dlgpemodel.api.formulas.INegation, fr.inria.rules.dlgpemodel.api.sentences.IPrintable, FOFormula, FOFormulaNegation, Substitutable<FOFormula>, TermCompound

public record FONegationImpl(FOFormula element) extends Record implements FOFormulaNegation
Default implementation of a FOFormulaNegation
Author:
Florent Tornil
  • Constructor Details

    • FONegationImpl

      public FONegationImpl(FOFormula element)
      Constructor with a sub element
      Parameters:
      element - the sub element
  • Method Details

    • getElement

      public FOFormula getElement()
      //////////////////////////////////////////////
      Specified by:
      getElement in interface fr.inria.rules.dlgpemodel.api.formulas.INegation
    • equals

      public boolean equals(Object o)
      //////////////////////////////////////////////
      Specified by:
      equals in class Record
    • toString

      public String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • applySubstitution

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

      public Stream<Term> getTerms()
      Description copied from interface: TermCompound
      Streams the first-level terms contained in this object.
      Specified by:
      getTerms in interface TermCompound
      Returns:
      a stream over all the non-nested terms (i.e., all terms that are not themselves in a compound term) For instance, for p(a,g(b)), it returns a and g(b) but not b.
    • copy

      public FOFormulaNegation copy()
      Description copied from interface: FOFormula
      Creates a deep copy of this formula.
      Specified by:
      copy in interface FOFormula
      Returns:
      a detached copy of this formula
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • element

      public FOFormula element()
      Returns the value of the element record component.
      Specified by:
      element in interface FOFormulaNegation
      Returns:
      the value of the element record component