Class IDRuleCompilation
java.lang.Object
fr.inria.rules.integraal.model.ruleCompilation.id.IDRuleCompilation
- All Implemented Interfaces:
RuleCompilation
Version as implemented by Melanie in graal
Compilation for atomic rules (head and body) with no existential variables or constants
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidThis method also removes the compiled rules from the given rulebase.Creates a record with the partition of the compiled rules.Returns every predicate compatible with the supplied one.getHomomorphisms(Atom a, Atom b, Substitution s) Compute all the possible homomorphisms from a to b with respect to sgetUnifications(Atom a, Atom b) Compute all the possible unifiers between a and bbooleanisCompatible(Predicate p, Predicate q) Two predicates are compatible iff there exists a condition c = (p, q, Ep, Lq)booleanisMoreSpecificThan(Atom a, Atom b) This method is not used for the moment.toString()Set<org.apache.commons.lang3.tuple.Pair<Atom, Substitution>> The unfolding of an atomais a set A' such that for all a' in A', a' <= a.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface RuleCompilation
getHomomorphisms
-
Constructor Details
-
IDRuleCompilation
public IDRuleCompilation()Create a new empty compilation
-
-
Method Details
-
compile
Description copied from interface:RuleCompilationThis method also removes the compiled rules from the given rulebase.- Specified by:
compilein interfaceRuleCompilation- Parameters:
rb- rulebase to compile
-
compileAndGet
Creates a record with the partition of the compiled rules.- Specified by:
compileAndGetin interfaceRuleCompilation- Parameters:
rb- rulebase to compile- Returns:
- the compilation result and the partition of input rules
-
isMoreSpecificThan
Description copied from interface:RuleCompilationThis method is not used for the moment.- Specified by:
isMoreSpecificThanin interfaceRuleCompilation- Parameters:
a- an atomb- an atom- Returns:
- true iff a <= b
-
unfold
Description copied from interface:RuleCompilationThe unfolding of an atomais 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.- Specified by:
unfoldin interfaceRuleCompilation- Parameters:
a- an atom- Returns:
- the unfolding of a with this compilation
-
isCompatible
Description copied from interface:RuleCompilationTwo predicates are compatible iff there exists a condition c = (p, q, Ep, Lq)- Specified by:
isCompatiblein interfaceRuleCompilation- Parameters:
p- a predicateq- a predicate- Returns:
- true iff p and q are compatible
-
getCompatiblePredicates
Description copied from interface:RuleCompilationReturns every predicate compatible with the supplied one.- Specified by:
getCompatiblePredicatesin interfaceRuleCompilation- Parameters:
p- a predicate- Returns:
- the set of all the predicates that are compatible with p
-
getHomomorphisms
Description copied from interface:RuleCompilationCompute all the possible homomorphisms from a to b with respect to s- Specified by:
getHomomorphismsin interfaceRuleCompilation- Parameters:
a- an atomb- an atoms- a substitution- Returns:
- the set of substitutions from the terms of
ato the terms of b with respect to s
-
getUnifications
Description copied from interface:RuleCompilationCompute all the possible unifiers between a and b- Specified by:
getUnificationsin interfaceRuleCompilation- Parameters:
a- an atomb- an atom- Returns:
- the set of all partitions from the terms of b and a
-
toString
-