Orbital library

orbital.logic.sign
Class SymbolBase

java.lang.Object
  extended by orbital.logic.sign.SymbolBase
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable, Symbol, Typed, Variable
Direct Known Subclasses:
UniqueSymbol

public class SymbolBase
extends java.lang.Object
implements Symbol, java.io.Serializable

Default representation of a syntactic symbol in a signature. A (syntactic) symbol is a triple ⟨name, spec, notation⟩ consisting of a name, its (arity and) type specification, and its notation.

Author:
André Platzer
See Also:
Serialized Form
Structure:
implements Symbol, implements java.io.Serializable
Stereotype:
Structure

Field Summary
static Type BOOLEAN_ATOM
          Deprecated. Since Orbital1.1 use Types.TRUTH instead.
static Type UNIVERSAL_ATOM
          Deprecated. Since Orbital1.1 use Types.INDIVIDUAL instead.
 
Constructor Summary
SymbolBase(java.lang.String signifier, Type type)
          Construct a constant symbol with a signifier, and type specification.
SymbolBase(java.lang.String signifier, Type type, Notation.NotationSpecification notation)
          Construct a constant symbol with a signifier, type specification, and notation.
SymbolBase(java.lang.String signifier, Type type, Notation.NotationSpecification notation, boolean variable)
          Construct a symbol with a signifier, type specification, and notation.
 
Method Summary
 int compareTo(java.lang.Object o)
          Compares two symbols.
 boolean equals(java.lang.Object o)
          Compares two symbols for equality according to their three components.
 Notation.NotationSpecification getNotation()
          Get the notation used when this symbol occurs.
 java.lang.String getSignifier()
          Get the signifier representing this symbol.
 Type getType()
          Get the propert type of this object.
 int hashCode()
          Returns the hash code value for this symbol.
 boolean isVariable()
          Whether this symbol is a variable symbol.
 void setNotation(Notation.NotationSpecification notation)
          Set the notation used when this symbol occurs.
 void setSignifier(java.lang.String signifier)
          Set the signifier representing this symbol.
 void setType(Type type)
          Set the type specification of this symbol.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

BOOLEAN_ATOM

public static final Type BOOLEAN_ATOM
Deprecated. Since Orbital1.1 use Types.TRUTH instead.
A type specification for logical atoms of type boolean and arity 0.

convenience constant for constructor calls.


UNIVERSAL_ATOM

public static final Type UNIVERSAL_ATOM
Deprecated. Since Orbital1.1 use Types.INDIVIDUAL instead.
A type specification for logical atomic terms (object variables and object constants) of universal type Object and arity 0. However be aware that this is not the universal type, but only the type of terms of arity 0 mapping into object.

convenience constant for constructor calls.

Constructor Detail

SymbolBase

public SymbolBase(java.lang.String signifier,
                  Type type,
                  Notation.NotationSpecification notation,
                  boolean variable)
Construct a symbol with a signifier, type specification, and notation.

Parameters:
signifier - the string representation of this symbol.
type - the type specification of this symbol.
notation - The notation used when this symbol occurs. This includes precedence and associativity information, as well. May be null for symbols with arity 0, which will be converted to the default notation specification, then.
variable - whether this is a variable symbol. true if this symbol is a variable symbol, and false if this symbol is a constant symbol.

SymbolBase

public SymbolBase(java.lang.String signifier,
                  Type type,
                  Notation.NotationSpecification notation)
Construct a constant symbol with a signifier, type specification, and notation.

Parameters:
signifier - the string representation of this symbol.
type - the type specification of this symbol.
notation - The notation used when this symbol occurs. This includes precedence and associativity information, as well. May be null for symbols with arity 0, which will be converted to the default notation specification, then.
Postconditions:
¬isVariable()

SymbolBase

public SymbolBase(java.lang.String signifier,
                  Type type)
Construct a constant symbol with a signifier, and type specification. The notation is chosen to be the default notation specification.

Parameters:
signifier - the string representation of this symbol.
type - the type specification of this symbol.
Postconditions:
¬isVariable()
Method Detail

equals

public boolean equals(java.lang.Object o)
Description copied from interface: Symbol
Compares two symbols for equality according to their three components. Two symbols are equal if they have the same signifier, type specification and notation. Then it should be asserted that they are either both variable, or both constant, because the sets of variable symbols and constant symbols are usually assumed disjunct.

Specified by:
equals in interface Symbol
Overrides:
equals in class java.lang.Object

compareTo

public int compareTo(java.lang.Object o)
Compares two symbols.

This implementation compares for notation precedence in favor of symbol name in favor of type (lexicographical).

Specified by:
compareTo in interface java.lang.Comparable
Postconditions:
only semi-consistent with equals (since Notation is)

hashCode

public int hashCode()
Description copied from interface: Symbol
Returns the hash code value for this symbol. The hash code of a symbol is defined to be the bitwise exclusive or of its components: signifier, type specification, and notation.

Specified by:
hashCode in interface Symbol
Overrides:
hashCode in class java.lang.Object

getSignifier

public java.lang.String getSignifier()
Description copied from interface: Symbol
Get the signifier representing this symbol.

Synonym(!): sign (C.S.Peirce), signifier (Saussure), token. Depending upon terminology, the "name" of a symbol is known as sign, signifier or token.

Generally the three constituents - according to C.S.Peirce - of a sign are (in their special notations, and with todays most common terminology)

Specified by:
getSignifier in interface Symbol

setSignifier

public void setSignifier(java.lang.String signifier)
Description copied from interface: Symbol
Set the signifier representing this symbol.

Specified by:
setSignifier in interface Symbol

getType

public Type getType()
Description copied from interface: Typed
Get the propert type of this object. Proper type means the most specific type, not only a supertype.

Specified by:
getType in interface Typed
Returns:
the type τ of this expression in T(Σ)τ.

setType

public void setType(Type type)
Description copied from interface: Symbol
Set the type specification of this symbol.

Specified by:
setType in interface Symbol
Parameters:
type - the type specification τ of this symbol.

getNotation

public Notation.NotationSpecification getNotation()
Description copied from interface: Symbol
Get the notation used when this symbol occurs. This includes precedence and associativity information, as well. The notation is not truely part of the abstract syntax of a formal language, but still useful for formatting and parsing. For this reason, the notation is included as a non-obligate recommendation.

Specified by:
getNotation in interface Symbol
Returns:
the notation used when this symbol occurs.

setNotation

public void setNotation(Notation.NotationSpecification notation)
Description copied from interface: Symbol
Set the notation used when this symbol occurs. This includes precedence and associativity information, as well.

Specified by:
setNotation in interface Symbol
Parameters:
notation - the notation used when this symbol occurs.

isVariable

public boolean isVariable()
Description copied from interface: Symbol
Whether this symbol is a variable symbol.

Note that the distinction between variable symbols and constant symbols is independent of the distinction between variable and constant interpretant functions. Especially, it is independent of the arity of this symbol.

Even though in the case of first-order logic, only object variables can occur, higher-order logic also provides function-variable symbols and predicate-variables. Then there truly is the terminologically confusing special case of variable symbols for constant functions (i.e. functions of arity 0).

Specified by:
isVariable in interface Symbol
Specified by:
isVariable in interface Variable
Returns:
true if this symbol is a variable symbol, and false if this symbol is a constant symbol.
See Also:
Variable

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

Orbital library
1.3.0: 11 Apr 2009

Copyright © 1996-2009 André Platzer
All Rights Reserved.