Package FAtiMA.Core.wellFormedNames
Class Inequality
java.lang.Object
FAtiMA.Core.wellFormedNames.Substitution
FAtiMA.Core.wellFormedNames.Inequality
- All Implemented Interfaces:
IGroundable,Serializable,Cloneable
Represents the condition that a variable cannot have a specified value.
- Author:
- Joao Dias
- See Also:
-
Field Summary
Fields inherited from class FAtiMA.Core.wellFormedNames.Substitution
_value, _variable -
Constructor Summary
ConstructorsConstructorDescriptionInequality(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
Modifier and TypeMethodDescriptionclone()Creates a new copy, which is initially equal to this inequality.booleanIndicates 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(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.toString()Converts the inequality to a StringMethods inherited from class FAtiMA.Core.wellFormedNames.Substitution
equals, getValue, getVariable
-
Constructor Details
-
Inequality
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
Creates a new Inequality Condition from an existing Substitution (by negating the Substitution)- Parameters:
subst- - the Substitution to be negated- See Also:
-
-
Method Details
-
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
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:
-
MakeGround
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:
-
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
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
Converts the inequality to a String- Overrides:
toStringin classSubstitution- Returns:
- the converted String
-