ai.planning.strips
Class Grounding

java.lang.Object
  extended by ai.planning.strips.Grounding
All Implemented Interfaces:
ai.krr.fol.Substitution
Direct Known Subclasses:
ActionType.ArrayGrounding

public abstract class Grounding
extends java.lang.Object
implements ai.krr.fol.Substitution

A Substitution maps a set of Variables to a set of Terms. In the case of a Grounding the Terms must be Constants and no Variables can be unified with other Variables.

Author:
Gerhard Wickler

Constructor Summary
Grounding()
           
 
Method Summary
abstract  boolean equals(Grounding s)
           This function compares this and the given Grounding.
abstract  ai.krr.fol.Constant getValue(ai.krr.fol.Variable aVar)
           This function returns the Term the given Variable is mapped to.
abstract  java.util.Set<ai.krr.fol.Variable> getVars()
           This function returns a Set of all the Variables that are bound in this Grounding.
abstract  int size()
           This function returns the number of variables bound by this Grounding.
 boolean unify(ai.krr.fol.Term aTerm, ai.krr.fol.Variable aVar)
           This function attempts to extend this Substitution such that the given Variable (from the "right" expression) and the given Term (from the "left") are unified and returns whether this succeeded.
 boolean unify(ai.krr.fol.Variable leftVar, ai.krr.fol.Variable rightVar)
           This function attempts to extend this Substitution such that the given Variables will be unified and returns true if this was possible.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface ai.krr.fol.Substitution
contains, unify
 

Constructor Detail

Grounding

public Grounding()
Method Detail

size

public abstract int size()

This function returns the number of variables bound by this Grounding.

Returns:
the number of mappings in this Grounding

getVars

public abstract java.util.Set<ai.krr.fol.Variable> getVars()

This function returns a Set of all the Variables that are bound in this Grounding.

Returns:
a Set of all the Variables that are instantiated by this Grounding

getValue

public abstract ai.krr.fol.Constant getValue(ai.krr.fol.Variable aVar)

This function returns the Term the given Variable is mapped to. More specifically, if there is an associated Term it returns a Term that is the instantiation of the associated Term under this Substitution. Otherwise it returns null.

Specified by:
getValue in interface ai.krr.fol.Substitution
Parameters:
aVar - the Variable the Term is being sought for
Returns:
the instantiated Term the given Variable is mapped to or null

unify

public boolean unify(ai.krr.fol.Term aTerm,
                     ai.krr.fol.Variable aVar)

This function attempts to extend this Substitution such that the given Variable (from the "right" expression) and the given Term (from the "left") are unified and returns whether this succeeded. For a Grounding this must always fail.

Specified by:
unify in interface ai.krr.fol.Substitution
Parameters:
aTerm - the Term the given Variable will be mapped to
aVar - the Variable the given Term is to be unified with
Returns:
false

unify

public boolean unify(ai.krr.fol.Variable leftVar,
                     ai.krr.fol.Variable rightVar)

This function attempts to extend this Substitution such that the given Variables will be unified and returns true if this was possible. Where this matters, the first variable is considered to come from the "left" expression and the second from the "right". For a Grounding this must always fail.

Specified by:
unify in interface ai.krr.fol.Substitution
Parameters:
leftVar - a Variable to be associated with the other given Variable
rightVar - a Variable to be associated with the other given Variable
Returns:
false

equals

public abstract boolean equals(Grounding s)

This function compares this and the given Grounding. Two Groundings are equal if they map the same Variables to the same Constants.

Parameters:
s - the Grounding this one is to be compared to
Returns:
whether the two Groundings are equivalent