Utility catalogue
Streams · First wave
head
Take a prefix of lines
Open2,000 seeds
Proof brief
- 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.
Subtasks and prerequisites
Read obligations JSONThis target needs root.io (proved), root.exit (tested, not proved).
-
head.linesLine prefix ProvedRead the bounded line count from argv and emit the requested stdin prefix under the successful byte I/O model.
Replayed proof evidence
Replayed on mainTask bundle
Read bundle JSON./ltp check head
Exact starter fixtures in the bundle include two-line prefix and zero lines with GNU head.
Replay the current milestone with 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.
GitHub submissions
See the review queueView GitHub pull requests for the current status.