aminePlatform.util.cg
Class ComposedType

java.lang.Object
  extended byaminePlatform.util.cg.ComposedType
All Implemented Interfaces:
AmineConstants, AmineObject, Matching, java.io.Serializable, ToString

public class ComposedType
extends java.lang.Object
implements AmineConstants, java.io.Serializable, AmineObject, Matching

Title: util.cg.ComposedType Class

Description: An auxiliary class used to represent composed type; a special case of type, used especially in the context of SYNERGY

Copyright : Copyright (c) Adil KABBAJ 2004-2009

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface aminePlatform.util.AmineConstants
ANALOGY, B_ASSIGN, B_DSPLY_WT_DELAY, B_DSPLY_WTT_DELAY, B_TRIGGER, B_WTT_DSPLY, BLOCK_BACKWARD_PROPAGATION, BLOCK_FORWARD_PROPAGATION, CANON, CGIF, CGRAPHIC, CHECK_PRECONDITIONS, COMPARE, COMPOSED_GOAL, CONCEPT_TYPE_IDENT, CONTEXT, COVERED_BY, CPLTE_CONTRACT, DEFINITION, EQ_OR_MORE_SPCFQ, EQUAL, EXPAND, FALSE_FOCUS_LIST, FUNCTIONAL, GENERALISE, GENERALIZE, HAVE_AN_INTERSECTION, ID_ADD, ID_DIV, ID_EQ, ID_INF, ID_IS, ID_MESSAGE, ID_MUL, ID_NOT, ID_NULL, ID_OPER_AND, ID_OPER_OR, ID_SUB, ID_SUP, IN_ACTIVATION, IN_MODE, IN_MODE2, INDIVIDUAL, INDIVIDUAL_IDENT, INTEGRATED, IS_CANONIC, KEY_GLOBAL_RULE, LC_ADD, LC_AMINE_BOOLEAN, LC_AMINE_DOUBLE, LC_AMINE_INTEGER, LC_AND, LC_BOOLEAN, LC_CG, LC_CLOSE_BRKT, LC_CLOSE_PARENT, LC_CLOSE_SET, LC_COMMA, LC_COMMA_SEMI, LC_CONCEPT, LC_CONSTRUCTOR, LC_CS, LC_CUT, LC_DIFF, LC_DIV, LC_DOUBLE, LC_DSBL_BKWRD_PRPGTN, LC_DSBL_FRWRD_PRPGTN, LC_EOF, LC_EQ, LC_FOUR_POINTS, LC_IDENTIFIER, LC_IF, LC_INF, LC_INTEGER, LC_INTEROG, LC_IS, LC_JAVA_OBJECT, LC_LEFT_ARROW, LC_LIST, LC_NULL, LC_OPEN_BRKT, LC_OPEN_PARENT, LC_OPEN_SET, LC_OPER_AND, LC_OPER_OR, LC_POINT, LC_RELATION, LC_RGHT_ARROW, LC_SEMI_COMMA, LC_SET, LC_STAR, LC_STATE, LC_STRING, LC_SUB, LC_SUP, LC_TERM, LC_TWO_POINTS, LC_VAR_LIST_CONSTRUCTOR, LC_VARIABLE, LF, MAXIMAL_JOIN, MORE_GENERAL, MORE_SPECIFIC, NOTHING_TO_INTEGRATE, OPERS_WITH_RSLT, OUT_MODE, OUT_MODE2, PARTIAL_CONTRACT, PARTIAL_SUBSUME, PRJCT_OPERS, PROJECT, READ, READ_SENTENCE, RELATION_TYPE_IDENT, S_AND, S_BOOLEAN, S_CG, S_CLOSE_BRKT, S_CLOSE_PARENT, S_CLOSE_SET, S_COMMA, S_CONCEPT, S_CONSTRUCTOR, S_CUT, S_DIFF, S_DOUBLE, S_EOF, S_EQUAL, S_EXPAND, S_FALSE, S_FOUR_POINTS, S_GENERALISE, S_GENERALIZE, S_IDENTIFIER, S_IF, S_INTEGER, S_INTEROG, S_IS, S_IS_CANONIC, S_LEFT_ARROW, S_LIST, S_MAXIMAL_JOIN, S_OPEN_BRKT, S_OPEN_PARENT, S_OPEN_SET, S_POINT, S_RGHT_ARROW, S_SEMI_COMMA, S_SOURCE, S_SPECIALIZE, S_STATE, S_STRING, S_SUBSUME, S_SUBSUME_WITH_RESULT, S_SUPER, S_TARGET, S_TERM, S_THIS, S_TRUE, S_TWO_POINTS, S_UNIFY, S_VARIABLE, SITUATION, SPECIALIZE, STEADY, SUBSUME, SUBSUME_WITH_RSLT, TRIGGER, UNCOMPARABLE, UNIFY, VAR_SUPER, WAIT_ASSIGNMENT, WAIT_END_OF_ASSIGNMENT, WAIT_PRECONDITIONS, WAIT_VALUE
 
Constructor Summary
ComposedType(java.lang.Object m, Identifier mtd)
           
 
Method Summary
 void clear()
          Clear the content of the object
 java.lang.Object clone()
          Return a clone of the object without considering binding context and resolution.
 java.lang.Object clone(BindingContext bindContext, java.lang.Object bindInf)
          Clone the object, taking into account the presence of variable and the binding context and resolution.
 ComposedType copy()
           
 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.
 boolean equals(java.lang.Object obj)
           
 void finalize()
          Finalize the object
 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 getMessenger()
           
 Identifier getMethodIdent()
           
 void getVariables(java.util.ArrayList varsIdent)
          This method adds in the specified varsIdent all the variables used in the object.
