3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-27 10:55:50 +00:00
z3/src/api/java/Probe.java
Christoph M. Wintersteiger 4bed5183f8 Made DRQ objects public in Java and .NET APIs.
Signed-off-by: Christoph M. Wintersteiger <cwinter@microsoft.com>
2015-01-30 21:58:43 -06:00

65 lines
1.5 KiB
Java

/**
Copyright (c) 2012-2014 Microsoft Corporation
Module Name:
Probe.java
Abstract:
Author:
@author Christoph Wintersteiger (cwinter) 2012-03-15
Notes:
**/
package com.microsoft.z3;
/**
* Probes are used to inspect a goal (aka problem) and collect information that
* may be used to decide which solver and/or preprocessing step will be used.
* The complete list of probes may be obtained using the procedures
* {@code Context.NumProbes} and {@code Context.ProbeNames}. It may
* also be obtained using the command {@code (help-tactics)} in the SMT 2.0
* front-end.
**/
public class Probe extends Z3Object
{
/**
* Execute the probe over the goal.
*
* @return A probe always produce a double value. "Boolean" probes return
* 0.0 for false, and a value different from 0.0 for true.
* @throws Z3Exception
**/
public double apply(Goal g) throws Z3Exception
{
getContext().checkContextMatch(g);
return Native.probeApply(getContext().nCtx(), getNativeObject(),
g.getNativeObject());
}
Probe(Context ctx, long obj) throws Z3Exception
{
super(ctx, obj);
}
Probe(Context ctx, String name) throws Z3Exception
{
super(ctx, Native.mkProbe(ctx.nCtx(), name));
}
void incRef(long o) throws Z3Exception
{
getContext().getProbeDRQ().incAndClear(getContext(), o);
super.incRef(o);
}
void decRef(long o) throws Z3Exception
{
getContext().getProbeDRQ().add(o);
super.decRef(o);
}
}