Class Function

java.lang.Object
  |
  +--Ident
        |
        +--Function

public class Function
extends Ident

This class represents a function indentifier

Author:
P. URSO
See Also:
Type, SortList

Constructor Summary
Function(String name, boolean c, boolean infix, Type type, SortList params)
          Constructor of the function.
 
Method Summary
 int getCP()
          Get contextual position of the function.
 int getDP()
          Get downward position of the function.
 int getIP()
          Get one induction position of this function.
 int getOrderNum()
          Accessor of the order number of the function.
 SortList getParamsType()
          Returns list of types of parameters.
 int getRA()
          Get reflexive argument position of the function.
 int getSP()
          Get transversal position of the function.
 int getTP()
          Get topward position of the function.
 Type getType()
          Returns the return type of the function.
 boolean inductionPosition(int p)
          Indicates if a specified position is an induction position.
 List inductionPositions()
          Returns a List representation of induction position of this function.
 boolean isConstant()
          Indicates if this function symbol is a constant.
 boolean isConstructor()
          Indicates if this function symbol is a constructor.
 boolean isInfix()
          Indicates if this function is infix.
 boolean lowerThan(Function f)
          Tests if this function is before (in order) than an other.
 void setCP(int p)
          Set a specified position as an contextual position for the function.
 void setDP(int p)
          Set a specified position as an downward position for the function.
 void setInductionPosition(int ip)
          Set a specified position as an induction position of the function.
 void setOrderNum(int o)
          Sets the order number of the function.
 void setRA(int p)
          Set a specified position as an reflexive argument position for a constructor.
 void setSP(int p)
          Set a specified position as an transversal position for the function.
 void setTP(int p)
          Set a specified position as an topward position for the function.
 String toString()
          Returns a string representation of this function.
 
Methods inherited from class Ident
getName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Function

public Function(String name,
                boolean c,
                boolean infix,
                Type type,
                SortList params)
Constructor of the function.
Parameters:
name - name of the function.
c - true for constructor symbol.
infix - true for infix operator.
type - return type of the function.
params - list of types of parameters.
Method Detail

isInfix

public boolean isInfix()
Indicates if this function is infix.
Returns:
true if it is an infix function.

isConstructor

public boolean isConstructor()
Indicates if this function symbol is a constructor.
Returns:
true if it is a constructor function.

isConstant

public boolean isConstant()
Indicates if this function symbol is a constant.
Returns:
true if it has no parameters.

getParamsType

public SortList getParamsType()
Returns list of types of parameters.
Returns:
list of types of parameters.

getType

public Type getType()
Returns the return type of the function.
Returns:
the return type of the function.

setOrderNum

public void setOrderNum(int o)
Sets the order number of the function.
Parameters:
o - the new order number of the function.

getOrderNum

public int getOrderNum()
Accessor of the order number of the function.
Returns:
the order number of the function.

setInductionPosition

public void setInductionPosition(int ip)
Set a specified position as an induction position of the function.
Parameters:
ip - the position.

inductionPosition

public boolean inductionPosition(int p)
Indicates if a specified position is an induction position.
Parameters:
p - the position.
Returns:
true if it is an induction position.

setDP

public void setDP(int p)
Set a specified position as an downward position for the function.
Parameters:
p - the position.

getDP

public int getDP()
Get downward position of the function.
Returns:
the DP position, -1 if none.

setTP

public void setTP(int p)
Set a specified position as an topward position for the function.
Parameters:
p - the position.

getTP

public int getTP()
Get topward position of the function.
Returns:
the TP position, -1 if none.

setCP

public void setCP(int p)
Set a specified position as an contextual position for the function.
Parameters:
p - the position.

getCP

public int getCP()
Get contextual position of the function.
Returns:
the CP position, -1 if none.

setSP

public void setSP(int p)
Set a specified position as an transversal position for the function.
Parameters:
p - the position.

getSP

public int getSP()
Get transversal position of the function.
Returns:
the SP position, -1 if none.

setRA

public void setRA(int p)
Set a specified position as an reflexive argument position for a constructor.
Parameters:
p - the position.

getRA

public int getRA()
Get reflexive argument position of the function.
Returns:
the RA position, -1 if none.

lowerThan

public boolean lowerThan(Function f)
Tests if this function is before (in order) than an other.
Parameters:
f - the other function.
Returns:
true if this function get a lower order number.

toString

public String toString()
Returns a string representation of this function.
Overrides:
toString in class Ident
Returns:
the name of function and its signature.

inductionPositions

public List inductionPositions()
Returns a List representation of induction position of this function.
Returns:
a list of integer.

getIP

public int getIP()
Get one induction position of this function.
Returns:
one position in IP, -1 if none.