uk.ac.man.cs.rainbow.rapa.data
Class Unary
java.lang.Object
|
+--uk.ac.man.cs.rainbow.rapa.data.Expression
|
+--uk.ac.man.cs.rainbow.rapa.data.Application
|
+--uk.ac.man.cs.rainbow.rapa.data.Unary
- All Implemented Interfaces:
- Argument, Cloneable, Serializable, Value, VariableContainer
- Direct Known Subclasses:
- Unary.Abs, Unary.Neg, Unary.Not
- public abstract class Unary
- extends Application
- implements Cloneable
- See Also:
- Serialized Form
Inner Class Summary |
static class |
Unary.Abs
Sign-removal operator. |
static class |
Unary.Neg
Numeric negation operator. |
static class |
Unary.Not
Boolean negation operator. |
Field Summary |
protected Value |
e
|
e
protected Value e
Unary
protected Unary(Value e,
Type resultType)
Unary
protected Unary()
toString
public String toString()
- Overrides:
toString
in class Application
getArgument
public Value getArgument()
inputSize
public int inputSize()
apply
public Value apply(Value[] args)
apply
public abstract Value apply(Value x)
getName
public abstract String getName()
- Overrides:
getName
in class Application
apply
public Value apply(Unifier u)
- Description copied from interface:
Value
- Apply a unifier to this value to get a new value.
- Overrides:
apply
in class Application
occurs
public boolean occurs(Substitution s,
Variable v)
- Description copied from interface:
Value
- Check whether the variable occurs in this value under the given
substitution.
- Overrides:
occurs
in class Application
unify
public Substitution unify(Substitution s,
Value ex)
throws NotUnifiable
- Description copied from interface:
Value
- Get the substitution which unifies this value with the given
value, after applying the given substitution.
- Overrides:
unify
in class Application
- Following copied from interface:
uk.ac.man.cs.rainbow.rapa.data.Value
- Parameters:
subst
- The substitution to apply first.val
- The value to unify with this value.- Returns:
- The substitution that is the combination of the given
substitution and whatever extra substitutions are necessary to
unify the two values.
- Throws:
NotUnifiable
- If the two values cannot be unified.
hashCode
public int hashCode()
- Overrides:
hashCode
in class Application
equals
public boolean equals(Value o)
- Overrides:
equals
in class Application
hasVariable
public boolean hasVariable()
- Overrides:
hasVariable
in class Application
subst
public Value subst(Substitution s)
- Description copied from interface:
Value
- Apply a substitution to this value to get a new value.
- Overrides:
subst
in class Application
subst
public Value subst(GeneralSubstitution s)
- Description copied from interface:
Value
- Apply a substitution to this value to get a new value.
- Overrides:
subst
in class Application