Class IDRuleCompilationCondition
java.lang.Object
fr.inria.rules.integraal.model.ruleCompilation.id.IDRuleCompilationCondition
- All Implemented Interfaces:
RuleCompilationCondition
Version as implemented by Melanie in graal
-
Constructor Summary
ConstructorsConstructorDescriptionIDRuleCompilationCondition(int[] condBody, int[] condHead) Create a new condition with the given encodingIDRuleCompilationCondition(Term[] body, Term[] head) Create a new condition with the given body and head as arrayIDRuleCompilationCondition(List<Term> body, List<Term> head) Create a new condition with the given body and head as list -
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks whether this condition applies between two atoms.composeWith(RuleCompilationCondition condition) Compose the current Condition with another Condition.booleanhomomorphism(List<Term> head, List<Term> to, Substitution initialSub) This method assumes that a <= b according to this condition.org.apache.commons.lang3.tuple.Pair<List<Term>, Substitution> instantiate(List<Term> head) Instantiates the body-side terms produced by this condition.booleanIndicates whether this condition is the identity condition.toString()Computes the unifier between two atoms under this condition.
-
Constructor Details
-
IDRuleCompilationCondition
public IDRuleCompilationCondition(int[] condBody, int[] condHead) Create a new condition with the given encoding- Parameters:
condBody- the conditions on the bodycondHead- the conditions on the head
-
IDRuleCompilationCondition
-
IDRuleCompilationCondition
-
-
Method Details
-
check
Description copied from interface:RuleCompilationConditionChecks whether this condition applies between two atoms.- Specified by:
checkin interfaceRuleCompilationCondition- Parameters:
a- an atomb- an atom- Returns:
- true iff this condition applies for a <= b
-
instantiate
Description copied from interface:RuleCompilationConditionInstantiates the body-side terms produced by this condition. The terms are returned with a substitution representing the specialization from the unification with the compiled rule.- Specified by:
instantiatein interfaceRuleCompilationCondition- Parameters:
head- a list of term- Returns:
- a list of terms corresponding to the body of this condition
-
composeWith
Description copied from interface:RuleCompilationConditionCompose the current Condition with another Condition. (x,y,x) -> (x,y) with (x,x) -> (x) produce (x,x,x) -> (x) (x,y,x) -> (y,x) with (x,y) -> (y) produce (x,y,x) -> (y)- Specified by:
composeWithin interfaceRuleCompilationCondition- Parameters:
condition- another condition- Returns:
- a new Condition representing the composition.
-
isIdentity
public boolean isIdentity()Description copied from interface:RuleCompilationConditionIndicates whether this condition is the identity condition.- Specified by:
isIdentityin interfaceRuleCompilationCondition- Returns:
- true if the current condition represents an identity condition, false otherwise.
-
homomorphism
Description copied from interface:RuleCompilationConditionThis method assumes that a <= b according to this condition.
Compute the homomorphism from head to to with respect to initialSub- Specified by:
homomorphismin interfaceRuleCompilationCondition- Parameters:
head- a list of termsto- a list of termsinitialSub- a substitution- Returns:
- the substitution from head to to with respect to initialSub
-
unifier
Description copied from interface:RuleCompilationConditionComputes the unifier between two atoms under this condition. This method assumes that a <= b according to this condition.
Compute the unifier between a and b- Specified by:
unifierin interfaceRuleCompilationCondition- Parameters:
a- an atomb- an atom- Returns:
- the unification of the terms of a and b
-
equals
-
toString
-