static boolean isComposedType(java.lang.Object obj)
           
 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.
 void setMessenger(java.lang.Object m)
           
 void setMethodIdent(Identifier mtd)
           
 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.
 java.lang.String toString()
           
 java.lang.String toString(BindingContext bindContext, java.lang.Object bindInf, Lexicon lexicon)
          Return the textual formulation of an object, taking into account the presence of variable and the binding context and resolution.
 java.lang.String toString(Lexicon lexicon)
           
 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.
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ComposedType

public ComposedType(java.lang.Object m,
                    Identifier mtd)
Method Detail

copy

public ComposedType copy()

clear

public void clear()
Description copied from interface: AmineObject
Clear the content of the object

Specified by:
clear in interface AmineObject

isComposedType

public static boolean isComposedType(java.lang.Object obj)

finalize

public void finalize()
Finalize the object

Specified by:
finalize in interface AmineObject

equals

public boolean equals(java.lang.Object obj)

toString

public java.lang.String toString(BindingContext bindContext,
                                 java.lang.Object bindInf,
                                 Lexicon lexicon)
                          throws ToStringException
Description copied from interface: AmineObject
Return the textual formulation of an object, taking into account the presence of variable and the binding context and resolution.

Specified by:
toString in interface AmineObject
Parameters:
bindContext - The Binding context
bindInf - The binding information related to the binding context and to the current object
lexicon - The lexicon to use during the textual formulation of the current object
Returns:
a String that represents the textual formulation of the current object.
Throws:
ToStringException - if an error occurs during the textual formulation of the current object.

toString

public java.lang.String toString()

toString

public java.lang.String toString(Lexicon lexicon)
Specified by:
toString in interface ToString

clone

public java.lang.Object clone(BindingContext bindContext,
                              java.lang.Object bindInf)
Description copied from interface: AmineObject
Clone the object, taking into account the presence of variable and the binding context and resolution.

Specified by:
clone in interface AmineObject
Parameters:
bindContext - The Binding context
bindInf - The binding information related to the binding context and to the object
Returns:
A Clone of the object

clone

public java.lang.Object clone()
Description copied from interface: AmineObject
Return a clone of the object without considering binding context and resolution.

Specified by:
clone in interface AmineObject

getVariables

public void getVariables(java.util.ArrayList varsIdent)
Description copied from interface: AmineObject
This method adds in the specified varsIdent all the variables used in the object. This method is used for instance by the Prolog+CG interpreter.

Specified by:
getVariables in interface AmineObject
Parameters:
varsIdent - : an ArrayList of Variable objects

match

public java.lang.Object match(byte matchOperation,
                              BindingContext bindContext,
                              java.lang.Object bindInf,
                              java.lang.Object obj,
                              java.lang.Object bindInfObj)
Description copied from interface: Matching
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.

Specified by:
match in interface Matching
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)
Description copied from interface: Matching
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.

Specified by:
match in interface Matching
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

maximalJoin

public java.lang.Object maximalJoin(BindingContext bindContext,
                                    java.lang.Object bindInf,
                                    java.lang.Object obj,
                                    java.lang.Object bindInfObj)
Description copied from interface: Matching
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.

Specified by:
maximalJoin in interface Matching
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)
Description copied from interface: Matching
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.

Specified by:
maximalJoin in interface Matching
Parameters:
obj - The object to join with the current object
Returns:
an object which is the result of the join operation

subsume

public boolean subsume(BindingContext bindContext,
                       java.lang.Object bindInf,
                       java.lang.Object obj,
                       java.lang.Object bindInfObj)
Description copied from interface: Matching
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.

Specified by:
subsume in interface Matching
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)
Description copied from interface: Matching
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.

Specified by:
subsume in interface Matching
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)
Description copied from interface: Matching
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.

Specified by:
subsumeWithResult in interface Matching
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)
Description copied from interface: Matching
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.

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

unify

public boolean unify(BindingContext bindContext,
                     java.lang.Object bindInf,
                     java.lang.Object obj,
                     java.lang.Object bindInfObj)
Description copied from interface: Matching
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.

Specified by:
unify in interface Matching
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

equal

public boolean equal(BindingContext bindContext,
                     java.lang.Object bindInf,
                     java.lang.Object obj,
                     java.lang.Object bindInfObj)
Description copied from interface: Matching
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.

Specified by:
equal in interface Matching
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)
Description copied from interface: Matching
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.

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

generalize

public java.lang.Object generalize(BindingContext bindContext,
                                   java.lang.Object bindInf,
                                   java.lang.Object obj,
                                   java.lang.Object bindInfObj)
Description copied from interface: Matching
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.

Specified by:
generalize in interface Matching
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)
Description copied from interface: Matching
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.

Specified by:
generalize in interface Matching
Parameters:
obj - The object to generalize with the current object
Returns:
an object which is the result of the generalization operation

getMessenger

public java.lang.Object getMessenger()

setMessenger

public void setMessenger(java.lang.Object m)

getMethodIdent

public Identifier getMethodIdent()

setMethodIdent

public void setMethodIdent(Identifier mtd)