Package FAtiMA.Core.wellFormedNames
Class Inequality
- java.lang.Object
-
- FAtiMA.Core.wellFormedNames.Substitution
-
- FAtiMA.Core.wellFormedNames.Inequality
-
- All Implemented Interfaces:
IGroundable,java.io.Serializable,java.lang.Cloneable
public class Inequality extends Substitution implements IGroundable, java.io.Serializable
Represents the condition that a variable cannot have a specified value.- Author:
- Joao Dias
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class FAtiMA.Core.wellFormedNames.Substitution
_value, _variable
-
-
Constructor Summary
Constructors Constructor Description Inequality(Substitution subst)Creates a new Inequality Condition from an existing Substitution (by negating the Substitution)Inequality(Symbol var, Symbol value)Creates a new Inequality Condition of the type [x]!=4
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectclone()Creates a new copy, which is initially equal to this inequality.booleanisGrounded()Indicates if the Inequality is grounded (no unbound variables in it's WFN) Example: 2 != 4 is grounded while [x] != 4 is not.voidMakeGround(Substitution subst)Applies a set of substitutions to the object, grounding it.voidMakeGround(java.util.ArrayList<Substitution> substs)Applies a set of substitutions to the object, grounding it.voidReplaceUnboundVariables(int id)Replaces all unbound variables in the object by applying a numeric identifier to each one.java.lang.StringtoString()Converts the inequality to a String-
Methods inherited from class FAtiMA.Core.wellFormedNames.Substitution
equals, getValue, getVariable
-
-
-
-
Constructor Detail
-
Inequality
public Inequality(Symbol var, Symbol value)
Creates a new Inequality Condition of the type [x]!=4- Parameters:
var- - the variable to be constrainedvalue- - the value that the variable cannot have
-
Inequality
public Inequality(Substitution subst)
Creates a new Inequality Condition from an existing Substitution (by negating the Substitution)- Parameters:
subst- - the Substitution to be negated- See Also:
Substitution
-
-
Method Detail
-
ReplaceUnboundVariables
public void ReplaceUnboundVariables(int id)
Replaces all unbound variables in the object by applying a numeric identifier to each one. For example, the variable [x] becomes [x4] if the received ID is 4. Attention, this method modifies the original object.- Specified by:
ReplaceUnboundVariablesin interfaceIGroundable- Parameters:
id- - the identifier to be applied
-
MakeGround
public void MakeGround(java.util.ArrayList<Substitution> substs)
Description copied from interface:IGroundableApplies a set of substitutions to the object, grounding it. Example: Applying the substitution "[X]/John" in the name "Weak([X])" returns "Weak(John)". Attention, this method modifies the original object.- Specified by:
MakeGroundin interfaceIGroundable- Parameters:
substs- - A list of substitutions of the type "[Variable]/value"- See Also:
Substitution
-
MakeGround
public void MakeGround(Substitution subst)
Applies a set of substitutions to the object, grounding it. Example: Applying the substitution "[X]/John" in the name "Weak([X])" returns "Weak(John)". Attention, this method modifies the original object.- Specified by:
MakeGroundin interfaceIGroundable- Parameters:
subst- - a substitution of the type "[Variable]/value"- See Also:
Substitution
-
isGrounded
public boolean isGrounded()
Indicates if the Inequality is grounded (no unbound variables in it's WFN) Example: 2 != 4 is grounded while [x] != 4 is not.- Specified by:
isGroundedin interfaceIGroundable- Returns:
- true if the Inequality is grounded, false otherwise
-
clone
public java.lang.Object clone()
Creates a new copy, which is initially equal to this inequality. If the new inequality changes, the original object remains the same.- Overrides:
clonein classSubstitution- Returns:
- the new created Inequality
-
toString
public java.lang.String toString()
Converts the inequality to a String- Overrides:
toStringin classSubstitution- Returns:
- the converted String
-
-