mirror of
https://github.com/Z3Prover/z3
synced 2025-04-30 04:15:51 +00:00
Java API: a first version that compiles. This is still untested.
Signed-off-by: Christoph M. Wintersteiger <cwinter@microsoft.com>
This commit is contained in:
parent
fb947f50fb
commit
c6303fc8f5
153 changed files with 10063 additions and 9851 deletions
59
src/api/java/IntNum.java
Normal file
59
src/api/java/IntNum.java
Normal file
|
@ -0,0 +1,59 @@
|
|||
/**
|
||||
* This file was automatically generated from IntNum.cs
|
||||
* w/ further modifications by:
|
||||
* @author Christoph M. Wintersteiger (cwinter)
|
||||
**/
|
||||
|
||||
package com.Microsoft.Z3;
|
||||
|
||||
import java.math.BigInteger;
|
||||
|
||||
/**
|
||||
* Integer Numerals
|
||||
**/
|
||||
public class IntNum extends IntExpr
|
||||
{
|
||||
|
||||
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 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());
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a string representation of the numeral.
|
||||
**/
|
||||
public String toString()
|
||||
{
|
||||
return Native.getNumeralString(Context().nCtx(), NativeObject());
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue