ConForM.CoopnTools.CoKer.CoopnMgr
Class CoopnTerm

java.lang.Object
  |
  +--ConForM.CoopnTools.CoKer.CoopnMgr.CoopnElement
        |
        +--ConForM.CoopnTools.CoKer.CoopnMgr.CoopnTerm
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Comparable, CoopnSyntacticElement, java.io.Serializable

public class CoopnTerm
extends CoopnElement
implements java.lang.Comparable

Coopn term.

See Also:
CoopnElement, Serialized Form

Constructor Summary
CoopnTerm()
          Simple constructor.
CoopnTerm(CoopnFunctionSymbol generator, CoopnTermAgg params)
          Simple constructor.
CoopnTerm(CoopnFunctionSymbol generator, CoopnTermAgg params, CoopnTypeRelation rel)
          Simple constructor.
CoopnTerm(CoopnObjectSymbol object)
          Simple constructor.
CoopnTerm(CoopnTermVariable variable)
          Simple constructor.
CoopnTerm(CoopnVariableSymbol variable)
          Simple constructor.
 
Method Summary
 java.lang.Object clone()
          Cloning method.
 int compareTo(java.lang.Object o)
           
 boolean equals(java.lang.Object obj)
          Equality method.
 int hashCode()
          Hashcode method.
 boolean hasParameters()
          Has parameters ?. return true iff this term has parameters.
 CoopnElement interpret(CoopnSubstitution sigma)
          Interpretation of this element according to a substitution.
 boolean isADTType()
          Is this term typed by an ADT type ?. return true iff this type is a class type.
 boolean isClassType()
          Is this term typed by a class type ?. return true iff this type is a class type.
 boolean isFunction()
          Is this term based on a function ?. return true iff this term is based on a function.
 boolean isGenerator()
          Is this term based on a generator ?. return true iff this term is based on a generator.
 boolean isGroundTerm()
          Is the term a ground term ?
 boolean isObject()
          Is this term based on an object ?. return true iff this term is based on an object.
 boolean isOperation()
          Is this term based on an operation ?. return true iff this term is based on an operation.
 boolean isSelf()
          Is this term Self ?. return true iff this term is Self.
 boolean isTermVariable()
          Is this term based on a term variable ?
 boolean isVariable()
          Is this term based on a variable ?. return true iff this term is based on a variable.
 CoopnTermAgg parameters()
          Get the parameters associated to this term.
 CoopnSymbol symbol()
          Get the symbol associated to this term.
 ConForM.CoopnTools.CoKer.CoopnMgr.CoopnCocoMgr.CoopnCocoElement toCoco(CoopnSymbolTable table)
          CoCo conversion method.
 ConForM.CoopnTools.CoKer.CoopnMgr.CoopnTextMgr.CoopnTextElement toCompleteText(CoopnSymbolTable table)
          Complete textual elements conversion method.
 ConForM.CoopnTools.CoKer.CoopnMgr.CoopnTextMgr.CoopnTextTerm toCompleteTextTerm(CoopnSymbolTable table)
          Get the complete textual term representing the term.
 ConForM.CoopnTools.CoKer.CoopnMgr.CoopnTextMgr.CoopnTextElement toText()
          Textual elements conversion method.
 ConForM.CoopnTools.CoKer.CoopnMgr.CoopnTextMgr.CoopnTextTerm toTextTerm()
          Get the textual term representing the term.
 CoopnType type()
          Returns the statis type of the term.
 java.lang.Object unmodifiableCopy()
          Copy the element into an unmodifiable structure.
 
Methods inherited from class ConForM.CoopnTools.CoKer.CoopnMgr.CoopnElement
cloneCoopnElement, pureCOIL, pureCOOPN, toCompleteString, toCompleteString, toCompleteString, toCompleteString, toCompleteString, toCompleteString, toCompleteText, toCompleteTokens, toCompleteTokens, toCompleteTokens, toCompleteTokens, toCompleteTokens, toCompleteTokens, toString, toString, toString, toTokens, toTokens, toTokens
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CoopnTerm

public CoopnTerm(CoopnObjectSymbol object)
          throws java.lang.IllegalArgumentException
Simple constructor. Build a term based on an object.

CoopnTerm

public CoopnTerm(CoopnVariableSymbol variable)
          throws java.lang.IllegalArgumentException
Simple constructor. Build a term based on a variable.

CoopnTerm

public CoopnTerm(CoopnTermVariable variable)
          throws java.lang.IllegalArgumentException
Simple constructor. Build a term based on a term variable; META-level

CoopnTerm

public CoopnTerm(CoopnFunctionSymbol generator,
                 CoopnTermAgg params)
          throws java.lang.IllegalArgumentException,
                 CoopnTypingProblemException,
                 CoopnArityProblemException
Simple constructor. Build a term based on a function along with parameters.

CoopnTerm

public CoopnTerm(CoopnFunctionSymbol generator,
                 CoopnTermAgg params,
                 CoopnTypeRelation rel)
          throws java.lang.IllegalArgumentException,
                 CoopnTypingProblemException,
                 CoopnArityProblemException
Simple constructor. Build a term based on a function along with parameters. The specified sub-sort/sub-type relation is used to check the term.
Parameters:
rel - the type realtion object, or null.

CoopnTerm

public CoopnTerm()
          throws java.lang.IllegalArgumentException
Simple constructor. Build a term based on SELF.
Method Detail

compareTo

public int compareTo(java.lang.Object o)
Specified by:
compareTo in interface java.lang.Comparable

interpret

public CoopnElement interpret(CoopnSubstitution sigma)
Description copied from class: CoopnElement
Interpretation of this element according to a substitution.
Overrides:
interpret in class CoopnElement
Following copied from class: ConForM.CoopnTools.CoKer.CoopnMgr.CoopnElement
Parameters:
sigma - the substitution; cannot be null
Returns:
a new CoopnElement object, coreesponding to the interpretation.

isObject

public boolean isObject()
Is this term based on an object ?. return true iff this term is based on an object.

isVariable

public boolean isVariable()
Is this term based on a variable ?. return true iff this term is based on a variable.

isTermVariable

public boolean isTermVariable()
Is this term based on a term variable ? (META-level). return true iff this term is based on a term variable.

isFunction

public boolean isFunction()
Is this term based on a function ?. return true iff this term is based on a function.

isGenerator

public boolean isGenerator()
Is this term based on a generator ?. return true iff this term is based on a generator.

isOperation

public boolean isOperation()
Is this term based on an operation ?. return true iff this term is based on an operation.

isSelf

public boolean isSelf()
Is this term Self ?. return true iff this term is Self.

hasParameters

public boolean hasParameters()
Has parameters ?. return true iff this term has parameters.

isGroundTerm

public boolean isGroundTerm()
Is the term a ground term ? A ground term is a term without variable. return true iff this term is a ground term.

symbol

public CoopnSymbol symbol()
                   throws java.lang.IllegalArgumentException
Get the symbol associated to this term.
Returns:
the symbol associated to this term.
Throws:
java.lang.IllegalArgumentException - This term is Self.

parameters

public CoopnTermAgg parameters()
Get the parameters associated to this term.
Returns:
the parameters or null, if there is no parameters.
Throws:
java.lang.IllegalArgumentException - This term is Self.

type

public CoopnType type()
Returns the statis type of the term.
Returns:
the static type of the term.

isADTType

public boolean isADTType()
Is this term typed by an ADT type ?. return true iff this type is a class type.

isClassType

public boolean isClassType()
Is this term typed by a class type ?. return true iff this type is a class type.

equals

public boolean equals(java.lang.Object obj)
Description copied from class: CoopnElement
Equality method. Must be defined in the inherited classes.
Overrides:
equals in class CoopnElement
Following copied from class: ConForM.CoopnTools.CoKer.CoopnMgr.CoopnElement
Parameters:
obj - the object to compare
Returns:
true iff this object and the parameter are equals.

