mirror of
https://github.com/Z3Prover/z3
synced 2025-04-12 12:08:18 +00:00
removed native low level parser
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
263fb48180
commit
95a25265f2
|
@ -23,7 +23,6 @@ Revision History:
|
||||||
#include"cmd_context.h"
|
#include"cmd_context.h"
|
||||||
#include"smt2parser.h"
|
#include"smt2parser.h"
|
||||||
#include"smtparser.h"
|
#include"smtparser.h"
|
||||||
#include"z3_solver.h"
|
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|
||||||
|
@ -248,40 +247,6 @@ extern "C" {
|
||||||
return mk_c(c)->m_smtlib_error_buffer.c_str();
|
return mk_c(c)->m_smtlib_error_buffer.c_str();
|
||||||
Z3_CATCH_RETURN("");
|
Z3_CATCH_RETURN("");
|
||||||
}
|
}
|
||||||
|
|
||||||
Z3_ast parse_z3_stream(Z3_context c, std::istream& is) {
|
|
||||||
z3_solver parser(c, is, verbose_stream(), mk_c(c)->fparams(), false);
|
|
||||||
if (!parser.parse()) {
|
|
||||||
SET_ERROR_CODE(Z3_PARSER_ERROR);
|
|
||||||
return of_ast(mk_c(c)->m().mk_true());
|
|
||||||
}
|
|
||||||
expr_ref_vector assumptions(mk_c(c)->m());
|
|
||||||
parser.get_assumptions(assumptions);
|
|
||||||
return of_ast(mk_c(c)->mk_and(assumptions.size(), assumptions.c_ptr()));
|
|
||||||
}
|
|
||||||
|
|
||||||
Z3_ast Z3_API Z3_parse_z3_string(Z3_context c, Z3_string str) {
|
|
||||||
Z3_TRY;
|
|
||||||
LOG_Z3_parse_z3_string(c, str);
|
|
||||||
std::string s(str);
|
|
||||||
std::istringstream is(s);
|
|
||||||
Z3_ast r = parse_z3_stream(c, is);
|
|
||||||
RETURN_Z3(r);
|
|
||||||
Z3_CATCH_RETURN(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
Z3_ast Z3_API Z3_parse_z3_file(Z3_context c, Z3_string file_name) {
|
|
||||||
Z3_TRY;
|
|
||||||
LOG_Z3_parse_z3_file(c, file_name);
|
|
||||||
std::ifstream is(file_name);
|
|
||||||
if (!is) {
|
|
||||||
SET_ERROR_CODE(Z3_PARSER_ERROR);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
Z3_ast r = parse_z3_stream(c, is);
|
|
||||||
RETURN_Z3(r);
|
|
||||||
Z3_CATCH_RETURN(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ---------------
|
// ---------------
|
||||||
// Support for SMTLIB2
|
// Support for SMTLIB2
|
||||||
|
|
|
@ -4977,23 +4977,6 @@ BEGIN_MLAPI_EXCLUDE
|
||||||
Z3_string Z3_API Z3_get_smtlib_error(__in Z3_context c);
|
Z3_string Z3_API Z3_get_smtlib_error(__in Z3_context c);
|
||||||
END_MLAPI_EXCLUDE
|
END_MLAPI_EXCLUDE
|
||||||
|
|
||||||
/**
|
|
||||||
\brief \mlh parse_z3_string c str \endmlh
|
|
||||||
Parse the given string using the Z3 native parser.
|
|
||||||
|
|
||||||
Return the conjunction of asserts made in the input.
|
|
||||||
|
|
||||||
def_API('Z3_parse_z3_string', AST, (_in(CONTEXT), _in(STRING)))
|
|
||||||
*/
|
|
||||||
Z3_ast Z3_API Z3_parse_z3_string(__in Z3_context c, __in Z3_string str);
|
|
||||||
|
|
||||||
/**
|
|
||||||
\brief Similar to #Z3_parse_z3_string, but reads the benchmark from a file.
|
|
||||||
|
|
||||||
def_API('Z3_parse_z3_file', AST, (_in(CONTEXT), _in(STRING)))
|
|
||||||
*/
|
|
||||||
Z3_ast Z3_API Z3_parse_z3_file(__in Z3_context c, __in Z3_string file_name);
|
|
||||||
|
|
||||||
/*@}*/
|
/*@}*/
|
||||||
|
|
||||||
#ifdef CorML4
|
#ifdef CorML4
|
||||||
|
|
File diff suppressed because it is too large
Load diff
1007
src/api/z3_solver.h
1007
src/api/z3_solver.h
File diff suppressed because it is too large
Load diff
|
@ -2853,30 +2853,6 @@ namespace Microsoft.Z3
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Native Parser
|
|
||||||
/// <summary>
|
|
||||||
/// Parse the given string using the Z3 native parser.
|
|
||||||
/// </summary>
|
|
||||||
/// <returns>A conjunction of asserts made in <paramref name="str"/>.</returns>
|
|
||||||
public Expr ParseZ3String(string str)
|
|
||||||
{
|
|
||||||
Contract.Ensures(Contract.Result<Expr>() != null);
|
|
||||||
|
|
||||||
return Expr.Create(this, Native.Z3_parse_z3_string(nCtx, str));
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Parse the given file using the Z3 native parser.
|
|
||||||
/// </summary>
|
|
||||||
/// <returns>A conjunction of asserts made in the file.</returns>
|
|
||||||
public Expr ParseZ3File(string fileName)
|
|
||||||
{
|
|
||||||
Contract.Ensures(Contract.Result<Expr>() != null);
|
|
||||||
|
|
||||||
return Expr.Create(this, Native.Z3_parse_z3_file(nCtx, fileName));
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Goals
|
#region Goals
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a new Goal.
|
/// Creates a new Goal.
|
||||||
|
|
Loading…
Reference in a new issue