Class AnalyserRuleSet

java.lang.Object
fr.lirmm.graphik.integraal.rulesetanalyser.util.AnalyserRuleSet
All Implemented Interfaces:
ImmutableRuleSet, Iterable<Rule>

public class AnalyserRuleSet extends Object implements ImmutableRuleSet
Immutable rule set wrapper enriched with analysis-oriented graph structures.
Author:
Clément Sipieter (INRIA) <clement@6pi.fr>
  • Constructor Details

    • AnalyserRuleSet

      public AnalyserRuleSet(Rule rule)
      Builds an analyser rule set containing a single rule.
      Parameters:
      rule - the rule to analyse
    • AnalyserRuleSet

      public AnalyserRuleSet(Iterable<Rule> rules)
      Builds an analyser rule set from the specified rules.
      Parameters:
      rules - the rules to analyse
    • AnalyserRuleSet

      public AnalyserRuleSet(Iterable<Rule> rules, fr.lirmm.graphik.integraal.api.core.unifier.DependencyChecker checker)
      Builds an analyser rule set from the specified rules and dependency checker.
      Parameters:
      rules - the rules to analyse
      checker - the dependency checker to use
    • AnalyserRuleSet

      public AnalyserRuleSet(Iterator<Rule> rules)
      Builds an analyser rule set from the specified rule iterator.
      Parameters:
      rules - the rules to analyse
    • AnalyserRuleSet

      public AnalyserRuleSet(Iterator<Rule> rules, fr.lirmm.graphik.integraal.api.core.unifier.DependencyChecker... checkers)
      Builds an analyser rule set from the specified rule iterator and dependency checkers.
      Parameters:
      rules - the rules to analyse
      checkers - the dependency checkers to apply
    • AnalyserRuleSet

      public AnalyserRuleSet(Iterator<Rule> rules, RulesCompilation compilation)
      Builds an analyser rule set from the specified iterator and compilation.
      Parameters:
      rules - the rules to analyse
      compilation - the rule compilation to use
    • AnalyserRuleSet

      public AnalyserRuleSet(CloseableIterator<Rule> rules) throws RuleSetException
      Builds an analyser rule set from a closeable iterator of rules.
      Parameters:
      rules - the rules to analyse
      Throws:
      RuleSetException - if the iterator fails
    • AnalyserRuleSet

      public AnalyserRuleSet(CloseableIterator<Rule> rules, fr.lirmm.graphik.integraal.api.core.unifier.DependencyChecker... checkers) throws RuleSetException
      Builds an analyser rule set from a closeable iterator and dependency checkers.
      Parameters:
      rules - the rules to analyse
      checkers - the dependency checkers to apply
      Throws:
      RuleSetException - if the iterator fails
    • AnalyserRuleSet

      public AnalyserRuleSet(fr.lirmm.graphik.integraal.core.grd.DefaultGraphOfRuleDependencies grd)
      Builds an analyser rule set from an already computed graph of rule dependencies.
      Parameters:
      grd - the graph of rule dependencies to wrap
  • Method Details

    • addDependencyChecker

      public void addDependencyChecker(fr.lirmm.graphik.integraal.api.core.unifier.DependencyChecker checker)
      Adds a dependency checker to this analyser rule set.
      Parameters:
      checker - the checker to add
    • removeDependencyChecker

      public void removeDependencyChecker(fr.lirmm.graphik.integraal.api.core.unifier.DependencyChecker checker)
      Removes a dependency checker from this analyser rule set.
      Parameters:
      checker - the checker to remove
    • clearDependencyChecker

      public void clearDependencyChecker()
      Removes all dependency checkers from this analyser rule set.
    • enableUnifiers

      public void enableUnifiers(boolean wu)
      Enables or disables unifier-based computations.
      Parameters:
      wu - true to enable unifiers, false otherwise
    • getGraphOfRuleDependencies

      public fr.lirmm.graphik.integraal.core.grd.DefaultGraphOfRuleDependencies getGraphOfRuleDependencies()
      Returns the graph of rule dependencies for this rule set.
      Returns:
      the graph of rule dependencies
    • setGraphOfRuleDependencies

      public void setGraphOfRuleDependencies(fr.lirmm.graphik.integraal.core.grd.DefaultGraphOfRuleDependencies grd)
      Replaces the graph of rule dependencies associated with this rule set.
      Parameters:
      grd - the graph of rule dependencies
    • getAffectedPositionSet

      public fr.lirmm.graphik.integraal.rulesetanalyser.graph.AffectedPositionSet getAffectedPositionSet()
      Returns the affected-position set associated with this rule set.
      Returns:
      the affected-position set
    • getJointlyAffectedPositionSet

      public fr.lirmm.graphik.integraal.rulesetanalyser.graph.JointlyAffectedPositionSet getJointlyAffectedPositionSet()
      Returns the jointly affected-position set associated with this rule set.
      Returns:
      the jointly affected-position set
    • getGraphPositionDependencies

      public fr.lirmm.graphik.integraal.rulesetanalyser.graph.GraphPositionDependencies getGraphPositionDependencies()
      Returns the graph of position dependencies.
      Returns:
      the graph of position dependencies
    • getMarkedVariableSet

      public fr.lirmm.graphik.integraal.rulesetanalyser.graph.MarkedVariableSet getMarkedVariableSet()
      Returns the marked-variable set associated with this rule set.
      Returns:
      the marked-variable set
    • getStronglyConnectedComponentsGraph

      public StronglyConnectedComponentsGraph<Rule> getStronglyConnectedComponentsGraph()
      Returns the strongly connected components graph of the rule-dependency graph.
      Returns:
      the SCC graph
    • getSubRuleSetAnalyser

      public AnalyserRuleSet getSubRuleSetAnalyser(Iterable<Rule> rules)
      Extracts a sub-rule-set analyser for the specified rules.
      Parameters:
      rules - the rules forming the sub-rule-set
      Returns:
      an analyser for the induced subgraph
    • getSCC

      public List<AnalyserRuleSet> getSCC()
      Returns the strongly connected components as analyser rule sets.
      Returns:
      the SCC analyser rule sets
    • contains

      public boolean contains(Rule rule)
      Description copied from interface: ImmutableRuleSet
      Returns whether the specified rule is present in this set.
      Specified by:
      contains in interface ImmutableRuleSet
      Parameters:
      rule - the rule to search for
      Returns:
      true if the rule is present
    • iterator

      public Iterator<Rule> iterator()
      Specified by:
      iterator in interface ImmutableRuleSet
      Specified by:
      iterator in interface Iterable<Rule>
    • size

      public int size()
      Description copied from interface: ImmutableRuleSet
      Returns the number of rules contained in this set.
      Specified by:
      size in interface ImmutableRuleSet
      Returns:
      the number of rules contained in this set.
    • isEmpty

      public boolean isEmpty()
      Description copied from interface: ImmutableRuleSet
      Returns whether this set contains no rule.
      Specified by:
      isEmpty in interface ImmutableRuleSet
      Returns:
      true if this set is empty