hashCode

public int hashCode()
Description copied from class: CoopnElement
Hashcode method. Must be defined in the inherited classes.
Overrides:
hashCode in class CoopnElement
Following copied from class: ConForM.CoopnTools.CoKer.CoopnMgr.CoopnElement
Returns:
the hash code.

toTextTerm

public ConForM.CoopnTools.CoKer.CoopnMgr.CoopnTextMgr.CoopnTextTerm toTextTerm()
Get the textual term representing the term. Actually, a term may be represented by a unique term.
Returns:
The textual term representing the term.
Throws:
java.lang.IllegalArgumentException - This term cannot be converted to a textual representation, for example because of an arity problem.

toText

public ConForM.CoopnTools.CoKer.CoopnMgr.CoopnTextMgr.CoopnTextElement toText()
Description copied from class: CoopnElement
Textual elements conversion method. Must be defined in the inherited classes. This routine converts an element into a user-friendly textual element representing it. The string interpretation of this element is very intuitive by a user, but may be incorrect in the sense that it may be rejected by a checker.
Overrides:
toText in class CoopnElement
Following copied from class: ConForM.CoopnTools.CoKer.CoopnMgr.CoopnElement
Returns:
a CoopnTextElement image.

toCompleteTextTerm

public ConForM.CoopnTools.CoKer.CoopnMgr.CoopnTextMgr.CoopnTextTerm toCompleteTextTerm(CoopnSymbolTable table)
                                                                                throws java.lang.IllegalArgumentException
Get the complete textual term representing the term. Actually, a term may be represented by a unique term.
Returns:
The complete textual term representing the term.
Throws:
java.lang.IllegalArgumentException - This term cannot be converted to a textual representation, for example because of an arity problem.

toCompleteText

public ConForM.CoopnTools.CoKer.CoopnMgr.CoopnTextMgr.CoopnTextElement toCompleteText(CoopnSymbolTable table)
Description copied from class: CoopnElement
Complete textual elements conversion method. Must be defined in the inherited classes. This routine converts an element into a correct textual element representing it. The string interpretation of this element will be accepted by a checker, but may be difficult to read by users, due to the additionnal information, like parenthesis and so on.
Overrides:
toCompleteText in class CoopnElement
Following copied from class: ConForM.CoopnTools.CoKer.CoopnMgr.CoopnElement
Parameters:
table - the symbol table used to generate symbol references
Returns:
a CoopnTextElement image.

toCoco

public ConForM.CoopnTools.CoKer.CoopnMgr.CoopnCocoMgr.CoopnCocoElement toCoco(CoopnSymbolTable table)
                                                                       throws java.lang.IllegalArgumentException
Description copied from class: CoopnElement
CoCo conversion method. Must be defined in the inherited classes. This routine convert an element into a string representing it in a CO-opn COnpact form.
Overrides:
toCoco in class CoopnElement
Following copied from class: ConForM.CoopnTools.CoKer.CoopnMgr.CoopnElement
Parameters:
origin - the module which generated the Coco conversion
table - the symbol table used to generate symbol references
Returns:
a String image of the element.
Throws:
java.lang.IllegalArgumentException - A used symbol is not in the symbol table.

unmodifiableCopy

public java.lang.Object unmodifiableCopy()
Description copied from class: CoopnElement
Copy the element into an unmodifiable structure.
Overrides:
unmodifiableCopy in class CoopnElement
Following copied from class: ConForM.CoopnTools.CoKer.CoopnMgr.CoopnElement
Returns:
an unmodififable clone of the element.

clone

public java.lang.Object clone()
Description copied from class: CoopnElement
Cloning method. Must be defined in the inherited classes.
Overrides:
clone in class CoopnElement
Following copied from class: ConForM.CoopnTools.CoKer.CoopnMgr.CoopnElement
Returns:
a clone object.