Show / Hide Table of Contents

Class Clause<T>

A Boolean Clause. Consists of a set of Literal<T>s of which at least one must be true.

Inheritance
Object
Clause<T>
Implements
IEquatable<Clause<T>>
Namespace: NanoByte.SatSolver
Assembly: NanoByte.SatSolver.dll
Syntax
public class Clause<T> : HashSet<Literal<T>> where T : IEquatable<T>
Type Parameters
Name Description
T

The underlying type used to identify/compare Literals.

Constructors

Clause()

Creates an empty Clause.

Declaration
public Clause()

Clause(IEnumerable<Literal<T>>)

Creates a Clause consisting the specified literals.

Declaration
public Clause(IEnumerable<Literal<T>> literals)
Parameters
Type Name Description
IEnumerable<Literal<T>> literals

Properties

IsEmpty

Indicates whether this Clause is empty and therefore unsatisfiable.

Declaration
public bool IsEmpty { get; }
Property Value
Type Description
Boolean

IsUnit

Indicates whether this is a Unit Clause, i.e. contains exactly one Literal.

Declaration
public bool IsUnit { get; }
Property Value
Type Description
Boolean

Methods

Equals(Clause<T>)

Declaration
public bool Equals(Clause<T> other)
Parameters
Type Name Description
Clause<T> other
Returns
Type Description
Boolean

Equals(Object)

Declaration
public override bool Equals(object obj)
Parameters
Type Name Description
Object obj
Returns
Type Description
Boolean

GetHashCode()

Declaration
public override int GetHashCode()
Returns
Type Description
Int32

ToString()

Declaration
public override string ToString()
Returns
Type Description
String

Without(Literal<T>)

Returns a negated copy of this Clause without the specified literal.

Declaration
public Clause<T> Without(Literal<T> literal)
Parameters
Type Name Description
Literal<T> literal
Returns
Type Description
Clause<T>

Operators

BitwiseAnd(Clause<T>, Clause<T>)

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

Declaration
public static Formula<T> operator &(Clause<T> clause1, Clause<T> clause2)
Parameters
Type Name Description
Clause<T> clause1

The first Clause.

Clause<T> clause2

The second Clause.

Returns
Type Description
Formula<T>

BitwiseOr(Clause<T>, Literal<T>)

Creates a Clause<T> consisting of all Literals from an existing Clause plus an additional Literal<T>.

Declaration
public static Clause<T> operator |(Clause<T> clause, Literal<T> literal)
Parameters
Type Name Description
Clause<T> clause

The existing Clause.

Literal<T> literal

The additional Literal.

Returns
Type Description
Clause<T>

BitwiseOr(Literal<T>, Clause<T>)

Creates a Clause<T> consisting of all Literals from an existing Clause plus an additional Literal<T>.

Declaration
public static Clause<T> operator |(Literal<T> literal, Clause<T> clause)
Parameters
Type Name Description
Literal<T> literal

The additional Literal.

Clause<T> clause

The existing Clause.

Returns
Type Description
Clause<T>

Implements

System.IEquatable<T>
In This Article
Back to top Copyright Bastian Eicher