#[repr(C)]pub struct ForwardChainingDefeasible {
pub rule_base: [DefeasibleRule; 100],
pub facts: [Fact; 50],
pub inference_queue: [usize; 50],
pub queue_head: u8,
pub queue_tail: u8,
pub conflict_state: ConflictState,
pub config: SolverConfig,
pub solver_state: SolverState,
}Expand description
Forward chaining defeasible reasoning solver
Fields§
§rule_base: [DefeasibleRule; 100]Rule base (fixed size)
facts: [Fact; 50]Current facts
inference_queue: [usize; 50]Inference queue
queue_head: u8Queue pointers
queue_tail: u8§conflict_state: ConflictStateConflict resolution state
config: SolverConfigSolver configuration
solver_state: SolverStateSolver state
Implementations§
Source§impl ForwardChainingDefeasible
impl ForwardChainingDefeasible
Sourcepub fn new(config: SolverConfig) -> Self
pub fn new(config: SolverConfig) -> Self
Create new defeasible reasoning solver
Sourcepub fn add_rule(&mut self, rule: DefeasibleRule) -> SolverResult<()>
pub fn add_rule(&mut self, rule: DefeasibleRule) -> SolverResult<()>
Add rule to rule base
Sourcepub fn add_fact(&mut self, fact: Fact) -> SolverResult<()>
pub fn add_fact(&mut self, fact: Fact) -> SolverResult<()>
Add fact to fact base
Sourcepub fn infer(&mut self) -> SolverResult<DefeasibleState>
pub fn infer(&mut self) -> SolverResult<DefeasibleState>
Perform forward chaining inference
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ForwardChainingDefeasible
impl RefUnwindSafe for ForwardChainingDefeasible
impl Send for ForwardChainingDefeasible
impl Sync for ForwardChainingDefeasible
impl Unpin for ForwardChainingDefeasible
impl UnsafeUnpin for ForwardChainingDefeasible
impl UnwindSafe for ForwardChainingDefeasible
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Aggregate shares in an MPC protocol.
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.