Z3
src
api
dotnet
Log.cs
Go to the documentation of this file.
1
/*++
2
Copyright (c) 2012 Microsoft Corporation
3
4
Module Name:
5
6
Log.cs
7
8
Abstract:
9
10
Z3 Managed API: Log
11
12
Author:
13
14
Christoph Wintersteiger (cwinter) 2012-03-15
15
16
Notes:
17
18
--*/
19
20
using
System
;
21
using
System
.
Diagnostics
.
Contracts
;
22
23
namespace
Microsoft
.Z3
24
{
32
[
ContractVerification
(
true
)]
33
public
static
class
Log
34
{
35
private
static
bool
m_is_open =
false
;
36
42
public
static
bool
Open(
string
filename)
43
{
44
m_is_open =
true
;
45
return
Native.Z3_open_log(filename) == 1;
46
}
47
51
public
static
void
Close()
52
{
53
m_is_open =
false
;
54
Native.Z3_close_log();
55
}
56
60
public
static
void
Append(
string
s)
61
{
62
Contract.Requires(isOpen());
63
64
if
(!m_is_open)
65
throw
new
Z3Exception(
"Log cannot be closed."
);
66
Native.Z3_append_log(s);
67
}
68
73
[
Pure
]
74
public
static
bool
isOpen()
75
{
76
return
m_is_open;
77
}
78
}
79
}
System.Diagnostics.Contracts.Pure
Definition:
DummyContracts.cs:43
System
System.Diagnostics
Microsoft
System.Diagnostics.Contracts.ContractVerification
Definition:
DummyContracts.cs:38
System.Diagnostics.Contracts
Definition:
DummyContracts.cs:21
Generated on Sat Nov 12 2016 23:18:40 for Z3 by
1.8.12