mirror of
https://github.com/Z3Prover/z3
synced 2025-04-24 01:25:31 +00:00
remove smtlib1 dependencies
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
d7042c234f
commit
89971e2a98
18 changed files with 23 additions and 3918 deletions
|
@ -37,7 +37,7 @@ Revision History:
|
|||
#include "util/env_params.h"
|
||||
#include "shell/lp_frontend.h"
|
||||
|
||||
typedef enum { IN_UNSPECIFIED, IN_SMTLIB, IN_SMTLIB_2, IN_DATALOG, IN_DIMACS, IN_WCNF, IN_OPB, IN_Z3_LOG, IN_MPS } input_kind;
|
||||
typedef enum { IN_UNSPECIFIED, IN_SMTLIB_2, IN_DATALOG, IN_DIMACS, IN_WCNF, IN_OPB, IN_Z3_LOG, IN_MPS } input_kind;
|
||||
|
||||
std::string g_aux_input_file;
|
||||
char const * g_input_file = 0;
|
||||
|
@ -169,9 +169,6 @@ void parse_cmd_line_args(int argc, char ** argv) {
|
|||
std::cout << "\n";
|
||||
exit(0);
|
||||
}
|
||||
else if (strcmp(opt_name, "smt") == 0) {
|
||||
g_input_kind = IN_SMTLIB;
|
||||
}
|
||||
else if (strcmp(opt_name, "smt2") == 0) {
|
||||
g_input_kind = IN_SMTLIB_2;
|
||||
}
|
||||
|
@ -340,9 +337,6 @@ int STD_CALL main(int argc, char ** argv) {
|
|||
else if (strcmp(ext, "smt2") == 0) {
|
||||
g_input_kind = IN_SMTLIB_2;
|
||||
}
|
||||
else if (strcmp(ext, "smt") == 0) {
|
||||
g_input_kind = IN_SMTLIB;
|
||||
}
|
||||
else if (strcmp(ext, "mps") == 0 || strcmp(ext, "sif") == 0 ||
|
||||
strcmp(ext, "MPS") == 0 || strcmp(ext, "SIF") == 0) {
|
||||
g_input_kind = IN_MPS;
|
||||
|
@ -350,9 +344,6 @@ int STD_CALL main(int argc, char ** argv) {
|
|||
}
|
||||
}
|
||||
switch (g_input_kind) {
|
||||
case IN_SMTLIB:
|
||||
return_value = read_smtlib_file(g_input_file);
|
||||
break;
|
||||
case IN_SMTLIB_2:
|
||||
memory::exit_when_out_of_memory(true, "(error \"out of memory\")");
|
||||
return_value = read_smtlib2_commands(g_input_file);
|
||||
|
|
|
@ -21,7 +21,6 @@ Revision History:
|
|||
#include<iostream>
|
||||
#include<time.h>
|
||||
#include<signal.h>
|
||||
#include "parsers/smt/smtlib_solver.h"
|
||||
#include "util/timeout.h"
|
||||
#include "parsers/smt2/smt2parser.h"
|
||||
#include "muz/fp/dl_cmds.h"
|
||||
|
@ -35,20 +34,14 @@ Revision History:
|
|||
|
||||
extern bool g_display_statistics;
|
||||
static clock_t g_start_time;
|
||||
static smtlib::solver* g_solver = 0;
|
||||
static cmd_context * g_cmd_context = 0;
|
||||
|
||||
static void display_statistics() {
|
||||
clock_t end_time = clock();
|
||||
if ((g_solver || g_cmd_context) && g_display_statistics) {
|
||||
if (g_cmd_context && g_display_statistics) {
|
||||
std::cout.flush();
|
||||
std::cerr.flush();
|
||||
if (g_solver) {
|
||||
g_solver->display_statistics();
|
||||
memory::display_max_usage(std::cout);
|
||||
std::cout << "time: " << ((static_cast<double>(end_time) - static_cast<double>(g_start_time)) / CLOCKS_PER_SEC) << " secs\n";
|
||||
}
|
||||
else if (g_cmd_context) {
|
||||
if (g_cmd_context) {
|
||||
g_cmd_context->set_regular_stream("stdout");
|
||||
g_cmd_context->display_statistics(true, ((static_cast<double>(end_time) - static_cast<double>(g_start_time)) / CLOCKS_PER_SEC));
|
||||
}
|
||||
|
@ -72,33 +65,6 @@ static void STD_CALL on_ctrl_c(int) {
|
|||
raise(SIGINT);
|
||||
}
|
||||
|
||||
unsigned read_smtlib_file(char const * benchmark_file) {
|
||||
g_start_time = clock();
|
||||
register_on_timeout_proc(on_timeout);
|
||||
signal(SIGINT, on_ctrl_c);
|
||||
smtlib::solver solver;
|
||||
g_solver = &solver;
|
||||
|
||||
bool ok = true;
|
||||
|
||||
ok = solver.solve_smt(benchmark_file);
|
||||
if (!ok) {
|
||||
if (benchmark_file) {
|
||||
std::cerr << "ERROR: solving '" << benchmark_file << "'.\n";
|
||||
}
|
||||
else {
|
||||
std::cerr << "ERROR: solving input stream.\n";
|
||||
}
|
||||
}
|
||||
|
||||
#pragma omp critical (g_display_stats)
|
||||
{
|
||||
display_statistics();
|
||||
register_on_timeout_proc(0);
|
||||
g_solver = 0;
|
||||
}
|
||||
return solver.get_error_code();
|
||||
}
|
||||
|
||||
unsigned read_smtlib2_commands(char const * file_name) {
|
||||
g_start_time = clock();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue