Methods and catalogs
Statistical methods
The formulas SENTIL uses to turn sampled robustness into a decision: the confidence intervals, the sample-sizing bounds, and the four checking regimes.
Statistical model checking estimates how often a property holds by drawing noisy realizations and scoring each one. A point estimate alone cannot carry a safety argument, so every estimate comes with an interval, and a run can stop early once a sequential test has enough evidence. The formulas below are the ones the engine computes, taken from the core stats module. Where a value is worth pinning down, the reference number is the one the tests assert.
The IntervalMethod default is Wilson. The three checking regimes are the fixed-sample Monte Carlo estimate, Wald's sequential probability ratio test, and the Bayesian sequential test. Each has one entry point: Monitor::check(&trace, &lifting) returns the fixed-sample SmcResult, Monitor::check_sequential(&trace, &lifting, &sprt) runs the SPRT, and Formula::check_bayesian(&trace, &lifting, &bayes) runs the Bayesian test. On the command line the same three are sentil smc with --algo smc, the default, --algo sprt, or --algo bayes; --algo chernoff sizes the run with the bound below before estimating.
Confidence intervals
For successes out of trials at confidence level level, each method returns a [lower, upper] pair clamped to . Write for the point estimate successes / trials, for the trial count, , and for the two-sided normal critical value.
| Method | Interval | When to reach for it |
|---|---|---|
Wilson (default) | score interval below | the right choice for most checks |
ClopperPearson | exact binomial-tail inversion | coverage must never drop below nominal |
Jeffreys | Beta credible interval | a shorter small-sample interval |
AgrestiCoull | adjusted normal interval | a cheap close approximation to Wilson |
Wilson score
The center is pulled toward and the half-width shrinks with , so the interval stays inside even at an extreme estimate. With no trials it returns the whole range.
Clopper-Pearson
The exact interval inverts the binomial tail through the Beta quantile function , the -quantile of a Beta:
with the success count. The lower bound is when and the upper bound is when . Coverage never drops below the stated level, at the cost of a wider interval than Wilson.
Jeffreys
The Bayesian interval under a Beta prior. The posterior is Beta, and the bounds are its and quantiles. It holds coverage near nominal while running shorter than Clopper-Pearson, which matters most at small .
Agresti-Coull
Add pseudo-successes and pseudo-failures, then apply the plain normal interval to the adjusted counts:
It tracks Wilson closely and is cheaper to compute. At the adjusted estimate is symmetric, so it coincides with Wilson.
The critical value
, the two-sided normal quantile. The inverse normal CDF is Acklam's rational approximation refined by one Halley step, accurate to about .
Reference values, asserted on every commit: wilson(50, 100, 0.95) = [0.403831, 0.596169], clopper_pearson(50, 100, 0.95) = [0.398321, 0.601679], and z(0.95) = 1.959964. Over 4000 batches of 100 draws at , Wilson coverage stays within of and Clopper-Pearson coverage stays at or above .
Sizing a fixed-sample run
Two bounds answer how many samples a run needs before it starts.
The Chernoff-Hoeffding bound is distribution-free. To land within of the true probability with confidence :
chernoff_hoeffding_samples(0.1, 0.05) returns 185. The parameters are and ; anything else is an InvalidConfig error.
The Wilson sizing works from the interval the run will report, bounding its worst-case half-width at :
wilson_samples(0.01, 0.95) returns 9604, roughly half the distribution-free count of 18445 for the same target.
Sequential probability ratio test
Wald's SPRT decides against , stopping as early as the evidence allows, often well before a fixed budget runs out. It carries a running log-likelihood ratio that starts at zero. Each satisfied draw adds ; each unsatisfied draw adds . The two decision bounds are
The test accepts when the ratio reaches , accepts when it falls to , and reports Inconclusive if neither happens within max_samples. Parameters (SprtConfig): the indifference region , the error bounds , the sample cap, and a seed. At , , , the measured Type I and Type II rates each stay at or below .
Bayesian sequential test
The Bayesian test decides whether meets a threshold under a uniform Beta prior. After successes in draws the posterior over is Beta. Let the posterior mass above the threshold be , where is the regularized incomplete beta function. The Bayes factor for against divides the posterior odds by the prior odds, which under the uniform prior is :
The test reports Holds when reaches the configured cutoff, Fails when does, and Inconclusive otherwise. The comparison is cross-multiplied internally, so a posterior mass of zero is handled without dividing by it. Parameters (BayesConfig): the threshold , a Bayes-factor cutoff greater than one, the sample cap, and a seed. A larger cutoff demands stronger evidence and spends more samples.
Adaptive multilevel splitting
For a violation probability too small for direct Monte Carlo, below roughly , the empirical estimator would need billions of samples to see a single event. Adaptive multilevel splitting advances a population of trajectory particles through nested robustness levels: at each stage the least-robust particles are discarded and the survivors are cloned, so the population stays concentrated on the paths heading toward violation. The estimate is the product of the per-level survival fractions. It runs over a StochasticSystem through Monitor::check_rare, tuned by RareEventConfig (particle count, violation margin, seed), and returns a RareEventResult with a point estimate rather than a confidence interval, since splitting produces no success-over-trials count to invert. The GPU splitting path sits behind the gpu feature.
The intuition and worked runs live in the concept pages: confidence intervals, sequential testing, and rare events. For the configuration structs, see configuration.
Parse errors
The parser diagnostics you are most likely to meet, with the exact message and the one-based line and column SENTIL reports, the input that triggers each, and the fix.
Synthesis backends
The four search backends behind SENTIL's synthesizer, what each one solves, how the Auto selector picks between them, and the two smooth-robustness kinds that make the objective differentiable.