3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-05-25 03:16:21 +00:00

Polish TPTP parser diagnostics

Agent-Logs-Url: https://github.com/Z3Prover/z3/sessions/ca1df142-d992-4e45-a8b3-859fa70a5222

Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2026-05-23 23:17:57 +00:00 committed by GitHub
parent 2bfb8d80db
commit aac0a49c5b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 5 deletions

View file

@ -1182,7 +1182,7 @@ class tptp_parser {
if (let_consts.size() == 1) {
replacer.insert(let_consts[0], value.get());
} else {
throw parse_error("tuple $let destructuring is not supported");
throw parse_error("tuple $let destructuring is not supported; use single-variable $let bindings instead");
}
expr_ref result(m);
replacer(body, result);
@ -1257,7 +1257,7 @@ class tptp_parser {
// Tuple/list in formula position: [t1, t2, ...] — return first element for simplicity
if (accept(token_kind::lbrack)) {
throw parse_error("tuple/list formulas are not supported");
throw parse_error("tuple/list formulas are not supported in formula position; split them into separate formulas instead");
}
std::string n = parse_name();
@ -1433,9 +1433,9 @@ class tptp_parser {
func_decl* f = mk_modal_op(mod_name);
return expr_ref(m.mk_app(f, sub.get()), m);
}
throw parse_error("tuple/list formulas are not supported");
throw parse_error("tuple/list formulas are not supported in formula position; split them into separate formulas instead");
}
throw parse_error("tuple/list formulas are not supported");
throw parse_error("tuple/list formulas are not supported in formula position; split them into separate formulas instead");
}
// Diamond modality: <.>, <name>

View file

@ -1,5 +1,7 @@
#include <atomic>
#include <cerrno>
#include <cstdio>
#include <cstring>
#include <chrono>
#include <filesystem>
#include <fstream>
@ -64,7 +66,7 @@ public:
}
~scoped_temp_file() {
if (!m_path.empty() && std::remove(m_path.c_str()) != 0)
std::cerr << "failed to remove temporary file: " << m_path << "\n";
std::cerr << "failed to remove temporary file '" << m_path << "': " << std::strerror(errno) << "\n";
}
std::string const& path() const { return m_path; }
};