pub struct ChcSystem { /* private fields */ }Expand description
A complete CHC system containing predicates and rules
Implementations§
Source§impl ChcSystem
impl ChcSystem
Sourcepub fn declare_predicate(
&mut self,
name: impl Into<String>,
params: impl IntoIterator<Item = SortId>,
) -> PredId
pub fn declare_predicate( &mut self, name: impl Into<String>, params: impl IntoIterator<Item = SortId>, ) -> PredId
Declare a new predicate
Sourcepub fn get_predicate(&self, id: PredId) -> Option<&Predicate>
pub fn get_predicate(&self, id: PredId) -> Option<&Predicate>
Get a predicate by ID
Sourcepub fn get_predicate_by_name(&self, name: &str) -> Option<&Predicate>
pub fn get_predicate_by_name(&self, name: &str) -> Option<&Predicate>
Get a predicate by name
Sourcepub fn get_predicate_id(&self, name: &str) -> Option<PredId>
pub fn get_predicate_id(&self, name: &str) -> Option<PredId>
Get a predicate ID by name
Sourcepub fn add_rule(
&mut self,
vars: impl IntoIterator<Item = (String, SortId)>,
body: RuleBody,
head: RuleHead,
name: Option<String>,
) -> RuleId
pub fn add_rule( &mut self, vars: impl IntoIterator<Item = (String, SortId)>, body: RuleBody, head: RuleHead, name: Option<String>, ) -> RuleId
Add a rule to the system
Sourcepub fn add_init_rule(
&mut self,
vars: impl IntoIterator<Item = (String, SortId)>,
constraint: TermId,
head_pred: PredId,
head_args: impl IntoIterator<Item = TermId>,
) -> RuleId
pub fn add_init_rule( &mut self, vars: impl IntoIterator<Item = (String, SortId)>, constraint: TermId, head_pred: PredId, head_args: impl IntoIterator<Item = TermId>, ) -> RuleId
Add a simple init rule: constraint => P(args)
Sourcepub fn add_transition_rule(
&mut self,
vars: impl IntoIterator<Item = (String, SortId)>,
body_preds: impl IntoIterator<Item = PredicateApp>,
constraint: TermId,
head_pred: PredId,
head_args: impl IntoIterator<Item = TermId>,
) -> RuleId
pub fn add_transition_rule( &mut self, vars: impl IntoIterator<Item = (String, SortId)>, body_preds: impl IntoIterator<Item = PredicateApp>, constraint: TermId, head_pred: PredId, head_args: impl IntoIterator<Item = TermId>, ) -> RuleId
Add a transition rule: P1(args1) /\ ... /\ constraint => P(args)
Sourcepub fn add_query(
&mut self,
vars: impl IntoIterator<Item = (String, SortId)>,
body_preds: impl IntoIterator<Item = PredicateApp>,
constraint: TermId,
) -> RuleId
pub fn add_query( &mut self, vars: impl IntoIterator<Item = (String, SortId)>, body_preds: impl IntoIterator<Item = PredicateApp>, constraint: TermId, ) -> RuleId
Add a query rule: P(args) /\ constraint => false
Sourcepub fn predicates(&self) -> impl Iterator<Item = &Predicate>
pub fn predicates(&self) -> impl Iterator<Item = &Predicate>
Get all predicates
Sourcepub fn rules_by_head(&self, pred: PredId) -> impl Iterator<Item = &Rule>
pub fn rules_by_head(&self, pred: PredId) -> impl Iterator<Item = &Rule>
Get rules with a given head predicate
Sourcepub fn rules_using(&self, pred: PredId) -> impl Iterator<Item = &Rule>
pub fn rules_using(&self, pred: PredId) -> impl Iterator<Item = &Rule>
Get rules that use a predicate in the body
Sourcepub fn num_predicates(&self) -> usize
pub fn num_predicates(&self) -> usize
Get the number of predicates
Sourcepub fn topological_order(&self) -> Option<Vec<PredId>>
pub fn topological_order(&self) -> Option<Vec<PredId>>
Get predicates in topological order (if acyclic)
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for ChcSystem
impl RefUnwindSafe for ChcSystem
impl Send for ChcSystem
impl Sync for ChcSystem
impl Unpin for ChcSystem
impl UnsafeUnpin for ChcSystem
impl UnwindSafe for ChcSystem
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more