Z3
src
api
dotnet
TupleSort.cs
Go to the documentation of this file.
1
/*++
2
Copyright (c) 2012 Microsoft Corporation
3
4
Module Name:
5
6
TupleSort.cs
7
8
Abstract:
9
10
Z3 Managed API: Tuple Sorts
11
12
Author:
13
14
Christoph Wintersteiger (cwinter) 2012-11-23
15
16
Notes:
17
18
--*/
19
20
using
System
;
21
using
System
.
Diagnostics
.
Contracts
;
22
23
namespace
Microsoft
.Z3
24
{
28
[
ContractVerification
(
true
)]
29
public
class
TupleSort
:
Sort
30
{
34
public
FuncDecl
MkDecl
35
{
36
get
37
{
38
Contract.Ensures(Contract.Result<
FuncDecl
>() != null);
39
40
return
new
FuncDecl
(
Context
, Native.Z3_get_tuple_sort_mk_decl(
Context
.nCtx, NativeObject));
41
}
42
}
43
47
public
uint NumFields
48
{
49
get
{
return
Native.Z3_get_tuple_sort_num_fields(
Context
.nCtx, NativeObject); }
50
}
51
55
public
FuncDecl
[] FieldDecls
56
{
57
get
58
{
59
Contract.Ensures(Contract.Result<
FuncDecl
[]>() != null);
60
61
uint n = NumFields;
62
FuncDecl
[] res =
new
FuncDecl
[n];
63
for
(uint i = 0; i < n; i++)
64
res[i] =
new
FuncDecl
(
Context
, Native.Z3_get_tuple_sort_field_decl(
Context
.nCtx, NativeObject, i));
65
return
res;
66
}
67
}
68
69
#region Internal
70
internal
TupleSort
(
Context
ctx,
Symbol
name, uint numFields,
Symbol
[] fieldNames,
Sort
[] fieldSorts)
71
: base(ctx, IntPtr.Zero)
72
{
73
Contract.Requires(ctx != null);
74
Contract.Requires(name != null);
75
76
IntPtr t = IntPtr.Zero;
77
IntPtr[] f =
new
IntPtr[numFields];
78
NativeObject = Native.Z3_mk_tuple_sort(ctx.nCtx, name.NativeObject, numFields,
79
Symbol
.ArrayToNative(fieldNames),
AST
.ArrayToNative(fieldSorts),
80
ref t, f);
81
}
82
#endregion
83
};
84
}
System
System.Diagnostics
Microsoft
System.Diagnostics.Contracts.ContractVerification
Definition:
DummyContracts.cs:38
System.Diagnostics.Contracts
Definition:
DummyContracts.cs:21
Microsoft.Z3.Context
The main interaction with Z3 happens via the Context.
Definition:
Context.cs:32
Microsoft.Z3.Sort
The Sort class implements type information for ASTs.
Definition:
Sort.cs:29
Microsoft.Z3.AST
The abstract syntax tree (AST) class.
Definition:
AST.cs:31
Microsoft.Z3.Symbol
Symbols are used to name several term and type constructors.
Definition:
Symbol.cs:30
Microsoft.Z3.FuncDecl
Function declarations.
Definition:
FuncDecl.cs:29
Microsoft.Z3.TupleSort
Tuple sorts.
Definition:
TupleSort.cs:29
Generated on Sat Nov 12 2016 22:01:04 for Z3 by
1.8.12