uk.ac.man.cs.rainbow.rapa.data
Interface Value

All Superinterfaces:
Argument, VariableContainer
All Known Implementing Classes:
Expression

public interface Value
extends Argument, VariableContainer

Values in RAPA and GCL.


Method Summary
 Value apply(Unifier unifier)
          Apply a unifier to this value to get a new value.
 void compatableWith(Argument argument)
          Check that this value is compatable with the argument.
 ValueWhite[] evaluate(Map funcs, Map regs, HashMap whiteboard)
          Evaluate the expression/value under the given substitution over functions and valuation of register contents.
 boolean occurs(Substitution subst, Variable var)
          Check whether the variable occurs in this value under the given substitution.
 Value subst(GeneralSubstitution subst)
          Apply a substitution to this value to get a new value.
 Value subst(Substitution subst)
          Apply a substitution to this value to get a new value.
 Substitution unify(Substitution subst, Value val)
          Get the substitution which unifies this value with the given value, after applying the given substitution.
 
Methods inherited from interface uk.ac.man.cs.rainbow.rapa.data.VariableContainer
hasVariable
 

Method Detail

apply

public Value apply(Unifier unifier)
Apply a unifier to this value to get a new value.

subst

public Value subst(Substitution subst)
Apply a substitution to this value to get a new value.

occurs

public boolean occurs(Substitution subst,
                      Variable var)
Check whether the variable occurs in this value under the given substitution.

unify

public Substitution unify(Substitution subst,
                          Value val)
                   throws NotUnifiable
Get the substitution which unifies this value with the given value, after applying the given substitution.
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.

compatableWith

public void compatableWith(Argument argument)
                    throws CompatabilityFailure
Check that this value is compatable with the argument.
Specified by:
compatableWith in interface Argument
See Also:
GeneralSubstitution

subst

public Value subst(GeneralSubstitution subst)
Apply a substitution to this value to get a new value.

evaluate

public ValueWhite[] evaluate(Map funcs,
                             Map regs,
                             HashMap whiteboard)
Evaluate the expression/value under the given substitution over functions and valuation of register contents. May return multiple values if there are several possible valuations of the given expression.