Interface RuleBase

All Superinterfaces:
Iterable<FORule>
All Known Implementing Classes:
RuleBaseImpl

public interface RuleBase extends Iterable<FORule>
A RuleBase is a set of Rule
Author:
Florent Tornil
  • Method Details

    • getRules

      Collection<FORule> getRules()
      Returns all rules contained in this base.
      Returns:
      the rules of this base
    • getRulesByHeadPredicate

      Collection<FORule> getRulesByHeadPredicate(Predicate p)
      Returns the rules indexed by head predicate.
      Parameters:
      p - a predicate
      Returns:
      the rules of this base that contains at least an atom with the given predicate in the head
    • getRulesByBodyPredicate

      Collection<FORule> getRulesByBodyPredicate(Predicate p)
      Returns the rules indexed by body predicate.
      Parameters:
      p - a predicate
      Returns:
      the rules of this base that contains at least an atom with the given predicate in the body
    • add

      void add(FORule r)
      Add the given rule to the rule base
      Parameters:
      r - a rule
    • addAll

      default void addAll(Collection<FORule> rules)
      Adds all the given rules to the rule base.
      Parameters:
      rules - rules to add
    • addAll

      default void addAll(Stream<FORule> rules)
      Adds all the given rules from the supplied stream to the rule base.
      Parameters:
      rules - rules to add
    • remove

      void remove(FORule r)
      Removes the given rule from the rule base
      Parameters:
      r - a rule