pub struct Signature(/* private fields */);Expand description
Represents a predicate signature.
Signatures have a name and an arity, and can be positive or negative (to represent classical negation).
Implementations§
Source§impl Signature
impl Signature
Sourcepub fn new(
name: &str,
arity: u32,
positive: bool,
) -> Result<Signature, ClingoError>
pub fn new( name: &str, arity: u32, positive: bool, ) -> Result<Signature, ClingoError>
Create a new signature.
§Arguments
name- name of the signaturearity- arity of the signaturepositive- false if the signature has a classical negation sign
§Errors
ClingoError::InternalErrorwithErrorCode::BadAllocClingoError::NulError- ifnamecontains a nul byte
Sourcepub fn name(&self) -> Result<&'static str, Utf8Error>
pub fn name(&self) -> Result<&'static str, Utf8Error>
Get the name of a signature. Note: The string is internalized and valid for the duration of the process.
Sourcepub fn is_positive(self) -> bool
pub fn is_positive(self) -> bool
Whether the signature is positive (is not classically negated).
Sourcepub fn is_negative(self) -> bool
pub fn is_negative(self) -> bool
Whether the signature is negative (is classically negated).
Trait Implementations§
Source§impl PartialOrd for Signature
impl PartialOrd for Signature
Source§fn partial_cmp(&self, other: &Signature) -> Option<Ordering>
fn partial_cmp(&self, other: &Signature) -> Option<Ordering>
Compare two signatures.
Signatures are compared first by sign (unsigned < signed), then by arity, then by name.
impl Copy for Signature
impl Eq for Signature
Auto Trait Implementations§
impl Freeze for Signature
impl RefUnwindSafe for Signature
impl Send for Signature
impl Sync for Signature
impl Unpin for Signature
impl UnwindSafe for Signature
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more