mirror of
				https://github.com/Z3Prover/z3
				synced 2025-11-03 21:09:11 +00:00 
			
		
		
		
	Java API: syntactic adjustments, getters, setters,
... convenience parameters, etc. Signed-off-by: Christoph M. Wintersteiger <cwinter@microsoft.com>
This commit is contained in:
		
							parent
							
								
									3abf397560
								
							
						
					
					
						commit
						4b18c8f9c4
					
				
					 63 changed files with 2939 additions and 2985 deletions
				
			
		| 
						 | 
				
			
			@ -6,7 +6,7 @@
 | 
			
		|||
 | 
			
		||||
package com.microsoft.z3;
 | 
			
		||||
 | 
			
		||||
import com.microsoft.z3.enumerations.*;
 | 
			
		||||
import com.microsoft.z3.enumerations.Z3_ast_kind;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * The abstract syntax tree (AST) class.
 | 
			
		||||
| 
						 | 
				
			
			@ -47,7 +47,7 @@ public class AST extends Z3Object
 | 
			
		|||
            return false;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return this.NativeObject() == casted.NativeObject();
 | 
			
		||||
        return this.getNativeObject() == casted.getNativeObject();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
| 
						 | 
				
			
			@ -70,9 +70,9 @@ public class AST extends Z3Object
 | 
			
		|||
            return 1;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (Id() < oAST.Id())
 | 
			
		||||
        if (getId() < oAST.getId())
 | 
			
		||||
            return -1;
 | 
			
		||||
        else if (Id() > oAST.Id())
 | 
			
		||||
        else if (getId() > oAST.getId())
 | 
			
		||||
            return +1;
 | 
			
		||||
        else
 | 
			
		||||
            return 0;
 | 
			
		||||
| 
						 | 
				
			
			@ -83,17 +83,22 @@ public class AST extends Z3Object
 | 
			
		|||
     * 
 | 
			
		||||
     * @return A hash code
 | 
			
		||||
     **/
 | 
			
		||||
    public int GetHashCode() throws Z3Exception
 | 
			
		||||
    public int hashCode()
 | 
			
		||||
    {
 | 
			
		||||
        return (int) Native.getAstHash(Context().nCtx(), NativeObject());
 | 
			
		||||
        int r = 0;
 | 
			
		||||
        try {
 | 
			
		||||
            Native.getAstHash(getContext().nCtx(), getNativeObject());
 | 
			
		||||
        }
 | 
			
		||||
        catch (Z3Exception ex) {}
 | 
			
		||||
        return r;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * A unique identifier for the AST (unique among all ASTs).
 | 
			
		||||
     **/
 | 
			
		||||
    public int Id() throws Z3Exception
 | 
			
		||||
    public int getId() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Native.getAstId(Context().nCtx(), NativeObject());
 | 
			
		||||
        return Native.getAstId(getContext().nCtx(), getNativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
| 
						 | 
				
			
			@ -102,31 +107,31 @@ public class AST extends Z3Object
 | 
			
		|||
     * 
 | 
			
		||||
     * @return A copy of the AST which is associated with <paramref name="ctx"/>
 | 
			
		||||
     **/
 | 
			
		||||
    public AST Translate(Context ctx) throws Z3Exception
 | 
			
		||||
    public AST translate(Context ctx) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
        if (Context() == ctx)
 | 
			
		||||
        if (getContext() == ctx)
 | 
			
		||||
            return this;
 | 
			
		||||
        else
 | 
			
		||||
            return new AST(ctx, Native.translate(Context().nCtx(),
 | 
			
		||||
                    NativeObject(), ctx.nCtx()));
 | 
			
		||||
            return new AST(ctx, Native.translate(getContext().nCtx(),
 | 
			
		||||
                    getNativeObject(), ctx.nCtx()));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * The kind of the AST.
 | 
			
		||||
     **/
 | 
			
		||||
    public Z3_ast_kind ASTKind() throws Z3Exception
 | 
			
		||||
    public Z3_ast_kind getASTKind() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Z3_ast_kind.fromInt(Native.getAstKind(Context().nCtx(),
 | 
			
		||||
                NativeObject()));
 | 
			
		||||
        return Z3_ast_kind.fromInt(Native.getAstKind(getContext().nCtx(),
 | 
			
		||||
                getNativeObject()));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Indicates whether the AST is an Expr
 | 
			
		||||
     **/
 | 
			
		||||
    public boolean IsExpr() throws Z3Exception
 | 
			
		||||
    public boolean isExpr() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        switch (ASTKind())
 | 
			
		||||
        switch (getASTKind())
 | 
			
		||||
        {
 | 
			
		||||
        case Z3_APP_AST:
 | 
			
		||||
        case Z3_NUMERAL_AST:
 | 
			
		||||
| 
						 | 
				
			
			@ -141,41 +146,41 @@ public class AST extends Z3Object
 | 
			
		|||
    /**
 | 
			
		||||
     * Indicates whether the AST is an application
 | 
			
		||||
     **/
 | 
			
		||||
    public boolean IsApp() throws Z3Exception
 | 
			
		||||
    public boolean isApp() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return this.ASTKind() == Z3_ast_kind.Z3_APP_AST;
 | 
			
		||||
        return this.getASTKind() == Z3_ast_kind.Z3_APP_AST;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Indicates whether the AST is a BoundVariable
 | 
			
		||||
     **/
 | 
			
		||||
    public boolean IsVar() throws Z3Exception
 | 
			
		||||
    public boolean isVar() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return this.ASTKind() == Z3_ast_kind.Z3_VAR_AST;
 | 
			
		||||
        return this.getASTKind() == Z3_ast_kind.Z3_VAR_AST;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Indicates whether the AST is a Quantifier
 | 
			
		||||
     **/
 | 
			
		||||
    public boolean IsQuantifier() throws Z3Exception
 | 
			
		||||
    public boolean isQuantifier() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return this.ASTKind() == Z3_ast_kind.Z3_QUANTIFIER_AST;
 | 
			
		||||
        return this.getASTKind() == Z3_ast_kind.Z3_QUANTIFIER_AST;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Indicates whether the AST is a Sort
 | 
			
		||||
     **/
 | 
			
		||||
    public boolean IsSort() throws Z3Exception
 | 
			
		||||
    public boolean isSort() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return this.ASTKind() == Z3_ast_kind.Z3_SORT_AST;
 | 
			
		||||
        return this.getASTKind() == Z3_ast_kind.Z3_SORT_AST;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Indicates whether the AST is a FunctionDeclaration
 | 
			
		||||
     **/
 | 
			
		||||
    public boolean IsFuncDecl() throws Z3Exception
 | 
			
		||||
    public boolean isFuncDecl() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return this.ASTKind() == Z3_ast_kind.Z3_FUNC_DECL_AST;
 | 
			
		||||
        return this.getASTKind() == Z3_ast_kind.Z3_FUNC_DECL_AST;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
| 
						 | 
				
			
			@ -185,7 +190,7 @@ public class AST extends Z3Object
 | 
			
		|||
    {
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
            return Native.astToString(Context().nCtx(), NativeObject());
 | 
			
		||||
            return Native.astToString(getContext().nCtx(), getNativeObject());
 | 
			
		||||
        } catch (Z3Exception e)
 | 
			
		||||
        {
 | 
			
		||||
            return "Z3Exception: " + e.getMessage();
 | 
			
		||||
| 
						 | 
				
			
			@ -195,9 +200,9 @@ public class AST extends Z3Object
 | 
			
		|||
    /**
 | 
			
		||||
     * A string representation of the AST in s-expression notation.
 | 
			
		||||
     **/
 | 
			
		||||
    public String SExpr() throws Z3Exception
 | 
			
		||||
    public String getSExpr() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Native.astToString(Context().nCtx(), NativeObject());
 | 
			
		||||
        return Native.astToString(getContext().nCtx(), getNativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    AST(Context ctx)
 | 
			
		||||
| 
						 | 
				
			
			@ -210,29 +215,29 @@ public class AST extends Z3Object
 | 
			
		|||
        super(ctx, obj);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    void IncRef(long o) throws Z3Exception
 | 
			
		||||
    void incRef(long o) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        // Console.WriteLine("AST IncRef()");
 | 
			
		||||
        if (Context() == null)
 | 
			
		||||
        if (getContext() == null)
 | 
			
		||||
            throw new Z3Exception("inc() called on null context");
 | 
			
		||||
        if (o == 0)
 | 
			
		||||
            throw new Z3Exception("inc() called on null AST");
 | 
			
		||||
        Context().AST_DRQ().IncAndClear(Context(), o);
 | 
			
		||||
        super.IncRef(o);
 | 
			
		||||
        getContext().ast_DRQ().incAndClear(getContext(), o);
 | 
			
		||||
        super.incRef(o);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    void DecRef(long o) throws Z3Exception
 | 
			
		||||
    void decRef(long o) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        // Console.WriteLine("AST DecRef()");
 | 
			
		||||
        if (Context() == null)
 | 
			
		||||
        if (getContext() == null)
 | 
			
		||||
            throw new Z3Exception("dec() called on null context");
 | 
			
		||||
        if (o == 0)
 | 
			
		||||
            throw new Z3Exception("dec() called on null AST");
 | 
			
		||||
        Context().AST_DRQ().Add(o);
 | 
			
		||||
        super.DecRef(o);
 | 
			
		||||
        getContext().ast_DRQ().add(o);
 | 
			
		||||
        super.decRef(o);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    static AST Create(Context ctx, long obj) throws Z3Exception
 | 
			
		||||
    static AST create(Context ctx, long obj) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        switch (Z3_ast_kind.fromInt(Native.getAstKind(ctx.nCtx(), obj)))
 | 
			
		||||
        {
 | 
			
		||||
| 
						 | 
				
			
			@ -241,11 +246,11 @@ public class AST extends Z3Object
 | 
			
		|||
        case Z3_QUANTIFIER_AST:
 | 
			
		||||
            return new Quantifier(ctx, obj);
 | 
			
		||||
        case Z3_SORT_AST:
 | 
			
		||||
            return Sort.Create(ctx, obj);
 | 
			
		||||
            return Sort.create(ctx, obj);
 | 
			
		||||
        case Z3_APP_AST:
 | 
			
		||||
        case Z3_NUMERAL_AST:
 | 
			
		||||
        case Z3_VAR_AST:
 | 
			
		||||
            return Expr.Create(ctx, obj);
 | 
			
		||||
            return Expr.create(ctx, obj);
 | 
			
		||||
        default:
 | 
			
		||||
            throw new Z3Exception("Unknown AST kind");
 | 
			
		||||
        }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -5,9 +5,9 @@
 | 
			
		|||
 | 
			
		||||
package com.microsoft.z3;
 | 
			
		||||
 | 
			
		||||
public class ASTDecRefQueue extends IDecRefQueue
 | 
			
		||||
class ASTDecRefQueue extends IDecRefQueue
 | 
			
		||||
{
 | 
			
		||||
    public void IncRef(Context ctx, long obj)
 | 
			
		||||
    protected void incRef(Context ctx, long obj)
 | 
			
		||||
    {
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
| 
						 | 
				
			
			@ -18,7 +18,7 @@ public class ASTDecRefQueue extends IDecRefQueue
 | 
			
		|||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void DecRef(Context ctx, long obj)
 | 
			
		||||
    protected void decRef(Context ctx, long obj)
 | 
			
		||||
    {
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -18,11 +18,11 @@ class ASTMap extends Z3Object
 | 
			
		|||
     * @return True if <paramref name="k"/> is a key in the map, false
 | 
			
		||||
     *         otherwise.
 | 
			
		||||
     **/
 | 
			
		||||
    public boolean Contains(AST k) throws Z3Exception
 | 
			
		||||
    public boolean contains(AST k) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
        return Native.astMapContains(Context().nCtx(), NativeObject(),
 | 
			
		||||
                k.NativeObject());
 | 
			
		||||
        return Native.astMapContains(getContext().nCtx(), getNativeObject(),
 | 
			
		||||
                k.getNativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
| 
						 | 
				
			
			@ -32,47 +32,47 @@ class ASTMap extends Z3Object
 | 
			
		|||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public AST Find(AST k) throws Z3Exception
 | 
			
		||||
    public AST find(AST k) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return new AST(Context(), Native.astMapFind(Context().nCtx(),
 | 
			
		||||
                NativeObject(), k.NativeObject()));
 | 
			
		||||
        return new AST(getContext(), Native.astMapFind(getContext().nCtx(),
 | 
			
		||||
                getNativeObject(), k.getNativeObject()));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 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>
 | 
			
		||||
     **/
 | 
			
		||||
    public void Insert(AST k, AST v) throws Z3Exception
 | 
			
		||||
    public void insert(AST k, AST v) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
        Native.astMapInsert(Context().nCtx(), NativeObject(), k.NativeObject(),
 | 
			
		||||
                v.NativeObject());
 | 
			
		||||
        Native.astMapInsert(getContext().nCtx(), getNativeObject(), k.getNativeObject(),
 | 
			
		||||
                v.getNativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Erases the key <paramref name="k"/> from the map. <param name="k">An
 | 
			
		||||
     * AST</param>
 | 
			
		||||
     **/
 | 
			
		||||
    public void Erase(AST k) throws Z3Exception
 | 
			
		||||
    public void erase(AST k) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
        Native.astMapErase(Context().nCtx(), NativeObject(), k.NativeObject());
 | 
			
		||||
        Native.astMapErase(getContext().nCtx(), getNativeObject(), k.getNativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Removes all keys from the map.
 | 
			
		||||
     **/
 | 
			
		||||
    public void Reset() throws Z3Exception
 | 
			
		||||
    public void reset() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Native.astMapReset(Context().nCtx(), NativeObject());
 | 
			
		||||
        Native.astMapReset(getContext().nCtx(), getNativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * The size of the map
 | 
			
		||||
     **/
 | 
			
		||||
    public int Size() throws Z3Exception
 | 
			
		||||
    public int size() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Native.astMapSize(Context().nCtx(), NativeObject());
 | 
			
		||||
        return Native.astMapSize(getContext().nCtx(), getNativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
| 
						 | 
				
			
			@ -80,10 +80,10 @@ class ASTMap extends Z3Object
 | 
			
		|||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public ASTVector Keys() throws Z3Exception
 | 
			
		||||
    public ASTVector getKeys() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return new ASTVector(Context(), Native.astMapKeys(Context().nCtx(),
 | 
			
		||||
                NativeObject()));
 | 
			
		||||
        return new ASTVector(getContext(), Native.astMapKeys(getContext().nCtx(),
 | 
			
		||||
                getNativeObject()));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
| 
						 | 
				
			
			@ -93,7 +93,7 @@ class ASTMap extends Z3Object
 | 
			
		|||
    {
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
            return Native.astMapToString(Context().nCtx(), NativeObject());
 | 
			
		||||
            return Native.astMapToString(getContext().nCtx(), getNativeObject());
 | 
			
		||||
        } catch (Z3Exception e)
 | 
			
		||||
        {
 | 
			
		||||
            return "Z3Exception: " + e.getMessage();
 | 
			
		||||
| 
						 | 
				
			
			@ -110,15 +110,15 @@ class ASTMap extends Z3Object
 | 
			
		|||
        super(ctx, Native.mkAstMap(ctx.nCtx()));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    void IncRef(long o) throws Z3Exception
 | 
			
		||||
    void incRef(long o) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Context().ASTMap_DRQ().IncAndClear(Context(), o);
 | 
			
		||||
        super.IncRef(o);
 | 
			
		||||
        getContext().astmap_DRQ().incAndClear(getContext(), o);
 | 
			
		||||
        super.incRef(o);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    void DecRef(long o) throws Z3Exception
 | 
			
		||||
    void decRef(long o) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Context().ASTMap_DRQ().Add(o);
 | 
			
		||||
        super.DecRef(o);
 | 
			
		||||
        getContext().astmap_DRQ().add(o);
 | 
			
		||||
        super.decRef(o);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -14,9 +14,9 @@ class ASTVector extends Z3Object
 | 
			
		|||
    /**
 | 
			
		||||
     * The size of the vector
 | 
			
		||||
     **/
 | 
			
		||||
    public int Size() throws Z3Exception
 | 
			
		||||
    public int size() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Native.astVectorSize(Context().nCtx(), NativeObject());
 | 
			
		||||
        return Native.astVectorSize(getContext().nCtx(), getNativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
| 
						 | 
				
			
			@ -29,33 +29,33 @@ class ASTVector extends Z3Object
 | 
			
		|||
     **/
 | 
			
		||||
    public AST get(int i) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return new AST(Context(), Native.astVectorGet(Context().nCtx(),
 | 
			
		||||
                NativeObject(), i));
 | 
			
		||||
        return new AST(getContext(), Native.astVectorGet(getContext().nCtx(),
 | 
			
		||||
                getNativeObject(), i));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void set(int i, AST value) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
        Native.astVectorSet(Context().nCtx(), NativeObject(), i,
 | 
			
		||||
                value.NativeObject());
 | 
			
		||||
        Native.astVectorSet(getContext().nCtx(), getNativeObject(), i,
 | 
			
		||||
                value.getNativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Resize the vector to <paramref name="newSize"/>. <param
 | 
			
		||||
     * name="newSize">The new size of the vector.</param>
 | 
			
		||||
     **/
 | 
			
		||||
    public void Resize(int newSize) throws Z3Exception
 | 
			
		||||
    public void resize(int newSize) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Native.astVectorResize(Context().nCtx(), NativeObject(), newSize);
 | 
			
		||||
        Native.astVectorResize(getContext().nCtx(), getNativeObject(), newSize);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Add the AST <paramref name="a"/> to the back of the vector. The size is
 | 
			
		||||
     * increased by 1. <param name="a">An AST</param>
 | 
			
		||||
     **/
 | 
			
		||||
    public void Push(AST a) throws Z3Exception
 | 
			
		||||
    public void push(AST a) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Native.astVectorPush(Context().nCtx(), NativeObject(), a.NativeObject());
 | 
			
		||||
        Native.astVectorPush(getContext().nCtx(), getNativeObject(), a.getNativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
| 
						 | 
				
			
			@ -65,10 +65,10 @@ class ASTVector extends Z3Object
 | 
			
		|||
     * @return A new ASTVector
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public ASTVector Translate(Context ctx) throws Z3Exception
 | 
			
		||||
    public ASTVector translate(Context ctx) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return new ASTVector(Context(), Native.astVectorTranslate(Context()
 | 
			
		||||
                .nCtx(), NativeObject(), ctx.nCtx()));
 | 
			
		||||
        return new ASTVector(getContext(), Native.astVectorTranslate(getContext()
 | 
			
		||||
                .nCtx(), getNativeObject(), ctx.nCtx()));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
| 
						 | 
				
			
			@ -78,7 +78,7 @@ class ASTVector extends Z3Object
 | 
			
		|||
    {
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
            return Native.astVectorToString(Context().nCtx(), NativeObject());
 | 
			
		||||
            return Native.astVectorToString(getContext().nCtx(), getNativeObject());
 | 
			
		||||
        } catch (Z3Exception e)
 | 
			
		||||
        {
 | 
			
		||||
            return "Z3Exception: " + e.getMessage();
 | 
			
		||||
| 
						 | 
				
			
			@ -95,15 +95,15 @@ class ASTVector extends Z3Object
 | 
			
		|||
        super(ctx, Native.mkAstVector(ctx.nCtx()));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    void IncRef(long o) throws Z3Exception
 | 
			
		||||
    void incRef(long o) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Context().ASTVector_DRQ().IncAndClear(Context(), o);
 | 
			
		||||
        super.IncRef(o);
 | 
			
		||||
        getContext().astvector_DRQ().incAndClear(getContext(), o);
 | 
			
		||||
        super.incRef(o);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    void DecRef(long o) throws Z3Exception
 | 
			
		||||
    void decRef(long o) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Context().ASTVector_DRQ().Add(o);
 | 
			
		||||
        super.DecRef(o);
 | 
			
		||||
        getContext().astvector_DRQ().add(o);
 | 
			
		||||
        super.decRef(o);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -19,11 +19,11 @@ public class AlgebraicNum extends ArithExpr
 | 
			
		|||
	 * 
 | 
			
		||||
	 * @return A numeral Expr of sort Real
 | 
			
		||||
	 **/
 | 
			
		||||
	public RatNum ToUpper(int precision) throws Z3Exception
 | 
			
		||||
	public RatNum toUpper(int precision) throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
 | 
			
		||||
		return new RatNum(Context(), Native.getAlgebraicNumberUpper(Context()
 | 
			
		||||
				.nCtx(), NativeObject(), precision));
 | 
			
		||||
		return new RatNum(getContext(), Native.getAlgebraicNumberUpper(getContext()
 | 
			
		||||
				.nCtx(), getNativeObject(), precision));
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
| 
						 | 
				
			
			@ -33,21 +33,21 @@ public class AlgebraicNum extends ArithExpr
 | 
			
		|||
	 * 
 | 
			
		||||
	 * @return A numeral Expr of sort Real
 | 
			
		||||
	 **/
 | 
			
		||||
	public RatNum ToLower(int precision) throws Z3Exception
 | 
			
		||||
	public RatNum toLower(int precision) throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
 | 
			
		||||
		return new RatNum(Context(), Native.getAlgebraicNumberLower(Context()
 | 
			
		||||
				.nCtx(), NativeObject(), precision));
 | 
			
		||||
		return new RatNum(getContext(), Native.getAlgebraicNumberLower(getContext()
 | 
			
		||||
				.nCtx(), getNativeObject(), precision));
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Returns a string representation in decimal notation. <remarks>The result
 | 
			
		||||
	 * has at most <paramref name="precision"/> decimal places.</remarks>
 | 
			
		||||
	 **/
 | 
			
		||||
	public String ToDecimal(int precision) throws Z3Exception
 | 
			
		||||
	public String toDecimal(int precision) throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
 | 
			
		||||
		return Native.getNumeralDecimalString(Context().nCtx(), NativeObject(),
 | 
			
		||||
		return Native.getNumeralDecimalString(getContext().nCtx(), getNativeObject(),
 | 
			
		||||
				precision);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -15,10 +15,10 @@ public class ApplyResult extends Z3Object
 | 
			
		|||
    /**
 | 
			
		||||
     * The number of Subgoals.
 | 
			
		||||
     **/
 | 
			
		||||
    public int NumSubgoals() throws Z3Exception
 | 
			
		||||
    public int getNumSubgoals() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Native.applyResultGetNumSubgoals(Context().nCtx(),
 | 
			
		||||
                NativeObject());
 | 
			
		||||
        return Native.applyResultGetNumSubgoals(getContext().nCtx(),
 | 
			
		||||
                getNativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
| 
						 | 
				
			
			@ -26,13 +26,13 @@ public class ApplyResult extends Z3Object
 | 
			
		|||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public Goal[] Subgoals() throws Z3Exception
 | 
			
		||||
    public Goal[] getSubgoals() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        int n = NumSubgoals();
 | 
			
		||||
        int n = getNumSubgoals();
 | 
			
		||||
        Goal[] res = new Goal[n];
 | 
			
		||||
        for (int i = 0; i < n; i++)
 | 
			
		||||
            res[i] = new Goal(Context(), Native.applyResultGetSubgoal(Context()
 | 
			
		||||
                    .nCtx(), NativeObject(), i));
 | 
			
		||||
            res[i] = new Goal(getContext(), 
 | 
			
		||||
                Native.applyResultGetSubgoal(getContext().nCtx(), getNativeObject(), i));
 | 
			
		||||
        return res;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -43,10 +43,10 @@ public class ApplyResult extends Z3Object
 | 
			
		|||
     * @return A model for <code>g</code>
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public Model ConvertModel(int i, Model m) throws Z3Exception
 | 
			
		||||
    public Model convertModel(int i, Model m) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return new Model(Context(), Native.applyResultConvertModel(Context()
 | 
			
		||||
                .nCtx(), NativeObject(), i, m.NativeObject()));
 | 
			
		||||
        return new Model(getContext(), 
 | 
			
		||||
            Native.applyResultConvertModel(getContext().nCtx(), getNativeObject(), i, m.getNativeObject()));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
| 
						 | 
				
			
			@ -56,7 +56,7 @@ public class ApplyResult extends Z3Object
 | 
			
		|||
    {
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
            return Native.applyResultToString(Context().nCtx(), NativeObject());
 | 
			
		||||
            return Native.applyResultToString(getContext().nCtx(), getNativeObject());
 | 
			
		||||
        } catch (Z3Exception e)
 | 
			
		||||
        {
 | 
			
		||||
            return "Z3Exception: " + e.getMessage();
 | 
			
		||||
| 
						 | 
				
			
			@ -68,15 +68,15 @@ public class ApplyResult extends Z3Object
 | 
			
		|||
        super(ctx, obj);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    void IncRef(long o) throws Z3Exception
 | 
			
		||||
    void incRef(long o) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Context().ApplyResult_DRQ().IncAndClear(Context(), o);
 | 
			
		||||
        super.IncRef(o);
 | 
			
		||||
        getContext().applyResult_DRQ().incAndClear(getContext(), o);
 | 
			
		||||
        super.incRef(o);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    void DecRef(long o) throws Z3Exception
 | 
			
		||||
    void decRef(long o) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Context().ApplyResult_DRQ().Add(o);
 | 
			
		||||
        super.DecRef(o);
 | 
			
		||||
        getContext().applyResult_DRQ().add(o);
 | 
			
		||||
        super.decRef(o);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -7,7 +7,7 @@ package com.microsoft.z3;
 | 
			
		|||
 | 
			
		||||
class ApplyResultDecRefQueue extends IDecRefQueue
 | 
			
		||||
{
 | 
			
		||||
    public void IncRef(Context ctx, long obj)
 | 
			
		||||
    protected void incRef(Context ctx, long obj)
 | 
			
		||||
    {
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
| 
						 | 
				
			
			@ -18,7 +18,7 @@ class ApplyResultDecRefQueue extends IDecRefQueue
 | 
			
		|||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void DecRef(Context ctx, long obj)
 | 
			
		||||
    protected void decRef(Context ctx, long obj)
 | 
			
		||||
    {
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -15,20 +15,20 @@ public class ArraySort extends Sort
 | 
			
		|||
	 * The domain of the array sort.
 | 
			
		||||
	 * @throws Z3Exception 
 | 
			
		||||
	 **/
 | 
			
		||||
	public Sort Domain() throws Z3Exception
 | 
			
		||||
	public Sort getDomain() throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		return Sort.Create(Context(),
 | 
			
		||||
				Native.getArraySortDomain(Context().nCtx(), NativeObject()));
 | 
			
		||||
		return Sort.create(getContext(),
 | 
			
		||||
				Native.getArraySortDomain(getContext().nCtx(), getNativeObject()));
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * The range of the array sort.
 | 
			
		||||
	 * @throws Z3Exception 
 | 
			
		||||
	 **/
 | 
			
		||||
	public Sort Range() throws Z3Exception
 | 
			
		||||
	public Sort getRange() throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		return Sort.Create(Context(),
 | 
			
		||||
				Native.getArraySortRange(Context().nCtx(), NativeObject()));
 | 
			
		||||
		return Sort.create(getContext(),
 | 
			
		||||
				Native.getArraySortRange(getContext().nCtx(), getNativeObject()));
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	ArraySort(Context ctx, long obj) throws Z3Exception
 | 
			
		||||
| 
						 | 
				
			
			@ -38,7 +38,7 @@ public class ArraySort extends Sort
 | 
			
		|||
 | 
			
		||||
	ArraySort(Context ctx, Sort domain, Sort range) throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		super(ctx, Native.mkArraySort(ctx.nCtx(), domain.NativeObject(),
 | 
			
		||||
				range.NativeObject()));
 | 
			
		||||
		super(ctx, Native.mkArraySort(ctx.nCtx(), domain.getNativeObject(),
 | 
			
		||||
				range.getNativeObject()));
 | 
			
		||||
	}
 | 
			
		||||
};
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -7,7 +7,7 @@ package com.microsoft.z3;
 | 
			
		|||
 | 
			
		||||
class ASTMapDecRefQueue extends IDecRefQueue
 | 
			
		||||
{
 | 
			
		||||
    public void IncRef(Context ctx, long obj)
 | 
			
		||||
    protected void incRef(Context ctx, long obj)
 | 
			
		||||
    {
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
| 
						 | 
				
			
			@ -18,7 +18,7 @@ class ASTMapDecRefQueue extends IDecRefQueue
 | 
			
		|||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void DecRef(Context ctx, long obj)
 | 
			
		||||
    protected void decRef(Context ctx, long obj)
 | 
			
		||||
    {
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -7,7 +7,7 @@ package com.microsoft.z3;
 | 
			
		|||
 | 
			
		||||
class ASTVectorDecRefQueue extends IDecRefQueue
 | 
			
		||||
{
 | 
			
		||||
    public void IncRef(Context ctx, long obj)
 | 
			
		||||
    protected void incRef(Context ctx, long obj)
 | 
			
		||||
    {
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
| 
						 | 
				
			
			@ -18,7 +18,7 @@ class ASTVectorDecRefQueue extends IDecRefQueue
 | 
			
		|||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void DecRef(Context ctx, long obj)
 | 
			
		||||
    protected void decRef(Context ctx, long obj)
 | 
			
		||||
    {
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -16,15 +16,15 @@ public class BitVecExpr extends Expr
 | 
			
		|||
	 * The size of the sort of a bit-vector term.
 | 
			
		||||
	 * @throws Z3Exception 
 | 
			
		||||
	 **/
 | 
			
		||||
	public int SortSize() throws Z3Exception
 | 
			
		||||
	public int getSortSize() throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		return ((BitVecSort) Sort()).Size();
 | 
			
		||||
		return ((BitVecSort) getSort()).getSize();
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Constructor for BitVecExpr </summary>
 | 
			
		||||
	 **/
 | 
			
		||||
	protected BitVecExpr(Context ctx)
 | 
			
		||||
	BitVecExpr(Context ctx)
 | 
			
		||||
	{
 | 
			
		||||
		super(ctx);
 | 
			
		||||
	}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -18,10 +18,10 @@ public class BitVecNum extends BitVecExpr
 | 
			
		|||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public int Int() throws Z3Exception
 | 
			
		||||
    public int getInt() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Native.IntPtr res = new Native.IntPtr();
 | 
			
		||||
        if (Native.getNumeralInt(Context().nCtx(), NativeObject(), res) ^ true)
 | 
			
		||||
        if (Native.getNumeralInt(getContext().nCtx(), getNativeObject(), res) ^ true)
 | 
			
		||||
            throw new Z3Exception("Numeral is not an int");
 | 
			
		||||
        return res.value;
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			@ -31,10 +31,10 @@ public class BitVecNum extends BitVecExpr
 | 
			
		|||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public long Long() throws Z3Exception
 | 
			
		||||
    public long getLong() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Native.LongPtr res = new Native.LongPtr();
 | 
			
		||||
        if (Native.getNumeralInt64(Context().nCtx(), NativeObject(), res) ^ true)
 | 
			
		||||
        if (Native.getNumeralInt64(getContext().nCtx(), getNativeObject(), res) ^ true)
 | 
			
		||||
            throw new Z3Exception("Numeral is not an int64");
 | 
			
		||||
        return res.value;
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			@ -42,7 +42,7 @@ public class BitVecNum extends BitVecExpr
 | 
			
		|||
    /**
 | 
			
		||||
     * Retrieve the BigInteger value.
 | 
			
		||||
     **/
 | 
			
		||||
    public BigInteger BigInteger()
 | 
			
		||||
    public BigInteger getBigInteger()
 | 
			
		||||
    {
 | 
			
		||||
        return new BigInteger(this.toString());
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			@ -54,7 +54,7 @@ public class BitVecNum extends BitVecExpr
 | 
			
		|||
    {
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
            return Native.getNumeralString(Context().nCtx(), NativeObject());
 | 
			
		||||
            return Native.getNumeralString(getContext().nCtx(), getNativeObject());
 | 
			
		||||
        } catch (Z3Exception e)
 | 
			
		||||
        {
 | 
			
		||||
            return "Z3Exception: " + e.getMessage();
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -13,9 +13,9 @@ public class BitVecSort extends Sort
 | 
			
		|||
	/**
 | 
			
		||||
	 * The size of the bit-vector sort.
 | 
			
		||||
	 **/
 | 
			
		||||
	public int Size() throws Z3Exception
 | 
			
		||||
	public int getSize() throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		return Native.getBvSortSize(Context().nCtx(), NativeObject());
 | 
			
		||||
		return Native.getBvSortSize(getContext().nCtx(), getNativeObject());
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	BitVecSort(Context ctx, long obj) throws Z3Exception
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -15,7 +15,7 @@ public class Constructor extends Z3Object
 | 
			
		|||
	 * The number of fields of the constructor.
 | 
			
		||||
	 * @throws Z3Exception 
 | 
			
		||||
	 **/
 | 
			
		||||
	public int NumFields() throws Z3Exception
 | 
			
		||||
	public int getNumFields() throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		init();
 | 
			
		||||
		return n;
 | 
			
		||||
| 
						 | 
				
			
			@ -35,7 +35,7 @@ public class Constructor extends Z3Object
 | 
			
		|||
	 * The function declaration of the tester.
 | 
			
		||||
	 * @throws Z3Exception 
 | 
			
		||||
	 **/
 | 
			
		||||
	public FuncDecl TesterDecl() throws Z3Exception
 | 
			
		||||
	public FuncDecl getTesterDecl() throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		init();
 | 
			
		||||
		return m_testerDecl;
 | 
			
		||||
| 
						 | 
				
			
			@ -45,7 +45,7 @@ public class Constructor extends Z3Object
 | 
			
		|||
	 * The function declarations of the accessors
 | 
			
		||||
	 * @throws Z3Exception 
 | 
			
		||||
	 **/
 | 
			
		||||
	public FuncDecl[] AccessorDecls() throws Z3Exception
 | 
			
		||||
	public FuncDecl[] getAccessorDecls() throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		init();
 | 
			
		||||
		return m_accessorDecls;
 | 
			
		||||
| 
						 | 
				
			
			@ -56,7 +56,7 @@ public class Constructor extends Z3Object
 | 
			
		|||
	 **/
 | 
			
		||||
	protected void finalize() throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		Native.delConstructor(Context().nCtx(), NativeObject());
 | 
			
		||||
		Native.delConstructor(getContext().nCtx(), getNativeObject());
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	private int n = 0;
 | 
			
		||||
| 
						 | 
				
			
			@ -70,9 +70,9 @@ public class Constructor extends Z3Object
 | 
			
		|||
	{
 | 
			
		||||
		super(ctx);
 | 
			
		||||
 | 
			
		||||
		n = AST.ArrayLength(fieldNames);
 | 
			
		||||
		n = AST.arrayLength(fieldNames);
 | 
			
		||||
 | 
			
		||||
		if (n != AST.ArrayLength(sorts))
 | 
			
		||||
		if (n != AST.arrayLength(sorts))
 | 
			
		||||
			throw new Z3Exception(
 | 
			
		||||
					"Number of field names does not match number of sorts");
 | 
			
		||||
		if (sortRefs != null && sortRefs.length != n)
 | 
			
		||||
| 
						 | 
				
			
			@ -82,9 +82,9 @@ public class Constructor extends Z3Object
 | 
			
		|||
		if (sortRefs == null)
 | 
			
		||||
			sortRefs = new int[n];
 | 
			
		||||
 | 
			
		||||
		setNativeObject(Native.mkConstructor(ctx.nCtx(), name.NativeObject(),
 | 
			
		||||
				recognizer.NativeObject(), 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));
 | 
			
		||||
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -95,13 +95,13 @@ public class Constructor extends Z3Object
 | 
			
		|||
		Native.LongPtr constructor = new Native.LongPtr();
 | 
			
		||||
		Native.LongPtr tester = new Native.LongPtr();
 | 
			
		||||
		long[] accessors = new long[n];
 | 
			
		||||
		Native.queryConstructor(Context().nCtx(), NativeObject(), n,
 | 
			
		||||
		Native.queryConstructor(getContext().nCtx(), getNativeObject(), n,
 | 
			
		||||
				constructor, tester, accessors);
 | 
			
		||||
		m_constructorDecl = new FuncDecl(Context(), constructor.value);
 | 
			
		||||
		m_testerDecl = new FuncDecl(Context(), tester.value);
 | 
			
		||||
		m_constructorDecl = new FuncDecl(getContext(), constructor.value);
 | 
			
		||||
		m_testerDecl = new FuncDecl(getContext(), tester.value);
 | 
			
		||||
		m_accessorDecls = new FuncDecl[n];
 | 
			
		||||
		for (int i = 0; i < n; i++)
 | 
			
		||||
			m_accessorDecls[i] = new FuncDecl(Context(), accessors[i]);
 | 
			
		||||
			m_accessorDecls[i] = new FuncDecl(getContext(), accessors[i]);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -16,7 +16,7 @@ public class ConstructorList extends Z3Object
 | 
			
		|||
	 **/
 | 
			
		||||
	protected void finalize() throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		Native.delConstructorList(Context().nCtx(), NativeObject());
 | 
			
		||||
		Native.delConstructorList(getContext().nCtx(), getNativeObject());
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	ConstructorList(Context ctx, long obj) throws Z3Exception
 | 
			
		||||
| 
						 | 
				
			
			@ -28,8 +28,8 @@ public class ConstructorList extends Z3Object
 | 
			
		|||
	{
 | 
			
		||||
		super(ctx);
 | 
			
		||||
 | 
			
		||||
		setNativeObject(Native.mkConstructorList(Context().nCtx(),
 | 
			
		||||
		setNativeObject(Native.mkConstructorList(getContext().nCtx(),
 | 
			
		||||
				(int) constructors.length,
 | 
			
		||||
				Constructor.ArrayToNative(constructors)));
 | 
			
		||||
				Constructor.arrayToNative(constructors)));
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
										
											
												File diff suppressed because it is too large
												Load diff
											
										
									
								
							| 
						 | 
				
			
			@ -14,10 +14,10 @@ public class DatatypeSort extends Sort
 | 
			
		|||
	/**
 | 
			
		||||
	 * The number of constructors of the datatype sort.
 | 
			
		||||
	 **/
 | 
			
		||||
	public int NumConstructors() throws Z3Exception
 | 
			
		||||
	public int getNumConstructors() throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		return Native.getDatatypeSortNumConstructors(Context().nCtx(),
 | 
			
		||||
				NativeObject());
 | 
			
		||||
		return Native.getDatatypeSortNumConstructors(getContext().nCtx(),
 | 
			
		||||
				getNativeObject());
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
| 
						 | 
				
			
			@ -25,13 +25,13 @@ public class DatatypeSort extends Sort
 | 
			
		|||
	 * 
 | 
			
		||||
	 * @throws Z3Exception
 | 
			
		||||
	 **/
 | 
			
		||||
	public FuncDecl[] Constructors() throws Z3Exception
 | 
			
		||||
	public FuncDecl[] getConstructors() throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		int n = NumConstructors();
 | 
			
		||||
		int n = getNumConstructors();
 | 
			
		||||
		FuncDecl[] res = new FuncDecl[n];
 | 
			
		||||
		for (int i = 0; i < n; i++)
 | 
			
		||||
			res[i] = new FuncDecl(Context(), Native.getDatatypeSortConstructor(
 | 
			
		||||
					Context().nCtx(), NativeObject(), i));
 | 
			
		||||
			res[i] = new FuncDecl(getContext(), Native.getDatatypeSortConstructor(
 | 
			
		||||
					getContext().nCtx(), getNativeObject(), i));
 | 
			
		||||
		return res;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -40,13 +40,13 @@ public class DatatypeSort extends Sort
 | 
			
		|||
	 * 
 | 
			
		||||
	 * @throws Z3Exception
 | 
			
		||||
	 **/
 | 
			
		||||
	public FuncDecl[] Recognizers() throws Z3Exception
 | 
			
		||||
	public FuncDecl[] getRecognizers() throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		int n = NumConstructors();
 | 
			
		||||
		int n = getNumConstructors();
 | 
			
		||||
		FuncDecl[] res = new FuncDecl[n];
 | 
			
		||||
		for (int i = 0; i < n; i++)
 | 
			
		||||
			res[i] = new FuncDecl(Context(), Native.getDatatypeSortRecognizer(
 | 
			
		||||
					Context().nCtx(), NativeObject(), i));
 | 
			
		||||
			res[i] = new FuncDecl(getContext(), Native.getDatatypeSortRecognizer(
 | 
			
		||||
					getContext().nCtx(), getNativeObject(), i));
 | 
			
		||||
		return res;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -55,22 +55,22 @@ public class DatatypeSort extends Sort
 | 
			
		|||
	 * 
 | 
			
		||||
	 * @throws Z3Exception
 | 
			
		||||
	 **/
 | 
			
		||||
	public FuncDecl[][] Accessors() throws Z3Exception
 | 
			
		||||
	public FuncDecl[][] getAccessors() throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
 | 
			
		||||
		int n = NumConstructors();
 | 
			
		||||
		int n = getNumConstructors();
 | 
			
		||||
		FuncDecl[][] res = new FuncDecl[n][];
 | 
			
		||||
		for (int i = 0; i < n; i++)
 | 
			
		||||
		{
 | 
			
		||||
			FuncDecl fd = new FuncDecl(Context(),
 | 
			
		||||
					Native.getDatatypeSortConstructor(Context().nCtx(),
 | 
			
		||||
							NativeObject(), i));
 | 
			
		||||
			int ds = fd.DomainSize();
 | 
			
		||||
			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(Context(),
 | 
			
		||||
						Native.getDatatypeSortConstructorAccessor(Context()
 | 
			
		||||
								.nCtx(), NativeObject(), i, j));
 | 
			
		||||
				tmp[j] = new FuncDecl(getContext(),
 | 
			
		||||
						Native.getDatatypeSortConstructorAccessor(getContext()
 | 
			
		||||
								.nCtx(), getNativeObject(), i, j));
 | 
			
		||||
			res[i] = tmp;
 | 
			
		||||
		}
 | 
			
		||||
		return res;
 | 
			
		||||
| 
						 | 
				
			
			@ -84,8 +84,8 @@ public class DatatypeSort extends Sort
 | 
			
		|||
	DatatypeSort(Context ctx, Symbol name, Constructor[] constructors)
 | 
			
		||||
			throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		super(ctx, Native.mkDatatype(ctx.nCtx(), name.NativeObject(),
 | 
			
		||||
				(int) constructors.length, ArrayToNative(constructors)));
 | 
			
		||||
		super(ctx, Native.mkDatatype(ctx.nCtx(), name.getNativeObject(),
 | 
			
		||||
				(int) constructors.length, arrayToNative(constructors)));
 | 
			
		||||
 | 
			
		||||
	}
 | 
			
		||||
};
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -14,7 +14,7 @@ public class EnumSort extends Sort
 | 
			
		|||
	/**
 | 
			
		||||
	 * The function declarations of the constants in the enumeration.
 | 
			
		||||
	 **/
 | 
			
		||||
	public FuncDecl[] ConstDecls()
 | 
			
		||||
	public FuncDecl[] getConstDecls()
 | 
			
		||||
	{
 | 
			
		||||
		return _constdecls;
 | 
			
		||||
	}
 | 
			
		||||
| 
						 | 
				
			
			@ -22,7 +22,7 @@ public class EnumSort extends Sort
 | 
			
		|||
	/**
 | 
			
		||||
	 * The constants in the enumeration.
 | 
			
		||||
	 **/
 | 
			
		||||
	public Expr[] Consts()
 | 
			
		||||
	public Expr[] getConsts()
 | 
			
		||||
	{
 | 
			
		||||
		return _consts;
 | 
			
		||||
	}
 | 
			
		||||
| 
						 | 
				
			
			@ -30,7 +30,7 @@ public class EnumSort extends Sort
 | 
			
		|||
	/**
 | 
			
		||||
	 * The test predicates for the constants in the enumeration.
 | 
			
		||||
	 **/
 | 
			
		||||
	public FuncDecl[] TesterDecls()
 | 
			
		||||
	public FuncDecl[] getTesterDecls()
 | 
			
		||||
	{
 | 
			
		||||
		return _testerdecls;
 | 
			
		||||
	}
 | 
			
		||||
| 
						 | 
				
			
			@ -46,7 +46,7 @@ public class EnumSort extends Sort
 | 
			
		|||
		long[] n_constdecls = new long[n];
 | 
			
		||||
		long[] n_testers = new long[n];
 | 
			
		||||
		setNativeObject(Native.mkEnumerationSort(ctx.nCtx(),
 | 
			
		||||
				name.NativeObject(), (int) n, Symbol.ArrayToNative(enumNames),
 | 
			
		||||
				name.getNativeObject(), (int) n, Symbol.arrayToNative(enumNames),
 | 
			
		||||
				n_constdecls, n_testers));
 | 
			
		||||
		_constdecls = new FuncDecl[n];
 | 
			
		||||
		for (int i = 0; i < n; i++)
 | 
			
		||||
| 
						 | 
				
			
			@ -56,6 +56,6 @@ public class EnumSort extends Sort
 | 
			
		|||
		    _testerdecls[i] = new FuncDecl(ctx, n_testers[i]);
 | 
			
		||||
		_consts = new Expr[n];
 | 
			
		||||
		for (int i = 0; i < n; i++)
 | 
			
		||||
		    _consts[i] = ctx.MkApp(_constdecls[i], (Expr[])null);
 | 
			
		||||
		    _consts[i] = ctx.mkApp(_constdecls[i], (Expr[])null);
 | 
			
		||||
	}
 | 
			
		||||
};
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
										
											
												File diff suppressed because it is too large
												Load diff
											
										
									
								
							| 
						 | 
				
			
			@ -14,10 +14,10 @@ public class FiniteDomainSort extends Sort
 | 
			
		|||
	/**
 | 
			
		||||
	 * The size of the finite domain sort.
 | 
			
		||||
	 **/
 | 
			
		||||
	public long Size() throws Z3Exception
 | 
			
		||||
	public long getSize() throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		Native.LongPtr res = new Native.LongPtr();
 | 
			
		||||
		Native.getFiniteDomainSortSize(Context().nCtx(), NativeObject(), res);
 | 
			
		||||
		Native.getFiniteDomainSortSize(getContext().nCtx(), getNativeObject(), res);
 | 
			
		||||
		return res.value;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -28,7 +28,7 @@ public class FiniteDomainSort extends Sort
 | 
			
		|||
 | 
			
		||||
	FiniteDomainSort(Context ctx, Symbol name, long size) throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		super(ctx, Native.mkFiniteDomainSort(ctx.nCtx(), name.NativeObject(),
 | 
			
		||||
		super(ctx, Native.mkFiniteDomainSort(ctx.nCtx(), name.getNativeObject(),
 | 
			
		||||
				size));
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -6,7 +6,7 @@
 | 
			
		|||
 | 
			
		||||
package com.microsoft.z3;
 | 
			
		||||
 | 
			
		||||
import com.microsoft.z3.enumerations.*;
 | 
			
		||||
import com.microsoft.z3.enumerations.Z3_lbool;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Object for managing fixedpoints
 | 
			
		||||
| 
						 | 
				
			
			@ -17,9 +17,9 @@ public class Fixedpoint extends Z3Object
 | 
			
		|||
    /**
 | 
			
		||||
     * A string that describes all available fixedpoint solver parameters.
 | 
			
		||||
     **/
 | 
			
		||||
    public String Help() throws Z3Exception
 | 
			
		||||
    public String getHelp() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Native.fixedpointGetHelp(Context().nCtx(), NativeObject());
 | 
			
		||||
        return Native.fixedpointGetHelp(getContext().nCtx(), getNativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
| 
						 | 
				
			
			@ -30,9 +30,9 @@ public class Fixedpoint extends Z3Object
 | 
			
		|||
    public void setParameters(Params value) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
        Context().CheckContextMatch(value);
 | 
			
		||||
        Native.fixedpointSetParams(Context().nCtx(), NativeObject(),
 | 
			
		||||
                value.NativeObject());
 | 
			
		||||
        getContext().checkContextMatch(value);
 | 
			
		||||
        Native.fixedpointSetParams(getContext().nCtx(), getNativeObject(),
 | 
			
		||||
                value.getNativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
| 
						 | 
				
			
			@ -40,10 +40,10 @@ public class Fixedpoint extends Z3Object
 | 
			
		|||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public ParamDescrs ParameterDescriptions() throws Z3Exception
 | 
			
		||||
    public ParamDescrs getParameterDescriptions() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return new ParamDescrs(Context(), Native.fixedpointGetParamDescrs(
 | 
			
		||||
                Context().nCtx(), NativeObject()));
 | 
			
		||||
        return new ParamDescrs(getContext(), Native.fixedpointGetParamDescrs(
 | 
			
		||||
                getContext().nCtx(), getNativeObject()));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
| 
						 | 
				
			
			@ -51,13 +51,13 @@ public class Fixedpoint extends Z3Object
 | 
			
		|||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public void Assert(BoolExpr[] constraints) throws Z3Exception
 | 
			
		||||
    public void assert_(BoolExpr ... constraints) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Context().CheckContextMatch(constraints);
 | 
			
		||||
        getContext().checkContextMatch(constraints);
 | 
			
		||||
        for (BoolExpr a : constraints)
 | 
			
		||||
        {
 | 
			
		||||
            Native.fixedpointAssert(Context().nCtx(), NativeObject(),
 | 
			
		||||
                    a.NativeObject());
 | 
			
		||||
            Native.fixedpointAssert(getContext().nCtx(), getNativeObject(),
 | 
			
		||||
                    a.getNativeObject());
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -66,12 +66,12 @@ public class Fixedpoint extends Z3Object
 | 
			
		|||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public void RegisterRelation(FuncDecl f) throws Z3Exception
 | 
			
		||||
    public void registerRelation(FuncDecl f) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
        Context().CheckContextMatch(f);
 | 
			
		||||
        Native.fixedpointRegisterRelation(Context().nCtx(), NativeObject(),
 | 
			
		||||
                f.NativeObject());
 | 
			
		||||
        getContext().checkContextMatch(f);
 | 
			
		||||
        Native.fixedpointRegisterRelation(getContext().nCtx(), getNativeObject(),
 | 
			
		||||
                f.getNativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
| 
						 | 
				
			
			@ -79,12 +79,12 @@ public class Fixedpoint extends Z3Object
 | 
			
		|||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public void AddRule(BoolExpr rule, Symbol name) throws Z3Exception
 | 
			
		||||
    public void addRule(BoolExpr rule, Symbol name) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
        Context().CheckContextMatch(rule);
 | 
			
		||||
        Native.fixedpointAddRule(Context().nCtx(), NativeObject(),
 | 
			
		||||
                rule.NativeObject(), AST.GetNativeObject(name));
 | 
			
		||||
        getContext().checkContextMatch(rule);
 | 
			
		||||
        Native.fixedpointAddRule(getContext().nCtx(), getNativeObject(),
 | 
			
		||||
                rule.getNativeObject(), AST.getNativeObject(name));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
| 
						 | 
				
			
			@ -92,12 +92,11 @@ public class Fixedpoint extends Z3Object
 | 
			
		|||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public void AddFact(FuncDecl pred, int[] args) throws Z3Exception
 | 
			
		||||
    public void addFact(FuncDecl pred, int ... args) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
        Context().CheckContextMatch(pred);
 | 
			
		||||
        Native.fixedpointAddFact(Context().nCtx(), NativeObject(),
 | 
			
		||||
                pred.NativeObject(), (int) args.length, args);
 | 
			
		||||
        getContext().checkContextMatch(pred);
 | 
			
		||||
        Native.fixedpointAddFact(getContext().nCtx(), getNativeObject(),
 | 
			
		||||
                pred.getNativeObject(), (int) args.length, args);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
| 
						 | 
				
			
			@ -109,12 +108,12 @@ public class Fixedpoint extends Z3Object
 | 
			
		|||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public Status Query(BoolExpr query) throws Z3Exception
 | 
			
		||||
    public Status query(BoolExpr query) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
        Context().CheckContextMatch(query);
 | 
			
		||||
        Z3_lbool r = Z3_lbool.fromInt(Native.fixedpointQuery(Context().nCtx(),
 | 
			
		||||
                NativeObject(), query.NativeObject()));
 | 
			
		||||
        getContext().checkContextMatch(query);
 | 
			
		||||
        Z3_lbool r = Z3_lbool.fromInt(Native.fixedpointQuery(getContext().nCtx(),
 | 
			
		||||
                getNativeObject(), query.getNativeObject()));
 | 
			
		||||
        switch (r)
 | 
			
		||||
        {
 | 
			
		||||
        case Z3_L_TRUE:
 | 
			
		||||
| 
						 | 
				
			
			@ -134,13 +133,13 @@ public class Fixedpoint extends Z3Object
 | 
			
		|||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public Status Query(FuncDecl[] relations) throws Z3Exception
 | 
			
		||||
    public Status query(FuncDecl[] relations) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
        Context().CheckContextMatch(relations);
 | 
			
		||||
        Z3_lbool r = Z3_lbool.fromInt(Native.fixedpointQueryRelations(Context()
 | 
			
		||||
                .nCtx(), NativeObject(), AST.ArrayLength(relations), AST
 | 
			
		||||
                .ArrayToNative(relations)));
 | 
			
		||||
        getContext().checkContextMatch(relations);
 | 
			
		||||
        Z3_lbool r = Z3_lbool.fromInt(Native.fixedpointQueryRelations(getContext()
 | 
			
		||||
                .nCtx(), getNativeObject(), AST.arrayLength(relations), AST
 | 
			
		||||
                .arrayToNative(relations)));
 | 
			
		||||
        switch (r)
 | 
			
		||||
        {
 | 
			
		||||
        case Z3_L_TRUE:
 | 
			
		||||
| 
						 | 
				
			
			@ -155,9 +154,9 @@ public class Fixedpoint extends Z3Object
 | 
			
		|||
    /**
 | 
			
		||||
     * Creates a backtracking point. <seealso cref="Pop"/>
 | 
			
		||||
     **/
 | 
			
		||||
    public void Push() throws Z3Exception
 | 
			
		||||
    public void push() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Native.fixedpointPush(Context().nCtx(), NativeObject());
 | 
			
		||||
        Native.fixedpointPush(getContext().nCtx(), getNativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
| 
						 | 
				
			
			@ -165,9 +164,9 @@ public class Fixedpoint extends Z3Object
 | 
			
		|||
     * thrown if Pop is called without a corresponding <code>Push</code>
 | 
			
		||||
     * </remarks> <seealso cref="Push"/>
 | 
			
		||||
     **/
 | 
			
		||||
    public void Pop() throws Z3Exception
 | 
			
		||||
    public void pop() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Native.fixedpointPop(Context().nCtx(), NativeObject());
 | 
			
		||||
        Native.fixedpointPop(getContext().nCtx(), getNativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
| 
						 | 
				
			
			@ -175,12 +174,12 @@ public class Fixedpoint extends Z3Object
 | 
			
		|||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public void UpdateRule(BoolExpr rule, Symbol name) throws Z3Exception
 | 
			
		||||
    public void updateRule(BoolExpr rule, Symbol name) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
        Context().CheckContextMatch(rule);
 | 
			
		||||
        Native.fixedpointUpdateRule(Context().nCtx(), NativeObject(),
 | 
			
		||||
                rule.NativeObject(), AST.GetNativeObject(name));
 | 
			
		||||
        getContext().checkContextMatch(rule);
 | 
			
		||||
        Native.fixedpointUpdateRule(getContext().nCtx(), getNativeObject(),
 | 
			
		||||
                rule.getNativeObject(), AST.getNativeObject(name));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
| 
						 | 
				
			
			@ -189,29 +188,29 @@ public class Fixedpoint extends Z3Object
 | 
			
		|||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public Expr GetAnswer() throws Z3Exception
 | 
			
		||||
    public Expr getAnswer() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        long ans = Native.fixedpointGetAnswer(Context().nCtx(), NativeObject());
 | 
			
		||||
        return (ans == 0) ? null : Expr.Create(Context(), ans);
 | 
			
		||||
        long ans = Native.fixedpointGetAnswer(getContext().nCtx(), getNativeObject());
 | 
			
		||||
        return (ans == 0) ? null : Expr.create(getContext(), ans);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Retrieve explanation why fixedpoint engine returned status Unknown.
 | 
			
		||||
     **/
 | 
			
		||||
    public String GetReasonUnknown() throws Z3Exception
 | 
			
		||||
    public String getReasonUnknown() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
        return Native.fixedpointGetReasonUnknown(Context().nCtx(),
 | 
			
		||||
                NativeObject());
 | 
			
		||||
        return Native.fixedpointGetReasonUnknown(getContext().nCtx(),
 | 
			
		||||
                getNativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Retrieve the number of levels explored for a given predicate.
 | 
			
		||||
     **/
 | 
			
		||||
    public int GetNumLevels(FuncDecl predicate) throws Z3Exception
 | 
			
		||||
    public int getNumLevels(FuncDecl predicate) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Native.fixedpointGetNumLevels(Context().nCtx(), NativeObject(),
 | 
			
		||||
                predicate.NativeObject());
 | 
			
		||||
        return Native.fixedpointGetNumLevels(getContext().nCtx(), getNativeObject(),
 | 
			
		||||
                predicate.getNativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
| 
						 | 
				
			
			@ -219,22 +218,22 @@ public class Fixedpoint extends Z3Object
 | 
			
		|||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public Expr GetCoverDelta(int level, FuncDecl predicate) throws Z3Exception
 | 
			
		||||
    public Expr getCoverDelta(int level, FuncDecl predicate) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        long res = Native.fixedpointGetCoverDelta(Context().nCtx(),
 | 
			
		||||
                NativeObject(), level, predicate.NativeObject());
 | 
			
		||||
        return (res == 0) ? null : Expr.Create(Context(), res);
 | 
			
		||||
        long res = Native.fixedpointGetCoverDelta(getContext().nCtx(),
 | 
			
		||||
                getNativeObject(), level, predicate.getNativeObject());
 | 
			
		||||
        return (res == 0) ? null : Expr.create(getContext(), res);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Add <tt>property</tt> about the <tt>predicate</tt>. The property is added
 | 
			
		||||
     * at <tt>level</tt>.
 | 
			
		||||
     **/
 | 
			
		||||
    public void AddCover(int level, FuncDecl predicate, Expr property)
 | 
			
		||||
    public void addCover(int level, FuncDecl predicate, Expr property)
 | 
			
		||||
            throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Native.fixedpointAddCover(Context().nCtx(), NativeObject(), level,
 | 
			
		||||
                predicate.NativeObject(), property.NativeObject());
 | 
			
		||||
        Native.fixedpointAddCover(getContext().nCtx(), getNativeObject(), level,
 | 
			
		||||
                predicate.getNativeObject(), property.getNativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
| 
						 | 
				
			
			@ -244,7 +243,7 @@ public class Fixedpoint extends Z3Object
 | 
			
		|||
    {
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
            return Native.fixedpointToString(Context().nCtx(), NativeObject(),
 | 
			
		||||
            return Native.fixedpointToString(getContext().nCtx(), getNativeObject(),
 | 
			
		||||
                    0, null);
 | 
			
		||||
        } catch (Z3Exception e)
 | 
			
		||||
        {
 | 
			
		||||
| 
						 | 
				
			
			@ -256,12 +255,12 @@ public class Fixedpoint extends Z3Object
 | 
			
		|||
     * Instrument the Datalog engine on which table representation to use for
 | 
			
		||||
     * recursive predicate.
 | 
			
		||||
     **/
 | 
			
		||||
    public void SetPredicateRepresentation(FuncDecl f, Symbol[] kinds) throws Z3Exception
 | 
			
		||||
    public void setPredicateRepresentation(FuncDecl f, Symbol[] kinds) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
        Native.fixedpointSetPredicateRepresentation(Context().nCtx(),
 | 
			
		||||
                NativeObject(), f.NativeObject(), AST.ArrayLength(kinds),
 | 
			
		||||
                Symbol.ArrayToNative(kinds));
 | 
			
		||||
        Native.fixedpointSetPredicateRepresentation(getContext().nCtx(),
 | 
			
		||||
                getNativeObject(), f.getNativeObject(), AST.arrayLength(kinds),
 | 
			
		||||
                Symbol.arrayToNative(kinds));
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -271,8 +270,8 @@ public class Fixedpoint extends Z3Object
 | 
			
		|||
    public String toString(BoolExpr[] queries) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
        return Native.fixedpointToString(Context().nCtx(), NativeObject(),
 | 
			
		||||
                AST.ArrayLength(queries), AST.ArrayToNative(queries));
 | 
			
		||||
        return Native.fixedpointToString(getContext().nCtx(), getNativeObject(),
 | 
			
		||||
                AST.arrayLength(queries), AST.arrayToNative(queries));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
| 
						 | 
				
			
			@ -280,15 +279,15 @@ public class Fixedpoint extends Z3Object
 | 
			
		|||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public BoolExpr[] Rules() throws Z3Exception
 | 
			
		||||
    public BoolExpr[] getRules() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
        ASTVector v = new ASTVector(Context(), Native.fixedpointGetRules(
 | 
			
		||||
                Context().nCtx(), NativeObject()));
 | 
			
		||||
        int n = v.Size();
 | 
			
		||||
        ASTVector v = new ASTVector(getContext(), Native.fixedpointGetRules(
 | 
			
		||||
                getContext().nCtx(), getNativeObject()));
 | 
			
		||||
        int n = v.size();
 | 
			
		||||
        BoolExpr[] res = new BoolExpr[n];
 | 
			
		||||
        for (int i = 0; i < n; i++)
 | 
			
		||||
            res[i] = new BoolExpr(Context(), v.get(i).NativeObject());
 | 
			
		||||
            res[i] = new BoolExpr(getContext(), v.get(i).getNativeObject());
 | 
			
		||||
        return res;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -297,15 +296,15 @@ public class Fixedpoint extends Z3Object
 | 
			
		|||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public BoolExpr[] Assertions() throws Z3Exception
 | 
			
		||||
    public BoolExpr[] getAssertions() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
        ASTVector v = new ASTVector(Context(), Native.fixedpointGetAssertions(
 | 
			
		||||
                Context().nCtx(), NativeObject()));
 | 
			
		||||
        int n = v.Size();
 | 
			
		||||
        ASTVector v = new ASTVector(getContext(), Native.fixedpointGetAssertions(
 | 
			
		||||
                getContext().nCtx(), getNativeObject()));
 | 
			
		||||
        int n = v.size();
 | 
			
		||||
        BoolExpr[] res = new BoolExpr[n];
 | 
			
		||||
        for (int i = 0; i < n; i++)
 | 
			
		||||
            res[i] = new BoolExpr(Context(), v.get(i).NativeObject());
 | 
			
		||||
            res[i] = new BoolExpr(getContext(), v.get(i).getNativeObject());
 | 
			
		||||
        return res;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -319,15 +318,15 @@ public class Fixedpoint extends Z3Object
 | 
			
		|||
        super(ctx, Native.mkFixedpoint(ctx.nCtx()));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    void IncRef(long o) throws Z3Exception
 | 
			
		||||
    void incRef(long o) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Context().Fixedpoint_DRQ().IncAndClear(Context(), o);
 | 
			
		||||
        super.IncRef(o);
 | 
			
		||||
        getContext().fixedpoint_DRQ().incAndClear(getContext(), o);
 | 
			
		||||
        super.incRef(o);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    void DecRef(long o) throws Z3Exception
 | 
			
		||||
    void decRef(long o) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Context().Fixedpoint_DRQ().Add(o);
 | 
			
		||||
        super.DecRef(o);
 | 
			
		||||
        getContext().fixedpoint_DRQ().add(o);
 | 
			
		||||
        super.decRef(o);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -7,7 +7,7 @@ package com.microsoft.z3;
 | 
			
		|||
 | 
			
		||||
class FixedpointDecRefQueue extends IDecRefQueue
 | 
			
		||||
{
 | 
			
		||||
    public void IncRef(Context ctx, long obj)
 | 
			
		||||
    protected void incRef(Context ctx, long obj)
 | 
			
		||||
    {
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
| 
						 | 
				
			
			@ -18,7 +18,7 @@ class FixedpointDecRefQueue extends IDecRefQueue
 | 
			
		|||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void DecRef(Context ctx, long obj)
 | 
			
		||||
    protected void decRef(Context ctx, long obj)
 | 
			
		||||
    {
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -6,7 +6,9 @@
 | 
			
		|||
 | 
			
		||||
package com.microsoft.z3;
 | 
			
		||||
 | 
			
		||||
import com.microsoft.z3.enumerations.*;
 | 
			
		||||
import com.microsoft.z3.enumerations.Z3_ast_kind;
 | 
			
		||||
import com.microsoft.z3.enumerations.Z3_decl_kind;
 | 
			
		||||
import com.microsoft.z3.enumerations.Z3_parameter_kind;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Function declarations.
 | 
			
		||||
| 
						 | 
				
			
			@ -32,7 +34,7 @@ public class FuncDecl extends AST
 | 
			
		|||
    /**
 | 
			
		||||
     * Object comparison.
 | 
			
		||||
     **/
 | 
			
		||||
    public boolean Equals(Object o)
 | 
			
		||||
    public boolean equals(Object o)
 | 
			
		||||
    {
 | 
			
		||||
        FuncDecl casted = (FuncDecl) o;
 | 
			
		||||
        if (casted == null)
 | 
			
		||||
| 
						 | 
				
			
			@ -43,9 +45,9 @@ public class FuncDecl extends AST
 | 
			
		|||
    /**
 | 
			
		||||
     * A hash code.
 | 
			
		||||
     **/
 | 
			
		||||
    public int GetHashCode() throws Z3Exception
 | 
			
		||||
    public int hashCode()
 | 
			
		||||
    {
 | 
			
		||||
        return super.GetHashCode();
 | 
			
		||||
        return super.hashCode();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
| 
						 | 
				
			
			@ -55,7 +57,7 @@ public class FuncDecl extends AST
 | 
			
		|||
    {
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
            return Native.funcDeclToString(Context().nCtx(), NativeObject());
 | 
			
		||||
            return Native.funcDeclToString(getContext().nCtx(), getNativeObject());
 | 
			
		||||
        } catch (Z3Exception e)
 | 
			
		||||
        {
 | 
			
		||||
            return "Z3Exception: " + e.getMessage();
 | 
			
		||||
| 
						 | 
				
			
			@ -65,125 +67,125 @@ public class FuncDecl extends AST
 | 
			
		|||
    /**
 | 
			
		||||
     * Returns a unique identifier for the function declaration.
 | 
			
		||||
     **/
 | 
			
		||||
    public int Id() throws Z3Exception
 | 
			
		||||
    public int getId() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Native.getFuncDeclId(Context().nCtx(), NativeObject());
 | 
			
		||||
        return Native.getFuncDeclId(getContext().nCtx(), getNativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * The arity of the function declaration
 | 
			
		||||
     **/
 | 
			
		||||
    public int Arity() throws Z3Exception
 | 
			
		||||
    public int getArity() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Native.getArity(Context().nCtx(), NativeObject());
 | 
			
		||||
        return Native.getArity(getContext().nCtx(), getNativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * The size of the domain of the function declaration <seealso
 | 
			
		||||
     * cref="Arity"/>
 | 
			
		||||
     **/
 | 
			
		||||
    public int DomainSize() throws Z3Exception
 | 
			
		||||
    public int getDomainSize() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Native.getDomainSize(Context().nCtx(), NativeObject());
 | 
			
		||||
        return Native.getDomainSize(getContext().nCtx(), getNativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * The domain of the function declaration
 | 
			
		||||
     **/
 | 
			
		||||
    public Sort[] Domain() throws Z3Exception
 | 
			
		||||
    public Sort[] getDomain() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
        int n = DomainSize();
 | 
			
		||||
        int n = getDomainSize();
 | 
			
		||||
 | 
			
		||||
        Sort[] res = new Sort[n];
 | 
			
		||||
        for (int i = 0; i < n; i++)
 | 
			
		||||
            res[i] = Sort.Create(Context(),
 | 
			
		||||
                    Native.getDomain(Context().nCtx(), NativeObject(), i));
 | 
			
		||||
            res[i] = Sort.create(getContext(),
 | 
			
		||||
                    Native.getDomain(getContext().nCtx(), getNativeObject(), i));
 | 
			
		||||
        return res;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * The range of the function declaration
 | 
			
		||||
     **/
 | 
			
		||||
    public Sort Range() throws Z3Exception
 | 
			
		||||
    public Sort getRange() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
        return Sort.Create(Context(),
 | 
			
		||||
                Native.getRange(Context().nCtx(), NativeObject()));
 | 
			
		||||
        return Sort.create(getContext(),
 | 
			
		||||
                Native.getRange(getContext().nCtx(), getNativeObject()));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * The kind of the function declaration.
 | 
			
		||||
     **/
 | 
			
		||||
    public Z3_decl_kind DeclKind() throws Z3Exception
 | 
			
		||||
    public Z3_decl_kind getDeclKind() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Z3_decl_kind.fromInt(Native.getDeclKind(Context().nCtx(),
 | 
			
		||||
                NativeObject()));
 | 
			
		||||
        return Z3_decl_kind.fromInt(Native.getDeclKind(getContext().nCtx(),
 | 
			
		||||
                getNativeObject()));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * The name of the function declaration
 | 
			
		||||
     **/
 | 
			
		||||
    public Symbol Name() throws Z3Exception
 | 
			
		||||
    public Symbol getName() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
        return Symbol.Create(Context(),
 | 
			
		||||
                Native.getDeclName(Context().nCtx(), NativeObject()));
 | 
			
		||||
        return Symbol.create(getContext(),
 | 
			
		||||
                Native.getDeclName(getContext().nCtx(), getNativeObject()));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * The number of parameters of the function declaration
 | 
			
		||||
     **/
 | 
			
		||||
    public int NumParameters() throws Z3Exception
 | 
			
		||||
    public int getNumParameters() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Native.getDeclNumParameters(Context().nCtx(), NativeObject());
 | 
			
		||||
        return Native.getDeclNumParameters(getContext().nCtx(), getNativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * The parameters of the function declaration
 | 
			
		||||
     **/
 | 
			
		||||
    public Parameter[] Parameters() throws Z3Exception
 | 
			
		||||
    public Parameter[] getParameters() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
        int num = NumParameters();
 | 
			
		||||
        int num = getNumParameters();
 | 
			
		||||
        Parameter[] res = new Parameter[num];
 | 
			
		||||
        for (int i = 0; i < num; i++)
 | 
			
		||||
        {
 | 
			
		||||
            Z3_parameter_kind k = Z3_parameter_kind.fromInt(Native
 | 
			
		||||
                    .getDeclParameterKind(Context().nCtx(), NativeObject(), i));
 | 
			
		||||
                    .getDeclParameterKind(getContext().nCtx(), getNativeObject(), i));
 | 
			
		||||
            switch (k)
 | 
			
		||||
            {
 | 
			
		||||
            case Z3_PARAMETER_INT:
 | 
			
		||||
                res[i] = new Parameter(k, Native.getDeclIntParameter(Context()
 | 
			
		||||
                        .nCtx(), NativeObject(), i));
 | 
			
		||||
                res[i] = new Parameter(k, Native.getDeclIntParameter(getContext()
 | 
			
		||||
                        .nCtx(), getNativeObject(), i));
 | 
			
		||||
                break;
 | 
			
		||||
            case Z3_PARAMETER_DOUBLE:
 | 
			
		||||
                res[i] = new Parameter(k, Native.getDeclDoubleParameter(
 | 
			
		||||
                        Context().nCtx(), NativeObject(), i));
 | 
			
		||||
                        getContext().nCtx(), getNativeObject(), i));
 | 
			
		||||
                break;
 | 
			
		||||
            case Z3_PARAMETER_SYMBOL:
 | 
			
		||||
                res[i] = new Parameter(k, Symbol.Create(Context(), Native
 | 
			
		||||
                        .getDeclSymbolParameter(Context().nCtx(),
 | 
			
		||||
                                NativeObject(), i)));
 | 
			
		||||
                res[i] = new Parameter(k, Symbol.create(getContext(), Native
 | 
			
		||||
                        .getDeclSymbolParameter(getContext().nCtx(),
 | 
			
		||||
                                getNativeObject(), i)));
 | 
			
		||||
                break;
 | 
			
		||||
            case Z3_PARAMETER_SORT:
 | 
			
		||||
                res[i] = new Parameter(k, Sort.Create(Context(), Native
 | 
			
		||||
                        .getDeclSortParameter(Context().nCtx(), NativeObject(),
 | 
			
		||||
                res[i] = new Parameter(k, Sort.create(getContext(), Native
 | 
			
		||||
                        .getDeclSortParameter(getContext().nCtx(), getNativeObject(),
 | 
			
		||||
                                i)));
 | 
			
		||||
                break;
 | 
			
		||||
            case Z3_PARAMETER_AST:
 | 
			
		||||
                res[i] = new Parameter(k, new AST(Context(),
 | 
			
		||||
                        Native.getDeclAstParameter(Context().nCtx(),
 | 
			
		||||
                                NativeObject(), i)));
 | 
			
		||||
                res[i] = new Parameter(k, new AST(getContext(),
 | 
			
		||||
                        Native.getDeclAstParameter(getContext().nCtx(),
 | 
			
		||||
                                getNativeObject(), i)));
 | 
			
		||||
                break;
 | 
			
		||||
            case Z3_PARAMETER_FUNC_DECL:
 | 
			
		||||
                res[i] = new Parameter(k, new FuncDecl(Context(),
 | 
			
		||||
                        Native.getDeclFuncDeclParameter(Context().nCtx(),
 | 
			
		||||
                                NativeObject(), i)));
 | 
			
		||||
                res[i] = new Parameter(k, new FuncDecl(getContext(),
 | 
			
		||||
                        Native.getDeclFuncDeclParameter(getContext().nCtx(),
 | 
			
		||||
                                getNativeObject(), i)));
 | 
			
		||||
                break;
 | 
			
		||||
            case Z3_PARAMETER_RATIONAL:
 | 
			
		||||
                res[i] = new Parameter(k, Native.getDeclRationalParameter(
 | 
			
		||||
                        Context().nCtx(), NativeObject(), i));
 | 
			
		||||
                        getContext().nCtx(), getNativeObject(), i));
 | 
			
		||||
                break;
 | 
			
		||||
            default:
 | 
			
		||||
                throw new Z3Exception(
 | 
			
		||||
| 
						 | 
				
			
			@ -210,9 +212,9 @@ public class FuncDecl extends AST
 | 
			
		|||
        /**
 | 
			
		||||
         * The int value of the parameter.</summary>
 | 
			
		||||
         **/
 | 
			
		||||
        public int Int() throws Z3Exception
 | 
			
		||||
        public int getInt() throws Z3Exception
 | 
			
		||||
        {
 | 
			
		||||
            if (ParameterKind() != Z3_parameter_kind.Z3_PARAMETER_INT)
 | 
			
		||||
            if (getParameterKind() != Z3_parameter_kind.Z3_PARAMETER_INT)
 | 
			
		||||
                throw new Z3Exception("parameter is not an int");
 | 
			
		||||
            return i;
 | 
			
		||||
        }
 | 
			
		||||
| 
						 | 
				
			
			@ -220,9 +222,9 @@ public class FuncDecl extends AST
 | 
			
		|||
        /**
 | 
			
		||||
         * The double value of the parameter.</summary>
 | 
			
		||||
         **/
 | 
			
		||||
        public double Double() throws Z3Exception
 | 
			
		||||
        public double getDouble() throws Z3Exception
 | 
			
		||||
        {
 | 
			
		||||
            if (ParameterKind() != Z3_parameter_kind.Z3_PARAMETER_DOUBLE)
 | 
			
		||||
            if (getParameterKind() != Z3_parameter_kind.Z3_PARAMETER_DOUBLE)
 | 
			
		||||
                throw new Z3Exception("parameter is not a double ");
 | 
			
		||||
            return d;
 | 
			
		||||
        }
 | 
			
		||||
| 
						 | 
				
			
			@ -230,9 +232,9 @@ public class FuncDecl extends AST
 | 
			
		|||
        /**
 | 
			
		||||
         * The Symbol value of the parameter.</summary>
 | 
			
		||||
         **/
 | 
			
		||||
        public Symbol Symbol() throws Z3Exception
 | 
			
		||||
        public Symbol getSymbol() throws Z3Exception
 | 
			
		||||
        {
 | 
			
		||||
            if (ParameterKind() != Z3_parameter_kind.Z3_PARAMETER_SYMBOL)
 | 
			
		||||
            if (getParameterKind() != Z3_parameter_kind.Z3_PARAMETER_SYMBOL)
 | 
			
		||||
                throw new Z3Exception("parameter is not a Symbol");
 | 
			
		||||
            return sym;
 | 
			
		||||
        }
 | 
			
		||||
| 
						 | 
				
			
			@ -240,9 +242,9 @@ public class FuncDecl extends AST
 | 
			
		|||
        /**
 | 
			
		||||
         * The Sort value of the parameter.</summary>
 | 
			
		||||
         **/
 | 
			
		||||
        public Sort Sort() throws Z3Exception
 | 
			
		||||
        public Sort getSort() throws Z3Exception
 | 
			
		||||
        {
 | 
			
		||||
            if (ParameterKind() != Z3_parameter_kind.Z3_PARAMETER_SORT)
 | 
			
		||||
            if (getParameterKind() != Z3_parameter_kind.Z3_PARAMETER_SORT)
 | 
			
		||||
                throw new Z3Exception("parameter is not a Sort");
 | 
			
		||||
            return srt;
 | 
			
		||||
        }
 | 
			
		||||
| 
						 | 
				
			
			@ -250,9 +252,9 @@ public class FuncDecl extends AST
 | 
			
		|||
        /**
 | 
			
		||||
         * The AST value of the parameter.</summary>
 | 
			
		||||
         **/
 | 
			
		||||
        public AST AST() throws Z3Exception
 | 
			
		||||
        public AST getAST() throws Z3Exception
 | 
			
		||||
        {
 | 
			
		||||
            if (ParameterKind() != Z3_parameter_kind.Z3_PARAMETER_AST)
 | 
			
		||||
            if (getParameterKind() != Z3_parameter_kind.Z3_PARAMETER_AST)
 | 
			
		||||
                throw new Z3Exception("parameter is not an AST");
 | 
			
		||||
            return ast;
 | 
			
		||||
        }
 | 
			
		||||
| 
						 | 
				
			
			@ -260,9 +262,9 @@ public class FuncDecl extends AST
 | 
			
		|||
        /**
 | 
			
		||||
         * The FunctionDeclaration value of the parameter.</summary>
 | 
			
		||||
         **/
 | 
			
		||||
        public FuncDecl FuncDecl() throws Z3Exception
 | 
			
		||||
        public FuncDecl getFuncDecl() throws Z3Exception
 | 
			
		||||
        {
 | 
			
		||||
            if (ParameterKind() != Z3_parameter_kind.Z3_PARAMETER_FUNC_DECL)
 | 
			
		||||
            if (getParameterKind() != Z3_parameter_kind.Z3_PARAMETER_FUNC_DECL)
 | 
			
		||||
                throw new Z3Exception("parameter is not a function declaration");
 | 
			
		||||
            return fd;
 | 
			
		||||
        }
 | 
			
		||||
| 
						 | 
				
			
			@ -270,9 +272,9 @@ public class FuncDecl extends AST
 | 
			
		|||
        /**
 | 
			
		||||
         * The rational string value of the parameter.</summary>
 | 
			
		||||
         **/
 | 
			
		||||
        public String Rational() throws Z3Exception
 | 
			
		||||
        public String getRational() throws Z3Exception
 | 
			
		||||
        {
 | 
			
		||||
            if (ParameterKind() != Z3_parameter_kind.Z3_PARAMETER_RATIONAL)
 | 
			
		||||
            if (getParameterKind() != Z3_parameter_kind.Z3_PARAMETER_RATIONAL)
 | 
			
		||||
                throw new Z3Exception("parameter is not a rational String");
 | 
			
		||||
            return r;
 | 
			
		||||
        }
 | 
			
		||||
| 
						 | 
				
			
			@ -280,7 +282,7 @@ public class FuncDecl extends AST
 | 
			
		|||
        /**
 | 
			
		||||
         * The kind of the parameter.
 | 
			
		||||
         **/
 | 
			
		||||
        public Z3_parameter_kind ParameterKind() throws Z3Exception
 | 
			
		||||
        public Z3_parameter_kind getParameterKind() throws Z3Exception
 | 
			
		||||
        {
 | 
			
		||||
            return kind;
 | 
			
		||||
        }
 | 
			
		||||
| 
						 | 
				
			
			@ -337,9 +339,9 @@ public class FuncDecl extends AST
 | 
			
		|||
    FuncDecl(Context ctx, Symbol name, Sort[] domain, Sort range)
 | 
			
		||||
            throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        super(ctx, Native.mkFuncDecl(ctx.nCtx(), name.NativeObject(),
 | 
			
		||||
                AST.ArrayLength(domain), AST.ArrayToNative(domain),
 | 
			
		||||
                range.NativeObject()));
 | 
			
		||||
        super(ctx, Native.mkFuncDecl(ctx.nCtx(), name.getNativeObject(),
 | 
			
		||||
                AST.arrayLength(domain), AST.arrayToNative(domain),
 | 
			
		||||
                range.getNativeObject()));
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -347,18 +349,18 @@ public class FuncDecl extends AST
 | 
			
		|||
            throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        super(ctx, Native.mkFreshFuncDecl(ctx.nCtx(), prefix,
 | 
			
		||||
                AST.ArrayLength(domain), AST.ArrayToNative(domain),
 | 
			
		||||
                range.NativeObject()));
 | 
			
		||||
                AST.arrayLength(domain), AST.arrayToNative(domain),
 | 
			
		||||
                range.getNativeObject()));
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    void CheckNativeObject(long obj) throws Z3Exception
 | 
			
		||||
    void checkNativeObject(long obj) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        if (Native.getAstKind(Context().nCtx(), obj) != Z3_ast_kind.Z3_FUNC_DECL_AST
 | 
			
		||||
        if (Native.getAstKind(getContext().nCtx(), obj) != Z3_ast_kind.Z3_FUNC_DECL_AST
 | 
			
		||||
                .toInt())
 | 
			
		||||
            throw new Z3Exception(
 | 
			
		||||
                    "Underlying object is not a function declaration");
 | 
			
		||||
        super.CheckNativeObject(obj);
 | 
			
		||||
        super.checkNativeObject(obj);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
| 
						 | 
				
			
			@ -367,31 +369,9 @@ public class FuncDecl extends AST
 | 
			
		|||
     * 
 | 
			
		||||
     * @return
 | 
			
		||||
     **/
 | 
			
		||||
    /* operator this[] not translated */
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Create expression that applies function to arguments. <param
 | 
			
		||||
     * name="args"></param>
 | 
			
		||||
     * 
 | 
			
		||||
     * @return
 | 
			
		||||
     **/
 | 
			
		||||
    public Expr Apply(Expr[] args) throws Z3Exception
 | 
			
		||||
    public Expr apply(Expr ... args) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Context().CheckContextMatch(args);
 | 
			
		||||
        return Expr.Create(Context(), this, args);
 | 
			
		||||
        getContext().checkContextMatch(args);
 | 
			
		||||
        return Expr.create(getContext(), this, args);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Create expression that applies function to one argument. <param
 | 
			
		||||
     * name="arg"></param>
 | 
			
		||||
     * 
 | 
			
		||||
     * @return
 | 
			
		||||
     **/
 | 
			
		||||
    public Expr Apply(Expr arg) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Context().CheckContextMatch(arg);
 | 
			
		||||
        Expr[] a = { arg };
 | 
			
		||||
        return Expr.Create(Context(), this, a);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -24,18 +24,18 @@ public class FuncInterp extends Z3Object
 | 
			
		|||
		 * 
 | 
			
		||||
		 * @throws Z3Exception
 | 
			
		||||
		 **/
 | 
			
		||||
		public Expr Value() throws Z3Exception
 | 
			
		||||
		public Expr getValue() throws Z3Exception
 | 
			
		||||
		{
 | 
			
		||||
			return Expr.Create(Context(),
 | 
			
		||||
					Native.funcEntryGetValue(Context().nCtx(), NativeObject()));
 | 
			
		||||
			return Expr.create(getContext(),
 | 
			
		||||
					Native.funcEntryGetValue(getContext().nCtx(), getNativeObject()));
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		/**
 | 
			
		||||
		 * The number of arguments of the entry.
 | 
			
		||||
		 **/
 | 
			
		||||
		public int NumArgs() throws Z3Exception
 | 
			
		||||
		public int getNumArgs() throws Z3Exception
 | 
			
		||||
		{
 | 
			
		||||
			return Native.funcEntryGetNumArgs(Context().nCtx(), NativeObject());
 | 
			
		||||
			return Native.funcEntryGetNumArgs(getContext().nCtx(), getNativeObject());
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		/**
 | 
			
		||||
| 
						 | 
				
			
			@ -43,13 +43,13 @@ public class FuncInterp extends Z3Object
 | 
			
		|||
		 * 
 | 
			
		||||
		 * @throws Z3Exception
 | 
			
		||||
		 **/
 | 
			
		||||
		public Expr[] Args() throws Z3Exception
 | 
			
		||||
		public Expr[] getArgs() throws Z3Exception
 | 
			
		||||
		{
 | 
			
		||||
			int n = NumArgs();
 | 
			
		||||
			int n = getNumArgs();
 | 
			
		||||
			Expr[] res = new Expr[n];
 | 
			
		||||
			for (int i = 0; i < n; i++)
 | 
			
		||||
				res[i] = Expr.Create(Context(), Native.funcEntryGetArg(
 | 
			
		||||
						Context().nCtx(), NativeObject(), i));
 | 
			
		||||
				res[i] = Expr.create(getContext(), Native.funcEntryGetArg(
 | 
			
		||||
						getContext().nCtx(), getNativeObject(), i));
 | 
			
		||||
			return res;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -60,12 +60,12 @@ public class FuncInterp extends Z3Object
 | 
			
		|||
		{
 | 
			
		||||
			try
 | 
			
		||||
			{
 | 
			
		||||
				int n = NumArgs();
 | 
			
		||||
				int n = getNumArgs();
 | 
			
		||||
				String res = "[";
 | 
			
		||||
				Expr[] args = Args();
 | 
			
		||||
				Expr[] args = getArgs();
 | 
			
		||||
				for (int i = 0; i < n; i++)
 | 
			
		||||
					res += args[i] + ", ";
 | 
			
		||||
				return res + Value() + "]";
 | 
			
		||||
				return res + getValue() + "]";
 | 
			
		||||
			} catch (Z3Exception e)
 | 
			
		||||
			{
 | 
			
		||||
				return new String("Z3Exception: " + e.getMessage());
 | 
			
		||||
| 
						 | 
				
			
			@ -77,25 +77,25 @@ public class FuncInterp extends Z3Object
 | 
			
		|||
			super(ctx, obj);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		void IncRef(long o) throws Z3Exception
 | 
			
		||||
		void incRef(long o) throws Z3Exception
 | 
			
		||||
		{
 | 
			
		||||
			Context().FuncEntry_DRQ().IncAndClear(Context(), o);
 | 
			
		||||
			super.IncRef(o);
 | 
			
		||||
			getContext().funcEntry_DRQ().incAndClear(getContext(), o);
 | 
			
		||||
			super.incRef(o);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		void DecRef(long o) throws Z3Exception
 | 
			
		||||
		void decRef(long o) throws Z3Exception
 | 
			
		||||
		{
 | 
			
		||||
			Context().FuncEntry_DRQ().Add(o);
 | 
			
		||||
			super.DecRef(o);
 | 
			
		||||
			getContext().funcEntry_DRQ().add(o);
 | 
			
		||||
			super.decRef(o);
 | 
			
		||||
		}
 | 
			
		||||
	};
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * The number of entries in the function interpretation.
 | 
			
		||||
	 **/
 | 
			
		||||
	public int NumEntries() throws Z3Exception
 | 
			
		||||
	public int getNumEntries() throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		return Native.funcInterpGetNumEntries(Context().nCtx(), NativeObject());
 | 
			
		||||
		return Native.funcInterpGetNumEntries(getContext().nCtx(), getNativeObject());
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
| 
						 | 
				
			
			@ -103,13 +103,13 @@ public class FuncInterp extends Z3Object
 | 
			
		|||
	 * 
 | 
			
		||||
	 * @throws Z3Exception
 | 
			
		||||
	 **/
 | 
			
		||||
	public Entry[] Entries() throws Z3Exception
 | 
			
		||||
	public Entry[] getEntries() throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		int n = NumEntries();
 | 
			
		||||
		int n = getNumEntries();
 | 
			
		||||
		Entry[] res = new Entry[n];
 | 
			
		||||
		for (int i = 0; i < n; i++)
 | 
			
		||||
			res[i] = new Entry(Context(), Native.funcInterpGetEntry(Context()
 | 
			
		||||
					.nCtx(), NativeObject(), i));
 | 
			
		||||
			res[i] = new Entry(getContext(), Native.funcInterpGetEntry(getContext()
 | 
			
		||||
					.nCtx(), getNativeObject(), i));
 | 
			
		||||
		return res;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -118,18 +118,18 @@ public class FuncInterp extends Z3Object
 | 
			
		|||
	 * 
 | 
			
		||||
	 * @throws Z3Exception
 | 
			
		||||
	 **/
 | 
			
		||||
	public Expr Else() throws Z3Exception
 | 
			
		||||
	public Expr getElse() throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		return Expr.Create(Context(),
 | 
			
		||||
				Native.funcInterpGetElse(Context().nCtx(), NativeObject()));
 | 
			
		||||
		return Expr.create(getContext(),
 | 
			
		||||
				Native.funcInterpGetElse(getContext().nCtx(), getNativeObject()));
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * The arity of the function interpretation
 | 
			
		||||
	 **/
 | 
			
		||||
	public int Arity() throws Z3Exception
 | 
			
		||||
	public int getArity() throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		return Native.funcInterpGetArity(Context().nCtx(), NativeObject());
 | 
			
		||||
		return Native.funcInterpGetArity(getContext().nCtx(), getNativeObject());
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
| 
						 | 
				
			
			@ -141,12 +141,12 @@ public class FuncInterp extends Z3Object
 | 
			
		|||
		{
 | 
			
		||||
			String res = "";
 | 
			
		||||
			res += "[";
 | 
			
		||||
			for (Entry e : Entries())
 | 
			
		||||
			for (Entry e : getEntries())
 | 
			
		||||
			{
 | 
			
		||||
				int n = e.NumArgs();
 | 
			
		||||
				int n = e.getNumArgs();
 | 
			
		||||
				if (n > 1)
 | 
			
		||||
					res += "[";
 | 
			
		||||
				Expr[] args = e.Args();
 | 
			
		||||
				Expr[] args = e.getArgs();
 | 
			
		||||
				for (int i = 0; i < n; i++)
 | 
			
		||||
				{
 | 
			
		||||
					if (i != 0)
 | 
			
		||||
| 
						 | 
				
			
			@ -155,9 +155,9 @@ public class FuncInterp extends Z3Object
 | 
			
		|||
				}
 | 
			
		||||
				if (n > 1)
 | 
			
		||||
					res += "]";
 | 
			
		||||
				res += " -> " + e.Value() + ", ";
 | 
			
		||||
				res += " -> " + e.getValue() + ", ";
 | 
			
		||||
			}
 | 
			
		||||
			res += "else -> " + Else();
 | 
			
		||||
			res += "else -> " + getElse();
 | 
			
		||||
			res += "]";
 | 
			
		||||
			return res;
 | 
			
		||||
		} catch (Z3Exception e)
 | 
			
		||||
| 
						 | 
				
			
			@ -171,15 +171,15 @@ public class FuncInterp extends Z3Object
 | 
			
		|||
		super(ctx, obj);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	void IncRef(long o) throws Z3Exception
 | 
			
		||||
	void incRef(long o) throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		Context().FuncInterp_DRQ().IncAndClear(Context(), o);
 | 
			
		||||
		super.IncRef(o);
 | 
			
		||||
		getContext().funcInterp_DRQ().incAndClear(getContext(), o);
 | 
			
		||||
		super.incRef(o);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	void DecRef(long o) throws Z3Exception
 | 
			
		||||
	void decRef(long o) throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		Context().FuncInterp_DRQ().Add(o);
 | 
			
		||||
		super.DecRef(o);
 | 
			
		||||
		getContext().funcInterp_DRQ().add(o);
 | 
			
		||||
		super.decRef(o);
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -7,7 +7,7 @@ package com.microsoft.z3;
 | 
			
		|||
 | 
			
		||||
class FuncInterpDecRefQueue extends IDecRefQueue
 | 
			
		||||
{
 | 
			
		||||
    public void IncRef(Context ctx, long obj)
 | 
			
		||||
    protected void incRef(Context ctx, long obj)
 | 
			
		||||
    {
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
| 
						 | 
				
			
			@ -18,7 +18,7 @@ class FuncInterpDecRefQueue extends IDecRefQueue
 | 
			
		|||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void DecRef(Context ctx, long obj)
 | 
			
		||||
    protected void decRef(Context ctx, long obj)
 | 
			
		||||
    {
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -7,7 +7,7 @@ package com.microsoft.z3;
 | 
			
		|||
 | 
			
		||||
class FuncInterpEntryDecRefQueue extends IDecRefQueue
 | 
			
		||||
{
 | 
			
		||||
    public void IncRef(Context ctx, long obj)
 | 
			
		||||
    protected void incRef(Context ctx, long obj)
 | 
			
		||||
    {
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
| 
						 | 
				
			
			@ -18,7 +18,7 @@ class FuncInterpEntryDecRefQueue extends IDecRefQueue
 | 
			
		|||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void DecRef(Context ctx, long obj)
 | 
			
		||||
    protected void decRef(Context ctx, long obj)
 | 
			
		||||
    {
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -30,7 +30,7 @@ public final class Global
 | 
			
		|||
     * will set the parameter "decimal" in the module "pp" to true.
 | 
			
		||||
     * </remarks>
 | 
			
		||||
     **/
 | 
			
		||||
    public static void SetParameter(String id, String value)
 | 
			
		||||
    public static void setParameter(String id, String value)
 | 
			
		||||
    {
 | 
			
		||||
	Native.globalParamSet(id, value);
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			@ -44,7 +44,7 @@ public final class Global
 | 
			
		|||
     * The result string stored in param_value is stored in a shared location.
 | 
			
		||||
     * </remarks>
 | 
			
		||||
     **/
 | 
			
		||||
    public static String GetParameter(String id)
 | 
			
		||||
    public static String getParameter(String id)
 | 
			
		||||
    {
 | 
			
		||||
        Native.StringPtr res = new Native.StringPtr();
 | 
			
		||||
        if (!Native.globalParamGet(id, res))
 | 
			
		||||
| 
						 | 
				
			
			@ -60,7 +60,7 @@ public final class Global
 | 
			
		|||
     * </remarks>
 | 
			
		||||
     * @seealso SetParameter
 | 
			
		||||
     **/
 | 
			
		||||
    public static void ResetParameters()
 | 
			
		||||
    public static void resetParameters()
 | 
			
		||||
    {
 | 
			
		||||
	Native.globalParamResetAll();
 | 
			
		||||
    }   
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -6,7 +6,7 @@
 | 
			
		|||
 | 
			
		||||
package com.microsoft.z3;
 | 
			
		||||
 | 
			
		||||
import com.microsoft.z3.enumerations.*;
 | 
			
		||||
import com.microsoft.z3.enumerations.Z3_goal_prec;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * A goal (aka problem). A goal is essentially a set of formulas, that can be
 | 
			
		||||
| 
						 | 
				
			
			@ -21,43 +21,43 @@ public class Goal extends Z3Object
 | 
			
		|||
     * applied when the objective is to find a proof for a given goal.
 | 
			
		||||
     * </remarks>
 | 
			
		||||
     **/
 | 
			
		||||
    public Z3_goal_prec Precision() throws Z3Exception
 | 
			
		||||
    public Z3_goal_prec getPrecision() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Z3_goal_prec.fromInt(Native.goalPrecision(Context().nCtx(),
 | 
			
		||||
                NativeObject()));
 | 
			
		||||
        return Z3_goal_prec.fromInt(Native.goalPrecision(getContext().nCtx(),
 | 
			
		||||
                getNativeObject()));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Indicates whether the goal is precise.
 | 
			
		||||
     **/
 | 
			
		||||
    public boolean IsPrecise() throws Z3Exception
 | 
			
		||||
    public boolean isPrecise() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Precision() == Z3_goal_prec.Z3_GOAL_PRECISE;
 | 
			
		||||
        return getPrecision() == Z3_goal_prec.Z3_GOAL_PRECISE;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Indicates whether the goal is an under-approximation.
 | 
			
		||||
     **/
 | 
			
		||||
    public boolean IsUnderApproximation() throws Z3Exception
 | 
			
		||||
    public boolean isUnderApproximation() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Precision() == Z3_goal_prec.Z3_GOAL_UNDER;
 | 
			
		||||
        return getPrecision() == Z3_goal_prec.Z3_GOAL_UNDER;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Indicates whether the goal is an over-approximation.
 | 
			
		||||
     **/
 | 
			
		||||
    public boolean IsOverApproximation() throws Z3Exception
 | 
			
		||||
    public boolean isOverApproximation() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Precision() == Z3_goal_prec.Z3_GOAL_OVER;
 | 
			
		||||
        return getPrecision() == Z3_goal_prec.Z3_GOAL_OVER;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Indicates whether the goal is garbage (i.e., the product of over- and
 | 
			
		||||
     * under-approximations).
 | 
			
		||||
     **/
 | 
			
		||||
    public boolean IsGarbage() throws Z3Exception
 | 
			
		||||
    public boolean isGarbage() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Precision() == Z3_goal_prec.Z3_GOAL_UNDER_OVER;
 | 
			
		||||
        return getPrecision() == Z3_goal_prec.Z3_GOAL_UNDER_OVER;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
| 
						 | 
				
			
			@ -65,59 +65,47 @@ public class Goal extends Z3Object
 | 
			
		|||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public void Assert(BoolExpr[] constraints) throws Z3Exception
 | 
			
		||||
    public void assert_(BoolExpr ... constraints) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Context().CheckContextMatch(constraints);
 | 
			
		||||
        getContext().checkContextMatch(constraints);
 | 
			
		||||
        for (BoolExpr c : constraints)
 | 
			
		||||
        {
 | 
			
		||||
            Native.goalAssert(Context().nCtx(), NativeObject(),
 | 
			
		||||
                    c.NativeObject());
 | 
			
		||||
            Native.goalAssert(getContext().nCtx(), getNativeObject(),
 | 
			
		||||
                    c.getNativeObject());
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Adds a <paramref name="constraint"/> to the given goal.
 | 
			
		||||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public void Assert(BoolExpr constraint) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Context().CheckContextMatch(constraint);
 | 
			
		||||
        Native.goalAssert(Context().nCtx(), NativeObject(),
 | 
			
		||||
                constraint.NativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Indicates whether the goal contains `false'.
 | 
			
		||||
     **/
 | 
			
		||||
    public boolean Inconsistent() throws Z3Exception
 | 
			
		||||
    public boolean inconsistent() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Native.goalInconsistent(Context().nCtx(), NativeObject());
 | 
			
		||||
        return Native.goalInconsistent(getContext().nCtx(), getNativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * The depth of the goal. <remarks> This tracks how many transformations
 | 
			
		||||
     * were applied to it. </remarks>
 | 
			
		||||
     **/
 | 
			
		||||
    public int Depth() throws Z3Exception
 | 
			
		||||
    public int getDepth() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Native.goalDepth(Context().nCtx(), NativeObject());
 | 
			
		||||
        return Native.goalDepth(getContext().nCtx(), getNativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Erases all formulas from the given goal.
 | 
			
		||||
     **/
 | 
			
		||||
    public void Reset() throws Z3Exception
 | 
			
		||||
    public void reset() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Native.goalReset(Context().nCtx(), NativeObject());
 | 
			
		||||
        Native.goalReset(getContext().nCtx(), getNativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * The number of formulas in the goal.
 | 
			
		||||
     **/
 | 
			
		||||
    public int Size() throws Z3Exception
 | 
			
		||||
    public int size() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Native.goalSize(Context().nCtx(), NativeObject());
 | 
			
		||||
        return Native.goalSize(getContext().nCtx(), getNativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
| 
						 | 
				
			
			@ -125,40 +113,41 @@ public class Goal extends Z3Object
 | 
			
		|||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public BoolExpr[] Formulas() throws Z3Exception
 | 
			
		||||
    public BoolExpr[] getFormulas() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        int n = Size();
 | 
			
		||||
        int n = size();
 | 
			
		||||
        BoolExpr[] res = new BoolExpr[n];
 | 
			
		||||
        for (int i = 0; i < n; i++)
 | 
			
		||||
            res[i] = new BoolExpr(Context(), Native.goalFormula(Context()
 | 
			
		||||
                    .nCtx(), NativeObject(), i));
 | 
			
		||||
            res[i] = new BoolExpr(getContext(), Native.goalFormula(getContext()
 | 
			
		||||
                    .nCtx(), getNativeObject(), i));
 | 
			
		||||
        return res;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * The number of formulas, subformulas and terms in the goal.
 | 
			
		||||
     **/
 | 
			
		||||
    public int NumExprs() throws Z3Exception
 | 
			
		||||
    public int getNumExprs() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Native.goalNumExprs(Context().nCtx(), NativeObject());
 | 
			
		||||
        return Native.goalNumExprs(getContext().nCtx(), getNativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Indicates whether the goal is empty, and it is precise or the product of
 | 
			
		||||
     * an under approximation.
 | 
			
		||||
     **/
 | 
			
		||||
    public boolean IsDecidedSat() throws Z3Exception
 | 
			
		||||
    public boolean isDecidedSat() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Native.goalIsDecidedSat(Context().nCtx(), NativeObject());
 | 
			
		||||
        return Native.goalIsDecidedSat(getContext().nCtx(), getNativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Indicates whether the goal contains `false', and it is precise or the
 | 
			
		||||
     * product of an over approximation.
 | 
			
		||||
     **/
 | 
			
		||||
    public boolean IsDecidedUnsat() throws Z3Exception
 | 
			
		||||
    public boolean isDecidedUnsat() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Native.goalIsDecidedUnsat(Context().nCtx(), NativeObject());
 | 
			
		||||
        return Native
 | 
			
		||||
                .goalIsDecidedUnsat(getContext().nCtx(), getNativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
| 
						 | 
				
			
			@ -167,25 +156,40 @@ public class Goal extends Z3Object
 | 
			
		|||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public Goal Translate(Context ctx) throws Z3Exception
 | 
			
		||||
    public Goal translate(Context ctx) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return new Goal(ctx, Native.goalTranslate(Context().nCtx(),
 | 
			
		||||
                NativeObject(), ctx.nCtx()));
 | 
			
		||||
        return new Goal(ctx, Native.goalTranslate(getContext().nCtx(),
 | 
			
		||||
                getNativeObject(), ctx.nCtx()));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Simplifies the goal. <remarks>Essentially invokes the `simplify' tactic
 | 
			
		||||
     * on the goal.</remarks>
 | 
			
		||||
     **/
 | 
			
		||||
    public Goal Simplify(Params p) throws Z3Exception
 | 
			
		||||
    public Goal simplify() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Tactic t = Context().MkTactic("simplify");
 | 
			
		||||
        ApplyResult res = t.Apply(this, p);
 | 
			
		||||
        Tactic t = getContext().mkTactic("simplify");
 | 
			
		||||
        ApplyResult res = t.apply(this);
 | 
			
		||||
 | 
			
		||||
        if (res.NumSubgoals() == 0)
 | 
			
		||||
        if (res.getNumSubgoals() == 0)
 | 
			
		||||
            throw new Z3Exception("No subgoals");
 | 
			
		||||
        else
 | 
			
		||||
            return res.Subgoals()[0];
 | 
			
		||||
            return res.getSubgoals()[0];
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    /**
 | 
			
		||||
     * Simplifies the goal. <remarks>Essentially invokes the `simplify' tactic
 | 
			
		||||
     * on the goal.</remarks>
 | 
			
		||||
     **/
 | 
			
		||||
    public Goal simplify(Params p) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Tactic t = getContext().mkTactic("simplify");
 | 
			
		||||
        ApplyResult res = t.apply(this, p);
 | 
			
		||||
 | 
			
		||||
        if (res.getNumSubgoals() == 0)
 | 
			
		||||
            throw new Z3Exception("No subgoals");
 | 
			
		||||
        else
 | 
			
		||||
            return res.getSubgoals()[0];
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
| 
						 | 
				
			
			@ -197,7 +201,7 @@ public class Goal extends Z3Object
 | 
			
		|||
    {
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
            return Native.goalToString(Context().nCtx(), NativeObject());
 | 
			
		||||
            return Native.goalToString(getContext().nCtx(), getNativeObject());
 | 
			
		||||
        } catch (Z3Exception e)
 | 
			
		||||
        {
 | 
			
		||||
            return "Z3Exception: " + e.getMessage();
 | 
			
		||||
| 
						 | 
				
			
			@ -216,16 +220,16 @@ public class Goal extends Z3Object
 | 
			
		|||
                (unsatCores) ? true : false, (proofs) ? true : false));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    void IncRef(long o) throws Z3Exception
 | 
			
		||||
    void incRef(long o) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Context().Goal_DRQ().IncAndClear(Context(), o);
 | 
			
		||||
        super.IncRef(o);
 | 
			
		||||
        getContext().goal_DRQ().incAndClear(getContext(), o);
 | 
			
		||||
        super.incRef(o);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    void DecRef(long o) throws Z3Exception
 | 
			
		||||
    void decRef(long o) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Context().Goal_DRQ().Add(o);
 | 
			
		||||
        super.DecRef(o);
 | 
			
		||||
        getContext().goal_DRQ().add(o);
 | 
			
		||||
        super.decRef(o);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -7,7 +7,7 @@ package com.microsoft.z3;
 | 
			
		|||
 | 
			
		||||
class GoalDecRefQueue extends IDecRefQueue
 | 
			
		||||
{
 | 
			
		||||
    public void IncRef(Context ctx, long obj)
 | 
			
		||||
    protected void incRef(Context ctx, long obj)
 | 
			
		||||
    {
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
| 
						 | 
				
			
			@ -18,7 +18,7 @@ class GoalDecRefQueue extends IDecRefQueue
 | 
			
		|||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void DecRef(Context ctx, long obj)
 | 
			
		||||
    protected void decRef(Context ctx, long obj)
 | 
			
		||||
    {
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -6,26 +6,26 @@
 | 
			
		|||
 | 
			
		||||
package com.microsoft.z3;
 | 
			
		||||
 | 
			
		||||
import java.util.*;
 | 
			
		||||
import java.util.LinkedList;
 | 
			
		||||
 | 
			
		||||
abstract class IDecRefQueue
 | 
			
		||||
{
 | 
			
		||||
	protected Object m_lock = new Object();
 | 
			
		||||
	protected LinkedList<Long> m_queue = new LinkedList<Long>();
 | 
			
		||||
	final int m_move_limit = 1024;
 | 
			
		||||
	protected final int m_move_limit = 1024;
 | 
			
		||||
 | 
			
		||||
	public abstract void IncRef(Context ctx, long obj);
 | 
			
		||||
	protected abstract void incRef(Context ctx, long obj);
 | 
			
		||||
 | 
			
		||||
	public abstract void DecRef(Context ctx, long obj);
 | 
			
		||||
	protected abstract void decRef(Context ctx, long obj);
 | 
			
		||||
 | 
			
		||||
	public void IncAndClear(Context ctx, long o)
 | 
			
		||||
	protected void incAndClear(Context ctx, long o)
 | 
			
		||||
	{
 | 
			
		||||
		IncRef(ctx, o);
 | 
			
		||||
		incRef(ctx, o);
 | 
			
		||||
		if (m_queue.size() >= m_move_limit)
 | 
			
		||||
			Clear(ctx);
 | 
			
		||||
			clear(ctx);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	public void Add(long o)
 | 
			
		||||
	protected void add(long o)
 | 
			
		||||
	{
 | 
			
		||||
		if (o == 0)
 | 
			
		||||
			return;
 | 
			
		||||
| 
						 | 
				
			
			@ -36,12 +36,12 @@ abstract class IDecRefQueue
 | 
			
		|||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	public void Clear(Context ctx)
 | 
			
		||||
	protected void clear(Context ctx)
 | 
			
		||||
	{
 | 
			
		||||
		synchronized (m_lock)
 | 
			
		||||
		{
 | 
			
		||||
			for (Long o : m_queue)
 | 
			
		||||
				DecRef(ctx, o);
 | 
			
		||||
				decRef(ctx, o);
 | 
			
		||||
			m_queue.clear();
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -21,7 +21,7 @@ package com.microsoft.z3;
 | 
			
		|||
 | 
			
		||||
public class IDisposable
 | 
			
		||||
{
 | 
			
		||||
	public void Dispose() throws Z3Exception
 | 
			
		||||
	public void dispose() throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -22,10 +22,10 @@ public class IntNum extends IntExpr
 | 
			
		|||
    /**
 | 
			
		||||
     * Retrieve the int value.
 | 
			
		||||
     **/
 | 
			
		||||
    public int Int() throws Z3Exception
 | 
			
		||||
    public int getInt() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Native.IntPtr res = new Native.IntPtr();
 | 
			
		||||
        if (Native.getNumeralInt(Context().nCtx(), NativeObject(), res) ^ true)
 | 
			
		||||
        if (Native.getNumeralInt(getContext().nCtx(), getNativeObject(), res) ^ true)
 | 
			
		||||
            throw new Z3Exception("Numeral is not an int");
 | 
			
		||||
        return res.value;
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			@ -33,10 +33,10 @@ public class IntNum extends IntExpr
 | 
			
		|||
    /**
 | 
			
		||||
     * Retrieve the 64-bit int value.
 | 
			
		||||
     **/
 | 
			
		||||
    public long Int64() throws Z3Exception
 | 
			
		||||
    public long getInt64() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Native.LongPtr res = new Native.LongPtr();
 | 
			
		||||
        if (Native.getNumeralInt64(Context().nCtx(), NativeObject(), res) ^ true)
 | 
			
		||||
        if (Native.getNumeralInt64(getContext().nCtx(), getNativeObject(), res) ^ true)
 | 
			
		||||
            throw new Z3Exception("Numeral is not an int64");
 | 
			
		||||
        return res.value;
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			@ -44,7 +44,7 @@ public class IntNum extends IntExpr
 | 
			
		|||
    /**
 | 
			
		||||
     * Retrieve the BigInteger value.
 | 
			
		||||
     **/
 | 
			
		||||
    public BigInteger BigInteger() throws Z3Exception
 | 
			
		||||
    public BigInteger getBigInteger() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return new BigInteger(this.toString());
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			@ -56,7 +56,7 @@ public class IntNum extends IntExpr
 | 
			
		|||
    {
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
            return Native.getNumeralString(Context().nCtx(), NativeObject());
 | 
			
		||||
            return Native.getNumeralString(getContext().nCtx(), getNativeObject());
 | 
			
		||||
        } catch (Z3Exception e)
 | 
			
		||||
        {
 | 
			
		||||
            return "Z3Exception: " + e.getMessage();
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -6,7 +6,7 @@
 | 
			
		|||
 | 
			
		||||
package com.microsoft.z3;
 | 
			
		||||
 | 
			
		||||
import com.microsoft.z3.enumerations.*;
 | 
			
		||||
import com.microsoft.z3.enumerations.Z3_symbol_kind;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Numbered symbols
 | 
			
		||||
| 
						 | 
				
			
			@ -17,11 +17,11 @@ public class IntSymbol extends Symbol
 | 
			
		|||
     * The int value of the symbol. <remarks>Throws an exception if the symbol
 | 
			
		||||
     * is not of int kind. </remarks>
 | 
			
		||||
     **/
 | 
			
		||||
    public int Int() throws Z3Exception
 | 
			
		||||
    public int getInt() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        if (!IsIntSymbol())
 | 
			
		||||
        if (!isIntSymbol())
 | 
			
		||||
            throw new Z3Exception("Int requested from non-Int symbol");
 | 
			
		||||
        return Native.getSymbolInt(Context().nCtx(), NativeObject());
 | 
			
		||||
        return Native.getSymbolInt(getContext().nCtx(), getNativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    IntSymbol(Context ctx, long obj) throws Z3Exception
 | 
			
		||||
| 
						 | 
				
			
			@ -34,11 +34,11 @@ public class IntSymbol extends Symbol
 | 
			
		|||
        super(ctx, Native.mkIntSymbol(ctx.nCtx(), i));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    void CheckNativeObject(long obj) throws Z3Exception
 | 
			
		||||
    void checkNativeObject(long obj) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        if (Native.getSymbolKind(Context().nCtx(), obj) != Z3_symbol_kind.Z3_INT_SYMBOL
 | 
			
		||||
        if (Native.getSymbolKind(getContext().nCtx(), obj) != Z3_symbol_kind.Z3_INT_SYMBOL
 | 
			
		||||
                .toInt())
 | 
			
		||||
            throw new Z3Exception("Symbol is not of integer kind");
 | 
			
		||||
        super.CheckNativeObject(obj);
 | 
			
		||||
        super.checkNativeObject(obj);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -14,36 +14,32 @@ public class ListSort extends Sort
 | 
			
		|||
    /**
 | 
			
		||||
     * The declaration of the nil function of this list sort.
 | 
			
		||||
     **/
 | 
			
		||||
    public FuncDecl NilDecl()
 | 
			
		||||
    public FuncDecl getNilDecl()
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
        return nilDecl;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * The empty list.
 | 
			
		||||
     **/
 | 
			
		||||
    public Expr Nil()
 | 
			
		||||
    public Expr getNil()
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
        return nilConst;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * The declaration of the isNil function of this list sort.
 | 
			
		||||
     **/
 | 
			
		||||
    public FuncDecl IsNilDecl()
 | 
			
		||||
    public FuncDecl getIsNilDecl()
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
        return isNilDecl;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * The declaration of the cons function of this list sort.
 | 
			
		||||
     **/
 | 
			
		||||
    public FuncDecl ConsDecl()
 | 
			
		||||
    public FuncDecl getConsDecl()
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
        return consDecl;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -51,27 +47,24 @@ public class ListSort extends Sort
 | 
			
		|||
     * The declaration of the isCons function of this list sort.
 | 
			
		||||
     * 
 | 
			
		||||
     **/
 | 
			
		||||
    public FuncDecl IsConsDecl()
 | 
			
		||||
    public FuncDecl getIsConsDecl()
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
        return isConsDecl;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * The declaration of the head function of this list sort.
 | 
			
		||||
     **/
 | 
			
		||||
    public FuncDecl HeadDecl()
 | 
			
		||||
    public FuncDecl getHeadDecl()
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
        return headDecl;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * The declaration of the tail function of this list sort.
 | 
			
		||||
     **/
 | 
			
		||||
    public FuncDecl TailDecl()
 | 
			
		||||
    public FuncDecl getTailDecl()
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
        return tailDecl;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -87,8 +80,8 @@ public class ListSort extends Sort
 | 
			
		|||
        Native.LongPtr icons = new Native.LongPtr(), iiscons = new Native.LongPtr();
 | 
			
		||||
        Native.LongPtr ihead = new Native.LongPtr(), itail = new Native.LongPtr();
 | 
			
		||||
 | 
			
		||||
        setNativeObject(Native.mkListSort(ctx.nCtx(), name.NativeObject(),
 | 
			
		||||
                elemSort.NativeObject(), inil, iisnil, icons, iiscons, ihead,
 | 
			
		||||
        setNativeObject(Native.mkListSort(ctx.nCtx(), name.getNativeObject(),
 | 
			
		||||
                elemSort.getNativeObject(), inil, iisnil, icons, iiscons, ihead,
 | 
			
		||||
                itail));
 | 
			
		||||
        nilDecl = new FuncDecl(ctx, inil.value);
 | 
			
		||||
        isNilDecl = new FuncDecl(ctx, iisnil.value);
 | 
			
		||||
| 
						 | 
				
			
			@ -96,6 +89,6 @@ public class ListSort extends Sort
 | 
			
		|||
        isConsDecl = new FuncDecl(ctx, iiscons.value);
 | 
			
		||||
        headDecl = new FuncDecl(ctx, ihead.value);
 | 
			
		||||
        tailDecl = new FuncDecl(ctx, itail.value);
 | 
			
		||||
        nilConst = ctx.MkConst(nilDecl);
 | 
			
		||||
        nilConst = ctx.mkConst(nilDecl);
 | 
			
		||||
    }
 | 
			
		||||
};
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -21,7 +21,7 @@ public final class Log
 | 
			
		|||
     * 
 | 
			
		||||
     * @return True if opening the log file succeeds, false otherwise.
 | 
			
		||||
     **/
 | 
			
		||||
    public static boolean Open(String filename)
 | 
			
		||||
    public static boolean open(String filename)
 | 
			
		||||
    {
 | 
			
		||||
        m_is_open = true;
 | 
			
		||||
        return Native.openLog(filename) == 1;
 | 
			
		||||
| 
						 | 
				
			
			@ -30,7 +30,7 @@ public final class Log
 | 
			
		|||
    /**
 | 
			
		||||
     * Closes the interaction log.
 | 
			
		||||
     **/
 | 
			
		||||
    public static void Close()
 | 
			
		||||
    public static void close()
 | 
			
		||||
    {
 | 
			
		||||
        m_is_open = false;
 | 
			
		||||
        Native.closeLog();
 | 
			
		||||
| 
						 | 
				
			
			@ -41,7 +41,7 @@ public final class Log
 | 
			
		|||
     * log.
 | 
			
		||||
     * @throws Z3Exception 
 | 
			
		||||
     **/
 | 
			
		||||
    public static void Append(String s) throws Z3Exception
 | 
			
		||||
    public static void append(String s) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        if (!m_is_open)
 | 
			
		||||
            throw new Z3Exception("Log cannot be closed.");
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -6,7 +6,7 @@
 | 
			
		|||
 | 
			
		||||
package com.microsoft.z3;
 | 
			
		||||
 | 
			
		||||
import com.microsoft.z3.enumerations.*;
 | 
			
		||||
import com.microsoft.z3.enumerations.Z3_sort_kind;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * A Model contains interpretations (assignments) of constants and functions.
 | 
			
		||||
| 
						 | 
				
			
			@ -21,10 +21,10 @@ public class Model extends Z3Object
 | 
			
		|||
     *         null otherwise.
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public Expr ConstInterp(Expr a) throws Z3Exception
 | 
			
		||||
    public Expr getConstInterp(Expr a) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Context().CheckContextMatch(a);
 | 
			
		||||
        return ConstInterp(a.FuncDecl());
 | 
			
		||||
        getContext().checkContextMatch(a);
 | 
			
		||||
        return getConstInterp(a.getFuncDecl());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
| 
						 | 
				
			
			@ -35,22 +35,22 @@ public class Model extends Z3Object
 | 
			
		|||
     *         null otherwise.
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public Expr ConstInterp(FuncDecl f) throws Z3Exception
 | 
			
		||||
    public Expr getConstInterp(FuncDecl f) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Context().CheckContextMatch(f);
 | 
			
		||||
        if (f.Arity() != 0
 | 
			
		||||
                || Native.getSortKind(Context().nCtx(),
 | 
			
		||||
                        Native.getRange(Context().nCtx(), f.NativeObject())) == Z3_sort_kind.Z3_ARRAY_SORT
 | 
			
		||||
        getContext().checkContextMatch(f);
 | 
			
		||||
        if (f.getArity() != 0
 | 
			
		||||
                || Native.getSortKind(getContext().nCtx(),
 | 
			
		||||
                        Native.getRange(getContext().nCtx(), f.getNativeObject())) == Z3_sort_kind.Z3_ARRAY_SORT
 | 
			
		||||
                        .toInt())
 | 
			
		||||
            throw new Z3Exception(
 | 
			
		||||
                    "Non-zero arity functions and arrays have FunctionInterpretations as a model. Use FuncInterp.");
 | 
			
		||||
 | 
			
		||||
        long n = Native.modelGetConstInterp(Context().nCtx(), NativeObject(),
 | 
			
		||||
                f.NativeObject());
 | 
			
		||||
        long n = Native.modelGetConstInterp(getContext().nCtx(), getNativeObject(),
 | 
			
		||||
                f.getNativeObject());
 | 
			
		||||
        if (n == 0)
 | 
			
		||||
            return null;
 | 
			
		||||
        else
 | 
			
		||||
            return Expr.Create(Context(), n);
 | 
			
		||||
            return Expr.create(getContext(), n);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
| 
						 | 
				
			
			@ -62,17 +62,17 @@ public class Model extends Z3Object
 | 
			
		|||
     *         the model, null otherwise.
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public FuncInterp FuncInterp(FuncDecl f) throws Z3Exception
 | 
			
		||||
    public FuncInterp getFuncInterp(FuncDecl f) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Context().CheckContextMatch(f);
 | 
			
		||||
        getContext().checkContextMatch(f);
 | 
			
		||||
 | 
			
		||||
        Z3_sort_kind sk = Z3_sort_kind.fromInt(Native.getSortKind(Context()
 | 
			
		||||
                .nCtx(), Native.getRange(Context().nCtx(), f.NativeObject())));
 | 
			
		||||
        Z3_sort_kind sk = Z3_sort_kind.fromInt(Native.getSortKind(getContext()
 | 
			
		||||
                .nCtx(), Native.getRange(getContext().nCtx(), f.getNativeObject())));
 | 
			
		||||
 | 
			
		||||
        if (f.Arity() == 0)
 | 
			
		||||
        if (f.getArity() == 0)
 | 
			
		||||
        {
 | 
			
		||||
            long n = Native.modelGetConstInterp(Context().nCtx(),
 | 
			
		||||
                    NativeObject(), f.NativeObject());
 | 
			
		||||
            long n = Native.modelGetConstInterp(getContext().nCtx(),
 | 
			
		||||
                    getNativeObject(), f.getNativeObject());
 | 
			
		||||
 | 
			
		||||
            if (sk == Z3_sort_kind.Z3_ARRAY_SORT)
 | 
			
		||||
            {
 | 
			
		||||
| 
						 | 
				
			
			@ -80,11 +80,11 @@ public class Model extends Z3Object
 | 
			
		|||
                    return null;
 | 
			
		||||
                else
 | 
			
		||||
                {
 | 
			
		||||
                    if (Native.isAsArray(Context().nCtx(), n) ^ true)
 | 
			
		||||
                    if (Native.isAsArray(getContext().nCtx(), n) ^ true)
 | 
			
		||||
                        throw new Z3Exception(
 | 
			
		||||
                                "Argument was not an array constant");
 | 
			
		||||
                    long fd = Native.getAsArrayFuncDecl(Context().nCtx(), n);
 | 
			
		||||
                    return FuncInterp(new FuncDecl(Context(), fd));
 | 
			
		||||
                    long fd = Native.getAsArrayFuncDecl(getContext().nCtx(), n);
 | 
			
		||||
                    return getFuncInterp(new FuncDecl(getContext(), fd));
 | 
			
		||||
                }
 | 
			
		||||
            } else
 | 
			
		||||
            {
 | 
			
		||||
| 
						 | 
				
			
			@ -93,21 +93,21 @@ public class Model extends Z3Object
 | 
			
		|||
            }
 | 
			
		||||
        } else
 | 
			
		||||
        {
 | 
			
		||||
            long n = Native.modelGetFuncInterp(Context().nCtx(),
 | 
			
		||||
                    NativeObject(), f.NativeObject());
 | 
			
		||||
            long n = Native.modelGetFuncInterp(getContext().nCtx(),
 | 
			
		||||
                    getNativeObject(), f.getNativeObject());
 | 
			
		||||
            if (n == 0)
 | 
			
		||||
                return null;
 | 
			
		||||
            else
 | 
			
		||||
                return new FuncInterp(Context(), n);
 | 
			
		||||
                return new FuncInterp(getContext(), n);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * The number of constants that have an interpretation in the model.
 | 
			
		||||
     **/
 | 
			
		||||
    public int NumConsts() throws Z3Exception
 | 
			
		||||
    public int getNumConsts() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Native.modelGetNumConsts(Context().nCtx(), NativeObject());
 | 
			
		||||
        return Native.modelGetNumConsts(getContext().nCtx(), getNativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
| 
						 | 
				
			
			@ -115,22 +115,22 @@ public class Model extends Z3Object
 | 
			
		|||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public FuncDecl[] ConstDecls() throws Z3Exception
 | 
			
		||||
    public FuncDecl[] getConstDecls() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        int n = NumConsts();
 | 
			
		||||
        int n = getNumConsts();
 | 
			
		||||
        FuncDecl[] res = new FuncDecl[n];
 | 
			
		||||
        for (int i = 0; i < n; i++)
 | 
			
		||||
            res[i] = new FuncDecl(Context(), Native.modelGetConstDecl(Context()
 | 
			
		||||
                    .nCtx(), NativeObject(), i));
 | 
			
		||||
            res[i] = new FuncDecl(getContext(), Native.modelGetConstDecl(getContext()
 | 
			
		||||
                    .nCtx(), getNativeObject(), i));
 | 
			
		||||
        return res;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * The number of function interpretations in the model.
 | 
			
		||||
     **/
 | 
			
		||||
    public int NumFuncs() throws Z3Exception
 | 
			
		||||
    public int getNumFuncs() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Native.modelGetNumFuncs(Context().nCtx(), NativeObject());
 | 
			
		||||
        return Native.modelGetNumFuncs(getContext().nCtx(), getNativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
| 
						 | 
				
			
			@ -138,13 +138,13 @@ public class Model extends Z3Object
 | 
			
		|||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public FuncDecl[] FuncDecls() throws Z3Exception
 | 
			
		||||
    public FuncDecl[] getFuncDecls() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        int n = NumFuncs();
 | 
			
		||||
        int n = getNumFuncs();
 | 
			
		||||
        FuncDecl[] res = new FuncDecl[n];
 | 
			
		||||
        for (int i = 0; i < n; i++)
 | 
			
		||||
            res[i] = new FuncDecl(Context(), Native.modelGetFuncDecl(Context()
 | 
			
		||||
                    .nCtx(), NativeObject(), i));
 | 
			
		||||
            res[i] = new FuncDecl(getContext(), Native.modelGetFuncDecl(getContext()
 | 
			
		||||
                    .nCtx(), getNativeObject(), i));
 | 
			
		||||
        return res;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -153,18 +153,18 @@ public class Model extends Z3Object
 | 
			
		|||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public FuncDecl[] Decls() throws Z3Exception
 | 
			
		||||
    public FuncDecl[] getDecls() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        int nFuncs = NumFuncs();
 | 
			
		||||
        int nConsts = NumConsts();
 | 
			
		||||
        int nFuncs = getNumFuncs();
 | 
			
		||||
        int nConsts = getNumConsts();
 | 
			
		||||
        int n = nFuncs + nConsts;
 | 
			
		||||
        FuncDecl[] res = new FuncDecl[n];
 | 
			
		||||
        for (int i = 0; i < nConsts; i++)
 | 
			
		||||
            res[i] = new FuncDecl(Context(), Native.modelGetConstDecl(Context()
 | 
			
		||||
                    .nCtx(), NativeObject(), i));
 | 
			
		||||
            res[i] = new FuncDecl(getContext(), Native.modelGetConstDecl(getContext()
 | 
			
		||||
                    .nCtx(), getNativeObject(), i));
 | 
			
		||||
        for (int i = 0; i < nFuncs; i++)
 | 
			
		||||
            res[nConsts + i] = new FuncDecl(Context(), Native.modelGetFuncDecl(
 | 
			
		||||
                    Context().nCtx(), NativeObject(), i));
 | 
			
		||||
            res[nConsts + i] = new FuncDecl(getContext(), Native.modelGetFuncDecl(
 | 
			
		||||
                    getContext().nCtx(), getNativeObject(), i));
 | 
			
		||||
        return res;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -197,14 +197,14 @@ public class Model extends Z3Object
 | 
			
		|||
     * @return The evaluation of <paramref name="t"/> in the model.
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public Expr Eval(Expr t, boolean completion) throws Z3Exception
 | 
			
		||||
    public Expr eval(Expr t, boolean completion) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Native.LongPtr v = new Native.LongPtr();
 | 
			
		||||
        if (Native.modelEval(Context().nCtx(), NativeObject(),
 | 
			
		||||
                t.NativeObject(), (completion) ? true : false, v) ^ true)
 | 
			
		||||
        if (Native.modelEval(getContext().nCtx(), getNativeObject(),
 | 
			
		||||
                t.getNativeObject(), (completion) ? true : false, v) ^ true)
 | 
			
		||||
            throw new ModelEvaluationFailedException();
 | 
			
		||||
        else
 | 
			
		||||
            return Expr.Create(Context(), v.value);
 | 
			
		||||
            return Expr.create(getContext(), v.value);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
| 
						 | 
				
			
			@ -212,18 +212,18 @@ public class Model extends Z3Object
 | 
			
		|||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public Expr Evaluate(Expr t, boolean completion) throws Z3Exception
 | 
			
		||||
    public Expr evaluate(Expr t, boolean completion) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Eval(t, completion);
 | 
			
		||||
        return eval(t, completion);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * The number of uninterpreted sorts that the model has an interpretation
 | 
			
		||||
     * for.
 | 
			
		||||
     **/
 | 
			
		||||
    public int NumSorts() throws Z3Exception
 | 
			
		||||
    public int getNumSorts() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Native.modelGetNumSorts(Context().nCtx(), NativeObject());
 | 
			
		||||
        return Native.modelGetNumSorts(getContext().nCtx(), getNativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
| 
						 | 
				
			
			@ -235,14 +235,14 @@ public class Model extends Z3Object
 | 
			
		|||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public Sort[] Sorts() throws Z3Exception
 | 
			
		||||
    public Sort[] getSorts() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
        int n = NumSorts();
 | 
			
		||||
        int n = getNumSorts();
 | 
			
		||||
        Sort[] res = new Sort[n];
 | 
			
		||||
        for (int i = 0; i < n; i++)
 | 
			
		||||
            res[i] = Sort.Create(Context(),
 | 
			
		||||
                    Native.modelGetSort(Context().nCtx(), NativeObject(), i));
 | 
			
		||||
            res[i] = Sort.create(getContext(),
 | 
			
		||||
                    Native.modelGetSort(getContext().nCtx(), getNativeObject(), i));
 | 
			
		||||
        return res;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -255,15 +255,15 @@ public class Model extends Z3Object
 | 
			
		|||
     *         of <paramref name="s"/>
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public Expr[] SortUniverse(Sort s) throws Z3Exception
 | 
			
		||||
    public Expr[] getSortUniverse(Sort s) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
        ASTVector nUniv = new ASTVector(Context(), Native.modelGetSortUniverse(
 | 
			
		||||
                Context().nCtx(), NativeObject(), s.NativeObject()));
 | 
			
		||||
        int n = nUniv.Size();
 | 
			
		||||
        ASTVector nUniv = new ASTVector(getContext(), Native.modelGetSortUniverse(
 | 
			
		||||
                getContext().nCtx(), getNativeObject(), s.getNativeObject()));
 | 
			
		||||
        int n = nUniv.size();
 | 
			
		||||
        Expr[] res = new Expr[n];
 | 
			
		||||
        for (int i = 0; i < n; i++)
 | 
			
		||||
            res[i] = Expr.Create(Context(), nUniv.get(i).NativeObject());
 | 
			
		||||
            res[i] = Expr.create(getContext(), nUniv.get(i).getNativeObject());
 | 
			
		||||
        return res;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -276,7 +276,7 @@ public class Model extends Z3Object
 | 
			
		|||
    {
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
            return Native.modelToString(Context().nCtx(), NativeObject());
 | 
			
		||||
            return Native.modelToString(getContext().nCtx(), getNativeObject());
 | 
			
		||||
        } catch (Z3Exception e)
 | 
			
		||||
        {
 | 
			
		||||
            return "Z3Exception: " + e.getMessage();
 | 
			
		||||
| 
						 | 
				
			
			@ -288,15 +288,15 @@ public class Model extends Z3Object
 | 
			
		|||
        super(ctx, obj);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    void IncRef(long o) throws Z3Exception
 | 
			
		||||
    void incRef(long o) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Context().Model_DRQ().IncAndClear(Context(), o);
 | 
			
		||||
        super.IncRef(o);
 | 
			
		||||
        getContext().model_DRQ().incAndClear(getContext(), o);
 | 
			
		||||
        super.incRef(o);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    void DecRef(long o) throws Z3Exception
 | 
			
		||||
    void decRef(long o) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Context().Model_DRQ().Add(o);
 | 
			
		||||
        super.DecRef(o);
 | 
			
		||||
        getContext().model_DRQ().add(o);
 | 
			
		||||
        super.decRef(o);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -7,7 +7,7 @@ package com.microsoft.z3;
 | 
			
		|||
 | 
			
		||||
class ModelDecRefQueue extends IDecRefQueue
 | 
			
		||||
{
 | 
			
		||||
    public void IncRef(Context ctx, long obj)
 | 
			
		||||
    protected void incRef(Context ctx, long obj)
 | 
			
		||||
    {
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
| 
						 | 
				
			
			@ -18,7 +18,7 @@ class ModelDecRefQueue extends IDecRefQueue
 | 
			
		|||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void DecRef(Context ctx, long obj)
 | 
			
		||||
    protected void decRef(Context ctx, long obj)
 | 
			
		||||
    {
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -6,7 +6,7 @@
 | 
			
		|||
 | 
			
		||||
package com.microsoft.z3;
 | 
			
		||||
 | 
			
		||||
import com.microsoft.z3.enumerations.*;
 | 
			
		||||
import com.microsoft.z3.enumerations.Z3_param_kind;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * A ParamDescrs describes a set of parameters.
 | 
			
		||||
| 
						 | 
				
			
			@ -16,21 +16,21 @@ public class ParamDescrs extends Z3Object
 | 
			
		|||
    /**
 | 
			
		||||
     * validate a set of parameters.
 | 
			
		||||
     **/
 | 
			
		||||
    public void Validate(Params p) throws Z3Exception
 | 
			
		||||
    public void validate(Params p) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
        Native.paramsValidate(Context().nCtx(), p.NativeObject(),
 | 
			
		||||
                NativeObject());
 | 
			
		||||
        Native.paramsValidate(getContext().nCtx(), p.getNativeObject(),
 | 
			
		||||
                getNativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Retrieve kind of parameter.
 | 
			
		||||
     **/
 | 
			
		||||
    public Z3_param_kind GetKind(Symbol name) throws Z3Exception
 | 
			
		||||
    public Z3_param_kind getKind(Symbol name) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
        return Z3_param_kind.fromInt(Native.paramDescrsGetKind(
 | 
			
		||||
                Context().nCtx(), NativeObject(), name.NativeObject()));
 | 
			
		||||
                getContext().nCtx(), getNativeObject(), name.getNativeObject()));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
| 
						 | 
				
			
			@ -38,14 +38,14 @@ public class ParamDescrs extends Z3Object
 | 
			
		|||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public Symbol[] Names() throws Z3Exception
 | 
			
		||||
    public Symbol[] getNames() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        int sz = Native.paramDescrsSize(Context().nCtx(), NativeObject());
 | 
			
		||||
        int sz = Native.paramDescrsSize(getContext().nCtx(), getNativeObject());
 | 
			
		||||
        Symbol[] names = new Symbol[sz];
 | 
			
		||||
        for (int i = 0; i < sz; ++i)
 | 
			
		||||
        {
 | 
			
		||||
            names[i] = Symbol.Create(Context(), Native.paramDescrsGetName(
 | 
			
		||||
                    Context().nCtx(), NativeObject(), i));
 | 
			
		||||
            names[i] = Symbol.create(getContext(), Native.paramDescrsGetName(
 | 
			
		||||
                    getContext().nCtx(), getNativeObject(), i));
 | 
			
		||||
        }
 | 
			
		||||
        return names;
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			@ -53,9 +53,9 @@ public class ParamDescrs extends Z3Object
 | 
			
		|||
    /**
 | 
			
		||||
     * The size of the ParamDescrs.
 | 
			
		||||
     **/
 | 
			
		||||
    public int Size() throws Z3Exception
 | 
			
		||||
    public int size() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Native.paramDescrsSize(Context().nCtx(), NativeObject());
 | 
			
		||||
        return Native.paramDescrsSize(getContext().nCtx(), getNativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
| 
						 | 
				
			
			@ -65,7 +65,7 @@ public class ParamDescrs extends Z3Object
 | 
			
		|||
    {
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
            return Native.paramDescrsToString(Context().nCtx(), NativeObject());
 | 
			
		||||
            return Native.paramDescrsToString(getContext().nCtx(), getNativeObject());
 | 
			
		||||
        } catch (Z3Exception e)
 | 
			
		||||
        {
 | 
			
		||||
            return "Z3Exception: " + e.getMessage();
 | 
			
		||||
| 
						 | 
				
			
			@ -77,15 +77,15 @@ public class ParamDescrs extends Z3Object
 | 
			
		|||
        super(ctx, obj);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    void IncRef(long o) throws Z3Exception
 | 
			
		||||
    void incRef(long o) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Context().ParamDescrs_DRQ().IncAndClear(Context(), o);
 | 
			
		||||
        super.IncRef(o);
 | 
			
		||||
        getContext().paramDescrs_DRQ().incAndClear(getContext(), o);
 | 
			
		||||
        super.incRef(o);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    void DecRef(long o) throws Z3Exception
 | 
			
		||||
    void decRef(long o) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Context().ParamDescrs_DRQ().Add(o);
 | 
			
		||||
        super.DecRef(o);
 | 
			
		||||
        getContext().paramDescrs_DRQ().add(o);
 | 
			
		||||
        super.decRef(o);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -7,7 +7,7 @@ package com.microsoft.z3;
 | 
			
		|||
 | 
			
		||||
class ParamDescrsDecRefQueue extends IDecRefQueue
 | 
			
		||||
{
 | 
			
		||||
    public void IncRef(Context ctx, long obj)
 | 
			
		||||
    protected void incRef(Context ctx, long obj)
 | 
			
		||||
    {
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
| 
						 | 
				
			
			@ -18,7 +18,7 @@ class ParamDescrsDecRefQueue extends IDecRefQueue
 | 
			
		|||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void DecRef(Context ctx, long obj)
 | 
			
		||||
    protected void decRef(Context ctx, long obj)
 | 
			
		||||
    {
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -14,65 +14,65 @@ public class Params extends Z3Object
 | 
			
		|||
    /**
 | 
			
		||||
     * Adds a parameter setting.
 | 
			
		||||
     **/
 | 
			
		||||
    public void Add(Symbol name, boolean value) throws Z3Exception
 | 
			
		||||
    public void add(Symbol name, boolean value) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Native.paramsSetBool(Context().nCtx(), NativeObject(),
 | 
			
		||||
                name.NativeObject(), (value) ? true : false);
 | 
			
		||||
        Native.paramsSetBool(getContext().nCtx(), getNativeObject(),
 | 
			
		||||
                name.getNativeObject(), (value) ? true : false);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Adds a parameter setting.
 | 
			
		||||
     **/
 | 
			
		||||
    public void Add(Symbol name, double value) throws Z3Exception
 | 
			
		||||
    public void add(Symbol name, double value) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Native.paramsSetDouble(Context().nCtx(), NativeObject(),
 | 
			
		||||
                name.NativeObject(), value);
 | 
			
		||||
        Native.paramsSetDouble(getContext().nCtx(), getNativeObject(),
 | 
			
		||||
                name.getNativeObject(), value);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Adds a parameter setting.
 | 
			
		||||
     **/
 | 
			
		||||
    public void Add(Symbol name, Symbol value) throws Z3Exception
 | 
			
		||||
    public void add(Symbol name, Symbol value) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
        Native.paramsSetSymbol(Context().nCtx(), NativeObject(),
 | 
			
		||||
                name.NativeObject(), value.NativeObject());
 | 
			
		||||
        Native.paramsSetSymbol(getContext().nCtx(), getNativeObject(),
 | 
			
		||||
                name.getNativeObject(), value.getNativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Adds a parameter setting.
 | 
			
		||||
     **/
 | 
			
		||||
    public void Add(String name, boolean value) throws Z3Exception
 | 
			
		||||
    public void add(String name, boolean value) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Native.paramsSetBool(Context().nCtx(), NativeObject(), 
 | 
			
		||||
                Context().MkSymbol(name).NativeObject(), value);
 | 
			
		||||
        Native.paramsSetBool(getContext().nCtx(), getNativeObject(), 
 | 
			
		||||
                getContext().mkSymbol(name).getNativeObject(), value);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Adds a parameter setting.
 | 
			
		||||
     **/
 | 
			
		||||
    public void Add(String name, int value) throws Z3Exception
 | 
			
		||||
    public void add(String name, int value) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Native.paramsSetUint(Context().nCtx(), NativeObject(), Context()
 | 
			
		||||
                .MkSymbol(name).NativeObject(), value);
 | 
			
		||||
        Native.paramsSetUint(getContext().nCtx(), getNativeObject(), getContext()
 | 
			
		||||
                .mkSymbol(name).getNativeObject(), value);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Adds a parameter setting.
 | 
			
		||||
     **/
 | 
			
		||||
    public void Add(String name, double value) throws Z3Exception
 | 
			
		||||
    public void add(String name, double value) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Native.paramsSetDouble(Context().nCtx(), NativeObject(), Context()
 | 
			
		||||
                .MkSymbol(name).NativeObject(), value);
 | 
			
		||||
        Native.paramsSetDouble(getContext().nCtx(), getNativeObject(), getContext()
 | 
			
		||||
                .mkSymbol(name).getNativeObject(), value);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Adds a parameter setting.
 | 
			
		||||
     **/
 | 
			
		||||
    public void Add(String name, Symbol value) throws Z3Exception
 | 
			
		||||
    public void add(String name, Symbol value) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Native.paramsSetSymbol(Context().nCtx(), NativeObject(), Context()
 | 
			
		||||
                .MkSymbol(name).NativeObject(), value.NativeObject());
 | 
			
		||||
        Native.paramsSetSymbol(getContext().nCtx(), getNativeObject(), getContext()
 | 
			
		||||
                .mkSymbol(name).getNativeObject(), value.getNativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
| 
						 | 
				
			
			@ -82,7 +82,7 @@ public class Params extends Z3Object
 | 
			
		|||
    {
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
            return Native.paramsToString(Context().nCtx(), NativeObject());
 | 
			
		||||
            return Native.paramsToString(getContext().nCtx(), getNativeObject());
 | 
			
		||||
        } catch (Z3Exception e)
 | 
			
		||||
        {
 | 
			
		||||
            return "Z3Exception: " + e.getMessage();
 | 
			
		||||
| 
						 | 
				
			
			@ -94,15 +94,15 @@ public class Params extends Z3Object
 | 
			
		|||
        super(ctx, Native.mkParams(ctx.nCtx()));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    void IncRef(long o) throws Z3Exception
 | 
			
		||||
    void incRef(long o) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Context().Params_DRQ().IncAndClear(Context(), o);
 | 
			
		||||
        super.IncRef(o);
 | 
			
		||||
        getContext().params_DRQ().incAndClear(getContext(), o);
 | 
			
		||||
        super.incRef(o);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    void DecRef(long o) throws Z3Exception
 | 
			
		||||
    void decRef(long o) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Context().Params_DRQ().Add(o);
 | 
			
		||||
        super.DecRef(o);
 | 
			
		||||
        getContext().params_DRQ().add(o);
 | 
			
		||||
        super.decRef(o);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -7,7 +7,7 @@ package com.microsoft.z3;
 | 
			
		|||
 | 
			
		||||
class ParamsDecRefQueue extends IDecRefQueue
 | 
			
		||||
{
 | 
			
		||||
    public void IncRef(Context ctx, long obj)
 | 
			
		||||
    protected void incRef(Context ctx, long obj)
 | 
			
		||||
    {
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
| 
						 | 
				
			
			@ -18,7 +18,7 @@ class ParamsDecRefQueue extends IDecRefQueue
 | 
			
		|||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void DecRef(Context ctx, long obj)
 | 
			
		||||
    protected void decRef(Context ctx, long obj)
 | 
			
		||||
    {
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -15,9 +15,9 @@ public class Pattern extends AST
 | 
			
		|||
    /**
 | 
			
		||||
     * The number of terms in the pattern.
 | 
			
		||||
     **/
 | 
			
		||||
    public int NumTerms() throws Z3Exception
 | 
			
		||||
    public int getNumTerms() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Native.getPatternNumTerms(Context().nCtx(), NativeObject());
 | 
			
		||||
        return Native.getPatternNumTerms(getContext().nCtx(), getNativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
| 
						 | 
				
			
			@ -25,14 +25,14 @@ public class Pattern extends AST
 | 
			
		|||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public Expr[] Terms() throws Z3Exception
 | 
			
		||||
    public Expr[] getTerms() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
        int n = NumTerms();
 | 
			
		||||
        int n = getNumTerms();
 | 
			
		||||
        Expr[] res = new Expr[n];
 | 
			
		||||
        for (int i = 0; i < n; i++)
 | 
			
		||||
            res[i] = Expr.Create(Context(),
 | 
			
		||||
                    Native.getPattern(Context().nCtx(), NativeObject(), i));
 | 
			
		||||
            res[i] = Expr.create(getContext(),
 | 
			
		||||
                    Native.getPattern(getContext().nCtx(), getNativeObject(), i));
 | 
			
		||||
        return res;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -43,7 +43,7 @@ public class Pattern extends AST
 | 
			
		|||
    {
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
            return Native.patternToString(Context().nCtx(), NativeObject());
 | 
			
		||||
            return Native.patternToString(getContext().nCtx(), getNativeObject());
 | 
			
		||||
        } catch (Z3Exception e)
 | 
			
		||||
        {
 | 
			
		||||
            return "Z3Exception: " + e.getMessage();
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -23,20 +23,11 @@ public class Probe extends Z3Object
 | 
			
		|||
     *         0.0 for false, and a value different from 0.0 for true.
 | 
			
		||||
     * @throws Z3Exception 
 | 
			
		||||
     **/
 | 
			
		||||
    public double Apply(Goal g) throws Z3Exception
 | 
			
		||||
    public double apply(Goal g) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Context().CheckContextMatch(g);
 | 
			
		||||
        return Native.probeApply(Context().nCtx(), NativeObject(),
 | 
			
		||||
                g.NativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Apply the probe to a goal.
 | 
			
		||||
     * @throws Z3Exception 
 | 
			
		||||
     **/
 | 
			
		||||
    public double get(Goal g) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Apply(g);
 | 
			
		||||
        getContext().checkContextMatch(g);
 | 
			
		||||
        return Native.probeApply(getContext().nCtx(), getNativeObject(),
 | 
			
		||||
                g.getNativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    Probe(Context ctx, long obj) throws Z3Exception
 | 
			
		||||
| 
						 | 
				
			
			@ -49,15 +40,15 @@ public class Probe extends Z3Object
 | 
			
		|||
        super(ctx, Native.mkProbe(ctx.nCtx(), name));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    void IncRef(long o) throws Z3Exception
 | 
			
		||||
    void incRef(long o) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Context().Probe_DRQ().IncAndClear(Context(), o);
 | 
			
		||||
        super.IncRef(o);
 | 
			
		||||
        getContext().probe_DRQ().incAndClear(getContext(), o);
 | 
			
		||||
        super.incRef(o);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    void DecRef(long o) throws Z3Exception
 | 
			
		||||
    void decRef(long o) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Context().Probe_DRQ().Add(o);
 | 
			
		||||
        super.DecRef(o);
 | 
			
		||||
        getContext().probe_DRQ().add(o);
 | 
			
		||||
        super.decRef(o);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -7,7 +7,7 @@ package com.microsoft.z3;
 | 
			
		|||
 | 
			
		||||
class ProbeDecRefQueue extends IDecRefQueue
 | 
			
		||||
{
 | 
			
		||||
    public void IncRef(Context ctx, long obj)
 | 
			
		||||
    protected void incRef(Context ctx, long obj)
 | 
			
		||||
    {
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
| 
						 | 
				
			
			@ -18,7 +18,7 @@ class ProbeDecRefQueue extends IDecRefQueue
 | 
			
		|||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void DecRef(Context ctx, long obj)
 | 
			
		||||
    protected void decRef(Context ctx, long obj)
 | 
			
		||||
    {
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -6,7 +6,7 @@
 | 
			
		|||
 | 
			
		||||
package com.microsoft.z3;
 | 
			
		||||
 | 
			
		||||
import com.microsoft.z3.enumerations.*;
 | 
			
		||||
import com.microsoft.z3.enumerations.Z3_ast_kind;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Quantifier expressions.
 | 
			
		||||
| 
						 | 
				
			
			@ -16,34 +16,34 @@ public class Quantifier extends BoolExpr
 | 
			
		|||
    /**
 | 
			
		||||
     * Indicates whether the quantifier is universal.
 | 
			
		||||
     **/
 | 
			
		||||
    public boolean IsUniversal() throws Z3Exception
 | 
			
		||||
    public boolean isUniversal() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Native.isQuantifierForall(Context().nCtx(), NativeObject());
 | 
			
		||||
        return Native.isQuantifierForall(getContext().nCtx(), getNativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Indicates whether the quantifier is existential.
 | 
			
		||||
     **/
 | 
			
		||||
    public boolean IsExistential() throws Z3Exception
 | 
			
		||||
    public boolean isExistential() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return !IsUniversal();
 | 
			
		||||
        return !isUniversal();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * The weight of the quantifier.
 | 
			
		||||
     **/
 | 
			
		||||
    public int Weight() throws Z3Exception
 | 
			
		||||
    public int getWeight() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Native.getQuantifierWeight(Context().nCtx(), NativeObject());
 | 
			
		||||
        return Native.getQuantifierWeight(getContext().nCtx(), getNativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * The number of patterns.
 | 
			
		||||
     **/
 | 
			
		||||
    public int NumPatterns() throws Z3Exception
 | 
			
		||||
    public int getNumPatterns() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Native
 | 
			
		||||
                .getQuantifierNumPatterns(Context().nCtx(), NativeObject());
 | 
			
		||||
                .getQuantifierNumPatterns(getContext().nCtx(), getNativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
| 
						 | 
				
			
			@ -51,23 +51,23 @@ public class Quantifier extends BoolExpr
 | 
			
		|||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public Pattern[] Patterns() throws Z3Exception
 | 
			
		||||
    public Pattern[] getPatterns() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        int n = NumPatterns();
 | 
			
		||||
        int n = getNumPatterns();
 | 
			
		||||
        Pattern[] res = new Pattern[n];
 | 
			
		||||
        for (int i = 0; i < n; i++)
 | 
			
		||||
            res[i] = new Pattern(Context(), Native.getQuantifierPatternAst(
 | 
			
		||||
                    Context().nCtx(), NativeObject(), i));
 | 
			
		||||
            res[i] = new Pattern(getContext(), Native.getQuantifierPatternAst(
 | 
			
		||||
                    getContext().nCtx(), getNativeObject(), i));
 | 
			
		||||
        return res;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * The number of no-patterns.
 | 
			
		||||
     **/
 | 
			
		||||
    public int NumNoPatterns() throws Z3Exception
 | 
			
		||||
    public int getNumNoPatterns() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Native.getQuantifierNumNoPatterns(Context().nCtx(),
 | 
			
		||||
                NativeObject());
 | 
			
		||||
        return Native.getQuantifierNumNoPatterns(getContext().nCtx(),
 | 
			
		||||
                getNativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
| 
						 | 
				
			
			@ -75,22 +75,22 @@ public class Quantifier extends BoolExpr
 | 
			
		|||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public Pattern[] NoPatterns() throws Z3Exception
 | 
			
		||||
    public Pattern[] getNoPatterns() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        int n = NumNoPatterns();
 | 
			
		||||
        int n = getNumNoPatterns();
 | 
			
		||||
        Pattern[] res = new Pattern[n];
 | 
			
		||||
        for (int i = 0; i < n; i++)
 | 
			
		||||
            res[i] = new Pattern(Context(), Native.getQuantifierNoPatternAst(
 | 
			
		||||
                    Context().nCtx(), NativeObject(), i));
 | 
			
		||||
            res[i] = new Pattern(getContext(), Native.getQuantifierNoPatternAst(
 | 
			
		||||
                    getContext().nCtx(), getNativeObject(), i));
 | 
			
		||||
        return res;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * The number of bound variables.
 | 
			
		||||
     **/
 | 
			
		||||
    public int NumBound() throws Z3Exception
 | 
			
		||||
    public int getNumBound() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Native.getQuantifierNumBound(Context().nCtx(), NativeObject());
 | 
			
		||||
        return Native.getQuantifierNumBound(getContext().nCtx(), getNativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
| 
						 | 
				
			
			@ -98,13 +98,13 @@ public class Quantifier extends BoolExpr
 | 
			
		|||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public Symbol[] BoundVariableNames() throws Z3Exception
 | 
			
		||||
    public Symbol[] getBoundVariableNames() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        int n = NumBound();
 | 
			
		||||
        int n = getNumBound();
 | 
			
		||||
        Symbol[] res = new Symbol[n];
 | 
			
		||||
        for (int i = 0; i < n; i++)
 | 
			
		||||
            res[i] = Symbol.Create(Context(), Native.getQuantifierBoundName(
 | 
			
		||||
                    Context().nCtx(), NativeObject(), i));
 | 
			
		||||
            res[i] = Symbol.create(getContext(), Native.getQuantifierBoundName(
 | 
			
		||||
                    getContext().nCtx(), getNativeObject(), i));
 | 
			
		||||
        return res;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -113,13 +113,13 @@ public class Quantifier extends BoolExpr
 | 
			
		|||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public Sort[] BoundVariableSorts() throws Z3Exception
 | 
			
		||||
    public Sort[] getBoundVariableSorts() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        int n = NumBound();
 | 
			
		||||
        int n = getNumBound();
 | 
			
		||||
        Sort[] res = new Sort[n];
 | 
			
		||||
        for (int i = 0; i < n; i++)
 | 
			
		||||
            res[i] = Sort.Create(Context(), Native.getQuantifierBoundSort(
 | 
			
		||||
                    Context().nCtx(), NativeObject(), i));
 | 
			
		||||
            res[i] = Sort.create(getContext(), Native.getQuantifierBoundSort(
 | 
			
		||||
                    getContext().nCtx(), getNativeObject(), i));
 | 
			
		||||
        return res;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -128,10 +128,10 @@ public class Quantifier extends BoolExpr
 | 
			
		|||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public BoolExpr Body() throws Z3Exception
 | 
			
		||||
    public BoolExpr getBody() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return new BoolExpr(Context(), Native.getQuantifierBody(Context()
 | 
			
		||||
                .nCtx(), NativeObject()));
 | 
			
		||||
        return new BoolExpr(getContext(), Native.getQuantifierBody(getContext()
 | 
			
		||||
                .nCtx(), getNativeObject()));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    Quantifier(Context ctx, boolean isForall, Sort[] sorts, Symbol[] names,
 | 
			
		||||
| 
						 | 
				
			
			@ -140,11 +140,11 @@ public class Quantifier extends BoolExpr
 | 
			
		|||
    {
 | 
			
		||||
        super(ctx);
 | 
			
		||||
 | 
			
		||||
        Context().CheckContextMatch(patterns);
 | 
			
		||||
        Context().CheckContextMatch(noPatterns);
 | 
			
		||||
        Context().CheckContextMatch(sorts);
 | 
			
		||||
        Context().CheckContextMatch(names);
 | 
			
		||||
        Context().CheckContextMatch(body);
 | 
			
		||||
        getContext().checkContextMatch(patterns);
 | 
			
		||||
        getContext().checkContextMatch(noPatterns);
 | 
			
		||||
        getContext().checkContextMatch(sorts);
 | 
			
		||||
        getContext().checkContextMatch(names);
 | 
			
		||||
        getContext().checkContextMatch(body);
 | 
			
		||||
 | 
			
		||||
        if (sorts.length != names.length)
 | 
			
		||||
            throw new Z3Exception(
 | 
			
		||||
| 
						 | 
				
			
			@ -153,20 +153,20 @@ public class Quantifier extends BoolExpr
 | 
			
		|||
        if (noPatterns == null && quantifierID == null && skolemID == null)
 | 
			
		||||
        {
 | 
			
		||||
            setNativeObject(Native.mkQuantifier(ctx.nCtx(), (isForall) ? true
 | 
			
		||||
                    : false, weight, AST.ArrayLength(patterns), AST
 | 
			
		||||
                    .ArrayToNative(patterns), AST.ArrayLength(sorts), AST
 | 
			
		||||
                    .ArrayToNative(sorts), Symbol.ArrayToNative(names), body
 | 
			
		||||
                    .NativeObject()));
 | 
			
		||||
                    : false, weight, AST.arrayLength(patterns), AST
 | 
			
		||||
                    .arrayToNative(patterns), AST.arrayLength(sorts), AST
 | 
			
		||||
                    .arrayToNative(sorts), Symbol.arrayToNative(names), body
 | 
			
		||||
                    .getNativeObject()));
 | 
			
		||||
        } 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.NativeObject()));
 | 
			
		||||
		    (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()));
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -176,26 +176,26 @@ public class Quantifier extends BoolExpr
 | 
			
		|||
    {
 | 
			
		||||
        super(ctx);
 | 
			
		||||
 | 
			
		||||
        Context().CheckContextMatch(noPatterns);
 | 
			
		||||
        Context().CheckContextMatch(patterns);
 | 
			
		||||
        getContext().checkContextMatch(noPatterns);
 | 
			
		||||
        getContext().checkContextMatch(patterns);
 | 
			
		||||
        // Context().CheckContextMatch(bound);
 | 
			
		||||
        Context().CheckContextMatch(body);
 | 
			
		||||
        getContext().checkContextMatch(body);
 | 
			
		||||
 | 
			
		||||
        if (noPatterns == null && quantifierID == null && skolemID == null)
 | 
			
		||||
        {
 | 
			
		||||
            setNativeObject(Native.mkQuantifierConst(ctx.nCtx(),
 | 
			
		||||
                    (isForall) ? true : false, weight, AST.ArrayLength(bound),
 | 
			
		||||
                    AST.ArrayToNative(bound), AST.ArrayLength(patterns),
 | 
			
		||||
                    AST.ArrayToNative(patterns), body.NativeObject()));
 | 
			
		||||
                    (isForall) ? true : false, weight, AST.arrayLength(bound),
 | 
			
		||||
                    AST.arrayToNative(bound), AST.arrayLength(patterns),
 | 
			
		||||
                    AST.arrayToNative(patterns), body.getNativeObject()));
 | 
			
		||||
        } else
 | 
			
		||||
        {
 | 
			
		||||
            setNativeObject(Native.mkQuantifierConstEx(ctx.nCtx(),
 | 
			
		||||
                    (isForall) ? true : false, weight,
 | 
			
		||||
                    AST.GetNativeObject(quantifierID),
 | 
			
		||||
                    AST.GetNativeObject(skolemID), AST.ArrayLength(bound),
 | 
			
		||||
                    AST.ArrayToNative(bound), AST.ArrayLength(patterns),
 | 
			
		||||
                    AST.ArrayToNative(patterns), AST.ArrayLength(noPatterns),
 | 
			
		||||
                    AST.ArrayToNative(noPatterns), body.NativeObject()));
 | 
			
		||||
                    AST.getNativeObject(quantifierID),
 | 
			
		||||
                    AST.getNativeObject(skolemID), AST.arrayLength(bound),
 | 
			
		||||
                    AST.arrayToNative(bound), AST.arrayLength(patterns),
 | 
			
		||||
                    AST.arrayToNative(patterns), AST.arrayLength(noPatterns),
 | 
			
		||||
                    AST.arrayToNative(noPatterns), body.getNativeObject()));
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -204,11 +204,11 @@ public class Quantifier extends BoolExpr
 | 
			
		|||
        super(ctx, obj);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    void CheckNativeObject(long obj) throws Z3Exception
 | 
			
		||||
    void checkNativeObject(long obj) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        if (Native.getAstKind(Context().nCtx(), obj) != Z3_ast_kind.Z3_QUANTIFIER_AST
 | 
			
		||||
        if (Native.getAstKind(getContext().nCtx(), obj) != Z3_ast_kind.Z3_QUANTIFIER_AST
 | 
			
		||||
                .toInt())
 | 
			
		||||
            throw new Z3Exception("Underlying object is not a quantifier");
 | 
			
		||||
        super.CheckNativeObject(obj);
 | 
			
		||||
        super.checkNativeObject(obj);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -16,36 +16,36 @@ public class RatNum extends RealExpr
 | 
			
		|||
    /**
 | 
			
		||||
     * The numerator of a rational numeral.
 | 
			
		||||
     **/
 | 
			
		||||
    public IntNum Numerator() throws Z3Exception
 | 
			
		||||
    public IntNum getNumerator() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return new IntNum(Context(), Native.getNumerator(Context().nCtx(),
 | 
			
		||||
                NativeObject()));
 | 
			
		||||
        return new IntNum(getContext(), Native.getNumerator(getContext().nCtx(),
 | 
			
		||||
                getNativeObject()));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * The denominator of a rational numeral.
 | 
			
		||||
     **/
 | 
			
		||||
    public IntNum Denominator() throws Z3Exception
 | 
			
		||||
    public IntNum getDenominator() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return new IntNum(Context(), Native.getDenominator(Context().nCtx(),
 | 
			
		||||
                NativeObject()));
 | 
			
		||||
        return new IntNum(getContext(), Native.getDenominator(getContext().nCtx(),
 | 
			
		||||
                getNativeObject()));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Converts the numerator of the rational to a BigInteger
 | 
			
		||||
     **/
 | 
			
		||||
    public BigInteger BigIntNumerator() throws Z3Exception
 | 
			
		||||
    public BigInteger getBigIntNumerator() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        IntNum n = Numerator();
 | 
			
		||||
        IntNum n = getNumerator();
 | 
			
		||||
        return new BigInteger(n.toString());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Converts the denominator of the rational to a BigInteger
 | 
			
		||||
     **/
 | 
			
		||||
    public BigInteger BigIntDenominator() throws Z3Exception
 | 
			
		||||
    public BigInteger getBigIntDenominator() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        IntNum n = Denominator();
 | 
			
		||||
        IntNum n = getDenominator();
 | 
			
		||||
        return new BigInteger(n.toString());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -53,9 +53,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>
 | 
			
		||||
     **/
 | 
			
		||||
    public String ToDecimalString(int precision) throws Z3Exception
 | 
			
		||||
    public String toDecimalString(int precision) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Native.getNumeralDecimalString(Context().nCtx(), NativeObject(),
 | 
			
		||||
        return Native.getNumeralDecimalString(getContext().nCtx(), getNativeObject(),
 | 
			
		||||
                precision);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -66,7 +66,7 @@ public class RatNum extends RealExpr
 | 
			
		|||
    {
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
            return Native.getNumeralString(Context().nCtx(), NativeObject());
 | 
			
		||||
            return Native.getNumeralString(getContext().nCtx(), getNativeObject());
 | 
			
		||||
        } catch (Z3Exception e)
 | 
			
		||||
        {
 | 
			
		||||
            return "Z3Exception: " + e.getMessage();
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -14,26 +14,26 @@ public class RelationSort extends Sort
 | 
			
		|||
    /**
 | 
			
		||||
     * The arity of the relation sort.
 | 
			
		||||
     **/
 | 
			
		||||
    public int Arity() throws Z3Exception
 | 
			
		||||
    public int getArity() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Native.getRelationArity(Context().nCtx(), NativeObject());
 | 
			
		||||
        return Native.getRelationArity(getContext().nCtx(), getNativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * The sorts of the columns of the relation sort.
 | 
			
		||||
     * @throws Z3Exception 
 | 
			
		||||
     **/
 | 
			
		||||
    public Sort[] ColumnSorts() throws Z3Exception
 | 
			
		||||
    public Sort[] getColumnSorts() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
        if (m_columnSorts != null)
 | 
			
		||||
            return m_columnSorts;
 | 
			
		||||
 | 
			
		||||
        int n = Arity();
 | 
			
		||||
        int n = getArity();
 | 
			
		||||
        Sort[] res = new Sort[n];
 | 
			
		||||
        for (int i = 0; i < n; i++)
 | 
			
		||||
            res[i] = Sort.Create(Context(), Native.getRelationColumn(Context()
 | 
			
		||||
                    .nCtx(), NativeObject(), i));
 | 
			
		||||
            res[i] = Sort.create(getContext(), Native.getRelationColumn(getContext()
 | 
			
		||||
                    .nCtx(), getNativeObject(), i));
 | 
			
		||||
        return res;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -18,6 +18,6 @@ public class SetSort extends Sort
 | 
			
		|||
 | 
			
		||||
    SetSort(Context ctx, Sort ty) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        super(ctx, Native.mkSetSort(ctx.nCtx(), ty.NativeObject()));
 | 
			
		||||
        super(ctx, Native.mkSetSort(ctx.nCtx(), ty.getNativeObject()));
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -6,7 +6,7 @@
 | 
			
		|||
 | 
			
		||||
package com.microsoft.z3;
 | 
			
		||||
 | 
			
		||||
import com.microsoft.z3.enumerations.*;
 | 
			
		||||
import com.microsoft.z3.enumerations.Z3_lbool;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Solvers.
 | 
			
		||||
| 
						 | 
				
			
			@ -16,9 +16,9 @@ public class Solver extends Z3Object
 | 
			
		|||
    /**
 | 
			
		||||
     * A string that describes all available solver parameters.
 | 
			
		||||
     **/
 | 
			
		||||
    public String Help() throws Z3Exception
 | 
			
		||||
    public String getHelp() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Native.solverGetHelp(Context().nCtx(), NativeObject());
 | 
			
		||||
        return Native.solverGetHelp(getContext().nCtx(), getNativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
| 
						 | 
				
			
			@ -28,9 +28,9 @@ public class Solver extends Z3Object
 | 
			
		|||
     **/
 | 
			
		||||
    public void setParameters(Params value) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Context().CheckContextMatch(value);
 | 
			
		||||
        Native.solverSetParams(Context().nCtx(), NativeObject(),
 | 
			
		||||
                value.NativeObject());
 | 
			
		||||
        getContext().checkContextMatch(value);
 | 
			
		||||
        Native.solverSetParams(getContext().nCtx(), getNativeObject(),
 | 
			
		||||
                value.getNativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
| 
						 | 
				
			
			@ -38,35 +38,36 @@ public class Solver extends Z3Object
 | 
			
		|||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public ParamDescrs ParameterDescriptions() throws Z3Exception
 | 
			
		||||
    public ParamDescrs getParameterDescriptions() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return new ParamDescrs(Context(), Native.solverGetParamDescrs(Context()
 | 
			
		||||
                .nCtx(), NativeObject()));
 | 
			
		||||
        return new ParamDescrs(getContext(), Native.solverGetParamDescrs(
 | 
			
		||||
                getContext().nCtx(), getNativeObject()));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * The current number of backtracking points (scopes). <seealso cref="Pop"/>
 | 
			
		||||
     * <seealso cref="Push"/>
 | 
			
		||||
     **/
 | 
			
		||||
    public int NumScopes() throws Z3Exception
 | 
			
		||||
    public int getNumScopes() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Native.solverGetNumScopes(Context().nCtx(), NativeObject());
 | 
			
		||||
        return Native
 | 
			
		||||
                .solverGetNumScopes(getContext().nCtx(), getNativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Creates a backtracking point. <seealso cref="Pop"/>
 | 
			
		||||
     **/
 | 
			
		||||
    public void Push() throws Z3Exception
 | 
			
		||||
    public void push() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Native.solverPush(Context().nCtx(), NativeObject());
 | 
			
		||||
        Native.solverPush(getContext().nCtx(), getNativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Backtracks one backtracking point. <remarks>.
 | 
			
		||||
     **/
 | 
			
		||||
    public void Pop() throws Z3Exception
 | 
			
		||||
    public void pop() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Pop(1);
 | 
			
		||||
        pop(1);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
| 
						 | 
				
			
			@ -74,18 +75,18 @@ public class Solver extends Z3Object
 | 
			
		|||
     * an exception is thrown if <paramref name="n"/> is not smaller than
 | 
			
		||||
     * <code>NumScopes</code></remarks> <seealso cref="Push"/>
 | 
			
		||||
     **/
 | 
			
		||||
    public void Pop(int n) throws Z3Exception
 | 
			
		||||
    public void pop(int n) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Native.solverPop(Context().nCtx(), NativeObject(), n);
 | 
			
		||||
        Native.solverPop(getContext().nCtx(), getNativeObject(), n);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Resets the Solver. <remarks>This removes all assertions from the
 | 
			
		||||
     * solver.</remarks>
 | 
			
		||||
     **/
 | 
			
		||||
    public void Reset() throws Z3Exception
 | 
			
		||||
    public void reset() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Native.solverReset(Context().nCtx(), NativeObject());
 | 
			
		||||
        Native.solverReset(getContext().nCtx(), getNativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
| 
						 | 
				
			
			@ -93,26 +94,62 @@ public class Solver extends Z3Object
 | 
			
		|||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public void Assert(BoolExpr[] constraints) throws Z3Exception
 | 
			
		||||
    public void assert_(BoolExpr... constraints) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Context().CheckContextMatch(constraints);
 | 
			
		||||
        getContext().checkContextMatch(constraints);
 | 
			
		||||
        for (BoolExpr a : constraints)
 | 
			
		||||
        {
 | 
			
		||||
            Native.solverAssert(Context().nCtx(), NativeObject(),
 | 
			
		||||
                    a.NativeObject());
 | 
			
		||||
            Native.solverAssert(getContext().nCtx(), getNativeObject(),
 | 
			
		||||
                    a.getNativeObject());
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Assert one constraint into the solver.
 | 
			
		||||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public void Assert(BoolExpr constraint) throws Z3Exception
 | 
			
		||||
    // / <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>
 | 
			
		||||
    public void assertAndTrack(BoolExpr[] constraints, BoolExpr[] ps) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Context().CheckContextMatch(constraint);
 | 
			
		||||
        Native.solverAssert(Context().nCtx(), NativeObject(),
 | 
			
		||||
                constraint.NativeObject());
 | 
			
		||||
        getContext().checkContextMatch(constraints);
 | 
			
		||||
        getContext().checkContextMatch(ps);
 | 
			
		||||
        if (constraints.length != ps.length)
 | 
			
		||||
            throw new Z3Exception("Argument size mismatch");
 | 
			
		||||
 | 
			
		||||
        for (int i = 0; i < constraints.length; i++)
 | 
			
		||||
            Native.solverAssertAndTrack(getContext().nCtx(), getNativeObject(),
 | 
			
		||||
                    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>
 | 
			
		||||
    public void assertAndTrack(BoolExpr constraint, BoolExpr p) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        getContext().checkContextMatch(constraint);
 | 
			
		||||
        getContext().checkContextMatch(p);
 | 
			
		||||
 | 
			
		||||
        Native.solverAssertAndTrack(getContext().nCtx(), getNativeObject(),
 | 
			
		||||
                constraint.getNativeObject(), p.getNativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
| 
						 | 
				
			
			@ -120,11 +157,11 @@ public class Solver extends Z3Object
 | 
			
		|||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public int NumAssertions() throws Z3Exception
 | 
			
		||||
    public int getNumAssertions() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        ASTVector ass = new ASTVector(Context(), Native.solverGetAssertions(
 | 
			
		||||
                Context().nCtx(), NativeObject()));
 | 
			
		||||
        return ass.Size();
 | 
			
		||||
        ASTVector ass = new ASTVector(getContext(), Native.solverGetAssertions(
 | 
			
		||||
                getContext().nCtx(), getNativeObject()));
 | 
			
		||||
        return ass.size();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
| 
						 | 
				
			
			@ -132,14 +169,14 @@ public class Solver extends Z3Object
 | 
			
		|||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public BoolExpr[] Assertions() throws Z3Exception
 | 
			
		||||
    public BoolExpr[] getAssertions() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        ASTVector ass = new ASTVector(Context(), Native.solverGetAssertions(
 | 
			
		||||
                Context().nCtx(), NativeObject()));
 | 
			
		||||
        int n = ass.Size();
 | 
			
		||||
        ASTVector ass = new ASTVector(getContext(), Native.solverGetAssertions(
 | 
			
		||||
                getContext().nCtx(), getNativeObject()));
 | 
			
		||||
        int n = ass.size();
 | 
			
		||||
        BoolExpr[] res = new BoolExpr[n];
 | 
			
		||||
        for (int i = 0; i < n; i++)
 | 
			
		||||
            res[i] = new BoolExpr(Context(), ass.get(i).NativeObject());
 | 
			
		||||
            res[i] = new BoolExpr(getContext(), ass.get(i).getNativeObject());
 | 
			
		||||
        return res;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -148,16 +185,16 @@ public class Solver extends Z3Object
 | 
			
		|||
     * <remarks> <seealso cref="Model"/> <seealso cref="UnsatCore"/> <seealso
 | 
			
		||||
     * cref="Proof"/> </remarks>
 | 
			
		||||
     **/
 | 
			
		||||
    public Status Check(Expr[] assumptions) throws Z3Exception
 | 
			
		||||
    public Status check(Expr... assumptions) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Z3_lbool r;
 | 
			
		||||
        if (assumptions == null)
 | 
			
		||||
            r = Z3_lbool.fromInt(Native.solverCheck(Context().nCtx(),
 | 
			
		||||
                    NativeObject()));
 | 
			
		||||
            r = Z3_lbool.fromInt(Native.solverCheck(getContext().nCtx(),
 | 
			
		||||
                    getNativeObject()));
 | 
			
		||||
        else
 | 
			
		||||
            r = Z3_lbool.fromInt(Native.solverCheckAssumptions(
 | 
			
		||||
                    Context().nCtx(), NativeObject(), (int) assumptions.length,
 | 
			
		||||
                    AST.ArrayToNative(assumptions)));
 | 
			
		||||
            r = Z3_lbool.fromInt(Native.solverCheckAssumptions(getContext()
 | 
			
		||||
                    .nCtx(), getNativeObject(), (int) assumptions.length, AST
 | 
			
		||||
                    .arrayToNative(assumptions)));
 | 
			
		||||
        switch (r)
 | 
			
		||||
        {
 | 
			
		||||
        case Z3_L_TRUE:
 | 
			
		||||
| 
						 | 
				
			
			@ -174,9 +211,9 @@ public class Solver extends Z3Object
 | 
			
		|||
     * <remarks> <seealso cref="Model"/> <seealso cref="UnsatCore"/> <seealso
 | 
			
		||||
     * cref="Proof"/> </remarks>
 | 
			
		||||
     **/
 | 
			
		||||
    public Status Check() throws Z3Exception
 | 
			
		||||
    public Status check() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Check(null);
 | 
			
		||||
        return check((Expr[]) null);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
| 
						 | 
				
			
			@ -187,13 +224,13 @@ public class Solver extends Z3Object
 | 
			
		|||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public Model Model() throws Z3Exception
 | 
			
		||||
    public Model getModel() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        long x = Native.solverGetModel(Context().nCtx(), NativeObject());
 | 
			
		||||
        long x = Native.solverGetModel(getContext().nCtx(), getNativeObject());
 | 
			
		||||
        if (x == 0)
 | 
			
		||||
            return null;
 | 
			
		||||
        else
 | 
			
		||||
            return new Model(Context(), x);
 | 
			
		||||
            return new Model(getContext(), x);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
| 
						 | 
				
			
			@ -204,13 +241,13 @@ public class Solver extends Z3Object
 | 
			
		|||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public Expr Proof() throws Z3Exception
 | 
			
		||||
    public Expr getProof() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        long x = Native.solverGetProof(Context().nCtx(), NativeObject());
 | 
			
		||||
        long x = Native.solverGetProof(getContext().nCtx(), getNativeObject());
 | 
			
		||||
        if (x == 0)
 | 
			
		||||
            return null;
 | 
			
		||||
        else
 | 
			
		||||
            return Expr.Create(Context(), x);
 | 
			
		||||
            return Expr.create(getContext(), x);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
| 
						 | 
				
			
			@ -221,15 +258,15 @@ public class Solver extends Z3Object
 | 
			
		|||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public Expr[] UnsatCore() throws Z3Exception
 | 
			
		||||
    public Expr[] getUnsatCore() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
        ASTVector core = new ASTVector(Context(), Native.solverGetUnsatCore(
 | 
			
		||||
                Context().nCtx(), NativeObject()));
 | 
			
		||||
        int n = core.Size();
 | 
			
		||||
        ASTVector core = new ASTVector(getContext(), Native.solverGetUnsatCore(
 | 
			
		||||
                getContext().nCtx(), getNativeObject()));
 | 
			
		||||
        int n = core.size();
 | 
			
		||||
        Expr[] res = new Expr[n];
 | 
			
		||||
        for (int i = 0; i < n; i++)
 | 
			
		||||
            res[i] = Expr.Create(Context(), core.get(i).NativeObject());
 | 
			
		||||
            res[i] = Expr.create(getContext(), core.get(i).getNativeObject());
 | 
			
		||||
        return res;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -237,9 +274,10 @@ public class Solver extends Z3Object
 | 
			
		|||
     * A brief justification of why the last call to <code>Check</code> returned
 | 
			
		||||
     * <code>UNKNOWN</code>.
 | 
			
		||||
     **/
 | 
			
		||||
    public String ReasonUnknown() throws Z3Exception
 | 
			
		||||
    public String getReasonUnknown() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Native.solverGetReasonUnknown(Context().nCtx(), NativeObject());
 | 
			
		||||
        return Native.solverGetReasonUnknown(getContext().nCtx(),
 | 
			
		||||
                getNativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
| 
						 | 
				
			
			@ -247,10 +285,10 @@ public class Solver extends Z3Object
 | 
			
		|||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public Statistics Statistics() throws Z3Exception
 | 
			
		||||
    public Statistics getStatistics() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return new Statistics(Context(), Native.solverGetStatistics(Context()
 | 
			
		||||
                .nCtx(), NativeObject()));
 | 
			
		||||
        return new Statistics(getContext(), Native.solverGetStatistics(
 | 
			
		||||
                getContext().nCtx(), getNativeObject()));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
| 
						 | 
				
			
			@ -260,7 +298,8 @@ public class Solver extends Z3Object
 | 
			
		|||
    {
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
            return Native.solverToString(Context().nCtx(), NativeObject());
 | 
			
		||||
            return Native
 | 
			
		||||
                    .solverToString(getContext().nCtx(), getNativeObject());
 | 
			
		||||
        } catch (Z3Exception e)
 | 
			
		||||
        {
 | 
			
		||||
            return "Z3Exception: " + e.getMessage();
 | 
			
		||||
| 
						 | 
				
			
			@ -272,15 +311,15 @@ public class Solver extends Z3Object
 | 
			
		|||
        super(ctx, obj);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    void IncRef(long o) throws Z3Exception
 | 
			
		||||
    void incRef(long o) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Context().Solver_DRQ().IncAndClear(Context(), o);
 | 
			
		||||
        super.IncRef(o);
 | 
			
		||||
        getContext().solver_DRQ().incAndClear(getContext(), o);
 | 
			
		||||
        super.incRef(o);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    void DecRef(long o) throws Z3Exception
 | 
			
		||||
    void decRef(long o) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Context().Solver_DRQ().Add(o);
 | 
			
		||||
        super.DecRef(o);
 | 
			
		||||
        getContext().solver_DRQ().add(o);
 | 
			
		||||
        super.decRef(o);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -7,7 +7,7 @@ package com.microsoft.z3;
 | 
			
		|||
 | 
			
		||||
class SolverDecRefQueue extends IDecRefQueue
 | 
			
		||||
{
 | 
			
		||||
    public void IncRef(Context ctx, long obj)
 | 
			
		||||
    protected void incRef(Context ctx, long obj)
 | 
			
		||||
    {
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
| 
						 | 
				
			
			@ -18,7 +18,7 @@ class SolverDecRefQueue extends IDecRefQueue
 | 
			
		|||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void DecRef(Context ctx, long obj)
 | 
			
		||||
    protected void decRef(Context ctx, long obj)
 | 
			
		||||
    {
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -6,7 +6,8 @@
 | 
			
		|||
 | 
			
		||||
package com.microsoft.z3;
 | 
			
		||||
 | 
			
		||||
import com.microsoft.z3.enumerations.*;
 | 
			
		||||
import com.microsoft.z3.enumerations.Z3_ast_kind;
 | 
			
		||||
import com.microsoft.z3.enumerations.Z3_sort_kind;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * The Sort class implements type information for ASTs.
 | 
			
		||||
| 
						 | 
				
			
			@ -47,7 +48,7 @@ public class Sort extends AST
 | 
			
		|||
	    return false;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return this.NativeObject() == casted.NativeObject();
 | 
			
		||||
	return this.getNativeObject() == casted.getNativeObject();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
| 
						 | 
				
			
			@ -55,35 +56,35 @@ public class Sort extends AST
 | 
			
		|||
     * 
 | 
			
		||||
     * @return A hash code
 | 
			
		||||
     **/
 | 
			
		||||
    public int GetHashCode() throws Z3Exception
 | 
			
		||||
    public int hashCode()
 | 
			
		||||
    {
 | 
			
		||||
        return super.GetHashCode();
 | 
			
		||||
        return super.hashCode();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Returns a unique identifier for the sort.
 | 
			
		||||
     **/
 | 
			
		||||
    public int Id() throws Z3Exception
 | 
			
		||||
    public int getId() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Native.getSortId(Context().nCtx(), NativeObject());
 | 
			
		||||
        return Native.getSortId(getContext().nCtx(), getNativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * The kind of the sort.
 | 
			
		||||
     **/
 | 
			
		||||
    public Z3_sort_kind SortKind() throws Z3Exception
 | 
			
		||||
    public Z3_sort_kind getSortKind() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Z3_sort_kind.fromInt(Native.getSortKind(Context().nCtx(),
 | 
			
		||||
                NativeObject()));
 | 
			
		||||
        return Z3_sort_kind.fromInt(Native.getSortKind(getContext().nCtx(),
 | 
			
		||||
                getNativeObject()));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * The name of the sort
 | 
			
		||||
     **/
 | 
			
		||||
    public Symbol Name() throws Z3Exception
 | 
			
		||||
    public Symbol getName() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Symbol.Create(Context(),
 | 
			
		||||
                Native.getSortName(Context().nCtx(), NativeObject()));
 | 
			
		||||
        return Symbol.create(getContext(),
 | 
			
		||||
                Native.getSortName(getContext().nCtx(), getNativeObject()));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
| 
						 | 
				
			
			@ -93,7 +94,7 @@ public class Sort extends AST
 | 
			
		|||
    {
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
            return Native.sortToString(Context().nCtx(), NativeObject());
 | 
			
		||||
            return Native.sortToString(getContext().nCtx(), getNativeObject());
 | 
			
		||||
        } catch (Z3Exception e)
 | 
			
		||||
        {
 | 
			
		||||
            return "Z3Exception: " + e.getMessage();
 | 
			
		||||
| 
						 | 
				
			
			@ -117,15 +118,15 @@ public class Sort extends AST
 | 
			
		|||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    void CheckNativeObject(long obj) throws Z3Exception
 | 
			
		||||
    void checkNativeObject(long obj) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        if (Native.getAstKind(Context().nCtx(), obj) != Z3_ast_kind.Z3_SORT_AST
 | 
			
		||||
        if (Native.getAstKind(getContext().nCtx(), obj) != Z3_ast_kind.Z3_SORT_AST
 | 
			
		||||
                .toInt())
 | 
			
		||||
            throw new Z3Exception("Underlying object is not a sort");
 | 
			
		||||
        super.CheckNativeObject(obj);
 | 
			
		||||
        super.checkNativeObject(obj);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    static Sort Create(Context ctx, long obj) throws Z3Exception
 | 
			
		||||
    static Sort create(Context ctx, long obj) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        switch (Z3_sort_kind.fromInt(Native.getSortKind(ctx.nCtx(), obj)))
 | 
			
		||||
        {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -25,7 +25,7 @@ public class Statistics extends Z3Object
 | 
			
		|||
        /**
 | 
			
		||||
         * The uint-value of the entry.
 | 
			
		||||
         **/
 | 
			
		||||
        public int UIntValue()
 | 
			
		||||
        public int getUIntValue()
 | 
			
		||||
        {
 | 
			
		||||
            return m_int;
 | 
			
		||||
        }
 | 
			
		||||
| 
						 | 
				
			
			@ -33,7 +33,7 @@ public class Statistics extends Z3Object
 | 
			
		|||
        /**
 | 
			
		||||
         * The double-value of the entry.
 | 
			
		||||
         **/
 | 
			
		||||
        public double DoubleValue()
 | 
			
		||||
        public double getDoubleValue()
 | 
			
		||||
        {
 | 
			
		||||
            return m_double;
 | 
			
		||||
        }
 | 
			
		||||
| 
						 | 
				
			
			@ -41,7 +41,7 @@ public class Statistics extends Z3Object
 | 
			
		|||
        /**
 | 
			
		||||
         * True if the entry is uint-valued.
 | 
			
		||||
         **/
 | 
			
		||||
        public boolean IsUInt()
 | 
			
		||||
        public boolean isUInt()
 | 
			
		||||
        {
 | 
			
		||||
            return m_is_int;
 | 
			
		||||
        }
 | 
			
		||||
| 
						 | 
				
			
			@ -49,7 +49,7 @@ public class Statistics extends Z3Object
 | 
			
		|||
        /**
 | 
			
		||||
         * True if the entry is double-valued.
 | 
			
		||||
         **/
 | 
			
		||||
        public boolean IsDouble()
 | 
			
		||||
        public boolean isDouble()
 | 
			
		||||
        {
 | 
			
		||||
            return m_is_double;
 | 
			
		||||
        }
 | 
			
		||||
| 
						 | 
				
			
			@ -59,11 +59,11 @@ public class Statistics extends Z3Object
 | 
			
		|||
         * 
 | 
			
		||||
         * @throws Z3Exception
 | 
			
		||||
         **/
 | 
			
		||||
        public String Value() throws Z3Exception
 | 
			
		||||
        public String getValueString() throws Z3Exception
 | 
			
		||||
        {
 | 
			
		||||
            if (IsUInt())
 | 
			
		||||
            if (isUInt())
 | 
			
		||||
                return Integer.toString(m_int);
 | 
			
		||||
            else if (IsDouble())
 | 
			
		||||
            else if (isDouble())
 | 
			
		||||
                return Double.toString(m_double);
 | 
			
		||||
            else
 | 
			
		||||
                throw new Z3Exception("Unknown statistical entry type");
 | 
			
		||||
| 
						 | 
				
			
			@ -76,7 +76,7 @@ public class Statistics extends Z3Object
 | 
			
		|||
        {
 | 
			
		||||
            try
 | 
			
		||||
            {
 | 
			
		||||
                return Key + ": " + Value();
 | 
			
		||||
                return Key + ": " + getValueString();
 | 
			
		||||
            } catch (Z3Exception e)
 | 
			
		||||
            {
 | 
			
		||||
                return new String("Z3Exception: " + e.getMessage());
 | 
			
		||||
| 
						 | 
				
			
			@ -110,7 +110,7 @@ public class Statistics extends Z3Object
 | 
			
		|||
    {
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
            return Native.statsToString(Context().nCtx(), NativeObject());
 | 
			
		||||
            return Native.statsToString(getContext().nCtx(), getNativeObject());
 | 
			
		||||
        } catch (Z3Exception e)
 | 
			
		||||
        {
 | 
			
		||||
            return "Z3Exception: " + e.getMessage();
 | 
			
		||||
| 
						 | 
				
			
			@ -120,9 +120,9 @@ public class Statistics extends Z3Object
 | 
			
		|||
    /**
 | 
			
		||||
     * The number of statistical data.
 | 
			
		||||
     **/
 | 
			
		||||
    public int Size() throws Z3Exception
 | 
			
		||||
    public int size() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Native.statsSize(Context().nCtx(), NativeObject());
 | 
			
		||||
        return Native.statsSize(getContext().nCtx(), getNativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
| 
						 | 
				
			
			@ -130,21 +130,21 @@ public class Statistics extends Z3Object
 | 
			
		|||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public Entry[] Entries() throws Z3Exception
 | 
			
		||||
    public Entry[] getEntries() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
        int n = Size();
 | 
			
		||||
        int n = size();
 | 
			
		||||
        Entry[] res = new Entry[n];
 | 
			
		||||
        for (int i = 0; i < n; i++)
 | 
			
		||||
        {
 | 
			
		||||
            Entry e;
 | 
			
		||||
            String k = Native.statsGetKey(Context().nCtx(), NativeObject(), i);
 | 
			
		||||
            if (Native.statsIsUint(Context().nCtx(), NativeObject(), i))
 | 
			
		||||
                e = new Entry(k, Native.statsGetUintValue(Context().nCtx(),
 | 
			
		||||
                        NativeObject(), i));
 | 
			
		||||
            else if (Native.statsIsDouble(Context().nCtx(), NativeObject(), i))
 | 
			
		||||
                e = new Entry(k, Native.statsGetDoubleValue(Context().nCtx(),
 | 
			
		||||
                        NativeObject(), i));
 | 
			
		||||
            String k = Native.statsGetKey(getContext().nCtx(), getNativeObject(), i);
 | 
			
		||||
            if (Native.statsIsUint(getContext().nCtx(), getNativeObject(), i))
 | 
			
		||||
                e = new Entry(k, Native.statsGetUintValue(getContext().nCtx(),
 | 
			
		||||
                        getNativeObject(), i));
 | 
			
		||||
            else if (Native.statsIsDouble(getContext().nCtx(), getNativeObject(), i))
 | 
			
		||||
                e = new Entry(k, Native.statsGetDoubleValue(getContext().nCtx(),
 | 
			
		||||
                        getNativeObject(), i));
 | 
			
		||||
            else
 | 
			
		||||
                throw new Z3Exception("Unknown data entry value");
 | 
			
		||||
            res[i] = e;
 | 
			
		||||
| 
						 | 
				
			
			@ -155,12 +155,12 @@ public class Statistics extends Z3Object
 | 
			
		|||
    /**
 | 
			
		||||
     * The statistical counters.
 | 
			
		||||
     **/
 | 
			
		||||
    public String[] Keys() throws Z3Exception
 | 
			
		||||
    public String[] getKeys() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        int n = Size();
 | 
			
		||||
        int n = size();
 | 
			
		||||
        String[] res = new String[n];
 | 
			
		||||
        for (int i = 0; i < n; i++)
 | 
			
		||||
            res[i] = Native.statsGetKey(Context().nCtx(), NativeObject(), i);
 | 
			
		||||
            res[i] = Native.statsGetKey(getContext().nCtx(), getNativeObject(), i);
 | 
			
		||||
        return res;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -172,8 +172,8 @@ public class Statistics extends Z3Object
 | 
			
		|||
     **/
 | 
			
		||||
    public Entry get(String key) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        int n = Size();
 | 
			
		||||
        Entry[] es = Entries();
 | 
			
		||||
        int n = size();
 | 
			
		||||
        Entry[] es = getEntries();
 | 
			
		||||
        for (int i = 0; i < n; i++)
 | 
			
		||||
            if (es[i].Key == key)
 | 
			
		||||
                return es[i];
 | 
			
		||||
| 
						 | 
				
			
			@ -185,15 +185,15 @@ public class Statistics extends Z3Object
 | 
			
		|||
        super(ctx, obj);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    void IncRef(long o) throws Z3Exception
 | 
			
		||||
    void incRef(long o) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Context().Statistics_DRQ().IncAndClear(Context(), o);
 | 
			
		||||
        super.IncRef(o);
 | 
			
		||||
        getContext().statistics_DRQ().incAndClear(getContext(), o);
 | 
			
		||||
        super.incRef(o);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    void DecRef(long o) throws Z3Exception
 | 
			
		||||
    void decRef(long o) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Context().Statistics_DRQ().Add(o);
 | 
			
		||||
        super.DecRef(o);
 | 
			
		||||
        getContext().statistics_DRQ().add(o);
 | 
			
		||||
        super.decRef(o);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -7,7 +7,7 @@ package com.microsoft.z3;
 | 
			
		|||
 | 
			
		||||
class StatisticsDecRefQueue extends IDecRefQueue
 | 
			
		||||
{
 | 
			
		||||
    public void IncRef(Context ctx, long obj)
 | 
			
		||||
    protected void incRef(Context ctx, long obj)
 | 
			
		||||
    {
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
| 
						 | 
				
			
			@ -18,7 +18,7 @@ class StatisticsDecRefQueue extends IDecRefQueue
 | 
			
		|||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void DecRef(Context ctx, long obj)
 | 
			
		||||
    protected void decRef(Context ctx, long obj)
 | 
			
		||||
    {
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -6,7 +6,7 @@
 | 
			
		|||
 | 
			
		||||
package com.microsoft.z3;
 | 
			
		||||
 | 
			
		||||
import com.microsoft.z3.enumerations.*;
 | 
			
		||||
import com.microsoft.z3.enumerations.Z3_symbol_kind;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Named symbols
 | 
			
		||||
| 
						 | 
				
			
			@ -17,9 +17,9 @@ public class StringSymbol extends Symbol
 | 
			
		|||
     * The string value of the symbol. <remarks>Throws an exception if the
 | 
			
		||||
     * symbol is not of string kind.</remarks>
 | 
			
		||||
     **/
 | 
			
		||||
    public String String() throws Z3Exception
 | 
			
		||||
    public String getString() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Native.getSymbolString(Context().nCtx(), NativeObject());
 | 
			
		||||
        return Native.getSymbolString(getContext().nCtx(), getNativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    StringSymbol(Context ctx, long obj) throws Z3Exception
 | 
			
		||||
| 
						 | 
				
			
			@ -32,12 +32,12 @@ public class StringSymbol extends Symbol
 | 
			
		|||
        super(ctx, Native.mkStringSymbol(ctx.nCtx(), s));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    void CheckNativeObject(long obj) throws Z3Exception
 | 
			
		||||
    void checkNativeObject(long obj) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        if (Native.getSymbolKind(Context().nCtx(), obj) != Z3_symbol_kind.Z3_STRING_SYMBOL
 | 
			
		||||
        if (Native.getSymbolKind(getContext().nCtx(), obj) != Z3_symbol_kind.Z3_STRING_SYMBOL
 | 
			
		||||
                .toInt())
 | 
			
		||||
            throw new Z3Exception("Symbol is not of String kind");
 | 
			
		||||
 | 
			
		||||
        super.CheckNativeObject(obj);
 | 
			
		||||
        super.checkNativeObject(obj);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -6,7 +6,7 @@
 | 
			
		|||
 | 
			
		||||
package com.microsoft.z3;
 | 
			
		||||
 | 
			
		||||
import com.microsoft.z3.enumerations.*;
 | 
			
		||||
import com.microsoft.z3.enumerations.Z3_symbol_kind;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Symbols are used to name several term and type constructors.
 | 
			
		||||
| 
						 | 
				
			
			@ -16,26 +16,26 @@ public class Symbol extends Z3Object
 | 
			
		|||
    /**
 | 
			
		||||
     * The kind of the symbol (int or string)
 | 
			
		||||
     **/
 | 
			
		||||
    protected Z3_symbol_kind Kind() throws Z3Exception
 | 
			
		||||
    protected Z3_symbol_kind getKind() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Z3_symbol_kind.fromInt(Native.getSymbolKind(Context().nCtx(),
 | 
			
		||||
                NativeObject()));
 | 
			
		||||
        return Z3_symbol_kind.fromInt(Native.getSymbolKind(getContext().nCtx(),
 | 
			
		||||
                getNativeObject()));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Indicates whether the symbol is of Int kind
 | 
			
		||||
     **/
 | 
			
		||||
    public boolean IsIntSymbol() throws Z3Exception
 | 
			
		||||
    public boolean isIntSymbol() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Kind() == Z3_symbol_kind.Z3_INT_SYMBOL;
 | 
			
		||||
        return getKind() == Z3_symbol_kind.Z3_INT_SYMBOL;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Indicates whether the symbol is of string kind.
 | 
			
		||||
     **/
 | 
			
		||||
    public boolean IsStringSymbol() throws Z3Exception
 | 
			
		||||
    public boolean isStringSymbol() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Kind() == Z3_symbol_kind.Z3_STRING_SYMBOL;
 | 
			
		||||
        return getKind() == Z3_symbol_kind.Z3_STRING_SYMBOL;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
| 
						 | 
				
			
			@ -45,10 +45,10 @@ public class Symbol extends Z3Object
 | 
			
		|||
    {
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
            if (IsIntSymbol())
 | 
			
		||||
                return Integer.toString(((IntSymbol) this).Int());
 | 
			
		||||
            else if (IsStringSymbol())
 | 
			
		||||
                return ((StringSymbol) this).String();
 | 
			
		||||
            if (isIntSymbol())
 | 
			
		||||
                return Integer.toString(((IntSymbol) this).getInt());
 | 
			
		||||
            else if (isStringSymbol())
 | 
			
		||||
                return ((StringSymbol) this).getString();
 | 
			
		||||
            else
 | 
			
		||||
                return new String(
 | 
			
		||||
                        "Z3Exception: Unknown symbol kind encountered.");
 | 
			
		||||
| 
						 | 
				
			
			@ -66,7 +66,7 @@ public class Symbol extends Z3Object
 | 
			
		|||
        super(ctx, obj);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    static Symbol Create(Context ctx, long obj) throws Z3Exception
 | 
			
		||||
    static Symbol create(Context ctx, long obj) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        switch (Z3_symbol_kind.fromInt(Native.getSymbolKind(ctx.nCtx(), obj)))
 | 
			
		||||
        {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -18,69 +18,57 @@ public class Tactic extends Z3Object
 | 
			
		|||
    /**
 | 
			
		||||
     * A string containing a description of parameters accepted by the tactic.
 | 
			
		||||
     **/
 | 
			
		||||
    public String Help() throws Z3Exception
 | 
			
		||||
    public String getHelp() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Native.tacticGetHelp(Context().nCtx(), NativeObject());
 | 
			
		||||
        return Native.tacticGetHelp(getContext().nCtx(), getNativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Retrieves parameter descriptions for Tactics.
 | 
			
		||||
     * @throws Z3Exception 
 | 
			
		||||
     **/
 | 
			
		||||
    public ParamDescrs ParameterDescriptions() throws Z3Exception
 | 
			
		||||
    public ParamDescrs getParameterDescriptions() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return new ParamDescrs(Context(), Native.tacticGetParamDescrs(Context()
 | 
			
		||||
                .nCtx(), NativeObject()));
 | 
			
		||||
        return new ParamDescrs(getContext(), Native.tacticGetParamDescrs(getContext()
 | 
			
		||||
                .nCtx(), getNativeObject()));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Execute the tactic over the goal.
 | 
			
		||||
     * @throws Z3Exception 
 | 
			
		||||
     **/
 | 
			
		||||
    public ApplyResult Apply(Goal g) throws Z3Exception
 | 
			
		||||
    public ApplyResult apply(Goal g) throws Z3Exception
 | 
			
		||||
    {	
 | 
			
		||||
        return Apply(g, null);
 | 
			
		||||
        return apply(g, null);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Execute the tactic over the goal.
 | 
			
		||||
     * @throws Z3Exception 
 | 
			
		||||
     **/
 | 
			
		||||
    public ApplyResult Apply(Goal g, Params p) throws Z3Exception
 | 
			
		||||
    public ApplyResult apply(Goal g, Params p) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
        Context().CheckContextMatch(g);
 | 
			
		||||
        getContext().checkContextMatch(g);
 | 
			
		||||
        if (p == null)
 | 
			
		||||
            return new ApplyResult(Context(), Native.tacticApply(Context()
 | 
			
		||||
                    .nCtx(), NativeObject(), g.NativeObject()));
 | 
			
		||||
            return new ApplyResult(getContext(), Native.tacticApply(getContext()
 | 
			
		||||
                    .nCtx(), getNativeObject(), g.getNativeObject()));
 | 
			
		||||
        else
 | 
			
		||||
        {
 | 
			
		||||
            Context().CheckContextMatch(p);
 | 
			
		||||
            return new ApplyResult(Context(),
 | 
			
		||||
                    Native.tacticApplyEx(Context().nCtx(), NativeObject(),
 | 
			
		||||
                            g.NativeObject(), p.NativeObject()));
 | 
			
		||||
            getContext().checkContextMatch(p);
 | 
			
		||||
            return new ApplyResult(getContext(),
 | 
			
		||||
                    Native.tacticApplyEx(getContext().nCtx(), getNativeObject(),
 | 
			
		||||
                            g.getNativeObject(), p.getNativeObject()));
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Apply the tactic to a goal.
 | 
			
		||||
     * @throws Z3Exception 
 | 
			
		||||
     **/
 | 
			
		||||
    public ApplyResult get(Goal g) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
        return Apply(g, null);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Creates a solver that is implemented using the given tactic. <seealso
 | 
			
		||||
     * cref="Context.MkSolver(Tactic)"/>
 | 
			
		||||
     * @throws Z3Exception 
 | 
			
		||||
     **/
 | 
			
		||||
    public Solver Solver() throws Z3Exception
 | 
			
		||||
    public Solver getSolver() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
        return Context().MkSolver(this);
 | 
			
		||||
        return getContext().mkSolver(this);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    Tactic(Context ctx, long obj) throws Z3Exception
 | 
			
		||||
| 
						 | 
				
			
			@ -93,15 +81,15 @@ public class Tactic extends Z3Object
 | 
			
		|||
        super(ctx, Native.mkTactic(ctx.nCtx(), name));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    void IncRef(long o) throws Z3Exception
 | 
			
		||||
    void incRef(long o) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Context().Tactic_DRQ().IncAndClear(Context(), o);
 | 
			
		||||
        super.IncRef(o);
 | 
			
		||||
        getContext().tactic_DRQ().incAndClear(getContext(), o);
 | 
			
		||||
        super.incRef(o);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    void DecRef(long o) throws Z3Exception
 | 
			
		||||
    void decRef(long o) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Context().Tactic_DRQ().Add(o);
 | 
			
		||||
        super.DecRef(o);
 | 
			
		||||
        getContext().tactic_DRQ().add(o);
 | 
			
		||||
        super.decRef(o);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -7,7 +7,7 @@ package com.microsoft.z3;
 | 
			
		|||
 | 
			
		||||
class TacticDecRefQueue extends IDecRefQueue
 | 
			
		||||
{
 | 
			
		||||
    public void IncRef(Context ctx, long obj)
 | 
			
		||||
    protected void incRef(Context ctx, long obj)
 | 
			
		||||
    {
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
| 
						 | 
				
			
			@ -18,7 +18,7 @@ class TacticDecRefQueue extends IDecRefQueue
 | 
			
		|||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void DecRef(Context ctx, long obj)
 | 
			
		||||
    protected void decRef(Context ctx, long obj)
 | 
			
		||||
    {
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -15,33 +15,33 @@ public class TupleSort extends Sort
 | 
			
		|||
     * The constructor function of the tuple.
 | 
			
		||||
     * @throws Z3Exception 
 | 
			
		||||
     **/
 | 
			
		||||
    public FuncDecl MkDecl() throws Z3Exception
 | 
			
		||||
    public FuncDecl mkDecl() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
        return new FuncDecl(Context(), Native.getTupleSortMkDecl(Context()
 | 
			
		||||
                .nCtx(), NativeObject()));
 | 
			
		||||
        return new FuncDecl(getContext(), Native.getTupleSortMkDecl(getContext()
 | 
			
		||||
                .nCtx(), getNativeObject()));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * The number of fields in the tuple.
 | 
			
		||||
     **/
 | 
			
		||||
    public int NumFields() throws Z3Exception
 | 
			
		||||
    public int getNumFields() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Native.getTupleSortNumFields(Context().nCtx(), NativeObject());
 | 
			
		||||
        return Native.getTupleSortNumFields(getContext().nCtx(), getNativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * The field declarations.
 | 
			
		||||
     * @throws Z3Exception 
 | 
			
		||||
     **/
 | 
			
		||||
    public FuncDecl[] FieldDecls() throws Z3Exception
 | 
			
		||||
    public FuncDecl[] getFieldDecls() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
        int n = NumFields();
 | 
			
		||||
        int n = getNumFields();
 | 
			
		||||
        FuncDecl[] res = new FuncDecl[n];
 | 
			
		||||
        for (int i = 0; i < n; i++)
 | 
			
		||||
            res[i] = new FuncDecl(Context(), Native.getTupleSortFieldDecl(
 | 
			
		||||
                    Context().nCtx(), NativeObject(), i));
 | 
			
		||||
            res[i] = new FuncDecl(getContext(), Native.getTupleSortFieldDecl(
 | 
			
		||||
                    getContext().nCtx(), getNativeObject(), i));
 | 
			
		||||
        return res;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -51,8 +51,8 @@ public class TupleSort extends Sort
 | 
			
		|||
        super(ctx);
 | 
			
		||||
 | 
			
		||||
        Native.LongPtr t = new Native.LongPtr();
 | 
			
		||||
        setNativeObject(Native.mkTupleSort(ctx.nCtx(), name.NativeObject(),
 | 
			
		||||
                numFields, Symbol.ArrayToNative(fieldNames),
 | 
			
		||||
                AST.ArrayToNative(fieldSorts), t, new long[numFields]));
 | 
			
		||||
        setNativeObject(Native.mkTupleSort(ctx.nCtx(), name.getNativeObject(),
 | 
			
		||||
                numFields, Symbol.arrayToNative(fieldNames),
 | 
			
		||||
                AST.arrayToNative(fieldSorts), t, new long[numFields]));
 | 
			
		||||
    }
 | 
			
		||||
};
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -18,6 +18,6 @@ public class UninterpretedSort extends Sort
 | 
			
		|||
 | 
			
		||||
    UninterpretedSort(Context ctx, Symbol s) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        super(ctx, Native.mkUninterpretedSort(ctx.nCtx(), s.NativeObject()));
 | 
			
		||||
        super(ctx, Native.mkUninterpretedSort(ctx.nCtx(), s.getNativeObject()));
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -14,7 +14,7 @@ public class Version
 | 
			
		|||
    /**
 | 
			
		||||
     * The major version
 | 
			
		||||
     **/
 | 
			
		||||
    public static int Major()
 | 
			
		||||
    public static int getMajor()
 | 
			
		||||
    {
 | 
			
		||||
        Native.IntPtr major = new Native.IntPtr(), minor = new Native.IntPtr(), build = new Native.IntPtr(), revision = new Native.IntPtr();
 | 
			
		||||
        Native.getVersion(major, minor, build, revision);
 | 
			
		||||
| 
						 | 
				
			
			@ -24,7 +24,7 @@ public class Version
 | 
			
		|||
    /**
 | 
			
		||||
     * The minor version
 | 
			
		||||
     **/
 | 
			
		||||
    public static int Minor()
 | 
			
		||||
    public static int getMinor()
 | 
			
		||||
    {
 | 
			
		||||
        Native.IntPtr major = new Native.IntPtr(), minor = new Native.IntPtr(), build = new Native.IntPtr(), revision = new Native.IntPtr();
 | 
			
		||||
        Native.getVersion(major, minor, build, revision);
 | 
			
		||||
| 
						 | 
				
			
			@ -34,7 +34,7 @@ public class Version
 | 
			
		|||
    /**
 | 
			
		||||
     * The build version
 | 
			
		||||
     **/
 | 
			
		||||
    public static int Build()
 | 
			
		||||
    public static int getBuild()
 | 
			
		||||
    {
 | 
			
		||||
        Native.IntPtr major = new Native.IntPtr(), minor = new Native.IntPtr(), build = new Native.IntPtr(), revision = new Native.IntPtr();
 | 
			
		||||
        Native.getVersion(major, minor, build, revision);
 | 
			
		||||
| 
						 | 
				
			
			@ -44,7 +44,7 @@ public class Version
 | 
			
		|||
    /**
 | 
			
		||||
     * The revision
 | 
			
		||||
     **/
 | 
			
		||||
    public static int Revision()
 | 
			
		||||
    public static int getRevision()
 | 
			
		||||
    {
 | 
			
		||||
        Native.IntPtr major = new Native.IntPtr(), minor = new Native.IntPtr(), build = new Native.IntPtr(), revision = new Native.IntPtr();
 | 
			
		||||
        Native.getVersion(major, minor, build, revision);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -6,7 +6,6 @@
 | 
			
		|||
 | 
			
		||||
package com.microsoft.z3;
 | 
			
		||||
 | 
			
		||||
import java.lang.Exception;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * The exception base class for error reporting from Z3
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -17,17 +17,17 @@ public class Z3Object extends IDisposable
 | 
			
		|||
     **/
 | 
			
		||||
    protected void finalize() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Dispose();
 | 
			
		||||
        dispose();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Disposes of the underlying native Z3 object.
 | 
			
		||||
     **/
 | 
			
		||||
    public void Dispose() throws Z3Exception
 | 
			
		||||
    public void dispose() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        if (m_n_obj != 0)
 | 
			
		||||
        {
 | 
			
		||||
            DecRef(m_n_obj);
 | 
			
		||||
            decRef(m_n_obj);
 | 
			
		||||
            m_n_obj = 0;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -51,23 +51,23 @@ public class Z3Object extends IDisposable
 | 
			
		|||
    {
 | 
			
		||||
        ctx.m_refCount++;
 | 
			
		||||
        m_ctx = ctx;
 | 
			
		||||
        IncRef(obj);
 | 
			
		||||
        incRef(obj);
 | 
			
		||||
        m_n_obj = obj;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    void IncRef(long o) throws Z3Exception
 | 
			
		||||
    void incRef(long o) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    void DecRef(long o) throws Z3Exception
 | 
			
		||||
    void decRef(long o) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    void CheckNativeObject(long obj) throws Z3Exception
 | 
			
		||||
    void checkNativeObject(long obj) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    long NativeObject()
 | 
			
		||||
    long getNativeObject()
 | 
			
		||||
    {
 | 
			
		||||
        return m_n_obj;
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			@ -76,39 +76,39 @@ public class Z3Object extends IDisposable
 | 
			
		|||
    {
 | 
			
		||||
        if (value != 0)
 | 
			
		||||
        {
 | 
			
		||||
            CheckNativeObject(value);
 | 
			
		||||
            IncRef(value);
 | 
			
		||||
            checkNativeObject(value);
 | 
			
		||||
            incRef(value);
 | 
			
		||||
        }
 | 
			
		||||
        if (m_n_obj != 0)
 | 
			
		||||
        {
 | 
			
		||||
            DecRef(m_n_obj);
 | 
			
		||||
            decRef(m_n_obj);
 | 
			
		||||
        }
 | 
			
		||||
        m_n_obj = value;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    static long GetNativeObject(Z3Object s)
 | 
			
		||||
    static long getNativeObject(Z3Object s)
 | 
			
		||||
    {
 | 
			
		||||
        if (s == null)
 | 
			
		||||
            return 0;
 | 
			
		||||
        return s.NativeObject();
 | 
			
		||||
        return s.getNativeObject();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    Context Context()
 | 
			
		||||
    Context getContext()
 | 
			
		||||
    {
 | 
			
		||||
        return m_ctx;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    static long[] ArrayToNative(Z3Object[] a)
 | 
			
		||||
    static long[] arrayToNative(Z3Object[] a)
 | 
			
		||||
    {
 | 
			
		||||
        if (a == null)
 | 
			
		||||
            return null;
 | 
			
		||||
        long[] an = new long[a.length];
 | 
			
		||||
        for (int i = 0; i < a.length; i++)
 | 
			
		||||
	    an[i] = (a[i] == null) ? 0 : a[i].NativeObject();
 | 
			
		||||
	    an[i] = (a[i] == null) ? 0 : a[i].getNativeObject();
 | 
			
		||||
        return an;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    static int ArrayLength(Z3Object[] a)
 | 
			
		||||
    static int arrayLength(Z3Object[] a)
 | 
			
		||||
    {
 | 
			
		||||
        return (a == null) ? 0 : a.length;
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue