3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-13 20:38:43 +00:00

Added ParamDescr.ToString()

Formatting

Signed-off-by: Christoph M. Wintersteiger <cwinter@microsoft.com>
This commit is contained in:
Christoph M. Wintersteiger 2012-10-12 16:44:46 +01:00
parent 4d70722769
commit 42c27b7a46
5 changed files with 90 additions and 78 deletions

View file

@ -50,7 +50,7 @@ namespace Microsoft.Z3
Contract.Requires(settings != null);
IntPtr cfg = Native.Z3_mk_config();
foreach(KeyValuePair<string,string> kv in settings)
foreach (KeyValuePair<string, string> kv in settings)
Native.Z3_set_param_value(cfg, kv.Key, kv.Value);
m_ctx = Native.Z3_mk_context_rc(cfg);
Native.Z3_del_config(cfg);
@ -3480,12 +3480,8 @@ namespace Microsoft.Z3
/// </summary>
public ParamDescrs SimplifyParameterDescriptions
{
get
{
return new ParamDescrs(this, Native.Z3_simplify_get_param_descrs(nCtx));
get { return new ParamDescrs(this, Native.Z3_simplify_get_param_descrs(nCtx)); }
}
}
/// <summary>
/// Enable/disable printing of warning messages to the console.

View file

@ -34,7 +34,8 @@ namespace Microsoft.Z3
/// </summary>
public string Help
{
get {
get
{
Contract.Ensures(Contract.Result<string>() != null);
return Native.Z3_fixedpoint_get_help(Context.nCtx, NativeObject);
}
@ -58,10 +59,7 @@ namespace Microsoft.Z3
/// </summary>
public ParamDescrs ParameterDescriptions
{
get
{
return new ParamDescrs(Context, Native.Z3_fixedpoint_get_param_descrs(Context.nCtx, NativeObject));
}
get { return new ParamDescrs(Context, Native.Z3_fixedpoint_get_param_descrs(Context.nCtx, NativeObject)); }
}

View file

@ -23,7 +23,7 @@ using System.Diagnostics.Contracts;
namespace Microsoft.Z3
{
/// <summary>
/// A ParameterSet represents a configuration in the form of Symbol/value pairs.
/// A ParamDescrs describes a set of parameters.
/// </summary>
[ContractVerification(true)]
public class ParamDescrs : Z3Object
@ -62,6 +62,27 @@ namespace Microsoft.Z3
}
}
/// <summary>
/// The size of the ParamDescrs.
/// </summary>
public uint Size
{
get { return Native.Z3_param_descrs_size(Context.nCtx, NativeObject); }
}
/// <summary>
/// Retrieves a string representation of the ParamDescrs.
/// </summary>
public override string ToString()
{
String res = "";
Symbol[] n = Names;
if (n.Length > 0) res = n[0].ToString();
for (uint i = 1; i < n.Length; i++)
res += " " + n[i].ToString();
return res;
}
#region Internal
internal ParamDescrs(Context ctx, IntPtr obj)
: base(ctx, obj)

View file

@ -60,10 +60,7 @@ namespace Microsoft.Z3
/// </summary>
public ParamDescrs ParameterDescriptions
{
get
{
return new ParamDescrs(Context, Native.Z3_solver_get_param_descrs(Context.nCtx, NativeObject));
}
get { return new ParamDescrs(Context, Native.Z3_solver_get_param_descrs(Context.nCtx, NativeObject)); }
}

View file

@ -40,7 +40,8 @@ namespace Microsoft.Z3
{
Contract.Ensures(Contract.Result<string>() != null);
return Native.Z3_tactic_get_help(Context.nCtx, NativeObject); }
return Native.Z3_tactic_get_help(Context.nCtx, NativeObject);
}
}
@ -49,10 +50,7 @@ namespace Microsoft.Z3
/// </summary>
public ParamDescrs ParameterDescriptions
{
get
{
return new ParamDescrs(Context, Native.Z3_tactic_get_param_descrs(Context.nCtx, NativeObject));
}
get { return new ParamDescrs(Context, Native.Z3_tactic_get_param_descrs(Context.nCtx, NativeObject)); }
}
@ -103,11 +101,13 @@ namespace Microsoft.Z3
}
#region Internal
internal Tactic(Context ctx, IntPtr obj) : base(ctx, obj)
internal Tactic(Context ctx, IntPtr obj)
: base(ctx, obj)
{
Contract.Requires(ctx != null);
}
internal Tactic(Context ctx, string name) : base(ctx, Native.Z3_mk_tactic(ctx.nCtx, name))
internal Tactic(Context ctx, string name)
: base(ctx, Native.Z3_mk_tactic(ctx.nCtx, name))
{
Contract.Requires(ctx != null);
}