Skip to content

--line should fail when no proof obligation is selected #276

Description

@lemmy

When tlapm --line <n> is given a line that does not select any proof obligation, TLAPM exits successfully and reports that all
zero obligations were proved. This can make an off-by-one line number look like a successful proof.

Reproducer

---- MODULE true_test ----
EXTENDS TLAPS
THEOREM TRUE
    OBVIOUS
====
$ tlapm --line 1 true_test.tla
@!!BEGIN
@!!type:obligationsnumber
@!!count:0
@!!END
File "./true_test.tla", line 1, character 1 to line 8, character 4:
[INFO]: All 0 obligation proved.
$ echo $?
0

Proposed behavior

For an explicit target such as --line, selecting zero obligations should return a nonzero exit code,
e.g.

[WARNING]: No proof obligation found at line 1.

A full-module run with genuinely zero obligations can still succeed. The proposed change is only for explicit proof targets
(--line, and possibly targeted Toolbox ranges).

Environment

$ tlapm --version
fd3988f

Potentially related: #245

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementA new feature, an improvement, or other addition.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions