Struct clingo::Backend
[−]
[src]
pub struct Backend(_);
Handle to the backend to add directives in aspif format.
Methods
impl Backend
[src]
pub fn rule(
&mut self,
choice: bool,
head: &[Atom],
body: &[Literal]
) -> Result<(), ClingoError>
[src]
&mut self,
choice: bool,
head: &[Atom],
body: &[Literal]
) -> Result<(), ClingoError>
Add a rule to the program.
Arguments
choice
determines if the head is a choice or a disjunctionhead
- the head atomsbody
- the body literals
Errors
pub fn weight_rule(
&mut self,
choice: bool,
head: &[Atom],
lower_bound: i32,
body: &[WeightedLiteral]
) -> Result<(), ClingoError>
[src]
&mut self,
choice: bool,
head: &[Atom],
lower_bound: i32,
body: &[WeightedLiteral]
) -> Result<(), ClingoError>
Add a weight rule to the program.
Attention: All weights and the lower bound must be positive.
Arguments
choice
- determines if the head is a choice or a disjunctionhead
- the head atomslower_bound
- the lower bound of the weight rulebody
- the weighted body literals
Errors
pub fn minimize(
&mut self,
priority: i32,
literals: &[WeightedLiteral]
) -> Result<(), ClingoError>
[src]
&mut self,
priority: i32,
literals: &[WeightedLiteral]
) -> Result<(), ClingoError>
Add a minimize constraint (or weak constraint) to the program.
Arguments
priority
- the priority of the constraintliterals
- the weighted literals whose sum to minimize
Errors
pub fn project(&mut self, atoms: &[Atom]) -> Result<(), ClingoError>
[src]
pub fn external(
&mut self,
atom: &Atom,
type_: ExternalType
) -> Result<(), ClingoError>
[src]
&mut self,
atom: &Atom,
type_: ExternalType
) -> Result<(), ClingoError>
Add an external statement.
Arguments
atom
- the external atomtype
- the type of the external statement
Errors
pub fn assume(&mut self, literals: &[Literal]) -> Result<(), ClingoError>
[src]
Add an assumption directive.
Arguments
literals
- the literals to assume (positive literals are true and negative literals false for the next solve call)
Errors
pub fn heuristic(
&mut self,
atom: &Atom,
type_: HeuristicType,
bias: i32,
priority: u32,
condition: &[Literal]
) -> Result<(), ClingoError>
[src]
&mut self,
atom: &Atom,
type_: HeuristicType,
bias: i32,
priority: u32,
condition: &[Literal]
) -> Result<(), ClingoError>
Add an heuristic directive.
Arguments
atom
- the target atomtype
- the type of the heuristic modificationbias
- the heuristic biaspriority
- the heuristic prioritycondition
- the condition under which to apply the heuristic modification
Errors
pub fn acyc_edge(
&mut self,
node_u: i32,
node_v: i32,
condition: &[Literal]
) -> Result<(), ClingoError>
[src]
&mut self,
node_u: i32,
node_v: i32,
condition: &[Literal]
) -> Result<(), ClingoError>
Add an edge directive.
Arguments
node_u
- the start vertex of the edgenode_v
- the end vertex of the edgecondition
- the condition under which the edge is part of the graph
Errors
pub fn add_atom(&mut self) -> Option<Atom>
[src]
Get a fresh atom to be used in aspif directives.
Trait Implementations
impl Debug for Backend
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more