/// <summary> /// Visits and transforms the expression. /// </summary> /// <param name="expression">Source expression.</param> /// <returns>Transformed expression.</returns> public override IExpression Visit(EqualsExpression expression) { if (IsNegating) { return(new NotExpression(expression)); } return(expression); }
/// <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) { EqualsExpression other = obj as EqualsExpression; if (other == null) { return(false); } return(LeftArgument.Equals(other.LeftArgument) && RightArgument.Equals(other.RightArgument)); }
/// <summary> /// Visits the expression. /// </summary> /// <param name="expression">Expression.</param> public void Visit(EqualsExpression expression) { ExtractParameters(expression.LeftArgument); ExtractParameters(expression.RightArgument); }
/// <summary> /// Visits and evaluates equals expression. /// </summary> /// <param name="expression">Equals expression.</param> /// <returns>True if the specified expression evaluates as true, false otherwise.</returns> public bool Visit(EqualsExpression expression) { return(true); }
/// <summary> /// Constructs the literal from the given expression. /// </summary> /// <param name="expression">Source expression.</param> /// <param name="isNegated">Is the literal negated?</param> public EqualsLiteralCNF(EqualsExpression expression, bool isNegated) { LeftArgument = expression.LeftArgument; RightArgument = expression.RightArgument; IsNegated = isNegated; }
/// <summary> /// Visits and transforms the expression. /// </summary> /// <param name="expression">Source expression.</param> /// <returns>Transformed expression.</returns> public IExpression Visit(EqualsExpression expression) { return(new EqualsExpression(GroundTerm(expression.LeftArgument), GroundTerm(expression.RightArgument))); }
/// <summary> /// Visits and performs a property count on equals expression. /// </summary> /// <param name="expression">Equals expression.</param> /// <returns>Tuple (property satisfied count, property not satisfied count).</returns> public Tuple <double, double> Visit(EqualsExpression expression) { // this property is not taken into account return(Tuple.Create(0.0, 0.0)); }
/// <summary> /// Visits and performs a property count on equals expression. /// </summary> /// <param name="expression">Equals expression.</param> /// <returns>Tuple (property satisfied count, property not satisfied count).</returns> public Tuple <int, int> Visit(EqualsExpression expression) { return(ProcessPrimitiveExpression(expression)); }
/// <summary> /// Visits the expression. /// </summary> /// <param name="expression">Expression.</param> public override void Visit(EqualsExpression expression) { Stack.Push(new EqualsLiteralCNF(expression, IsNegated)); }
/// <summary> /// Visits and evaluates equals expression. /// </summary> /// <param name="expression">Equals expression.</param> /// <returns>True if the specified expression evaluates as true, false otherwise.</returns> public bool Visit(EqualsExpression expression) { return(GroundingManager.GroundTermDeep(expression.LeftArgument, Substitution, ReferenceState).Equals( GroundingManager.GroundTermDeep(expression.RightArgument, Substitution, ReferenceState))); }