Z3
 
Loading...
Searching...
No Matches
ApplyResult.java
Go to the documentation of this file.
1
18package com.microsoft.z3;
19
20import java.lang.ref.ReferenceQueue;
21
26public class ApplyResult extends Z3Object {
30 public int getNumSubgoals()
31 {
32 return Native.applyResultGetNumSubgoals(getContext().nCtx(),
33 getNativeObject());
34 }
35
41 public Goal[] getSubgoals()
42 {
43 int n = getNumSubgoals();
44 Goal[] res = new Goal[n];
45 for (int i = 0; i < n; i++)
46 res[i] = new Goal(getContext(),
47 Native.applyResultGetSubgoal(getContext().nCtx(), getNativeObject(), i));
48 return res;
49 }
50
54 @Override
55 public String toString() {
56 return Native.applyResultToString(getContext().nCtx(), getNativeObject());
57 }
58
59 ApplyResult(Context ctx, long obj)
60 {
61 super(ctx, obj);
62 }
63
64 @Override
65 void incRef() {
66 Native.applyResultIncRef(getContext().nCtx(), getNativeObject());
67 }
68
69 @Override
70 void addToReferenceQueue() {
71 getContext().getReferenceQueue().storeReference(this, ApplyResultRef::new);
72 }
73
74 private static class ApplyResultRef extends Z3ReferenceQueue.Reference<ApplyResult> {
75
76 private ApplyResultRef(ApplyResult referent, ReferenceQueue<Z3Object> q) {
77 super(referent, q);
78 }
79
80 @Override
81 void decRef(Context ctx, long z3Obj) {
82 Native.applyResultDecRef(ctx.nCtx(), z3Obj);
83 }
84 }
85}