Interface RuleCompilation

All Known Implementing Classes:
HierarchicalRuleCompilation, IDRuleCompilation, NoRuleCompilation

public interface RuleCompilation
A RuleCompilation is a structure that represents a compilation as defined in Melanie König's thesis.
Author:
ftornil
  • Method Details

    • compile

      void compile(RuleBase rb)
      This method also removes the compiled rules from the given rulebase.
      Parameters:
      rb - rulebase to compile
    • compileAndGet

      RuleCompilationResult compileAndGet(RuleBase rb)
      Compiles the rule base and returns the compilation split.
      Parameters:
      rb - rulebase to compile
      Returns:
      the compilation result and the partition of input rules
    • isMoreSpecificThan

      boolean isMoreSpecificThan(Atom a, Atom b)
      This method is not used for the moment.
      Parameters:
      a - an atom
      b - an atom
      Returns:
      true iff a <= b
    • unfold

      Set<org.apache.commons.lang3.tuple.Pair<Atom, Substitution>> unfold(Atom a)
      The unfolding of an atom a is a set A' such that for all a' in A', a' <= a. The atom is returned with a substitution representing the specialization from the unification with the compiled rule.
      Parameters:
      a - an atom
      Returns:
      the unfolding of a with this compilation
    • isCompatible

      boolean isCompatible(Predicate p, Predicate q)
      Two predicates are compatible iff there exists a condition c = (p, q, Ep, Lq)
      Parameters:
      p - a predicate
      q - a predicate
      Returns:
      true iff p and q are compatible
    • getCompatiblePredicates

      Set<Predicate> getCompatiblePredicates(Predicate p)
      Returns every predicate compatible with the supplied one.
      Parameters:
      p - a predicate
      Returns:
      the set of all the predicates that are compatible with p
    • getHomomorphisms

      default Set<Substitution> getHomomorphisms(Atom a, Atom b)
      Compute all the possible homomorphisms from a to b
      Parameters:
      a - an atom
      b - an atom
      Returns:
      the set of substitutions from the terms of a to the terms of b
    • getHomomorphisms

      Set<Substitution> getHomomorphisms(Atom a, Atom b, Substitution s)
      Compute all the possible homomorphisms from a to b with respect to s
      Parameters:
      a - an atom
      b - an atom
      s - a substitution
      Returns:
      the set of substitutions from the terms of a to the terms of b with respect to s
    • getUnifications

      Set<TermPartition> getUnifications(Atom a, Atom b)
      Compute all the possible unifiers between a and b
      Parameters:
      a - an atom
      b - an atom
      Returns:
      the set of all partitions from the terms of b and a