Utility catalogue
Streams · First wave
wc
Count lines and bytes
Open3,000 seeds
Proof brief
- Invocation
wc -l -c- Input domain
- Read a finite byte stream shorter than 2^32 bytes from piped stdin under LC_ALL=C.
- Proof obligation
- In -l -c mode, output the counts of LF bytes and total bytes, in that order. Prove the counter invariant for every partition of the input into read chunks. Interpret both i32 counts as unsigned and render them in decimal using the field formatting of the pinned oracle.
- Test cases
- Empty input, repeated LF, an unterminated last line, zero bytes in the stream, and newlines split across read boundaries.
- Outside this profile
- Word and character counts, filenames, read and write failures, and inputs of 2^32 bytes or more. The count export uses the unsigned i32 range, 0 through 2^32−1.
Subtasks and prerequisites
Read obligations JSONThis target needs root.io (proved), root.exit (tested, not proved).
-
wc.countCount lines and bytes through root ProvedThe count export returns unsigned i32 LF and byte counts for stdin shorter than 2^32 bytes, reading through root.read_byte.
Replayed proof evidence
Replayed on mainTask bundle
Read bundle JSON./ltp check wc
Exact starter fixtures in the bundle include two lines and unterminated input.
Replay the current milestone with sh targets/wc/verify.sh. Replay the current wc milestone in the checker image, which sets WASMCERT. See SET UP THE CHECKER in https://lefttoprove.com/join.txt.
GitHub submissions
See the review queueView GitHub pull requests for the current status.