Start pplus-library: 16 verified routines in six modules

Routines written once in pseudo and checked at every level, so programs
can use them by name instead of rewriting and re-verifying them:

- stats: Mean, Variance (two-pass)
- numerics: KahanSum, LinearInterp, Trapezoid
- align: LinearGapPenalty, AffineGapPenalty, MatchScore,
  NeedlemanWunschScore
- md: LennardJones, LennardJonesForce, MinimumImage, PairDistance
- seq: GCContent, HammingDistance
- special: ErfApprox (Abramowitz and Stegun 7.1.26)

Each has contracts, cases, reference implementations in Python, Mojo
and (for the numerical ones) C at more than one level, and nine have a
Dafny proof over exact numbers. status.json and STATUS.md are written by
pplus-core's library-check: every check passes or is open/unverified as
listed there. The Mojo references still need the pinned compiler's
answers (library-verify-mojo, network).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FgvbRdoEheAHqsRmr2WuKZ
This commit is contained in:
alexmandClaude committed 2026-10-05 11:58:22 +00:00
commit df12b2a008
103 files changed
+3025

No files matched your search

+44
View File
@@ -0,0 +1,44 @@
{
"name": "AffineGapPenalty",
"summary": "The score of a gap of Length positions when opening a gap scores Open and each further position scores Extend.",
"tags": [
"alignment",
"gap model"
],
"sources": [
{
"title": "Gotoh, An improved algorithm for matching biological sequences, J. Mol. Biol. 162 (1982)",
"url": "https://doi.org/10.1016/0022-2836(82)90398-9"
}
],
"cases": [
{
"call": "AffineGapPenalty(1, -10, -1)"
},
{
"call": "AffineGapPenalty(5, -10, -1)"
},
{
"call": "AffineGapPenalty(3, -2, -2)"
}
],
"references": [
{
"lang": "python",
"level": "plain",
"file": "ref/python/plain.py",
"note": "The same formula."
},
{
"lang": "mojo",
"level": "plain",
"file": "ref/mojo/plain.mojo",
"note": "The same formula in Mojo."
}
],
"proof": {
"lang": "dafny",
"file": "proof/affine_gap.dfy",
"note": "The formula equals the score built position by position, and with Open == Extend it equals the linear model."
}
}