3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-07-22 23:15:51 +00:00

fix: add dedicated lim_svector<sort*> m_type_vars to decl_collector and emit declare-type-var in display_decls

- decl_collector.h: add m_type_vars lim_svector, get_type_vars() getter, update reset()
- decl_collector.cpp: push poly_family_id sorts to m_type_vars instead of m_sorts;
  push_scope/pop_scope m_type_vars in push()/pop()
- ast_pp_util.h: add stacked_value<unsigned> m_type_vars counter
- ast_pp_util.cpp: emit (declare-type-var <name>) before other sort declarations
  in display_decls(); reset/push/pop the new m_type_vars counter
This commit is contained in:
copilot-swe-agent[bot] 2026-07-13 03:27:16 +00:00 committed by GitHub
parent 638e7b7bce
commit 1e07ca76af
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 20 additions and 5 deletions

View file

@ -26,8 +26,9 @@ Revision History:
#include "ast/array_decl_plugin.h"
class decl_collector {
ast_manager & m;
ast_manager & m;
lim_svector<sort*> m_sorts;
lim_svector<sort*> m_type_vars;
lim_svector<func_decl*> m_decls;
lim_svector<func_decl*> m_rec_decls;
ast_mark m_visited;
@ -53,7 +54,7 @@ public:
bool should_declare(func_decl* f) const;
void reset() { m_sorts.reset(); m_decls.reset(); m_visited.reset(); m_trail.reset(); }
void reset() { m_sorts.reset(); m_type_vars.reset(); m_decls.reset(); m_visited.reset(); m_trail.reset(); }
void visit_func(func_decl* n);
void visit(ast * n);
void visit(unsigned n, expr* const* es);
@ -68,6 +69,7 @@ public:
unsigned get_num_decls() const { return m_decls.size(); }
lim_svector<sort*> const& get_sorts() const { return m_sorts; }
lim_svector<sort*> const& get_type_vars() const { return m_type_vars; }
lim_svector<func_decl*> const& get_func_decls() const { return m_decls; }
lim_svector<func_decl*> const& get_rec_decls() const { return m_rec_decls; }
};