mirror of
				https://github.com/Z3Prover/z3
				synced 2025-11-04 13:29:11 +00:00 
			
		
		
		
	Java API: Added exception wrappers and build dependencies.
Signed-off-by: Christoph M. Wintersteiger <cwinter@microsoft.com>
This commit is contained in:
		
							parent
							
								
									654c02701c
								
							
						
					
					
						commit
						0c1f2a8281
					
				
					 47 changed files with 4908 additions and 4554 deletions
				
			
		| 
						 | 
				
			
			@ -13,216 +13,222 @@ import com.microsoft.z3.enumerations.*;
 | 
			
		|||
 **/
 | 
			
		||||
public class AST extends Z3Object
 | 
			
		||||
{
 | 
			
		||||
	/**
 | 
			
		||||
	 * Comparison operator. <param name="a">An AST</param> <param name="b">An
 | 
			
		||||
	 * AST</param>
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @return True if <paramref name="a"/> and <paramref name="b"/> are from
 | 
			
		||||
	 *         the same context and represent the same sort; false otherwise.
 | 
			
		||||
	 **/
 | 
			
		||||
	/* Overloaded operators are not translated. */
 | 
			
		||||
    /**
 | 
			
		||||
     * Comparison operator. <param name="a">An AST</param> <param name="b">An
 | 
			
		||||
     * AST</param>
 | 
			
		||||
     * 
 | 
			
		||||
     * @return True if <paramref name="a"/> and <paramref name="b"/> are from
 | 
			
		||||
     *         the same context and represent the same sort; false otherwise.
 | 
			
		||||
     **/
 | 
			
		||||
    /* Overloaded operators are not translated. */
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Comparison operator. <param name="a">An AST</param> <param name="b">An
 | 
			
		||||
	 * AST</param>
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @return True if <paramref name="a"/> and <paramref name="b"/> are not
 | 
			
		||||
	 *         from the same context or represent different sorts; false
 | 
			
		||||
	 *         otherwise.
 | 
			
		||||
	 **/
 | 
			
		||||
	/* Overloaded operators are not translated. */
 | 
			
		||||
    /**
 | 
			
		||||
     * Comparison operator. <param name="a">An AST</param> <param name="b">An
 | 
			
		||||
     * AST</param>
 | 
			
		||||
     * 
 | 
			
		||||
     * @return True if <paramref name="a"/> and <paramref name="b"/> are not
 | 
			
		||||
     *         from the same context or represent different sorts; false
 | 
			
		||||
     *         otherwise.
 | 
			
		||||
     **/
 | 
			
		||||
    /* Overloaded operators are not translated. */
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Object comparison.
 | 
			
		||||
	 **/
 | 
			
		||||
	public boolean Equals(Object o)
 | 
			
		||||
	{
 | 
			
		||||
		AST casted = (AST) o;
 | 
			
		||||
		if (casted == null)
 | 
			
		||||
			return false;
 | 
			
		||||
		return this == casted;
 | 
			
		||||
	}
 | 
			
		||||
    /**
 | 
			
		||||
     * Object comparison.
 | 
			
		||||
     **/
 | 
			
		||||
    public boolean equals(Object o)
 | 
			
		||||
    {
 | 
			
		||||
        AST casted = (AST) o;
 | 
			
		||||
        if (casted == null)
 | 
			
		||||
            return false;
 | 
			
		||||
        return this == casted;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Object Comparison. <param name="other">Another AST</param>
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @return Negative if the object should be sorted before <paramref
 | 
			
		||||
	 *         name="other"/>, positive if after else zero.
 | 
			
		||||
	 **/
 | 
			
		||||
	public int CompareTo(Object other) throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		if (other == null)
 | 
			
		||||
			return 1;
 | 
			
		||||
		AST oAST = (AST) other;
 | 
			
		||||
		if (oAST == null)
 | 
			
		||||
			return 1;
 | 
			
		||||
		else
 | 
			
		||||
		{
 | 
			
		||||
			if (Id() < oAST.Id())
 | 
			
		||||
				return -1;
 | 
			
		||||
			else if (Id() > oAST.Id())
 | 
			
		||||
				return +1;
 | 
			
		||||
			else
 | 
			
		||||
				return 0;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
    /**
 | 
			
		||||
     * Object Comparison. <param name="other">Another AST</param>
 | 
			
		||||
     * 
 | 
			
		||||
     * @return Negative if the object should be sorted before <paramref
 | 
			
		||||
     *         name="other"/>, positive if after else zero.
 | 
			
		||||
     **/
 | 
			
		||||
    public int compareTo(Object other) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        if (other == null)
 | 
			
		||||
            return 1;
 | 
			
		||||
        AST oAST = (AST) other;
 | 
			
		||||
        if (oAST == null)
 | 
			
		||||
            return 1;
 | 
			
		||||
        else
 | 
			
		||||
        {
 | 
			
		||||
            if (Id() < oAST.Id())
 | 
			
		||||
                return -1;
 | 
			
		||||
            else if (Id() > oAST.Id())
 | 
			
		||||
                return +1;
 | 
			
		||||
            else
 | 
			
		||||
                return 0;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * The AST's hash code.
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @return A hash code
 | 
			
		||||
	 **/
 | 
			
		||||
	public int GetHashCode() throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		return (int) Native.getAstHash(Context().nCtx(), NativeObject());
 | 
			
		||||
	}
 | 
			
		||||
    /**
 | 
			
		||||
     * The AST's hash code.
 | 
			
		||||
     * 
 | 
			
		||||
     * @return A hash code
 | 
			
		||||
     **/
 | 
			
		||||
    public int GetHashCode() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return (int) Native.getAstHash(Context().nCtx(), NativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * A unique identifier for the AST (unique among all ASTs).
 | 
			
		||||
	 **/
 | 
			
		||||
	public int Id() throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		return Native.getAstId(Context().nCtx(), NativeObject());
 | 
			
		||||
	}
 | 
			
		||||
    /**
 | 
			
		||||
     * A unique identifier for the AST (unique among all ASTs).
 | 
			
		||||
     **/
 | 
			
		||||
    public int Id() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Native.getAstId(Context().nCtx(), NativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Translates (copies) the AST to the Context <paramref name="ctx"/>. <param
 | 
			
		||||
	 * name="ctx">A context</param>
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @return A copy of the AST which is associated with <paramref name="ctx"/>
 | 
			
		||||
	 **/
 | 
			
		||||
	public AST Translate(Context ctx) throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
    /**
 | 
			
		||||
     * Translates (copies) the AST to the Context <paramref name="ctx"/>. <param
 | 
			
		||||
     * name="ctx">A context</param>
 | 
			
		||||
     * 
 | 
			
		||||
     * @return A copy of the AST which is associated with <paramref name="ctx"/>
 | 
			
		||||
     **/
 | 
			
		||||
    public AST Translate(Context ctx) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
		if (Context() == ctx)
 | 
			
		||||
			return this;
 | 
			
		||||
		else
 | 
			
		||||
			return new AST(ctx, Native.translate(Context().nCtx(),
 | 
			
		||||
					NativeObject(), ctx.nCtx()));
 | 
			
		||||
	}
 | 
			
		||||
        if (Context() == ctx)
 | 
			
		||||
            return this;
 | 
			
		||||
        else
 | 
			
		||||
            return new AST(ctx, Native.translate(Context().nCtx(),
 | 
			
		||||
                    NativeObject(), ctx.nCtx()));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * The kind of the AST.
 | 
			
		||||
	 **/
 | 
			
		||||
	public Z3_ast_kind ASTKind()
 | 
			
		||||
	{
 | 
			
		||||
		return Z3_ast_kind.fromInt(Native.getAstKind(Context().nCtx(),
 | 
			
		||||
				NativeObject()));
 | 
			
		||||
	}
 | 
			
		||||
    /**
 | 
			
		||||
     * The kind of the AST.
 | 
			
		||||
     **/
 | 
			
		||||
    public Z3_ast_kind ASTKind() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Z3_ast_kind.fromInt(Native.getAstKind(Context().nCtx(),
 | 
			
		||||
                NativeObject()));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Indicates whether the AST is an Expr
 | 
			
		||||
	 **/
 | 
			
		||||
	public boolean IsExpr() throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		switch (ASTKind())
 | 
			
		||||
		{
 | 
			
		||||
		case Z3_APP_AST:
 | 
			
		||||
		case Z3_NUMERAL_AST:
 | 
			
		||||
		case Z3_QUANTIFIER_AST:
 | 
			
		||||
		case Z3_VAR_AST:
 | 
			
		||||
			return true;
 | 
			
		||||
		default:
 | 
			
		||||
			return false;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
    /**
 | 
			
		||||
     * Indicates whether the AST is an Expr
 | 
			
		||||
     **/
 | 
			
		||||
    public boolean IsExpr() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        switch (ASTKind())
 | 
			
		||||
        {
 | 
			
		||||
        case Z3_APP_AST:
 | 
			
		||||
        case Z3_NUMERAL_AST:
 | 
			
		||||
        case Z3_QUANTIFIER_AST:
 | 
			
		||||
        case Z3_VAR_AST:
 | 
			
		||||
            return true;
 | 
			
		||||
        default:
 | 
			
		||||
            return false;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Indicates whether the AST is a BoundVariable
 | 
			
		||||
	 **/
 | 
			
		||||
	public boolean IsVar() throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		return this.ASTKind() == Z3_ast_kind.Z3_VAR_AST;
 | 
			
		||||
	}
 | 
			
		||||
    /**
 | 
			
		||||
     * Indicates whether the AST is a BoundVariable
 | 
			
		||||
     **/
 | 
			
		||||
    public boolean IsVar() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return this.ASTKind() == Z3_ast_kind.Z3_VAR_AST;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Indicates whether the AST is a Quantifier
 | 
			
		||||
	 **/
 | 
			
		||||
	public boolean IsQuantifier() throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		return this.ASTKind() == Z3_ast_kind.Z3_QUANTIFIER_AST;
 | 
			
		||||
	}
 | 
			
		||||
    /**
 | 
			
		||||
     * Indicates whether the AST is a Quantifier
 | 
			
		||||
     **/
 | 
			
		||||
    public boolean IsQuantifier() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return this.ASTKind() == Z3_ast_kind.Z3_QUANTIFIER_AST;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Indicates whether the AST is a Sort
 | 
			
		||||
	 **/
 | 
			
		||||
	public boolean IsSort() throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		return this.ASTKind() == Z3_ast_kind.Z3_SORT_AST;
 | 
			
		||||
	}
 | 
			
		||||
    /**
 | 
			
		||||
     * Indicates whether the AST is a Sort
 | 
			
		||||
     **/
 | 
			
		||||
    public boolean IsSort() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return this.ASTKind() == Z3_ast_kind.Z3_SORT_AST;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Indicates whether the AST is a FunctionDeclaration
 | 
			
		||||
	 **/
 | 
			
		||||
	public boolean IsFuncDecl() throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		return this.ASTKind() == Z3_ast_kind.Z3_FUNC_DECL_AST;
 | 
			
		||||
	}
 | 
			
		||||
    /**
 | 
			
		||||
     * Indicates whether the AST is a FunctionDeclaration
 | 
			
		||||
     **/
 | 
			
		||||
    public boolean IsFuncDecl() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return this.ASTKind() == Z3_ast_kind.Z3_FUNC_DECL_AST;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * A string representation of the AST.
 | 
			
		||||
	 **/
 | 
			
		||||
	public String toString()
 | 
			
		||||
	{
 | 
			
		||||
		return Native.astToString(Context().nCtx(), NativeObject());
 | 
			
		||||
	}
 | 
			
		||||
    /**
 | 
			
		||||
     * A string representation of the AST.
 | 
			
		||||
     **/
 | 
			
		||||
    public String toString()
 | 
			
		||||
    {
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
            return Native.astToString(Context().nCtx(), NativeObject());
 | 
			
		||||
        } catch (Z3Exception e)
 | 
			
		||||
        {
 | 
			
		||||
            return "Z3Exception: " + e.getMessage();
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * A string representation of the AST in s-expression notation.
 | 
			
		||||
	 **/
 | 
			
		||||
	public String SExpr() throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		return Native.astToString(Context().nCtx(), NativeObject());
 | 
			
		||||
	}
 | 
			
		||||
    /**
 | 
			
		||||
     * A string representation of the AST in s-expression notation.
 | 
			
		||||
     **/
 | 
			
		||||
    public String SExpr() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Native.astToString(Context().nCtx(), NativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	AST(Context ctx)
 | 
			
		||||
	{
 | 
			
		||||
		super(ctx);
 | 
			
		||||
	}
 | 
			
		||||
    AST(Context ctx)
 | 
			
		||||
    {
 | 
			
		||||
        super(ctx);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	AST(Context ctx, long obj) throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		super(ctx, obj);
 | 
			
		||||
	}
 | 
			
		||||
    AST(Context ctx, long obj) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        super(ctx, obj);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	void IncRef(long o) throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		// Console.WriteLine("AST IncRef()");
 | 
			
		||||
		if (Context() == 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);
 | 
			
		||||
	}
 | 
			
		||||
    void IncRef(long o) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        // Console.WriteLine("AST IncRef()");
 | 
			
		||||
        if (Context() == 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);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	void DecRef(long o) throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		// Console.WriteLine("AST DecRef()");
 | 
			
		||||
		if (Context() == 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);
 | 
			
		||||
	}
 | 
			
		||||
    void DecRef(long o) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        // Console.WriteLine("AST DecRef()");
 | 
			
		||||
        if (Context() == 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);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	static AST Create(Context ctx, long obj) throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		switch (Z3_ast_kind.fromInt(Native.getAstKind(ctx.nCtx(), obj)))
 | 
			
		||||
		{
 | 
			
		||||
		case Z3_FUNC_DECL_AST:
 | 
			
		||||
			return new FuncDecl(ctx, obj);
 | 
			
		||||
		case Z3_QUANTIFIER_AST:
 | 
			
		||||
			return new Quantifier(ctx, obj);
 | 
			
		||||
		case Z3_SORT_AST:
 | 
			
		||||
			return Sort.Create(ctx, obj);
 | 
			
		||||
		case Z3_APP_AST:
 | 
			
		||||
		case Z3_NUMERAL_AST:
 | 
			
		||||
		case Z3_VAR_AST:
 | 
			
		||||
			return Expr.Create(ctx, obj);
 | 
			
		||||
		default:
 | 
			
		||||
			throw new Z3Exception("Unknown AST kind");
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
    static AST Create(Context ctx, long obj) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        switch (Z3_ast_kind.fromInt(Native.getAstKind(ctx.nCtx(), obj)))
 | 
			
		||||
        {
 | 
			
		||||
        case Z3_FUNC_DECL_AST:
 | 
			
		||||
            return new FuncDecl(ctx, obj);
 | 
			
		||||
        case Z3_QUANTIFIER_AST:
 | 
			
		||||
            return new Quantifier(ctx, obj);
 | 
			
		||||
        case Z3_SORT_AST:
 | 
			
		||||
            return Sort.Create(ctx, obj);
 | 
			
		||||
        case Z3_APP_AST:
 | 
			
		||||
        case Z3_NUMERAL_AST:
 | 
			
		||||
        case Z3_VAR_AST:
 | 
			
		||||
            return Expr.Create(ctx, obj);
 | 
			
		||||
        default:
 | 
			
		||||
            throw new Z3Exception("Unknown AST kind");
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -7,13 +7,25 @@ package com.microsoft.z3;
 | 
			
		|||
 | 
			
		||||
public class ASTDecRefQueue extends IDecRefQueue
 | 
			
		||||
{
 | 
			
		||||
	public void IncRef(Context ctx, long obj)
 | 
			
		||||
	{
 | 
			
		||||
		Native.incRef(ctx.nCtx(), obj);
 | 
			
		||||
	}
 | 
			
		||||
    public void IncRef(Context ctx, long obj)
 | 
			
		||||
    {
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
            Native.incRef(ctx.nCtx(), obj);
 | 
			
		||||
        } catch (Z3Exception e)
 | 
			
		||||
        {
 | 
			
		||||
            // OK.
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	public void DecRef(Context ctx, long obj)
 | 
			
		||||
	{
 | 
			
		||||
		Native.decRef(ctx.nCtx(), obj);
 | 
			
		||||
	}
 | 
			
		||||
    public void DecRef(Context ctx, long obj)
 | 
			
		||||
    {
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
            Native.decRef(ctx.nCtx(), obj);
 | 
			
		||||
        } catch (Z3Exception e)
 | 
			
		||||
        {
 | 
			
		||||
            // OK.
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
};
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -11,106 +11,114 @@ package com.microsoft.z3;
 | 
			
		|||
 **/
 | 
			
		||||
class ASTMap extends Z3Object
 | 
			
		||||
{
 | 
			
		||||
	/**
 | 
			
		||||
	 * Checks whether the map contains the key <paramref name="k"/>. <param
 | 
			
		||||
	 * name="k">An AST</param>
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @return True if <paramref name="k"/> is a key in the map, false
 | 
			
		||||
	 *         otherwise.
 | 
			
		||||
	 **/
 | 
			
		||||
	public boolean Contains(AST k)
 | 
			
		||||
	{
 | 
			
		||||
    /**
 | 
			
		||||
     * Checks whether the map contains the key <paramref name="k"/>. <param
 | 
			
		||||
     * name="k">An AST</param>
 | 
			
		||||
     * 
 | 
			
		||||
     * @return True if <paramref name="k"/> is a key in the map, false
 | 
			
		||||
     *         otherwise.
 | 
			
		||||
     **/
 | 
			
		||||
    public boolean Contains(AST k) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
		return Native.astMapContains(Context().nCtx(), NativeObject(),
 | 
			
		||||
				k.NativeObject());
 | 
			
		||||
	}
 | 
			
		||||
        return Native.astMapContains(Context().nCtx(), NativeObject(),
 | 
			
		||||
                k.NativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Finds the value associated with the key <paramref name="k"/>. <remarks>
 | 
			
		||||
	 * This function signs an error when <paramref name="k"/> is not a key in
 | 
			
		||||
	 * the map. </remarks> <param name="k">An AST</param>
 | 
			
		||||
	 * @throws Z3Exception 
 | 
			
		||||
	 **/
 | 
			
		||||
	public AST Find(AST k) throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		return new AST(Context(), Native.astMapFind(Context().nCtx(),
 | 
			
		||||
				NativeObject(), k.NativeObject()));
 | 
			
		||||
	}
 | 
			
		||||
    /**
 | 
			
		||||
     * Finds the value associated with the key <paramref name="k"/>. <remarks>
 | 
			
		||||
     * This function signs an error when <paramref name="k"/> is not a key in
 | 
			
		||||
     * the map. </remarks> <param name="k">An AST</param>
 | 
			
		||||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public AST Find(AST k) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return new AST(Context(), Native.astMapFind(Context().nCtx(),
 | 
			
		||||
                NativeObject(), k.NativeObject()));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * 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)
 | 
			
		||||
	{
 | 
			
		||||
    /**
 | 
			
		||||
     * 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
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
		Native.astMapInsert(Context().nCtx(), NativeObject(), k.NativeObject(),
 | 
			
		||||
				v.NativeObject());
 | 
			
		||||
	}
 | 
			
		||||
        Native.astMapInsert(Context().nCtx(), NativeObject(), k.NativeObject(),
 | 
			
		||||
                v.NativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Erases the key <paramref name="k"/> from the map. <param name="k">An
 | 
			
		||||
	 * AST</param>
 | 
			
		||||
	 **/
 | 
			
		||||
	public void Erase(AST k)
 | 
			
		||||
	{
 | 
			
		||||
    /**
 | 
			
		||||
     * Erases the key <paramref name="k"/> from the map. <param name="k">An
 | 
			
		||||
     * AST</param>
 | 
			
		||||
     **/
 | 
			
		||||
    public void Erase(AST k) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
		Native.astMapErase(Context().nCtx(), NativeObject(), k.NativeObject());
 | 
			
		||||
	}
 | 
			
		||||
        Native.astMapErase(Context().nCtx(), NativeObject(), k.NativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Removes all keys from the map.
 | 
			
		||||
	 **/
 | 
			
		||||
	public void Reset()
 | 
			
		||||
	{
 | 
			
		||||
		Native.astMapReset(Context().nCtx(), NativeObject());
 | 
			
		||||
	}
 | 
			
		||||
    /**
 | 
			
		||||
     * Removes all keys from the map.
 | 
			
		||||
     **/
 | 
			
		||||
    public void Reset() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Native.astMapReset(Context().nCtx(), NativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * The size of the map
 | 
			
		||||
	 **/
 | 
			
		||||
	public int Size()
 | 
			
		||||
	{
 | 
			
		||||
		return Native.astMapSize(Context().nCtx(), NativeObject());
 | 
			
		||||
	}
 | 
			
		||||
    /**
 | 
			
		||||
     * The size of the map
 | 
			
		||||
     **/
 | 
			
		||||
    public int Size() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Native.astMapSize(Context().nCtx(), NativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * The keys stored in the map.
 | 
			
		||||
	 * @throws Z3Exception 
 | 
			
		||||
	 **/
 | 
			
		||||
	public ASTVector Keys() throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		return new ASTVector(Context(), Native.astMapKeys(Context().nCtx(),
 | 
			
		||||
				NativeObject()));
 | 
			
		||||
	}
 | 
			
		||||
    /**
 | 
			
		||||
     * The keys stored in the map.
 | 
			
		||||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public ASTVector Keys() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return new ASTVector(Context(), Native.astMapKeys(Context().nCtx(),
 | 
			
		||||
                NativeObject()));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Retrieves a string representation of the map.
 | 
			
		||||
	 **/
 | 
			
		||||
	public String toString()
 | 
			
		||||
	{
 | 
			
		||||
		return Native.astMapToString(Context().nCtx(), NativeObject());
 | 
			
		||||
	}
 | 
			
		||||
    /**
 | 
			
		||||
     * Retrieves a string representation of the map.
 | 
			
		||||
     **/
 | 
			
		||||
    public String toString()
 | 
			
		||||
    {
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
            return Native.astMapToString(Context().nCtx(), NativeObject());
 | 
			
		||||
        } catch (Z3Exception e)
 | 
			
		||||
        {
 | 
			
		||||
            return "Z3Exception: " + e.getMessage();
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	ASTMap(Context ctx, long obj) throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		super(ctx, obj);
 | 
			
		||||
	}
 | 
			
		||||
    ASTMap(Context ctx, long obj) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        super(ctx, obj);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	ASTMap(Context ctx) throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		super(ctx, Native.mkAstMap(ctx.nCtx()));
 | 
			
		||||
	}
 | 
			
		||||
    ASTMap(Context ctx) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        super(ctx, Native.mkAstMap(ctx.nCtx()));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	void IncRef(long o) throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		Context().ASTMap_DRQ().IncAndClear(Context(), o);
 | 
			
		||||
		super.IncRef(o);
 | 
			
		||||
	}
 | 
			
		||||
    void IncRef(long o) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Context().ASTMap_DRQ().IncAndClear(Context(), o);
 | 
			
		||||
        super.IncRef(o);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	void DecRef(long o) throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		Context().ASTMap_DRQ().Add(o);
 | 
			
		||||
		super.DecRef(o);
 | 
			
		||||
	}
 | 
			
		||||
    void DecRef(long o) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Context().ASTMap_DRQ().Add(o);
 | 
			
		||||
        super.DecRef(o);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -11,94 +11,99 @@ package com.microsoft.z3;
 | 
			
		|||
 **/
 | 
			
		||||
class ASTVector extends Z3Object
 | 
			
		||||
{
 | 
			
		||||
	/**
 | 
			
		||||
	 * The size of the vector
 | 
			
		||||
	 **/
 | 
			
		||||
	public int Size()
 | 
			
		||||
	{
 | 
			
		||||
		return Native.astVectorSize(Context().nCtx(), NativeObject());
 | 
			
		||||
	}
 | 
			
		||||
    /**
 | 
			
		||||
     * The size of the vector
 | 
			
		||||
     **/
 | 
			
		||||
    public int Size() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Native.astVectorSize(Context().nCtx(), NativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Retrieves the i-th object in the vector. <remarks>May throw an
 | 
			
		||||
	 * IndexOutOfBoundsException when <paramref name="i"/> is out of
 | 
			
		||||
	 * range.</remarks> <param name="i">Index</param>
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @return An AST
 | 
			
		||||
	 * @throws Z3Exception
 | 
			
		||||
	 **/
 | 
			
		||||
	public AST get(int i) throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		return new AST(Context(), Native.astVectorGet(Context().nCtx(),
 | 
			
		||||
				NativeObject(), i));
 | 
			
		||||
	}
 | 
			
		||||
    /**
 | 
			
		||||
     * Retrieves the i-th object in the vector. <remarks>May throw an
 | 
			
		||||
     * IndexOutOfBoundsException when <paramref name="i"/> is out of
 | 
			
		||||
     * range.</remarks> <param name="i">Index</param>
 | 
			
		||||
     * 
 | 
			
		||||
     * @return An AST
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public AST get(int i) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return new AST(Context(), Native.astVectorGet(Context().nCtx(),
 | 
			
		||||
                NativeObject(), i));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	public void set(int i, AST value)
 | 
			
		||||
	{
 | 
			
		||||
    public void set(int i, AST value) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
		Native.astVectorSet(Context().nCtx(), NativeObject(), i,
 | 
			
		||||
				value.NativeObject());
 | 
			
		||||
	}
 | 
			
		||||
        Native.astVectorSet(Context().nCtx(), NativeObject(), i,
 | 
			
		||||
                value.NativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Resize the vector to <paramref name="newSize"/>. <param
 | 
			
		||||
	 * name="newSize">The new size of the vector.</param>
 | 
			
		||||
	 **/
 | 
			
		||||
	public void Resize(int newSize)
 | 
			
		||||
	{
 | 
			
		||||
		Native.astVectorResize(Context().nCtx(), NativeObject(), newSize);
 | 
			
		||||
	}
 | 
			
		||||
    /**
 | 
			
		||||
     * Resize the vector to <paramref name="newSize"/>. <param
 | 
			
		||||
     * name="newSize">The new size of the vector.</param>
 | 
			
		||||
     **/
 | 
			
		||||
    public void Resize(int newSize) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Native.astVectorResize(Context().nCtx(), NativeObject(), 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)
 | 
			
		||||
	{
 | 
			
		||||
    /**
 | 
			
		||||
     * 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
 | 
			
		||||
    {
 | 
			
		||||
        Native.astVectorPush(Context().nCtx(), NativeObject(), a.NativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
		Native.astVectorPush(Context().nCtx(), NativeObject(), a.NativeObject());
 | 
			
		||||
	}
 | 
			
		||||
    /**
 | 
			
		||||
     * Translates all ASTs in the vector to <paramref name="ctx"/>. <param
 | 
			
		||||
     * name="ctx">A context</param>
 | 
			
		||||
     * 
 | 
			
		||||
     * @return A new ASTVector
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public ASTVector Translate(Context ctx) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return new ASTVector(Context(), Native.astVectorTranslate(Context()
 | 
			
		||||
                .nCtx(), NativeObject(), ctx.nCtx()));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Translates all ASTs in the vector to <paramref name="ctx"/>. <param
 | 
			
		||||
	 * name="ctx">A context</param>
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @return A new ASTVector
 | 
			
		||||
	 * @throws Z3Exception
 | 
			
		||||
	 **/
 | 
			
		||||
	public ASTVector Translate(Context ctx) throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		return new ASTVector(Context(), Native.astVectorTranslate(Context()
 | 
			
		||||
				.nCtx(), NativeObject(), ctx.nCtx()));
 | 
			
		||||
	}
 | 
			
		||||
    /**
 | 
			
		||||
     * Retrieves a string representation of the vector.
 | 
			
		||||
     **/
 | 
			
		||||
    public String toString()
 | 
			
		||||
    {
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
            return Native.astVectorToString(Context().nCtx(), NativeObject());
 | 
			
		||||
        } catch (Z3Exception e)
 | 
			
		||||
        {
 | 
			
		||||
            return "Z3Exception: " + e.getMessage();
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Retrieves a string representation of the vector.
 | 
			
		||||
	 **/
 | 
			
		||||
	public String toString()
 | 
			
		||||
	{
 | 
			
		||||
		return Native.astVectorToString(Context().nCtx(), NativeObject());
 | 
			
		||||
	}
 | 
			
		||||
    ASTVector(Context ctx, long obj) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        super(ctx, obj);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	ASTVector(Context ctx, long obj) throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		super(ctx, obj);
 | 
			
		||||
	}
 | 
			
		||||
    ASTVector(Context ctx) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        super(ctx, Native.mkAstVector(ctx.nCtx()));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	ASTVector(Context ctx) throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		super(ctx, Native.mkAstVector(ctx.nCtx()));
 | 
			
		||||
	}
 | 
			
		||||
    void IncRef(long o) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Context().ASTVector_DRQ().IncAndClear(Context(), o);
 | 
			
		||||
        super.IncRef(o);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	void IncRef(long o) throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		Context().ASTVector_DRQ().IncAndClear(Context(), o);
 | 
			
		||||
		super.IncRef(o);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	void DecRef(long o) throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		Context().ASTVector_DRQ().Add(o);
 | 
			
		||||
		super.DecRef(o);
 | 
			
		||||
	}
 | 
			
		||||
    void DecRef(long o) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Context().ASTVector_DRQ().Add(o);
 | 
			
		||||
        super.DecRef(o);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -12,64 +12,71 @@ package com.microsoft.z3;
 | 
			
		|||
 **/
 | 
			
		||||
public class ApplyResult extends Z3Object
 | 
			
		||||
{
 | 
			
		||||
	/**
 | 
			
		||||
	 * The number of Subgoals.
 | 
			
		||||
	 **/
 | 
			
		||||
	public int NumSubgoals()
 | 
			
		||||
	{
 | 
			
		||||
		return Native.applyResultGetNumSubgoals(Context().nCtx(),
 | 
			
		||||
				NativeObject());
 | 
			
		||||
	}
 | 
			
		||||
    /**
 | 
			
		||||
     * The number of Subgoals.
 | 
			
		||||
     **/
 | 
			
		||||
    public int NumSubgoals() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Native.applyResultGetNumSubgoals(Context().nCtx(),
 | 
			
		||||
                NativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Retrieves the subgoals from the ApplyResult.
 | 
			
		||||
	 * @throws Z3Exception 
 | 
			
		||||
	 **/
 | 
			
		||||
	public Goal[] Subgoals() throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
	    int n = NumSubgoals();
 | 
			
		||||
		Goal[] res = new Goal[n];
 | 
			
		||||
		for (int i = 0; i < n; i++)
 | 
			
		||||
			res[i] = new Goal(Context(), Native.applyResultGetSubgoal(Context()
 | 
			
		||||
					.nCtx(), NativeObject(), i));
 | 
			
		||||
		return res;
 | 
			
		||||
	}
 | 
			
		||||
    /**
 | 
			
		||||
     * Retrieves the subgoals from the ApplyResult.
 | 
			
		||||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public Goal[] Subgoals() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        int n = NumSubgoals();
 | 
			
		||||
        Goal[] res = new Goal[n];
 | 
			
		||||
        for (int i = 0; i < n; i++)
 | 
			
		||||
            res[i] = new Goal(Context(), Native.applyResultGetSubgoal(Context()
 | 
			
		||||
                    .nCtx(), NativeObject(), i));
 | 
			
		||||
        return res;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Convert a model for the subgoal <paramref name="i"/> into a model for the
 | 
			
		||||
	 * original goal <code>g</code>, that the ApplyResult was obtained from.
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @return A model for <code>g</code>
 | 
			
		||||
	 * @throws Z3Exception 
 | 
			
		||||
	 **/
 | 
			
		||||
	public Model ConvertModel(int i, Model m) throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		return new Model(Context(), Native.applyResultConvertModel(Context()
 | 
			
		||||
				.nCtx(), NativeObject(), i, m.NativeObject()));
 | 
			
		||||
	}
 | 
			
		||||
    /**
 | 
			
		||||
     * Convert a model for the subgoal <paramref name="i"/> into a model for the
 | 
			
		||||
     * original goal <code>g</code>, that the ApplyResult was obtained from.
 | 
			
		||||
     * 
 | 
			
		||||
     * @return A model for <code>g</code>
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public Model ConvertModel(int i, Model m) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return new Model(Context(), Native.applyResultConvertModel(Context()
 | 
			
		||||
                .nCtx(), NativeObject(), i, m.NativeObject()));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * A string representation of the ApplyResult.
 | 
			
		||||
	 **/
 | 
			
		||||
	public String toString()
 | 
			
		||||
	{
 | 
			
		||||
		return Native.applyResultToString(Context().nCtx(), NativeObject());
 | 
			
		||||
	}
 | 
			
		||||
    /**
 | 
			
		||||
     * A string representation of the ApplyResult.
 | 
			
		||||
     **/
 | 
			
		||||
    public String toString()
 | 
			
		||||
    {
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
            return Native.applyResultToString(Context().nCtx(), NativeObject());
 | 
			
		||||
        } catch (Z3Exception e)
 | 
			
		||||
        {
 | 
			
		||||
            return "Z3Exception: " + e.getMessage();
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	ApplyResult(Context ctx, long obj) throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		super(ctx, obj);
 | 
			
		||||
	}
 | 
			
		||||
    ApplyResult(Context ctx, long obj) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        super(ctx, obj);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	void IncRef(long o) throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		Context().ApplyResult_DRQ().IncAndClear(Context(), o);
 | 
			
		||||
		super.IncRef(o);
 | 
			
		||||
	}
 | 
			
		||||
    void IncRef(long o) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Context().ApplyResult_DRQ().IncAndClear(Context(), o);
 | 
			
		||||
        super.IncRef(o);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	void DecRef(long o) throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		Context().ApplyResult_DRQ().Add(o);
 | 
			
		||||
		super.DecRef(o);
 | 
			
		||||
	}
 | 
			
		||||
    void DecRef(long o) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Context().ApplyResult_DRQ().Add(o);
 | 
			
		||||
        super.DecRef(o);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -7,13 +7,25 @@ package com.microsoft.z3;
 | 
			
		|||
 | 
			
		||||
class ApplyResultDecRefQueue extends IDecRefQueue
 | 
			
		||||
{
 | 
			
		||||
	public void IncRef(Context ctx, long obj)
 | 
			
		||||
	{
 | 
			
		||||
		Native.applyResultIncRef(ctx.nCtx(), obj);
 | 
			
		||||
	}
 | 
			
		||||
    public void IncRef(Context ctx, long obj)
 | 
			
		||||
    {
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
            Native.applyResultIncRef(ctx.nCtx(), obj);
 | 
			
		||||
        } catch (Z3Exception e)
 | 
			
		||||
        {
 | 
			
		||||
            // OK.
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	public void DecRef(Context ctx, long obj)
 | 
			
		||||
	{
 | 
			
		||||
		Native.applyResultDecRef(ctx.nCtx(), obj);
 | 
			
		||||
	}
 | 
			
		||||
    public void DecRef(Context ctx, long obj)
 | 
			
		||||
    {
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
            Native.applyResultDecRef(ctx.nCtx(), obj);
 | 
			
		||||
        } catch (Z3Exception e)
 | 
			
		||||
        {
 | 
			
		||||
            // OK.
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
};
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -7,13 +7,25 @@ package com.microsoft.z3;
 | 
			
		|||
 | 
			
		||||
class ASTMapDecRefQueue extends IDecRefQueue
 | 
			
		||||
{
 | 
			
		||||
	public void IncRef(Context ctx, long obj)
 | 
			
		||||
	{
 | 
			
		||||
		Native.astMapIncRef(ctx.nCtx(), obj);
 | 
			
		||||
	}
 | 
			
		||||
    public void IncRef(Context ctx, long obj)
 | 
			
		||||
    {
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
            Native.astMapIncRef(ctx.nCtx(), obj);
 | 
			
		||||
        } catch (Z3Exception e)
 | 
			
		||||
        {
 | 
			
		||||
            // OK.
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	public void DecRef(Context ctx, long obj)
 | 
			
		||||
	{
 | 
			
		||||
		Native.astMapDecRef(ctx.nCtx(), obj);
 | 
			
		||||
	}
 | 
			
		||||
    public void DecRef(Context ctx, long obj)
 | 
			
		||||
    {
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
            Native.astMapDecRef(ctx.nCtx(), obj);
 | 
			
		||||
        } catch (Z3Exception e)
 | 
			
		||||
        {
 | 
			
		||||
            // OK.
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
};
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -7,13 +7,25 @@ package com.microsoft.z3;
 | 
			
		|||
 | 
			
		||||
class ASTVectorDecRefQueue extends IDecRefQueue
 | 
			
		||||
{
 | 
			
		||||
	public void IncRef(Context ctx, long obj)
 | 
			
		||||
	{
 | 
			
		||||
		Native.astVectorIncRef(ctx.nCtx(), obj);
 | 
			
		||||
	}
 | 
			
		||||
    public void IncRef(Context ctx, long obj)
 | 
			
		||||
    {
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
            Native.astVectorIncRef(ctx.nCtx(), obj);
 | 
			
		||||
        } catch (Z3Exception e)
 | 
			
		||||
        {
 | 
			
		||||
            // OK.
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	public void DecRef(Context ctx, long obj)
 | 
			
		||||
	{
 | 
			
		||||
		Native.astVectorDecRef(ctx.nCtx(), obj);
 | 
			
		||||
	}
 | 
			
		||||
    public void DecRef(Context ctx, long obj)
 | 
			
		||||
    {
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
            Native.astVectorDecRef(ctx.nCtx(), obj);
 | 
			
		||||
        } catch (Z3Exception e)
 | 
			
		||||
        {
 | 
			
		||||
            // OK.
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
};
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -13,50 +13,56 @@ import java.math.BigInteger;
 | 
			
		|||
 **/
 | 
			
		||||
public class BitVecNum extends BitVecExpr
 | 
			
		||||
{
 | 
			
		||||
	/**
 | 
			
		||||
	 * Retrieve the int value.
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @throws Z3Exception
 | 
			
		||||
	 **/
 | 
			
		||||
	public int Int() throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		Native.IntPtr res = new Native.IntPtr();
 | 
			
		||||
		if (Native.getNumeralInt(Context().nCtx(), NativeObject(), res) ^ true)
 | 
			
		||||
			throw new Z3Exception("Numeral is not an int");
 | 
			
		||||
		return res.value;
 | 
			
		||||
	}
 | 
			
		||||
    /**
 | 
			
		||||
     * Retrieve the int value.
 | 
			
		||||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public int Int() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Native.IntPtr res = new Native.IntPtr();
 | 
			
		||||
        if (Native.getNumeralInt(Context().nCtx(), NativeObject(), res) ^ true)
 | 
			
		||||
            throw new Z3Exception("Numeral is not an int");
 | 
			
		||||
        return res.value;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Retrieve the 64-bit int value.
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @throws Z3Exception
 | 
			
		||||
	 **/
 | 
			
		||||
	public long Long() throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		Native.LongPtr res = new Native.LongPtr();
 | 
			
		||||
		if (Native.getNumeralInt64(Context().nCtx(), NativeObject(), res) ^ true)
 | 
			
		||||
			throw new Z3Exception("Numeral is not an int64");
 | 
			
		||||
		return res.value;
 | 
			
		||||
	}
 | 
			
		||||
    /**
 | 
			
		||||
     * Retrieve the 64-bit int value.
 | 
			
		||||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public long Long() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Native.LongPtr res = new Native.LongPtr();
 | 
			
		||||
        if (Native.getNumeralInt64(Context().nCtx(), NativeObject(), res) ^ true)
 | 
			
		||||
            throw new Z3Exception("Numeral is not an int64");
 | 
			
		||||
        return res.value;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Retrieve the BigInteger value.
 | 
			
		||||
	 **/
 | 
			
		||||
	public BigInteger BigInteger()
 | 
			
		||||
	{
 | 
			
		||||
		return new BigInteger(this.toString());
 | 
			
		||||
	}
 | 
			
		||||
    /**
 | 
			
		||||
     * Retrieve the BigInteger value.
 | 
			
		||||
     **/
 | 
			
		||||
    public BigInteger BigInteger()
 | 
			
		||||
    {
 | 
			
		||||
        return new BigInteger(this.toString());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Returns a string representation of the numeral.
 | 
			
		||||
	 **/
 | 
			
		||||
	public String toString()
 | 
			
		||||
	{
 | 
			
		||||
		return Native.getNumeralString(Context().nCtx(), NativeObject());
 | 
			
		||||
	}
 | 
			
		||||
    /**
 | 
			
		||||
     * Returns a string representation of the numeral.
 | 
			
		||||
     **/
 | 
			
		||||
    public String toString()
 | 
			
		||||
    {
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
            return Native.getNumeralString(Context().nCtx(), NativeObject());
 | 
			
		||||
        } catch (Z3Exception e)
 | 
			
		||||
        {
 | 
			
		||||
            return "Z3Exception: " + e.getMessage();
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	BitVecNum(Context ctx, long obj) throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		super(ctx, obj);
 | 
			
		||||
	}
 | 
			
		||||
    BitVecNum(Context ctx, long obj) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        super(ctx, obj);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -13,7 +13,7 @@ public class BitVecSort extends Sort
 | 
			
		|||
	/**
 | 
			
		||||
	 * The size of the bit-vector sort.
 | 
			
		||||
	 **/
 | 
			
		||||
	public int Size()
 | 
			
		||||
	public int Size() throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		return Native.getBvSortSize(Context().nCtx(), NativeObject());
 | 
			
		||||
	}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -54,7 +54,7 @@ public class Constructor extends Z3Object
 | 
			
		|||
	/**
 | 
			
		||||
	 * Destructor.
 | 
			
		||||
	 **/
 | 
			
		||||
	protected void finalize()
 | 
			
		||||
	protected void finalize() throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		Native.delConstructor(Context().nCtx(), NativeObject());
 | 
			
		||||
	}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -14,7 +14,7 @@ public class ConstructorList extends Z3Object
 | 
			
		|||
	/**
 | 
			
		||||
	 * Destructor.
 | 
			
		||||
	 **/
 | 
			
		||||
	protected void finalize()
 | 
			
		||||
	protected void finalize() throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		Native.delConstructorList(Context().nCtx(), NativeObject());
 | 
			
		||||
	}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
										
											
												File diff suppressed because it is too large
												Load diff
											
										
									
								
							| 
						 | 
				
			
			@ -14,7 +14,7 @@ public class DatatypeSort extends Sort
 | 
			
		|||
	/**
 | 
			
		||||
	 * The number of constructors of the datatype sort.
 | 
			
		||||
	 **/
 | 
			
		||||
	public int NumConstructors()
 | 
			
		||||
	public int NumConstructors() throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		return Native.getDatatypeSortNumConstructors(Context().nCtx(),
 | 
			
		||||
				NativeObject());
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -14,7 +14,7 @@ public class FiniteDomainSort extends Sort
 | 
			
		|||
	/**
 | 
			
		||||
	 * The size of the finite domain sort.
 | 
			
		||||
	 **/
 | 
			
		||||
	public long Size()
 | 
			
		||||
	public long Size() throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		Native.LongPtr res = new Native.LongPtr();
 | 
			
		||||
		Native.getFiniteDomainSortSize(Context().nCtx(), NativeObject(), res);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -14,314 +14,320 @@ import com.microsoft.z3.enumerations.*;
 | 
			
		|||
public class Fixedpoint extends Z3Object
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * A string that describes all available fixedpoint solver parameters.
 | 
			
		||||
	 **/
 | 
			
		||||
	public String Help()
 | 
			
		||||
	{
 | 
			
		||||
    /**
 | 
			
		||||
     * A string that describes all available fixedpoint solver parameters.
 | 
			
		||||
     **/
 | 
			
		||||
    public String Help() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Native.fixedpointGetHelp(Context().nCtx(), NativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
		return Native.fixedpointGetHelp(Context().nCtx(), NativeObject());
 | 
			
		||||
	}
 | 
			
		||||
    /**
 | 
			
		||||
     * Sets the fixedpoint solver parameters.
 | 
			
		||||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public void setParameters(Params value) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Sets the fixedpoint solver parameters.
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @throws Z3Exception
 | 
			
		||||
	 **/
 | 
			
		||||
	public void setParameters(Params value) throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
        Context().CheckContextMatch(value);
 | 
			
		||||
        Native.fixedpointSetParams(Context().nCtx(), NativeObject(),
 | 
			
		||||
                value.NativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
		Context().CheckContextMatch(value);
 | 
			
		||||
		Native.fixedpointSetParams(Context().nCtx(), NativeObject(),
 | 
			
		||||
				value.NativeObject());
 | 
			
		||||
	}
 | 
			
		||||
    /**
 | 
			
		||||
     * Retrieves parameter descriptions for Fixedpoint solver.
 | 
			
		||||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public ParamDescrs ParameterDescriptions() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return new ParamDescrs(Context(), Native.fixedpointGetParamDescrs(
 | 
			
		||||
                Context().nCtx(), NativeObject()));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Retrieves parameter descriptions for Fixedpoint solver.
 | 
			
		||||
	 * @throws Z3Exception 
 | 
			
		||||
	 **/
 | 
			
		||||
	public ParamDescrs ParameterDescriptions() throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		return new ParamDescrs(Context(), Native.fixedpointGetParamDescrs(
 | 
			
		||||
				Context().nCtx(), NativeObject()));
 | 
			
		||||
	}
 | 
			
		||||
    /**
 | 
			
		||||
     * Assert a constraint (or multiple) into the fixedpoint solver.
 | 
			
		||||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public void Assert(BoolExpr[] constraints) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Context().CheckContextMatch(constraints);
 | 
			
		||||
        for (BoolExpr a : constraints)
 | 
			
		||||
        {
 | 
			
		||||
            Native.fixedpointAssert(Context().nCtx(), NativeObject(),
 | 
			
		||||
                    a.NativeObject());
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Assert a constraint (or multiple) into the fixedpoint solver.
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @throws Z3Exception
 | 
			
		||||
	 **/
 | 
			
		||||
	public void Assert(BoolExpr[] constraints) throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
    /**
 | 
			
		||||
     * Register predicate as recursive relation.
 | 
			
		||||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public void RegisterRelation(FuncDecl f) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
		Context().CheckContextMatch(constraints);
 | 
			
		||||
		for (BoolExpr a : constraints)
 | 
			
		||||
		{
 | 
			
		||||
			Native.fixedpointAssert(Context().nCtx(), NativeObject(),
 | 
			
		||||
					a.NativeObject());
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
        Context().CheckContextMatch(f);
 | 
			
		||||
        Native.fixedpointRegisterRelation(Context().nCtx(), NativeObject(),
 | 
			
		||||
                f.NativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Register predicate as recursive relation.
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @throws Z3Exception
 | 
			
		||||
	 **/
 | 
			
		||||
	public void RegisterRelation(FuncDecl f) throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
    /**
 | 
			
		||||
     * Add rule into the fixedpoint solver.
 | 
			
		||||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public void AddRule(BoolExpr rule, Symbol name) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
		Context().CheckContextMatch(f);
 | 
			
		||||
		Native.fixedpointRegisterRelation(Context().nCtx(), NativeObject(),
 | 
			
		||||
				f.NativeObject());
 | 
			
		||||
	}
 | 
			
		||||
        Context().CheckContextMatch(rule);
 | 
			
		||||
        Native.fixedpointAddRule(Context().nCtx(), NativeObject(),
 | 
			
		||||
                rule.NativeObject(), AST.GetNativeObject(name));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Add rule into the fixedpoint solver.
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @throws Z3Exception
 | 
			
		||||
	 **/
 | 
			
		||||
	public void AddRule(BoolExpr rule, Symbol name) throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
    /**
 | 
			
		||||
     * Add table fact to the fixedpoint solver.
 | 
			
		||||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public void AddFact(FuncDecl pred, int[] args) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
		Context().CheckContextMatch(rule);
 | 
			
		||||
		Native.fixedpointAddRule(Context().nCtx(), NativeObject(),
 | 
			
		||||
				rule.NativeObject(), AST.GetNativeObject(name));
 | 
			
		||||
	}
 | 
			
		||||
        Context().CheckContextMatch(pred);
 | 
			
		||||
        Native.fixedpointAddFact(Context().nCtx(), NativeObject(),
 | 
			
		||||
                pred.NativeObject(), (int) args.length, args);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Add table fact to the fixedpoint solver.
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @throws Z3Exception
 | 
			
		||||
	 **/
 | 
			
		||||
	public void AddFact(FuncDecl pred, int[] args) throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
    /**
 | 
			
		||||
     * Query the fixedpoint solver. A query is a conjunction of constraints. The
 | 
			
		||||
     * constraints may include the recursively defined relations. The query is
 | 
			
		||||
     * satisfiable if there is an instance of the query variables and a
 | 
			
		||||
     * derivation for it. The query is unsatisfiable if there are no derivations
 | 
			
		||||
     * satisfying the query variables.
 | 
			
		||||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public Status Query(BoolExpr query) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
		Context().CheckContextMatch(pred);
 | 
			
		||||
		Native.fixedpointAddFact(Context().nCtx(), NativeObject(),
 | 
			
		||||
				pred.NativeObject(), (int) args.length, args);
 | 
			
		||||
	}
 | 
			
		||||
        Context().CheckContextMatch(query);
 | 
			
		||||
        Z3_lbool r = Z3_lbool.fromInt(Native.fixedpointQuery(Context().nCtx(),
 | 
			
		||||
                NativeObject(), query.NativeObject()));
 | 
			
		||||
        switch (r)
 | 
			
		||||
        {
 | 
			
		||||
        case Z3_L_TRUE:
 | 
			
		||||
            return Status.SATISFIABLE;
 | 
			
		||||
        case Z3_L_FALSE:
 | 
			
		||||
            return Status.UNSATISFIABLE;
 | 
			
		||||
        default:
 | 
			
		||||
            return Status.UNKNOWN;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Query the fixedpoint solver. A query is a conjunction of constraints. The
 | 
			
		||||
	 * constraints may include the recursively defined relations. The query is
 | 
			
		||||
	 * satisfiable if there is an instance of the query variables and a
 | 
			
		||||
	 * derivation for it. The query is unsatisfiable if there are no derivations
 | 
			
		||||
	 * satisfying the query variables.
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @throws Z3Exception
 | 
			
		||||
	 **/
 | 
			
		||||
	public Status Query(BoolExpr query) throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
    /**
 | 
			
		||||
     * Query the fixedpoint solver. A query is an array of relations. The query
 | 
			
		||||
     * is satisfiable if there is an instance of some relation that is
 | 
			
		||||
     * non-empty. The query is unsatisfiable if there are no derivations
 | 
			
		||||
     * satisfying any of the relations.
 | 
			
		||||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public Status Query(FuncDecl[] relations) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
		Context().CheckContextMatch(query);
 | 
			
		||||
		Z3_lbool r = Z3_lbool.fromInt(Native.fixedpointQuery(Context().nCtx(),
 | 
			
		||||
				NativeObject(), query.NativeObject()));
 | 
			
		||||
		switch (r)
 | 
			
		||||
		{
 | 
			
		||||
		case Z3_L_TRUE:
 | 
			
		||||
			return Status.SATISFIABLE;
 | 
			
		||||
		case Z3_L_FALSE:
 | 
			
		||||
			return Status.UNSATISFIABLE;
 | 
			
		||||
		default:
 | 
			
		||||
			return Status.UNKNOWN;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
        Context().CheckContextMatch(relations);
 | 
			
		||||
        Z3_lbool r = Z3_lbool.fromInt(Native.fixedpointQueryRelations(Context()
 | 
			
		||||
                .nCtx(), NativeObject(), AST.ArrayLength(relations), AST
 | 
			
		||||
                .ArrayToNative(relations)));
 | 
			
		||||
        switch (r)
 | 
			
		||||
        {
 | 
			
		||||
        case Z3_L_TRUE:
 | 
			
		||||
            return Status.SATISFIABLE;
 | 
			
		||||
        case Z3_L_FALSE:
 | 
			
		||||
            return Status.UNSATISFIABLE;
 | 
			
		||||
        default:
 | 
			
		||||
            return Status.UNKNOWN;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Query the fixedpoint solver. A query is an array of relations. The query
 | 
			
		||||
	 * is satisfiable if there is an instance of some relation that is
 | 
			
		||||
	 * non-empty. The query is unsatisfiable if there are no derivations
 | 
			
		||||
	 * satisfying any of the relations.
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @throws Z3Exception
 | 
			
		||||
	 **/
 | 
			
		||||
	public Status Query(FuncDecl[] relations) throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
    /**
 | 
			
		||||
     * Creates a backtracking point. <seealso cref="Pop"/>
 | 
			
		||||
     **/
 | 
			
		||||
    public void Push() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Native.fixedpointPush(Context().nCtx(), NativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
		Context().CheckContextMatch(relations);
 | 
			
		||||
		Z3_lbool r = Z3_lbool.fromInt(Native.fixedpointQueryRelations(Context()
 | 
			
		||||
				.nCtx(), NativeObject(), AST.ArrayLength(relations), AST
 | 
			
		||||
				.ArrayToNative(relations)));
 | 
			
		||||
		switch (r)
 | 
			
		||||
		{
 | 
			
		||||
		case Z3_L_TRUE:
 | 
			
		||||
			return Status.SATISFIABLE;
 | 
			
		||||
		case Z3_L_FALSE:
 | 
			
		||||
			return Status.UNSATISFIABLE;
 | 
			
		||||
		default:
 | 
			
		||||
			return Status.UNKNOWN;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
    /**
 | 
			
		||||
     * Backtrack one backtracking point. <remarks>Note that an exception is
 | 
			
		||||
     * thrown if Pop is called without a corresponding <code>Push</code>
 | 
			
		||||
     * </remarks> <seealso cref="Push"/>
 | 
			
		||||
     **/
 | 
			
		||||
    public void Pop() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Native.fixedpointPop(Context().nCtx(), NativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Creates a backtracking point. <seealso cref="Pop"/>
 | 
			
		||||
	 **/
 | 
			
		||||
	public void Push()
 | 
			
		||||
	{
 | 
			
		||||
		Native.fixedpointPush(Context().nCtx(), NativeObject());
 | 
			
		||||
	}
 | 
			
		||||
    /**
 | 
			
		||||
     * Update named rule into in the fixedpoint solver.
 | 
			
		||||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public void UpdateRule(BoolExpr rule, Symbol name) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Backtrack one backtracking point. <remarks>Note that an exception is
 | 
			
		||||
	 * thrown if Pop is called without a corresponding <code>Push</code>
 | 
			
		||||
	 * </remarks> <seealso cref="Push"/>
 | 
			
		||||
	 **/
 | 
			
		||||
	public void Pop()
 | 
			
		||||
	{
 | 
			
		||||
		Native.fixedpointPop(Context().nCtx(), NativeObject());
 | 
			
		||||
	}
 | 
			
		||||
        Context().CheckContextMatch(rule);
 | 
			
		||||
        Native.fixedpointUpdateRule(Context().nCtx(), NativeObject(),
 | 
			
		||||
                rule.NativeObject(), AST.GetNativeObject(name));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Update named rule into in the fixedpoint solver.
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @throws Z3Exception
 | 
			
		||||
	 **/
 | 
			
		||||
	public void UpdateRule(BoolExpr rule, Symbol name) throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
    /**
 | 
			
		||||
     * Retrieve satisfying instance or instances of solver, or definitions for
 | 
			
		||||
     * the recursive predicates that show unsatisfiability.
 | 
			
		||||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public Expr GetAnswer() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        long ans = Native.fixedpointGetAnswer(Context().nCtx(), NativeObject());
 | 
			
		||||
        return (ans == 0) ? null : Expr.Create(Context(), ans);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
		Context().CheckContextMatch(rule);
 | 
			
		||||
		Native.fixedpointUpdateRule(Context().nCtx(), NativeObject(),
 | 
			
		||||
				rule.NativeObject(), AST.GetNativeObject(name));
 | 
			
		||||
	}
 | 
			
		||||
    /**
 | 
			
		||||
     * Retrieve explanation why fixedpoint engine returned status Unknown.
 | 
			
		||||
     **/
 | 
			
		||||
    public String GetReasonUnknown() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Retrieve satisfying instance or instances of solver, or definitions for
 | 
			
		||||
	 * the recursive predicates that show unsatisfiability.
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @throws Z3Exception
 | 
			
		||||
	 **/
 | 
			
		||||
	public Expr GetAnswer() throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		long ans = Native.fixedpointGetAnswer(Context().nCtx(), NativeObject());
 | 
			
		||||
		return (ans == 0) ? null : Expr.Create(Context(), ans);
 | 
			
		||||
	}
 | 
			
		||||
        return Native.fixedpointGetReasonUnknown(Context().nCtx(),
 | 
			
		||||
                NativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Retrieve explanation why fixedpoint engine returned status Unknown.
 | 
			
		||||
	 **/
 | 
			
		||||
	public String GetReasonUnknown()
 | 
			
		||||
	{
 | 
			
		||||
    /**
 | 
			
		||||
     * Retrieve the number of levels explored for a given predicate.
 | 
			
		||||
     **/
 | 
			
		||||
    public int GetNumLevels(FuncDecl predicate) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Native.fixedpointGetNumLevels(Context().nCtx(), NativeObject(),
 | 
			
		||||
                predicate.NativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
		return Native.fixedpointGetReasonUnknown(Context().nCtx(),
 | 
			
		||||
				NativeObject());
 | 
			
		||||
	}
 | 
			
		||||
    /**
 | 
			
		||||
     * Retrieve the cover of a 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);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Retrieve the number of levels explored for a given predicate.
 | 
			
		||||
	 **/
 | 
			
		||||
	public int GetNumLevels(FuncDecl predicate)
 | 
			
		||||
	{
 | 
			
		||||
		return Native.fixedpointGetNumLevels(Context().nCtx(), NativeObject(),
 | 
			
		||||
				predicate.NativeObject());
 | 
			
		||||
	}
 | 
			
		||||
    /**
 | 
			
		||||
     * 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)
 | 
			
		||||
            throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Native.fixedpointAddCover(Context().nCtx(), NativeObject(), level,
 | 
			
		||||
                predicate.NativeObject(), property.NativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Retrieve the cover of a 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);
 | 
			
		||||
	}
 | 
			
		||||
    /**
 | 
			
		||||
     * Retrieve internal string representation of fixedpoint object.
 | 
			
		||||
     **/
 | 
			
		||||
    public String toString()
 | 
			
		||||
    {
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
            return Native.fixedpointToString(Context().nCtx(), NativeObject(),
 | 
			
		||||
                    0, null);
 | 
			
		||||
        } catch (Z3Exception e)
 | 
			
		||||
        {
 | 
			
		||||
            return "Z3Exception: " + e.getMessage();
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * 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)
 | 
			
		||||
	{
 | 
			
		||||
		Native.fixedpointAddCover(Context().nCtx(), NativeObject(), level,
 | 
			
		||||
				predicate.NativeObject(), property.NativeObject());
 | 
			
		||||
	}
 | 
			
		||||
    /**
 | 
			
		||||
     * Instrument the Datalog engine on which table representation to use for
 | 
			
		||||
     * recursive predicate.
 | 
			
		||||
     **/
 | 
			
		||||
    public void SetPredicateRepresentation(FuncDecl f, Symbol[] kinds) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Retrieve internal string representation of fixedpoint object.
 | 
			
		||||
	 **/
 | 
			
		||||
	public String toString()
 | 
			
		||||
	{
 | 
			
		||||
		return Native.fixedpointToString(Context().nCtx(), NativeObject(), 0,
 | 
			
		||||
				null);
 | 
			
		||||
	}
 | 
			
		||||
        Native.fixedpointSetPredicateRepresentation(Context().nCtx(),
 | 
			
		||||
                NativeObject(), f.NativeObject(), AST.ArrayLength(kinds),
 | 
			
		||||
                Symbol.ArrayToNative(kinds));
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Instrument the Datalog engine on which table representation to use for
 | 
			
		||||
	 * recursive predicate.
 | 
			
		||||
	 **/
 | 
			
		||||
	public void SetPredicateRepresentation(FuncDecl f, Symbol[] kinds)
 | 
			
		||||
	{
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
		Native.fixedpointSetPredicateRepresentation(Context().nCtx(),
 | 
			
		||||
				NativeObject(), f.NativeObject(), AST.ArrayLength(kinds),
 | 
			
		||||
				Symbol.ArrayToNative(kinds));
 | 
			
		||||
    /**
 | 
			
		||||
     * Convert benchmark given as set of axioms, rules and queries to a string.
 | 
			
		||||
     **/
 | 
			
		||||
    public String toString(BoolExpr[] queries) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
	}
 | 
			
		||||
        return Native.fixedpointToString(Context().nCtx(), NativeObject(),
 | 
			
		||||
                AST.ArrayLength(queries), AST.ArrayToNative(queries));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Convert benchmark given as set of axioms, rules and queries to a string.
 | 
			
		||||
	 **/
 | 
			
		||||
	public String toString(BoolExpr[] queries)
 | 
			
		||||
	{
 | 
			
		||||
    /**
 | 
			
		||||
     * Retrieve set of rules added to fixedpoint context.
 | 
			
		||||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public BoolExpr[] Rules() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
		return Native.fixedpointToString(Context().nCtx(), NativeObject(),
 | 
			
		||||
				AST.ArrayLength(queries), AST.ArrayToNative(queries));
 | 
			
		||||
	}
 | 
			
		||||
        ASTVector v = new ASTVector(Context(), Native.fixedpointGetRules(
 | 
			
		||||
                Context().nCtx(), NativeObject()));
 | 
			
		||||
        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());
 | 
			
		||||
        return res;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Retrieve set of rules added to fixedpoint context.
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @throws Z3Exception
 | 
			
		||||
	 **/
 | 
			
		||||
	public BoolExpr[] Rules() throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
    /**
 | 
			
		||||
     * Retrieve set of assertions added to fixedpoint context.
 | 
			
		||||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public BoolExpr[] Assertions() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
		ASTVector v = new ASTVector(Context(), Native.fixedpointGetRules(
 | 
			
		||||
				Context().nCtx(), NativeObject()));
 | 
			
		||||
		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());
 | 
			
		||||
		return res;
 | 
			
		||||
	}
 | 
			
		||||
        ASTVector v = new ASTVector(Context(), Native.fixedpointGetAssertions(
 | 
			
		||||
                Context().nCtx(), NativeObject()));
 | 
			
		||||
        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());
 | 
			
		||||
        return res;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Retrieve set of assertions added to fixedpoint context.
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @throws Z3Exception
 | 
			
		||||
	 **/
 | 
			
		||||
	public BoolExpr[] Assertions() throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
    Fixedpoint(Context ctx, long obj) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        super(ctx, obj);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
		ASTVector v = new ASTVector(Context(), Native.fixedpointGetAssertions(
 | 
			
		||||
				Context().nCtx(), NativeObject()));
 | 
			
		||||
		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());
 | 
			
		||||
		return res;
 | 
			
		||||
	}
 | 
			
		||||
    Fixedpoint(Context ctx) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        super(ctx, Native.mkFixedpoint(ctx.nCtx()));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	Fixedpoint(Context ctx, long obj) throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		super(ctx, obj);
 | 
			
		||||
	}
 | 
			
		||||
    void IncRef(long o) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Context().Fixedpoint_DRQ().IncAndClear(Context(), o);
 | 
			
		||||
        super.IncRef(o);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	Fixedpoint(Context ctx) throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		super(ctx, Native.mkFixedpoint(ctx.nCtx()));
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	void IncRef(long o) throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		Context().Fixedpoint_DRQ().IncAndClear(Context(), o);
 | 
			
		||||
		super.IncRef(o);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	void DecRef(long o) throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		Context().Fixedpoint_DRQ().Add(o);
 | 
			
		||||
		super.DecRef(o);
 | 
			
		||||
	}
 | 
			
		||||
    void DecRef(long o) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Context().Fixedpoint_DRQ().Add(o);
 | 
			
		||||
        super.DecRef(o);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -7,13 +7,25 @@ package com.microsoft.z3;
 | 
			
		|||
 | 
			
		||||
class FixedpointDecRefQueue extends IDecRefQueue
 | 
			
		||||
{
 | 
			
		||||
	public void IncRef(Context ctx, long obj)
 | 
			
		||||
	{
 | 
			
		||||
		Native.fixedpointIncRef(ctx.nCtx(), obj);
 | 
			
		||||
	}
 | 
			
		||||
    public void IncRef(Context ctx, long obj)
 | 
			
		||||
    {
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
            Native.fixedpointIncRef(ctx.nCtx(), obj);
 | 
			
		||||
        } catch (Z3Exception e)
 | 
			
		||||
        {
 | 
			
		||||
            // OK.
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	public void DecRef(Context ctx, long obj)
 | 
			
		||||
	{
 | 
			
		||||
		Native.fixedpointDecRef(ctx.nCtx(), obj);
 | 
			
		||||
	}
 | 
			
		||||
    public void DecRef(Context ctx, long obj)
 | 
			
		||||
    {
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
            Native.fixedpointDecRef(ctx.nCtx(), obj);
 | 
			
		||||
        } catch (Z3Exception e)
 | 
			
		||||
        {
 | 
			
		||||
            // OK.
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
};
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -13,379 +13,385 @@ import com.microsoft.z3.enumerations.*;
 | 
			
		|||
 **/
 | 
			
		||||
public class FuncDecl extends AST
 | 
			
		||||
{
 | 
			
		||||
	/**
 | 
			
		||||
	 * Comparison operator.
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @return True if <paramref name="a"/> and <paramref name="b"/> share the
 | 
			
		||||
	 *         same context and are equal, false otherwise.
 | 
			
		||||
	 **/
 | 
			
		||||
	/* Overloaded operators are not translated. */
 | 
			
		||||
    /**
 | 
			
		||||
     * Comparison operator.
 | 
			
		||||
     * 
 | 
			
		||||
     * @return True if <paramref name="a"/> and <paramref name="b"/> share the
 | 
			
		||||
     *         same context and are equal, false otherwise.
 | 
			
		||||
     **/
 | 
			
		||||
    /* Overloaded operators are not translated. */
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Comparison operator.
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @return True if <paramref name="a"/> and <paramref name="b"/> do not
 | 
			
		||||
	 *         share the same context or are not equal, false otherwise.
 | 
			
		||||
	 **/
 | 
			
		||||
	/* Overloaded operators are not translated. */
 | 
			
		||||
    /**
 | 
			
		||||
     * Comparison operator.
 | 
			
		||||
     * 
 | 
			
		||||
     * @return True if <paramref name="a"/> and <paramref name="b"/> do not
 | 
			
		||||
     *         share the same context or are not equal, false otherwise.
 | 
			
		||||
     **/
 | 
			
		||||
    /* Overloaded operators are not translated. */
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Object comparison.
 | 
			
		||||
	 **/
 | 
			
		||||
	public boolean Equals(Object o)
 | 
			
		||||
	{
 | 
			
		||||
		FuncDecl casted = (FuncDecl) o;
 | 
			
		||||
		if (casted == null)
 | 
			
		||||
			return false;
 | 
			
		||||
		return this == casted;
 | 
			
		||||
	}
 | 
			
		||||
    /**
 | 
			
		||||
     * Object comparison.
 | 
			
		||||
     **/
 | 
			
		||||
    public boolean Equals(Object o)
 | 
			
		||||
    {
 | 
			
		||||
        FuncDecl casted = (FuncDecl) o;
 | 
			
		||||
        if (casted == null)
 | 
			
		||||
            return false;
 | 
			
		||||
        return this == casted;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * A hash code.
 | 
			
		||||
	 **/
 | 
			
		||||
	public int GetHashCode() throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		return super.GetHashCode();
 | 
			
		||||
	}
 | 
			
		||||
    /**
 | 
			
		||||
     * A hash code.
 | 
			
		||||
     **/
 | 
			
		||||
    public int GetHashCode() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return super.GetHashCode();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * A string representations of the function declaration.
 | 
			
		||||
	 **/
 | 
			
		||||
	public String toString()
 | 
			
		||||
	{
 | 
			
		||||
		return Native.funcDeclToString(Context().nCtx(), NativeObject());
 | 
			
		||||
	}
 | 
			
		||||
    /**
 | 
			
		||||
     * A string representations of the function declaration.
 | 
			
		||||
     **/
 | 
			
		||||
    public String toString()
 | 
			
		||||
    {
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
            return Native.funcDeclToString(Context().nCtx(), NativeObject());
 | 
			
		||||
        } catch (Z3Exception e)
 | 
			
		||||
        {
 | 
			
		||||
            return "Z3Exception: " + e.getMessage();
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Returns a unique identifier for the function declaration.
 | 
			
		||||
	 **/
 | 
			
		||||
	public int Id() throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		return Native.getFuncDeclId(Context().nCtx(), NativeObject());
 | 
			
		||||
	}
 | 
			
		||||
    /**
 | 
			
		||||
     * Returns a unique identifier for the function declaration.
 | 
			
		||||
     **/
 | 
			
		||||
    public int Id() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Native.getFuncDeclId(Context().nCtx(), NativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * The arity of the function declaration
 | 
			
		||||
	 **/
 | 
			
		||||
	public int Arity() throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		return Native.getArity(Context().nCtx(), NativeObject());
 | 
			
		||||
	}
 | 
			
		||||
    /**
 | 
			
		||||
     * The arity of the function declaration
 | 
			
		||||
     **/
 | 
			
		||||
    public int Arity() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Native.getArity(Context().nCtx(), NativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * The size of the domain of the function declaration <seealso
 | 
			
		||||
	 * cref="Arity"/>
 | 
			
		||||
	 **/
 | 
			
		||||
	public int DomainSize()
 | 
			
		||||
	{
 | 
			
		||||
		return Native.getDomainSize(Context().nCtx(), NativeObject());
 | 
			
		||||
	}
 | 
			
		||||
    /**
 | 
			
		||||
     * The size of the domain of the function declaration <seealso
 | 
			
		||||
     * cref="Arity"/>
 | 
			
		||||
     **/
 | 
			
		||||
    public int DomainSize() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Native.getDomainSize(Context().nCtx(), NativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * The domain of the function declaration
 | 
			
		||||
	 **/
 | 
			
		||||
	public Sort[] Domain() throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
    /**
 | 
			
		||||
     * The domain of the function declaration
 | 
			
		||||
     **/
 | 
			
		||||
    public Sort[] Domain() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
		int n = DomainSize();
 | 
			
		||||
        int n = DomainSize();
 | 
			
		||||
 | 
			
		||||
		Sort[] res = new Sort[n];
 | 
			
		||||
		for (int i = 0; i < n; i++)
 | 
			
		||||
			res[i] = Sort.Create(Context(),
 | 
			
		||||
					Native.getDomain(Context().nCtx(), NativeObject(), i));
 | 
			
		||||
		return res;
 | 
			
		||||
	}
 | 
			
		||||
        Sort[] res = new Sort[n];
 | 
			
		||||
        for (int i = 0; i < n; i++)
 | 
			
		||||
            res[i] = Sort.Create(Context(),
 | 
			
		||||
                    Native.getDomain(Context().nCtx(), NativeObject(), i));
 | 
			
		||||
        return res;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * The range of the function declaration
 | 
			
		||||
	 **/
 | 
			
		||||
	public Sort Range() throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
    /**
 | 
			
		||||
     * The range of the function declaration
 | 
			
		||||
     **/
 | 
			
		||||
    public Sort Range() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
		return Sort.Create(Context(),
 | 
			
		||||
				Native.getRange(Context().nCtx(), NativeObject()));
 | 
			
		||||
	}
 | 
			
		||||
        return Sort.Create(Context(),
 | 
			
		||||
                Native.getRange(Context().nCtx(), NativeObject()));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * The kind of the function declaration.
 | 
			
		||||
	 **/
 | 
			
		||||
	public Z3_decl_kind DeclKind() throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		return Z3_decl_kind.fromInt(Native.getDeclKind(Context().nCtx(),
 | 
			
		||||
				NativeObject()));
 | 
			
		||||
	}
 | 
			
		||||
    /**
 | 
			
		||||
     * The kind of the function declaration.
 | 
			
		||||
     **/
 | 
			
		||||
    public Z3_decl_kind DeclKind() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Z3_decl_kind.fromInt(Native.getDeclKind(Context().nCtx(),
 | 
			
		||||
                NativeObject()));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * The name of the function declaration
 | 
			
		||||
	 **/
 | 
			
		||||
	public Symbol Name() throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
    /**
 | 
			
		||||
     * The name of the function declaration
 | 
			
		||||
     **/
 | 
			
		||||
    public Symbol Name() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
		return Symbol.Create(Context(),
 | 
			
		||||
				Native.getDeclName(Context().nCtx(), NativeObject()));
 | 
			
		||||
	}
 | 
			
		||||
        return Symbol.Create(Context(),
 | 
			
		||||
                Native.getDeclName(Context().nCtx(), NativeObject()));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * The number of parameters of the function declaration
 | 
			
		||||
	 **/
 | 
			
		||||
	public int NumParameters() throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		return Native.getDeclNumParameters(Context().nCtx(), NativeObject());
 | 
			
		||||
	}
 | 
			
		||||
    /**
 | 
			
		||||
     * The number of parameters of the function declaration
 | 
			
		||||
     **/
 | 
			
		||||
    public int NumParameters() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Native.getDeclNumParameters(Context().nCtx(), NativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * The parameters of the function declaration
 | 
			
		||||
	 **/
 | 
			
		||||
	public Parameter[] Parameters() throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
    /**
 | 
			
		||||
     * The parameters of the function declaration
 | 
			
		||||
     **/
 | 
			
		||||
    public Parameter[] Parameters() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
		int num = NumParameters();
 | 
			
		||||
		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));
 | 
			
		||||
			switch (k)
 | 
			
		||||
			{
 | 
			
		||||
			case Z3_PARAMETER_INT:
 | 
			
		||||
				res[i] = new Parameter(k, Native.getDeclIntParameter(Context()
 | 
			
		||||
						.nCtx(), NativeObject(), i));
 | 
			
		||||
				break;
 | 
			
		||||
			case Z3_PARAMETER_DOUBLE:
 | 
			
		||||
				res[i] = new Parameter(k, Native.getDeclDoubleParameter(
 | 
			
		||||
						Context().nCtx(), NativeObject(), i));
 | 
			
		||||
				break;
 | 
			
		||||
			case Z3_PARAMETER_SYMBOL:
 | 
			
		||||
				res[i] = new Parameter(k, Symbol.Create(Context(), Native
 | 
			
		||||
						.getDeclSymbolParameter(Context().nCtx(),
 | 
			
		||||
								NativeObject(), i)));
 | 
			
		||||
				break;
 | 
			
		||||
			case Z3_PARAMETER_SORT:
 | 
			
		||||
				res[i] = new Parameter(k, Sort.Create(Context(), Native
 | 
			
		||||
						.getDeclSortParameter(Context().nCtx(), NativeObject(),
 | 
			
		||||
								i)));
 | 
			
		||||
				break;
 | 
			
		||||
			case Z3_PARAMETER_AST:
 | 
			
		||||
				res[i] = new Parameter(k, new AST(Context(),
 | 
			
		||||
						Native.getDeclAstParameter(Context().nCtx(),
 | 
			
		||||
								NativeObject(), i)));
 | 
			
		||||
				break;
 | 
			
		||||
			case Z3_PARAMETER_FUNC_DECL:
 | 
			
		||||
				res[i] = new Parameter(k, new FuncDecl(Context(),
 | 
			
		||||
						Native.getDeclFuncDeclParameter(Context().nCtx(),
 | 
			
		||||
								NativeObject(), i)));
 | 
			
		||||
				break;
 | 
			
		||||
			case Z3_PARAMETER_RATIONAL:
 | 
			
		||||
				res[i] = new Parameter(k, Native.getDeclRationalParameter(
 | 
			
		||||
						Context().nCtx(), NativeObject(), i));
 | 
			
		||||
				break;
 | 
			
		||||
			default:
 | 
			
		||||
				throw new Z3Exception(
 | 
			
		||||
						"Unknown function declaration parameter kind encountered");
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
		return res;
 | 
			
		||||
	}
 | 
			
		||||
        int num = NumParameters();
 | 
			
		||||
        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));
 | 
			
		||||
            switch (k)
 | 
			
		||||
            {
 | 
			
		||||
            case Z3_PARAMETER_INT:
 | 
			
		||||
                res[i] = new Parameter(k, Native.getDeclIntParameter(Context()
 | 
			
		||||
                        .nCtx(), NativeObject(), i));
 | 
			
		||||
                break;
 | 
			
		||||
            case Z3_PARAMETER_DOUBLE:
 | 
			
		||||
                res[i] = new Parameter(k, Native.getDeclDoubleParameter(
 | 
			
		||||
                        Context().nCtx(), NativeObject(), i));
 | 
			
		||||
                break;
 | 
			
		||||
            case Z3_PARAMETER_SYMBOL:
 | 
			
		||||
                res[i] = new Parameter(k, Symbol.Create(Context(), Native
 | 
			
		||||
                        .getDeclSymbolParameter(Context().nCtx(),
 | 
			
		||||
                                NativeObject(), i)));
 | 
			
		||||
                break;
 | 
			
		||||
            case Z3_PARAMETER_SORT:
 | 
			
		||||
                res[i] = new Parameter(k, Sort.Create(Context(), Native
 | 
			
		||||
                        .getDeclSortParameter(Context().nCtx(), NativeObject(),
 | 
			
		||||
                                i)));
 | 
			
		||||
                break;
 | 
			
		||||
            case Z3_PARAMETER_AST:
 | 
			
		||||
                res[i] = new Parameter(k, new AST(Context(),
 | 
			
		||||
                        Native.getDeclAstParameter(Context().nCtx(),
 | 
			
		||||
                                NativeObject(), i)));
 | 
			
		||||
                break;
 | 
			
		||||
            case Z3_PARAMETER_FUNC_DECL:
 | 
			
		||||
                res[i] = new Parameter(k, new FuncDecl(Context(),
 | 
			
		||||
                        Native.getDeclFuncDeclParameter(Context().nCtx(),
 | 
			
		||||
                                NativeObject(), i)));
 | 
			
		||||
                break;
 | 
			
		||||
            case Z3_PARAMETER_RATIONAL:
 | 
			
		||||
                res[i] = new Parameter(k, Native.getDeclRationalParameter(
 | 
			
		||||
                        Context().nCtx(), NativeObject(), i));
 | 
			
		||||
                break;
 | 
			
		||||
            default:
 | 
			
		||||
                throw new Z3Exception(
 | 
			
		||||
                        "Unknown function declaration parameter kind encountered");
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        return res;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Function declarations can have Parameters associated with them.
 | 
			
		||||
	 **/
 | 
			
		||||
	public class Parameter
 | 
			
		||||
	{
 | 
			
		||||
		private Z3_parameter_kind kind;
 | 
			
		||||
		private int i;
 | 
			
		||||
		private double d;
 | 
			
		||||
		private Symbol sym;
 | 
			
		||||
		private Sort srt;
 | 
			
		||||
		private AST ast;
 | 
			
		||||
		private FuncDecl fd;
 | 
			
		||||
		private String r;
 | 
			
		||||
    /**
 | 
			
		||||
     * Function declarations can have Parameters associated with them.
 | 
			
		||||
     **/
 | 
			
		||||
    public class Parameter
 | 
			
		||||
    {
 | 
			
		||||
        private Z3_parameter_kind kind;
 | 
			
		||||
        private int i;
 | 
			
		||||
        private double d;
 | 
			
		||||
        private Symbol sym;
 | 
			
		||||
        private Sort srt;
 | 
			
		||||
        private AST ast;
 | 
			
		||||
        private FuncDecl fd;
 | 
			
		||||
        private String r;
 | 
			
		||||
 | 
			
		||||
		/**
 | 
			
		||||
		 * The int value of the parameter.</summary>
 | 
			
		||||
		 **/
 | 
			
		||||
		public int Int() throws Z3Exception
 | 
			
		||||
		{
 | 
			
		||||
			if (ParameterKind() != Z3_parameter_kind.Z3_PARAMETER_INT)
 | 
			
		||||
				throw new Z3Exception("parameter is not an int");
 | 
			
		||||
			return i;
 | 
			
		||||
		}
 | 
			
		||||
        /**
 | 
			
		||||
         * The int value of the parameter.</summary>
 | 
			
		||||
         **/
 | 
			
		||||
        public int Int() throws Z3Exception
 | 
			
		||||
        {
 | 
			
		||||
            if (ParameterKind() != Z3_parameter_kind.Z3_PARAMETER_INT)
 | 
			
		||||
                throw new Z3Exception("parameter is not an int");
 | 
			
		||||
            return i;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
		/**
 | 
			
		||||
		 * The double value of the parameter.</summary>
 | 
			
		||||
		 **/
 | 
			
		||||
		public double Double() throws Z3Exception
 | 
			
		||||
		{
 | 
			
		||||
			if (ParameterKind() != Z3_parameter_kind.Z3_PARAMETER_DOUBLE)
 | 
			
		||||
				throw new Z3Exception("parameter is not a double ");
 | 
			
		||||
			return d;
 | 
			
		||||
		}
 | 
			
		||||
        /**
 | 
			
		||||
         * The double value of the parameter.</summary>
 | 
			
		||||
         **/
 | 
			
		||||
        public double Double() throws Z3Exception
 | 
			
		||||
        {
 | 
			
		||||
            if (ParameterKind() != Z3_parameter_kind.Z3_PARAMETER_DOUBLE)
 | 
			
		||||
                throw new Z3Exception("parameter is not a double ");
 | 
			
		||||
            return d;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
		/**
 | 
			
		||||
		 * The Symbol value of the parameter.</summary>
 | 
			
		||||
		 **/
 | 
			
		||||
		public Symbol Symbol() throws Z3Exception
 | 
			
		||||
		{
 | 
			
		||||
			if (ParameterKind() != Z3_parameter_kind.Z3_PARAMETER_SYMBOL)
 | 
			
		||||
				throw new Z3Exception("parameter is not a Symbol");
 | 
			
		||||
			return sym;
 | 
			
		||||
		}
 | 
			
		||||
        /**
 | 
			
		||||
         * The Symbol value of the parameter.</summary>
 | 
			
		||||
         **/
 | 
			
		||||
        public Symbol Symbol() throws Z3Exception
 | 
			
		||||
        {
 | 
			
		||||
            if (ParameterKind() != Z3_parameter_kind.Z3_PARAMETER_SYMBOL)
 | 
			
		||||
                throw new Z3Exception("parameter is not a Symbol");
 | 
			
		||||
            return sym;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
		/**
 | 
			
		||||
		 * The Sort value of the parameter.</summary>
 | 
			
		||||
		 **/
 | 
			
		||||
		public Sort Sort() throws Z3Exception
 | 
			
		||||
		{
 | 
			
		||||
			if (ParameterKind() != Z3_parameter_kind.Z3_PARAMETER_SORT)
 | 
			
		||||
				throw new Z3Exception("parameter is not a Sort");
 | 
			
		||||
			return srt;
 | 
			
		||||
		}
 | 
			
		||||
        /**
 | 
			
		||||
         * The Sort value of the parameter.</summary>
 | 
			
		||||
         **/
 | 
			
		||||
        public Sort Sort() throws Z3Exception
 | 
			
		||||
        {
 | 
			
		||||
            if (ParameterKind() != Z3_parameter_kind.Z3_PARAMETER_SORT)
 | 
			
		||||
                throw new Z3Exception("parameter is not a Sort");
 | 
			
		||||
            return srt;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
		/**
 | 
			
		||||
		 * The AST value of the parameter.</summary>
 | 
			
		||||
		 **/
 | 
			
		||||
		public AST AST() throws Z3Exception
 | 
			
		||||
		{
 | 
			
		||||
			if (ParameterKind() != Z3_parameter_kind.Z3_PARAMETER_AST)
 | 
			
		||||
				throw new Z3Exception("parameter is not an AST");
 | 
			
		||||
			return ast;
 | 
			
		||||
		}
 | 
			
		||||
        /**
 | 
			
		||||
         * The AST value of the parameter.</summary>
 | 
			
		||||
         **/
 | 
			
		||||
        public AST AST() throws Z3Exception
 | 
			
		||||
        {
 | 
			
		||||
            if (ParameterKind() != Z3_parameter_kind.Z3_PARAMETER_AST)
 | 
			
		||||
                throw new Z3Exception("parameter is not an AST");
 | 
			
		||||
            return ast;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
		/**
 | 
			
		||||
		 * The FunctionDeclaration value of the parameter.</summary>
 | 
			
		||||
		 **/
 | 
			
		||||
		public FuncDecl FuncDecl() throws Z3Exception
 | 
			
		||||
		{
 | 
			
		||||
			if (ParameterKind() != Z3_parameter_kind.Z3_PARAMETER_FUNC_DECL)
 | 
			
		||||
				throw new Z3Exception("parameter is not a function declaration");
 | 
			
		||||
			return fd;
 | 
			
		||||
		}
 | 
			
		||||
        /**
 | 
			
		||||
         * The FunctionDeclaration value of the parameter.</summary>
 | 
			
		||||
         **/
 | 
			
		||||
        public FuncDecl FuncDecl() throws Z3Exception
 | 
			
		||||
        {
 | 
			
		||||
            if (ParameterKind() != Z3_parameter_kind.Z3_PARAMETER_FUNC_DECL)
 | 
			
		||||
                throw new Z3Exception("parameter is not a function declaration");
 | 
			
		||||
            return fd;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
		/**
 | 
			
		||||
		 * The rational string value of the parameter.</summary>
 | 
			
		||||
		 **/
 | 
			
		||||
		public String Rational() throws Z3Exception
 | 
			
		||||
		{
 | 
			
		||||
			if (ParameterKind() != Z3_parameter_kind.Z3_PARAMETER_RATIONAL)
 | 
			
		||||
				throw new Z3Exception("parameter is not a rational String");
 | 
			
		||||
			return r;
 | 
			
		||||
		}
 | 
			
		||||
        /**
 | 
			
		||||
         * The rational string value of the parameter.</summary>
 | 
			
		||||
         **/
 | 
			
		||||
        public String Rational() throws Z3Exception
 | 
			
		||||
        {
 | 
			
		||||
            if (ParameterKind() != Z3_parameter_kind.Z3_PARAMETER_RATIONAL)
 | 
			
		||||
                throw new Z3Exception("parameter is not a rational String");
 | 
			
		||||
            return r;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
		/**
 | 
			
		||||
		 * The kind of the parameter.
 | 
			
		||||
		 **/
 | 
			
		||||
		public Z3_parameter_kind ParameterKind() throws Z3Exception
 | 
			
		||||
		{
 | 
			
		||||
			return kind;
 | 
			
		||||
		}
 | 
			
		||||
        /**
 | 
			
		||||
         * The kind of the parameter.
 | 
			
		||||
         **/
 | 
			
		||||
        public Z3_parameter_kind ParameterKind() throws Z3Exception
 | 
			
		||||
        {
 | 
			
		||||
            return kind;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
		Parameter(Z3_parameter_kind k, int i)
 | 
			
		||||
		{
 | 
			
		||||
			this.kind = k;
 | 
			
		||||
			this.i = i;
 | 
			
		||||
		}
 | 
			
		||||
        Parameter(Z3_parameter_kind k, int i)
 | 
			
		||||
        {
 | 
			
		||||
            this.kind = k;
 | 
			
		||||
            this.i = i;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
		Parameter(Z3_parameter_kind k, double d)
 | 
			
		||||
		{
 | 
			
		||||
			this.kind = k;
 | 
			
		||||
			this.d = d;
 | 
			
		||||
		}
 | 
			
		||||
        Parameter(Z3_parameter_kind k, double d)
 | 
			
		||||
        {
 | 
			
		||||
            this.kind = k;
 | 
			
		||||
            this.d = d;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
		Parameter(Z3_parameter_kind k, Symbol s)
 | 
			
		||||
		{
 | 
			
		||||
			this.kind = k;
 | 
			
		||||
			this.sym = s;
 | 
			
		||||
		}
 | 
			
		||||
        Parameter(Z3_parameter_kind k, Symbol s)
 | 
			
		||||
        {
 | 
			
		||||
            this.kind = k;
 | 
			
		||||
            this.sym = s;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
		Parameter(Z3_parameter_kind k, Sort s)
 | 
			
		||||
		{
 | 
			
		||||
			this.kind = k;
 | 
			
		||||
			this.srt = s;
 | 
			
		||||
		}
 | 
			
		||||
        Parameter(Z3_parameter_kind k, Sort s)
 | 
			
		||||
        {
 | 
			
		||||
            this.kind = k;
 | 
			
		||||
            this.srt = s;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
		Parameter(Z3_parameter_kind k, AST a)
 | 
			
		||||
		{
 | 
			
		||||
			this.kind = k;
 | 
			
		||||
			this.ast = a;
 | 
			
		||||
		}
 | 
			
		||||
        Parameter(Z3_parameter_kind k, AST a)
 | 
			
		||||
        {
 | 
			
		||||
            this.kind = k;
 | 
			
		||||
            this.ast = a;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
		Parameter(Z3_parameter_kind k, FuncDecl fd)
 | 
			
		||||
		{
 | 
			
		||||
			this.kind = k;
 | 
			
		||||
			this.fd = fd;
 | 
			
		||||
		}
 | 
			
		||||
        Parameter(Z3_parameter_kind k, FuncDecl fd)
 | 
			
		||||
        {
 | 
			
		||||
            this.kind = k;
 | 
			
		||||
            this.fd = fd;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
		Parameter(Z3_parameter_kind k, String r)
 | 
			
		||||
		{
 | 
			
		||||
			this.kind = k;
 | 
			
		||||
			this.r = r;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
        Parameter(Z3_parameter_kind k, String r)
 | 
			
		||||
        {
 | 
			
		||||
            this.kind = k;
 | 
			
		||||
            this.r = r;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	FuncDecl(Context ctx, long obj) throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		super(ctx, obj);
 | 
			
		||||
    FuncDecl(Context ctx, long obj) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        super(ctx, obj);
 | 
			
		||||
 | 
			
		||||
	}
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	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()));
 | 
			
		||||
    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()));
 | 
			
		||||
 | 
			
		||||
	}
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	FuncDecl(Context ctx, String prefix, Sort[] domain, Sort range)
 | 
			
		||||
			throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		super(ctx, Native.mkFreshFuncDecl(ctx.nCtx(), prefix,
 | 
			
		||||
				AST.ArrayLength(domain), AST.ArrayToNative(domain),
 | 
			
		||||
				range.NativeObject()));
 | 
			
		||||
    FuncDecl(Context ctx, String prefix, Sort[] domain, Sort range)
 | 
			
		||||
            throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        super(ctx, Native.mkFreshFuncDecl(ctx.nCtx(), prefix,
 | 
			
		||||
                AST.ArrayLength(domain), AST.ArrayToNative(domain),
 | 
			
		||||
                range.NativeObject()));
 | 
			
		||||
 | 
			
		||||
	}
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	void CheckNativeObject(long obj) throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		if (Native.getAstKind(Context().nCtx(), obj) != Z3_ast_kind.Z3_FUNC_DECL_AST
 | 
			
		||||
				.toInt())
 | 
			
		||||
			throw new Z3Exception(
 | 
			
		||||
					"Underlying object is not a function declaration");
 | 
			
		||||
		super.CheckNativeObject(obj);
 | 
			
		||||
	}
 | 
			
		||||
    void CheckNativeObject(long obj) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        if (Native.getAstKind(Context().nCtx(), obj) != Z3_ast_kind.Z3_FUNC_DECL_AST
 | 
			
		||||
                .toInt())
 | 
			
		||||
            throw new Z3Exception(
 | 
			
		||||
                    "Underlying object is not a function declaration");
 | 
			
		||||
        super.CheckNativeObject(obj);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Create expression that applies function to arguments. 
 | 
			
		||||
	 * <param name="args"></param>
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @return
 | 
			
		||||
	 **/
 | 
			
		||||
	/* operator this[] not translated */
 | 
			
		||||
    /**
 | 
			
		||||
     * Create expression that applies function to arguments. <param
 | 
			
		||||
     * name="args"></param>
 | 
			
		||||
     * 
 | 
			
		||||
     * @return
 | 
			
		||||
     **/
 | 
			
		||||
    /* operator this[] not translated */
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Create expression that applies function to arguments.
 | 
			
		||||
	 * <param name="args"></param>
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @return
 | 
			
		||||
	 **/
 | 
			
		||||
	public Expr Apply(Expr[] args) throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		Context().CheckContextMatch(args);
 | 
			
		||||
		return Expr.Create(Context(), this, args);
 | 
			
		||||
	}
 | 
			
		||||
    /**
 | 
			
		||||
     * Create expression that applies function to arguments. <param
 | 
			
		||||
     * name="args"></param>
 | 
			
		||||
     * 
 | 
			
		||||
     * @return
 | 
			
		||||
     **/
 | 
			
		||||
    public Expr Apply(Expr[] args) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Context().CheckContextMatch(args);
 | 
			
		||||
        return Expr.Create(Context(), 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);
 | 
			
		||||
	}
 | 
			
		||||
    /**
 | 
			
		||||
     * 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);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -33,7 +33,7 @@ public class FuncInterp extends Z3Object
 | 
			
		|||
		/**
 | 
			
		||||
		 * The number of arguments of the entry.
 | 
			
		||||
		 **/
 | 
			
		||||
		public int NumArgs()
 | 
			
		||||
		public int NumArgs() throws Z3Exception
 | 
			
		||||
		{
 | 
			
		||||
			return Native.funcEntryGetNumArgs(Context().nCtx(), NativeObject());
 | 
			
		||||
		}
 | 
			
		||||
| 
						 | 
				
			
			@ -93,7 +93,7 @@ public class FuncInterp extends Z3Object
 | 
			
		|||
	/**
 | 
			
		||||
	 * The number of entries in the function interpretation.
 | 
			
		||||
	 **/
 | 
			
		||||
	public int NumEntries()
 | 
			
		||||
	public int NumEntries() throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		return Native.funcInterpGetNumEntries(Context().nCtx(), NativeObject());
 | 
			
		||||
	}
 | 
			
		||||
| 
						 | 
				
			
			@ -127,7 +127,7 @@ public class FuncInterp extends Z3Object
 | 
			
		|||
	/**
 | 
			
		||||
	 * The arity of the function interpretation
 | 
			
		||||
	 **/
 | 
			
		||||
	public int Arity()
 | 
			
		||||
	public int Arity() throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		return Native.funcInterpGetArity(Context().nCtx(), NativeObject());
 | 
			
		||||
	}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -7,13 +7,25 @@ package com.microsoft.z3;
 | 
			
		|||
 | 
			
		||||
class FuncInterpDecRefQueue extends IDecRefQueue
 | 
			
		||||
{
 | 
			
		||||
	public void IncRef(Context ctx, long obj)
 | 
			
		||||
	{
 | 
			
		||||
		Native.funcInterpIncRef(ctx.nCtx(), obj);
 | 
			
		||||
	}
 | 
			
		||||
    public void IncRef(Context ctx, long obj)
 | 
			
		||||
    {
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
            Native.funcInterpIncRef(ctx.nCtx(), obj);
 | 
			
		||||
        } catch (Z3Exception e)
 | 
			
		||||
        {
 | 
			
		||||
            // OK.
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	public void DecRef(Context ctx, long obj)
 | 
			
		||||
	{
 | 
			
		||||
		Native.funcInterpDecRef(ctx.nCtx(), obj);
 | 
			
		||||
	}
 | 
			
		||||
    public void DecRef(Context ctx, long obj)
 | 
			
		||||
    {
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
            Native.funcInterpDecRef(ctx.nCtx(), obj);
 | 
			
		||||
        } catch (Z3Exception e)
 | 
			
		||||
        {
 | 
			
		||||
            // OK.
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
};
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -7,13 +7,25 @@ package com.microsoft.z3;
 | 
			
		|||
 | 
			
		||||
class FuncInterpEntryDecRefQueue extends IDecRefQueue
 | 
			
		||||
{
 | 
			
		||||
	public void IncRef(Context ctx, long obj)
 | 
			
		||||
	{
 | 
			
		||||
		Native.funcEntryIncRef(ctx.nCtx(), obj);
 | 
			
		||||
	}
 | 
			
		||||
    public void IncRef(Context ctx, long obj)
 | 
			
		||||
    {
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
            Native.funcEntryIncRef(ctx.nCtx(), obj);
 | 
			
		||||
        } catch (Z3Exception e)
 | 
			
		||||
        {
 | 
			
		||||
            // OK.
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	public void DecRef(Context ctx, long obj)
 | 
			
		||||
	{
 | 
			
		||||
		Native.funcEntryDecRef(ctx.nCtx(), obj);
 | 
			
		||||
	}
 | 
			
		||||
    public void DecRef(Context ctx, long obj)
 | 
			
		||||
    {
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
            Native.funcEntryDecRef(ctx.nCtx(), obj);
 | 
			
		||||
        } catch (Z3Exception e)
 | 
			
		||||
        {
 | 
			
		||||
            // OK.
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
};
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -14,207 +14,218 @@ import com.microsoft.z3.enumerations.*;
 | 
			
		|||
 **/
 | 
			
		||||
public class Goal extends Z3Object
 | 
			
		||||
{
 | 
			
		||||
	/**
 | 
			
		||||
	 * The precision of the goal. <remarks> Goals can be transformed using over
 | 
			
		||||
	 * and under approximations. An under approximation is applied when the
 | 
			
		||||
	 * objective is to find a model for a given goal. An over approximation is
 | 
			
		||||
	 * applied when the objective is to find a proof for a given goal.
 | 
			
		||||
	 * </remarks>
 | 
			
		||||
	 **/
 | 
			
		||||
	public Z3_goal_prec Precision()
 | 
			
		||||
	{
 | 
			
		||||
		return Z3_goal_prec.fromInt(Native.goalPrecision(Context().nCtx(),
 | 
			
		||||
				NativeObject()));
 | 
			
		||||
	}
 | 
			
		||||
    /**
 | 
			
		||||
     * The precision of the goal. <remarks> Goals can be transformed using over
 | 
			
		||||
     * and under approximations. An under approximation is applied when the
 | 
			
		||||
     * objective is to find a model for a given goal. An over approximation is
 | 
			
		||||
     * applied when the objective is to find a proof for a given goal.
 | 
			
		||||
     * </remarks>
 | 
			
		||||
     **/
 | 
			
		||||
    public Z3_goal_prec Precision() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Z3_goal_prec.fromInt(Native.goalPrecision(Context().nCtx(),
 | 
			
		||||
                NativeObject()));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Indicates whether the goal is precise.
 | 
			
		||||
	 **/
 | 
			
		||||
	public boolean IsPrecise()
 | 
			
		||||
	{
 | 
			
		||||
		return Precision() == Z3_goal_prec.Z3_GOAL_PRECISE;
 | 
			
		||||
	}
 | 
			
		||||
    /**
 | 
			
		||||
     * Indicates whether the goal is precise.
 | 
			
		||||
     **/
 | 
			
		||||
    public boolean IsPrecise() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Precision() == Z3_goal_prec.Z3_GOAL_PRECISE;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Indicates whether the goal is an under-approximation.
 | 
			
		||||
	 **/
 | 
			
		||||
	public boolean IsUnderApproximation()
 | 
			
		||||
	{
 | 
			
		||||
		return Precision() == Z3_goal_prec.Z3_GOAL_UNDER;
 | 
			
		||||
	}
 | 
			
		||||
    /**
 | 
			
		||||
     * Indicates whether the goal is an under-approximation.
 | 
			
		||||
     **/
 | 
			
		||||
    public boolean IsUnderApproximation() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Precision() == Z3_goal_prec.Z3_GOAL_UNDER;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Indicates whether the goal is an over-approximation.
 | 
			
		||||
	 **/
 | 
			
		||||
	public boolean IsOverApproximation()
 | 
			
		||||
	{
 | 
			
		||||
		return Precision() == Z3_goal_prec.Z3_GOAL_OVER;
 | 
			
		||||
	}
 | 
			
		||||
    /**
 | 
			
		||||
     * Indicates whether the goal is an over-approximation.
 | 
			
		||||
     **/
 | 
			
		||||
    public boolean IsOverApproximation() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Precision() == Z3_goal_prec.Z3_GOAL_OVER;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Indicates whether the goal is garbage (i.e., the product of over- and
 | 
			
		||||
	 * under-approximations).
 | 
			
		||||
	 **/
 | 
			
		||||
	public boolean IsGarbage()
 | 
			
		||||
	{
 | 
			
		||||
		return Precision() == Z3_goal_prec.Z3_GOAL_UNDER_OVER;
 | 
			
		||||
	}
 | 
			
		||||
    /**
 | 
			
		||||
     * Indicates whether the goal is garbage (i.e., the product of over- and
 | 
			
		||||
     * under-approximations).
 | 
			
		||||
     **/
 | 
			
		||||
    public boolean IsGarbage() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Precision() == Z3_goal_prec.Z3_GOAL_UNDER_OVER;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Adds the <paramref name="constraints"/> to the given goal.
 | 
			
		||||
	 * @throws Z3Exception 
 | 
			
		||||
	 **/
 | 
			
		||||
	public void Assert(BoolExpr[] constraints) throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		Context().CheckContextMatch(constraints);
 | 
			
		||||
		for (BoolExpr c : constraints)
 | 
			
		||||
		{
 | 
			
		||||
		    Native.goalAssert(Context().nCtx(), NativeObject(),
 | 
			
		||||
				      c.NativeObject());
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
    /**
 | 
			
		||||
     * Adds the <paramref name="constraints"/> to the given goal.
 | 
			
		||||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public void Assert(BoolExpr[] constraints) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Context().CheckContextMatch(constraints);
 | 
			
		||||
        for (BoolExpr c : constraints)
 | 
			
		||||
        {
 | 
			
		||||
            Native.goalAssert(Context().nCtx(), NativeObject(),
 | 
			
		||||
                    c.NativeObject());
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
	 * 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());
 | 
			
		||||
	}
 | 
			
		||||
    /**
 | 
			
		||||
     * 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()
 | 
			
		||||
	{
 | 
			
		||||
		return Native.goalInconsistent(Context().nCtx(), NativeObject());
 | 
			
		||||
	}
 | 
			
		||||
    /**
 | 
			
		||||
     * Indicates whether the goal contains `false'.
 | 
			
		||||
     **/
 | 
			
		||||
    public boolean Inconsistent() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Native.goalInconsistent(Context().nCtx(), NativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * The depth of the goal. <remarks> This tracks how many transformations
 | 
			
		||||
	 * were applied to it. </remarks>
 | 
			
		||||
	 **/
 | 
			
		||||
	public int Depth()
 | 
			
		||||
	{
 | 
			
		||||
		return Native.goalDepth(Context().nCtx(), NativeObject());
 | 
			
		||||
	}
 | 
			
		||||
    /**
 | 
			
		||||
     * The depth of the goal. <remarks> This tracks how many transformations
 | 
			
		||||
     * were applied to it. </remarks>
 | 
			
		||||
     **/
 | 
			
		||||
    public int Depth() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Native.goalDepth(Context().nCtx(), NativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Erases all formulas from the given goal.
 | 
			
		||||
	 **/
 | 
			
		||||
	public void Reset()
 | 
			
		||||
	{
 | 
			
		||||
		Native.goalReset(Context().nCtx(), NativeObject());
 | 
			
		||||
	}
 | 
			
		||||
    /**
 | 
			
		||||
     * Erases all formulas from the given goal.
 | 
			
		||||
     **/
 | 
			
		||||
    public void Reset() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Native.goalReset(Context().nCtx(), NativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * The number of formulas in the goal.
 | 
			
		||||
	 **/
 | 
			
		||||
	public int Size()
 | 
			
		||||
	{
 | 
			
		||||
		return Native.goalSize(Context().nCtx(), NativeObject());
 | 
			
		||||
	}
 | 
			
		||||
    /**
 | 
			
		||||
     * The number of formulas in the goal.
 | 
			
		||||
     **/
 | 
			
		||||
    public int Size() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Native.goalSize(Context().nCtx(), NativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * The formulas in the goal.
 | 
			
		||||
	 * @throws Z3Exception 
 | 
			
		||||
	 **/
 | 
			
		||||
	public BoolExpr[] Formulas() throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		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));
 | 
			
		||||
		return res;
 | 
			
		||||
	}
 | 
			
		||||
    /**
 | 
			
		||||
     * The formulas in the goal.
 | 
			
		||||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public BoolExpr[] Formulas() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        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));
 | 
			
		||||
        return res;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * The number of formulas, subformulas and terms in the goal.
 | 
			
		||||
	 **/
 | 
			
		||||
	public int NumExprs()
 | 
			
		||||
	{
 | 
			
		||||
		return Native.goalNumExprs(Context().nCtx(), NativeObject());
 | 
			
		||||
	}
 | 
			
		||||
    /**
 | 
			
		||||
     * The number of formulas, subformulas and terms in the goal.
 | 
			
		||||
     **/
 | 
			
		||||
    public int NumExprs() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Native.goalNumExprs(Context().nCtx(), NativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Indicates whether the goal is empty, and it is precise or the product of
 | 
			
		||||
	 * an under approximation.
 | 
			
		||||
	 **/
 | 
			
		||||
	public boolean IsDecidedSat()
 | 
			
		||||
	{
 | 
			
		||||
		return Native.goalIsDecidedSat(Context().nCtx(), NativeObject());
 | 
			
		||||
	}
 | 
			
		||||
    /**
 | 
			
		||||
     * Indicates whether the goal is empty, and it is precise or the product of
 | 
			
		||||
     * an under approximation.
 | 
			
		||||
     **/
 | 
			
		||||
    public boolean IsDecidedSat() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Native.goalIsDecidedSat(Context().nCtx(), NativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Indicates whether the goal contains `false', and it is precise or the
 | 
			
		||||
	 * product of an over approximation.
 | 
			
		||||
	 **/
 | 
			
		||||
	public boolean IsDecidedUnsat()
 | 
			
		||||
	{
 | 
			
		||||
		return Native.goalIsDecidedUnsat(Context().nCtx(), NativeObject());
 | 
			
		||||
	}
 | 
			
		||||
    /**
 | 
			
		||||
     * Indicates whether the goal contains `false', and it is precise or the
 | 
			
		||||
     * product of an over approximation.
 | 
			
		||||
     **/
 | 
			
		||||
    public boolean IsDecidedUnsat() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Native.goalIsDecidedUnsat(Context().nCtx(), NativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Translates (copies) the Goal to the target Context <paramref
 | 
			
		||||
	 * name="ctx"/>.
 | 
			
		||||
	 * @throws Z3Exception 
 | 
			
		||||
	 **/
 | 
			
		||||
	public Goal Translate(Context ctx) throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		return new Goal(ctx, Native.goalTranslate(Context().nCtx(),
 | 
			
		||||
				NativeObject(), ctx.nCtx()));
 | 
			
		||||
	}
 | 
			
		||||
    /**
 | 
			
		||||
     * Translates (copies) the Goal to the target Context <paramref
 | 
			
		||||
     * name="ctx"/>.
 | 
			
		||||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public Goal Translate(Context ctx) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return new Goal(ctx, Native.goalTranslate(Context().nCtx(),
 | 
			
		||||
                NativeObject(), ctx.nCtx()));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Simplifies the goal. <remarks>Essentially invokes the `simplify' tactic
 | 
			
		||||
	 * on the goal.</remarks>
 | 
			
		||||
	 **/
 | 
			
		||||
	public Goal Simplify(Params p) throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		Tactic t = Context().MkTactic("simplify");
 | 
			
		||||
		ApplyResult res = t.Apply(this, p);
 | 
			
		||||
    /**
 | 
			
		||||
     * Simplifies the goal. <remarks>Essentially invokes the `simplify' tactic
 | 
			
		||||
     * on the goal.</remarks>
 | 
			
		||||
     **/
 | 
			
		||||
    public Goal Simplify(Params p) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Tactic t = Context().MkTactic("simplify");
 | 
			
		||||
        ApplyResult res = t.Apply(this, p);
 | 
			
		||||
 | 
			
		||||
		if (res.NumSubgoals() == 0)
 | 
			
		||||
			throw new Z3Exception("No subgoals");
 | 
			
		||||
		else
 | 
			
		||||
			return res.Subgoals()[0];
 | 
			
		||||
	}
 | 
			
		||||
        if (res.NumSubgoals() == 0)
 | 
			
		||||
            throw new Z3Exception("No subgoals");
 | 
			
		||||
        else
 | 
			
		||||
            return res.Subgoals()[0];
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Goal to string conversion.
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @return A string representation of the Goal.
 | 
			
		||||
	 **/
 | 
			
		||||
	public String toString()
 | 
			
		||||
	{
 | 
			
		||||
		return Native.goalToString(Context().nCtx(), NativeObject());
 | 
			
		||||
	}
 | 
			
		||||
    /**
 | 
			
		||||
     * Goal to string conversion.
 | 
			
		||||
     * 
 | 
			
		||||
     * @return A string representation of the Goal.
 | 
			
		||||
     **/
 | 
			
		||||
    public String toString()
 | 
			
		||||
    {
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
            return Native.goalToString(Context().nCtx(), NativeObject());
 | 
			
		||||
        } catch (Z3Exception e)
 | 
			
		||||
        {
 | 
			
		||||
            return "Z3Exception: " + e.getMessage();
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	Goal(Context ctx, long obj) throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		super(ctx, obj);
 | 
			
		||||
	}
 | 
			
		||||
    Goal(Context ctx, long obj) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        super(ctx, obj);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	Goal(Context ctx, boolean models, boolean unsatCores, boolean proofs) throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		super(ctx, Native.mkGoal(ctx.nCtx(), (models) ? true : false,
 | 
			
		||||
				(unsatCores) ? true : false, (proofs) ? true : false));
 | 
			
		||||
	}
 | 
			
		||||
    Goal(Context ctx, boolean models, boolean unsatCores, boolean proofs)
 | 
			
		||||
            throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        super(ctx, Native.mkGoal(ctx.nCtx(), (models) ? true : false,
 | 
			
		||||
                (unsatCores) ? true : false, (proofs) ? true : false));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	void IncRef(long o) throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		Context().Goal_DRQ().IncAndClear(Context(), o);
 | 
			
		||||
		super.IncRef(o);
 | 
			
		||||
	}
 | 
			
		||||
    void IncRef(long o) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Context().Goal_DRQ().IncAndClear(Context(), o);
 | 
			
		||||
        super.IncRef(o);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	void DecRef(long o) throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		Context().Goal_DRQ().Add(o);
 | 
			
		||||
		super.DecRef(o);
 | 
			
		||||
	}
 | 
			
		||||
    void DecRef(long o) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Context().Goal_DRQ().Add(o);
 | 
			
		||||
        super.DecRef(o);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -7,13 +7,25 @@ package com.microsoft.z3;
 | 
			
		|||
 | 
			
		||||
class GoalDecRefQueue extends IDecRefQueue
 | 
			
		||||
{
 | 
			
		||||
	public void IncRef(Context ctx, long obj)
 | 
			
		||||
	{
 | 
			
		||||
		Native.goalIncRef(ctx.nCtx(), obj);
 | 
			
		||||
	}
 | 
			
		||||
    public void IncRef(Context ctx, long obj)
 | 
			
		||||
    {
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
            Native.goalIncRef(ctx.nCtx(), obj);
 | 
			
		||||
        } catch (Z3Exception e)
 | 
			
		||||
        {
 | 
			
		||||
            // OK.
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	public void DecRef(Context ctx, long obj)
 | 
			
		||||
	{
 | 
			
		||||
		Native.goalDecRef(ctx.nCtx(), obj);
 | 
			
		||||
	}
 | 
			
		||||
    public void DecRef(Context ctx, long obj)
 | 
			
		||||
    {
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
            Native.goalDecRef(ctx.nCtx(), obj);
 | 
			
		||||
        } catch (Z3Exception e)
 | 
			
		||||
        {
 | 
			
		||||
            // OK.
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
};
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -14,46 +14,52 @@ import java.math.BigInteger;
 | 
			
		|||
public class IntNum extends IntExpr
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
	IntNum(Context ctx, long obj) throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		super(ctx, obj);
 | 
			
		||||
	}
 | 
			
		||||
    IntNum(Context ctx, long obj) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        super(ctx, obj);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Retrieve the int value.
 | 
			
		||||
	 **/
 | 
			
		||||
	public int Int() throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		Native.IntPtr res = new Native.IntPtr();
 | 
			
		||||
		if (Native.getNumeralInt(Context().nCtx(), NativeObject(), res) ^ true)
 | 
			
		||||
			throw new Z3Exception("Numeral is not an int");
 | 
			
		||||
		return res.value;
 | 
			
		||||
	}
 | 
			
		||||
    /**
 | 
			
		||||
     * Retrieve the int value.
 | 
			
		||||
     **/
 | 
			
		||||
    public int Int() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Native.IntPtr res = new Native.IntPtr();
 | 
			
		||||
        if (Native.getNumeralInt(Context().nCtx(), NativeObject(), res) ^ true)
 | 
			
		||||
            throw new Z3Exception("Numeral is not an int");
 | 
			
		||||
        return res.value;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Retrieve the 64-bit int value.
 | 
			
		||||
	 **/
 | 
			
		||||
	public long Int64() throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		Native.LongPtr res = new Native.LongPtr();
 | 
			
		||||
		if (Native.getNumeralInt64(Context().nCtx(), NativeObject(), res) ^ true)
 | 
			
		||||
			throw new Z3Exception("Numeral is not an int64");
 | 
			
		||||
		return res.value;
 | 
			
		||||
	}
 | 
			
		||||
    /**
 | 
			
		||||
     * Retrieve the 64-bit int value.
 | 
			
		||||
     **/
 | 
			
		||||
    public long Int64() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Native.LongPtr res = new Native.LongPtr();
 | 
			
		||||
        if (Native.getNumeralInt64(Context().nCtx(), NativeObject(), res) ^ true)
 | 
			
		||||
            throw new Z3Exception("Numeral is not an int64");
 | 
			
		||||
        return res.value;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Retrieve the BigInteger value.
 | 
			
		||||
	 **/
 | 
			
		||||
	public BigInteger BigInteger() throws Z3Exception
 | 
			
		||||
	{
 | 
			
		||||
		return new BigInteger(this.toString());
 | 
			
		||||
	}
 | 
			
		||||
    /**
 | 
			
		||||
     * Retrieve the BigInteger value.
 | 
			
		||||
     **/
 | 
			
		||||
    public BigInteger BigInteger() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return new BigInteger(this.toString());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Returns a string representation of the numeral.
 | 
			
		||||
	 **/
 | 
			
		||||
	public String toString()
 | 
			
		||||
	{
 | 
			
		||||
		return Native.getNumeralString(Context().nCtx(), NativeObject());
 | 
			
		||||
	}
 | 
			
		||||
    /**
 | 
			
		||||
     * Returns a string representation of the numeral.
 | 
			
		||||
     **/
 | 
			
		||||
    public String toString()
 | 
			
		||||
    {
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
            return Native.getNumeralString(Context().nCtx(), NativeObject());
 | 
			
		||||
        } catch (Z3Exception e)
 | 
			
		||||
        {
 | 
			
		||||
            return "Z3Exception: " + e.getMessage();
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -19,7 +19,7 @@ public class Model extends Z3Object
 | 
			
		|||
     * 
 | 
			
		||||
     * @return An expression if the constant has an interpretation in the model,
 | 
			
		||||
     *         null otherwise.
 | 
			
		||||
     * @throws Z3Exception 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public Expr ConstInterp(Expr a) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
| 
						 | 
				
			
			@ -33,7 +33,7 @@ public class Model extends Z3Object
 | 
			
		|||
     * 
 | 
			
		||||
     * @return An expression if the function has an interpretation in the model,
 | 
			
		||||
     *         null otherwise.
 | 
			
		||||
     * @throws Z3Exception 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public Expr ConstInterp(FuncDecl f) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
| 
						 | 
				
			
			@ -60,7 +60,7 @@ public class Model extends Z3Object
 | 
			
		|||
     * 
 | 
			
		||||
     * @return A FunctionInterpretation if the function has an interpretation in
 | 
			
		||||
     *         the model, null otherwise.
 | 
			
		||||
     * @throws Z3Exception 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public FuncInterp FuncInterp(FuncDecl f) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
| 
						 | 
				
			
			@ -105,14 +105,15 @@ public class Model extends Z3Object
 | 
			
		|||
    /**
 | 
			
		||||
     * The number of constants that have an interpretation in the model.
 | 
			
		||||
     **/
 | 
			
		||||
    public int NumConsts()
 | 
			
		||||
    public int NumConsts() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Native.modelGetNumConsts(Context().nCtx(), NativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * The function declarations of the constants in the model.
 | 
			
		||||
     * @throws Z3Exception 
 | 
			
		||||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public FuncDecl[] ConstDecls() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
| 
						 | 
				
			
			@ -127,14 +128,15 @@ public class Model extends Z3Object
 | 
			
		|||
    /**
 | 
			
		||||
     * The number of function interpretations in the model.
 | 
			
		||||
     **/
 | 
			
		||||
    public int NumFuncs()
 | 
			
		||||
    public int NumFuncs() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Native.modelGetNumFuncs(Context().nCtx(), NativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * The function declarations of the function interpretations in the model.
 | 
			
		||||
     * @throws Z3Exception 
 | 
			
		||||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public FuncDecl[] FuncDecls() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
| 
						 | 
				
			
			@ -148,7 +150,8 @@ public class Model extends Z3Object
 | 
			
		|||
 | 
			
		||||
    /**
 | 
			
		||||
     * All symbols that have an interpretation in the model.
 | 
			
		||||
     * @throws Z3Exception 
 | 
			
		||||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public FuncDecl[] Decls() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
| 
						 | 
				
			
			@ -192,7 +195,7 @@ public class Model extends Z3Object
 | 
			
		|||
     * that does not have an interpretation in the model. </param>
 | 
			
		||||
     * 
 | 
			
		||||
     * @return The evaluation of <paramref name="t"/> in the model.
 | 
			
		||||
     * @throws Z3Exception 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public Expr Eval(Expr t, boolean completion) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
| 
						 | 
				
			
			@ -206,7 +209,8 @@ public class Model extends Z3Object
 | 
			
		|||
 | 
			
		||||
    /**
 | 
			
		||||
     * Alias for <code>Eval</code>.
 | 
			
		||||
     * @throws Z3Exception 
 | 
			
		||||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public Expr Evaluate(Expr t, boolean completion) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
| 
						 | 
				
			
			@ -217,7 +221,7 @@ public class Model extends Z3Object
 | 
			
		|||
     * The number of uninterpreted sorts that the model has an interpretation
 | 
			
		||||
     * for.
 | 
			
		||||
     **/
 | 
			
		||||
    public int NumSorts()
 | 
			
		||||
    public int NumSorts() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Native.modelGetNumSorts(Context().nCtx(), NativeObject());
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			@ -228,7 +232,8 @@ public class Model extends Z3Object
 | 
			
		|||
     * in a formula. The interpretation for a sort is a finite set of distinct
 | 
			
		||||
     * values. We say this finite set is the "universe" of the sort. </remarks>
 | 
			
		||||
     * <seealso cref="NumSorts"/> <seealso cref="SortUniverse"/>
 | 
			
		||||
     * @throws Z3Exception 
 | 
			
		||||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public Sort[] Sorts() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
| 
						 | 
				
			
			@ -248,7 +253,7 @@ public class Model extends Z3Object
 | 
			
		|||
     * 
 | 
			
		||||
     * @return An array of expressions, where each is an element of the universe
 | 
			
		||||
     *         of <paramref name="s"/>
 | 
			
		||||
     * @throws Z3Exception 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public Expr[] SortUniverse(Sort s) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
| 
						 | 
				
			
			@ -269,7 +274,13 @@ public class Model extends Z3Object
 | 
			
		|||
     **/
 | 
			
		||||
    public String toString()
 | 
			
		||||
    {
 | 
			
		||||
        return Native.modelToString(Context().nCtx(), NativeObject());
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
            return Native.modelToString(Context().nCtx(), NativeObject());
 | 
			
		||||
        } catch (Z3Exception e)
 | 
			
		||||
        {
 | 
			
		||||
            return "Z3Exception: " + e.getMessage();
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    Model(Context ctx, long obj) throws Z3Exception
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -9,11 +9,23 @@ class ModelDecRefQueue extends IDecRefQueue
 | 
			
		|||
{
 | 
			
		||||
    public void IncRef(Context ctx, long obj)
 | 
			
		||||
    {
 | 
			
		||||
        Native.modelIncRef(ctx.nCtx(), obj);
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
            Native.modelIncRef(ctx.nCtx(), obj);
 | 
			
		||||
        } catch (Z3Exception e)
 | 
			
		||||
        {
 | 
			
		||||
            // OK.
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void DecRef(Context ctx, long obj)
 | 
			
		||||
    {
 | 
			
		||||
        Native.modelDecRef(ctx.nCtx(), obj);
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
            Native.modelDecRef(ctx.nCtx(), obj);
 | 
			
		||||
        } catch (Z3Exception e)
 | 
			
		||||
        {
 | 
			
		||||
            // OK.
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
};
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -16,7 +16,7 @@ public class ParamDescrs extends Z3Object
 | 
			
		|||
    /**
 | 
			
		||||
     * validate a set of parameters.
 | 
			
		||||
     **/
 | 
			
		||||
    public void Validate(Params p)
 | 
			
		||||
    public void Validate(Params p) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
        Native.paramsValidate(Context().nCtx(), p.NativeObject(),
 | 
			
		||||
| 
						 | 
				
			
			@ -26,7 +26,7 @@ public class ParamDescrs extends Z3Object
 | 
			
		|||
    /**
 | 
			
		||||
     * Retrieve kind of parameter.
 | 
			
		||||
     **/
 | 
			
		||||
    public Z3_param_kind GetKind(Symbol name)
 | 
			
		||||
    public Z3_param_kind GetKind(Symbol name) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
        return Z3_param_kind.fromInt(Native.paramDescrsGetKind(
 | 
			
		||||
| 
						 | 
				
			
			@ -53,7 +53,7 @@ public class ParamDescrs extends Z3Object
 | 
			
		|||
    /**
 | 
			
		||||
     * The size of the ParamDescrs.
 | 
			
		||||
     **/
 | 
			
		||||
    public int Size()
 | 
			
		||||
    public int Size() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Native.paramDescrsSize(Context().nCtx(), NativeObject());
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			@ -63,7 +63,13 @@ public class ParamDescrs extends Z3Object
 | 
			
		|||
     **/
 | 
			
		||||
    public String toString()
 | 
			
		||||
    {
 | 
			
		||||
        return Native.paramDescrsToString(Context().nCtx(), NativeObject());
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
            return Native.paramDescrsToString(Context().nCtx(), NativeObject());
 | 
			
		||||
        } catch (Z3Exception e)
 | 
			
		||||
        {
 | 
			
		||||
            return "Z3Exception: " + e.getMessage();
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    ParamDescrs(Context ctx, long obj) throws Z3Exception
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -9,11 +9,23 @@ class ParamDescrsDecRefQueue extends IDecRefQueue
 | 
			
		|||
{
 | 
			
		||||
    public void IncRef(Context ctx, long obj)
 | 
			
		||||
    {
 | 
			
		||||
        Native.paramDescrsIncRef(ctx.nCtx(), obj);
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
            Native.paramDescrsIncRef(ctx.nCtx(), obj);
 | 
			
		||||
        } catch (Z3Exception e)
 | 
			
		||||
        {
 | 
			
		||||
            // OK.
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void DecRef(Context ctx, long obj)
 | 
			
		||||
    {
 | 
			
		||||
        Native.paramDescrsDecRef(ctx.nCtx(), obj);
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
            Native.paramDescrsDecRef(ctx.nCtx(), obj);
 | 
			
		||||
        } catch (Z3Exception e)
 | 
			
		||||
        {
 | 
			
		||||
            // OK.
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
};
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -80,7 +80,13 @@ public class Params extends Z3Object
 | 
			
		|||
     **/
 | 
			
		||||
    public String toString()
 | 
			
		||||
    {
 | 
			
		||||
        return Native.paramsToString(Context().nCtx(), NativeObject());
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
            return Native.paramsToString(Context().nCtx(), NativeObject());
 | 
			
		||||
        } catch (Z3Exception e)
 | 
			
		||||
        {
 | 
			
		||||
            return "Z3Exception: " + e.getMessage();
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    Params(Context ctx) throws Z3Exception
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -9,11 +9,23 @@ class ParamsDecRefQueue extends IDecRefQueue
 | 
			
		|||
{
 | 
			
		||||
    public void IncRef(Context ctx, long obj)
 | 
			
		||||
    {
 | 
			
		||||
        Native.paramsIncRef(ctx.nCtx(), obj);
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
            Native.paramsIncRef(ctx.nCtx(), obj);
 | 
			
		||||
        } catch (Z3Exception e)
 | 
			
		||||
        {
 | 
			
		||||
            // OK.
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void DecRef(Context ctx, long obj)
 | 
			
		||||
    {
 | 
			
		||||
        Native.paramsDecRef(ctx.nCtx(), obj);
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
            Native.paramsDecRef(ctx.nCtx(), obj);
 | 
			
		||||
        } catch (Z3Exception e)
 | 
			
		||||
        {
 | 
			
		||||
            // OK.
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
};
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -15,7 +15,7 @@ public class Pattern extends AST
 | 
			
		|||
    /**
 | 
			
		||||
     * The number of terms in the pattern.
 | 
			
		||||
     **/
 | 
			
		||||
    public int NumTerms()
 | 
			
		||||
    public int NumTerms() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Native.getPatternNumTerms(Context().nCtx(), NativeObject());
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			@ -41,7 +41,13 @@ public class Pattern extends AST
 | 
			
		|||
     **/
 | 
			
		||||
    public String toString()
 | 
			
		||||
    {
 | 
			
		||||
        return Native.patternToString(Context().nCtx(), NativeObject());
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
            return Native.patternToString(Context().nCtx(), NativeObject());
 | 
			
		||||
        } catch (Z3Exception e)
 | 
			
		||||
        {
 | 
			
		||||
            return "Z3Exception: " + e.getMessage();
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    Pattern(Context ctx, long obj) throws Z3Exception
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -9,11 +9,23 @@ class ProbeDecRefQueue extends IDecRefQueue
 | 
			
		|||
{
 | 
			
		||||
    public void IncRef(Context ctx, long obj)
 | 
			
		||||
    {
 | 
			
		||||
        Native.probeIncRef(ctx.nCtx(), obj);
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
            Native.probeIncRef(ctx.nCtx(), obj);
 | 
			
		||||
        } catch (Z3Exception e)
 | 
			
		||||
        {
 | 
			
		||||
            // OK.
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void DecRef(Context ctx, long obj)
 | 
			
		||||
    {
 | 
			
		||||
        Native.probeDecRef(ctx.nCtx(), obj);
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
            Native.probeDecRef(ctx.nCtx(), obj);
 | 
			
		||||
        } catch (Z3Exception e)
 | 
			
		||||
        {
 | 
			
		||||
            // OK.
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
};
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -16,7 +16,7 @@ public class Quantifier extends BoolExpr
 | 
			
		|||
    /**
 | 
			
		||||
     * Indicates whether the quantifier is universal.
 | 
			
		||||
     **/
 | 
			
		||||
    public boolean IsUniversal()
 | 
			
		||||
    public boolean IsUniversal() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Native.isQuantifierForall(Context().nCtx(), NativeObject());
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			@ -24,7 +24,7 @@ public class Quantifier extends BoolExpr
 | 
			
		|||
    /**
 | 
			
		||||
     * Indicates whether the quantifier is existential.
 | 
			
		||||
     **/
 | 
			
		||||
    public boolean IsExistential()
 | 
			
		||||
    public boolean IsExistential() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return !IsUniversal();
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			@ -32,7 +32,7 @@ public class Quantifier extends BoolExpr
 | 
			
		|||
    /**
 | 
			
		||||
     * The weight of the quantifier.
 | 
			
		||||
     **/
 | 
			
		||||
    public int Weight()
 | 
			
		||||
    public int Weight() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Native.getQuantifierWeight(Context().nCtx(), NativeObject());
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			@ -40,7 +40,7 @@ public class Quantifier extends BoolExpr
 | 
			
		|||
    /**
 | 
			
		||||
     * The number of patterns.
 | 
			
		||||
     **/
 | 
			
		||||
    public int NumPatterns()
 | 
			
		||||
    public int NumPatterns() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Native
 | 
			
		||||
                .getQuantifierNumPatterns(Context().nCtx(), NativeObject());
 | 
			
		||||
| 
						 | 
				
			
			@ -64,7 +64,7 @@ public class Quantifier extends BoolExpr
 | 
			
		|||
    /**
 | 
			
		||||
     * The number of no-patterns.
 | 
			
		||||
     **/
 | 
			
		||||
    public int NumNoPatterns()
 | 
			
		||||
    public int NumNoPatterns() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Native.getQuantifierNumNoPatterns(Context().nCtx(),
 | 
			
		||||
                NativeObject());
 | 
			
		||||
| 
						 | 
				
			
			@ -88,7 +88,7 @@ public class Quantifier extends BoolExpr
 | 
			
		|||
    /**
 | 
			
		||||
     * The number of bound variables.
 | 
			
		||||
     **/
 | 
			
		||||
    public int NumBound()
 | 
			
		||||
    public int NumBound() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Native.getQuantifierNumBound(Context().nCtx(), NativeObject());
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -7,6 +7,7 @@
 | 
			
		|||
package com.microsoft.z3;
 | 
			
		||||
 | 
			
		||||
import java.math.BigInteger;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Rational Numerals
 | 
			
		||||
 **/
 | 
			
		||||
| 
						 | 
				
			
			@ -63,7 +64,13 @@ public class RatNum extends RealExpr
 | 
			
		|||
     **/
 | 
			
		||||
    public String toString()
 | 
			
		||||
    {
 | 
			
		||||
        return Native.getNumeralString(Context().nCtx(), NativeObject());
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
            return Native.getNumeralString(Context().nCtx(), NativeObject());
 | 
			
		||||
        } catch (Z3Exception e)
 | 
			
		||||
        {
 | 
			
		||||
            return "Z3Exception: " + e.getMessage();
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    RatNum(Context ctx, long obj) throws Z3Exception
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -14,7 +14,7 @@ public class RelationSort extends Sort
 | 
			
		|||
    /**
 | 
			
		||||
     * The arity of the relation sort.
 | 
			
		||||
     **/
 | 
			
		||||
    public int Arity()
 | 
			
		||||
    public int Arity() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Native.getRelationArity(Context().nCtx(), NativeObject());
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -16,14 +16,15 @@ public class Solver extends Z3Object
 | 
			
		|||
    /**
 | 
			
		||||
     * A string that describes all available solver parameters.
 | 
			
		||||
     **/
 | 
			
		||||
    public String Help()
 | 
			
		||||
    public String Help() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Native.solverGetHelp(Context().nCtx(), NativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Sets the solver parameters.
 | 
			
		||||
     * @throws Z3Exception 
 | 
			
		||||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public void setParameters(Params value) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
| 
						 | 
				
			
			@ -34,7 +35,8 @@ public class Solver extends Z3Object
 | 
			
		|||
 | 
			
		||||
    /**
 | 
			
		||||
     * Retrieves parameter descriptions for solver.
 | 
			
		||||
     * @throws Z3Exception 
 | 
			
		||||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public ParamDescrs ParameterDescriptions() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
| 
						 | 
				
			
			@ -46,7 +48,7 @@ public class Solver extends Z3Object
 | 
			
		|||
     * The current number of backtracking points (scopes). <seealso cref="Pop"/>
 | 
			
		||||
     * <seealso cref="Push"/>
 | 
			
		||||
     **/
 | 
			
		||||
    public int NumScopes()
 | 
			
		||||
    public int NumScopes() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Native.solverGetNumScopes(Context().nCtx(), NativeObject());
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			@ -54,7 +56,7 @@ public class Solver extends Z3Object
 | 
			
		|||
    /**
 | 
			
		||||
     * Creates a backtracking point. <seealso cref="Pop"/>
 | 
			
		||||
     **/
 | 
			
		||||
    public void Push()
 | 
			
		||||
    public void Push() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Native.solverPush(Context().nCtx(), NativeObject());
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			@ -62,9 +64,9 @@ public class Solver extends Z3Object
 | 
			
		|||
    /**
 | 
			
		||||
     * Backtracks one backtracking point. <remarks>.
 | 
			
		||||
     **/
 | 
			
		||||
    public void Pop()
 | 
			
		||||
    public void Pop() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
	Pop(1);
 | 
			
		||||
        Pop(1);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
| 
						 | 
				
			
			@ -72,7 +74,7 @@ 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)
 | 
			
		||||
    public void Pop(int n) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Native.solverPop(Context().nCtx(), NativeObject(), n);
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			@ -81,14 +83,15 @@ public class Solver extends Z3Object
 | 
			
		|||
     * Resets the Solver. <remarks>This removes all assertions from the
 | 
			
		||||
     * solver.</remarks>
 | 
			
		||||
     **/
 | 
			
		||||
    public void Reset()
 | 
			
		||||
    public void Reset() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Native.solverReset(Context().nCtx(), NativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Assert a multiple constraints into the solver.
 | 
			
		||||
     * @throws Z3Exception 
 | 
			
		||||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public void Assert(BoolExpr[] constraints) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
| 
						 | 
				
			
			@ -102,17 +105,20 @@ public class Solver extends Z3Object
 | 
			
		|||
 | 
			
		||||
    /**
 | 
			
		||||
     * Assert one constraint into the solver.
 | 
			
		||||
     * @throws Z3Exception 
 | 
			
		||||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public void Assert(BoolExpr constraint) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Context().CheckContextMatch(constraint);
 | 
			
		||||
	Native.solverAssert(Context().nCtx(), NativeObject(), constraint.NativeObject());
 | 
			
		||||
        Native.solverAssert(Context().nCtx(), NativeObject(),
 | 
			
		||||
                constraint.NativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * The number of assertions in the solver.
 | 
			
		||||
     * @throws Z3Exception 
 | 
			
		||||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public int NumAssertions() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
| 
						 | 
				
			
			@ -123,7 +129,8 @@ public class Solver extends Z3Object
 | 
			
		|||
 | 
			
		||||
    /**
 | 
			
		||||
     * The set of asserted formulas.
 | 
			
		||||
     * @throws Z3Exception 
 | 
			
		||||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public BoolExpr[] Assertions() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
| 
						 | 
				
			
			@ -141,7 +148,7 @@ public class Solver extends Z3Object
 | 
			
		|||
     * <remarks> <seealso cref="Model"/> <seealso cref="UnsatCore"/> <seealso
 | 
			
		||||
     * cref="Proof"/> </remarks>
 | 
			
		||||
     **/
 | 
			
		||||
    public Status Check(Expr[] assumptions)
 | 
			
		||||
    public Status Check(Expr[] assumptions) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        Z3_lbool r;
 | 
			
		||||
        if (assumptions == null)
 | 
			
		||||
| 
						 | 
				
			
			@ -167,9 +174,9 @@ public class Solver extends Z3Object
 | 
			
		|||
     * <remarks> <seealso cref="Model"/> <seealso cref="UnsatCore"/> <seealso
 | 
			
		||||
     * cref="Proof"/> </remarks>
 | 
			
		||||
     **/
 | 
			
		||||
    public Status Check()
 | 
			
		||||
    public Status Check() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
	return Check(null);
 | 
			
		||||
        return Check(null);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
| 
						 | 
				
			
			@ -177,7 +184,8 @@ public class Solver extends Z3Object
 | 
			
		|||
     * <code>null</code> if <code>Check</code> was not invoked before, if its
 | 
			
		||||
     * results was not <code>SATISFIABLE</code>, or if model production is not
 | 
			
		||||
     * enabled. </remarks>
 | 
			
		||||
     * @throws Z3Exception 
 | 
			
		||||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public Model Model() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
| 
						 | 
				
			
			@ -193,7 +201,8 @@ public class Solver extends Z3Object
 | 
			
		|||
     * <code>null</code> if <code>Check</code> was not invoked before, if its
 | 
			
		||||
     * results was not <code>UNSATISFIABLE</code>, or if proof production is
 | 
			
		||||
     * disabled. </remarks>
 | 
			
		||||
     * @throws Z3Exception 
 | 
			
		||||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public Expr Proof() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
| 
						 | 
				
			
			@ -209,7 +218,8 @@ public class Solver extends Z3Object
 | 
			
		|||
     * is a subset of <code>Assertions</code> The result is empty if
 | 
			
		||||
     * <code>Check</code> was not invoked before, if its results was not
 | 
			
		||||
     * <code>UNSATISFIABLE</code>, or if core production is disabled. </remarks>
 | 
			
		||||
     * @throws Z3Exception 
 | 
			
		||||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public Expr[] UnsatCore() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
| 
						 | 
				
			
			@ -227,15 +237,15 @@ public class Solver extends Z3Object
 | 
			
		|||
     * A brief justification of why the last call to <code>Check</code> returned
 | 
			
		||||
     * <code>UNKNOWN</code>.
 | 
			
		||||
     **/
 | 
			
		||||
    public String ReasonUnknown()
 | 
			
		||||
    public String ReasonUnknown() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
        return Native.solverGetReasonUnknown(Context().nCtx(), NativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Solver statistics.
 | 
			
		||||
     * @throws Z3Exception 
 | 
			
		||||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public Statistics Statistics() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
| 
						 | 
				
			
			@ -248,7 +258,13 @@ public class Solver extends Z3Object
 | 
			
		|||
     **/
 | 
			
		||||
    public String toString()
 | 
			
		||||
    {
 | 
			
		||||
        return Native.solverToString(Context().nCtx(), NativeObject());
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
            return Native.solverToString(Context().nCtx(), NativeObject());
 | 
			
		||||
        } catch (Z3Exception e)
 | 
			
		||||
        {
 | 
			
		||||
            return "Z3Exception: " + e.getMessage();
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    Solver(Context ctx, long obj) throws Z3Exception
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -9,11 +9,23 @@ class SolverDecRefQueue extends IDecRefQueue
 | 
			
		|||
{
 | 
			
		||||
    public void IncRef(Context ctx, long obj)
 | 
			
		||||
    {
 | 
			
		||||
        Native.solverIncRef(ctx.nCtx(), obj);
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
            Native.solverIncRef(ctx.nCtx(), obj);
 | 
			
		||||
        } catch (Z3Exception e)
 | 
			
		||||
        {
 | 
			
		||||
            // OK.
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void DecRef(Context ctx, long obj)
 | 
			
		||||
    {
 | 
			
		||||
        Native.solverDecRef(ctx.nCtx(), obj);
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
            Native.solverDecRef(ctx.nCtx(), obj);
 | 
			
		||||
        } catch (Z3Exception e)
 | 
			
		||||
        {
 | 
			
		||||
            // OK.
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
};
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -37,7 +37,7 @@ public class Sort extends AST
 | 
			
		|||
     * 
 | 
			
		||||
     * @return
 | 
			
		||||
     **/
 | 
			
		||||
    public boolean Equals(Object o)
 | 
			
		||||
    public boolean equals(Object o)
 | 
			
		||||
    {
 | 
			
		||||
        Sort casted = (Sort) o;
 | 
			
		||||
        if (casted == null)
 | 
			
		||||
| 
						 | 
				
			
			@ -86,7 +86,13 @@ public class Sort extends AST
 | 
			
		|||
     **/
 | 
			
		||||
    public String toString()
 | 
			
		||||
    {
 | 
			
		||||
        return Native.sortToString(Context().nCtx(), NativeObject());
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
            return Native.sortToString(Context().nCtx(), NativeObject());
 | 
			
		||||
        } catch (Z3Exception e)
 | 
			
		||||
        {
 | 
			
		||||
            return "Z3Exception: " + e.getMessage();
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -56,7 +56,8 @@ public class Statistics extends Z3Object
 | 
			
		|||
 | 
			
		||||
        /**
 | 
			
		||||
         * The string representation of the the entry's value.
 | 
			
		||||
         * @throws Z3Exception 
 | 
			
		||||
         * 
 | 
			
		||||
         * @throws Z3Exception
 | 
			
		||||
         **/
 | 
			
		||||
        public String Value() throws Z3Exception
 | 
			
		||||
        {
 | 
			
		||||
| 
						 | 
				
			
			@ -107,20 +108,27 @@ public class Statistics extends Z3Object
 | 
			
		|||
     **/
 | 
			
		||||
    public String toString()
 | 
			
		||||
    {
 | 
			
		||||
        return Native.statsToString(Context().nCtx(), NativeObject());
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
            return Native.statsToString(Context().nCtx(), NativeObject());
 | 
			
		||||
        } catch (Z3Exception e)
 | 
			
		||||
        {
 | 
			
		||||
            return "Z3Exception: " + e.getMessage();
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * The number of statistical data.
 | 
			
		||||
     **/
 | 
			
		||||
    public int Size()
 | 
			
		||||
    public int Size() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Native.statsSize(Context().nCtx(), NativeObject());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * The data entries.
 | 
			
		||||
     * @throws Z3Exception 
 | 
			
		||||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public Entry[] Entries() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
| 
						 | 
				
			
			@ -147,7 +155,7 @@ public class Statistics extends Z3Object
 | 
			
		|||
    /**
 | 
			
		||||
     * The statistical counters.
 | 
			
		||||
     **/
 | 
			
		||||
    public String[] Keys()
 | 
			
		||||
    public String[] Keys() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        int n = Size();
 | 
			
		||||
        String[] res = new String[n];
 | 
			
		||||
| 
						 | 
				
			
			@ -159,7 +167,8 @@ public class Statistics extends Z3Object
 | 
			
		|||
    /**
 | 
			
		||||
     * The value of a particular statistical counter. <remarks>Returns null if
 | 
			
		||||
     * the key is unknown.</remarks>
 | 
			
		||||
     * @throws Z3Exception 
 | 
			
		||||
     * 
 | 
			
		||||
     * @throws Z3Exception
 | 
			
		||||
     **/
 | 
			
		||||
    public Entry get(String key) throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -9,11 +9,23 @@ class StatisticsDecRefQueue extends IDecRefQueue
 | 
			
		|||
{
 | 
			
		||||
    public void IncRef(Context ctx, long obj)
 | 
			
		||||
    {
 | 
			
		||||
	Native.statsIncRef(ctx.nCtx(), obj);
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
            Native.statsIncRef(ctx.nCtx(), obj);
 | 
			
		||||
        } catch (Z3Exception e)
 | 
			
		||||
        {
 | 
			
		||||
            // OK.
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    public void DecRef(Context ctx, long obj)
 | 
			
		||||
    {
 | 
			
		||||
	Native.statsDecRef(ctx.nCtx(), obj);
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
            Native.statsDecRef(ctx.nCtx(), obj);
 | 
			
		||||
        } catch (Z3Exception e)
 | 
			
		||||
        {
 | 
			
		||||
            // OK.
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
};
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -16,7 +16,7 @@ public class Symbol extends Z3Object
 | 
			
		|||
    /**
 | 
			
		||||
     * The kind of the symbol (int or string)
 | 
			
		||||
     **/
 | 
			
		||||
    protected Z3_symbol_kind Kind()
 | 
			
		||||
    protected Z3_symbol_kind Kind() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Z3_symbol_kind.fromInt(Native.getSymbolKind(Context().nCtx(),
 | 
			
		||||
                NativeObject()));
 | 
			
		||||
| 
						 | 
				
			
			@ -25,7 +25,7 @@ public class Symbol extends Z3Object
 | 
			
		|||
    /**
 | 
			
		||||
     * Indicates whether the symbol is of Int kind
 | 
			
		||||
     **/
 | 
			
		||||
    public boolean IsIntSymbol()
 | 
			
		||||
    public boolean IsIntSymbol() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Kind() == Z3_symbol_kind.Z3_INT_SYMBOL;
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			@ -33,7 +33,7 @@ public class Symbol extends Z3Object
 | 
			
		|||
    /**
 | 
			
		||||
     * Indicates whether the symbol is of string kind.
 | 
			
		||||
     **/
 | 
			
		||||
    public boolean IsStringSymbol()
 | 
			
		||||
    public boolean IsStringSymbol() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Kind() == Z3_symbol_kind.Z3_STRING_SYMBOL;
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -18,7 +18,7 @@ public class Tactic extends Z3Object
 | 
			
		|||
    /**
 | 
			
		||||
     * A string containing a description of parameters accepted by the tactic.
 | 
			
		||||
     **/
 | 
			
		||||
    public String Help()
 | 
			
		||||
    public String Help() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Native.tacticGetHelp(Context().nCtx(), NativeObject());
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -9,11 +9,23 @@ class TacticDecRefQueue extends IDecRefQueue
 | 
			
		|||
{
 | 
			
		||||
    public void IncRef(Context ctx, long obj)
 | 
			
		||||
    {
 | 
			
		||||
        Native.tacticIncRef(ctx.nCtx(), obj);
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
            Native.tacticIncRef(ctx.nCtx(), obj);
 | 
			
		||||
        } catch (Z3Exception e)
 | 
			
		||||
        {
 | 
			
		||||
            // OK.
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void DecRef(Context ctx, long obj)
 | 
			
		||||
    {
 | 
			
		||||
        Native.tacticDecRef(ctx.nCtx(), obj);
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
            Native.tacticDecRef(ctx.nCtx(), obj);
 | 
			
		||||
        } catch (Z3Exception e)
 | 
			
		||||
        {
 | 
			
		||||
            // OK.
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
};
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -25,7 +25,7 @@ public class TupleSort extends Sort
 | 
			
		|||
    /**
 | 
			
		||||
     * The number of fields in the tuple.
 | 
			
		||||
     **/
 | 
			
		||||
    public int NumFields()
 | 
			
		||||
    public int NumFields() throws Z3Exception
 | 
			
		||||
    {
 | 
			
		||||
        return Native.getTupleSortNumFields(Context().nCtx(), NativeObject());
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue