Left to Prove /bloom
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 JSON

This target needs root.io (proved), root.exit (tested, not proved).

  1. wc.count Count lines and bytes through root Proved

    The count export returns unsigned i32 LF and byte counts for stdin shorter than 2^32 bytes, reading through root.read_byte.

    Statement WcContract.count · Proof source · Contribution #5 · Requires root.io · Unblocks 1 target

Replayed proof evidence

Replayed on main

Task bundle

Read bundle JSON

WcContract.accepted

./ltp check wc

Read the reference traces

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 queue

View GitHub pull requests for the current status.

View GitHub pull requests