NanoByte SAT Solver
Public Member Functions | Static Public Member Functions | Properties | List of all members
NanoByte.SatSolver.Literal< T > Class Template Reference

A Boolean Literal. More...

Inheritance diagram for NanoByte.SatSolver.Literal< T >:

Public Member Functions

 Literal (T value, bool negated=false)
 Creates a Literal. More...
 
Literal< T > Negate ()
 Returns a negated copy of this Literal. More...
 
bool ConflictsWith (Literal< T > literal)
 Checks whether this Literal conflicts with the given literal . More...
 
bool IsPure (IEnumerable< Literal< T >> literals)
 Checks whether this Literal conflicts with any of the given literals . More...
 
override string ToString ()
 
bool Equals (Literal< T > other)
 
override bool Equals (object obj)
 
override int GetHashCode ()
 

Static Public Member Functions

static implicit operator Literal< T > (T value)
 Creates a Literal<T>. More...
 
static Literal< T > operator ! (Literal< T > literal)
 Returns a negated copy of this Literal. More...
 
static implicit operator Clause< T > (Literal< T > literal)
 Creates a Clause<T> consisting of a single Literal<T>. More...
 
static Clause< T > operator| (Literal< T > literal1, Literal< T > literal2)
 Creates a Clause<T> consisting of two Literal<T>s. More...
 
static Formula< T > operator & (Literal< T > literal1, Literal< T > literal2)
 Creates a Formula<T> consisting of two Clause<T>s, each containing a single Literal<T>. More...
 
static bool operator== (Literal< T > left, Literal< T > right)
 
static bool operator != (Literal< T > left, Literal< T > right)
 
static Literal< T > Of< T > (T value)
 Creates a Literal<T>. More...
 

Properties

Value [get]
 The underlying value used to identify/compare Literals. More...
 
bool Negated [get]
 Indicates whether this Literal has been negated. More...
 

Detailed Description

A Boolean Literal.

Factory methods for Literal<T>s.

Template Parameters
TThe underlying type used to identify/compare Literals.
Type Constraints
T :IEquatable<T> 

Constructor & Destructor Documentation

◆ Literal()

NanoByte.SatSolver.Literal< T >.Literal ( value,
bool  negated = false 
)
inline

Creates a Literal.

Parameters
valueThe underlying value used to identify/compare Literals.
negatedIndicates whether this Literal has been negated.

Member Function Documentation

◆ ConflictsWith()

bool NanoByte.SatSolver.Literal< T >.ConflictsWith ( Literal< T >  literal)

Checks whether this Literal conflicts with the given literal .

◆ IsPure()

bool NanoByte.SatSolver.Literal< T >.IsPure ( IEnumerable< Literal< T >>  literals)

Checks whether this Literal conflicts with any of the given literals .

◆ Negate()

Literal<T> NanoByte.SatSolver.Literal< T >.Negate ( )

Returns a negated copy of this Literal.

◆ Of< T >()

static Literal<T> NanoByte.SatSolver.Literal< T >.Of< T > ( value)
static

Creates a Literal<T>.

Parameters
valueThe underlying value used to identify/compare Literals.
Type Constraints
T :IEquatable<T> 
T :new 
T :Literal<T> 
T :value 

◆ operator !()

static Literal<T> NanoByte.SatSolver.Literal< T >.operator ! ( Literal< T >  literal)
static

Returns a negated copy of this Literal.

◆ operator &()

static Formula<T> NanoByte.SatSolver.Literal< T >.operator & ( Literal< T >  literal1,
Literal< T >  literal2 
)
static

Creates a Formula<T> consisting of two Clause<T>s, each containing a single Literal<T>.

Parameters
literal1The Literal in the first Clause.
literal2The Literal in the second Clause.

◆ operator Clause< T >()

static implicit NanoByte.SatSolver.Literal< T >.operator Clause< T > ( Literal< T >  literal)
static

Creates a Clause<T> consisting of a single Literal<T>.

Parameters
literalThe single Literal in the Clause.

◆ operator Literal< T >()

static implicit NanoByte.SatSolver.Literal< T >.operator Literal< T > ( value)
static

Creates a Literal<T>.

Parameters
valueThe underlying value used to identify/compare Literals.

◆ operator|()

static Clause<T> NanoByte.SatSolver.Literal< T >.operator| ( Literal< T >  literal1,
Literal< T >  literal2 
)
static

Creates a Clause<T> consisting of two Literal<T>s.

Parameters
literal1The first Literal in the Clause.
literal2The second Literal in the Clause.

Property Documentation

◆ Negated

bool NanoByte.SatSolver.Literal< T >.Negated
get

Indicates whether this Literal has been negated.

◆ Value

T NanoByte.SatSolver.Literal< T >.Value
get

The underlying value used to identify/compare Literals.


The documentation for this class was generated from the following file: