Class Inequality

java.lang.Object
FAtiMA.Core.wellFormedNames.Substitution
FAtiMA.Core.wellFormedNames.Inequality
All Implemented Interfaces:
IGroundable, Serializable, Cloneable

public class Inequality extends Substitution implements IGroundable, Serializable
Represents the condition that a variable cannot have a specified value.
Author:
Joao Dias
See Also:
  • Constructor Details

    • Inequality

      public Inequality(Symbol var, Symbol value)
      Creates a new Inequality Condition of the type [x]!=4
      Parameters:
      var - - the variable to be constrained
      value - - 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:
  • 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:
      ReplaceUnboundVariables in interface IGroundable
      Parameters:
      id - - the identifier to be applied
    • MakeGround

      public void MakeGround(ArrayList<Substitution> substs)
      Description copied from interface: IGroundable
      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:
      MakeGround in interface IGroundable
      Parameters:
      substs - - A list of substitutions of the type "[Variable]/value"
      See Also:
    • 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:
      MakeGround in interface IGroundable
      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:
      isGrounded in interface IGroundable
      Returns:
      true if the Inequality is grounded, false otherwise
    • clone

      public 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:
      clone in class Substitution
      Returns:
      the new created Inequality
    • toString

      public String toString()
      Converts the inequality to a String
      Overrides:
      toString in class Substitution
      Returns:
      the converted String