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

Clean up implicit variable handling helpers in TPTP parser

Agent-Logs-Url: https://github.com/Z3Prover/z3/sessions/38c3a47d-1e93-48d8-8fa4-1dfc724e76e5

Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2026-05-13 15:57:34 +00:00 committed by GitHub
parent e50c22099d
commit 7658141c0b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -412,9 +412,13 @@ class tptp_parser {
return false;
}
bool should_create_implicit_var(std::string const& n) const {
return is_var_name(n) && m_implicit_scope;
}
app* get_or_create_implicit_var(std::string const& n) {
if (!m_implicit_scope)
throw parse_error("internal parser error: implicit variable scope is missing (unexpected parser state)");
throw parse_error("unexpected parser state: missing implicit variable scope");
auto it = m_implicit_scope->vars.find(n);
if (it != m_implicit_scope->vars.end()) return it->second;
app* c = m.mk_const(symbol(n), m_univ);
@ -536,7 +540,7 @@ class tptp_parser {
expr_ref b(m);
if (is_var_name(n) && find_bound(n, b))
return b;
if (is_var_name(n) && m_implicit_scope)
if (should_create_implicit_var(n))
return expr_ref(get_or_create_implicit_var(n), m);
expr_ref_vector args(m);
@ -624,7 +628,7 @@ class tptp_parser {
lhs = b;
has_lhs = true;
}
else if (is_var_name(n) && m_implicit_scope) {
else if (should_create_implicit_var(n)) {
lhs = expr_ref(get_or_create_implicit_var(n), m);
has_lhs = true;
}