Left to Prove | wc Count lines and bytes Status: Open Seeds: 3000 Category: Streams (first wave) 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. Specification: https://pubs.opengroup.org/onlinepubs/9799919799/utilities/wc.html Reference: https://www.gnu.org/software/coreutils/manual/html_node/wc-invocation.html Reference source: https://github.com/coreutils/coreutils/blob/v9.11/src/wc.c Reference release: GNU Coreutils 9.11 (https://github.com/coreutils/coreutils/releases/tag/v9.11) Prerequisites: root.io: Byte I/O and argument forwarding (Proved) root.exit: Exit status (Tested, not proved) Subtasks: wc.count: Count lines and bytes through root (Proved; requires root.io; unblocks 1 target) Obligation graph: https://lefttoprove.com/obligations.json Task bundle: https://lefttoprove.com/bundles/wc.json Proof replay: Specs.WcContract.accepted (replayed) Rocq contract: https://github.com/bloom-directory/lefttoprove/blob/3440f400d235544fe816475adde8e55009e057c0/targets/wc/Contract.v Rocq assumptions policy: https://github.com/bloom-directory/lefttoprove/blob/3440f400d235544fe816475adde8e55009e057c0/.github/assumptions-allowlist.txt Replay bundle and recorded assumptions: https://github.com/bloom-directory/lefttoprove/actions/runs/46701031785#artifacts Rocq statement: WcContract.accepted (https://github.com/bloom-directory/lefttoprove/blob/main/targets/wc/Contract.v) Specification replay from the contribution checkout: ./ltp check wc Reference fixtures: https://github.com/bloom-directory/lefttoprove/blob/main/targets/wc/fixtures.json Implementation replay command: 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. Submission: https://github.com/bloom-directory/lefttoprove/compare Pull request metadata: Target: wc Contribution: proof Contribution guidelines: https://lefttoprove.com/join.txt