Left to Prove /bloom
Utility catalogue

Text processing · First wave

uniq

Collapse adjacent equal lines

Open2,000 seeds

Proof brief

Invocation
uniq
Input domain
Use no options. Read byte lines from stdin under LC_ALL=C, each shorter than 2^20 bytes excluding LF. Treat a final line without LF as a line.
Proof obligation
Emit exactly the first line of each maximal run of byte-identical lines, in input order, followed by LF. Repeated lines that occur in separate runs stay separate.
Test cases
Empty input, blank lines, long runs, the sequence A, B, A, and a final line without LF.
Outside this profile
Counting, skip flags, named files, locale-sensitive comparison, and I/O failures.

Subtasks and prerequisites

Read obligations JSON

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

  1. uniq.adjacent Collapse adjacent runs Proved

    Write one LF-terminated line for each adjacent run of equal byte lines shorter than 2^20 bytes, including a final line without LF.

    Statement UniqContract.adjacent · Proof source · Contribution #11 · Requires root.io · Unblocks 1 target

Replayed proof evidence

Replayed on main

Task bundle

Read bundle JSON

UniqContract.accepted

./ltp check uniq

Read the reference traces

Exact starter fixtures in the bundle include collapse runs while preserving separated duplicates and repeated blank lines and normalize a final line without LF and deduplicate a final line without LF.

Replay the current milestone with sh targets/uniq/verify.sh. Replay the current uniq 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