rocq/backend/NfbProof.v
What NFB's Gallina reader and writer (NfbTerm.v, Nfb.v) are proved to do (docs/nfb.md, Relation to the term form and the Rocq model).
- Canonical: the words
decodetakes are the wordsencode_withwrites for the module it gives, CONTEXT and tools' sections aside (decode_canonical). So two lists of words that decode to one module, with NAMES in both or in neither, are the same words (decode_identity): the words are the module's identity. - Round trip: toward
decodeencodem = Somem, the words of each kind of field read back as what was written: a signed 64-bit or 96-bit integer (i64_round_trip,wide_round_trip), an inline constant (inline_round_trip), and an enumeration's code (codes_round_trip).
Canonical form
words_eqb is equality of word lists.
Proof 6 steps Qed
Whether the reader finds a NAMES section in ws.
The words decode takes are exactly the words encode_with writes for the module it gives, with NAMES if they have it: no other spelling of a module is read.
Proof 12 steps Qed
Two lists of words that decode reads as the same module, both with NAMES or both without, are the same words once CONTEXT and tools' sections are set aside: the module id the document defines over them is sound.
Proof 3 steps Qed
Words read back
A signed 64-bit integer, written as two words, reads back.
Proof 18 steps Qed
A signed 96-bit integer, written as three words, reads back.
Proof 22 steps Qed
An inline constant's operand word reads back as the constant, whatever the tables: tag 1, the constant in the payload.
Proof 22 steps Qed
Whether each key and each value of the table xs occurs once.
A table whose keys and values each occur once gives back the key of the value of a key.
Proof 13 steps Qed
Every enumeration's table has each atom once and each code once.
Proof 1 step Qed
The code of an atom in an enumeration reads back as the atom.