21using System.Diagnostics;
43 readonly
public string Key;
55 public bool IsUInt {
get {
return m_is_uint; } }
59 public bool IsDouble {
get {
return m_is_double; } }
70 return m_uint.ToString();
72 return m_double.ToString();
74 throw new Z3Exception(
"Unknown statistical entry type");
87 readonly
private bool m_is_uint =
false;
88 readonly
private bool m_is_double =
false;
89 readonly
private uint m_uint = 0;
90 readonly
private double m_double = 0.0;
91 internal Entry(
string k, uint v)
97 internal Entry(
string k,
double v)
111 return Native.Z3_stats_to_string(
Context.nCtx, NativeObject);
119 get {
return Native.Z3_stats_size(
Context.nCtx, NativeObject); }
129 return NativeEntries(
Context.nCtx, NativeObject);
135 uint n = Native.Z3_stats_size(ctx, stats);
136 Entry[] res =
new Entry[n];
137 for (uint i = 0; i < n; i++)
140 string k = Native.Z3_stats_get_key(ctx, stats, i);
141 if (Native.Z3_stats_is_uint(ctx, stats, i) != 0)
142 e =
new Entry(k, Native.Z3_stats_get_uint_value(ctx, stats, i));
143 else if (Native.Z3_stats_is_double(ctx, stats, i) != 0)
144 e =
new Entry(k, Native.Z3_stats_get_double_value(ctx, stats, i));
161 string[] res =
new string[n];
162 for (uint i = 0; i < n; i++)
163 res[i] = Native.Z3_stats_get_key(
Context.nCtx, NativeObject, i);
178 for (uint i = 0; i < n; i++)
179 if (es[i].Key == key)
189 Debug.Assert(ctx !=
null);
192 internal class DecRefQueue : IDecRefQueue
194 public DecRefQueue() : base() { }
195 public DecRefQueue(uint move_limit) : base(move_limit) { }
196 internal override void IncRef(
Context ctx, IntPtr obj)
198 Native.Z3_stats_inc_ref(ctx.nCtx, obj);
201 internal override void DecRef(
Context ctx, IntPtr obj)
203 Native.Z3_stats_dec_ref(ctx.nCtx, obj);
207 internal override void IncRef(IntPtr o)
213 internal override void DecRef(IntPtr o)
The main interaction with Z3 happens via the Context.
IDecRefQueue Statistics_DRQ
Statistics DRQ
Statistical data is organized into pairs of [Key, Entry], where every Entry is either a DoubleEntry o...
double DoubleValue
The double-value of the entry.
readonly string Key
The key of the entry.
uint UIntValue
The uint-value of the entry.
bool IsDouble
True if the entry is double-valued.
bool IsUInt
True if the entry is uint-valued.
override string ToString()
The string representation of the Entry.
string Value
The string representation of the entry's value.
Objects of this class track statistical information about solvers.
string[] Keys
The statistical counters.
uint Size
The number of statistical data.
override string ToString()
A string representation of the statistical data.
Entry[] Entries
The data entries.
The exception base class for error reporting from Z3
Internal base class for interfacing with native Z3 objects. Should not be used externally.
Context Context
Access Context object