pub struct Statement {
pub id: String,
pub text: String,
pub prior: TruthValue,
pub evidence: Vec<RelativeEvidence>,
pub dependencies: Vec<Dependency>,
pub truth: TruthValue,
}Expand description
A dependent statement inside a Context.
A statement carries its own assumed-true prior and base evidence (weighed
exactly as StatementAssessment does elsewhere), plus zero or more
Dependency edges onto other statements in the same context. Its truth
is the value Context::recalculate last computed; it is graph-visible via
Context::links_notation.
Fields§
§id: StringContent-addressed id, stable over the statement text.
text: StringThe statement text.
prior: TruthValueThe assumed-true prior before any evidence or dependency is weighed.
evidence: Vec<RelativeEvidence>Base evidence weighed against this statement.
dependencies: Vec<Dependency>Edges onto the statements this one depends on.
truth: TruthValueThe probability last computed by Context::recalculate.
Implementations§
Source§impl Statement
impl Statement
Sourcepub fn new(text: impl Into<String>) -> Self
pub fn new(text: impl Into<String>) -> Self
Build a statement with the module default ASSUMED_TRUE_PRIOR and no
dependencies. Its initial truth is its own evidence-only posterior.
Sourcepub fn with_evidence(self, evidence: RelativeEvidence) -> Self
pub fn with_evidence(self, evidence: RelativeEvidence) -> Self
Attach base evidence, returning self for chaining.
Sourcepub fn with_dependency(self, dependency: Dependency) -> Self
pub fn with_dependency(self, dependency: Dependency) -> Self
Attach a dependency edge, returning self for chaining.
Sourcepub fn with_prior(self, prior: impl Into<TruthValue>) -> Self
pub fn with_prior(self, prior: impl Into<TruthValue>) -> Self
Override the assumed-true prior, returning self for chaining.