3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-27 02:45:51 +00:00

pull unstable

Signed-off-by: Nikolaj Bjorner <nbjorner@hotmail.com>
This commit is contained in:
Nikolaj Bjorner 2015-04-01 14:57:11 -07:00
commit 52619b9dbb
337 changed files with 24943 additions and 30606 deletions

View file

@ -28,7 +28,8 @@ public class AST extends Z3Object
/**
* Object comparison.
* <param name="o">another AST</param>
*
* @param o another AST
**/
public boolean equals(Object o)
{
@ -46,10 +47,12 @@ public class AST extends Z3Object
}
/**
* Object Comparison. <param name="other">Another AST</param>
* Object Comparison.
* @param other Another AST
*
* @return Negative if the object should be sorted before <paramref
* name="other"/>, positive if after else zero.
* @return Negative if the object should be sorted before {@code other},
* positive if after else zero.
* @throws Z3Exception on error
**/
public int compareTo(Object other) throws Z3Exception
{
@ -90,6 +93,7 @@ public class AST extends Z3Object
/**
* A unique identifier for the AST (unique among all ASTs).
* @throws Z3Exception on error
**/
public int getId() throws Z3Exception
{
@ -97,10 +101,11 @@ public class AST extends Z3Object
}
/**
* Translates (copies) the AST to the Context <paramref name="ctx"/>. <param
* name="ctx">A context</param>
* Translates (copies) the AST to the Context {@code ctx}.
* @param ctx A context
*
* @return A copy of the AST which is associated with <paramref name="ctx"/>
* @return A copy of the AST which is associated with {@code ctx}
* @throws Z3Exception on error
**/
public AST translate(Context ctx) throws Z3Exception
{
@ -114,6 +119,7 @@ public class AST extends Z3Object
/**
* The kind of the AST.
* @throws Z3Exception on error
**/
public Z3_ast_kind getASTKind() throws Z3Exception
{
@ -123,6 +129,8 @@ public class AST extends Z3Object
/**
* Indicates whether the AST is an Expr
* @throws Z3Exception on error
* @throws Z3Exception on error
**/
public boolean isExpr() throws Z3Exception
{
@ -140,6 +148,8 @@ public class AST extends Z3Object
/**
* Indicates whether the AST is an application
* @return a boolean
* @throws Z3Exception on error
**/
public boolean isApp() throws Z3Exception
{
@ -147,7 +157,9 @@ public class AST extends Z3Object
}
/**
* Indicates whether the AST is a BoundVariable
* Indicates whether the AST is a BoundVariable.
* @return a boolean
* @throws Z3Exception on error
**/
public boolean isVar() throws Z3Exception
{
@ -156,6 +168,8 @@ public class AST extends Z3Object
/**
* Indicates whether the AST is a Quantifier
* @return a boolean
* @throws Z3Exception on error
**/
public boolean isQuantifier() throws Z3Exception
{
@ -213,22 +227,18 @@ public class AST extends Z3Object
void incRef(long o) throws Z3Exception
{
// Console.WriteLine("AST IncRef()");
if (getContext() == null)
throw new Z3Exception("inc() called on null context");
if (o == 0)
throw new Z3Exception("inc() called on null AST");
getContext().ast_DRQ().incAndClear(getContext(), o);
if (getContext() == null || o == 0)
return;
getContext().getASTDRQ().incAndClear(getContext(), o);
super.incRef(o);
}
void decRef(long o) throws Z3Exception
{
// Console.WriteLine("AST DecRef()");
if (getContext() == null)
throw new Z3Exception("dec() called on null context");
if (o == 0)
throw new Z3Exception("dec() called on null AST");
getContext().ast_DRQ().add(o);
if (getContext() == null || o == 0)
return;
getContext().getASTDRQ().add(o);
super.decRef(o);
}

View file

@ -19,6 +19,16 @@ package com.microsoft.z3;
class ASTDecRefQueue extends IDecRefQueue
{
public ASTDecRefQueue()
{
super();
}
public ASTDecRefQueue(int move_limit)
{
super(move_limit);
}
protected void incRef(Context ctx, long obj)
{
try

View file

@ -23,10 +23,10 @@ package com.microsoft.z3;
class ASTMap extends Z3Object
{
/**
* Checks whether the map contains the key <paramref name="k"/>. <param
* name="k">An AST</param>
* Checks whether the map contains the key {@code k}.
* @param k An AST
*
* @return True if <paramref name="k"/> is a key in the map, false
* @return True if {@code k} is a key in the map, false
* otherwise.
**/
public boolean contains(AST k) throws Z3Exception
@ -37,9 +37,10 @@ class ASTMap extends Z3Object
}
/**
* Finds the value associated with the key <paramref name="k"/>. <remarks>
* This function signs an error when <paramref name="k"/> is not a key in
* the map. </remarks> <param name="k">An AST</param>
* Finds the value associated with the key {@code k}.
* Remarks: This function signs an error when {@code k} is not a key in
* the map.
* @param k An AST
*
* @throws Z3Exception
**/
@ -50,8 +51,9 @@ class ASTMap extends Z3Object
}
/**
* Stores or replaces a new key/value pair in the map. <param name="k">The
* key AST</param> <param name="v">The value AST</param>
* Stores or replaces a new key/value pair in the map.
* @param k The key AST
* @param v The value AST
**/
public void insert(AST k, AST v) throws Z3Exception
{
@ -61,12 +63,11 @@ class ASTMap extends Z3Object
}
/**
* Erases the key <paramref name="k"/> from the map. <param name="k">An
* AST</param>
* Erases the key {@code k} from the map.
* @param k An AST
**/
public void erase(AST k) throws Z3Exception
{
Native.astMapErase(getContext().nCtx(), getNativeObject(), k.getNativeObject());
}
@ -123,13 +124,13 @@ class ASTMap extends Z3Object
void incRef(long o) throws Z3Exception
{
getContext().astmap_DRQ().incAndClear(getContext(), o);
getContext().getASTMapDRQ().incAndClear(getContext(), o);
super.incRef(o);
}
void decRef(long o) throws Z3Exception
{
getContext().astmap_DRQ().add(o);
getContext().getASTMapDRQ().add(o);
super.decRef(o);
}
}

View file

@ -31,9 +31,10 @@ class ASTVector extends Z3Object
}
/**
* Retrieves the i-th object in the vector. <remarks>May throw an
* IndexOutOfBoundsException when <paramref name="i"/> is out of
* range.</remarks> <param name="i">Index</param>
* Retrieves the i-th object in the vector.
* Remarks: May throw an {@code IndexOutOfBoundsException} when
* {@code i} is out of range.
* @param i Index
*
* @return An AST
* @throws Z3Exception
@ -52,8 +53,8 @@ class ASTVector extends Z3Object
}
/**
* Resize the vector to <paramref name="newSize"/>. <param
* name="newSize">The new size of the vector.</param>
* Resize the vector to {@code newSize}.
* @param newSize The new size of the vector.
**/
public void resize(int newSize) throws Z3Exception
{
@ -61,8 +62,9 @@ class ASTVector extends Z3Object
}
/**
* Add the AST <paramref name="a"/> to the back of the vector. The size is
* increased by 1. <param name="a">An AST</param>
* Add the AST {@code a} to the back of the vector. The size is
* increased by 1.
* @param a An AST
**/
public void push(AST a) throws Z3Exception
{
@ -70,8 +72,8 @@ class ASTVector extends Z3Object
}
/**
* Translates all ASTs in the vector to <paramref name="ctx"/>. <param
* name="ctx">A context</param>
* Translates all ASTs in the vector to {@code ctx}.
* @param ctx A context
*
* @return A new ASTVector
* @throws Z3Exception
@ -108,13 +110,13 @@ class ASTVector extends Z3Object
void incRef(long o) throws Z3Exception
{
getContext().astvector_DRQ().incAndClear(getContext(), o);
getContext().getASTVectorDRQ().incAndClear(getContext(), o);
super.incRef(o);
}
void decRef(long o) throws Z3Exception
{
getContext().astvector_DRQ().add(o);
getContext().getASTVectorDRQ().add(o);
super.decRef(o);
}
}

View file

@ -24,11 +24,13 @@ public class AlgebraicNum extends ArithExpr
{
/**
* Return a upper bound for a given real algebraic number. The interval
* isolating the number is smaller than 1/10^<paramref name="precision"/>.
* <seealso cref="Expr.IsAlgebraicNumber"/> <param name="precision">the
* precision of the result</param>
* isolating the number is smaller than 1/10^{@code precision}.
*
* @see Expr#isAlgebraicNumber
* @param precision the precision of the result
*
* @return A numeral Expr of sort Real
* @throws Z3Exception on error
**/
public RatNum toUpper(int precision) throws Z3Exception
{
@ -39,10 +41,13 @@ public class AlgebraicNum extends ArithExpr
/**
* Return a lower bound for the given real algebraic number. The interval
* isolating the number is smaller than 1/10^<paramref name="precision"/>.
* <seealso cref="Expr.IsAlgebraicNumber"/> <param name="precision"></param>
* isolating the number is smaller than 1/10^{@code precision}.
*
* @see Expr#isAlgebraicNumber
* @param precision precision
*
* @return A numeral Expr of sort Real
* @throws Z3Exception on error
**/
public RatNum toLower(int precision) throws Z3Exception
{
@ -52,8 +57,11 @@ public class AlgebraicNum extends ArithExpr
}
/**
* Returns a string representation in decimal notation. <remarks>The result
* has at most <paramref name="precision"/> decimal places.</remarks>
* Returns a string representation in decimal notation.
* Remarks: The result has at most {@code precision} decimal places.
* @param precision precision
* @return String
* @throws Z3Exception on error
**/
public String toDecimal(int precision) throws Z3Exception
{

View file

@ -48,10 +48,10 @@ public class ApplyResult extends Z3Object
}
/**
* 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.
* Convert a model for the subgoal {@code i} into a model for the
* original goal {@code g}, that the ApplyResult was obtained from.
*
* @return A model for <code>g</code>
* @return A model for {@code g}
* @throws Z3Exception
**/
public Model convertModel(int i, Model m) throws Z3Exception
@ -81,13 +81,13 @@ public class ApplyResult extends Z3Object
void incRef(long o) throws Z3Exception
{
getContext().applyResult_DRQ().incAndClear(getContext(), o);
getContext().getApplyResultDRQ().incAndClear(getContext(), o);
super.incRef(o);
}
void decRef(long o) throws Z3Exception
{
getContext().applyResult_DRQ().add(o);
getContext().getApplyResultDRQ().add(o);
super.decRef(o);
}
}

View file

@ -19,6 +19,16 @@ package com.microsoft.z3;
class ApplyResultDecRefQueue extends IDecRefQueue
{
public ApplyResultDecRefQueue()
{
super();
}
public ApplyResultDecRefQueue(int move_limit)
{
super(move_limit);
}
protected void incRef(Context ctx, long obj)
{
try

View file

@ -22,16 +22,11 @@ package com.microsoft.z3;
**/
public class ArithExpr extends Expr
{
/**
* Constructor for ArithExpr </summary>
**/
protected ArithExpr(Context ctx)
{
super(ctx);
}
ArithExpr(Context ctx, long obj) throws Z3Exception
{
super(ctx, obj);
}
/**
* Constructor for ArithExpr
**/
ArithExpr(Context ctx, long obj) throws Z3Exception
{
super(ctx, obj);
}
}

View file

@ -22,8 +22,8 @@ package com.microsoft.z3;
**/
public class ArithSort extends Sort
{
ArithSort(Context ctx, long obj) throws Z3Exception
{
super(ctx, obj);
}
ArithSort(Context ctx, long obj) throws Z3Exception
{
super(ctx, obj);
}
};

View file

@ -23,16 +23,11 @@ package com.microsoft.z3;
**/
public class ArrayExpr extends Expr
{
/**
* Constructor for ArrayExpr </summary>
**/
protected ArrayExpr(Context ctx)
{
super(ctx);
}
ArrayExpr(Context ctx, long obj) throws Z3Exception
{
super(ctx, obj);
}
/**
* Constructor for ArrayExpr
**/
ArrayExpr(Context ctx, long obj) throws Z3Exception
{
super(ctx, obj);
}
}

View file

@ -22,34 +22,38 @@ package com.microsoft.z3;
**/
public class ArraySort extends Sort
{
/**
* The domain of the array sort.
* @throws Z3Exception
**/
public Sort getDomain() throws Z3Exception
{
return Sort.create(getContext(),
Native.getArraySortDomain(getContext().nCtx(), getNativeObject()));
}
/**
* The domain of the array sort.
* @throws Z3Exception
* @throws Z3Exception on error
* @return a sort
**/
public Sort getDomain() throws Z3Exception
{
return Sort.create(getContext(),
Native.getArraySortDomain(getContext().nCtx(), getNativeObject()));
}
/**
* The range of the array sort.
* @throws Z3Exception
**/
public Sort getRange() throws Z3Exception
{
return Sort.create(getContext(),
Native.getArraySortRange(getContext().nCtx(), getNativeObject()));
}
/**
* The range of the array sort.
* @throws Z3Exception
* @throws Z3Exception on error
* @return a sort
**/
public Sort getRange() throws Z3Exception
{
return Sort.create(getContext(),
Native.getArraySortRange(getContext().nCtx(), getNativeObject()));
}
ArraySort(Context ctx, long obj) throws Z3Exception
{
super(ctx, obj);
}
ArraySort(Context ctx, long obj) throws Z3Exception
{
super(ctx, obj);
}
ArraySort(Context ctx, Sort domain, Sort range) throws Z3Exception
{
super(ctx, Native.mkArraySort(ctx.nCtx(), domain.getNativeObject(),
range.getNativeObject()));
}
ArraySort(Context ctx, Sort domain, Sort range) throws Z3Exception
{
super(ctx, Native.mkArraySort(ctx.nCtx(), domain.getNativeObject(),
range.getNativeObject()));
}
};

View file

@ -19,6 +19,16 @@ package com.microsoft.z3;
class ASTMapDecRefQueue extends IDecRefQueue
{
public ASTMapDecRefQueue()
{
super();
}
public ASTMapDecRefQueue(int move_limit)
{
super(move_limit);
}
protected void incRef(Context ctx, long obj)
{
try

View file

@ -19,6 +19,16 @@ package com.microsoft.z3;
class ASTVectorDecRefQueue extends IDecRefQueue
{
public ASTVectorDecRefQueue()
{
super();
}
public ASTVectorDecRefQueue(int move_limit)
{
super(move_limit);
}
protected void incRef(Context ctx, long obj)
{
try

View file

@ -23,25 +23,22 @@ package com.microsoft.z3;
public class BitVecExpr extends Expr
{
/**
* The size of the sort of a bit-vector term.
* @throws Z3Exception
**/
public int getSortSize() throws Z3Exception
{
return ((BitVecSort) getSort()).getSize();
}
/**
* The size of the sort of a bit-vector term.
* @throws Z3Exception
* @throws Z3Exception on error
* @return an int
**/
public int getSortSize() throws Z3Exception
{
return ((BitVecSort) getSort()).getSize();
}
/**
* Constructor for BitVecExpr </summary>
**/
BitVecExpr(Context ctx)
{
super(ctx);
}
BitVecExpr(Context ctx, long obj) throws Z3Exception
{
super(ctx, obj);
}
/**
* Constructor for BitVecExpr
**/
BitVecExpr(Context ctx, long obj) throws Z3Exception
{
super(ctx, obj);
}
}

View file

@ -22,16 +22,18 @@ package com.microsoft.z3;
**/
public class BitVecSort extends Sort
{
/**
* The size of the bit-vector sort.
**/
public int getSize() throws Z3Exception
{
return Native.getBvSortSize(getContext().nCtx(), getNativeObject());
}
/**
* The size of the bit-vector sort.
* @throws Z3Exception on error
* @return an int
**/
public int getSize() throws Z3Exception
{
return Native.getBvSortSize(getContext().nCtx(), getNativeObject());
}
BitVecSort(Context ctx, long obj) throws Z3Exception
{
super(ctx, obj);
}
BitVecSort(Context ctx, long obj) throws Z3Exception
{
super(ctx, obj);
}
};

View file

@ -22,20 +22,21 @@ package com.microsoft.z3;
**/
public class BoolExpr extends Expr
{
/**
* Constructor for BoolExpr </summary>
**/
protected BoolExpr(Context ctx)
{
super(ctx);
}
/**
* Constructor for BoolExpr
**/
protected BoolExpr(Context ctx)
{
super(ctx);
}
/**
* Constructor for BoolExpr </summary>
* @throws Z3Exception
**/
BoolExpr(Context ctx, long obj) throws Z3Exception
{
super(ctx, obj);
}
/**
* Constructor for BoolExpr
* @throws Z3Exception
* @throws Z3Exception on error
**/
BoolExpr(Context ctx, long obj) throws Z3Exception
{
super(ctx, obj);
}
}

View file

@ -22,48 +22,53 @@ package com.microsoft.z3;
**/
public class Constructor extends Z3Object
{
/**
* The number of fields of the constructor.
* @throws Z3Exception
**/
public int getNumFields() throws Z3Exception
{
return n;
}
/**
* The number of fields of the constructor.
* @throws Z3Exception
* @throws Z3Exception on error
* @return an int
**/
public int getNumFields() throws Z3Exception
{
return n;
}
/**
* The function declaration of the constructor.
* @throws Z3Exception
**/
public FuncDecl ConstructorDecl() throws Z3Exception
{
Native.LongPtr constructor = new Native.LongPtr();
Native.LongPtr tester = new Native.LongPtr();
long[] accessors = new long[n];
/**
* The function declaration of the constructor.
* @throws Z3Exception
* @throws Z3Exception on error
**/
public FuncDecl ConstructorDecl() throws Z3Exception
{
Native.LongPtr constructor = new Native.LongPtr();
Native.LongPtr tester = new Native.LongPtr();
long[] accessors = new long[n];
Native.queryConstructor(getContext().nCtx(), getNativeObject(), n, constructor, tester, accessors);
return new FuncDecl(getContext(), constructor.value);
}
}
/**
* The function declaration of the tester.
* @throws Z3Exception
**/
public FuncDecl getTesterDecl() throws Z3Exception
{
Native.LongPtr constructor = new Native.LongPtr();
/**
* The function declaration of the tester.
* @throws Z3Exception
* @throws Z3Exception on error
**/
public FuncDecl getTesterDecl() throws Z3Exception
{
Native.LongPtr constructor = new Native.LongPtr();
Native.LongPtr tester = new Native.LongPtr();
long[] accessors = new long[n];
Native.queryConstructor(getContext().nCtx(), getNativeObject(), n, constructor, tester, accessors);
return new FuncDecl(getContext(), tester.value);
}
}
/**
* The function declarations of the accessors
* @throws Z3Exception
**/
public FuncDecl[] getAccessorDecls() throws Z3Exception
{
Native.LongPtr constructor = new Native.LongPtr();
/**
* The function declarations of the accessors
* @throws Z3Exception
* @throws Z3Exception on error
**/
public FuncDecl[] getAccessorDecls() throws Z3Exception
{
Native.LongPtr constructor = new Native.LongPtr();
Native.LongPtr tester = new Native.LongPtr();
long[] accessors = new long[n];
Native.queryConstructor(getContext().nCtx(), getNativeObject(), n, constructor, tester, accessors);
@ -71,39 +76,40 @@ public class Constructor extends Z3Object
for (int i = 0; i < n; i++)
t[i] = new FuncDecl(getContext(), accessors[i]);
return t;
}
}
/**
* Destructor.
**/
protected void finalize() throws Z3Exception
{
Native.delConstructor(getContext().nCtx(), getNativeObject());
}
/**
* Destructor.
* @throws Z3Exception on error
**/
protected void finalize() throws Z3Exception
{
Native.delConstructor(getContext().nCtx(), getNativeObject());
}
private int n = 0;
private int n = 0;
Constructor(Context ctx, Symbol name, Symbol recognizer,
Symbol[] fieldNames, Sort[] sorts, int[] sortRefs)
throws Z3Exception
{
super(ctx);
Constructor(Context ctx, Symbol name, Symbol recognizer,
Symbol[] fieldNames, Sort[] sorts, int[] sortRefs)
throws Z3Exception
{
super(ctx);
n = AST.arrayLength(fieldNames);
n = AST.arrayLength(fieldNames);
if (n != AST.arrayLength(sorts))
throw new Z3Exception(
"Number of field names does not match number of sorts");
if (sortRefs != null && sortRefs.length != n)
throw new Z3Exception(
"Number of field names does not match number of sort refs");
if (n != AST.arrayLength(sorts))
throw new Z3Exception(
"Number of field names does not match number of sorts");
if (sortRefs != null && sortRefs.length != n)
throw new Z3Exception(
"Number of field names does not match number of sort refs");
if (sortRefs == null)
sortRefs = new int[n];
if (sortRefs == null)
sortRefs = new int[n];
setNativeObject(Native.mkConstructor(ctx.nCtx(), name.getNativeObject(),
recognizer.getNativeObject(), n, Symbol.arrayToNative(fieldNames),
Sort.arrayToNative(sorts), sortRefs));
setNativeObject(Native.mkConstructor(ctx.nCtx(), name.getNativeObject(),
recognizer.getNativeObject(), n, Symbol.arrayToNative(fieldNames),
Sort.arrayToNative(sorts), sortRefs));
}
}
}

View file

@ -22,25 +22,26 @@ package com.microsoft.z3;
**/
public class ConstructorList extends Z3Object
{
/**
* Destructor.
**/
protected void finalize() throws Z3Exception
{
Native.delConstructorList(getContext().nCtx(), getNativeObject());
}
/**
* Destructor.
* @throws Z3Exception on error
**/
protected void finalize() throws Z3Exception
{
Native.delConstructorList(getContext().nCtx(), getNativeObject());
}
ConstructorList(Context ctx, long obj) throws Z3Exception
{
super(ctx, obj);
}
ConstructorList(Context ctx, long obj) throws Z3Exception
{
super(ctx, obj);
}
ConstructorList(Context ctx, Constructor[] constructors) throws Z3Exception
{
super(ctx);
ConstructorList(Context ctx, Constructor[] constructors) throws Z3Exception
{
super(ctx);
setNativeObject(Native.mkConstructorList(getContext().nCtx(),
(int) constructors.length,
Constructor.arrayToNative(constructors)));
}
setNativeObject(Native.mkConstructorList(getContext().nCtx(),
(int) constructors.length,
Constructor.arrayToNative(constructors)));
}
}

File diff suppressed because it is too large Load diff

View file

@ -22,16 +22,11 @@ package com.microsoft.z3;
**/
public class DatatypeExpr extends Expr
{
/**
* Constructor for DatatypeExpr </summary>
**/
protected DatatypeExpr(Context ctx)
{
super(ctx);
}
DatatypeExpr(Context ctx, long obj) throws Z3Exception
{
super(ctx, obj);
}
/**
* Constructor for DatatypeExpr
**/
DatatypeExpr(Context ctx, long obj) throws Z3Exception
{
super(ctx, obj);
}
}

View file

@ -22,81 +22,86 @@ package com.microsoft.z3;
**/
public class DatatypeSort extends Sort
{
/**
* The number of constructors of the datatype sort.
**/
public int getNumConstructors() throws Z3Exception
{
return Native.getDatatypeSortNumConstructors(getContext().nCtx(),
getNativeObject());
}
/**
* The number of constructors of the datatype sort.
* @throws Z3Exception on error
* @return an int
**/
public int getNumConstructors() throws Z3Exception
{
return Native.getDatatypeSortNumConstructors(getContext().nCtx(),
getNativeObject());
}
/**
* The constructors.
*
* @throws Z3Exception
**/
public FuncDecl[] getConstructors() throws Z3Exception
{
int n = getNumConstructors();
FuncDecl[] res = new FuncDecl[n];
for (int i = 0; i < n; i++)
res[i] = new FuncDecl(getContext(), Native.getDatatypeSortConstructor(
getContext().nCtx(), getNativeObject(), i));
return res;
}
/**
* The constructors.
*
* @throws Z3Exception
* @throws Z3Exception on error
**/
public FuncDecl[] getConstructors() throws Z3Exception
{
int n = getNumConstructors();
FuncDecl[] res = new FuncDecl[n];
for (int i = 0; i < n; i++)
res[i] = new FuncDecl(getContext(), Native.getDatatypeSortConstructor(
getContext().nCtx(), getNativeObject(), i));
return res;
}
/**
* The recognizers.
*
* @throws Z3Exception
**/
public FuncDecl[] getRecognizers() throws Z3Exception
{
int n = getNumConstructors();
FuncDecl[] res = new FuncDecl[n];
for (int i = 0; i < n; i++)
res[i] = new FuncDecl(getContext(), Native.getDatatypeSortRecognizer(
getContext().nCtx(), getNativeObject(), i));
return res;
}
/**
* The recognizers.
*
* @throws Z3Exception
* @throws Z3Exception on error
**/
public FuncDecl[] getRecognizers() throws Z3Exception
{
int n = getNumConstructors();
FuncDecl[] res = new FuncDecl[n];
for (int i = 0; i < n; i++)
res[i] = new FuncDecl(getContext(), Native.getDatatypeSortRecognizer(
getContext().nCtx(), getNativeObject(), i));
return res;
}
/**
* The constructor accessors.
*
* @throws Z3Exception
**/
public FuncDecl[][] getAccessors() throws Z3Exception
{
/**
* The constructor accessors.
*
* @throws Z3Exception
* @throws Z3Exception on error
**/
public FuncDecl[][] getAccessors() throws Z3Exception
{
int n = getNumConstructors();
FuncDecl[][] res = new FuncDecl[n][];
for (int i = 0; i < n; i++)
{
FuncDecl fd = new FuncDecl(getContext(),
Native.getDatatypeSortConstructor(getContext().nCtx(),
getNativeObject(), i));
int ds = fd.getDomainSize();
FuncDecl[] tmp = new FuncDecl[ds];
for (int j = 0; j < ds; j++)
tmp[j] = new FuncDecl(getContext(),
Native.getDatatypeSortConstructorAccessor(getContext()
.nCtx(), getNativeObject(), i, j));
res[i] = tmp;
}
return res;
}
int n = getNumConstructors();
FuncDecl[][] res = new FuncDecl[n][];
for (int i = 0; i < n; i++)
{
FuncDecl fd = new FuncDecl(getContext(),
Native.getDatatypeSortConstructor(getContext().nCtx(),
getNativeObject(), i));
int ds = fd.getDomainSize();
FuncDecl[] tmp = new FuncDecl[ds];
for (int j = 0; j < ds; j++)
tmp[j] = new FuncDecl(getContext(),
Native.getDatatypeSortConstructorAccessor(getContext()
.nCtx(), getNativeObject(), i, j));
res[i] = tmp;
}
return res;
}
DatatypeSort(Context ctx, long obj) throws Z3Exception
{
super(ctx, obj);
}
DatatypeSort(Context ctx, long obj) throws Z3Exception
{
super(ctx, obj);
}
DatatypeSort(Context ctx, Symbol name, Constructor[] constructors)
throws Z3Exception
{
super(ctx, Native.mkDatatype(ctx.nCtx(), name.getNativeObject(),
(int) constructors.length, arrayToNative(constructors)));
DatatypeSort(Context ctx, Symbol name, Constructor[] constructors)
throws Z3Exception
{
super(ctx, Native.mkDatatype(ctx.nCtx(), name.getNativeObject(),
(int) constructors.length, arrayToNative(constructors)));
}
}
};

View file

@ -22,51 +22,83 @@ package com.microsoft.z3;
**/
public class EnumSort extends Sort
{
/**
* The function declarations of the constants in the enumeration.
**/
public FuncDecl[] getConstDecls() throws Z3Exception
{
int n = Native.getDatatypeSortNumConstructors(getContext().nCtx(), getNativeObject());
/**
* The function declarations of the constants in the enumeration.
* @throws Z3Exception on error
**/
public FuncDecl[] getConstDecls() throws Z3Exception
{
int n = Native.getDatatypeSortNumConstructors(getContext().nCtx(), getNativeObject());
FuncDecl[] t = new FuncDecl[n];
for (int i = 0; i < n; i++)
t[i] = new FuncDecl(getContext(), Native.getDatatypeSortConstructor(getContext().nCtx(), getNativeObject(), i));
return t;
}
}
/**
* Retrieves the inx'th constant declaration in the enumeration.
* @throws Z3Exception on error
**/
public FuncDecl getConstDecl(int inx) throws Z3Exception
{
return new FuncDecl(getContext(), Native.getDatatypeSortConstructor(getContext().nCtx(), getNativeObject(), inx));
}
/**
* The constants in the enumeration.
**/
public Expr[] getConsts() throws Z3Exception
{
FuncDecl[] cds = getConstDecls();
/**
* The constants in the enumeration.
* @throws Z3Exception on error
* @return an Expr[]
**/
public Expr[] getConsts() throws Z3Exception
{
FuncDecl[] cds = getConstDecls();
Expr[] t = new Expr[cds.length];
for (int i = 0; i < t.length; i++)
t[i] = getContext().mkApp(cds[i]);
return t;
}
}
/**
* Retrieves the inx'th constant in the enumeration.
* @throws Z3Exception on error
* @return an Expr
**/
public Expr getConst(int inx) throws Z3Exception
{
return getContext().mkApp(getConstDecl(inx));
}
/**
* The test predicates for the constants in the enumeration.
**/
public FuncDecl[] getTesterDecls() throws Z3Exception
{
int n = Native.getDatatypeSortNumConstructors(getContext().nCtx(), getNativeObject());
/**
* The test predicates for the constants in the enumeration.
* @throws Z3Exception on error
**/
public FuncDecl[] getTesterDecls() throws Z3Exception
{
int n = Native.getDatatypeSortNumConstructors(getContext().nCtx(), getNativeObject());
FuncDecl[] t = new FuncDecl[n];
for (int i = 0; i < n; i++)
t[i] = new FuncDecl(getContext(), Native.getDatatypeSortRecognizer(getContext().nCtx(), getNativeObject(), i));
return t;
}
}
/**
* Retrieves the inx'th tester/recognizer declaration in the enumeration.
* @throws Z3Exception on error
**/
public FuncDecl getTesterDecl(int inx) throws Z3Exception
{
return new FuncDecl(getContext(), Native.getDatatypeSortRecognizer(getContext().nCtx(), getNativeObject(), inx));
}
EnumSort(Context ctx, Symbol name, Symbol[] enumNames) throws Z3Exception
{
super(ctx);
EnumSort(Context ctx, Symbol name, Symbol[] enumNames) throws Z3Exception
{
super(ctx, 0);
int n = enumNames.length;
long[] n_constdecls = new long[n];
long[] n_testers = new long[n];
setNativeObject(Native.mkEnumerationSort(ctx.nCtx(),
name.getNativeObject(), (int) n, Symbol.arrayToNative(enumNames),
n_constdecls, n_testers));
}
int n = enumNames.length;
long[] n_constdecls = new long[n];
long[] n_testers = new long[n];
setNativeObject(Native.mkEnumerationSort(ctx.nCtx(),
name.getNativeObject(), (int) n, Symbol.arrayToNative(enumNames),
n_constdecls, n_testers));
}
};

File diff suppressed because it is too large Load diff

41
src/api/java/FPExpr.java Normal file
View file

@ -0,0 +1,41 @@
/*++
Copyright (c) 2013 Microsoft Corporation
Module Name:
FPExpr.java
Abstract:
Author:
Christoph Wintersteiger (cwinter) 2013-06-10
Notes:
--*/
package com.microsoft.z3;
/**
* FloatingPoint Expressions
*/
public class FPExpr extends Expr
{
/**
* The number of exponent bits.
* @throws Z3Exception
*/
public int getEBits() throws Z3Exception { return ((FPSort)getSort()).getEBits(); }
/**
* The number of significand bits.
* @throws Z3Exception
*/
public int getSBits() throws Z3Exception { return ((FPSort)getSort()).getSBits(); }
public FPExpr(Context ctx, long obj) throws Z3Exception
{
super(ctx, obj);
}
}

84
src/api/java/FPNum.java Normal file
View file

@ -0,0 +1,84 @@
/*++
Copyright (c) 2013 Microsoft Corporation
Module Name:
FPNum.java
Abstract:
Author:
Christoph Wintersteiger (cwinter) 2013-06-10
Notes:
--*/
package com.microsoft.z3;
/**
* FloatingPoint Numerals
*/
public class FPNum extends FPExpr
{
/**
* Retrieves the sign of a floating-point literal
* Remarks: returns true if the numeral is negative
* @throws Z3Exception
*/
public boolean getSign() throws Z3Exception {
Native.IntPtr res = new Native.IntPtr();
if (Native.fpaGetNumeralSign(getContext().nCtx(), getNativeObject(), res) ^ true)
throw new Z3Exception("Sign is not a Boolean value");
return res.value != 0;
}
/**
* The significand value of a floating-point numeral as a string
* Remarks: The significand s is always 0 &lt; s &lt; 2.0; the resulting string is long
* enough to represent the real significand precisely.
* @throws Z3Exception
**/
public String getSignificand() throws Z3Exception {
return Native.fpaGetNumeralSignificandString(getContext().nCtx(), getNativeObject());
}
/**
* Return the exponent value of a floating-point numeral as a string
* @throws Z3Exception
*/
public String getExponent() throws Z3Exception {
return Native.fpaGetNumeralExponentString(getContext().nCtx(), getNativeObject());
}
/**
* Return the exponent value of a floating-point numeral as a signed 64-bit integer
* @throws Z3Exception
*/
public long getExponentInt64() throws Z3Exception {
Native.LongPtr res = new Native.LongPtr();
if (Native.fpaGetNumeralExponentInt64(getContext().nCtx(), getNativeObject(), res) ^ true)
throw new Z3Exception("Exponent is not a 64 bit integer");
return res.value;
}
public FPNum(Context ctx, long obj) throws Z3Exception
{
super(ctx, obj);
}
/**
* Returns a string representation of the numeral.
*/
public String toString()
{
try
{
return Native.getNumeralString(getContext().nCtx(), getNativeObject());
} catch (Z3Exception e)
{
return "Z3Exception: " + e.getMessage();
}
}
}

View file

@ -0,0 +1,29 @@
/*++
Copyright (c) 2013 Microsoft Corporation
Module Name:
FPRMExpr.java
Abstract:
Author:
Christoph Wintersteiger (cwinter) 2013-06-10
Notes:
--*/
package com.microsoft.z3;
/**
* FloatingPoint RoundingMode Expressions
*/
public class FPRMExpr extends Expr
{
public FPRMExpr(Context ctx, long obj) throws Z3Exception
{
super(ctx, obj);
}
}

90
src/api/java/FPRMNum.java Normal file
View file

@ -0,0 +1,90 @@
/*++
Copyright (c) 2013 Microsoft Corporation
Module Name:
FPRMNum.java
Abstract:
Author:
Christoph Wintersteiger (cwinter) 2013-06-10
Notes:
--*/
package com.microsoft.z3;
import com.microsoft.z3.enumerations.Z3_decl_kind;
/**
* FloatingPoint RoundingMode Numerals
*/
public class FPRMNum extends FPRMExpr {
/**
* Indicates whether the term is the floating-point rounding numeral roundNearestTiesToEven
* @throws Z3Exception
* **/
public boolean isRoundNearestTiesToEven() throws Z3Exception { return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_FPA_RM_NEAREST_TIES_TO_EVEN; }
/**
* Indicates whether the term is the floating-point rounding numeral roundNearestTiesToEven
* @throws Z3Exception
*/
public boolean isRNE() throws Z3Exception { return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_FPA_RM_NEAREST_TIES_TO_EVEN; }
/**
* Indicates whether the term is the floating-point rounding numeral roundNearestTiesToAway
* @throws Z3Exception
*/
public boolean isRoundNearestTiesToAway() throws Z3Exception { return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_FPA_RM_NEAREST_TIES_TO_AWAY; }
/**
* Indicates whether the term is the floating-point rounding numeral roundNearestTiesToAway
* @throws Z3Exception
*/
public boolean isRNA() throws Z3Exception { return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_FPA_RM_NEAREST_TIES_TO_AWAY; }
/**
* Indicates whether the term is the floating-point rounding numeral roundTowardPositive
* @throws Z3Exception
*/
public boolean isRoundTowardPositive() throws Z3Exception { return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_FPA_RM_TOWARD_POSITIVE; }
/**
* Indicates whether the term is the floating-point rounding numeral roundTowardPositive
* @throws Z3Exception
*/
public boolean isRTP() throws Z3Exception { return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_FPA_RM_TOWARD_POSITIVE; }
/**
* Indicates whether the term is the floating-point rounding numeral roundTowardNegative
* @throws Z3Exception
*/
public boolean isRoundTowardNegative() throws Z3Exception { return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_FPA_RM_TOWARD_NEGATIVE; }
/**
* Indicates whether the term is the floating-point rounding numeral roundTowardNegative
* @throws Z3Exception
*/
public boolean isRTN() throws Z3Exception { return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_FPA_RM_TOWARD_NEGATIVE; }
/**
* Indicates whether the term is the floating-point rounding numeral roundTowardZero
* @throws Z3Exception
*/
public boolean isRoundTowardZero() throws Z3Exception { return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_FPA_RM_TOWARD_ZERO; }
/**
* Indicates whether the term is the floating-point rounding numeral roundTowardZero
* @throws Z3Exception
*/
public boolean isRTZ() throws Z3Exception { return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_FPA_RM_TOWARD_ZERO; }
public FPRMNum(Context ctx, long obj) throws Z3Exception {
super(ctx, obj);
}
}

View file

@ -0,0 +1,35 @@
/*++
Copyright (c) 2013 Microsoft Corporation
Module Name:
FPRMExpr.java
Abstract:
Author:
Christoph Wintersteiger (cwinter) 2013-06-10
Notes:
--*/
package com.microsoft.z3;
/**
* The FloatingPoint RoundingMode sort
**/
public class FPRMSort extends Sort
{
public FPRMSort(Context ctx) throws Z3Exception
{
super(ctx, Native.mkFpaRoundingModeSort(ctx.nCtx()));
}
public FPRMSort(Context ctx, long obj) throws Z3Exception
{
super(ctx, obj);
}
}

49
src/api/java/FPSort.java Normal file
View file

@ -0,0 +1,49 @@
/*++
Copyright (c) 2013 Microsoft Corporation
Module Name:
FPSort.java
Abstract:
Author:
Christoph Wintersteiger (cwinter) 2013-06-10
Notes:
--*/
package com.microsoft.z3;
/**
* A FloatingPoint sort
**/
public class FPSort extends Sort
{
public FPSort(Context ctx, long obj) throws Z3Exception
{
super(ctx, obj);
}
public FPSort(Context ctx, int ebits, int sbits) throws Z3Exception
{
super(ctx, Native.mkFpaSort(ctx.nCtx(), ebits, sbits));
}
/**
* The number of exponent bits.
*/
public int getEBits() throws Z3Exception {
return Native.fpaGetEbits(getContext().nCtx(), getNativeObject());
}
/**
* The number of significand bits.
*/
public int getSBits() throws Z3Exception {
return Native.fpaGetEbits(getContext().nCtx(), getNativeObject());
}
}

View file

@ -22,24 +22,25 @@ package com.microsoft.z3;
**/
public class FiniteDomainSort extends Sort
{
/**
* The size of the finite domain sort.
**/
public long getSize() throws Z3Exception
{
Native.LongPtr res = new Native.LongPtr();
Native.getFiniteDomainSortSize(getContext().nCtx(), getNativeObject(), res);
return res.value;
}
/**
* The size of the finite domain sort.
* @throws Z3Exception on error
**/
public long getSize() throws Z3Exception
{
Native.LongPtr res = new Native.LongPtr();
Native.getFiniteDomainSortSize(getContext().nCtx(), getNativeObject(), res);
return res.value;
}
FiniteDomainSort(Context ctx, long obj) throws Z3Exception
{
super(ctx, obj);
}
FiniteDomainSort(Context ctx, long obj) throws Z3Exception
{
super(ctx, obj);
}
FiniteDomainSort(Context ctx, Symbol name, long size) throws Z3Exception
{
super(ctx, Native.mkFiniteDomainSort(ctx.nCtx(), name.getNativeObject(),
size));
}
FiniteDomainSort(Context ctx, Symbol name, long size) throws Z3Exception
{
super(ctx, Native.mkFiniteDomainSort(ctx.nCtx(), name.getNativeObject(),
size));
}
}

View file

@ -163,7 +163,8 @@ public class Fixedpoint extends Z3Object
}
/**
* Creates a backtracking point. <seealso cref="Pop"/>
* Creates a backtracking point.
* @see pop
**/
public void push() throws Z3Exception
{
@ -171,9 +172,11 @@ public class Fixedpoint extends Z3Object
}
/**
* Backtrack one backtracking point. <remarks>Note that an exception is
* thrown if Pop is called without a corresponding <code>Push</code>
* </remarks> <seealso cref="Push"/>
* Backtrack one backtracking point.
* Remarks: Note that an exception is thrown if {@code pop}
* is called without a corresponding {@code push}
*
* @see push
**/
public void pop() throws Z3Exception
{
@ -343,13 +346,13 @@ public class Fixedpoint extends Z3Object
void incRef(long o) throws Z3Exception
{
getContext().fixedpoint_DRQ().incAndClear(getContext(), o);
getContext().getFixedpointDRQ().incAndClear(getContext(), o);
super.incRef(o);
}
void decRef(long o) throws Z3Exception
{
getContext().fixedpoint_DRQ().add(o);
getContext().getFixedpointDRQ().add(o);
super.decRef(o);
}
}

View file

@ -19,6 +19,16 @@ package com.microsoft.z3;
class FixedpointDecRefQueue extends IDecRefQueue
{
public FixedpointDecRefQueue()
{
super();
}
public FixedpointDecRefQueue(int move_limit)
{
super(move_limit);
}
protected void incRef(Context ctx, long obj)
{
try

View file

@ -29,7 +29,7 @@ public class FuncDecl extends AST
/**
* Comparison operator.
*
* @return True if <paramref name="a"/> and <paramref name="b"/> share the
* @return True if {@code a"/> and <paramref name="b} share the
* same context and are equal, false otherwise.
**/
/* Overloaded operators are not translated. */
@ -37,7 +37,7 @@ public class FuncDecl extends AST
/**
* Comparison operator.
*
* @return True if <paramref name="a"/> and <paramref name="b"/> do not
* @return True if {@code a"/> and <paramref name="b} do not
* share the same context or are not equal, false otherwise.
**/
/* Overloaded operators are not translated. */
@ -92,8 +92,8 @@ public class FuncDecl extends AST
}
/**
* The size of the domain of the function declaration <seealso
* cref="Arity"/>
* The size of the domain of the function declaration
* @see getArity
**/
public int getDomainSize() throws Z3Exception
{
@ -221,7 +221,7 @@ public class FuncDecl extends AST
private String r;
/**
* The int value of the parameter.</summary>
* The int value of the parameter.
**/
public int getInt() throws Z3Exception
{
@ -231,7 +231,7 @@ public class FuncDecl extends AST
}
/**
* The double value of the parameter.</summary>
* The double value of the parameter.
**/
public double getDouble() throws Z3Exception
{
@ -241,7 +241,7 @@ public class FuncDecl extends AST
}
/**
* The Symbol value of the parameter.</summary>
* The Symbol value of the parameter.
**/
public Symbol getSymbol() throws Z3Exception
{
@ -251,7 +251,7 @@ public class FuncDecl extends AST
}
/**
* The Sort value of the parameter.</summary>
* The Sort value of the parameter.
**/
public Sort getSort() throws Z3Exception
{
@ -261,7 +261,7 @@ public class FuncDecl extends AST
}
/**
* The AST value of the parameter.</summary>
* The AST value of the parameter.
**/
public AST getAST() throws Z3Exception
{
@ -271,7 +271,7 @@ public class FuncDecl extends AST
}
/**
* The FunctionDeclaration value of the parameter.</summary>
* The FunctionDeclaration value of the parameter.
**/
public FuncDecl getFuncDecl() throws Z3Exception
{
@ -281,7 +281,7 @@ public class FuncDecl extends AST
}
/**
* The rational string value of the parameter.</summary>
* The rational string value of the parameter.
**/
public String getRational() throws Z3Exception
{
@ -375,8 +375,8 @@ public class FuncDecl extends AST
}
/**
* Create expression that applies function to arguments. <param
* name="args"></param>
* Create expression that applies function to arguments.
* @param args
*
* @return
**/

View file

@ -24,173 +24,183 @@ package com.microsoft.z3;
**/
public class FuncInterp extends Z3Object
{
/**
* An Entry object represents an element in the finite map used to encode a
* function interpretation.
**/
public class Entry extends Z3Object
{
/**
* Return the (symbolic) value of this entry.
*
* @throws Z3Exception
**/
public Expr getValue() throws Z3Exception
{
return Expr.create(getContext(),
Native.funcEntryGetValue(getContext().nCtx(), getNativeObject()));
}
/**
* An Entry object represents an element in the finite map used to encode a
* function interpretation.
**/
public class Entry extends Z3Object
{
/**
* Return the (symbolic) value of this entry.
*
* @throws Z3Exception
* @throws Z3Exception on error
**/
public Expr getValue() throws Z3Exception
{
return Expr.create(getContext(),
Native.funcEntryGetValue(getContext().nCtx(), getNativeObject()));
}
/**
* The number of arguments of the entry.
**/
public int getNumArgs() throws Z3Exception
{
return Native.funcEntryGetNumArgs(getContext().nCtx(), getNativeObject());
}
/**
* The number of arguments of the entry.
* @throws Z3Exception on error
**/
public int getNumArgs() throws Z3Exception
{
return Native.funcEntryGetNumArgs(getContext().nCtx(), getNativeObject());
}
/**
* The arguments of the function entry.
*
* @throws Z3Exception
**/
public Expr[] getArgs() throws Z3Exception
{
int n = getNumArgs();
Expr[] res = new Expr[n];
for (int i = 0; i < n; i++)
res[i] = Expr.create(getContext(), Native.funcEntryGetArg(
getContext().nCtx(), getNativeObject(), i));
return res;
}
/**
* The arguments of the function entry.
*
* @throws Z3Exception
* @throws Z3Exception on error
**/
public Expr[] getArgs() throws Z3Exception
{
int n = getNumArgs();
Expr[] res = new Expr[n];
for (int i = 0; i < n; i++)
res[i] = Expr.create(getContext(), Native.funcEntryGetArg(
getContext().nCtx(), getNativeObject(), i));
return res;
}
/**
* A string representation of the function entry.
**/
public String toString()
{
try
{
int n = getNumArgs();
String res = "[";
Expr[] args = getArgs();
for (int i = 0; i < n; i++)
res += args[i] + ", ";
return res + getValue() + "]";
} catch (Z3Exception e)
{
return new String("Z3Exception: " + e.getMessage());
}
}
/**
* A string representation of the function entry.
**/
public String toString()
{
try
{
int n = getNumArgs();
String res = "[";
Expr[] args = getArgs();
for (int i = 0; i < n; i++)
res += args[i] + ", ";
return res + getValue() + "]";
} catch (Z3Exception e)
{
return new String("Z3Exception: " + e.getMessage());
}
}
Entry(Context ctx, long obj) throws Z3Exception
{
super(ctx, obj);
}
Entry(Context ctx, long obj) throws Z3Exception
{
super(ctx, obj);
}
void incRef(long o) throws Z3Exception
{
getContext().funcEntry_DRQ().incAndClear(getContext(), o);
super.incRef(o);
}
void incRef(long o) throws Z3Exception
{
getContext().getFuncEntryDRQ().incAndClear(getContext(), o);
super.incRef(o);
}
void decRef(long o) throws Z3Exception
{
getContext().funcEntry_DRQ().add(o);
super.decRef(o);
}
};
void decRef(long o) throws Z3Exception
{
getContext().getFuncEntryDRQ().add(o);
super.decRef(o);
}
};
/**
* The number of entries in the function interpretation.
**/
public int getNumEntries() throws Z3Exception
{
return Native.funcInterpGetNumEntries(getContext().nCtx(), getNativeObject());
}
/**
* The number of entries in the function interpretation.
* @throws Z3Exception on error
* @return an int
**/
public int getNumEntries() throws Z3Exception
{
return Native.funcInterpGetNumEntries(getContext().nCtx(), getNativeObject());
}
/**
* The entries in the function interpretation
*
* @throws Z3Exception
**/
public Entry[] getEntries() throws Z3Exception
{
int n = getNumEntries();
Entry[] res = new Entry[n];
for (int i = 0; i < n; i++)
res[i] = new Entry(getContext(), Native.funcInterpGetEntry(getContext()
.nCtx(), getNativeObject(), i));
return res;
}
/**
* The entries in the function interpretation
*
* @throws Z3Exception
* @throws Z3Exception on error
**/
public Entry[] getEntries() throws Z3Exception
{
int n = getNumEntries();
Entry[] res = new Entry[n];
for (int i = 0; i < n; i++)
res[i] = new Entry(getContext(), Native.funcInterpGetEntry(getContext()
.nCtx(), getNativeObject(), i));
return res;
}
/**
* The (symbolic) `else' value of the function interpretation.
*
* @throws Z3Exception
**/
public Expr getElse() throws Z3Exception
{
return Expr.create(getContext(),
Native.funcInterpGetElse(getContext().nCtx(), getNativeObject()));
}
/**
* The (symbolic) `else' value of the function interpretation.
*
* @throws Z3Exception
* @throws Z3Exception on error
* @return an Expr
**/
public Expr getElse() throws Z3Exception
{
return Expr.create(getContext(),
Native.funcInterpGetElse(getContext().nCtx(), getNativeObject()));
}
/**
* The arity of the function interpretation
**/
public int getArity() throws Z3Exception
{
return Native.funcInterpGetArity(getContext().nCtx(), getNativeObject());
}
/**
* The arity of the function interpretation
* @throws Z3Exception on error
* @return an int
**/
public int getArity() throws Z3Exception
{
return Native.funcInterpGetArity(getContext().nCtx(), getNativeObject());
}
/**
* A string representation of the function interpretation.
**/
public String toString()
{
try
{
String res = "";
res += "[";
for (Entry e : getEntries())
{
int n = e.getNumArgs();
if (n > 1)
res += "[";
Expr[] args = e.getArgs();
for (int i = 0; i < n; i++)
{
if (i != 0)
res += ", ";
res += args[i];
}
if (n > 1)
res += "]";
res += " -> " + e.getValue() + ", ";
}
res += "else -> " + getElse();
res += "]";
return res;
} catch (Z3Exception e)
{
return new String("Z3Exception: " + e.getMessage());
}
}
/**
* A string representation of the function interpretation.
**/
public String toString()
{
try
{
String res = "";
res += "[";
for (Entry e : getEntries())
{
int n = e.getNumArgs();
if (n > 1)
res += "[";
Expr[] args = e.getArgs();
for (int i = 0; i < n; i++)
{
if (i != 0)
res += ", ";
res += args[i];
}
if (n > 1)
res += "]";
res += " -> " + e.getValue() + ", ";
}
res += "else -> " + getElse();
res += "]";
return res;
} catch (Z3Exception e)
{
return new String("Z3Exception: " + e.getMessage());
}
}
FuncInterp(Context ctx, long obj) throws Z3Exception
{
super(ctx, obj);
}
FuncInterp(Context ctx, long obj) throws Z3Exception
{
super(ctx, obj);
}
void incRef(long o) throws Z3Exception
{
getContext().funcInterp_DRQ().incAndClear(getContext(), o);
super.incRef(o);
}
void incRef(long o) throws Z3Exception
{
getContext().getFuncInterpDRQ().incAndClear(getContext(), o);
super.incRef(o);
}
void decRef(long o) throws Z3Exception
{
getContext().funcInterp_DRQ().add(o);
super.decRef(o);
}
void decRef(long o) throws Z3Exception
{
getContext().getFuncInterpDRQ().add(o);
super.decRef(o);
}
}

View file

@ -19,6 +19,16 @@ package com.microsoft.z3;
class FuncInterpDecRefQueue extends IDecRefQueue
{
public FuncInterpDecRefQueue()
{
super();
}
public FuncInterpDecRefQueue(int move_limit)
{
super(move_limit);
}
protected void incRef(Context ctx, long obj)
{
try

View file

@ -19,6 +19,16 @@ package com.microsoft.z3;
class FuncInterpEntryDecRefQueue extends IDecRefQueue
{
public FuncInterpEntryDecRefQueue()
{
super();
}
public FuncInterpEntryDecRefQueue(int move_limit)
{
super(move_limit);
}
protected void incRef(Context ctx, long obj)
{
try

View file

@ -19,16 +19,16 @@ package com.microsoft.z3;
/**
* Global functions for Z3.
* <remarks>
* Remarks:
* This (static) class contains functions that effect the behaviour of Z3
* globally across contexts, etc.
* </remarks>
*
**/
public final class Global
{
/**
* Set a global (or module) parameter, which is shared by all Z3 contexts.
* <remarks>
* Remarks:
* When a Z3 module is initialized it will use the value of these parameters
* when Z3_params objects are not provided.
* The name of parameter can be composed of characters [a-z][A-Z], digits [0-9], '-' and '_'.
@ -36,24 +36,23 @@ public final class Global
* The parameter names are case-insensitive. The character '-' should be viewed as an "alias" for '_'.
* Thus, the following parameter names are considered equivalent: "pp.decimal-precision" and "PP.DECIMAL_PRECISION".
* This function can be used to set parameters for a specific Z3 module.
* This can be done by using <module-name>.<parameter-name>.
* This can be done by using &lt;module-name&gt;.&lt;parameter-name&gt;.
* For example:
* Z3_global_param_set('pp.decimal', 'true')
* will set the parameter "decimal" in the module "pp" to true.
* </remarks>
*
**/
public static void setParameter(String id, String value)
{
Native.globalParamSet(id, value);
Native.globalParamSet(id, value);
}
/**
* Get a global (or module) parameter.
* <remarks>
* Returns null if the parameter <param name="id">parameter id</param> does not exist.
* Remarks:
* This function cannot be invoked simultaneously from different threads without synchronization.
* The result string stored in param_value is stored in a shared location.
* </remarks>
* @return null if the parameter {@code id} does not exist.
**/
public static String getParameter(String id)
{
@ -66,13 +65,44 @@ public final class Global
/**
* Restore the value of all global (and module) parameters.
* <remarks>
* Remarks:
* This command will not affect already created objects (such as tactics and solvers)
* </remarks>
* <seealso cref="SetParameter"/>
* @see setParameter
**/
public static void resetParameters()
{
Native.globalParamResetAll();
}
Native.globalParamResetAll();
}
/**
* Enable/disable printing of warning messages to the console.
* Remarks: Note
* that this function is static and effects the behaviour of all contexts
* globally.
**/
public static void ToggleWarningMessages(boolean enabled)
throws Z3Exception
{
Native.toggleWarningMessages((enabled) ? true : false);
}
/**
* Enable tracing messages tagged as `tag' when Z3 is compiled in debug mode.
*
* Remarks: It is a NOOP otherwise.
**/
public static void enableTrace(String tag)
{
Native.enableTrace(tag);
}
/**
* Disable tracing messages tagged as `tag' when Z3 is compiled in debug mode.
*
* Remarks: It is a NOOP otherwise.
**/
public static void disableTrace(String tag)
{
Native.disableTrace(tag);
}
}

View file

@ -26,11 +26,12 @@ import com.microsoft.z3.enumerations.Z3_goal_prec;
public class Goal extends Z3Object
{
/**
* The precision of the goal. <remarks> Goals can be transformed using over
* The precision of the goal.
* Remarks: Goals can be transformed using over
* and under approximations. An under approximation is applied when the
* objective is to find a model for a given goal. An over approximation is
* applied when the objective is to find a proof for a given goal.
* </remarks>
*
**/
public Z3_goal_prec getPrecision() throws Z3Exception
{
@ -72,7 +73,7 @@ public class Goal extends Z3Object
}
/**
* Adds the <paramref name="constraints"/> to the given goal.
* Adds the {@code constraints} to the given goal.
*
* @throws Z3Exception
**/
@ -95,8 +96,9 @@ public class Goal extends Z3Object
}
/**
* The depth of the goal. <remarks> This tracks how many transformations
* were applied to it. </remarks>
* The depth of the goal.
* Remarks: This tracks how many transformations
* were applied to it.
**/
public int getDepth() throws Z3Exception
{
@ -162,8 +164,7 @@ public class Goal extends Z3Object
}
/**
* Translates (copies) the Goal to the target Context <paramref
* name="ctx"/>.
* Translates (copies) the Goal to the target Context {@code ctx}.
*
* @throws Z3Exception
**/
@ -174,8 +175,9 @@ public class Goal extends Z3Object
}
/**
* Simplifies the goal. <remarks>Essentially invokes the `simplify' tactic
* on the goal.</remarks>
* Simplifies the goal.
* Remarks: Essentially invokes the `simplify' tactic
* on the goal.
**/
public Goal simplify() throws Z3Exception
{
@ -189,8 +191,9 @@ public class Goal extends Z3Object
}
/**
* Simplifies the goal. <remarks>Essentially invokes the `simplify' tactic
* on the goal.</remarks>
* Simplifies the goal.
* Remarks: Essentially invokes the `simplify' tactic
* on the goal.
**/
public Goal simplify(Params p) throws Z3Exception
{
@ -233,13 +236,13 @@ public class Goal extends Z3Object
void incRef(long o) throws Z3Exception
{
getContext().goal_DRQ().incAndClear(getContext(), o);
getContext().getGoalDRQ().incAndClear(getContext(), o);
super.incRef(o);
}
void decRef(long o) throws Z3Exception
{
getContext().goal_DRQ().add(o);
getContext().getGoalDRQ().add(o);
super.decRef(o);
}

View file

@ -19,6 +19,16 @@ package com.microsoft.z3;
class GoalDecRefQueue extends IDecRefQueue
{
public GoalDecRefQueue()
{
super();
}
public GoalDecRefQueue(int move_limit)
{
super(move_limit);
}
protected void incRef(Context ctx, long obj)
{
try

View file

@ -19,41 +19,53 @@ package com.microsoft.z3;
import java.util.LinkedList;
abstract class IDecRefQueue
public abstract class IDecRefQueue
{
protected Object m_lock = new Object();
protected LinkedList<Long> m_queue = new LinkedList<Long>();
protected final int m_move_limit = 1024;
protected Object m_lock = new Object();
protected LinkedList<Long> m_queue = new LinkedList<Long>();
protected int m_move_limit;
protected abstract void incRef(Context ctx, long obj);
protected abstract void decRef(Context ctx, long obj);
protected void incAndClear(Context ctx, long o)
protected IDecRefQueue()
{
incRef(ctx, o);
if (m_queue.size() >= m_move_limit)
clear(ctx);
}
m_move_limit = 1024;
}
protected void add(long o)
{
if (o == 0)
return;
protected IDecRefQueue(int move_limit)
{
m_move_limit = move_limit;
}
public void setLimit(int l) { m_move_limit = l; }
protected abstract void incRef(Context ctx, long obj);
synchronized (m_lock)
{
m_queue.add(o);
}
}
protected abstract void decRef(Context ctx, long obj);
protected void clear(Context ctx)
{
synchronized (m_lock)
{
for (Long o : m_queue)
decRef(ctx, o);
m_queue.clear();
}
}
protected void incAndClear(Context ctx, long o)
{
incRef(ctx, o);
if (m_queue.size() >= m_move_limit)
clear(ctx);
}
protected void add(long o)
{
if (o == 0)
return;
synchronized (m_lock)
{
m_queue.add(o);
}
}
protected void clear(Context ctx)
{
synchronized (m_lock)
{
for (Long o : m_queue)
decRef(ctx, o);
m_queue.clear();
}
}
}

View file

@ -21,7 +21,7 @@ package com.microsoft.z3;
public class IDisposable
{
public void dispose() throws Z3Exception
{
}
public void dispose() throws Z3Exception
{
}
}

View file

@ -22,16 +22,12 @@ package com.microsoft.z3;
**/
public class IntExpr extends ArithExpr
{
/**
* Constructor for IntExpr </summary>
**/
protected IntExpr(Context ctx) throws Z3Exception
{
super(ctx);
}
IntExpr(Context ctx, long obj) throws Z3Exception
{
super(ctx, obj);
}
/**
* Constructor for IntExpr
* @throws Z3Exception on error
**/
IntExpr(Context ctx, long obj) throws Z3Exception
{
super(ctx, obj);
}
}

View file

@ -22,13 +22,13 @@ package com.microsoft.z3;
**/
public class IntSort extends ArithSort
{
IntSort(Context ctx, long obj) throws Z3Exception
{
super(ctx, obj);
}
IntSort(Context ctx, long obj) throws Z3Exception
{
super(ctx, obj);
}
IntSort(Context ctx) throws Z3Exception
{
super(ctx, Native.mkIntSort(ctx.nCtx()));
}
IntSort(Context ctx) throws Z3Exception
{
super(ctx, Native.mkIntSort(ctx.nCtx()));
}
}

View file

@ -25,8 +25,9 @@ import com.microsoft.z3.enumerations.Z3_symbol_kind;
public class IntSymbol extends Symbol
{
/**
* The int value of the symbol. <remarks>Throws an exception if the symbol
* is not of int kind. </remarks>
* The int value of the symbol.
* Remarks: Throws an exception if the symbol
* is not of int kind.
**/
public int getInt() throws Z3Exception
{

View file

@ -20,15 +20,13 @@ package com.microsoft.z3;
import java.util.Map;
import java.lang.String;
import com.microsoft.z3.Native.IntPtr;
import com.microsoft.z3.Native.UIntArrayPtr;
import com.microsoft.z3.enumerations.Z3_lbool;
/** <summary>
/**
* The InterpolationContext is suitable for generation of interpolants.
* </summary>
* <remarks>For more information on interpolation please refer
* too the C/C++ API, which is well documented.</remarks>
*
* Remarks: For more information on interpolation please refer
* too the C/C++ API, which is well documented.
**/
public class InterpolationContext extends Context
{
@ -44,7 +42,9 @@ public class InterpolationContext extends Context
/**
* Constructor.
*
* <remarks><seealso cref="Context.Context(Dictionary&lt;string, string&gt;)"/></remarks>
*
* Remarks:
* @see Context#Context
**/
public InterpolationContext(Map<String, String> settings) throws Z3Exception
{
@ -58,7 +58,7 @@ public class InterpolationContext extends Context
/**
* Create an expression that marks a formula position for interpolation.
* @throws Z3Exception
* @throws Z3Exception
**/
public BoolExpr MkInterpolant(BoolExpr a) throws Z3Exception
{
@ -68,9 +68,9 @@ public class InterpolationContext extends Context
/**
* Computes an interpolant.
* <remarks>For more information on interpolation please refer
* Remarks: For more information on interpolation please refer
* too the function Z3_get_interpolant in the C/C++ API, which is
* well documented.</remarks>
* well documented.
* @throws Z3Exception
**/
Expr[] GetInterpolant(Expr pf, Expr pat, Params p) throws Z3Exception
@ -89,9 +89,9 @@ public class InterpolationContext extends Context
/**
* Computes an interpolant.
* <remarks>For more information on interpolation please refer
* Remarks: For more information on interpolation please refer
* too the function Z3_compute_interpolant in the C/C++ API, which is
* well documented.</remarks>
* well documented.
* @throws Z3Exception
**/
Z3_lbool ComputeInterpolant(Expr pat, Params p, ASTVector interp, Model model) throws Z3Exception
@ -107,23 +107,23 @@ public class InterpolationContext extends Context
return Z3_lbool.fromInt(r);
}
/// <summary>
///
/// Return a string summarizing cumulative time used for interpolation.
/// </summary>
/// <remarks>For more information on interpolation please refer
///
/// Remarks: For more information on interpolation please refer
/// too the function Z3_interpolation_profile in the C/C++ API, which is
/// well documented.</remarks>
/// well documented.
public String InterpolationProfile() throws Z3Exception
{
return Native.interpolationProfile(nCtx());
}
/// <summary>
///
/// Checks the correctness of an interpolant.
/// </summary>
/// <remarks>For more information on interpolation please refer
///
/// Remarks: For more information on interpolation please refer
/// too the function Z3_check_interpolant in the C/C++ API, which is
/// well documented.</remarks>
/// well documented.
public int CheckInterpolant(Expr[] cnsts, int[] parents, Expr[] interps, String error, Expr[] theory) throws Z3Exception
{
Native.StringPtr n_err_str = new Native.StringPtr();
@ -139,12 +139,12 @@ public class InterpolationContext extends Context
return r;
}
/// <summary>
///
/// Reads an interpolation problem from a file.
/// </summary>
/// <remarks>For more information on interpolation please refer
///
/// Remarks: For more information on interpolation please refer
/// too the function Z3_read_interpolation_problem in the C/C++ API, which is
/// well documented.</remarks>
/// well documented.
public int ReadInterpolationProblem(String filename, Expr[] cnsts, int[] parents, String error, Expr[] theory) throws Z3Exception
{
Native.IntPtr n_num = new Native.IntPtr();
@ -170,12 +170,12 @@ public class InterpolationContext extends Context
return r;
}
/// <summary>
///
/// Writes an interpolation problem to a file.
/// </summary>
/// <remarks>For more information on interpolation please refer
///
/// Remarks: For more information on interpolation please refer
/// too the function Z3_write_interpolation_problem in the C/C++ API, which is
/// well documented.</remarks>
/// well documented.
public void WriteInterpolationProblem(String filename, Expr[] cnsts, int[] parents, String error, Expr[] theory) throws Z3Exception
{
Native.writeInterpolationProblem(nCtx(), cnsts.length, Expr.arrayToNative(cnsts), parents, filename, theory.length, Expr.arrayToNative(theory));

View file

@ -88,7 +88,7 @@ public class ListSort extends Sort
ListSort(Context ctx, Symbol name, Sort elemSort) throws Z3Exception
{
super(ctx);
super(ctx, 0);
Native.LongPtr inil = new Native.LongPtr(), iisnil = new Native.LongPtr();
Native.LongPtr icons = new Native.LongPtr(), iiscons = new Native.LongPtr();

View file

@ -18,17 +18,18 @@ Notes:
package com.microsoft.z3;
/**
* Interaction logging for Z3. <remarks> Note that this is a global, static log
* Interaction logging for Z3.
* Remarks: Note that this is a global, static log
* and if multiple Context objects are created, it logs the interaction with all
* of them. </remarks>
* of them.
**/
public final class Log
{
private static boolean m_is_open = false;
/**
* Open an interaction log file. <param name="filename">the name of the file
* to open</param>
* Open an interaction log file.
* @param filename the name of the file to open
*
* @return True if opening the log file succeeds, false otherwise.
**/
@ -48,7 +49,7 @@ public final class Log
}
/**
* Appends the user-provided string <paramref name="s"/> to the interaction
* Appends the user-provided string {@code s} to the interaction
* log.
* @throws Z3Exception
**/

View file

@ -25,8 +25,9 @@ import com.microsoft.z3.enumerations.Z3_sort_kind;
public class Model extends Z3Object
{
/**
* Retrieves the interpretation (the assignment) of <paramref name="a"/> in
* the model. <param name="a">A Constant</param>
* Retrieves the interpretation (the assignment) of {@code a} in
* the model.
* @param a A Constant
*
* @return An expression if the constant has an interpretation in the model,
* null otherwise.
@ -39,8 +40,9 @@ public class Model extends Z3Object
}
/**
* Retrieves the interpretation (the assignment) of <paramref name="f"/> in
* the model. <param name="f">A function declaration of zero arity</param>
* Retrieves the interpretation (the assignment) of {@code f} in
* the model.
* @param f A function declaration of zero arity
*
* @return An expression if the function has an interpretation in the model,
* null otherwise.
@ -65,9 +67,8 @@ public class Model extends Z3Object
}
/**
* Retrieves the interpretation (the assignment) of a non-constant <paramref
* name="f"/> in the model. <param name="f">A function declaration of
* non-zero arity</param>
* Retrieves the interpretation (the assignment) of a non-constant {@code f} in the model.
* @param f A function declaration of non-zero arity
*
* @return A FunctionInterpretation if the function has an interpretation in
* the model, null otherwise.
@ -196,16 +197,15 @@ public class Model extends Z3Object
}
/**
* Evaluates the expression <paramref name="t"/> in the current model.
* <remarks> This function may fail if <paramref name="t"/> contains
* quantifiers, is partial (MODEL_PARTIAL enabled), or if <paramref
* name="t"/> is not well-sorted. In this case a
* <code>ModelEvaluationFailedException</code> is thrown. </remarks> <param
* name="t">An expression</param> <param name="completion"> When this flag
* Evaluates the expression {@code t} in the current model.
* Remarks: This function may fail if {@code t} contains
* quantifiers, is partial (MODEL_PARTIAL enabled), or if {@code t} is not well-sorted. In this case a
* {@code ModelEvaluationFailedException} is thrown.
* @param t An expression {@code completion} When this flag
* is enabled, a model value will be assigned to any constant or function
* that does not have an interpretation in the model. </param>
* that does not have an interpretation in the model.
*
* @return The evaluation of <paramref name="t"/> in the model.
* @return The evaluation of {@code t} in the model.
* @throws Z3Exception
**/
public Expr eval(Expr t, boolean completion) throws Z3Exception
@ -219,7 +219,7 @@ public class Model extends Z3Object
}
/**
* Alias for <code>Eval</code>.
* Alias for {@code Eval}.
*
* @throws Z3Exception
**/
@ -239,10 +239,12 @@ public class Model extends Z3Object
/**
* The uninterpreted sorts that the model has an interpretation for.
* <remarks> Z3 also provides an intepretation for uninterpreted sorts used
* Remarks: Z3 also provides an intepretation for uninterpreted sorts used
* in a formula. The interpretation for a sort is a finite set of distinct
* values. We say this finite set is the "universe" of the sort. </remarks>
* <seealso cref="NumSorts"/> <seealso cref="SortUniverse"/>
* values. We say this finite set is the "universe" of the sort.
*
* @see getNumSorts
* @see getSortUniverse
*
* @throws Z3Exception
**/
@ -259,11 +261,11 @@ public class Model extends Z3Object
/**
* The finite set of distinct values that represent the interpretation for
* sort <paramref name="s"/>. <seealso cref="Sorts"/> <param name="s">An
* uninterpreted sort</param>
* sort {@code s}.
* @param s An uninterpreted sort
*
* @return An array of expressions, where each is an element of the universe
* of <paramref name="s"/>
* of {@code s}
* @throws Z3Exception
**/
public Expr[] getSortUniverse(Sort s) throws Z3Exception
@ -301,13 +303,13 @@ public class Model extends Z3Object
void incRef(long o) throws Z3Exception
{
getContext().model_DRQ().incAndClear(getContext(), o);
getContext().getModelDRQ().incAndClear(getContext(), o);
super.incRef(o);
}
void decRef(long o) throws Z3Exception
{
getContext().model_DRQ().add(o);
getContext().getModelDRQ().add(o);
super.decRef(o);
}
}

View file

@ -19,6 +19,16 @@ package com.microsoft.z3;
class ModelDecRefQueue extends IDecRefQueue
{
public ModelDecRefQueue()
{
super();
}
public ModelDecRefQueue(int move_limit)
{
super(move_limit);
}
protected void incRef(Context ctx, long obj)
{
try

View file

@ -90,13 +90,13 @@ public class ParamDescrs extends Z3Object
void incRef(long o) throws Z3Exception
{
getContext().paramDescrs_DRQ().incAndClear(getContext(), o);
getContext().getParamDescrsDRQ().incAndClear(getContext(), o);
super.incRef(o);
}
void decRef(long o) throws Z3Exception
{
getContext().paramDescrs_DRQ().add(o);
getContext().getParamDescrsDRQ().add(o);
super.decRef(o);
}
}

View file

@ -19,6 +19,16 @@ package com.microsoft.z3;
class ParamDescrsDecRefQueue extends IDecRefQueue
{
public ParamDescrsDecRefQueue()
{
super();
}
public ParamDescrsDecRefQueue(int move_limit)
{
super(move_limit);
}
protected void incRef(Context ctx, long obj)
{
try

View file

@ -130,13 +130,13 @@ public class Params extends Z3Object
void incRef(long o) throws Z3Exception
{
getContext().params_DRQ().incAndClear(getContext(), o);
getContext().getParamsDRQ().incAndClear(getContext(), o);
super.incRef(o);
}
void decRef(long o) throws Z3Exception
{
getContext().params_DRQ().add(o);
getContext().getParamsDRQ().add(o);
super.decRef(o);
}
}

View file

@ -19,6 +19,16 @@ package com.microsoft.z3;
class ParamsDecRefQueue extends IDecRefQueue
{
public ParamsDecRefQueue()
{
super();
}
public ParamsDecRefQueue(int move_limit)
{
super(move_limit);
}
protected void incRef(Context ctx, long obj)
{
try

View file

@ -21,8 +21,8 @@ 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</code> and <code>Context.ProbeNames</code>. It may
* also be obtained using the command <code>(help-tactics)</code> in the SMT 2.0
* {@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
@ -53,13 +53,13 @@ public class Probe extends Z3Object
void incRef(long o) throws Z3Exception
{
getContext().probe_DRQ().incAndClear(getContext(), o);
getContext().getProbeDRQ().incAndClear(getContext(), o);
super.incRef(o);
}
void decRef(long o) throws Z3Exception
{
getContext().probe_DRQ().add(o);
getContext().getProbeDRQ().add(o);
super.decRef(o);
}
}

View file

@ -19,6 +19,16 @@ package com.microsoft.z3;
class ProbeDecRefQueue extends IDecRefQueue
{
public ProbeDecRefQueue()
{
super();
}
public ProbeDecRefQueue(int move_limit)
{
super(move_limit);
}
protected void incRef(Context ctx, long obj)
{
try

View file

@ -149,7 +149,7 @@ public class Quantifier extends BoolExpr
Expr body, int weight, Pattern[] patterns, Expr[] noPatterns,
Symbol quantifierID, Symbol skolemID) throws Z3Exception
{
super(ctx);
super(ctx, 0);
getContext().checkContextMatch(patterns);
getContext().checkContextMatch(noPatterns);
@ -171,13 +171,13 @@ public class Quantifier extends BoolExpr
} else
{
setNativeObject(Native.mkQuantifierEx(ctx.nCtx(),
(isForall) ? true : false, weight, AST.getNativeObject(quantifierID),
AST.getNativeObject(skolemID),
AST.arrayLength(patterns), AST.arrayToNative(patterns),
AST.arrayLength(noPatterns), AST.arrayToNative(noPatterns),
AST.arrayLength(sorts), AST.arrayToNative(sorts),
Symbol.arrayToNative(names),
body.getNativeObject()));
(isForall) ? true : false, weight, AST.getNativeObject(quantifierID),
AST.getNativeObject(skolemID),
AST.arrayLength(patterns), AST.arrayToNative(patterns),
AST.arrayLength(noPatterns), AST.arrayToNative(noPatterns),
AST.arrayLength(sorts), AST.arrayToNative(sorts),
Symbol.arrayToNative(names),
body.getNativeObject()));
}
}
@ -185,7 +185,7 @@ public class Quantifier extends BoolExpr
int weight, Pattern[] patterns, Expr[] noPatterns,
Symbol quantifierID, Symbol skolemID) throws Z3Exception
{
super(ctx);
super(ctx, 0);
getContext().checkContextMatch(noPatterns);
getContext().checkContextMatch(patterns);

View file

@ -61,8 +61,9 @@ public class RatNum extends RealExpr
}
/**
* Returns a string representation in decimal notation. <remarks>The result
* has at most <paramref name="precision"/> decimal places.</remarks>
* Returns a string representation in decimal notation.
* Remarks: The result
* has at most {@code precision} decimal places.
**/
public String toDecimalString(int precision) throws Z3Exception
{

View file

@ -23,13 +23,8 @@ package com.microsoft.z3;
public class RealExpr extends ArithExpr
{
/**
* Constructor for RealExpr </summary>
* Constructor for RealExpr
**/
protected RealExpr(Context ctx)
{
super(ctx);
}
RealExpr(Context ctx, long obj) throws Z3Exception
{
super(ctx, obj);

View file

@ -56,8 +56,9 @@ public class Solver extends Z3Object
}
/**
* The current number of backtracking points (scopes). <seealso cref="Pop"/>
* <seealso cref="Push"/>
* The current number of backtracking points (scopes).
* @see pop
* @see push
**/
public int getNumScopes() throws Z3Exception
{
@ -66,7 +67,8 @@ public class Solver extends Z3Object
}
/**
* Creates a backtracking point. <seealso cref="Pop"/>
* Creates a backtracking point.
* @see pop
**/
public void push() throws Z3Exception
{
@ -74,7 +76,8 @@ public class Solver extends Z3Object
}
/**
* Backtracks one backtracking point. <remarks>.
* Backtracks one backtracking point.
* Remarks: .
**/
public void pop() throws Z3Exception
{
@ -82,9 +85,11 @@ public class Solver extends Z3Object
}
/**
* Backtracks <paramref name="n"/> backtracking points. <remarks>Note that
* an exception is thrown if <paramref name="n"/> is not smaller than
* <code>NumScopes</code></remarks> <seealso cref="Push"/>
* Backtracks {@code n} backtracking points.
* Remarks: Note that
* an exception is thrown if {@code n} is not smaller than
* {@code NumScopes}
* @see push
**/
public void pop(int n) throws Z3Exception
{
@ -92,8 +97,9 @@ public class Solver extends Z3Object
}
/**
* Resets the Solver. <remarks>This removes all assertions from the
* solver.</remarks>
* Resets the Solver.
* Remarks: This removes all assertions from the
* solver.
**/
public void reset() throws Z3Exception
{
@ -115,20 +121,20 @@ public class Solver extends Z3Object
}
}
// / <summary>
// / Assert multiple constraints into the solver, and track them (in the
// unsat) core
// / using the Boolean constants in ps.
// / </summary>
// / <remarks>
// / This API is an alternative to <see cref="Check"/> with assumptions for
// extracting unsat cores.
// / Both APIs can be used in the same solver. The unsat core will contain a
// combination
// / of the Boolean variables provided using <see cref="AssertAndTrack"/>
// and the Boolean literals
// / provided using <see cref="Check"/> with assumptions.
// / </remarks>
/**
* Assert multiple constraints into the solver, and track them (in the
* unsat) core
* using the Boolean constants in ps.
*
* Remarks:
* This API is an alternative to <see cref="Check"/> with assumptions for
* extracting unsat cores.
* Both APIs can be used in the same solver. The unsat core will contain a
* combination
* of the Boolean variables provided using <see cref="AssertAndTrack"/>
* and the Boolean literals
* provided using <see cref="Check"/> with assumptions.
**/
public void assertAndTrack(BoolExpr[] constraints, BoolExpr[] ps) throws Z3Exception
{
getContext().checkContextMatch(constraints);
@ -141,19 +147,19 @@ public class Solver extends Z3Object
constraints[i].getNativeObject(), ps[i].getNativeObject());
}
// / <summary>
// / Assert a constraint into the solver, and track it (in the unsat) core
// / using the Boolean constant p.
// / </summary>
// / <remarks>
// / This API is an alternative to <see cref="Check"/> with assumptions for
// extracting unsat cores.
// / Both APIs can be used in the same solver. The unsat core will contain a
// combination
// / of the Boolean variables provided using <see cref="AssertAndTrack"/>
// and the Boolean literals
// / provided using <see cref="Check"/> with assumptions.
// / </remarks>
/**
* Assert a constraint into the solver, and track it (in the unsat) core
* using the Boolean constant p.
*
* Remarks:
* This API is an alternative to <see cref="Check"/> with assumptions for
* extracting unsat cores.
* Both APIs can be used in the same solver. The unsat core will contain a
* combination
* of the Boolean variables provided using <see cref="AssertAndTrack"/>
* and the Boolean literals
* provided using <see cref="Check"/> with assumptions.
*/
public void assertAndTrack(BoolExpr constraint, BoolExpr p) throws Z3Exception
{
getContext().checkContextMatch(constraint);
@ -170,9 +176,9 @@ public class Solver extends Z3Object
**/
public int getNumAssertions() throws Z3Exception
{
ASTVector ass = new ASTVector(getContext(), Native.solverGetAssertions(
ASTVector assrts = new ASTVector(getContext(), Native.solverGetAssertions(
getContext().nCtx(), getNativeObject()));
return ass.size();
return assrts.size();
}
/**
@ -182,19 +188,21 @@ public class Solver extends Z3Object
**/
public BoolExpr[] getAssertions() throws Z3Exception
{
ASTVector ass = new ASTVector(getContext(), Native.solverGetAssertions(
ASTVector assrts = new ASTVector(getContext(), Native.solverGetAssertions(
getContext().nCtx(), getNativeObject()));
int n = ass.size();
int n = assrts.size();
BoolExpr[] res = new BoolExpr[n];
for (int i = 0; i < n; i++)
res[i] = new BoolExpr(getContext(), ass.get(i).getNativeObject());
res[i] = new BoolExpr(getContext(), assrts.get(i).getNativeObject());
return res;
}
/**
* Checks whether the assertions in the solver are consistent or not.
* <remarks> <seealso cref="Model"/> <seealso cref="UnsatCore"/> <seealso
* cref="Proof"/> </remarks>
* Remarks:
* @see getModel
* @see getUnsatCore
* @see getProof
**/
public Status check(Expr... assumptions) throws Z3Exception
{
@ -219,8 +227,10 @@ public class Solver extends Z3Object
/**
* Checks whether the assertions in the solver are consistent or not.
* <remarks> <seealso cref="Model"/> <seealso cref="UnsatCore"/> <seealso
* cref="Proof"/> </remarks>
* Remarks:
* @see getModel
* @see getUnsatCore
* @see getProof
**/
public Status check() throws Z3Exception
{
@ -228,10 +238,11 @@ public class Solver extends Z3Object
}
/**
* The model of the last <code>Check</code>. <remarks> The result is
* <code>null</code> if <code>Check</code> was not invoked before, if its
* results was not <code>SATISFIABLE</code>, or if model production is not
* enabled. </remarks>
* The model of the last {@code Check}.
* Remarks: The result is
* {@code null} if {@code Check} was not invoked before, if its
* results was not {@code SATISFIABLE}, or if model production is not
* enabled.
*
* @throws Z3Exception
**/
@ -245,10 +256,11 @@ public class Solver extends Z3Object
}
/**
* The proof of the last <code>Check</code>. <remarks> The result is
* <code>null</code> if <code>Check</code> was not invoked before, if its
* results was not <code>UNSATISFIABLE</code>, or if proof production is
* disabled. </remarks>
* The proof of the last {@code Check}.
* Remarks: The result is
* {@code null} if {@code Check} was not invoked before, if its
* results was not {@code UNSATISFIABLE}, or if proof production is
* disabled.
*
* @throws Z3Exception
**/
@ -262,10 +274,11 @@ public class Solver extends Z3Object
}
/**
* The unsat core of the last <code>Check</code>. <remarks> The unsat core
* is a subset of <code>Assertions</code> The result is empty if
* <code>Check</code> was not invoked before, if its results was not
* <code>UNSATISFIABLE</code>, or if core production is disabled. </remarks>
* The unsat core of the last {@code Check}.
* Remarks: The unsat core
* is a subset of {@code Assertions} The result is empty if
* {@code Check} was not invoked before, if its results was not
* {@code UNSATISFIABLE}, or if core production is disabled.
*
* @throws Z3Exception
**/
@ -282,8 +295,8 @@ public class Solver extends Z3Object
}
/**
* A brief justification of why the last call to <code>Check</code> returned
* <code>UNKNOWN</code>.
* A brief justification of why the last call to {@code Check} returned
* {@code UNKNOWN}.
**/
public String getReasonUnknown() throws Z3Exception
{
@ -324,13 +337,13 @@ public class Solver extends Z3Object
void incRef(long o) throws Z3Exception
{
getContext().solver_DRQ().incAndClear(getContext(), o);
getContext().getSolverDRQ().incAndClear(getContext(), o);
super.incRef(o);
}
void decRef(long o) throws Z3Exception
{
getContext().solver_DRQ().add(o);
getContext().getSolverDRQ().add(o);
super.decRef(o);
}
}

View file

@ -19,6 +19,13 @@ package com.microsoft.z3;
class SolverDecRefQueue extends IDecRefQueue
{
public SolverDecRefQueue() { super(); }
public SolverDecRefQueue(int move_limit)
{
super(move_limit);
}
protected void incRef(Context ctx, long obj)
{
try

View file

@ -28,21 +28,21 @@ public class Sort extends AST
/* Overloaded operators are not translated. */
/**
* Equality operator for objects of type Sort. <param name="o"/>
*
* Equality operator for objects of type Sort.
* @param o
* @return
**/
public boolean equals(Object o)
{
Sort casted = null;
try {
casted = Sort.class.cast(o);
} catch (ClassCastException e) {
return false;
}
try {
casted = Sort.class.cast(o);
} catch (ClassCastException e) {
return false;
}
return this.getNativeObject() == casted.getNativeObject();
return this.getNativeObject() == casted.getNativeObject();
}
/**
@ -98,18 +98,9 @@ public class Sort extends AST
/**
* Sort constructor
**/
protected Sort(Context ctx) throws Z3Exception
{
super(ctx);
{
}
}
Sort(Context ctx, long obj) throws Z3Exception
{
super(ctx, obj);
{
}
}
void checkNativeObject(long obj) throws Z3Exception
@ -143,6 +134,10 @@ public class Sort extends AST
return new FiniteDomainSort(ctx, obj);
case Z3_RELATION_SORT:
return new RelationSort(ctx, obj);
case Z3_FLOATING_POINT_SORT:
return new FPSort(ctx, obj);
case Z3_ROUNDING_MODE_SORT:
return new FPRMSort(ctx, obj);
default:
throw new Z3Exception("Unknown sort kind");
}

View file

@ -24,7 +24,7 @@ public class Statistics extends Z3Object
{
/**
* Statistical data is organized into pairs of [Key, Entry], where every
* Entry is either a <code>DoubleEntry</code> or a <code>UIntEntry</code>
* Entry is either a {@code DoubleEntry} or a {@code UIntEntry}
**/
public class Entry
{
@ -176,8 +176,9 @@ public class Statistics extends Z3Object
}
/**
* The value of a particular statistical counter. <remarks>Returns null if
* the key is unknown.</remarks>
* The value of a particular statistical counter.
* Remarks: Returns null if
* the key is unknown.
*
* @throws Z3Exception
**/
@ -198,13 +199,13 @@ public class Statistics extends Z3Object
void incRef(long o) throws Z3Exception
{
getContext().statistics_DRQ().incAndClear(getContext(), o);
getContext().getStatisticsDRQ().incAndClear(getContext(), o);
super.incRef(o);
}
void decRef(long o) throws Z3Exception
{
getContext().statistics_DRQ().add(o);
getContext().getStatisticsDRQ().add(o);
super.decRef(o);
}
}

View file

@ -19,6 +19,16 @@ package com.microsoft.z3;
class StatisticsDecRefQueue extends IDecRefQueue
{
public StatisticsDecRefQueue()
{
super();
}
public StatisticsDecRefQueue(int move_limit)
{
super(move_limit);
}
protected void incRef(Context ctx, long obj)
{
try

View file

@ -25,8 +25,9 @@ import com.microsoft.z3.enumerations.Z3_symbol_kind;
public class StringSymbol extends Symbol
{
/**
* The string value of the symbol. <remarks>Throws an exception if the
* symbol is not of string kind.</remarks>
* The string value of the symbol.
* Remarks: Throws an exception if the
* symbol is not of string kind.
**/
public String getString() throws Z3Exception
{

View file

@ -20,8 +20,8 @@ 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
* {@code Context.NumTactics} and {@code Context.TacticNames}. It may
* also be obtained using the command {@code (help-tactics)} in the SMT 2.0
* front-end.
**/
public class Tactic extends Z3Object
@ -49,7 +49,7 @@ public class Tactic extends Z3Object
* @throws Z3Exception
**/
public ApplyResult apply(Goal g) throws Z3Exception
{
{
return apply(g, null);
}
@ -73,8 +73,8 @@ public class Tactic extends Z3Object
}
/**
* Creates a solver that is implemented using the given tactic. <seealso
* cref="Context.MkSolver(Tactic)"/>
* Creates a solver that is implemented using the given tactic.
* @see Context#mkSolver(Tactic)
* @throws Z3Exception
**/
public Solver getSolver() throws Z3Exception
@ -94,13 +94,13 @@ public class Tactic extends Z3Object
void incRef(long o) throws Z3Exception
{
getContext().tactic_DRQ().incAndClear(getContext(), o);
getContext().getTacticDRQ().incAndClear(getContext(), o);
super.incRef(o);
}
void decRef(long o) throws Z3Exception
{
getContext().tactic_DRQ().add(o);
getContext().getTacticDRQ().add(o);
super.decRef(o);
}
}

View file

@ -19,6 +19,16 @@ package com.microsoft.z3;
class TacticDecRefQueue extends IDecRefQueue
{
public TacticDecRefQueue()
{
super();
}
public TacticDecRefQueue(int move_limit)
{
super(move_limit);
}
protected void incRef(Context ctx, long obj)
{
try

View file

@ -59,7 +59,7 @@ public class TupleSort extends Sort
TupleSort(Context ctx, Symbol name, int numFields, Symbol[] fieldNames,
Sort[] fieldSorts) throws Z3Exception
{
super(ctx);
super(ctx, 0);
Native.LongPtr t = new Native.LongPtr();
setNativeObject(Native.mkTupleSort(ctx.nCtx(), name.getNativeObject(),

View file

@ -18,7 +18,8 @@ Notes:
package com.microsoft.z3;
/**
* Version information. <remarks>Note that this class is static.</remarks>
* Version information.
* Remarks: Note that this class is static.
**/
public class Version
{

View file

@ -115,7 +115,7 @@ public class Z3Object extends IDisposable
return null;
long[] an = new long[a.length];
for (int i = 0; i < a.length; i++)
an[i] = (a[i] == null) ? 0 : a[i].getNativeObject();
an[i] = (a[i] == null) ? 0 : a[i].getNativeObject();
return an;
}