Skip to content

Commit

Permalink
Adapt "ensures not found" warning message
Browse files Browse the repository at this point in the history
"translatable" was a bit confusing a word (translation was not really
the issue).
Add some explanation on what the ensures clause should look like.
  • Loading branch information
n-osborne authored and shym committed Oct 17, 2023
1 parent 76099bd commit 8f2ebf0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
8 changes: 5 additions & 3 deletions plugins/qcheck-stm/src/reserr.ml
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,11 @@ let pp_kind ppf kind =
pf ppf "Skipping unsupported modifies clause:@ %a" text
"expected \"modifies x\" or \"modifies x.model\" where x is the SUT"
| Ensures_not_found_for_next_state (f, m) ->
pf ppf "Skipping %s:@ model@ %s@ %a" f m text
"is declared as modified by the function but no translatable ensures \
clause was found"
pf ppf "Skipping %s:@ model@ %s %a@;%a%s%a" f m text
"is declared as modified by the function but no suitable ensures \
clause was found."
text "Specifications should contain at least one \"ensures x." m text
" = ...\" where x is the SUT"
| Functional_argument f ->
pf ppf "Skipping %s:@ %a" f text
"functions are not supported yet as arguments"
Expand Down
5 changes: 3 additions & 2 deletions plugins/qcheck-stm/test/all_warnings_errors.expected
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ File "all_warnings.mli", line 37, characters 13-23:
37 | modifies t.contents *)
^^^^^^^^^^
Warning: Skipping ensures_not_found_for_next_state: model contents is
declared as modified by the function but no translatable ensures
clause was found.
declared as modified by the function but no suitable ensures clause
was found. Specifications should contain at least one "ensures
x.contents = ..." where x is the SUT.
File "all_warnings.mli", line 53, characters 16-54:
53 | ensures b = forall a. List.mem a t.contents -> p a *)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down

0 comments on commit 8f2ebf0

Please sign in to comment.