tvm
Loading...
Searching...
No Matches
Public Member Functions | Friends | List of all members
tvm::sym::Z3Prover Class Reference

Optional Z3-backed prover over the analyzer's accepted premises. More...

#include <analyzer.h>

Collaboration diagram for tvm::sym::Z3Prover:

Public Member Functions

TVM_TIRX_DLL bool IsEnabled () const
 Whether the Z3 backend is compiled into this build (TVM_TIRX_USE_Z3=ON).
 
TVM_TIRX_DLL bool CanProve (const PrimExpr &expr)
 Attempt to prove that expr holds under the current premises.
 
TVM_TIRX_DLL ffi::String GetSMTLIB2 (const ffi::Optional< PrimExpr > expr)
 Get the SMTLIB2 representation of the current context.
 
TVM_TIRX_DLL ffi::String GetStats ()
 Get statistics about Z3 prover.
 
TVM_TIRX_DLL void SetTimeoutMs (unsigned timeout_ms)
 Set timeout in milliseconds for Z3 prover.
 
TVM_TIRX_DLL void SetRLimit (unsigned rlimit)
 Set resource limitation for Z3 prover.
 
TVM_TIRX_DLL ffi::String GetModel (const PrimExpr &expr)
 Get a counterexample model for a boolean expression.
 
TVM_TIRX_DLL int64_t CountSatisfyingValues (const Var &var, int64_t max_count=2048, int64_t min_consecutive=1)
 Count the number of integer values that satisfy the current constraints.
 

Friends

class AnalyzerObj
 
class Analyzer
 

Detailed Description

Optional Z3-backed prover over the analyzer's accepted premises.

Diagnostic and enumeration queries may propagate translation or solver errors. Their temporary assertions do not change the accepted premise environment.

Member Function Documentation

◆ CanProve()

TVM_TIRX_DLL bool tvm::sym::Z3Prover::CanProve ( const PrimExpr &  expr)

Attempt to prove that expr holds under the current premises.

Parameters
exprBoolean expression to prove.
Returns
True only when proved; false for unsupported expressions, an unavailable backend, an inconclusive solver result, or a caught Z3 error. False is not a disproof.

◆ CountSatisfyingValues()

TVM_TIRX_DLL int64_t tvm::sym::Z3Prover::CountSatisfyingValues ( const Var &  var,
int64_t  max_count = 2048,
int64_t  min_consecutive = 1 
)

Count the number of integer values that satisfy the current constraints.

Enumerates distinct values until the limit, unsatisfiability, or an inconclusive result. The count may be partial; it is not a proof of the domain cardinality.

Parameters
varThe variable to count satisfying values for.
max_countMaximum number of values to enumerate; nonpositive values enumerate none.
min_consecutiveMinimum size of each consecutive run in the enumerated values; nonpositive values disable this check. The check does not establish complete coverage.
Returns
The enumerated count, -1 for an unsupported variable or disabled Z3, or -2 if a nonempty enumerated run is shorter than min_consecutive. Errors may propagate.

◆ GetModel()

TVM_TIRX_DLL ffi::String tvm::sym::Z3Prover::GetModel ( const PrimExpr &  expr)

Get a counterexample model for a boolean expression.

Parameters
exprBoolean expression whose negation is checked under the current premises.
Returns
A model satisfying the negation, or an empty string if no model is found (including an unknown result). The stub returns a comment indicating Z3 is disabled.

◆ GetSMTLIB2()

TVM_TIRX_DLL ffi::String tvm::sym::Z3Prover::GetSMTLIB2 ( const ffi::Optional< PrimExpr >  expr)

Get the SMTLIB2 representation of the current context.

Parameters
exprOptional boolean expression whose negation is added as a proof query.
Returns
The SMTLIB2 string, or a comment indicating that Z3 is disabled.

◆ GetStats()

TVM_TIRX_DLL ffi::String tvm::sym::Z3Prover::GetStats ( )

Get statistics about Z3 prover.

Returns
The statistics string, or a comment indicating that Z3 is disabled.

◆ IsEnabled()

TVM_TIRX_DLL bool tvm::sym::Z3Prover::IsEnabled ( ) const

Whether the Z3 backend is compiled into this build (TVM_TIRX_USE_Z3=ON).

Returns
true if the real Z3 prover is available, false for the stub.

◆ SetRLimit()

TVM_TIRX_DLL void tvm::sym::Z3Prover::SetRLimit ( unsigned  rlimit)

Set resource limitation for Z3 prover.

Parameters
rlimitZ3 resource limit; zero disables it. Ignored by the stub.

◆ SetTimeoutMs()

TVM_TIRX_DLL void tvm::sym::Z3Prover::SetTimeoutMs ( unsigned  timeout_ms)

Set timeout in milliseconds for Z3 prover.

Parameters
timeout_msThe timeout in milliseconds; zero disables the timeout. Ignored by the stub.

Friends And Related Symbol Documentation

◆ Analyzer

friend class Analyzer
friend

◆ AnalyzerObj

friend class AnalyzerObj
friend

The documentation for this class was generated from the following file: