Struct clingo::Assignment
[−]
[src]
pub struct Assignment(_);
Represents a (partial) assignment of a particular solver.
An assignment assigns truth values to a set of literals. A literal is assigned to either true or false, or is unassigned. Furthermore, each assigned literal is associated with a decision level. There is exactly one decision literal for each decision level greater than zero. Assignments to all other literals on the same level are consequences implied by the current and possibly previous decisions. Assignments on level zero are immediate consequences of the current program. Decision levels are consecutive numbers starting with zero up to and including the current decision level.
Methods
impl Assignment
[src]
pub fn decision_level(&self) -> u32
[src]
Get the current decision level.
pub fn has_conflict(&self) -> bool
[src]
Check whether the given assignment is conflicting.
pub fn has_literal(&self, literal: Literal) -> bool
[src]
pub fn level(&self, literal: Literal) -> Option<u32>
[src]
Determine the decision level of a given literal.
Arguments
literal
- the literal
Returns the decision level of the given literal
pub fn decision(&self, level: u32) -> Option<Literal>
[src]
Determine the decision literal given a decision level.
Arguments
level
- the level
Returns the decision literal for the given decision level
pub fn is_fixed(&self, literal: Literal) -> Option<bool>
[src]
Check if a literal has a fixed truth value.
Arguments
literal
- the literal
Returns whether the literal is fixed
pub fn is_true(&self, literal: Literal) -> Option<bool>
[src]
Check if a literal is true.
Arguments
literal
- the literal Returns whether the literal is true (seeAssignment::truth_value()
)
pub fn is_false(&self, literal: Literal) -> Option<bool>
[src]
Check if a literal has a fixed truth value.
Arguments
literal
- the literal
Returns whether the literal is false (see Assignment::truth_value()
)
pub fn truth_value(&self, literal: Literal) -> Option<TruthValue>
[src]
Determine the truth value of a given literal.
Arguments
literal
- the literalvalue
- the resulting truth value
Returns whether the call was successful
pub fn size(&self) -> usize
[src]
The number of assigned literals in the assignment.
pub fn max_size(&self) -> usize
[src]
The maximum size of the assignment (if all literals are assigned).
pub fn is_total(&self) -> bool
[src]
Check if the assignmen is total, i.e. - size == max_size.
Trait Implementations
impl Debug for Assignment
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Copy for Assignment
[src]
impl Clone for Assignment
[src]
fn clone(&self) -> Assignment
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more