Z3
ParamDescrs.cs
Go to the documentation of this file.
1/*++
2Copyright (c) 2012 Microsoft Corporation
3
4Module Name:
5
6 Parameter.cs
7
8Abstract:
9
10 Z3 Managed API: Parameter Descriptions
11
12Author:
13
14 Christoph Wintersteiger (cwinter) 2012-03-20
15
16Notes:
17
18--*/
19
20using System.Diagnostics;
21using System;
22
23namespace Microsoft.Z3
24{
28 public class ParamDescrs : Z3Object
29 {
33 public void Validate(Params p)
34 {
35 Debug.Assert(p != null);
36 Native.Z3_params_validate(Context.nCtx, p.NativeObject, NativeObject);
37 }
38
43 {
44 Debug.Assert(name != null);
45 return (Z3_param_kind)Native.Z3_param_descrs_get_kind(Context.nCtx, NativeObject, name.NativeObject);
46 }
47
51 public string GetDocumentation(Symbol name)
52 {
53 Debug.Assert(name != null);
54 return Native.Z3_param_descrs_get_documentation(Context.nCtx, NativeObject, name.NativeObject);
55 }
56
60 public Symbol[] Names
61 {
62 get
63 {
64 uint sz = Native.Z3_param_descrs_size(Context.nCtx, NativeObject);
65 Symbol[] names = new Symbol[sz];
66 for (uint i = 0; i < sz; ++i) {
67 names[i] = Symbol.Create(Context, Native.Z3_param_descrs_get_name(Context.nCtx, NativeObject, i));
68 }
69 return names;
70 }
71 }
72
76 public uint Size
77 {
78 get { return Native.Z3_param_descrs_size(Context.nCtx, NativeObject); }
79 }
80
84 public override string ToString()
85 {
86 return Native.Z3_param_descrs_to_string(Context.nCtx, NativeObject);
87 }
88
89 #region Internal
90 internal ParamDescrs(Context ctx, IntPtr obj)
91 : base(ctx, obj)
92 {
93 Debug.Assert(ctx != null);
94 }
95
96 internal class DecRefQueue : IDecRefQueue
97 {
98 public DecRefQueue() : base() { }
99 public DecRefQueue(uint move_limit) : base(move_limit) { }
100 internal override void IncRef(Context ctx, IntPtr obj)
101 {
102 Native.Z3_param_descrs_inc_ref(ctx.nCtx, obj);
103 }
104
105 internal override void DecRef(Context ctx, IntPtr obj)
106 {
107 Native.Z3_param_descrs_dec_ref(ctx.nCtx, obj);
108 }
109 };
110
111 internal override void IncRef(IntPtr o)
112 {
113 Context.ParamDescrs_DRQ.IncAndClear(Context, o);
114 base.IncRef(o);
115 }
116
117 internal override void DecRef(IntPtr o)
118 {
119 Context.ParamDescrs_DRQ.Add(o);
120 base.DecRef(o);
121 }
122 #endregion
123 }
124}
The main interaction with Z3 happens via the Context.
Definition: Context.cs:32
IDecRefQueue ParamDescrs_DRQ
ParamDescrs DRQ
Definition: Context.cs:4770
A ParamDescrs describes a set of parameters.
Definition: ParamDescrs.cs:29
string GetDocumentation(Symbol name)
Retrieve documentation of parameter.
Definition: ParamDescrs.cs:51
Symbol[] Names
Retrieve all names of parameters.
Definition: ParamDescrs.cs:61
void Validate(Params p)
validate a set of parameters.
Definition: ParamDescrs.cs:33
uint Size
The size of the ParamDescrs.
Definition: ParamDescrs.cs:77
override string ToString()
Retrieves a string representation of the ParamDescrs.
Definition: ParamDescrs.cs:84
Z3_param_kind GetKind(Symbol name)
Retrieve kind of parameter.
Definition: ParamDescrs.cs:42
A Params objects represents a configuration in the form of Symbol/value pairs.
Definition: Params.cs:29
Symbols are used to name several term and type constructors.
Definition: Symbol.cs:30
Internal base class for interfacing with native Z3 objects. Should not be used externally.
Definition: Z3Object.cs:33
Z3_param_kind
The different kinds of parameters that can be associated with parameter sets. (see Z3_mk_params).
Definition: z3_api.h:1317