aminePlatform.util
Interface Matching

All Known Implementing Classes:
AmineList, AmineSet, CG, ComposedType, Concept, Relation, Term, Variable, VarListConstructor

public interface Matching

Title : util.Matching interface

Description : Matching interface specifies a set of matching operations that operates on Amine objects. The interface is implemented by Amine structures (AmineList, AmineSet, Term, Concept, Relation and CG) and of course any Java class can implement it and becomes a full Amine structure. The specification of the operations considers the presence of variables and the binding relation between variables and values.

Matching operations include: match(), equal(), unify(), subsume(), subsumeWithResult(), maximalJoin(), and generalize(). Copyright: Copyright (c) Adil KABBAJ, 2004-2009


Method Summary
 boolean equal(BindingContext bindContext, java.lang.Object bindInf, java.lang.Object obj, java.lang.Object bindInfObj)
          Check that the current object is equal with the specified object obj.
 boolean equal(java.lang.Object obj)
          Check that the current object is equal with the specified object obj.
 java.lang.Object generalize(BindingContext bindContext, java.lang.Object bindInf, java.lang.Object obj, java.lang.Object bindInfObj)
          Perform a generalization of the current object with the specified object obj, to determine what is common to the two objects.
 java.lang.Object generalize(java.lang.Object obj)
          Perform a generalization of the current object with the specified object obj, to determine what is common to the two objects.
 java.lang.Object match(byte matchOperation, BindingContext bindContext, java.lang.Object bindInf, java.lang.Object obj, java.lang.Object bindInfObj)
          Match the current object with the specified object obj, according to the value of the parameter matchOperation.
 java.lang.Object match(byte matchOperation, java.lang.Object obj)
          Match the current object with the specified object obj, according to the value of the parameter matchOperation.
 java.lang.Object maximalJoin(BindingContext bindContext, java.lang.Object bindInf, java.lang.Object obj, java.lang.Object bindInfObj)
          Perform a maximal join of the current object with the specified object obj.
 java.lang.Object maximalJoin(java.lang.Object obj)
          Perform a maximal join of the current object with the specified object obj.
 boolean subsume(BindingContext bindContext, java.lang.Object bindInf, java.lang.Object obj, java.lang.Object bindInfObj)
          Check that the current object subsumes (is more general than) the specified object obj.
 boolean subsume(java.lang.Object obj)
          Check that the current object subsumes (is more general than) the specified object obj.
 java.lang.Object subsumeWithResult(BindingContext bindContext, java.lang.Object bindInf, java.lang.Object obj, java.lang.Object bindInfObj)
          Check that the current object subsumes (is more general than) the specified object obj.
 java.lang.Object subsumeWithResult(java.lang.Object obj)
          Check that the current object subsumes (is more general than) the specified object obj.
 boolean unify(BindingContext bindContext, java.lang.Object bindInf, java.lang.Object obj, java.lang.Object bindInfObj)
          Unify the current object with the specified object obj.
 

Method Detail

match

public java.lang.Object match(byte matchOperation,
                              BindingContext bindContext,
                              java.lang.Object bindInf,
                              java.lang.Object obj,
                              java.lang.Object bindInfObj)
Match the current object with the specified object obj, according to the value of the parameter matchOperation. The matching considers the binding context and the binding information for the two objects.

Parameters:
matchOperation - A byte value that specifies which kind of matching to apply. Atually, these values are defined in AmineConstants interface and are: EQUAL, UNIFY, SUBSUME, SUBSUME_WITH_RSLT, MAXIMAL_JOIN, and GENERALIZE.
bindContext - The binding context
bindInf - The binding information for the current object
obj - The object to match with the current object
bindInfObj - The binding information for the parameter obj
Returns:
an object which is the result of the match operation

match

public java.lang.Object match(byte matchOperation,
                              java.lang.Object obj)
Match the current object with the specified object obj, according to the value of the parameter matchOperation. This version of matching does not consider the binding context and resolution.

Parameters:
matchOperation - A byte value that specifies which kind of matching to apply
obj - The object to match with the current object
Returns:
an object which is the result of the match operation

equal

public boolean equal(BindingContext bindContext,
                     java.lang.Object bindInf,
                     java.lang.Object obj,
                     java.lang.Object bindInfObj)
Check that the current object is equal with the specified object obj. The equality is a kind of matching and this version considers the binding context and the binding information for the two objects.

