Interface RulesCompilation
public interface RulesCompilation
Compilation of rules used to accelerate atom rewriting and unification checks.
-
Method Summary
Modifier and TypeMethodDescriptionvoidExtract compilable rules from the specified ruleset and compile them.getIrredondant(InMemoryAtomSet atomSet) Filters redundant atom in the specified atom-set with respect to this rule compilation.fr.lirmm.graphik.util.profiler.ProfilerCollection<org.apache.commons.lang3.tuple.Pair<Atom, Substitution>> getRewritingOf(Atom father) Return the list of atom that are R-rewriting of the atom father by compiled rulesReturns the saturation produced by the compilation.Return a collection of predicate unifiable with the given oneCollection<fr.lirmm.graphik.util.Partition<Term>> getUnification(Atom father, Atom son) Return the list of c-unifier from the atom father to the atom sonhomomorphism(Atom father, Atom son) Return the list of c-homomorphisms of the atom father to the atom son.homomorphism(Atom father, Atom son, Substitution s) Return the list of c-homomorphisms of the atom father to the atom son such that it respects s.booleanisCompilable(Rule r) Return true if the given rule is compilable by this kind of rules compilation.booleanisEmpty()Returns true if this compilation object does not contain any information, false otherwise.booleanReturn true iff the atom father is implied from the atom son with compiled rules (son -> father) i. e. the atom son is a R-rewriting of the atom father by compiled rulesbooleanisMappable(Predicate father, Predicate son) Return true iff there is a way to rewrite an atom with the predicate father into an atom with the predicate son.voidLoad compilation from a preprocessed rulesetvoidsetProfiler(fr.lirmm.graphik.util.profiler.Profiler profiler)
-
Method Details
-
compile
-
load
-
getSaturation
-
isCompilable
Return true if the given rule is compilable by this kind of rules compilation.- Parameters:
r- the rule to test- Returns:
- true if the rule is compilable
-
isMappable
Return true iff there is a way to rewrite an atom with the predicate father into an atom with the predicate son.- Parameters:
father- the source predicateson- the target predicate- Returns:
- true if the source predicate can rewrite to the target predicate
-
homomorphism
Return the list of c-homomorphisms of the atom father to the atom son.
ie. return all the homomorphisms that map father with a fact implied from the atom son with compiled rules.- Parameters:
father- the source atomson- the target atom- Returns:
- the matching homomorphisms
-
homomorphism
Return the list of c-homomorphisms of the atom father to the atom son such that it respects s.
ie. return all the homomorphisms that map father with a fact implied from the atom son with compiled rules.- Parameters:
father- the source atomson- the target atoms- the substitution that must be respected- Returns:
- the matching homomorphisms
-
getUnification
Return the list of c-unifier from the atom father to the atom son- Parameters:
father- the source atomson- the target atom- Returns:
- the unifications between both atoms
-
isImplied
Return true iff the atom father is implied from the atom son with compiled rules (son -> father) i. e. the atom son is a R-rewriting of the atom father by compiled rules- Parameters:
father- the source atomson- the target atom- Returns:
- true if the target atom implies the source atom
-
getRewritingOf
Return the list of atom that are R-rewriting of the atom father by compiled rules- Parameters:
father- the atom to rewrite- Returns:
- the rewritings of the given atom
-
getUnifiablePredicate
Return a collection of predicate unifiable with the given one- Parameters:
p- the predicate to compare- Returns:
- the unifiable predicates
-
getIrredondant
Filters redundant atom in the specified atom-set with respect to this rule compilation.- Parameters:
atomSet- the atom set to reduce- Returns:
- an InMemoryAtomSet which is a subset of the specified one and which is equivalent to with respect to this rule compilation.
-
isEmpty
boolean isEmpty()Returns true if this compilation object does not contain any information, false otherwise.- Returns:
- true if this compilation object does not contain any information, false otherwise.
-
setProfiler
void setProfiler(fr.lirmm.graphik.util.profiler.Profiler profiler) -
getProfiler
fr.lirmm.graphik.util.profiler.Profiler getProfiler()
-