Interface RuleCompilationCondition
- All Known Implementing Classes:
IDRuleCompilationCondition
public interface RuleCompilationCondition
A RuleCompilationCondition is a structure that represents a condition as defined in Melanie König's thesis.
A condition is defined as c = (q, p, Eq, Lp)
A condition is defined as c = (q, p, Eq, Lp)
- Author:
- Florent Tornil
-
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks whether this condition applies between two atoms.composeWith(RuleCompilationCondition condition) Compose the current Condition with another Condition.homomorphism(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.Computes the unifier between two atoms under this condition.
-
Method Details
-
check
-
instantiate
Instantiates 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.- Parameters:
head- a list of term- Returns:
- a list of terms corresponding to the body of this condition
-
composeWith
Compose 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)- Parameters:
condition- another condition- Returns:
- a new Condition representing the composition.
-
isIdentity
boolean isIdentity()Indicates whether this condition is the identity condition.- Returns:
- true if the current condition represents an identity condition, false otherwise.
-
homomorphism
This method assumes that a <= b according to this condition.
Compute the homomorphism from head to to with respect to initialSub- Parameters:
head- a list of termsto- a list of termsinitialSub- a substitution- Returns:
- the substitution from head to to with respect to initialSub
-
unifier
Computes 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- Parameters:
a- an atomb- an atom- Returns:
- the unification of the terms of a and b
-