Class BooleanResultBase
- Namespace
- Motiv
- Assembly
- Motiv.dll
Represents a base class for boolean results.
public abstract class BooleanResultBase : IEquatable<BooleanResultBase>, IEquatable<bool>
- Inheritance
-
BooleanResultBase
- Implements
- Derived
-
BooleanResultBase<TMetadata>
- Inherited Members
- Extension Methods
Properties
AllAssertions
Gets all the assertions yielded by the current result, including those that are non-determinative.
public IEnumerable<string> AllAssertions { get; }
Property Value
Remarks
This will yield assertions from both satisfied and unsatisfied operands.
AllRootAssertions
Gets all the underlying assertions generated by the evaluation.
public IEnumerable<string> AllRootAssertions { get; }
Property Value
AllSubAssertions
Gets all the assertions from the underlying results.
public IEnumerable<string> AllSubAssertions { get; }
Property Value
Assertions
Gets the assertions that determined this result.
public IEnumerable<string> Assertions { get; }
Property Value
Causes
Gets the underlying BooleanResultBases that caused this result.
public abstract IEnumerable<BooleanResultBase> Causes { get; }
Property Value
Description
Gets a set of human-readable descriptions of the underlying causes.
public abstract ResultDescriptionBase Description { get; }
Property Value
Explanation
Gets the specific underlying reasons why the condition is satisfied or not. Duplicates are permitted in the result at this stage to avoid excessive de-duplication during intermediate steps. Deduplication is performed during the call to Explanation.
public abstract Explanation Explanation { get; }
Property Value
Justification
Gets a full hierarchical breakdown of the reasons for the result.
public string Justification { get; }
Property Value
Reason
Gets a concise reason for the result. If the result is a proposition, then the reason will be a single assertion. Otherwise, the result is boolean expression, and the reason will be a composition of assertions using the logical operators &, | and ^.
public string Reason { get; }
Property Value
RootAssertions
Gets all the assertions returned from atomic propositions.
public IEnumerable<string> RootAssertions { get; }
Property Value
Satisfied
Gets a value indicating whether the condition is satisfied.
public abstract bool Satisfied { get; }
Property Value
SubAssertions
Gets all the determinative assertions from the underlying results.
public IEnumerable<string> SubAssertions { get; }
Property Value
Underlying
Gets the underlying BooleanResultBase that contribute to this result.
public abstract IEnumerable<BooleanResultBase> Underlying { get; }
Property Value
UnderlyingAllAssertionSources
Gets the underlying BooleanResultBases that are the sources of the Assertions.
public IEnumerable<BooleanResultBase> UnderlyingAllAssertionSources { get; }
Property Value
UnderlyingAssertionSources
Gets the underlying BooleanResultBases that are the sources of the Assertions.
public IEnumerable<BooleanResultBase> UnderlyingAssertionSources { get; }
Property Value
UnderlyingExpressionResults
Gets the underlying BooleanResultBases that represent the expression results.
public IEnumerable<BooleanResultBase> UnderlyingExpressionResults { get; }
Property Value
UnderlyingReasons
Gets a set of human-readable expressions that represent the underlying resons/boolean-expressons of the result.
public IEnumerable<string> UnderlyingReasons { get; }
Property Value
Methods
And(BooleanResultBase)
Performs a logical AND operation between the current BooleanResultBase instance and another BooleanResultBase instance.
public BooleanResultBase<string> And(BooleanResultBase right)
Parameters
rightBooleanResultBaseThe other boolean result instance to perform the logical AND operation with.
Returns
- BooleanResultBase<string>
A new boolean result instance representing the result of the logical AND operation.
AndAlso(BooleanResultBase)
Performs a conditional AND operation between the current BooleanResultBase instance and another BooleanResultBase instance. This will short-circuit the evaluation of the right operand if the left operand is not satisfied.
public BooleanResultBase<string> AndAlso(BooleanResultBase right)
Parameters
rightBooleanResultBaseThe other boolean result instance to perform the logical AND operation with.
Returns
- BooleanResultBase<string>
A new boolean result instance representing the result of the logical AND operation.
Equals(BooleanResultBase?)
Determines whether the this object is equal to another BooleanResultBase object.
public bool Equals(BooleanResultBase? other)
Parameters
otherBooleanResultBaseThe BooleanResultBase object to compare with the current object.
Returns
- bool
true if the current object is equal to the other object; otherwise, false.
Equals(bool)
Determines whether the Satisfied Property is equal to the specified boolean value.
public bool Equals(bool other)
Parameters
otherboolThe boolean value to compare with the current BooleanResultBase object.
Returns
- bool
True if the current BooleanResultBase object is equal to the specified boolean value; otherwise, false.
Equals(object?)
Determines whether the current object is equal to another object.
public override bool Equals(object? obj)
Parameters
objobjectThe object to compare with the current object.
Returns
- bool
true if the specified object is equal to the current object; otherwise, false.
GetHashCode()
Computes the hash code for the current BooleanResultBase object.
public override int GetHashCode()
Returns
- int
A hash code for the current object.
Or(BooleanResultBase)
Performs a logical OR operation between the current BooleanResultBase instance and another BooleanResultBase instance.
public BooleanResultBase<string> Or(BooleanResultBase right)
Parameters
rightBooleanResultBaseThe other boolean result instance to perform the OR operation with.
Returns
- BooleanResultBase<string>
A new boolean result instance representing the result of the OR operation.
OrElse(BooleanResultBase)
Performs a conditional OR operation between the current BooleanResultBase instance and another BooleanResultBase instance. This will short-circuit the evaluation of the right operand if the left operand is satisfied.
public BooleanResultBase<string> OrElse(BooleanResultBase right)
Parameters
rightBooleanResultBaseThe other boolean result instance to perform the OR operation with.
Returns
- BooleanResultBase<string>
A new boolean result instance representing the result of the OR operation.
ToString()
Returns a human-readable description of the tree of conditions that make up this result.
public override string ToString()
Returns
- string
A string that describes the tree of conditions that make up this result.
XOr(BooleanResultBase)
Performs a logical exclusive OR (XOR) operation between this BooleanResultBase instance and another BooleanResultBase instance.
public BooleanResultBase<string> XOr(BooleanResultBase right)
Parameters
rightBooleanResultBaseThe other boolean result instance to perform the XOR operation with.
Returns
- BooleanResultBase<string>
A new boolean result instance representing the result of the XOR operation.
Operators
operator &(BooleanResultBase, BooleanResultBase)
Overloads the bitwise AND operator to perform a logical AND operation on two BooleanResultBase instances.
public static BooleanResultBase<string> operator &(BooleanResultBase left, BooleanResultBase right)
Parameters
leftBooleanResultBaseThe left boolean result instance.
rightBooleanResultBaseThe right boolean result instance.
Returns
- BooleanResultBase<string>
A new BooleanResultBase instance representing the result of the logical AND operation.
operator |(BooleanResultBase, BooleanResultBase)
Overloads the logical OR operator (|) to perform a logical OR operation on two BooleanResultBase instances.
public static BooleanResultBase<string> operator |(BooleanResultBase left, BooleanResultBase right)
Parameters
leftBooleanResultBaseThe left boolean result instance.
rightBooleanResultBaseThe right boolean result instance.
Returns
- BooleanResultBase<string>
A new BooleanResultBase instance representing the result of the logical OR operation.
operator ==(BooleanResultBase, BooleanResultBase)
Determines whether two BooleanResultBase<TMetadata> objects are equal.
public static bool operator ==(BooleanResultBase left, BooleanResultBase right)
Parameters
leftBooleanResultBaseThe first operand to compare.
rightBooleanResultBaseThe second operand to compare.
Returns
- bool
trueif the two objects are equal; otherwise,false.
operator ==(BooleanResultBase, bool)
Determines whether two BooleanResultBase<TMetadata> objects are equal.
public static bool operator ==(BooleanResultBase left, bool right)
Parameters
leftBooleanResultBaseThe first operand to compare.
rightboolThe second operand to compare.
Returns
- bool
trueif the two objects are equal; otherwise,false.
operator ==(bool, BooleanResultBase)
Determines whether two BooleanResultBase<TMetadata> objects are equal.
public static bool operator ==(bool left, BooleanResultBase right)
Parameters
leftboolThe first operand to compare.
rightBooleanResultBaseThe second operand to compare.
Returns
- bool
trueif the two objects are equal; otherwise,false.
operator ^(BooleanResultBase, BooleanResultBase)
Overloads the ^ operator to perform an exclusive OR (XOR) operation on two BooleanResultBase instances.
public static BooleanResultBase<string> operator ^(BooleanResultBase left, BooleanResultBase right)
Parameters
leftBooleanResultBaseThe left boolean result operand.
rightBooleanResultBaseThe right boolean result operand.
Returns
- BooleanResultBase<string>
A new BooleanResultBase instance representing the result of the XOR operation.
operator false(BooleanResultBase)
Defines the false operator for the BooleanResultBase<TMetadata> class.
public static bool operator false(BooleanResultBase result)
Parameters
resultBooleanResultBaseThe BooleanResultBase<TMetadata> instance.
Returns
- bool
trueif theresultis not satisfied; otherwise,false.
implicit operator bool(BooleanResultBase)
Defines an implicit conversion from BooleanResultBase<TMetadata> to bool.
public static implicit operator bool(BooleanResultBase result)
Parameters
resultBooleanResultBaseThe BooleanResultBase<TMetadata> instance to convert.
Returns
- bool
The boolean value indicating whether the result is satisfied.
operator !=(BooleanResultBase, BooleanResultBase)
Implements the inequality operator for comparing two instances of BooleanResultBase<TMetadata>.
public static bool operator !=(BooleanResultBase left, BooleanResultBase right)
Parameters
leftBooleanResultBaseThe first operand to compare.
rightBooleanResultBaseThe second operand to compare.
Returns
- bool
trueif the two instances are not equal; otherwise,false.
operator !=(BooleanResultBase, bool)
Determines whether two BooleanResultBase<TMetadata> objects are not equal.
public static bool operator !=(BooleanResultBase left, bool right)
Parameters
leftBooleanResultBaseThe first operand to compare.
rightboolThe second operand to compare.
Returns
- bool
trueif the two objects are not equal; otherwise,false.
operator !=(bool, BooleanResultBase)
Determines whether two BooleanResultBase<TMetadata> objects are not equal.
public static bool operator !=(bool left, BooleanResultBase right)
Parameters
leftboolThe first operand to compare.
rightBooleanResultBaseThe second operand to compare.
Returns
- bool
trueif the two objects are not equal; otherwise,false.
operator true(BooleanResultBase)
Defines the true operator for the BooleanResultBase<TMetadata> class.
public static bool operator true(BooleanResultBase result)
Parameters
resultBooleanResultBaseThe BooleanResultBase<TMetadata> instance.
Returns
- bool
trueif theresultis satisfied; otherwise,false.