/// <summary> /// Checks the equality of objects. /// </summary> /// <param name="obj">Object to be checked.</param> /// <returns>True if the objects are equal, false otherwise.</returns> public override bool Equals(object obj) { PredicateExpression other = obj as PredicateExpression; if (other == null) { return(false); } return(PredicateAtom.Equals(other.PredicateAtom)); }
/// <summary> /// Checks the equality of objects. /// </summary> /// <param name="obj">Object to be checked.</param> /// <returns>True if the objects are equal, false otherwise.</returns> public override bool Equals(object obj) { if (obj == this) { return true; } PredicateLiteralCNF other = obj as PredicateLiteralCNF; if (other == null) { return false; } return (PredicateAtom.Equals(other.PredicateAtom) && IsNegated == other.IsNegated); }
/// <summary> /// Creates a deep copy of the expression. /// </summary> /// <returns>Expression clone.</returns> public override IConjunctCNF Clone() { return new PredicateLiteralCNF(PredicateAtom.Clone(), IsNegated, IdManager); }
/// <summary> /// String representation. /// </summary> /// <returns>String representation.</returns> public override string ToString() { string predicateString = PredicateAtom.ToString(IdManager.Predicates); return (IsNegated) ? $"(not {predicateString})" : predicateString; }
/// <summary> /// Creates a deep copy of the expression. /// </summary> /// <returns>Expression clone.</returns> public IExpression Clone() { return(new PredicateExpression(PredicateAtom.Clone(), IdManager)); }
/// <summary> /// Constructs a hash code used in the collections. /// </summary> /// <returns>Hash code of the object.</returns> public override int GetHashCode() { return(PredicateAtom.GetHashCode()); }
/// <summary> /// String representation. /// </summary> /// <returns>String representation.</returns> public override string ToString() { return(PredicateAtom.ToString(IdManager.Predicates)); }