Last Updated: 2025-01-18
Phase: 1 - Phonetic Rewrite Rules
Status: Historical snapshot; see FORMAL_VERIFICATION_MANIFEST.tsv for
current trusted/partial/legacy status.
The phonetic proof tree is currently partial. It contains useful proof islands for a legacy modeled subset, but it does not yet cover the full current Rust phonetic API or 62-rule runtime aggregate.
We are implementing a fully Rocq-verified phonetic fuzzy matching system with the following phases:
docs/verification/phonetic/)rewrite_rules.v)Phone - phonetic symbolsContext - rule application contextsRewriteRule - complete rule structurePhone_eqb - equality checkingis_vowel, is_consonant - type predicatesis_Some - option checkingcontext_matches - validate rule contextpattern_matches_at - check pattern at positionapply_rule_at - apply single rulefind_first_match - find application positionapply_rules_seq - sequential application with fuelzompist_rules.v)orthography_rules - exact transformationsphonetic_rules - approximate transformationszompist_rule_set - combined set✅ Theorem 1: Well-Formedness (zompist_rules_wellformed)
Theorem zompist_rules_wellformed :
forall r, In r zompist_rule_set -> wf_rule r.
Status: ✅ PROVEN (complete proof, no Admitted)
Proof strategy:
✅ Theorem 2: Bounded Expansion (rule_application_bounded)
Theorem rule_application_bounded :
forall r s pos s',
In r zompist_rule_set ->
apply_rule_at r s pos = Some s' ->
(length s' <= length s + max_expansion_factor)%nat.
Status: ✅ PROVEN (complete proof, zero Admitted)
Proof strategy:
firstn_length_le - firstn produces expected lengthskipn_length - skipn length calculationpattern_matches_implies_bounds - pattern matching implies valid positionmax_replacement_length - replacement bounded by 2min_pattern_length - pattern at least 1lia tactic to complete bounds proofTheorem some_rules_dont_commute :
exists r1 r2,
In r1 zompist_rule_set /\
In r2 zompist_rule_set /\
~rules_commute r1 r2.
Plan: Prove by counterexample (Rule 33 vs Rule 34)
Theorem sequential_application_terminates :
forall rules s,
(forall r, In r rules -> wf_rule r) ->
exists fuel result,
apply_rules_seq rules s fuel = Some result.
Plan: Well-founded recursion on fuel = length s * length rules * max_expansion
Theorem rewrite_idempotent :
forall rules s fuel s',
apply_rules_seq rules s fuel = Some s' ->
apply_rules_seq rules s' fuel = Some s'.
Plan: Prove fixed point property
$ cd docs/verification
$ make phonetic
Compiling phonetic/rewrite_rules.v...
✓ OK
Compiling phonetic/zompist_rules.v...
✓ OK (zero Admitted!)
Admitted lemmas in zompist_rules.v| Metric | Count | Target | Progress |
|---|---|---|---|
| Rules Defined | 11 | 56 | 20% |
| Theorems Stated | 5 | 5 | 100% |
| Theorems Proven | 2 | 5 | 40% |
| Lines of Proof | ~250 | ~500 | 50% |
| Admitted Lemmas | 0 | 0 | ✅ |
Admitted)max_replacement_length, min_pattern_length)firstn_length_le and skipn_length lemmasrule_application_boundedAdmitted from zompist_rules.v proofsConfidence Level: 🟢 VERY HIGH
Admitted in zompist_rules.vCan you improve this documentation?Edit on GitHub
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |