-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApplyResult.java
More file actions
82 lines (74 loc) · 2.14 KB
/
ApplyResult.java
File metadata and controls
82 lines (74 loc) · 2.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/**
* This file was automatically generated from ApplyResult.cs
* w/ further modifications by:
* @author Christoph M. Wintersteiger (cwinter)
**/
package com.microsoft.z3;
/**
* ApplyResult objects represent the result of an application of a tactic to a
* goal. It contains the subgoals that were produced.
**/
public class ApplyResult extends Z3Object
{
/**
* The number of Subgoals.
**/
public int getNumSubgoals() throws Z3Exception
{
return Native.applyResultGetNumSubgoals(getContext().nCtx(),
getNativeObject());
}
/**
* Retrieves the subgoals from the ApplyResult.
*
* @throws Z3Exception
**/
public Goal[] getSubgoals() throws Z3Exception
{
int n = getNumSubgoals();
Goal[] res = new Goal[n];
for (int i = 0; i < n; i++)
res[i] = new Goal(getContext(),
Native.applyResultGetSubgoal(getContext().nCtx(), getNativeObject(), i));
return res;
}
/**
* Convert a model for the subgoal <paramref name="i"/> into a model for the
* original goal <code>g</code>, that the ApplyResult was obtained from.
*
* @return A model for <code>g</code>
* @throws Z3Exception
**/
public Model convertModel(int i, Model m) throws Z3Exception
{
return new Model(getContext(),
Native.applyResultConvertModel(getContext().nCtx(), getNativeObject(), i, m.getNativeObject()));
}
/**
* A string representation of the ApplyResult.
**/
public String toString()
{
try
{
return Native.applyResultToString(getContext().nCtx(), getNativeObject());
} catch (Z3Exception e)
{
return "Z3Exception: " + e.getMessage();
}
}
ApplyResult(Context ctx, long obj) throws Z3Exception
{
super(ctx, obj);
}
void incRef(long o) throws Z3Exception
{
getContext().applyResult_DRQ().incAndClear(getContext(), o);
super.incRef(o);
}
void decRef(long o) throws Z3Exception
{
getContext().applyResult_DRQ().add(o);
super.decRef(o);
}
}