3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-05-11 09:44:43 +00:00
z3/src/api/java/ApplyResult.java
Nikolaj Bjorner 4bbece6616 re-organize proof and model converters to be associated with goals instead of external
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2017-11-18 16:33:54 -08:00

71 lines
1.5 KiB
Java

/**
Copyright (c) 2012-2014 Microsoft Corporation
Module Name:
ApplyResult.java
Abstract:
Author:
@author Christoph Wintersteiger (cwinter) 2012-03-15
Notes:
**/
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()
{
return Native.applyResultGetNumSubgoals(getContext().nCtx(),
getNativeObject());
}
/**
* Retrieves the subgoals from the ApplyResult.
*
* @throws Z3Exception
**/
public Goal[] getSubgoals()
{
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;
}
/**
* A string representation of the ApplyResult.
**/
@Override
public String toString() {
return Native.applyResultToString(getContext().nCtx(), getNativeObject());
}
ApplyResult(Context ctx, long obj)
{
super(ctx, obj);
}
@Override
void incRef() {
Native.applyResultIncRef(getContext().nCtx(), getNativeObject());
}
@Override
void addToReferenceQueue() {
getContext().getApplyResultDRQ().storeReference(getContext(), this);
}
}