mirror of
https://github.com/Z3Prover/z3
synced 2025-06-21 21:33:39 +00:00
move spacer_marshal to under parsers/smt2
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
d67f3c1466
commit
70f7846af5
4 changed files with 10 additions and 19 deletions
|
@ -7,7 +7,6 @@ z3_add_component(spacer
|
||||||
spacer_farkas_learner.cpp
|
spacer_farkas_learner.cpp
|
||||||
spacer_generalizers.cpp
|
spacer_generalizers.cpp
|
||||||
spacer_manager.cpp
|
spacer_manager.cpp
|
||||||
spacer_marshal.cpp
|
|
||||||
spacer_prop_solver.cpp
|
spacer_prop_solver.cpp
|
||||||
spacer_smt_context_manager.cpp
|
spacer_smt_context_manager.cpp
|
||||||
spacer_sym_mux.cpp
|
spacer_sym_mux.cpp
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
z3_add_component(smt2parser
|
z3_add_component(smt2parser
|
||||||
SOURCES
|
SOURCES
|
||||||
|
marshal.cpp
|
||||||
smt2parser.cpp
|
smt2parser.cpp
|
||||||
smt2scanner.cpp
|
smt2scanner.cpp
|
||||||
COMPONENT_DEPENDENCIES
|
COMPONENT_DEPENDENCIES
|
||||||
|
|
|
@ -2,14 +2,14 @@
|
||||||
Copyright (c) 2017 Arie Gurfinkel
|
Copyright (c) 2017 Arie Gurfinkel
|
||||||
Module Name:
|
Module Name:
|
||||||
|
|
||||||
spacer_marshal.cpp
|
marshal.cpp
|
||||||
|
|
||||||
Abstract:
|
Abstract:
|
||||||
|
|
||||||
marshaling and unmarshaling of expressions
|
marshaling and unmarshaling of expressions
|
||||||
|
|
||||||
--*/
|
--*/
|
||||||
#include "muz/spacer/spacer_marshal.h"
|
#include "parsers/smt2/marshal.h"
|
||||||
|
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
|
@ -18,39 +18,33 @@ Abstract:
|
||||||
#include "util/vector.h"
|
#include "util/vector.h"
|
||||||
#include "ast/ast_smt_pp.h"
|
#include "ast/ast_smt_pp.h"
|
||||||
#include "ast/ast_pp.h"
|
#include "ast/ast_pp.h"
|
||||||
|
#include "ast/ast_util.h"
|
||||||
|
|
||||||
namespace spacer {
|
std::ostream &marshal(std::ostream &os, expr_ref e, ast_manager &m) {
|
||||||
std::ostream &marshal(std::ostream &os, expr_ref e, ast_manager &m)
|
|
||||||
{
|
|
||||||
ast_smt_pp pp(m);
|
ast_smt_pp pp(m);
|
||||||
pp.display_smt2(os, e);
|
pp.display_smt2(os, e);
|
||||||
return os;
|
return os;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string marshal(expr_ref e, ast_manager &m)
|
std::string marshal(expr_ref e, ast_manager &m) {
|
||||||
{
|
|
||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
marshal(ss, e, m);
|
marshal(ss, e, m);
|
||||||
return ss.str();
|
return ss.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
expr_ref unmarshal(std::istream &is, ast_manager &m)
|
expr_ref unmarshal(std::istream &is, ast_manager &m) {
|
||||||
{
|
|
||||||
cmd_context ctx(false, &m);
|
cmd_context ctx(false, &m);
|
||||||
ctx.set_ignore_check(true);
|
ctx.set_ignore_check(true);
|
||||||
if (!parse_smt2_commands(ctx, is)) { return expr_ref(0, m); }
|
if (!parse_smt2_commands(ctx, is)) { return expr_ref(0, m); }
|
||||||
|
|
||||||
ptr_vector<expr>::const_iterator it = ctx.begin_assertions();
|
ptr_vector<expr>::const_iterator it = ctx.begin_assertions();
|
||||||
ptr_vector<expr>::const_iterator end = ctx.end_assertions();
|
ptr_vector<expr>::const_iterator end = ctx.end_assertions();
|
||||||
if (it == end) { return expr_ref(m.mk_true(), m); }
|
|
||||||
unsigned size = static_cast<unsigned>(end - it);
|
unsigned size = static_cast<unsigned>(end - it);
|
||||||
return expr_ref(m.mk_and(size, it), m);
|
return expr_ref(mk_and(m, size, it), m);
|
||||||
}
|
}
|
||||||
|
|
||||||
expr_ref unmarshal(std::string s, ast_manager &m)
|
expr_ref unmarshal(std::string s, ast_manager &m) {
|
||||||
{
|
|
||||||
std::istringstream is(s);
|
std::istringstream is(s);
|
||||||
return unmarshal(is, m);
|
return unmarshal(is, m);
|
||||||
}
|
}
|
||||||
}
|
|
|
@ -2,7 +2,7 @@
|
||||||
Copyright (c) 2017 Arie Gurfinkel
|
Copyright (c) 2017 Arie Gurfinkel
|
||||||
Module Name:
|
Module Name:
|
||||||
|
|
||||||
spacer_marshal.h
|
marshal.h
|
||||||
|
|
||||||
Abstract:
|
Abstract:
|
||||||
|
|
||||||
|
@ -17,14 +17,11 @@ Abstract:
|
||||||
|
|
||||||
#include "ast/ast.h"
|
#include "ast/ast.h"
|
||||||
|
|
||||||
namespace spacer {
|
|
||||||
std::ostream &marshal(std::ostream &os, expr_ref e, ast_manager &m);
|
std::ostream &marshal(std::ostream &os, expr_ref e, ast_manager &m);
|
||||||
std::string marshal(expr_ref e, ast_manager &m);
|
std::string marshal(expr_ref e, ast_manager &m);
|
||||||
expr_ref unmarshal(std::string s, ast_manager &m);
|
expr_ref unmarshal(std::string s, ast_manager &m);
|
||||||
expr_ref unmarshal(std::istream &is, ast_manager &m);
|
expr_ref unmarshal(std::istream &is, ast_manager &m);
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
Loading…
Add table
Add a link
Reference in a new issue