3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-05-11 09:44:43 +00:00

add optimization front-ends directly to the shell

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2014-10-10 14:23:58 -07:00
parent d1a2e61220
commit f651145b4c
5 changed files with 379 additions and 2 deletions

View file

@ -29,13 +29,14 @@ Revision History:
#include"version.h"
#include"dimacs_frontend.h"
#include"datalog_frontend.h"
#include"opt_frontend.h"
#include"timeout.h"
#include"z3_exception.h"
#include"error_codes.h"
#include"gparams.h"
#include"env_params.h"
typedef enum { IN_UNSPECIFIED, IN_SMTLIB, IN_SMTLIB_2, IN_DATALOG, IN_DIMACS, IN_Z3_LOG } input_kind;
typedef enum { IN_UNSPECIFIED, IN_SMTLIB, IN_SMTLIB_2, IN_DATALOG, IN_DIMACS, IN_WCNF, IN_PBO, IN_Z3_LOG } input_kind;
std::string g_aux_input_file;
char const * g_input_file = 0;
@ -168,6 +169,12 @@ void parse_cmd_line_args(int argc, char ** argv) {
else if (strcmp(opt_name, "dimacs") == 0) {
g_input_kind = IN_DIMACS;
}
else if (strcmp(opt_name, "wcnf") == 0) {
g_input_kind = IN_WCNF;
}
else if (strcmp(opt_name, "bpo") == 0) {
g_input_kind = IN_PBO;
}
else if (strcmp(opt_name, "log") == 0) {
g_input_kind = IN_Z3_LOG;
}
@ -306,6 +313,12 @@ int main(int argc, char ** argv) {
else if (strcmp(ext, "dimacs") == 0 || strcmp(ext, "cnf") == 0) {
g_input_kind = IN_DIMACS;
}
else if (strcmp(ext, "wcnf") == 0) {
g_input_kind = IN_WCNF;
}
else if (strcmp(ext, "pbo") == 0) {
g_input_kind = IN_PBO;
}
else if (strcmp(ext, "log") == 0) {
g_input_kind = IN_Z3_LOG;
}
@ -328,6 +341,12 @@ int main(int argc, char ** argv) {
case IN_DIMACS:
return_value = read_dimacs(g_input_file);
break;
case IN_WCNF:
return_value = parse_opt(g_input_file, true);
break;
case IN_PBO:
return_value = parse_opt(g_input_file, false);
break;
case IN_DATALOG:
read_datalog(g_input_file);
break;