Class BasePConstraint

java.lang.Object
tools.refinery.interpreter.matchers.psystem.BasePConstraint
All Implemented Interfaces:
PConstraint, PTraceable
Direct Known Subclasses:
DeferredPConstraint, EnumerablePConstraint

public abstract class BasePConstraint extends Object implements PConstraint
  • Field Details

    • pBody

      protected PBody pBody
  • Constructor Details

    • BasePConstraint

      public BasePConstraint(PBody pBody, Set<PVariable> affectedVariables)
  • Method Details

    • toString

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

      protected abstract String toStringRest()
    • getAffectedVariables

      public Set<PVariable> getAffectedVariables()
      Description copied from interface: PConstraint
      All variables affected by this constraint.
      Specified by:
      getAffectedVariables in interface PConstraint
    • getFunctionalDependencies

      public Map<Set<PVariable>,Set<PVariable>> getFunctionalDependencies(IQueryMetaContext context)
      Description copied from interface: PConstraint
      A (preferably minimal) cover of known functional dependencies between variables.
      Specified by:
      getFunctionalDependencies in interface PConstraint
      Returns:
      non-trivial functional dependencies in the form of {variables} --> {variables}, where dependencies with the same lhs are unified.
    • replaceVariable

      public void replaceVariable(PVariable obsolete, PVariable replacement)
      Specified by:
      replaceVariable in interface PConstraint
    • doReplaceVariable

      protected abstract void doReplaceVariable(PVariable obsolete, PVariable replacement)
    • delete

      public void delete()
      Specified by:
      delete in interface PConstraint
    • checkSanity

      public void checkSanity()
      Specified by:
      checkSanity in interface PConstraint
    • getPSystem

      public PBody getPSystem()
      For backwards compatibility. Equivalent to getBody()
    • getBody

      public PBody getBody()
      Specified by:
      getBody in interface PConstraint
      Returns:
      the query body this constraint belongs to
      Since:
      2.1
    • getMonotonousID

      public int getMonotonousID()
      Description copied from interface: PConstraint
      Returns an integer ID that is guaranteed to increase strictly monotonously for constraints within a pBody.
      Specified by:
      getMonotonousID in interface PConstraint