mirror of
https://github.com/Z3Prover/z3
synced 2025-06-06 22:23:22 +00:00
added Z3_enable_trace/Z3_disable_trace to the Z3 API (these APIs are NOOPs if tracing is not enabled during compilation)
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
1a16cf5a01
commit
5220092f0c
4 changed files with 33 additions and 5 deletions
|
@ -650,6 +650,7 @@ def def_APIs():
|
||||||
for api_file in API_FILES:
|
for api_file in API_FILES:
|
||||||
api = open(api_file, 'r')
|
api = open(api_file, 'r')
|
||||||
for line in api:
|
for line in api:
|
||||||
|
line = line.strip('\r\n\t ')
|
||||||
try:
|
try:
|
||||||
m = pat1.match(line)
|
m = pat1.match(line)
|
||||||
if m:
|
if m:
|
||||||
|
|
|
@ -491,6 +491,16 @@ extern "C" {
|
||||||
*revision_number = Z3_REVISION_NUMBER;
|
*revision_number = Z3_REVISION_NUMBER;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Z3_API Z3_enable_trace(Z3_string tag) {
|
||||||
|
LOG_Z3_enable_trace(tag);
|
||||||
|
enable_trace(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Z3_API Z3_disable_trace(Z3_string tag) {
|
||||||
|
LOG_Z3_disable_trace(tag);
|
||||||
|
disable_trace(tag);
|
||||||
|
}
|
||||||
|
|
||||||
void Z3_API Z3_reset_memory(void) {
|
void Z3_API Z3_reset_memory(void) {
|
||||||
LOG_Z3_reset_memory();
|
LOG_Z3_reset_memory();
|
||||||
memory::finalize();
|
memory::finalize();
|
||||||
|
|
|
@ -5057,12 +5057,24 @@ END_MLAPI_EXCLUDE
|
||||||
|
|
||||||
def_API('Z3_get_version', VOID, (_out(UINT), _out(UINT), _out(UINT), _out(UINT)))
|
def_API('Z3_get_version', VOID, (_out(UINT), _out(UINT), _out(UINT), _out(UINT)))
|
||||||
*/
|
*/
|
||||||
void Z3_API Z3_get_version(__out unsigned * major,
|
void Z3_API Z3_get_version(__out unsigned * major, __out unsigned * minor, __out unsigned * build_number, __out unsigned * revision_number);
|
||||||
__out unsigned * minor,
|
|
||||||
__out unsigned * build_number,
|
/**
|
||||||
__out unsigned * revision_number);
|
\brief Enable tracing messages tagged as \c tag when Z3 is compiled in debug mode.
|
||||||
|
It is a NOOP otherwise
|
||||||
|
|
||||||
|
def_API('Z3_enable_trace', VOID, (_in(STRING),))
|
||||||
|
*/
|
||||||
|
void Z3_API Z3_enable_trace(__in Z3_string tag);
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Disable tracing messages tagged as \c tag when Z3 is compiled in debug mode.
|
||||||
|
It is a NOOP otherwise
|
||||||
|
|
||||||
|
def_API('Z3_disable_trace', VOID, (_in(STRING),))
|
||||||
|
*/
|
||||||
|
void Z3_API Z3_disable_trace(__in Z3_string tag);
|
||||||
|
|
||||||
#ifdef CorML3
|
#ifdef CorML3
|
||||||
/**
|
/**
|
||||||
\brief Reset all allocated resources.
|
\brief Reset all allocated resources.
|
||||||
|
|
|
@ -37,13 +37,18 @@ Z3 exceptions:
|
||||||
... print "failed:", ex
|
... print "failed:", ex
|
||||||
failed: 'sort mismatch'
|
failed: 'sort mismatch'
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from z3core import *
|
from z3core import *
|
||||||
from z3types import *
|
from z3types import *
|
||||||
from z3consts import *
|
from z3consts import *
|
||||||
from z3printer import *
|
from z3printer import *
|
||||||
import io
|
import io
|
||||||
|
|
||||||
|
def enable_trace(msg):
|
||||||
|
Z3_enable_trace(msg)
|
||||||
|
|
||||||
|
def disable_trace(msg):
|
||||||
|
Z3_disable_trace(msg)
|
||||||
|
|
||||||
# We use _z3_assert instead of the assert command because we want to
|
# We use _z3_assert instead of the assert command because we want to
|
||||||
# produce nice error messages in Z3Py at rise4fun.com
|
# produce nice error messages in Z3Py at rise4fun.com
|
||||||
def _z3_assert(cond, msg):
|
def _z3_assert(cond, msg):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue