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
51
src/api/java/Pattern.java
Normal file
51
src/api/java/Pattern.java
Normal file
|
@ -0,0 +1,51 @@
|
|||
/**
|
||||
* This file was automatically generated from Pattern.cs
|
||||
* w/ further modifications by:
|
||||
* @author Christoph M. Wintersteiger (cwinter)
|
||||
**/
|
||||
|
||||
package com.Microsoft.Z3;
|
||||
|
||||
/**
|
||||
* Patterns comprise a list of terms. The list should be non-empty. If the list
|
||||
* comprises of more than one term, it is also called a multi-pattern.
|
||||
**/
|
||||
public class Pattern extends AST
|
||||
{
|
||||
/**
|
||||
* The number of terms in the pattern.
|
||||
**/
|
||||
public int NumTerms()
|
||||
{
|
||||
return Native.getPatternNumTerms(Context().nCtx(), NativeObject());
|
||||
}
|
||||
|
||||
/**
|
||||
* The terms in the pattern.
|
||||
*
|
||||
* @throws Z3Exception
|
||||
**/
|
||||
public Expr[] Terms() throws Z3Exception
|
||||
{
|
||||
|
||||
int n = NumTerms();
|
||||
Expr[] res = new Expr[n];
|
||||
for (int i = 0; i < n; i++)
|
||||
res[i] = Expr.Create(Context(),
|
||||
Native.getPattern(Context().nCtx(), NativeObject(), i));
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* A string representation of the pattern.
|
||||
**/
|
||||
public String toString()
|
||||
{
|
||||
return Native.patternToString(Context().nCtx(), NativeObject());
|
||||
}
|
||||
|
||||
Pattern(Context ctx, long obj) throws Z3Exception
|
||||
{
|
||||
super(ctx, obj);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue