Z3
 
Loading...
Searching...
No Matches
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 override void IncRef(IntPtr o)
97 {
98 Native.Z3_param_descrs_inc_ref(Context.nCtx, o);
99 }
100
101 internal override void DecRef(IntPtr o)
102 {
103 lock (Context)
104 {
105 if (Context.nCtx != IntPtr.Zero)
106 Native.Z3_param_descrs_dec_ref(Context.nCtx, o);
107 }
108 }
109 #endregion
110 }
111}
The main interaction with Z3 happens via the Context.
Definition Context.cs:34
A ParamDescrs describes a set of parameters.
string GetDocumentation(Symbol name)
Retrieve documentation of parameter.
Symbol[] Names
Retrieve all names of parameters.
void Validate(Params p)
validate a set of parameters.
uint Size
The size of the ParamDescrs.
override string ToString()
Retrieves a string representation of the ParamDescrs.
Z3_param_kind GetKind(Symbol name)
Retrieve kind of parameter.
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
Context Context
Access Context object.
Definition Z3Object.cs:111
Z3_param_kind
The different kinds of parameters that can be associated with parameter sets. (see Z3_mk_params).
Definition z3_api.h:1305