Table of Contents

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
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

IEnumerable<string>

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

IEnumerable<string>

AllSubAssertions

Gets all the assertions from the underlying results.

public IEnumerable<string> AllSubAssertions { get; }

Property Value

IEnumerable<string>

Assertions

Gets the assertions that determined this result.

public IEnumerable<string> Assertions { get; }

Property Value

IEnumerable<string>

Causes

Gets the underlying BooleanResultBases that caused this result.

public abstract IEnumerable<BooleanResultBase> Causes { get; }

Property Value

IEnumerable<BooleanResultBase>

Description

Gets a set of human-readable descriptions of the underlying causes.

public abstract ResultDescriptionBase Description { get; }

Property Value

ResultDescriptionBase

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

Explanation

Justification

Gets a full hierarchical breakdown of the reasons for the result.

public string Justification { get; }

Property Value

string

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

string

RootAssertions

Gets all the assertions returned from atomic propositions.

public IEnumerable<string> RootAssertions { get; }

Property Value

IEnumerable<string>

Satisfied

Gets a value indicating whether the condition is satisfied.

public abstract bool Satisfied { get; }

Property Value

bool

SubAssertions

Gets all the determinative assertions from the underlying results.

public IEnumerable<string> SubAssertions { get; }

Property Value

IEnumerable<string>

Underlying

Gets the underlying BooleanResultBase that contribute to this result.

public abstract IEnumerable<BooleanResultBase> Underlying { get; }

Property Value

IEnumerable<BooleanResultBase>

UnderlyingAllAssertionSources

Gets the underlying BooleanResultBases that are the sources of the Assertions.

public IEnumerable<BooleanResultBase> UnderlyingAllAssertionSources { get; }

Property Value

IEnumerable<BooleanResultBase>

UnderlyingAssertionSources

Gets the underlying BooleanResultBases that are the sources of the Assertions.

public IEnumerable<BooleanResultBase> UnderlyingAssertionSources { get; }

Property Value

IEnumerable<BooleanResultBase>

UnderlyingExpressionResults

Gets the underlying BooleanResultBases that represent the expression results.

public IEnumerable<BooleanResultBase> UnderlyingExpressionResults { get; }

Property Value

IEnumerable<BooleanResultBase>

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

IEnumerable<string>

Methods

And(BooleanResultBase)

Performs a logical AND operation between the current BooleanResultBase instance and another BooleanResultBase instance.

public BooleanResultBase<string> And(BooleanResultBase right)

Parameters

right BooleanResultBase

The 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

right BooleanResultBase

The 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

other BooleanResultBase

The 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

other bool

The 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

obj object

The 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

right BooleanResultBase

The 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

right BooleanResultBase

The 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

right BooleanResultBase

The 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

left BooleanResultBase

The left boolean result instance.

right BooleanResultBase

The 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

left BooleanResultBase

The left boolean result instance.

right BooleanResultBase

The 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

left BooleanResultBase

The first operand to compare.

right BooleanResultBase

The second operand to compare.

Returns

bool

true if 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

left BooleanResultBase

The first operand to compare.

right bool

The second operand to compare.

Returns

bool

true if 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

left bool

The first operand to compare.

right BooleanResultBase

The second operand to compare.

Returns

bool

true if 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

left BooleanResultBase

The left boolean result operand.

right BooleanResultBase

The 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

result BooleanResultBase

The BooleanResultBase<TMetadata> instance.

Returns

bool

true if the result is 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

result BooleanResultBase

The 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

left BooleanResultBase

The first operand to compare.

right BooleanResultBase

The second operand to compare.

Returns

bool

true if 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

left BooleanResultBase

The first operand to compare.

right bool

The second operand to compare.

Returns

bool

true if 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

left bool

The first operand to compare.

right BooleanResultBase

The second operand to compare.

Returns

bool

true if 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

result BooleanResultBase

The BooleanResultBase<TMetadata> instance.

Returns

bool

true if the result is satisfied; otherwise, false.