Parameters:
bindContext - The binding context
bindInf - The binding information for the current object
obj - The object to check the equality with the current object
bindInfObj - The binding information for the parameter obj
Returns:
true if the two objects are equal and false otherwise

equal

public boolean equal(java.lang.Object obj)
Check that the current object is equal with the specified object obj. The equality is a kind of matching and this version does not considers the binding context and the binding information for the two objects.

Parameters:
obj - The object to check the equality with the current object
Returns:
true if the two objects are equal and false otherwise

unify

public boolean unify(BindingContext bindContext,
                     java.lang.Object bindInf,
                     java.lang.Object obj,
                     java.lang.Object bindInfObj)
Unify the current object with the specified object obj. Unification has a side effect on variables that can occur in the two objects to unify. Also, an important point about unification is that variables (or anonymous variables, including absence of variables like in concepts when the designator of a concept is not specified) in the current (first) object are exitential variables, while variables in the (second) object obj are universal variables.

Parameters:
bindContext - The binding context
bindInf - The binding information for the current object
obj - The object to unify with the current object
bindInfObj - The binding information for the parameter obj
Returns:
true if the two objects can be unified and false otherwise

subsume

public boolean subsume(BindingContext bindContext,
                       java.lang.Object bindInf,
                       java.lang.Object obj,
                       java.lang.Object bindInfObj)
Check that the current object subsumes (is more general than) the specified object obj. Subsumption is a kind of matching and this version considers the binding context and the binding information for the two objects.

Parameters:
bindContext - The binding context
bindInf - The binding information for the current object
obj - The object to check its subsumption by the current object
bindInfObj - The binding information for the parameter obj
Returns:
true if the current object subsumes the specified object obj

subsume

public boolean subsume(java.lang.Object obj)
Check that the current object subsumes (is more general than) the specified object obj. Subsumption is a kind of matching and this version does not considers the binding context and the binding information for the two objects.

Parameters:
obj - The object to check its subsumption by the current object
Returns:
true if the current object subsumes the specified object obj

subsumeWithResult

public java.lang.Object subsumeWithResult(BindingContext bindContext,
                                          java.lang.Object bindInf,
                                          java.lang.Object obj,
                                          java.lang.Object bindInfObj)
Check that the current object subsumes (is more general than) the specified object obj. Subsumption is a kind of matching and this version considers the binding context and the binding information for the two objects.

Parameters:
bindContext - The binding context
bindInf - The binding information for the current object
obj - The object to check its subsumption by the current object
bindInfObj - The binding information for the parameter obj
Returns:
the image, in obj, of the current object

subsumeWithResult

public java.lang.Object subsumeWithResult(java.lang.Object obj)
Check that the current object subsumes (is more general than) the specified object obj. Subsumption is a kind of matching and this version does not considers the binding context and the binding information for the two objects.

Parameters:
obj - The object to check its subsumption by the current object
Returns:
the image, in obj, of the current object

maximalJoin

public java.lang.Object maximalJoin(BindingContext bindContext,
                                    java.lang.Object bindInf,
                                    java.lang.Object obj,
                                    java.lang.Object bindInfObj)
Perform a maximal join of the current object with the specified object obj. The join considers the binding context and the binding information for the two objects.

Parameters:
bindContext - The binding context
bindInf - The binding information for the current object
obj - The object to join with the current object
bindInfObj - The binding information for the parameter obj
Returns:
an object which is the result of the join operation

maximalJoin

public java.lang.Object maximalJoin(java.lang.Object obj)
Perform a maximal join of the current object with the specified object obj. This version of join does not considers the binding context and the binding information for the two objects.

Parameters:
obj - The object to join with the current object
Returns:
an object which is the result of the join operation

generalize

public java.lang.Object generalize(BindingContext bindContext,
                                   java.lang.Object bindInf,
                                   java.lang.Object obj,
                                   java.lang.Object bindInfObj)
Perform a generalization of the current object with the specified object obj, to determine what is common to the two objects. The generalize operation considers the binding context and the binding information for the two objects.

Parameters:
bindContext - The binding context
bindInf - The binding information for the current object
obj - The object to generalize with the current object
bindInfObj - The binding information for the parameter obj
Returns:
an object which is the result of the generalization operation

generalize

public java.lang.Object generalize(java.lang.Object obj)
Perform a generalization of the current object with the specified object obj, to determine what is common to the two objects. This version of generalize operation does not considers the binding context and the binding information for the two objects.

Parameters:
obj - The object to generalize with the current object
Returns:
an object which is the result of the generalization operation