Sign in

    moonbelief

    Bounded finite-frame belief-function calculus, explicit conflict fusion and explainable decisions in pure MoonBit

    belief-functions
    dempster-shafer
    evidence-fusion
    uncertainty
    Download zip
    Version
    0.1.0
    License
    MIT
    Last updated
    8 hours ago
    Downloads
    4

    #MoonBelief

    有限分类框架上的证据质量函数、显式冲突融合与可拒绝决策。纯 MoonBit 实现,无运行时网络、训练或第三方算法依赖;模块 TWISTY2Ynb/moonbelief@0.1.0,MIT。

    它解决的是“若干来源只支持一组候选,但不足以选定一个候选”时的计算问题。集合质量不是普通分类概率:{a,b} 上的质量表示没有继续分配的支持;空集质量表示冲突。使用者必须先保证类别互斥、穷尽,并说明来源依赖性与可靠度。融合规则不是从观测自动推导的真理。

    #安装与最小集成

    moon add TWISTY2Ynb/moonbelief@0.1.0

    在消费者的 moon.pkg 中加入:

    import {
    "TWISTY2Ynb/moonbelief" @belief,
    }

    在可抛出 @belief.BeliefError 的函数中使用:

    let f = @belief.frame(["clear", "blocked"])
    let optical = @belief.simple_support(f, 1, 0.8)
    let sonar = @belief.simple_support(f, 2, 0.6)
    let result = @belief.yager(optical, sonar)
    let (lower, upper) = result.interval(1)
    assert_true(lower <= upper)

    位掩码中第 i 位对应第 i 个标签;0 是空集,f.universe() 是全集。框架标签顺序属于语义:即使标签相同,顺序不同也不可直接融合;显式使用 align。完整接口见 pkg.generated.mbti。

    #六种融合规则

    API / 协议值交集为空时的处理重要边界
    conjunctive留在空集支持开放世界质量;不隐去冲突
    dempster以非空存活质量归一化存活量默认不得小于等于 1e-12
    disjunctive所有质量按并集累计表示至少一个来源有效的不同假设
    yager冲突移到全集不等价于概率归一化;多源顺序可能影响结果
    dubois_prade / dubois-prade不相容对移到该对的并集确定的二元规则
    pcr5 / pairwise-pcr5按每对质量比例重新分配仅闭世界输入;不是广义多源 PCR5

    pipeline 对 1–32 个命名来源先用调用者提供的可靠度折扣,再按调用顺序左折叠。它保留每步冲突、无知与焦元数;诊断计算和融合计算均计入总 pair budget。单来源只折扣,不额外归一化。不要将顺序敏感规则的左折叠称为多源闭式规则。

    #可复用能力

    • 有界框架与质量构造:重复焦元合并、有限数校验、补偿求和、向外复制数组,不暴露可变内部状态。
    • belief、plausibility、commonality、区间、全集无知、非单点质量、直接计算的存活质量。
    • 稠密 zeta/Möbius 变换与 commonality 反演;不一致的逆向输入报错。
    • 开放/归一化条件化、可靠度折扣、细化/粗化、显式同标签重排与位置重命名。
    • Pignistic 投影、稳定排序、效用/损失、冲突/非特异性/效用间隔拒绝策略。
    • Jousselme 距离、焦元总变差、最大 belief 差、留一来源敏感性;不据此自动学习来源可信度。
    • 无 I/O 的 execute_request / execute_json,以及同一协议的单次 CLI。

    #三个实际工作流

    moon run examples/sensors --target wasm-gc moon run examples/diagnostics --target wasm-gc moon run examples/ensemble --target wasm-gc python scripts/check_examples.py --target wasm-gc

    1. 分类传感器:光学与声纳分别提供“通行/受阻”的集合支持,指定可靠度后 Yager 融合。原始交集冲突为 0.3456,输出无知为 0.4912,通行 plausibility 为 0.8656,避免把冲突悄悄变成置信结论。
    2. 设备诊断:对电源/机械/软件的集合质量折扣、按硬件事件条件化并粗化,得到电源区间 [0.16, 0.76],硬件 belief 为 1;这是设备演示,不是临床诊断。
    3. 分类器集成:三个分类器输出集合支持,通过 Yager 与业务效用矩阵产生 accept,期望效用 0.31;示例策略接受该建议,逐个去除来源时三个获胜标签均不变。这个玩具结果不证明真实模型校准或安全性。

    #JSON 与 CLI

    moon run cmd/moonbelief --target wasm-gc -- '{"schema":"moonbelief.request.v1","frame":["a","b"],"rule":"yager","sources":[{"name":"sensor","masses":[{"subset":["a"],"mass":0.7},{"subset":["a","b"],"mass":0.3}]}],"queries":[["a"]]}'

    Windows PowerShell 推荐先把 JSON 放入字符串变量,再作为一个参数传入。完整请求示例在 examples/request.json;也可直接调用纯函数 execute_json。

    • moonbelief.mass.v1:schema、有序 frame、masses(subset 标签数组和 mass 数值)。
    • moonbelief.request.v1:schema、frame、rule、1–32 个 sources;来源字段为 name、可选 reliability、masses。可选 queries 与 decision。
    • decision:actions、逐行动作×逐列类别的 utilities,以及可选 policy(max_conflict、max_nonspecific、min_margin)。默认 0.5、0.8、0.05。效用间隔的单位由调用者定义,单动作间隔定义为 0。
    • moonbelief.report.v1:规范质量、冲突、非单点质量、排序、融合步骤、pair_work,以及请求的查询/决策。
    • moonbelief.error.v1:结构化错误。CLI 的领域错误仍以进程状态 0 返回,消费者必须检查 schema/kind,不能只看退出码。 全冲突无法生成排序,因此报告服务报错;底层 conjunctive API 可保留全冲突质量。

    输入拒绝未知字段;JSON 重复对象键遵循 core 解析器的最后一个值覆盖行为,不保证检测重复键。需防止重复键歧义的接入方必须在上游单独拒绝它们。

    #资源与数值契约

    • 1–16 个唯一非空标签,每个最多 256 字符;输入质量须有限且在 [0,1],总和允许误差 1e-10;内部计算结果重新归一化。正的极小质量不人为截断。
    • 默认/硬上限:4096 焦元、1,000,000 次 pair 工作、65536 稠密单元;limits 只能收紧。稠密变换是 O(n·2^n),不是大规模连续状态算法。
    • JSON 文本最多 262144 UTF-16 代码单元、容器嵌套最多 12;查询最多 256。决策最多 64 动作×16 类别,效用/损失绝对值不超过 1e12。
    • 错误为 Invalid、Budget、FrameMismatch、TotalConflict。归一化与 pignistic 直接求和非空质量,避免用 1-conflict 丢失微小存活量;默认阈值仍主动拒绝数值不稳定区域。
    • 反演只对不超过 1e-12 的负舍入残差截零;不是任意修复不合法质量。

    #验证

    moon info && moon fmt moon fmt --check moon check --deny-warn --target wasm-gc moon test --deny-warn --target wasm-gc moon build --deny-warn --target wasm-gc python scripts/differential.py python scripts/audit.py

    验证工具链为 Moon 0.1.20261012 / moonc v0.10.15+943464bfa(2026-10-12);源码与 CI 使用同一版本的规范格式。CI 在 Linux 上分别检查/测试/构建 wasm-gc、wasm、js、native,并对三个例子断言输出。工具链下载带 ETag 与 SHA-256 校验,见 CI 安装脚本。本地 Windows 已运行 wasm-gc/wasm/js;native 本地只有严格 check,缺少 C 编译器,不声称本地 native 执行成功。

    测试不是覆盖率数字:35 个 test 声明中包含 13,475 个双源规则枚举结果,以及边界、可变别名、变换与顺序测试;另有 72 个经实际 CLI 的有理数差分案例。具体口径见 验证说明。

    #范围与参考

    不做贝叶斯网络训练、连续状态 Kalman 滤波、密码学取证、自动可靠度学习或安全认证。来源相关性、框架是否穷尽及规则是否适用须由调用者论证;存在冲突并不说明哪一个来源错了。

    原创实现,仅依赖 MoonBit core。参考 Dempster–Shafer / transferable-belief 通用定义;对照 reineking/pyds 的确切二元 conjunctive/disjunctive 行为,未复制其源码或测试数据。上游 BSD-3-Clause,且 README 明示停止维护并建议考虑概率方法;本项目不以该库作为推荐决策准则或维护保证。见 来源说明、架构、安全、AI 使用、查重边界。

    BeliefError

    pub(all) suberror BeliefError {
    Invalid(String)
    Budget(String)
    FrameMismatch
    TotalConflict
    } derive(Eq,
    Debug
    )

    BeliefError::equal

    fn BeliefError::equal(BeliefError, BeliefError) -> Bool

    BeliefError::not_equal

    fn BeliefError::not_equal(x : BeliefError, y : BeliefError) -> Bool

    ActionDecision

    pub struct ActionDecision {
    index : Int
    label : String
    expected_score : Double
    margin : Double
    accepted : Bool
    reason : String
    conflict : Double
    nonspecific : Double
    } derive(Eq,
    Debug
    )

    ActionDecision::equal

    ActionDecision::not_equal

    fn ActionDecision::not_equal(x : ActionDecision, y : ActionDecision) -> Bool

    DecisionPolicy

    pub struct DecisionPolicy {
    // private fields
    } derive(Eq,
    Debug
    )

    DecisionPolicy::equal

    DecisionPolicy::not_equal

    fn DecisionPolicy::not_equal(x : DecisionPolicy, y : DecisionPolicy) -> Bool

    Frame

    pub struct Frame {
    // private fields
    } derive(Eq,
    Debug
    )

    Ordered, exhaustive, mutually exclusive hypotheses. Order is semantic.

    Frame::cardinality

    fn Frame::cardinality(self : Frame, mask : Int) -> Int raise BeliefError

    Frame::coarse_preimage

    fn Frame::coarse_preimage(self : Frame, target : Frame, mapping : Array[Int], event : Int) -> Int raise BeliefError

    Preimage event on the source frame for a category-level query.

    Frame::complement

    fn Frame::complement(self : Frame, mask : Int) -> Int raise BeliefError

    Frame::difference

    fn Frame::difference(self : Frame, left : Int, right : Int) -> Int raise BeliefError

    Frame::equal

    fn Frame::equal(Frame, Frame) -> Bool

    Frame::intersection

    fn Frame::intersection(self : Frame, left : Int, right : Int) -> Int raise BeliefError

    Frame::is_subset

    fn Frame::is_subset(self : Frame, left : Int, right : Int) -> Bool raise BeliefError

    Frame::labels

    fn Frame::labels(self : Frame) -> Array[String]

    Frame::members

    fn Frame::members(self : Frame, mask : Int) -> Array[String] raise BeliefError

    Frame::not_equal

    fn Frame::not_equal(x : Frame, y : Frame) -> Bool

    Frame::refinement_inverse

    fn Frame::refinement_inverse(self : Frame, target : Frame, blocks : Array[Int]) -> Array[Int] raise BeliefError

    Derive the inverse category map from a valid refinement partition.

    Frame::size

    fn Frame::size(self : Frame) -> Int

    Frame::subset

    fn Frame::subset(self : Frame, labels : Array[String]) -> Int raise BeliefError

    Frame::subsets

    fn Frame::subsets(self : Frame, mask : Int, max_results? : Int) -> Array[Int] raise BeliefError

    Enumerate subsets of a query, not of an implicitly unbounded universe.

    Frame::to_repr

    Frame::union

    fn Frame::union(self : Frame, left : Int, right : Int) -> Int raise BeliefError

    Frame::universe

    fn Frame::universe(self : Frame) -> Int

    FusionStep

    pub struct FusionStep {
    source : String
    input_conflict : Double
    previous_conflict : Double
    conjunctive_conflict : Double
    output_conflict : Double
    output_ignorance : Double
    output_focals : Int
    } derive(Eq,
    Debug
    )

    FusionStep::equal

    fn FusionStep::equal(FusionStep, FusionStep) -> Bool

    FusionStep::not_equal

    fn FusionStep::not_equal(x : FusionStep, y : FusionStep) -> Bool

    HypothesisScore

    pub struct HypothesisScore {
    index : Int
    label : String
    belief : Double
    plausibility : Double
    pignistic : Double
    } derive(Eq,
    Debug
    )

    HypothesisScore::equal

    HypothesisScore::not_equal

    fn HypothesisScore::not_equal(x : HypothesisScore, y : HypothesisScore) -> Bool

    Limits

    pub struct Limits {
    // private fields
    } derive(Eq,
    Debug
    )

    Limits can tighten, never increase, the engine's hard resource ceilings.

    Limits::equal

    fn Limits::equal(Limits, Limits) -> Bool

    Limits::max_dense_cells

    fn Limits::max_dense_cells(self : Limits) -> Int

    Limits::max_focals

    fn Limits::max_focals(self : Limits) -> Int

    Limits::max_pairs

    fn Limits::max_pairs(self : Limits) -> Int

    Limits::not_equal

    fn Limits::not_equal(x : Limits, y : Limits) -> Bool

    Limits::to_repr

    Mass

    pub struct Mass {
    // private fields
    } derive(Eq,
    Debug
    )

    Sparse canonical mass assignment; empty-set mass is retained explicitly.

    Mass::align

    fn Mass::align(self : Mass, target : Frame, budget? : Limits) -> Mass raise BeliefError

    Reorder to an exactly matching set of labels. Fusion never aligns silently.

    Mass::belief

    fn Mass::belief(self : Mass, event : Int) -> Double raise BeliefError

    Sum of nonempty focal masses included in the event (unnormalized TBM).

    Mass::belief_table

    fn Mass::belief_table(self : Mass, budget? : Limits) -> Array[Double] raise BeliefError

    Mass::coarsen

    fn Mass::coarsen(self : Mass, target : Frame, mapping : Array[Int], budget? : Limits) -> Mass raise BeliefError

    mapping[i] is the target hypothesis index for source hypothesis i. Surjectivity forbids introducing unsupported target categories.

    Mass::commonality

    fn Mass::commonality(self : Mass, event : Int) -> Double raise BeliefError

    Commonality includes empty-set mass only when event is empty.

    Mass::commonality_table

    fn Mass::commonality_table(self : Mass, budget? : Limits) -> Array[Double] raise BeliefError

    Mass::condition

    fn Mass::condition(self : Mass, event : Int, min_survival? : Double, budget? : Limits) -> Mass raise BeliefError

    Closed-world conditioning uses the same near-total-conflict gate as Dempster.

    Mass::condition_open

    fn Mass::condition_open(self : Mass, event : Int, budget? : Limits) -> Mass raise BeliefError

    Conditioning by certain event evidence. Incompatible mass stays empty. An impossible/empty observation is rejected rather than fabricated.

    Mass::conditional_interval

    fn Mass::conditional_interval(self : Mass, query : Int, given : Int, min_survival? : Double, budget? : Limits) -> (Double, Double) raise BeliefError

    Conditional belief/plausibility bounds, not a posterior probability vector.

    Mass::conflict

    fn Mass::conflict(self : Mass) -> Double

    Mass::decide

    fn Mass::decide(self : Mass, actions : Array[String], utilities : Array[Array[Double]], policy : DecisionPolicy) -> ActionDecision raise BeliefError

    Explicit supplied policy; equal scores keep the first action. If only one action exists its margin is defined as zero, not infinity. Margins have utility units, so caller must calibrate the policy accordingly.

    Mass::dense

    fn Mass::dense(self : Mass, budget? : Limits) -> Array[Double] raise BeliefError

    A copy of mass values in integer-mask order, including empty set at index 0.

    Mass::discount

    fn Mass::discount(self : Mass, reliability : Double, budget? : Limits) -> Mass raise BeliefError

    Shafer reliability discounting: alpha scales every focal, including empty, then 1-alpha is transferred to the full frame. Reliability is supplied, never inferred from agreement. This is not a source-dependence correction.

    Mass::entries

    fn Mass::entries(self : Mass) -> Array[(Int, Double)]

    Mass::equal

    fn Mass::equal(Mass, Mass) -> Bool

    Mass::expected_losses

    fn Mass::expected_losses(self : Mass, losses : Array[Array[Double]]) -> Array[Double] raise BeliefError

    Loss rows have the same layout, but must be nonnegative.

    Mass::expected_utilities

    fn Mass::expected_utilities(self : Mass, utilities : Array[Array[Double]]) -> Array[Double] raise BeliefError

    Rows are actions; columns are hypotheses in frame order. Limited to 64 actions and finite magnitudes <=1e12. Returned expectations use BetP.

    Mass::focal_count

    fn Mass::focal_count(self : Mass) -> Int

    Mass::forget_detail

    fn Mass::forget_detail(self : Mass, budget? : Limits) -> Mass raise BeliefError

    Explicitly move all nonsingleton nonempty masses to the full frame. Conflict and singleton commitments are retained; no hidden pruning occurs.

    Mass::frame

    fn Mass::frame(self : Mass) -> Frame

    Mass::ignorance

    fn Mass::ignorance(self : Mass) -> Double raise BeliefError

    Mass::interval

    fn Mass::interval(self : Mass, event : Int) -> (Double, Double) raise BeliefError

    Mass::json_text

    fn Mass::json_text(self : Mass) -> String raise BeliefError

    Mass::nonspecific_mass

    fn Mass::nonspecific_mass(self : Mass) -> Double

    Nonspecificity: total nonempty mass assigned to nonsingleton subsets. This is not Shannon entropy and is distinct from mass on the full frame.

    Mass::normalize

    fn Mass::normalize(self : Mass, min_survival? : Double, budget? : Limits) -> Mass raise BeliefError

    Removes explicit conflict by conditioning on nonempty mass. Summing surviving focals directly avoids catastrophic 1-conflict cancellation.

    Mass::not_equal

    fn Mass::not_equal(x : Mass, y : Mass) -> Bool

    Mass::pignistic

    fn Mass::pignistic(self : Mass, min_survival? : Double) -> Array[Double] raise BeliefError

    Singleton decision projection. This is pignistic probability, not belief. Conflict is removed by conditioning on directly summed nonempty mass.

    Mass::plausibility

    fn Mass::plausibility(self : Mass, event : Int) -> Double raise BeliefError

    Sum of masses intersecting the event; empty-set conflict contributes zero.

    Mass::ranking

    fn Mass::ranking(self : Mass, min_survival? : Double) -> Array[HypothesisScore] raise BeliefError

    Stable descending pignistic ranking: ties retain original frame order. Belief and plausibility columns remain unnormalized open-world bounds.

    Mass::refine

    fn Mass::refine(self : Mass, target : Frame, blocks : Array[Int], budget? : Limits) -> Mass raise BeliefError

    Each source hypothesis maps to a nonempty disjoint block of the target. Blocks must partition the target. No probabilities are invented within a block: every focal is extended to the union of its corresponding blocks.

    Mass::relabel

    fn Mass::relabel(self : Mass, names : Array[String], budget? : Limits) -> Mass raise BeliefError

    Rename positionally; caller asserts that the new labels mean the same hypotheses. This is not semantic matching or automatic label inference.

    Mass::survival

    fn Mass::survival(self : Mass) -> Double

    Surviving mass is summed directly to avoid cancellation of 1-conflict.

    Mass::to_json

    fn Mass::to_json(self : Mass) -> Json raise BeliefError

    Mass::to_repr

    Mass::weight

    fn Mass::weight(self : Mass, mask : Int) -> Double raise BeliefError

    PipelineResult

    pub struct PipelineResult {
    // private fields
    } derive(Eq,
    Debug
    )

    PipelineResult::equal

    PipelineResult::mass

    fn PipelineResult::mass(self : PipelineResult) -> Mass

    PipelineResult::not_equal

    fn PipelineResult::not_equal(x : PipelineResult, y : PipelineResult) -> Bool

    PipelineResult::pair_work

    fn PipelineResult::pair_work(self : PipelineResult) -> Int

    PipelineResult::steps

    Rule

    pub(all) enum Rule {
    Conjunctive
    Dempster
    Disjunctive
    Yager
    DuboisPrade
    PairwisePCR5
    } derive(Eq,
    Debug
    )

    Rule::equal

    fn Rule::equal(Rule, Rule) -> Bool

    Rule::not_equal

    fn Rule::not_equal(x : Rule, y : Rule) -> Bool

    Rule::to_repr

    Source

    pub struct Source {
    // private fields
    } derive(Eq,
    Debug
    )

    Source::equal

    fn Source::equal(Source, Source) -> Bool

    Source::mass

    fn Source::mass(self : Source) -> Mass

    Source::name

    fn Source::name(self : Source) -> String

    Source::not_equal

    fn Source::not_equal(x : Source, y : Source) -> Bool

    Source::to_repr

    SourceSensitivity

    pub struct SourceSensitivity {
    omitted : String
    conflict_without : Double
    conflict_change : Double
    pignistic_variation : Double
    winner_without : String
    winner_changed : Bool
    } derive(Eq,
    Debug
    )

    SourceSensitivity::equal

    SourceSensitivity::not_equal

    fn SourceSensitivity::not_equal(x : SourceSensitivity, y : SourceSensitivity) -> Bool

    bayesian

    fn bayesian(f : Frame, probabilities : Array[Double], budget? : Limits) -> Mass raise BeliefError

    Bayesian mass: one explicit probability for each hypothesis in frame order.

    conjunctive

    fn conjunctive(a : Mass, b : Mass, budget? : Limits) -> Mass raise BeliefError

    Unnormalized conjunctive fusion: each pair transfers mass to intersection. Empty intersections are preserved as conflict, never renormalized here.

    decision_policy

    fn decision_policy(max_conflict? : Double, max_nonspecific? : Double, min_margin? : Double) -> DecisionPolicy raise BeliefError

    default_limits

    fn default_limits() -> Limits

    dempster

    fn dempster(a : Mass, b : Mass, min_survival? : Double, budget? : Limits) -> Mass raise BeliefError

    Dempster's normalized conjunctive rule, with an explicit instability gate.

    disjunctive

    fn disjunctive(a : Mass, b : Mass, budget? : Limits) -> Mass raise BeliefError

    Disjunctive fusion transfers each focal pair to its union. This is an alternative source model, not interchangeable with conjunction.

    dubois_prade

    fn dubois_prade(a : Mass, b : Mass, budget? : Limits) -> Mass raise BeliefError

    Dubois-Prade transfers each incompatible pair to its union. Both-empty pairs stay empty; open-world inputs are not silently normalized.

    execute_json

    fn execute_json(text : String, budget? : Limits) -> String raise BeliefError

    execute_request

    fn execute_request(value : Json, budget? : Limits) -> Json raise BeliefError

    Pure request/report facade: no I/O, credentials, training or network. Total conflict produces a domain error instead of invalid ranking numbers.

    focal_total_variation

    fn focal_total_variation(a : Mass, b : Mass, budget? : Limits) -> Double raise BeliefError

    Total variation of focal-mass vectors (not a belief metric).

    frame

    fn frame(names : Array[String]) -> Frame raise BeliefError

    A finite powerset is deliberately bounded to at most sixteen hypotheses.

    from_commonality

    fn from_commonality(f : Frame, values : Array[Double], budget? : Limits) -> Mass raise BeliefError

    Invert a normalized commonality vector; negative rounding noise <=1e-12 may be clamped, but inconsistent vectors are rejected, never renormalized.

    fuse

    fn fuse(a : Mass, b : Mass, rule : Rule, budget? : Limits) -> Mass raise BeliefError

    jousselme

    fn jousselme(a : Mass, b : Mass, budget? : Limits) -> Double raise BeliefError

    Jousselme distance with D(empty,empty)=1. Different frames are rejected. Work is quadratic in the union of nonzero difference focals, not powerset.

    leave_one_out

    fn leave_one_out(sources : Array[Source], rule : Rule, budget? : Limits) -> Array[SourceSensitivity] raise BeliefError

    Leave-one-out is a sensitivity diagnostic, not source-reliability learning. Limited to 2..16 sources. The pair budget is shared across baseline and all reruns; no per-source failures are hidden. Total conflict raises an error.

    limits

    fn limits(max_focals? : Int, max_pairs? : Int, max_dense_cells? : Int) -> Limits raise BeliefError

    mass

    fn mass(f : Frame, entries : Array[(Int, Double)], budget? : Limits) -> Mass raise BeliefError

    Duplicate subsets are merged; totals must be one within 1e-10. Tiny positive focals are preserved, not pruned by a hidden threshold.

    mass_from_json

    fn mass_from_json(value : Json, budget? : Limits) -> Mass raise BeliefError

    maximum_belief_difference

    fn maximum_belief_difference(a : Mass, b : Mass, budget? : Limits) -> (Int, Double) raise BeliefError

    Largest difference over all belief queries, using bounded zeta transforms.

    mixture

    fn mixture(a : Mass, b : Mass, alpha : Double, budget? : Limits) -> Mass raise BeliefError

    Convex pooling is an alternative to independent-evidence fusion. alpha is the weight of the first source, not a reliability estimate.

    parse_mass

    fn parse_mass(text : String, budget? : Limits) -> Mass raise BeliefError

    pcr5

    fn pcr5(a : Mass, b : Mass, budget? : Limits) -> Mass raise BeliefError

    Two-source PCR5 only. Incompatible pair products are redistributed to those same two focals in proportion to their original masses. Inputs must have zero empty-set mass; sequential use is order-sensitive.

    pipeline

    fn pipeline(sources : Array[Source], rule : Rule, budget? : Limits) -> PipelineResult raise BeliefError

    Deterministic left fold in caller order. Not a generalized multisource PCR5 or associativity guarantee. One source yields its discounted mass. Pair budget covers BOTH diagnostic and fusion cross products globally.

    rule_from_string

    fn rule_from_string(name : String) -> Rule raise BeliefError

    simple_support

    fn simple_support(f : Frame, event : Int, support : Double, budget? : Limits) -> Mass raise BeliefError

    Simple support does not silently create empty-set conflict.

    source

    fn source(name : String, evidence : Mass, reliability? : Double) -> Source raise BeliefError

    subset_mobius

    fn subset_mobius(f : Frame, values : Array[Double], budget? : Limits) -> Array[Double] raise BeliefError

    subset_zeta

    fn subset_zeta(f : Frame, values : Array[Double], budget? : Limits) -> Array[Double] raise BeliefError

    superset_mobius

    fn superset_mobius(f : Frame, values : Array[Double], budget? : Limits) -> Array[Double] raise BeliefError

    superset_zeta

    fn superset_zeta(f : Frame, values : Array[Double], budget? : Limits) -> Array[Double] raise BeliefError

    vacuous

    fn vacuous(f : Frame, budget? : Limits) -> Mass raise BeliefError

    yager

    fn yager(a : Mass, b : Mass, budget? : Limits) -> Mass raise BeliefError

    Yager transfers all conjunctive conflict to the full frame.