-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Silent failure when input file doesn't exist -- output suggests file exists #41
Comments
Thank you for reporting this issue. This bug was caused by a comparison between the file basename, with the extension This comparison is on the following line: Line 234 in ab564e3
Adding before the above line the following lines: let file_basename = Filename.basename loc.Loc.file in
print_string "Inside `Proof.Gen`\nFile basename:\n";
print_string (file_basename ^ "\n");
print_string "!Params.input_files:\n";
List.iter (fun x -> print_string x) !Params.input_files;
print_string "\n----"; results in the following output: > ls nonexistent
ls: nonexistent: No such file or directory
> ls nonexistent.tla
nonexistent.tla
> cat nonexistent.tla
---- MODULE nonexistent ----
THEOREM FALSE
OBVIOUS
============================
> tlapm nonexistent
...
Inside `Proof.Gen`
File basename:
nonexistent.tla
!Params.input_files:
nonexistent
...
(* created new ".tlacache/nonexistent.tlaps/nonexistent.thy" *)
(* fingerprints written in ".tlacache/nonexistent.tlaps/fingerprints" *)
File "./nonexistent.tla", line 1, character 1 to line 6, character 28:
[INFO]: All 0 obligation proved.
> tlapm nonexistent.tla
...
Inside `Proof.Gen`
File basename:
nonexistent.tla
!Params.input_files:
nonexistent.tla
...
(* loading fingerprints in ".tlacache/nonexistent.tlaps/fingerprints" *)
** Unexpanded symbols: ---
Zenon error: exhausted search space without finding a proof
(* created new ".tlacache/nonexistent.tlaps/nonexistent.thy" *)
(* fingerprints written in ".tlacache/nonexistent.tlaps/fingerprints" *)
File "./nonexistent.tla", line 4, characters 1-7:
[ERROR]: Could not prove or check:
FALSE
File "./nonexistent.tla", line 1, character 1 to line 6, character 28:
[ERROR]: 1/1 obligation failed.
There were backend errors processing module `"nonexistent"`.
tlapm ending abnormally with Failure("backend errors: there are unproved obligations")
Raised at Stdlib.failwith in file "stdlib.ml", line 29, characters 17-33
Called from Tlapm.process_module in file "tlapm.ml", line 406, characters 12-77
Called from Tlapm.main.f in file "tlapm.ml", line 502, characters 23-43
Called from Stdlib__list.fold_left in file "list.ml", line 121, characters 24-34
Called from Tlapm.main in file "tlapm.ml", line 505, characters 13-40
Called from Tlapm.init in file "tlapm.ml", line 517, characters 8-33 This error arises when the following condition is true:
What So in both cases of invocation above, > tlapm nofile
File "<unknown>":
Error: File "nofile" not found
...
tlapm ending abnormally with Failure("Module.Parser.parse_file")
Raised at Stdlib.failwith in file "stdlib.ml", line 29, characters 17-33
Called from M_save.clocking in file "m_save.ml", line 29, characters 18-22
Called from Tlapm.read_new_modules.(fun) in file "tlapm.ml", line 453, characters 8-112
Called from Stdlib__list.fold_left in file "list.ml", line 121, characters 24-34
Called from Tlapm.main in file "tlapm.ml", line 489, characters 20-43
Called from Tlapm.init in file "tlapm.ml", line 517, characters 8-33 Later, as
The filename given on the command-line is One way to address this issue (assuming the diff --git a/src/tlapm.ml b/src/tlapm.ml
index f46d51f..cd3bc80 100644
--- a/src/tlapm.ml
+++ b/src/tlapm.ml
@@ -470,8 +470,22 @@ let print_modules mcx =
print_string "\nModules loaded so far:\n";
Sm.iter (fun name mule -> Printf.printf "Module name: \"%s\"\n" name) mcx
+
+let append_ext_if_not_tla filename =
+ if Filename.check_suffix filename ".tla" then
+ filename
+ else
+ filename ^ ".tla"
+
+
+let map_paths_to_filenames paths =
+ let basenames = List.map Filename.basename paths in
+ List.map append_ext_if_not_tla basenames
+
+
let main fs =
- Params.input_files := List.map Filename.basename fs;
+ Params.input_files := map_paths_to_filenames fs;
+ List.iter (fun x -> print_string (x ^ "\n")) !Params.input_files;
let () =
List.iter begin
fun s -> Further commentsThe code relevant to the extension After the code for (Passing a filename with two dot characters (The value Line 472 in ab564e3
) |
Addressed by commit c791f8b. |
Note the missing file extension (
BlockingQueue
) in the first invocation, but the message includes the extension (BlockingQueue.tla
) :Both TLC and Apalache automatically append the
.tla
extension if omitted.The text was updated successfully, but these errors were encountered: