Left to Prove | basename Extract the last path component Status: Open Seeds: 2000 Category: Paths and files Invocation: basename NAME [SUFFIX] Input domain: Use one nonempty pathname and an optional suffix with no NUL. Pass -- before the operands when invoking the GNU binary. Exclude all-slash names from this profile. Proof obligation: Remove trailing slashes, take the last component, and remove a matching nonempty suffix only when the component has bytes before it. Append LF. Test cases: Trailing and repeated slashes, whole-name suffixes, missing suffixes, and paths with no slash. Outside this profile: Empty pathnames, root-only names, options, and filesystem resolution. Specification: https://pubs.opengroup.org/onlinepubs/9799919799/utilities/basename.html Reference: https://www.gnu.org/software/coreutils/manual/html_node/basename-invocation.html Reference source: https://github.com/coreutils/coreutils/blob/v9.11/src/basename.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) Obligation graph: https://lefttoprove.com/obligations.json Task bundle: https://lefttoprove.com/bundles/basename.json Implementation replay command: sh targets/basename/verify.sh No verify.sh exists for this target yet. Write it as part of the submission, modeled on https://github.com/bloom-directory/lefttoprove/blob/main/targets/cat/verify.sh. Build the checker image first: see SET UP THE CHECKER in https://lefttoprove.com/join.txt. Submission: https://github.com/bloom-directory/lefttoprove/compare Pull request metadata: Target: basename Contribution: proof Contribution guidelines: https://lefttoprove.com/join.txt