-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTactic.java
More file actions
95 lines (85 loc) · 2.64 KB
/
Tactic.java
File metadata and controls
95 lines (85 loc) · 2.64 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
83
84
85
86
87
88
89
90
91
92
93
94
95
/**
* This file was automatically generated from Tactic.cs
* w/ further modifications by:
* @author Christoph M. Wintersteiger (cwinter)
**/
package com.microsoft.z3;
/**
* Tactics are the basic building block for creating custom solvers for specific
* problem domains. The complete list of tactics may be obtained using
* <code>Context.NumTactics</code> and <code>Context.TacticNames</code>. It may
* also be obtained using the command <code>(help-tactics)</code> in the SMT 2.0
* front-end.
**/
public class Tactic extends Z3Object
{
/**
* A string containing a description of parameters accepted by the tactic.
**/
public String getHelp() throws Z3Exception
{
return Native.tacticGetHelp(getContext().nCtx(), getNativeObject());
}
/**
* Retrieves parameter descriptions for Tactics.
* @throws Z3Exception
**/
public ParamDescrs getParameterDescriptions() throws Z3Exception
{
return new ParamDescrs(getContext(), Native.tacticGetParamDescrs(getContext()
.nCtx(), getNativeObject()));
}
/**
* Execute the tactic over the goal.
* @throws Z3Exception
**/
public ApplyResult apply(Goal g) throws Z3Exception
{
return apply(g, null);
}
/**
* Execute the tactic over the goal.
* @throws Z3Exception
**/
public ApplyResult apply(Goal g, Params p) throws Z3Exception
{
getContext().checkContextMatch(g);
if (p == null)
return new ApplyResult(getContext(), Native.tacticApply(getContext()
.nCtx(), getNativeObject(), g.getNativeObject()));
else
{
getContext().checkContextMatch(p);
return new ApplyResult(getContext(),
Native.tacticApplyEx(getContext().nCtx(), getNativeObject(),
g.getNativeObject(), p.getNativeObject()));
}
}
/**
* Creates a solver that is implemented using the given tactic. <seealso
* cref="Context.MkSolver(Tactic)"/>
* @throws Z3Exception
**/
public Solver getSolver() throws Z3Exception
{
return getContext().mkSolver(this);
}
Tactic(Context ctx, long obj) throws Z3Exception
{
super(ctx, obj);
}
Tactic(Context ctx, String name) throws Z3Exception
{
super(ctx, Native.mkTactic(ctx.nCtx(), name));
}
void incRef(long o) throws Z3Exception
{
getContext().tactic_DRQ().incAndClear(getContext(), o);
super.incRef(o);
}
void decRef(long o) throws Z3Exception
{
getContext().tactic_DRQ().add(o);
super.decRef(o);
}
}