<!-- Sema documentation — std.belief
     Sema is a new AI-native, neurosymbolic programming language most models
     have not been trained on. Full corpus: https://sema.49.12.246.95.sslip.io/llms-full.txt
     Install language support: https://sema.49.12.246.95.sslip.io/install-skill/ -->

# std.belief

> Reflected API reference for the Sema standard-library module std.belief.

> Generated by `sema doc` from `stdlib/sema/belief.sema`. Import with `from std.belief import …`. For a narrative introduction see [std.belief](/stdlib/belief/).

# `belief`

std.belief — Beta-Bernoulli confidence tracking (design ⑤).

A first-class calibrated-confidence type: each observation is a soft Bernoulli
update (alpha += conf, beta += 1 - conf). Replaces a hand-rolled
~120-line BeliefTracker. The prior is parametrizable — `prior()` is the uniform
Beta(1,1); `prior_with(a, b)` sets any prior — nothing about the distribution is
hardcoded in the runtime.

# `struct Belief`

**Fields**

| field | type | descriptor |
|---|---|---|
| `alpha` | `f64` |  |
| `beta` | `f64` |  |
| `history` | `list[f64]` |  |

# `def prior`

```sema
def prior() -> Belief !{}
```

**Returns** `Belief`

**Effects** `!{}`

# `def prior_with`

```sema
def prior_with(alpha: f64, beta: f64) -> Belief !{}
```

**Parameters**

| name | type |
|---|---|
| `alpha` | `f64` |
| `beta` | `f64` |

**Returns** `Belief`

**Effects** `!{}`
