scphEditor
Interface IOperator

All Known Implementing Classes:
DefaultOperator, Identifier, Variable

public interface IOperator

IOperator models an operator. An IOperator object is an immutable object (so sorry, no clone), and should be used as singletons and flyweights. You can query an IOperator object for its properties as specified by this interface.

Some examples:


Field Summary
static int ASSOC
          If associative() returns ASSOC, this operator is (two-way) associative.
static int LEFT
          If associative() returns LEFT, this operator is left-associative.
static int nARY
          If arity() returns nARY, this operator is an n-ary operator, without an upper limit for the number of operands, though the lower limit is 2.
static int NONASSOC
          If associative() returns NONASSOC, this operator is non-associative.
static int RIGHT
          If associative() returns RIGHT, this operator is right-associative.
 
Method Summary
 int arity()
          Returns the arity of this operator.
 int associative()
          Returns the associativity of this operator.
 boolean commutative()
          Returns true iff this operator is commutative.
 IEmbedding format()
           
 java.lang.String id()
           
 int precedence()
          Returns the precedence, as a number, of this operator.
 java.lang.String[] proverName()
           
 java.lang.String proverName0()
           
 

Field Detail

nARY

static final int nARY
If arity() returns nARY, this operator is an n-ary operator, without an upper limit for the number of operands, though the lower limit is 2. Examples are plus,times, and, or.

See Also:
arity(), Constant Field Values

NONASSOC

static final int NONASSOC
If associative() returns NONASSOC, this operator is non-associative.

See Also:
associative(), Constant Field Values

LEFT

static final int LEFT
If associative() returns LEFT, this operator is left-associative.

See Also:
associative(), Constant Field Values

RIGHT

static final int RIGHT
If associative() returns RIGHT, this operator is right-associative.

See Also:
associative(), Constant Field Values

ASSOC

static final int ASSOC
If associative() returns ASSOC, this operator is (two-way) associative.

See Also:
associative(), Constant Field Values
Method Detail

precedence

int precedence()
Returns the precedence, as a number, of this operator. Larger number means lower precedence (looser binding), smaller number means higher precedence (tighter binding).


associative

int associative()
Returns the associativity of this operator. Possible values are NONASSOC, LEFT, RIGHT, and ASSOC.


commutative

boolean commutative()
Returns true iff this operator is commutative.


arity

int arity()
Returns the arity of this operator. Possible values are natural numbers (my natural numbers include 0) as well as nARY.


id

java.lang.String id()
Returns:
Returns the internal unique id.

format

IEmbedding format()
Returns:
the format.

proverName

java.lang.String[] proverName()
Returns:
Returns the names on the prover.

proverName0

java.lang.String proverName0()
Returns:
Returns the first name on the prover.