Interface RuleCompilationCondition

All Known Implementing Classes:
IDRuleCompilationCondition

public interface RuleCompilationCondition
A RuleCompilationCondition is a structure that represents a condition as defined in Melanie König's thesis.
A condition is defined as c = (q, p, Eq, Lp)
Author:
Florent Tornil
  • Method Details

    • check

      boolean check(Atom a, Atom b)
      Checks whether this condition applies between two atoms.
      Parameters:
      a - an atom
      b - an atom
      Returns:
      true iff this condition applies for a <= b
    • instantiate

      org.apache.commons.lang3.tuple.Pair<List<Term>, Substitution> instantiate(List<Term> head)
      Instantiates the body-side terms produced by this condition. The terms are returned with a substitution representing the specialization from the unification with the compiled rule.
      Parameters:
      head - a list of term
      Returns:
      a list of terms corresponding to the body of this condition
    • composeWith

      Compose the current Condition with another Condition. (x,y,x) -> (x,y) with (x,x) -> (x) produce (x,x,x) -> (x) (x,y,x) -> (y,x) with (x,y) -> (y) produce (x,y,x) -> (y)
      Parameters:
      condition - another condition
      Returns:
      a new Condition representing the composition.
    • isIdentity

      boolean isIdentity()
      Indicates whether this condition is the identity condition.
      Returns:
      true if the current condition represents an identity condition, false otherwise.
    • homomorphism

      Substitution homomorphism(List<Term> head, List<Term> to, Substitution initialSub)
      This method assumes that a <= b according to this condition.
      Compute the homomorphism from head to to with respect to initialSub
      Parameters:
      head - a list of terms
      to - a list of terms
      initialSub - a substitution
      Returns:
      the substitution from head to to with respect to initialSub
    • unifier

      TermPartition unifier(Atom a, Atom b)
      Computes the unifier between two atoms under this condition. This method assumes that a <= b according to this condition.
      Compute the unifier between a and b
      Parameters:
      a - an atom
      b - an atom
      Returns:
      the unification of the terms of a and b