3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-05-07 07:45:46 +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:
Christoph M. Wintersteiger 2012-11-27 16:36:50 +00:00
parent fb947f50fb
commit c6303fc8f5
153 changed files with 10063 additions and 9851 deletions

73
src/api/java/RatNum.java Normal file
View file

@ -0,0 +1,73 @@
/**
* This file was automatically generated from RatNum.cs
* w/ further modifications by:
* @author Christoph M. Wintersteiger (cwinter)
**/
package com.Microsoft.Z3;
import java.math.BigInteger;
/**
* Rational Numerals
**/
public class RatNum extends RealExpr
{
/**
* The numerator of a rational numeral.
**/
public IntNum Numerator() throws Z3Exception
{
return new IntNum(Context(), Native.getNumerator(Context().nCtx(),
NativeObject()));
}
/**
* The denominator of a rational numeral.
**/
public IntNum Denominator() throws Z3Exception
{
return new IntNum(Context(), Native.getDenominator(Context().nCtx(),
NativeObject()));
}
/**
* Converts the numerator of the rational to a BigInteger
**/
public BigInteger BigIntNumerator() throws Z3Exception
{
IntNum n = Numerator();
return new BigInteger(n.toString());
}
/**
* Converts the denominator of the rational to a BigInteger
**/
public BigInteger BigIntDenominator() throws Z3Exception
{
IntNum n = Denominator();
return new BigInteger(n.toString());
}
/**
* Returns a string representation in decimal notation. <remarks>The result
* has at most <paramref name="precision"/> decimal places.</remarks>
**/
public String ToDecimalString(int precision) throws Z3Exception
{
return Native.getNumeralDecimalString(Context().nCtx(), NativeObject(),
precision);
}
/**
* Returns a string representation of the numeral.
**/
public String toString()
{
return Native.getNumeralString(Context().nCtx(), NativeObject());
}
RatNum(Context ctx, long obj) throws Z3Exception
{
super(ctx, obj);
}
}