pub struct Hypothesis { /* private fields */ }Expand description
Explainable claim whose belief is maintained by a reasoning engine.
Implementations§
Source§impl Hypothesis
impl Hypothesis
Sourcepub fn new(
subject: EntityId,
predicate: KnowledgePredicate,
value: EvidenceValue,
prior: Probability,
) -> Self
pub fn new( subject: EntityId, predicate: KnowledgePredicate, value: EvidenceValue, prior: Probability, ) -> Self
Creates a weak, proposed claim at the supplied prior.
Sourcepub fn with_id(
id: impl Into<String>,
subject: EntityId,
predicate: KnowledgePredicate,
value: EvidenceValue,
prior: Probability,
) -> Result<Self, ReasoningModelError>
pub fn with_id( id: impl Into<String>, subject: EntityId, predicate: KnowledgePredicate, value: EvidenceValue, prior: Probability, ) -> Result<Self, ReasoningModelError>
Creates a hypothesis with a stable host-assigned identifier.
Deterministic decision engines should use this constructor so repeated evaluation updates one hypothesis instead of creating duplicates.
Sourcepub fn observe(
&mut self,
observation: BayesianEvidence,
) -> Result<BeliefWrite, ReasoningModelError>
pub fn observe( &mut self, observation: BayesianEvidence, ) -> Result<BeliefWrite, ReasoningModelError>
Applies one observation to the Bayesian belief.
Sourcepub fn set_strength(&mut self, strength: HypothesisStrength)
pub fn set_strength(&mut self, strength: HypothesisStrength)
Replaces the strength assigned by a deterministic rule.
Sourcepub fn set_state(&mut self, state: HypothesisState)
pub fn set_state(&mut self, state: HypothesisState)
Replaces the lifecycle state assigned by the reasoning engine or verifier.
Sourcepub fn predicate(&self) -> &KnowledgePredicate
pub fn predicate(&self) -> &KnowledgePredicate
Returns the claim predicate.
Sourcepub fn value(&self) -> &EvidenceValue
pub fn value(&self) -> &EvidenceValue
Returns the claim value.
Sourcepub fn belief(&self) -> &BayesianBelief
pub fn belief(&self) -> &BayesianBelief
Returns the complete Bayesian belief and audit trail.
Sourcepub fn prior(&self) -> Probability
pub fn prior(&self) -> Probability
Returns the caller- or policy-supplied prior probability.
Sourcepub fn posterior(&self) -> Probability
pub fn posterior(&self) -> Probability
Returns the current posterior probability.
Sourcepub fn strength(&self) -> HypothesisStrength
pub fn strength(&self) -> HypothesisStrength
Returns the rule-assigned evidence strength.
Sourcepub fn state(&self) -> HypothesisState
pub fn state(&self) -> HypothesisState
Returns the current evaluation state.
Sourcepub fn updated_at_ms(&self) -> u64
pub fn updated_at_ms(&self) -> u64
Returns when the hypothesis last changed in Unix milliseconds.
Sourcepub fn same_evaluation_as(&self, other: &Self) -> bool
pub fn same_evaluation_as(&self, other: &Self) -> bool
Returns whether two records carry the same decision state.
Wall-clock update timestamps are deliberately ignored so deterministic re-evaluation can remain idempotent.
Trait Implementations§
Source§impl Clone for Hypothesis
impl Clone for Hypothesis
Source§fn clone(&self) -> Hypothesis
fn clone(&self) -> Hypothesis
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Hypothesis
impl Debug for Hypothesis
Source§impl<'de> Deserialize<'de> for Hypothesis
impl<'de> Deserialize<'de> for Hypothesis
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Hypothesis
Source§impl PartialEq for Hypothesis
impl PartialEq for Hypothesis
Source§impl Serialize for Hypothesis
impl Serialize for Hypothesis
impl StructuralPartialEq for Hypothesis
Auto Trait Implementations§
impl Freeze for Hypothesis
impl RefUnwindSafe for Hypothesis
impl Send for Hypothesis
impl Sync for Hypothesis
impl Unpin for Hypothesis
impl UnsafeUnpin for Hypothesis
impl UnwindSafe for Hypothesis
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.