Left to Prove | head Take a prefix of lines Status: Open Seeds: 2000 Category: Streams (first wave) Invocation: head -n N Input domain: Read a finite byte stream from stdin. N is a nonnegative integer in a documented range. Proof obligation: Output all bytes through the Nth LF, or the whole input if there are fewer than N LF bytes. For N = 0, produce empty output. Show that the result is independent of read chunk boundaries. Test cases: Zero lines, empty input, a final unterminated line, consecutive empty lines, and an LF on the edge of a read buffer. Outside this profile: Named files, negative counts, GNU byte mode, and guarantees about unread bytes on a shared descriptor. Specification: https://pubs.opengroup.org/onlinepubs/9799919799/utilities/head.html Reference: https://www.gnu.org/software/coreutils/manual/html_node/head-invocation.html Reference source: https://github.com/coreutils/coreutils/blob/v9.11/src/head.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: head.lines: Line prefix (Proved; requires root.io; unblocks 1 target) Obligation graph: https://lefttoprove.com/obligations.json Task bundle: https://lefttoprove.com/bundles/head.json Proof replay: Specs.HeadContract.accepted (replayed) Rocq contract: https://github.com/bloom-directory/lefttoprove/blob/3440f400d235544fe816475adde8e55009e057c0/targets/head/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: HeadContract.accepted (https://github.com/bloom-directory/lefttoprove/blob/main/targets/head/Contract.v) Specification replay from the contribution checkout: ./ltp check head Reference fixtures: https://github.com/bloom-directory/lefttoprove/blob/main/targets/head/fixtures.json Implementation replay command: sh targets/head/verify.sh Replay the current head 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: head Contribution: proof Contribution guidelines: https://lefttoprove.com/join.txt