Struct clingo::Signature
[−]
[src]
pub struct Signature(_);
Represents a predicate signature.
Signatures have a name and an arity, and can be positive or negative (to represent classical negation).
Methods
impl Signature
[src]
pub fn new(name: &str, arity: u32, positive: bool) -> Result<Signature, Error>
[src]
Create a new signature.
Arguments
name
name of the signaturearity
arity of the signaturepositive
false if the signature has a classical negation sign
Errors
ErrorType::BadAlloc
NulError
- ifname
contains a nul byte
pub fn ast_statement(&self, Location: Location) -> AstStatement<Signature>
[src]
Create a statement for the signature.
pub fn name(&self) -> Result<&str, Utf8Error>
[src]
pub fn arity(&self) -> u32
[src]
Get the arity of a signature.
pub fn is_positive(&self) -> bool
[src]
Whether the signature is positive (is not classically negated).
pub fn is_negative(&self) -> bool
[src]
Whether the signature is negative (is classically negated).
Trait Implementations
impl Debug for Signature
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Copy for Signature
[src]
impl Clone for Signature
[src]
fn clone(&self) -> Signature
[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
impl PartialEq for Signature
[src]
fn eq(&self, other: &Signature) -> bool
[src]
Check if two signatures are equal.
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl Eq for Signature
[src]
impl PartialOrd for Signature
[src]
fn partial_cmp(&self, other: &Signature) -> Option<Ordering>
[src]
Compare two signatures.
Signatures are compared first by sign (unsigned < signed), then by arity, then by name.
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more