-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPattern.java
More file actions
57 lines (51 loc) · 1.35 KB
/
Pattern.java
File metadata and controls
57 lines (51 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/**
* 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 getNumTerms() throws Z3Exception
{
return Native.getPatternNumTerms(getContext().nCtx(), getNativeObject());
}
/**
* The terms in the pattern.
*
* @throws Z3Exception
**/
public Expr[] getTerms() throws Z3Exception
{
int n = getNumTerms();
Expr[] res = new Expr[n];
for (int i = 0; i < n; i++)
res[i] = Expr.create(getContext(),
Native.getPattern(getContext().nCtx(), getNativeObject(), i));
return res;
}
/**
* A string representation of the pattern.
**/
public String toString()
{
try
{
return Native.patternToString(getContext().nCtx(), getNativeObject());
} catch (Z3Exception e)
{
return "Z3Exception: " + e.getMessage();
}
}
Pattern(Context ctx, long obj) throws Z3Exception
{
super(ctx, obj);
}
}