Class QueryUnifierImpl
java.lang.Object
fr.inria.rules.integraal.unifier.QueryUnifierImpl
- All Implemented Interfaces:
QueryUnifier
Basic implementation for the query unifier
-
Constructor Summary
ConstructorsConstructorDescriptionQueryUnifierImpl(FOQuery<?> query, FOFormula unifiedQueryPart, TermPartition partition, FORule rule) Creates a new QueryUnifier using the given parametersQueryUnifierImpl(FOQuery<?> query, FOFormula unifiedQueryPart, TermPartition partition, FORule rule, Set<FORule> initialFORules) Creates a new QueryUnifier using the given parameters -
Method Summary
Modifier and TypeMethodDescriptionaggregate(QueryUnifier other) Creates a new unifier corresponding to the aggregation of this unifier and the given onebooleanReturns the substitution associated to this unifier.Returns the image of a formula under this unifier substitution.Not used yetReturns the term partition that realizes the unification.FOQuery<?> getQuery()Not used yetgetRule()Not used yetReturns the part of the query unified by this unifier.inthashCode()booleanisCompatible(QueryUnifier other) If the pieces of the two unifiers have atom in common the unifiers are not compatible Otherwise check if the two partition of the unifiers are possible to joinCreates a new unifier corresponding to the aggregation of this unifier and the given one Also assure that the unifiers are on a different set of variables, renaming the given one if necessary Return the aggregated unifier if possible or an empty optional if the unifiers are not compatibletoString()Methods inherited from interface QueryUnifier
apply
-
Constructor Details
-
QueryUnifierImpl
public QueryUnifierImpl(FOQuery<?> query, FOFormula unifiedQueryPart, TermPartition partition, FORule rule) Creates a new QueryUnifier using the given parameters- Parameters:
query- the query that is unifiedunifiedQueryPart- the part of the query that is unifiedpartition- the partition of the terms of the rule and the queryrule- the rule that is unified
-
QueryUnifierImpl
public QueryUnifierImpl(FOQuery<?> query, FOFormula unifiedQueryPart, TermPartition partition, FORule rule, Set<FORule> initialFORules) Creates a new QueryUnifier using the given parameters- Parameters:
query- the query that is unifiedunifiedQueryPart- the part of the query that is unifiedpartition- the partition of the terms of the rule and the queryrule- the rule that is unifiedinitialFORules- the initial rules that created the rule
-
-
Method Details
-
getRule
Description copied from interface:QueryUnifierNot used yet- Specified by:
getRulein interfaceQueryUnifier- Returns:
- the FORule where the unifier applies
-
getUnifiedQueryPart
Description copied from interface:QueryUnifierReturns the part of the query unified by this unifier.- Specified by:
getUnifiedQueryPartin interfaceQueryUnifier- Returns:
- the part of the query that is unified by this unifier
-
getQuery
Description copied from interface:QueryUnifierNot used yet- Specified by:
getQueryin interfaceQueryUnifier- Returns:
- the query unified by this unifier
-
getPartition
Description copied from interface:QueryUnifierReturns the term partition that realizes the unification.- Specified by:
getPartitionin interfaceQueryUnifier- Returns:
- the partition that unify the piece and a part of the head FORule
-
getInitialFORules
Description copied from interface:QueryUnifierNot used yet- Specified by:
getInitialFORulesin interfaceQueryUnifier- Returns:
- the initial FORules (before aggregation) where the unifier apply
-
getAssociatedSubstitution
Description copied from interface:QueryUnifierReturns the substitution associated to this unifier.- Specified by:
getAssociatedSubstitutionin interfaceQueryUnifier- Returns:
- the substitution associated to this unifier
-
getImageOf
Description copied from interface:QueryUnifierReturns the image of a formula under this unifier substitution.- Specified by:
getImageOfin interfaceQueryUnifier- Parameters:
f- a fact- Returns:
- the image of a given fact by the substitution associated to this unifier
-
safeAggregate
Description copied from interface:QueryUnifierCreates a new unifier corresponding to the aggregation of this unifier and the given one Also assure that the unifiers are on a different set of variables, renaming the given one if necessary Return the aggregated unifier if possible or an empty optional if the unifiers are not compatible- Specified by:
safeAggregatein interfaceQueryUnifier- Parameters:
u- unifier to aggregate- Returns:
- the aggregation of the given unifier and the receiving unifier
-
aggregate
Description copied from interface:QueryUnifierCreates a new unifier corresponding to the aggregation of this unifier and the given one- Specified by:
aggregatein interfaceQueryUnifier- Parameters:
other- unifier to aggregate- Returns:
- the aggregation of the given unifier and the receiving unifier
-
isCompatible
Description copied from interface:QueryUnifierIf the pieces of the two unifiers have atom in common the unifiers are not compatible Otherwise check if the two partition of the unifiers are possible to join- Specified by:
isCompatiblein interfaceQueryUnifier- Parameters:
other- unifier to check compatibility with- Returns:
- true iff this unifier is compatible with the given unifier
-
toString
-
hashCode
-
equals
-