mirror of
https://github.com/Z3Prover/z3
synced 2025-05-06 15:25:46 +00:00
add shorthand for translating models #1407
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
8dadd30db5
commit
f0a30ded7d
5 changed files with 48 additions and 7 deletions
|
@ -212,6 +212,18 @@ extern "C" {
|
|||
RETURN_Z3(of_ast_vector(v));
|
||||
Z3_CATCH_RETURN(0);
|
||||
}
|
||||
|
||||
Z3_model Z3_API Z3_model_translate(Z3_context c, Z3_model m, Z3_context target) {
|
||||
Z3_TRY;
|
||||
LOG_Z3_model_translate(c, m, target);
|
||||
RESET_ERROR_CODE();
|
||||
Z3_model_ref* dst = alloc(Z3_model_ref, *mk_c(target));
|
||||
ast_translation tr(mk_c(c)->m(), mk_c(target)->m());
|
||||
dst->m_model = to_model_ref(m)->translate(tr);
|
||||
mk_c(target)->save_object(dst);
|
||||
RETURN_Z3(of_model(dst));
|
||||
Z3_CATCH_RETURN(0);
|
||||
}
|
||||
|
||||
Z3_bool Z3_API Z3_is_as_array(Z3_context c, Z3_ast a) {
|
||||
Z3_TRY;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue