From 682a725e1323d7ef4513a9a85ade0f4a44baea19 Mon Sep 17 00:00:00 2001 From: "Christoph M. Wintersteiger" Date: Mon, 26 Nov 2012 13:47:26 +0000 Subject: [PATCH 1/6] Managed API: Refactoring, Formatting. Signed-off-by: Christoph M. Wintersteiger --- src/api/dotnet/BitVecSort.cs | 1 - src/api/dotnet/Context.cs | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/api/dotnet/BitVecSort.cs b/src/api/dotnet/BitVecSort.cs index 55ef4ae49..d865159f4 100644 --- a/src/api/dotnet/BitVecSort.cs +++ b/src/api/dotnet/BitVecSort.cs @@ -37,7 +37,6 @@ namespace Microsoft.Z3 #region Internal internal BitVecSort(Context ctx, IntPtr obj) : base(ctx, obj) { Contract.Requires(ctx != null); } - internal BitVecSort(Context ctx, uint size) : base(ctx, Native.Z3_mk_bv_sort(ctx.nCtx, size)) { Contract.Requires(ctx != null); } #endregion }; } diff --git a/src/api/dotnet/Context.cs b/src/api/dotnet/Context.cs index 2aea1586c..30e5ece4f 100644 --- a/src/api/dotnet/Context.cs +++ b/src/api/dotnet/Context.cs @@ -193,7 +193,7 @@ namespace Microsoft.Z3 { Contract.Ensures(Contract.Result() != null); - return new BitVecSort(this, size); + return new BitVecSort(this, Native.Z3_mk_bv_sort(nCtx, size)); } /// From f7825755db08d230142bedf7e98ddce33d2d4010 Mon Sep 17 00:00:00 2001 From: Nikolaj Bjorner Date: Mon, 26 Nov 2012 08:26:51 -0800 Subject: [PATCH 2/6] fix build problem, redo naming abstraction Signed-off-by: Nikolaj Bjorner --- src/muz_qe/dl_context.cpp | 19 +++++++++++++------ src/muz_qe/pdr_util.cpp | 2 +- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/muz_qe/dl_context.cpp b/src/muz_qe/dl_context.cpp index f38999381..77b391ef7 100644 --- a/src/muz_qe/dl_context.cpp +++ b/src/muz_qe/dl_context.cpp @@ -338,7 +338,7 @@ namespace datalog { expr_ref context::bind_variables(expr* fml, bool is_forall) { expr_ref result(m); - app_ref_vector & vars = m_vars; + app_ref_vector const & vars = m_vars; if (vars.empty()) { result = fml; } @@ -352,13 +352,20 @@ namespace datalog { else { svector names; for (unsigned i = 0; i < sorts.size(); ++i) { - if (vars.size() == i) { - vars.push_back(m.mk_fresh_const("x", m.mk_bool_sort())); - } if (!sorts[i]) { - sorts[i] = vars[i]->get_decl()->get_range(); + if (i < vars.size()) { + sorts[i] = vars[i]->get_decl()->get_range(); + } + else { + sorts[i] = m.mk_bool_sort(); + } + } + if (i < vars.size()) { + names.push_back(vars[i]->get_decl()->get_name()); + } + else { + names.push_back(symbol(i)); } - names.push_back(vars[i]->get_decl()->get_name()); } quantifier_ref q(m); sorts.reverse(); diff --git a/src/muz_qe/pdr_util.cpp b/src/muz_qe/pdr_util.cpp index 0840f1d73..2c009dc25 100644 --- a/src/muz_qe/pdr_util.cpp +++ b/src/muz_qe/pdr_util.cpp @@ -119,7 +119,6 @@ namespace pdr { select_elim_cfg(ast_manager & m, model_ref& md, params_ref const & p):m_r(m, md) {} }; - template class rewriter_tpl; class select_elim_star : public rewriter_tpl { select_elim_cfg m_cfg; @@ -1205,5 +1204,6 @@ namespace pdr { template class rewriter_tpl; +template class rewriter_tpl; From 75b1278e9735d757e80fcc3f4ba86b0a9dc6c1e2 Mon Sep 17 00:00:00 2001 From: "Christoph M. Wintersteiger" Date: Mon, 26 Nov 2012 21:02:22 +0000 Subject: [PATCH 3/6] Managed API: Refactoring. Signed-off-by: Christoph M. Wintersteiger --- src/api/dotnet/Context.cs | 2 +- src/api/dotnet/Expr.cs | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/api/dotnet/Context.cs b/src/api/dotnet/Context.cs index 30e5ece4f..3e438d69d 100644 --- a/src/api/dotnet/Context.cs +++ b/src/api/dotnet/Context.cs @@ -388,7 +388,7 @@ namespace Microsoft.Z3 IntPtr[] n_constr = new IntPtr[n]; for (uint i = 0; i < n; i++) { - var constructor = c[i]; + Constructor[] constructor = c[i]; Contract.Assume(Contract.ForAll(constructor, arr => arr != null), "Clousot does not support yet quantified formula on multidimensional arrays"); CheckContextMatch(constructor); cla[i] = new ConstructorList(this, constructor); diff --git a/src/api/dotnet/Expr.cs b/src/api/dotnet/Expr.cs index 22a506c71..6c2ebb3ad 100644 --- a/src/api/dotnet/Expr.cs +++ b/src/api/dotnet/Expr.cs @@ -433,7 +433,8 @@ namespace Microsoft.Z3 get { return (Native.Z3_is_app(Context.nCtx, NativeObject) != 0 && - (Z3_sort_kind)Native.Z3_get_sort_kind(Context.nCtx, Native.Z3_get_sort(Context.nCtx, NativeObject)) == Z3_sort_kind.Z3_ARRAY_SORT); + (Z3_sort_kind)Native.Z3_get_sort_kind(Context.nCtx, Native.Z3_get_sort(Context.nCtx, NativeObject)) + == Z3_sort_kind.Z3_ARRAY_SORT); } } @@ -1308,7 +1309,8 @@ namespace Microsoft.Z3 get { return (Native.Z3_is_app(Context.nCtx, NativeObject) != 0 && - (Z3_sort_kind)Native.Z3_get_sort_kind(Context.nCtx, Native.Z3_get_sort(Context.nCtx, NativeObject)) == Z3_sort_kind.Z3_RELATION_SORT); + Native.Z3_get_sort_kind(Context.nCtx, Native.Z3_get_sort(Context.nCtx, NativeObject)) + == (uint)Z3_sort_kind.Z3_RELATION_SORT); } } @@ -1429,7 +1431,7 @@ namespace Microsoft.Z3 get { return (Native.Z3_is_app(Context.nCtx, NativeObject) != 0 && - (Z3_sort_kind)Native.Z3_get_sort_kind(Context.nCtx, Native.Z3_get_sort(Context.nCtx, NativeObject)) == Z3_sort_kind.Z3_FINITE_DOMAIN_SORT); + Native.Z3_get_sort_kind(Context.nCtx, Native.Z3_get_sort(Context.nCtx, NativeObject)) == (uint)Z3_sort_kind.Z3_FINITE_DOMAIN_SORT); } } @@ -1489,8 +1491,8 @@ namespace Microsoft.Z3 internal override void CheckNativeObject(IntPtr obj) { if (Native.Z3_is_app(Context.nCtx, obj) == 0 && - (Z3_ast_kind)Native.Z3_get_ast_kind(Context.nCtx, obj) != Z3_ast_kind.Z3_VAR_AST && - (Z3_ast_kind)Native.Z3_get_ast_kind(Context.nCtx, obj) != Z3_ast_kind.Z3_QUANTIFIER_AST) + Native.Z3_get_ast_kind(Context.nCtx, obj) != (uint)Z3_ast_kind.Z3_VAR_AST && + Native.Z3_get_ast_kind(Context.nCtx, obj) != (uint)Z3_ast_kind.Z3_QUANTIFIER_AST) throw new Z3Exception("Underlying object is not a term"); base.CheckNativeObject(obj); } From 36d9a90d2a8ae7e033a5c01b1d292981b3452576 Mon Sep 17 00:00:00 2001 From: "Christoph M. Wintersteiger" Date: Mon, 26 Nov 2012 21:03:35 +0000 Subject: [PATCH 4/6] Java API: more automatic translation from C#, but still unfinished. Signed-off-by: Christoph M. Wintersteiger --- scripts/mk_util.py | 19 +- scripts/update_api.py | 1 + src/api/java/com/Microsoft/Z3/AST.java | 41 +- src/api/java/com/Microsoft/Z3/ASTMap.java | 17 +- src/api/java/com/Microsoft/Z3/ASTVector.java | 21 +- .../java/com/Microsoft/Z3/AlgebraicNum.java | 11 +- .../java/com/Microsoft/Z3/ApplyResult.java | 17 +- src/api/java/com/Microsoft/Z3/ArithExpr.java | 1 + src/api/java/com/Microsoft/Z3/ArithSort.java | 1 + src/api/java/com/Microsoft/Z3/ArrayExpr.java | 1 + src/api/java/com/Microsoft/Z3/ArraySort.java | 7 +- src/api/java/com/Microsoft/Z3/BitVecExpr.java | 3 +- src/api/java/com/Microsoft/Z3/BitVecNum.java | 17 +- src/api/java/com/Microsoft/Z3/BitVecSort.java | 4 +- src/api/java/com/Microsoft/Z3/BoolExpr.java | 1 + src/api/java/com/Microsoft/Z3/BoolSort.java | 1 + .../java/com/Microsoft/Z3/Constructor.java | 21 +- .../com/Microsoft/Z3/ConstructorList.java | 3 +- src/api/java/com/Microsoft/Z3/Context.java | 571 ++++++++---------- .../java/com/Microsoft/Z3/DatatypeExpr.java | 1 + .../java/com/Microsoft/Z3/DatatypeSort.java | 29 +- src/api/java/com/Microsoft/Z3/EnumSort.java | 11 +- .../Z3/Enumerations/Z3_ast_kind.class | Bin 0 -> 1554 bytes .../Z3/Enumerations/Z3_ast_kind.java | 28 +- .../Z3/Enumerations/Z3_ast_print_mode.class | Bin 0 -> 1450 bytes .../Z3/Enumerations/Z3_ast_print_mode.java | 22 +- .../Z3/Enumerations/Z3_decl_kind.class | Bin 0 -> 11227 bytes .../Z3/Enumerations/Z3_decl_kind.java | 318 +++++----- .../Z3/Enumerations/Z3_error_code.class | Bin 0 -> 1961 bytes .../Z3/Enumerations/Z3_error_code.java | 40 +- .../Z3/Enumerations/Z3_goal_prec.class | Bin 0 -> 1379 bytes .../Z3/Enumerations/Z3_goal_prec.java | 22 +- .../Microsoft/Z3/Enumerations/Z3_lbool.class | Bin 0 -> 1270 bytes .../Microsoft/Z3/Enumerations/Z3_lbool.java | 20 +- .../Z3/Enumerations/Z3_param_kind.class | Bin 0 -> 1557 bytes .../Z3/Enumerations/Z3_param_kind.java | 28 +- .../Z3/Enumerations/Z3_parameter_kind.class | Bin 0 -> 1639 bytes .../Z3/Enumerations/Z3_parameter_kind.java | 28 +- .../Z3/Enumerations/Z3_sort_kind.class | Bin 0 -> 1770 bytes .../Z3/Enumerations/Z3_sort_kind.java | 34 +- .../Z3/Enumerations/Z3_symbol_kind.class | Bin 0 -> 1270 bytes .../Z3/Enumerations/Z3_symbol_kind.java | 18 +- src/api/java/com/Microsoft/Z3/Expr.java | 405 +++++++------ .../com/Microsoft/Z3/FiniteDomainSort.java | 3 +- src/api/java/com/Microsoft/Z3/Fixedpoint.java | 79 +-- src/api/java/com/Microsoft/Z3/FuncDecl.java | 57 +- src/api/java/com/Microsoft/Z3/FuncInterp.java | 41 +- src/api/java/com/Microsoft/Z3/Goal.java | 37 +- .../java/com/Microsoft/Z3/IDecRefQueue.java | 13 +- src/api/java/com/Microsoft/Z3/IntExpr.java | 1 + src/api/java/com/Microsoft/Z3/IntNum.java | 17 +- src/api/java/com/Microsoft/Z3/IntSort.java | 1 + src/api/java/com/Microsoft/Z3/IntSymbol.java | 1 + src/api/java/com/Microsoft/Z3/ListSort.java | 3 +- src/api/java/com/Microsoft/Z3/Log.java | 1 + src/api/java/com/Microsoft/Z3/Model.java | 79 +-- src/api/java/com/Microsoft/Z3/Native.java | 4 +- .../java/com/Microsoft/Z3/ParamDescrs.java | 17 +- src/api/java/com/Microsoft/Z3/Params.java | 25 +- src/api/java/com/Microsoft/Z3/Pattern.java | 9 +- src/api/java/com/Microsoft/Z3/Probe.java | 9 +- src/api/java/com/Microsoft/Z3/Quantifier.java | 77 +-- src/api/java/com/Microsoft/Z3/RatNum.java | 15 +- src/api/java/com/Microsoft/Z3/RealExpr.java | 1 + src/api/java/com/Microsoft/Z3/RealSort.java | 1 + .../java/com/Microsoft/Z3/RelationSort.java | 9 +- src/api/java/com/Microsoft/Z3/SetSort.java | 3 +- src/api/java/com/Microsoft/Z3/Solver.java | 55 +- src/api/java/com/Microsoft/Z3/Sort.java | 29 +- src/api/java/com/Microsoft/Z3/Statistics.java | 43 +- src/api/java/com/Microsoft/Z3/Status.java | 9 +- .../java/com/Microsoft/Z3/StringSymbol.java | 1 + src/api/java/com/Microsoft/Z3/Symbol.java | 11 +- src/api/java/com/Microsoft/Z3/Tactic.java | 17 +- src/api/java/com/Microsoft/Z3/TupleSort.java | 15 +- .../com/Microsoft/Z3/UninterpretedSort.java | 3 +- src/api/java/com/Microsoft/Z3/Version.java | 21 +- .../java/com/Microsoft/Z3/Z3Exception.java | 1 + src/api/java/com/Microsoft/Z3/Z3Object.java | 9 +- src/api/java/mk_java.py | 126 +++- 80 files changed, 1439 insertions(+), 1166 deletions(-) create mode 100644 src/api/java/com/Microsoft/Z3/Enumerations/Z3_ast_kind.class create mode 100644 src/api/java/com/Microsoft/Z3/Enumerations/Z3_ast_print_mode.class create mode 100644 src/api/java/com/Microsoft/Z3/Enumerations/Z3_decl_kind.class create mode 100644 src/api/java/com/Microsoft/Z3/Enumerations/Z3_error_code.class create mode 100644 src/api/java/com/Microsoft/Z3/Enumerations/Z3_goal_prec.class create mode 100644 src/api/java/com/Microsoft/Z3/Enumerations/Z3_lbool.class create mode 100644 src/api/java/com/Microsoft/Z3/Enumerations/Z3_param_kind.class create mode 100644 src/api/java/com/Microsoft/Z3/Enumerations/Z3_parameter_kind.class create mode 100644 src/api/java/com/Microsoft/Z3/Enumerations/Z3_sort_kind.class create mode 100644 src/api/java/com/Microsoft/Z3/Enumerations/Z3_symbol_kind.class diff --git a/scripts/mk_util.py b/scripts/mk_util.py index b69171a24..ae10d6740 100644 --- a/scripts/mk_util.py +++ b/scripts/mk_util.py @@ -1854,8 +1854,25 @@ def mk_z3consts_java(api_files): efile.write(' **/\n') efile.write('public enum %s {\n' % name) efile.write + first = True for k, i in decls.iteritems(): - efile.write('%s (%s),\n' % (k, i)) + if first: + first = False + else: + efile.write(',\n') + efile.write(' %s (%s)' % (k, i)) + efile.write(";\n") + efile.write('\n private final int intValue;\n\n') + efile.write(' %s(int v) {\n' % name) + efile.write(' this.intValue = v;\n') + efile.write(' }\n\n') + efile.write(' public static final %s fromInt(int v) {\n' % name) + efile.write(' for (%s k: values()) \n' % name) + efile.write(' if (k.intValue == v) return k;\n') + efile.write(' return values()[0];\n') + efile.write(' }\n\n') + efile.write(' public final int toInt() { return this.intValue; }\n') + # efile.write(';\n %s(int v) {}\n' % name) efile.write('}\n\n') efile.close() mode = SEARCHING diff --git a/scripts/update_api.py b/scripts/update_api.py index 7e1439375..1eef11705 100644 --- a/scripts/update_api.py +++ b/scripts/update_api.py @@ -509,6 +509,7 @@ def mk_java(): java_native.write(' public static class IntPtr { public int value; }\n') java_native.write(' public static class LongPtr { public long value; }\n') java_native.write(' public static class StringPtr { public String value; }\n') + java_native.write(' public static class errorHandler { public long ptr; }\n') if is_windows(): java_native.write(' static { System.loadLibrary("%s"); }\n' % get_component('java')) diff --git a/src/api/java/com/Microsoft/Z3/AST.java b/src/api/java/com/Microsoft/Z3/AST.java index c8471e2e8..069c07a4c 100644 --- a/src/api/java/com/Microsoft/Z3/AST.java +++ b/src/api/java/com/Microsoft/Z3/AST.java @@ -7,6 +7,7 @@ package com.Microsoft.Z3; import java.math.BigInteger; import java.util.*; import java.lang.Exception; +import com.Microsoft.Z3.Enumerations.*; /* using System; */ /* using System.Collections; */ @@ -58,9 +59,9 @@ import java.lang.Exception; return 1; else { - if (Id < oAST.Id) + if (Id() < oAST.Id()) return -1; - else if (Id > oAST.Id) + else if (Id() > oAST.Id()) return +1; else return 0; @@ -79,7 +80,7 @@ import java.lang.Exception; /** * A unique identifier for the AST (unique among all ASTs). **/ - public long Id() { return Native.getAstId(Context().nCtx(), NativeObject()); } + public int Id() { return Native.getAstId(Context().nCtx(), NativeObject()); } /** * Translates (copies) the AST to the Context . @@ -91,7 +92,7 @@ import java.lang.Exception; - if (ReferenceEquals(Context, ctx)) + if (Context() == ctx) return this; else return new AST(ctx, Native.translate(Context().nCtx(), NativeObject(), ctx.nCtx())); @@ -100,7 +101,7 @@ import java.lang.Exception; /** * The kind of the AST. **/ - public Z3_ast_kind ASTKind() { return (Z3_ast_kind)Native.getAstKind(Context().nCtx(), NativeObject()); } + public Z3_ast_kind ASTKind() { return Z3_ast_kind.fromInt(Native.getAstKind(Context().nCtx(), NativeObject())); } /** * Indicates whether the AST is an Expr @@ -109,10 +110,10 @@ import java.lang.Exception; { switch (ASTKind()) { - case Z3_ast_kind.Z3_APP_AST: - case Z3_ast_kind.Z3_NUMERAL_AST: - case Z3_ast_kind.Z3_QUANTIFIER_AST: - case Z3_ast_kind.Z3_VAR_AST: return true; + case Z3_APP_AST: + case Z3_NUMERAL_AST: + case Z3_QUANTIFIER_AST: + case Z3_VAR_AST: return true; default: return false; } } @@ -174,22 +175,22 @@ import java.lang.Exception; void IncRef(long o) { // Console.WriteLine("AST IncRef()"); - if (Context == null) + 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); + Context().AST_DRQ().IncAndClear(Context(), o); super.IncRef(o); } void DecRef(long o) { // Console.WriteLine("AST DecRef()"); - if (Context == null) + 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); + Context().AST_DRQ().Add(o); super.DecRef(o); } @@ -198,14 +199,14 @@ import java.lang.Exception; - switch ((Z3_ast_kind)Native.getAstKind(ctx.nCtx(), obj)) + switch (Z3_ast_kind.fromInt(Native.getAstKind(ctx.nCtx(), obj))) { - case Z3_ast_kind.Z3_FUNC_DECL_AST: return new FuncDecl(ctx, obj); - case Z3_ast_kind.Z3_QUANTIFIER_AST: return new Quantifier(ctx, obj); - case Z3_ast_kind.Z3_SORT_AST: return Sort.Create(ctx, obj); - case Z3_ast_kind.Z3_APP_AST: - case Z3_ast_kind.Z3_NUMERAL_AST: - case Z3_ast_kind.Z3_VAR_AST: return Expr.Create(ctx, 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"); } diff --git a/src/api/java/com/Microsoft/Z3/ASTMap.java b/src/api/java/com/Microsoft/Z3/ASTMap.java index 837779234..defd7e736 100644 --- a/src/api/java/com/Microsoft/Z3/ASTMap.java +++ b/src/api/java/com/Microsoft/Z3/ASTMap.java @@ -7,6 +7,7 @@ package com.Microsoft.Z3; import java.math.BigInteger; import java.util.*; import java.lang.Exception; +import com.Microsoft.Z3.Enumerations.*; /* using System; */ @@ -24,7 +25,7 @@ import java.lang.Exception; { - return Native.astMapContains(Context().nCtx(), NativeObject(), k.NativeObject) != 0; + return Native.astMapContains(Context().nCtx(), NativeObject(), k.NativeObject()) ; } /** @@ -39,7 +40,7 @@ import java.lang.Exception; - return new AST(Context, Native.astMapFind(Context().nCtx(), NativeObject(), k.NativeObject)); + return new AST(Context(), Native.astMapFind(Context().nCtx(), NativeObject(), k.NativeObject())); } /** @@ -52,7 +53,7 @@ import java.lang.Exception; - Native.astMapInsert(Context().nCtx(), NativeObject(), k.NativeObject, v.NativeObject); + Native.astMapInsert(Context().nCtx(), NativeObject(), k.NativeObject(), v.NativeObject()); } /** @@ -63,7 +64,7 @@ import java.lang.Exception; { - Native.astMapErase(Context().nCtx(), NativeObject(), k.NativeObject); + Native.astMapErase(Context().nCtx(), NativeObject(), k.NativeObject()); } /** @@ -77,14 +78,14 @@ import java.lang.Exception; /** * The size of the map **/ - public long Size() { return Native.astMapSize(Context().nCtx(), NativeObject()); } + public int Size() { return Native.astMapSize(Context().nCtx(), NativeObject()); } /** * The keys stored in the map. **/ public ASTVector Keys() { - return new ASTVector(Context, Native.astMapKeys(Context().nCtx(), NativeObject())); + return new ASTVector(Context(), Native.astMapKeys(Context().nCtx(), NativeObject())); } /** @@ -119,13 +120,13 @@ import java.lang.Exception; void IncRef(long o) { - Context.ASTMap_DRQ.IncAndClear(Context, o); + Context().ASTMap_DRQ().IncAndClear(Context(), o); super.IncRef(o); } void DecRef(long o) { - Context.ASTMap_DRQ.Add(o); + Context().ASTMap_DRQ().Add(o); super.DecRef(o); } } diff --git a/src/api/java/com/Microsoft/Z3/ASTVector.java b/src/api/java/com/Microsoft/Z3/ASTVector.java index 2bb1ab3e0..83d8173e6 100644 --- a/src/api/java/com/Microsoft/Z3/ASTVector.java +++ b/src/api/java/com/Microsoft/Z3/ASTVector.java @@ -7,6 +7,7 @@ package com.Microsoft.Z3; import java.math.BigInteger; import java.util.*; import java.lang.Exception; +import com.Microsoft.Z3.Enumerations.*; /* using System; */ @@ -18,7 +19,7 @@ import java.lang.Exception; /** * The size of the vector **/ - public long Size() { return Native.astVectorSize(Context().nCtx(), NativeObject()); } + public int Size() { return Native.astVectorSize(Context().nCtx(), NativeObject()); } /** * Retrieves the i-th object in the vector. @@ -26,24 +27,24 @@ import java.lang.Exception; * Index * @return An AST **/ - public AST get(long i) + public AST get(int i) { - return new AST(Context, Native.astVectorGet(Context().nCtx(), NativeObject(), i)); + return new AST(Context(), Native.astVectorGet(Context().nCtx(), NativeObject(), i)); } - public void set(long i, AST value) + public void set(int i, AST value) { - Native.astVectorSet(Context().nCtx(), NativeObject(), i, value.NativeObject); + Native.astVectorSet(Context().nCtx(), NativeObject(), i, value.NativeObject()); } /** * Resize the vector to . * The new size of the vector. **/ - public void Resize(long newSize) + public void Resize(int newSize) { Native.astVectorResize(Context().nCtx(), NativeObject(), newSize); } @@ -57,7 +58,7 @@ import java.lang.Exception; { - Native.astVectorPush(Context().nCtx(), NativeObject(), a.NativeObject); + Native.astVectorPush(Context().nCtx(), NativeObject(), a.NativeObject()); } /** @@ -70,7 +71,7 @@ import java.lang.Exception; - return new ASTVector(Context, Native.astVectorTranslate(Context().nCtx(), NativeObject(), ctx.nCtx())); + return new ASTVector(Context(), Native.astVectorTranslate(Context().nCtx(), NativeObject(), ctx.nCtx())); } /** @@ -99,13 +100,13 @@ import java.lang.Exception; void IncRef(long o) { - Context.ASTVector_DRQ.IncAndClear(Context, o); + Context().ASTVector_DRQ().IncAndClear(Context(), o); super.IncRef(o); } void DecRef(long o) { - Context.ASTVector_DRQ.Add(o); + Context().ASTVector_DRQ().Add(o); super.DecRef(o); } } diff --git a/src/api/java/com/Microsoft/Z3/AlgebraicNum.java b/src/api/java/com/Microsoft/Z3/AlgebraicNum.java index eccd15556..b9f5766ce 100644 --- a/src/api/java/com/Microsoft/Z3/AlgebraicNum.java +++ b/src/api/java/com/Microsoft/Z3/AlgebraicNum.java @@ -7,6 +7,7 @@ package com.Microsoft.Z3; import java.math.BigInteger; import java.util.*; import java.lang.Exception; +import com.Microsoft.Z3.Enumerations.*; /* using System; */ /* using System.Numerics; */ @@ -23,11 +24,11 @@ import java.lang.Exception; * the precision of the result * @return A numeral Expr of sort Real **/ - public RatNum ToUpper(long precision) + public RatNum ToUpper(int precision) { - return new RatNum(Context, Native.getAlgebraicNumberUpper(Context().nCtx(), NativeObject(), precision)); + return new RatNum(Context(), Native.getAlgebraicNumberUpper(Context().nCtx(), NativeObject(), precision)); } /** @@ -37,18 +38,18 @@ import java.lang.Exception; * * @return A numeral Expr of sort Real **/ - public RatNum ToLower(long precision) + public RatNum ToLower(int precision) { - return new RatNum(Context, Native.getAlgebraicNumberLower(Context().nCtx(), NativeObject(), precision)); + return new RatNum(Context(), Native.getAlgebraicNumberLower(Context().nCtx(), NativeObject(), precision)); } /** * Returns a string representation in decimal notation. * The result has at most decimal places. **/ - public String ToDecimal(long precision) + public String ToDecimal(int precision) { diff --git a/src/api/java/com/Microsoft/Z3/ApplyResult.java b/src/api/java/com/Microsoft/Z3/ApplyResult.java index 51be63496..016b2f055 100644 --- a/src/api/java/com/Microsoft/Z3/ApplyResult.java +++ b/src/api/java/com/Microsoft/Z3/ApplyResult.java @@ -7,6 +7,7 @@ package com.Microsoft.Z3; import java.math.BigInteger; import java.util.*; import java.lang.Exception; +import com.Microsoft.Z3.Enumerations.*; /* using System; */ @@ -19,7 +20,7 @@ import java.lang.Exception; /** * The number of Subgoals. **/ - public long NumSubgoals() { return Native.applyResultGetNumSubgoals(Context().nCtx(), NativeObject()); } + public int NumSubgoals() { return Native.applyResultGetNumSubgoals(Context().nCtx(), NativeObject()); } /** * Retrieves the subgoals from the ApplyResult. @@ -29,10 +30,10 @@ import java.lang.Exception; - long n = NumSubgoals; + int n = NumSubgoals(); Goal[] res = new Goal[n]; - for (long i; i < n; i++) - res[i] = new Goal(Context, Native.applyResultGetSubgoal(Context().nCtx(), NativeObject(), i)); + for (int i = 0; i < n; i++) + res[i] = new Goal(Context(), Native.applyResultGetSubgoal(Context().nCtx(), NativeObject(), i)); return res; } @@ -41,12 +42,12 @@ import java.lang.Exception; * goal g, that the ApplyResult was obtained from. * @return A model for g **/ - public Model ConvertModel(long i, Model m) + public Model ConvertModel(int i, Model m) { - return new Model(Context, Native.applyResultConvertModel(Context().nCtx(), NativeObject(), i, m.NativeObject)); + return new Model(Context(), Native.applyResultConvertModel(Context().nCtx(), NativeObject(), i, m.NativeObject())); } /** @@ -77,13 +78,13 @@ import java.lang.Exception; void IncRef(long o) { - Context.ApplyResult_DRQ.IncAndClear(Context, o); + Context().ApplyResult_DRQ().IncAndClear(Context(), o); super.IncRef(o); } void DecRef(long o) { - Context.ApplyResult_DRQ.Add(o); + Context().ApplyResult_DRQ().Add(o); super.DecRef(o); } } diff --git a/src/api/java/com/Microsoft/Z3/ArithExpr.java b/src/api/java/com/Microsoft/Z3/ArithExpr.java index 7920bdded..8df3bb0a5 100644 --- a/src/api/java/com/Microsoft/Z3/ArithExpr.java +++ b/src/api/java/com/Microsoft/Z3/ArithExpr.java @@ -7,6 +7,7 @@ package com.Microsoft.Z3; import java.math.BigInteger; import java.util.*; import java.lang.Exception; +import com.Microsoft.Z3.Enumerations.*; /* using System; */ /* using System.Collections.Generic; */ /* using System.Linq; */ diff --git a/src/api/java/com/Microsoft/Z3/ArithSort.java b/src/api/java/com/Microsoft/Z3/ArithSort.java index a6e339e30..009112494 100644 --- a/src/api/java/com/Microsoft/Z3/ArithSort.java +++ b/src/api/java/com/Microsoft/Z3/ArithSort.java @@ -7,6 +7,7 @@ package com.Microsoft.Z3; import java.math.BigInteger; import java.util.*; import java.lang.Exception; +import com.Microsoft.Z3.Enumerations.*; /* using System; */ diff --git a/src/api/java/com/Microsoft/Z3/ArrayExpr.java b/src/api/java/com/Microsoft/Z3/ArrayExpr.java index bc03135aa..27495fb64 100644 --- a/src/api/java/com/Microsoft/Z3/ArrayExpr.java +++ b/src/api/java/com/Microsoft/Z3/ArrayExpr.java @@ -7,6 +7,7 @@ package com.Microsoft.Z3; import java.math.BigInteger; import java.util.*; import java.lang.Exception; +import com.Microsoft.Z3.Enumerations.*; /* using System; */ /* using System.Collections.Generic; */ /* using System.Linq; */ diff --git a/src/api/java/com/Microsoft/Z3/ArraySort.java b/src/api/java/com/Microsoft/Z3/ArraySort.java index cd00df084..b3c5ee7c3 100644 --- a/src/api/java/com/Microsoft/Z3/ArraySort.java +++ b/src/api/java/com/Microsoft/Z3/ArraySort.java @@ -7,6 +7,7 @@ package com.Microsoft.Z3; import java.math.BigInteger; import java.util.*; import java.lang.Exception; +import com.Microsoft.Z3.Enumerations.*; /* using System; */ @@ -22,7 +23,7 @@ import java.lang.Exception; { - return Sort.Create(Context, Native.getArraySortDomain(Context().nCtx(), NativeObject())); + return Sort.Create(Context(), Native.getArraySortDomain(Context().nCtx(), NativeObject())); } /** @@ -32,12 +33,12 @@ import java.lang.Exception; { - return Sort.Create(Context, Native.getArraySortRange(Context().nCtx(), NativeObject())); + return Sort.Create(Context(), Native.getArraySortRange(Context().nCtx(), NativeObject())); } ArraySort(Context ctx, long obj) { super(ctx, obj); { }} ArraySort(Context ctx, Sort domain, Sort range) - { super(ctx, Native.mkArraySort(ctx.nCtx(), domain.NativeObject, range.NativeObject)); + { super(ctx, Native.mkArraySort(ctx.nCtx(), domain.NativeObject(), range.NativeObject())); diff --git a/src/api/java/com/Microsoft/Z3/BitVecExpr.java b/src/api/java/com/Microsoft/Z3/BitVecExpr.java index 62a03cd06..bbb13a873 100644 --- a/src/api/java/com/Microsoft/Z3/BitVecExpr.java +++ b/src/api/java/com/Microsoft/Z3/BitVecExpr.java @@ -7,6 +7,7 @@ package com.Microsoft.Z3; import java.math.BigInteger; import java.util.*; import java.lang.Exception; +import com.Microsoft.Z3.Enumerations.*; /* using System; */ /* using System.Collections.Generic; */ /* using System.Linq; */ @@ -22,7 +23,7 @@ import java.lang.Exception; /** * The size of the sort of a bit-vector term. **/ - public long SortSize() { return ((BitVecSort)Sort).Size; } + public int SortSize() { return ((BitVecSort)Sort).Size; } /** Constructor for BitVecExpr **/ diff --git a/src/api/java/com/Microsoft/Z3/BitVecNum.java b/src/api/java/com/Microsoft/Z3/BitVecNum.java index 81389dd4b..6a46fc852 100644 --- a/src/api/java/com/Microsoft/Z3/BitVecNum.java +++ b/src/api/java/com/Microsoft/Z3/BitVecNum.java @@ -7,6 +7,7 @@ package com.Microsoft.Z3; import java.math.BigInteger; import java.util.*; import java.lang.Exception; +import com.Microsoft.Z3.Enumerations.*; /* using System; */ /* using System.Numerics; */ @@ -22,7 +23,7 @@ import java.lang.Exception; public long UInt64() { long res = 0; - if (Native.getNumeralLong64(Context().nCtx(), NativeObject(), res) == 0) + if (Native.getNumeralInt64(Context().nCtx(), NativeObject(), res) ^ true) throw new Z3Exception("Numeral is not a 64 bit unsigned"); return res; } @@ -33,7 +34,7 @@ import java.lang.Exception; public int Int() { int res = 0; - if (Native.getNumeralInt(Context().nCtx(), NativeObject(), res) == 0) + if (Native.getNumeralInt(Context().nCtx(), NativeObject(), res) ^ true) throw new Z3Exception("Numeral is not an int"); return res; } @@ -44,7 +45,7 @@ import java.lang.Exception; public long Int64() { long res = 0; - if (Native.getNumeralInt64(Context().nCtx(), NativeObject(), res) == 0) + if (Native.getNumeralInt64(Context().nCtx(), NativeObject(), res) ^ true) throw new Z3Exception("Numeral is not an int64"); return res; } @@ -52,11 +53,11 @@ import java.lang.Exception; /** * Retrieve the int value. **/ - public long UInt() + public int UInt() { - long res = 0; - if (Native.getNumeralLong(Context().nCtx(), NativeObject(), res) == 0) - throw new Z3Exception("Numeral is not a long"); + int res = 0; + if (Native.getNumeralInt(Context().nCtx(), NativeObject(), res) ^ true) + throw new Z3Exception("Numeral is not a int"); return res; } @@ -65,7 +66,7 @@ import java.lang.Exception; **/ public BigInteger BigInteger() { - return BigInteger.Parse(this.ToString()); + return new BigInteger(this.toString()); } /** diff --git a/src/api/java/com/Microsoft/Z3/BitVecSort.java b/src/api/java/com/Microsoft/Z3/BitVecSort.java index 0ed24573a..4f9f1a2e2 100644 --- a/src/api/java/com/Microsoft/Z3/BitVecSort.java +++ b/src/api/java/com/Microsoft/Z3/BitVecSort.java @@ -7,6 +7,7 @@ package com.Microsoft.Z3; import java.math.BigInteger; import java.util.*; import java.lang.Exception; +import com.Microsoft.Z3.Enumerations.*; /* using System; */ @@ -18,8 +19,7 @@ import java.lang.Exception; /** * The size of the bit-vector sort. **/ - public long Size() { return Native.getBvSortSize(Context().nCtx(), NativeObject()); } + public int Size() { return Native.getBvSortSize(Context().nCtx(), NativeObject()); } BitVecSort(Context ctx, long obj) { super(ctx, obj); { }} - BitVecSort(Context ctx, long size) { super(ctx, Native.mkBvSort(ctx.nCtx(), size)); { }} }; diff --git a/src/api/java/com/Microsoft/Z3/BoolExpr.java b/src/api/java/com/Microsoft/Z3/BoolExpr.java index 65778ba44..7644b4400 100644 --- a/src/api/java/com/Microsoft/Z3/BoolExpr.java +++ b/src/api/java/com/Microsoft/Z3/BoolExpr.java @@ -7,6 +7,7 @@ package com.Microsoft.Z3; import java.math.BigInteger; import java.util.*; import java.lang.Exception; +import com.Microsoft.Z3.Enumerations.*; /* using System; */ /* using System.Collections.Generic; */ /* using System.Linq; */ diff --git a/src/api/java/com/Microsoft/Z3/BoolSort.java b/src/api/java/com/Microsoft/Z3/BoolSort.java index 9b05607ac..13d4f2f1d 100644 --- a/src/api/java/com/Microsoft/Z3/BoolSort.java +++ b/src/api/java/com/Microsoft/Z3/BoolSort.java @@ -7,6 +7,7 @@ package com.Microsoft.Z3; import java.math.BigInteger; import java.util.*; import java.lang.Exception; +import com.Microsoft.Z3.Enumerations.*; /* using System; */ diff --git a/src/api/java/com/Microsoft/Z3/Constructor.java b/src/api/java/com/Microsoft/Z3/Constructor.java index caead4737..d7d534873 100644 --- a/src/api/java/com/Microsoft/Z3/Constructor.java +++ b/src/api/java/com/Microsoft/Z3/Constructor.java @@ -7,6 +7,7 @@ package com.Microsoft.Z3; import java.math.BigInteger; import java.util.*; import java.lang.Exception; +import com.Microsoft.Z3.Enumerations.*; /* using System; */ @@ -18,7 +19,7 @@ import java.lang.Exception; /** * The number of fields of the constructor. **/ - public long NumFields() + public int NumFields() { init(); return n; @@ -70,13 +71,13 @@ import java.lang.Exception; } - private long n = 0; + private int n = 0; private FuncDecl m_testerDecl = null; private FuncDecl m_constructorDecl = null; private FuncDecl[] m_accessorDecls = null; Constructor(Context ctx, Symbol name, Symbol recognizer, Symbol[] fieldNames, - Sort[] sorts, long[] sortRefs) + Sort[] sorts, int[] sortRefs) { super(ctx); @@ -86,12 +87,12 @@ import java.lang.Exception; if (n != AST.ArrayLength(sorts)) throw new Z3Exception("Number of field names does not match number of sorts"); - if (sortRefs != null && sortRefs.Length != n) + if (sortRefs != null && sortRefs.length != n) throw new Z3Exception("Number of field names does not match number of sort refs"); - if (sortRefs == null) sortRefs = new long[n]; + if (sortRefs == null) sortRefs = new int[n]; - NativeObject() = Native.mkConstructor(ctx.nCtx(), name.NativeObject, recognizer.NativeObject, + NativeObject() = Native.mkConstructor(ctx.nCtx(), name.NativeObject(), recognizer.NativeObject(), n, Symbol.ArrayToNative(fieldNames), Sort.ArrayToNative(sorts), @@ -110,11 +111,11 @@ import java.lang.Exception; long tester = 0; long[] accessors = new long[n]; Native.queryConstructor(Context().nCtx(), NativeObject(), n, constructor, tester, accessors); - m_constructorDecl = new FuncDecl(Context, constructor); - m_testerDecl = new FuncDecl(Context, tester); + m_constructorDecl = new FuncDecl(Context(), constructor); + m_testerDecl = new FuncDecl(Context(), tester); m_accessorDecls = new FuncDecl[n]; - for (long i; i < n; i++) - m_accessorDecls[i] = new FuncDecl(Context, accessors[i]); + for (int i = 0; i < n; i++) + m_accessorDecls[i] = new FuncDecl(Context(), accessors[i]); } } diff --git a/src/api/java/com/Microsoft/Z3/ConstructorList.java b/src/api/java/com/Microsoft/Z3/ConstructorList.java index 05b85e664..cb8be3b38 100644 --- a/src/api/java/com/Microsoft/Z3/ConstructorList.java +++ b/src/api/java/com/Microsoft/Z3/ConstructorList.java @@ -7,6 +7,7 @@ package com.Microsoft.Z3; import java.math.BigInteger; import java.util.*; import java.lang.Exception; +import com.Microsoft.Z3.Enumerations.*; /* using System; */ /* using System.Collections.Generic; */ @@ -37,6 +38,6 @@ import java.lang.Exception; - setNativeObject(Native.mkConstructorList(Context().nCtx(), (long)constructors.Length, Constructor.ArrayToNative(constructors))); + setNativeObject(Native.mkConstructorList(Context().nCtx(), (int)constructors.length, Constructor.ArrayToNative(constructors))); } } diff --git a/src/api/java/com/Microsoft/Z3/Context.java b/src/api/java/com/Microsoft/Z3/Context.java index 69a01cb86..079bcaf43 100644 --- a/src/api/java/com/Microsoft/Z3/Context.java +++ b/src/api/java/com/Microsoft/Z3/Context.java @@ -7,6 +7,7 @@ package com.Microsoft.Z3; import java.math.BigInteger; import java.util.*; import java.lang.Exception; +import com.Microsoft.Z3.Enumerations.*; /* using System; */ /* using System.Collections.Generic; */ @@ -34,7 +35,7 @@ import java.lang.Exception; long cfg = Native.mkConfig(); - for (Iterator kv = settings.iterator(); kv.hasNext(); ) + for (KeyValuePair kv: settings) Native.setParamValue(cfg, kv.Key, kv.Value); m_ctx = Native.mkContextRc(cfg); Native.delConfig(cfg); @@ -76,8 +77,8 @@ import java.lang.Exception; if (names == null) return null; - Symbol[] result = new Symbol[names.Length]; - for (int i; i < names.Length; ++i) result[i] = MkSymbol(names[i]); + Symbol[] result = new Symbol[names.length]; + for (int i = 0; i < names.length; ++i) result[i] = MkSymbol(names[i]); return result; } @@ -163,11 +164,11 @@ import java.lang.Exception; /** * Create a new bit-vector sort. **/ - public BitVecSort MkBitVecSort(long size) + public BitVecSort MkBitVecSort(int size) { - return new BitVecSort(this, size); + return new BitVecSort(this, Native.mkBvSort(nCtx(), size)); } /** @@ -198,7 +199,7 @@ import java.lang.Exception; CheckContextMatch(name); CheckContextMatch(fieldNames); CheckContextMatch(fieldSorts); - return new TupleSort(this, name, (long)fieldNames.Length, fieldNames, fieldSorts); + return new TupleSort(this, name, (int)fieldNames.length, fieldNames, fieldSorts); } /** @@ -287,7 +288,7 @@ import java.lang.Exception; * if the corresponding sort reference is 0, then the value in sort_refs should be an index * referring to one of the recursive datatypes that is declared. **/ - public Constructor MkConstructor(Symbol name, Symbol recognizer, Symbol[] fieldNames, Sort[] sorts, long[] sortRefs) + public Constructor MkConstructor(Symbol name, Symbol recognizer, Symbol[] fieldNames, Sort[] sorts, int[] sortRefs) { @@ -305,7 +306,7 @@ import java.lang.Exception; * * @return **/ - public Constructor MkConstructor(String name, String recognizer, String[] fieldNames, Sort[] sorts, long[] sortRefs) + public Constructor MkConstructor(String name, String recognizer, String[] fieldNames, Sort[] sorts, int[] sortRefs) { @@ -356,21 +357,21 @@ import java.lang.Exception; CheckContextMatch(names); - long n = (long)names.Length; + int n = (int)names.length; ConstructorList[] cla = new ConstructorList[n]; long[] n_constr = new long[n]; - for (long i; i < n; i++) + for (int i = 0; i < n; i++) { - var constructor = c[i]; + Constructor[] constructor = c[i]; CheckContextMatch(constructor); cla[i] = new ConstructorList(this, constructor); n_constr[i] = cla[i].NativeObject(); } long[] n_res = new long[n]; - Native.mkDatatypes(nCtx, n, Symbol.ArrayToNative(names), n_res, n_constr); + Native.mkDatatypes(nCtx(), n, Symbol.ArrayToNative(names), n_res, n_constr); DatatypeSort[] res = new DatatypeSort[n]; - for (long i; i < n; i++) + for (int i = 0; i < n; i++) res[i] = new DatatypeSort(this, n_res[i]); return res; } @@ -517,12 +518,12 @@ import java.lang.Exception; * The de-Bruijn index of the variable * The sort of the variable **/ - public Expr MkBound(long index, Sort ty) + public Expr MkBound(int index, Sort ty) { - return Expr.Create(this, Native.mkBound(nCtx, index, ty.NativeObject)); + return Expr.Create(this, Native.mkBound(nCtx(), index, ty.NativeObject())); } /** @@ -531,7 +532,7 @@ import java.lang.Exception; public Pattern MkPattern(Expr[] terms) { - if (terms.Length == 0) + if (terms.length == 0) throw new Z3Exception("Cannot create a pattern from zero terms"); @@ -539,7 +540,7 @@ import java.lang.Exception; long[] termsNative = AST.ArrayToNative(terms); - return new Pattern(this, Native.mkPattern(nCtx, (long)terms.Length, termsNative)); + return new Pattern(this, Native.mkPattern(nCtx(), (int)terms.length, termsNative)); } /** @@ -554,7 +555,7 @@ import java.lang.Exception; CheckContextMatch(name); CheckContextMatch(range); - return Expr.Create(this, Native.mkConst(nCtx, name.NativeObject, range.NativeObject)); + return Expr.Create(this, Native.mkConst(nCtx(), name.NativeObject(), range.NativeObject())); } /** @@ -578,7 +579,7 @@ import java.lang.Exception; CheckContextMatch(range); - return Expr.Create(this, Native.mkFreshConst(nCtx, prefix, range.NativeObject)); + return Expr.Create(this, Native.mkFreshConst(nCtx(), prefix, range.NativeObject())); } /** @@ -601,7 +602,7 @@ import java.lang.Exception; - return (BoolExpr)MkConst(name, BoolSort); + return (BoolExpr)MkConst(name, BoolSort()); } /** @@ -611,7 +612,7 @@ import java.lang.Exception; { - return (BoolExpr)MkConst(MkSymbol(name), BoolSort); + return (BoolExpr)MkConst(MkSymbol(name), BoolSort()); } /** @@ -622,7 +623,7 @@ import java.lang.Exception; - return (IntExpr)MkConst(name, IntSort); + return (IntExpr)MkConst(name, IntSort()); } /** @@ -633,7 +634,7 @@ import java.lang.Exception; - return (IntExpr)MkConst(name, IntSort); + return (IntExpr)MkConst(name, IntSort()); } /** @@ -644,7 +645,7 @@ import java.lang.Exception; - return (RealExpr)MkConst(name, RealSort); + return (RealExpr)MkConst(name, RealSort()); } /** @@ -654,13 +655,13 @@ import java.lang.Exception; { - return (RealExpr)MkConst(name, RealSort); + return (RealExpr)MkConst(name, RealSort()); } /** * Creates a bit-vector constant. **/ - public BitVecExpr MkBVConst(Symbol name, long size) + public BitVecExpr MkBVConst(Symbol name, int size) { @@ -671,7 +672,7 @@ import java.lang.Exception; /** * Creates a bit-vector constant. **/ - public BitVecExpr MkBVConst(String name, long size) + public BitVecExpr MkBVConst(String name, int size) { @@ -699,7 +700,7 @@ import java.lang.Exception; { - return new BoolExpr(this, Native.mkTrue(nCtx)); + return new BoolExpr(this, Native.mkTrue(nCtx())); } /** @@ -709,7 +710,7 @@ import java.lang.Exception; { - return new BoolExpr(this, Native.mkFalse(nCtx)); + return new BoolExpr(this, Native.mkFalse(nCtx())); } /** @@ -733,7 +734,7 @@ import java.lang.Exception; CheckContextMatch(x); CheckContextMatch(y); - return new BoolExpr(this, Native.mkEq(nCtx, x.NativeObject, y.NativeObject)); + return new BoolExpr(this, Native.mkEq(nCtx(), x.NativeObject(), y.NativeObject())); } /** @@ -747,7 +748,7 @@ import java.lang.Exception; CheckContextMatch(args); - return new BoolExpr(this, Native.mkDistinct(nCtx, (long)args.Length, AST.ArrayToNative(args))); + return new BoolExpr(this, Native.mkDistinct(nCtx(), (int)args.length, AST.ArrayToNative(args))); } /** @@ -759,7 +760,7 @@ import java.lang.Exception; CheckContextMatch(a); - return new BoolExpr(this, Native.mkNot(nCtx, a.NativeObject)); + return new BoolExpr(this, Native.mkNot(nCtx(), a.NativeObject())); } /** @@ -778,7 +779,7 @@ import java.lang.Exception; CheckContextMatch(t1); CheckContextMatch(t2); CheckContextMatch(t3); - return Expr.Create(this, Native.mkIte(nCtx, t1.NativeObject, t2.NativeObject, t3.NativeObject)); + return Expr.Create(this, Native.mkIte(nCtx(), t1.NativeObject(), t2.NativeObject(), t3.NativeObject())); } /** @@ -792,7 +793,7 @@ import java.lang.Exception; CheckContextMatch(t1); CheckContextMatch(t2); - return new BoolExpr(this, Native.mkIff(nCtx, t1.NativeObject, t2.NativeObject)); + return new BoolExpr(this, Native.mkIff(nCtx(), t1.NativeObject(), t2.NativeObject())); } /** @@ -806,7 +807,7 @@ import java.lang.Exception; CheckContextMatch(t1); CheckContextMatch(t2); - return new BoolExpr(this, Native.mkImplies(nCtx, t1.NativeObject, t2.NativeObject)); + return new BoolExpr(this, Native.mkImplies(nCtx(), t1.NativeObject(), t2.NativeObject())); } /** @@ -820,7 +821,7 @@ import java.lang.Exception; CheckContextMatch(t1); CheckContextMatch(t2); - return new BoolExpr(this, Native.mkXor(nCtx, t1.NativeObject, t2.NativeObject)); + return new BoolExpr(this, Native.mkXor(nCtx(), t1.NativeObject(), t2.NativeObject())); } /** @@ -833,7 +834,7 @@ import java.lang.Exception; CheckContextMatch(t); - return new BoolExpr(this, Native.mkAnd(nCtx, (long)t.Length, AST.ArrayToNative(t))); + return new BoolExpr(this, Native.mkAnd(nCtx(), (int)t.length, AST.ArrayToNative(t))); } /** @@ -846,7 +847,7 @@ import java.lang.Exception; CheckContextMatch(t); - return new BoolExpr(this, Native.mkOr(nCtx, (long)t.Length, AST.ArrayToNative(t))); + return new BoolExpr(this, Native.mkOr(nCtx(), (int)t.length, AST.ArrayToNative(t))); } /** @@ -859,7 +860,7 @@ import java.lang.Exception; CheckContextMatch(t); - return (ArithExpr)Expr.Create(this, Native.mkAdd(nCtx, (long)t.Length, AST.ArrayToNative(t))); + return (ArithExpr)Expr.Create(this, Native.mkAdd(nCtx(), (int)t.length, AST.ArrayToNative(t))); } /** @@ -872,7 +873,7 @@ import java.lang.Exception; CheckContextMatch(t); - return (ArithExpr)Expr.Create(this, Native.mkMul(nCtx, (long)t.Length, AST.ArrayToNative(t))); + return (ArithExpr)Expr.Create(this, Native.mkMul(nCtx(), (int)t.length, AST.ArrayToNative(t))); } /** @@ -885,7 +886,7 @@ import java.lang.Exception; CheckContextMatch(t); - return (ArithExpr)Expr.Create(this, Native.mkSub(nCtx, (long)t.Length, AST.ArrayToNative(t))); + return (ArithExpr)Expr.Create(this, Native.mkSub(nCtx(), (int)t.length, AST.ArrayToNative(t))); } /** @@ -897,7 +898,7 @@ import java.lang.Exception; CheckContextMatch(t); - return (ArithExpr)Expr.Create(this, Native.mkUnaryMinus(nCtx, t.NativeObject)); + return (ArithExpr)Expr.Create(this, Native.mkUnaryMinus(nCtx(), t.NativeObject())); } /** @@ -911,7 +912,7 @@ import java.lang.Exception; CheckContextMatch(t1); CheckContextMatch(t2); - return (ArithExpr)Expr.Create(this, Native.mkDiv(nCtx, t1.NativeObject, t2.NativeObject)); + return (ArithExpr)Expr.Create(this, Native.mkDiv(nCtx(), t1.NativeObject(), t2.NativeObject())); } /** @@ -926,7 +927,7 @@ import java.lang.Exception; CheckContextMatch(t1); CheckContextMatch(t2); - return new IntExpr(this, Native.mkMod(nCtx, t1.NativeObject, t2.NativeObject)); + return new IntExpr(this, Native.mkMod(nCtx(), t1.NativeObject(), t2.NativeObject())); } /** @@ -941,7 +942,7 @@ import java.lang.Exception; CheckContextMatch(t1); CheckContextMatch(t2); - return new IntExpr(this, Native.mkRem(nCtx, t1.NativeObject, t2.NativeObject)); + return new IntExpr(this, Native.mkRem(nCtx(), t1.NativeObject(), t2.NativeObject())); } /** @@ -955,7 +956,7 @@ import java.lang.Exception; CheckContextMatch(t1); CheckContextMatch(t2); - return (ArithExpr)Expr.Create(this, Native.mkPower(nCtx, t1.NativeObject, t2.NativeObject)); + return (ArithExpr)Expr.Create(this, Native.mkPower(nCtx(), t1.NativeObject(), t2.NativeObject())); } /** @@ -969,7 +970,7 @@ import java.lang.Exception; CheckContextMatch(t1); CheckContextMatch(t2); - return new BoolExpr(this, Native.mkLt(nCtx, t1.NativeObject, t2.NativeObject)); + return new BoolExpr(this, Native.mkLt(nCtx(), t1.NativeObject(), t2.NativeObject())); } /** @@ -983,7 +984,7 @@ import java.lang.Exception; CheckContextMatch(t1); CheckContextMatch(t2); - return new BoolExpr(this, Native.mkLe(nCtx, t1.NativeObject, t2.NativeObject)); + return new BoolExpr(this, Native.mkLe(nCtx(), t1.NativeObject(), t2.NativeObject())); } /** @@ -997,7 +998,7 @@ import java.lang.Exception; CheckContextMatch(t1); CheckContextMatch(t2); - return new BoolExpr(this, Native.mkGt(nCtx, t1.NativeObject, t2.NativeObject)); + return new BoolExpr(this, Native.mkGt(nCtx(), t1.NativeObject(), t2.NativeObject())); } /** @@ -1011,7 +1012,7 @@ import java.lang.Exception; CheckContextMatch(t1); CheckContextMatch(t2); - return new BoolExpr(this, Native.mkGe(nCtx, t1.NativeObject, t2.NativeObject)); + return new BoolExpr(this, Native.mkGe(nCtx(), t1.NativeObject(), t2.NativeObject())); } /** @@ -1030,7 +1031,7 @@ import java.lang.Exception; CheckContextMatch(t); - return new RealExpr(this, Native.mkInt2real(nCtx, t.NativeObject)); + return new RealExpr(this, Native.mkInt2real(nCtx(), t.NativeObject())); } /** @@ -1046,7 +1047,7 @@ import java.lang.Exception; CheckContextMatch(t); - return new IntExpr(this, Native.mkReal2int(nCtx, t.NativeObject)); + return new IntExpr(this, Native.mkReal2int(nCtx(), t.NativeObject())); } /** @@ -1058,7 +1059,7 @@ import java.lang.Exception; CheckContextMatch(t); - return new BoolExpr(this, Native.mkIsInt(nCtx, t.NativeObject)); + return new BoolExpr(this, Native.mkIsInt(nCtx(), t.NativeObject())); } /** @@ -1071,7 +1072,7 @@ import java.lang.Exception; CheckContextMatch(t); - return new BitVecExpr(this, Native.mkBvnot(nCtx, t.NativeObject)); + return new BitVecExpr(this, Native.mkBvnot(nCtx(), t.NativeObject())); } /** @@ -1084,7 +1085,7 @@ import java.lang.Exception; CheckContextMatch(t); - return new BitVecExpr(this, Native.mkBvredand(nCtx, t.NativeObject)); + return new BitVecExpr(this, Native.mkBvredand(nCtx(), t.NativeObject())); } /** @@ -1097,7 +1098,7 @@ import java.lang.Exception; CheckContextMatch(t); - return new BitVecExpr(this, Native.mkBvredor(nCtx, t.NativeObject)); + return new BitVecExpr(this, Native.mkBvredor(nCtx(), t.NativeObject())); } /** @@ -1112,7 +1113,7 @@ import java.lang.Exception; CheckContextMatch(t1); CheckContextMatch(t2); - return new BitVecExpr(this, Native.mkBvand(nCtx, t1.NativeObject, t2.NativeObject)); + return new BitVecExpr(this, Native.mkBvand(nCtx(), t1.NativeObject(), t2.NativeObject())); } /** @@ -1127,7 +1128,7 @@ import java.lang.Exception; CheckContextMatch(t1); CheckContextMatch(t2); - return new BitVecExpr(this, Native.mkBvor(nCtx, t1.NativeObject, t2.NativeObject)); + return new BitVecExpr(this, Native.mkBvor(nCtx(), t1.NativeObject(), t2.NativeObject())); } /** @@ -1142,7 +1143,7 @@ import java.lang.Exception; CheckContextMatch(t1); CheckContextMatch(t2); - return new BitVecExpr(this, Native.mkBvxor(nCtx, t1.NativeObject, t2.NativeObject)); + return new BitVecExpr(this, Native.mkBvxor(nCtx(), t1.NativeObject(), t2.NativeObject())); } /** @@ -1157,7 +1158,7 @@ import java.lang.Exception; CheckContextMatch(t1); CheckContextMatch(t2); - return new BitVecExpr(this, Native.mkBvnand(nCtx, t1.NativeObject, t2.NativeObject)); + return new BitVecExpr(this, Native.mkBvnand(nCtx(), t1.NativeObject(), t2.NativeObject())); } /** @@ -1172,7 +1173,7 @@ import java.lang.Exception; CheckContextMatch(t1); CheckContextMatch(t2); - return new BitVecExpr(this, Native.mkBvnor(nCtx, t1.NativeObject, t2.NativeObject)); + return new BitVecExpr(this, Native.mkBvnor(nCtx(), t1.NativeObject(), t2.NativeObject())); } /** @@ -1187,7 +1188,7 @@ import java.lang.Exception; CheckContextMatch(t1); CheckContextMatch(t2); - return new BitVecExpr(this, Native.mkBvxnor(nCtx, t1.NativeObject, t2.NativeObject)); + return new BitVecExpr(this, Native.mkBvxnor(nCtx(), t1.NativeObject(), t2.NativeObject())); } /** @@ -1200,7 +1201,7 @@ import java.lang.Exception; CheckContextMatch(t); - return new BitVecExpr(this, Native.mkBvneg(nCtx, t.NativeObject)); + return new BitVecExpr(this, Native.mkBvneg(nCtx(), t.NativeObject())); } /** @@ -1215,7 +1216,7 @@ import java.lang.Exception; CheckContextMatch(t1); CheckContextMatch(t2); - return new BitVecExpr(this, Native.mkBvadd(nCtx, t1.NativeObject, t2.NativeObject)); + return new BitVecExpr(this, Native.mkBvadd(nCtx(), t1.NativeObject(), t2.NativeObject())); } /** @@ -1230,7 +1231,7 @@ import java.lang.Exception; CheckContextMatch(t1); CheckContextMatch(t2); - return new BitVecExpr(this, Native.mkBvsub(nCtx, t1.NativeObject, t2.NativeObject)); + return new BitVecExpr(this, Native.mkBvsub(nCtx(), t1.NativeObject(), t2.NativeObject())); } /** @@ -1245,7 +1246,7 @@ import java.lang.Exception; CheckContextMatch(t1); CheckContextMatch(t2); - return new BitVecExpr(this, Native.mkBvmul(nCtx, t1.NativeObject, t2.NativeObject)); + return new BitVecExpr(this, Native.mkBvmul(nCtx(), t1.NativeObject(), t2.NativeObject())); } /** @@ -1265,7 +1266,7 @@ import java.lang.Exception; CheckContextMatch(t1); CheckContextMatch(t2); - return new BitVecExpr(this, Native.mkBvudiv(nCtx, t1.NativeObject, t2.NativeObject)); + return new BitVecExpr(this, Native.mkBvudiv(nCtx(), t1.NativeObject(), t2.NativeObject())); } /** @@ -1289,7 +1290,7 @@ import java.lang.Exception; CheckContextMatch(t1); CheckContextMatch(t2); - return new BitVecExpr(this, Native.mkBvsdiv(nCtx, t1.NativeObject, t2.NativeObject)); + return new BitVecExpr(this, Native.mkBvsdiv(nCtx(), t1.NativeObject(), t2.NativeObject())); } /** @@ -1308,7 +1309,7 @@ import java.lang.Exception; CheckContextMatch(t1); CheckContextMatch(t2); - return new BitVecExpr(this, Native.mkBvurem(nCtx, t1.NativeObject, t2.NativeObject)); + return new BitVecExpr(this, Native.mkBvurem(nCtx(), t1.NativeObject(), t2.NativeObject())); } /** @@ -1329,7 +1330,7 @@ import java.lang.Exception; CheckContextMatch(t1); CheckContextMatch(t2); - return new BitVecExpr(this, Native.mkBvsrem(nCtx, t1.NativeObject, t2.NativeObject)); + return new BitVecExpr(this, Native.mkBvsrem(nCtx(), t1.NativeObject(), t2.NativeObject())); } /** @@ -1347,7 +1348,7 @@ import java.lang.Exception; CheckContextMatch(t1); CheckContextMatch(t2); - return new BitVecExpr(this, Native.mkBvsmod(nCtx, t1.NativeObject, t2.NativeObject)); + return new BitVecExpr(this, Native.mkBvsmod(nCtx(), t1.NativeObject(), t2.NativeObject())); } /** @@ -1364,7 +1365,7 @@ import java.lang.Exception; CheckContextMatch(t1); CheckContextMatch(t2); - return new BoolExpr(this, Native.mkBvult(nCtx, t1.NativeObject, t2.NativeObject)); + return new BoolExpr(this, Native.mkBvult(nCtx(), t1.NativeObject(), t2.NativeObject())); } /** @@ -1381,7 +1382,7 @@ import java.lang.Exception; CheckContextMatch(t1); CheckContextMatch(t2); - return new BoolExpr(this, Native.mkBvslt(nCtx, t1.NativeObject, t2.NativeObject)); + return new BoolExpr(this, Native.mkBvslt(nCtx(), t1.NativeObject(), t2.NativeObject())); } /** @@ -1398,7 +1399,7 @@ import java.lang.Exception; CheckContextMatch(t1); CheckContextMatch(t2); - return new BoolExpr(this, Native.mkBvule(nCtx, t1.NativeObject, t2.NativeObject)); + return new BoolExpr(this, Native.mkBvule(nCtx(), t1.NativeObject(), t2.NativeObject())); } /** @@ -1415,7 +1416,7 @@ import java.lang.Exception; CheckContextMatch(t1); CheckContextMatch(t2); - return new BoolExpr(this, Native.mkBvsle(nCtx, t1.NativeObject, t2.NativeObject)); + return new BoolExpr(this, Native.mkBvsle(nCtx(), t1.NativeObject(), t2.NativeObject())); } /** @@ -1432,7 +1433,7 @@ import java.lang.Exception; CheckContextMatch(t1); CheckContextMatch(t2); - return new BoolExpr(this, Native.mkBvuge(nCtx, t1.NativeObject, t2.NativeObject)); + return new BoolExpr(this, Native.mkBvuge(nCtx(), t1.NativeObject(), t2.NativeObject())); } /** @@ -1449,7 +1450,7 @@ import java.lang.Exception; CheckContextMatch(t1); CheckContextMatch(t2); - return new BoolExpr(this, Native.mkBvsge(nCtx, t1.NativeObject, t2.NativeObject)); + return new BoolExpr(this, Native.mkBvsge(nCtx(), t1.NativeObject(), t2.NativeObject())); } /** @@ -1466,7 +1467,7 @@ import java.lang.Exception; CheckContextMatch(t1); CheckContextMatch(t2); - return new BoolExpr(this, Native.mkBvugt(nCtx, t1.NativeObject, t2.NativeObject)); + return new BoolExpr(this, Native.mkBvugt(nCtx(), t1.NativeObject(), t2.NativeObject())); } /** @@ -1483,7 +1484,7 @@ import java.lang.Exception; CheckContextMatch(t1); CheckContextMatch(t2); - return new BoolExpr(this, Native.mkBvsgt(nCtx, t1.NativeObject, t2.NativeObject)); + return new BoolExpr(this, Native.mkBvsgt(nCtx(), t1.NativeObject(), t2.NativeObject())); } /** @@ -1504,7 +1505,7 @@ import java.lang.Exception; CheckContextMatch(t1); CheckContextMatch(t2); - return new BitVecExpr(this, Native.mkConcat(nCtx, t1.NativeObject, t2.NativeObject)); + return new BitVecExpr(this, Native.mkConcat(nCtx(), t1.NativeObject(), t2.NativeObject())); } /** @@ -1516,13 +1517,13 @@ import java.lang.Exception; * The argument must have a bit-vector sort. * **/ - public BitVecExpr MkExtract(long high, long low, BitVecExpr t) + public BitVecExpr MkExtract(int high, int low, BitVecExpr t) { CheckContextMatch(t); - return new BitVecExpr(this, Native.mkExtract(nCtx, high, low, t.NativeObject)); + return new BitVecExpr(this, Native.mkExtract(nCtx(), high, low, t.NativeObject())); } /** @@ -1533,13 +1534,13 @@ import java.lang.Exception; * The argument must have a bit-vector sort. * **/ - public BitVecExpr MkSignExt(long i, BitVecExpr t) + public BitVecExpr MkSignExt(int i, BitVecExpr t) { CheckContextMatch(t); - return new BitVecExpr(this, Native.mkSignExt(nCtx, i, t.NativeObject)); + return new BitVecExpr(this, Native.mkSignExt(nCtx(), i, t.NativeObject())); } /** @@ -1551,13 +1552,13 @@ import java.lang.Exception; * The argument must have a bit-vector sort. * **/ - public BitVecExpr MkZeroExt(long i, BitVecExpr t) + public BitVecExpr MkZeroExt(int i, BitVecExpr t) { CheckContextMatch(t); - return new BitVecExpr(this, Native.mkZeroExt(nCtx, i, t.NativeObject)); + return new BitVecExpr(this, Native.mkZeroExt(nCtx(), i, t.NativeObject())); } /** @@ -1566,13 +1567,13 @@ import java.lang.Exception; * The argument must have a bit-vector sort. * **/ - public BitVecExpr MkRepeat(long i, BitVecExpr t) + public BitVecExpr MkRepeat(int i, BitVecExpr t) { CheckContextMatch(t); - return new BitVecExpr(this, Native.mkRepeat(nCtx, i, t.NativeObject)); + return new BitVecExpr(this, Native.mkRepeat(nCtx(), i, t.NativeObject())); } /** @@ -1595,7 +1596,7 @@ import java.lang.Exception; CheckContextMatch(t1); CheckContextMatch(t2); - return new BitVecExpr(this, Native.mkBvshl(nCtx, t1.NativeObject, t2.NativeObject)); + return new BitVecExpr(this, Native.mkBvshl(nCtx(), t1.NativeObject(), t2.NativeObject())); } /** @@ -1618,7 +1619,7 @@ import java.lang.Exception; CheckContextMatch(t1); CheckContextMatch(t2); - return new BitVecExpr(this, Native.mkBvlshr(nCtx, t1.NativeObject, t2.NativeObject)); + return new BitVecExpr(this, Native.mkBvlshr(nCtx(), t1.NativeObject(), t2.NativeObject())); } /** @@ -1643,7 +1644,7 @@ import java.lang.Exception; CheckContextMatch(t1); CheckContextMatch(t2); - return new BitVecExpr(this, Native.mkBvashr(nCtx, t1.NativeObject, t2.NativeObject)); + return new BitVecExpr(this, Native.mkBvashr(nCtx(), t1.NativeObject(), t2.NativeObject())); } /** @@ -1653,13 +1654,13 @@ import java.lang.Exception; * The argument must have a bit-vector sort. * **/ - public BitVecExpr MkBVRotateLeft(long i, BitVecExpr t) + public BitVecExpr MkBVRotateLeft(int i, BitVecExpr t) { CheckContextMatch(t); - return new BitVecExpr(this, Native.mkRotateLeft(nCtx, i, t.NativeObject)); + return new BitVecExpr(this, Native.mkRotateLeft(nCtx(), i, t.NativeObject())); } /** @@ -1669,13 +1670,13 @@ import java.lang.Exception; * The argument must have a bit-vector sort. * **/ - public BitVecExpr MkBVRotateRight(long i, BitVecExpr t) + public BitVecExpr MkBVRotateRight(int i, BitVecExpr t) { CheckContextMatch(t); - return new BitVecExpr(this, Native.mkRotateRight(nCtx, i, t.NativeObject)); + return new BitVecExpr(this, Native.mkRotateRight(nCtx(), i, t.NativeObject())); } /** @@ -1693,7 +1694,7 @@ import java.lang.Exception; CheckContextMatch(t1); CheckContextMatch(t2); - return new BitVecExpr(this, Native.mkExtRotateLeft(nCtx, t1.NativeObject, t2.NativeObject)); + return new BitVecExpr(this, Native.mkExtRotateLeft(nCtx(), t1.NativeObject(), t2.NativeObject())); } /** @@ -1711,7 +1712,7 @@ import java.lang.Exception; CheckContextMatch(t1); CheckContextMatch(t2); - return new BitVecExpr(this, Native.mkExtRotateRight(nCtx, t1.NativeObject, t2.NativeObject)); + return new BitVecExpr(this, Native.mkExtRotateRight(nCtx(), t1.NativeObject(), t2.NativeObject())); } /** @@ -1724,13 +1725,13 @@ import java.lang.Exception; * The argument must be of integer sort. * **/ - public BitVecExpr MkInt2BV(long n, IntExpr t) + public BitVecExpr MkInt2BV(int n, IntExpr t) { CheckContextMatch(t); - return new BitVecExpr(this, Native.mkInt2bv(nCtx, n, t.NativeObject)); + return new BitVecExpr(this, Native.mkInt2bv(nCtx(), n, t.NativeObject())); } /** @@ -1754,7 +1755,7 @@ import java.lang.Exception; CheckContextMatch(t); - return new IntExpr(this, Native.mkBv2int(nCtx, t.NativeObject, (signed) ? 1 : 0)); + return new IntExpr(this, Native.mkBv2int(nCtx(), t.NativeObject(), (signed) ? true : false)); } /** @@ -1771,7 +1772,7 @@ import java.lang.Exception; CheckContextMatch(t1); CheckContextMatch(t2); - return new BoolExpr(this, Native.mkBvaddNoOverflow(nCtx, t1.NativeObject, t2.NativeObject, (isSigned) ? 1 : 0)); + return new BoolExpr(this, Native.mkBvaddNoOverflow(nCtx(), t1.NativeObject(), t2.NativeObject(), (isSigned) ? true : false)); } /** @@ -1788,7 +1789,7 @@ import java.lang.Exception; CheckContextMatch(t1); CheckContextMatch(t2); - return new BoolExpr(this, Native.mkBvaddNoUnderflow(nCtx, t1.NativeObject, t2.NativeObject)); + return new BoolExpr(this, Native.mkBvaddNoUnderflow(nCtx(), t1.NativeObject(), t2.NativeObject())); } /** @@ -1805,7 +1806,7 @@ import java.lang.Exception; CheckContextMatch(t1); CheckContextMatch(t2); - return new BoolExpr(this, Native.mkBvsubNoOverflow(nCtx, t1.NativeObject, t2.NativeObject)); + return new BoolExpr(this, Native.mkBvsubNoOverflow(nCtx(), t1.NativeObject(), t2.NativeObject())); } /** @@ -1822,7 +1823,7 @@ import java.lang.Exception; CheckContextMatch(t1); CheckContextMatch(t2); - return new BoolExpr(this, Native.mkBvsubNoUnderflow(nCtx, t1.NativeObject, t2.NativeObject, (isSigned) ? 1 : 0)); + return new BoolExpr(this, Native.mkBvsubNoUnderflow(nCtx(), t1.NativeObject(), t2.NativeObject(), (isSigned) ? true : false)); } /** @@ -1839,7 +1840,7 @@ import java.lang.Exception; CheckContextMatch(t1); CheckContextMatch(t2); - return new BoolExpr(this, Native.mkBvsdivNoOverflow(nCtx, t1.NativeObject, t2.NativeObject)); + return new BoolExpr(this, Native.mkBvsdivNoOverflow(nCtx(), t1.NativeObject(), t2.NativeObject())); } /** @@ -1854,7 +1855,7 @@ import java.lang.Exception; CheckContextMatch(t); - return new BoolExpr(this, Native.mkBvnegNoOverflow(nCtx, t.NativeObject)); + return new BoolExpr(this, Native.mkBvnegNoOverflow(nCtx(), t.NativeObject())); } /** @@ -1871,7 +1872,7 @@ import java.lang.Exception; CheckContextMatch(t1); CheckContextMatch(t2); - return new BoolExpr(this, Native.mkBvmulNoOverflow(nCtx, t1.NativeObject, t2.NativeObject, (isSigned) ? 1 : 0)); + return new BoolExpr(this, Native.mkBvmulNoOverflow(nCtx(), t1.NativeObject(), t2.NativeObject(), (isSigned) ? true : false)); } /** @@ -1888,7 +1889,7 @@ import java.lang.Exception; CheckContextMatch(t1); CheckContextMatch(t2); - return new BoolExpr(this, Native.mkBvmulNoUnderflow(nCtx, t1.NativeObject, t2.NativeObject)); + return new BoolExpr(this, Native.mkBvmulNoUnderflow(nCtx(), t1.NativeObject(), t2.NativeObject())); } /** @@ -1937,7 +1938,7 @@ import java.lang.Exception; CheckContextMatch(a); CheckContextMatch(i); - return Expr.Create(this, Native.mkSelect(nCtx, a.NativeObject, i.NativeObject)); + return Expr.Create(this, Native.mkSelect(nCtx(), a.NativeObject(), i.NativeObject())); } /** @@ -1967,7 +1968,7 @@ import java.lang.Exception; CheckContextMatch(a); CheckContextMatch(i); CheckContextMatch(v); - return new ArrayExpr(this, Native.mkStore(nCtx, a.NativeObject, i.NativeObject, v.NativeObject)); + return new ArrayExpr(this, Native.mkStore(nCtx(), a.NativeObject(), i.NativeObject(), v.NativeObject())); } /** @@ -1987,7 +1988,7 @@ import java.lang.Exception; CheckContextMatch(domain); CheckContextMatch(v); - return new ArrayExpr(this, Native.mkConstArray(nCtx, domain.NativeObject, v.NativeObject)); + return new ArrayExpr(this, Native.mkConstArray(nCtx(), domain.NativeObject(), v.NativeObject())); } /** @@ -2009,7 +2010,7 @@ import java.lang.Exception; CheckContextMatch(f); CheckContextMatch(args); - return (ArrayExpr)Expr.Create(this, Native.mkMap(nCtx, f.NativeObject, AST.ArrayLength(args), AST.ArrayToNative(args))); + return (ArrayExpr)Expr.Create(this, Native.mkMap(nCtx(), f.NativeObject(), AST.ArrayLength(args), AST.ArrayToNative(args))); } /** @@ -2025,7 +2026,7 @@ import java.lang.Exception; CheckContextMatch(array); - return Expr.Create(this, Native.mkArrayDefault(nCtx, array.NativeObject)); + return Expr.Create(this, Native.mkArrayDefault(nCtx(), array.NativeObject())); } /** @@ -2049,7 +2050,7 @@ import java.lang.Exception; CheckContextMatch(domain); - return Expr.Create(this, Native.mkEmptySet(nCtx, domain.NativeObject)); + return Expr.Create(this, Native.mkEmptySet(nCtx(), domain.NativeObject())); } /** @@ -2061,7 +2062,7 @@ import java.lang.Exception; CheckContextMatch(domain); - return Expr.Create(this, Native.mkFullSet(nCtx, domain.NativeObject)); + return Expr.Create(this, Native.mkFullSet(nCtx(), domain.NativeObject())); } /** @@ -2075,7 +2076,7 @@ import java.lang.Exception; CheckContextMatch(set); CheckContextMatch(element); - return Expr.Create(this, Native.mkSetAdd(nCtx, set.NativeObject, element.NativeObject)); + return Expr.Create(this, Native.mkSetAdd(nCtx(), set.NativeObject(), element.NativeObject())); } @@ -2090,7 +2091,7 @@ import java.lang.Exception; CheckContextMatch(set); CheckContextMatch(element); - return Expr.Create(this, Native.mkSetDel(nCtx, set.NativeObject, element.NativeObject)); + return Expr.Create(this, Native.mkSetDel(nCtx(), set.NativeObject(), element.NativeObject())); } /** @@ -2102,7 +2103,7 @@ import java.lang.Exception; CheckContextMatch(args); - return Expr.Create(this, Native.mkSetUnion(nCtx, (long)args.Length, AST.ArrayToNative(args))); + return Expr.Create(this, Native.mkSetUnion(nCtx(), (int)args.length, AST.ArrayToNative(args))); } /** @@ -2115,7 +2116,7 @@ import java.lang.Exception; CheckContextMatch(args); - return Expr.Create(this, Native.mkSetIntersect(nCtx, (long)args.Length, AST.ArrayToNative(args))); + return Expr.Create(this, Native.mkSetIntersect(nCtx(), (int)args.length, AST.ArrayToNative(args))); } /** @@ -2129,7 +2130,7 @@ import java.lang.Exception; CheckContextMatch(arg1); CheckContextMatch(arg2); - return Expr.Create(this, Native.mkSetDifference(nCtx, arg1.NativeObject, arg2.NativeObject)); + return Expr.Create(this, Native.mkSetDifference(nCtx(), arg1.NativeObject(), arg2.NativeObject())); } /** @@ -2141,7 +2142,7 @@ import java.lang.Exception; CheckContextMatch(arg); - return Expr.Create(this, Native.mkSetComplement(nCtx, arg.NativeObject)); + return Expr.Create(this, Native.mkSetComplement(nCtx(), arg.NativeObject())); } /** @@ -2155,7 +2156,7 @@ import java.lang.Exception; CheckContextMatch(elem); CheckContextMatch(set); - return Expr.Create(this, Native.mkSetMember(nCtx, elem.NativeObject, set.NativeObject)); + return Expr.Create(this, Native.mkSetMember(nCtx(), elem.NativeObject(), set.NativeObject())); } /** @@ -2169,7 +2170,7 @@ import java.lang.Exception; CheckContextMatch(arg1); CheckContextMatch(arg2); - return Expr.Create(this, Native.mkSetSubset(nCtx, arg1.NativeObject, arg2.NativeObject)); + return Expr.Create(this, Native.mkSetSubset(nCtx(), arg1.NativeObject(), arg2.NativeObject())); } @@ -2185,7 +2186,7 @@ import java.lang.Exception; CheckContextMatch(ty); - return Expr.Create(this, Native.mkNumeral(nCtx, v, ty.NativeObject)); + return Expr.Create(this, Native.mkNumeral(nCtx(), v, ty.NativeObject())); } /** @@ -2201,9 +2202,18 @@ import java.lang.Exception; CheckContextMatch(ty); - return Expr.Create(this, Native.mkInt(nCtx, v, ty.NativeObject)); + return Expr.Create(this, Native.mkInt(nCtx(), v, ty.NativeObject())); } + /** + * Create a Term of a given sort. This function can be use to create numerals that fit in a machine integer. + * It is slightly faster than MakeNumeral since it is not necessary to parse a string. + * Value of the numeral + * Sort of the numeral + * @return A Term with value and type + **/ + /* Not translated because it would translate to a function with clashing types. */ + /** * Create a Term of a given sort. This function can be use to create numerals that fit in a machine integer. * It is slightly faster than MakeNumeral since it is not necessary to parse a string. @@ -2217,7 +2227,7 @@ import java.lang.Exception; CheckContextMatch(ty); - return Expr.Create(this, Native.mkUnsignedInt(nCtx, v, ty.NativeObject)); + return Expr.Create(this, Native.mkInt64(nCtx(), v, ty.NativeObject())); } /** @@ -2227,30 +2237,7 @@ import java.lang.Exception; * Sort of the numeral * @return A Term with value and type **/ - public Expr MkNumeral(long v, Sort ty) - { - - - - CheckContextMatch(ty); - return Expr.Create(this, Native.mkInt64(nCtx, v, ty.NativeObject)); - } - - /** - * Create a Term of a given sort. This function can be use to create numerals that fit in a machine integer. - * It is slightly faster than MakeNumeral since it is not necessary to parse a string. - * Value of the numeral - * Sort of the numeral - * @return A Term with value and type - **/ - public Expr MkNumeral(long v, Sort ty) - { - - - - CheckContextMatch(ty); - return Expr.Create(this, Native.mkUnsignedInt64(nCtx, v, ty.NativeObject)); - } + /* Not translated because it would translate to a function with clashing types. */ /** * Create a real from a fraction. @@ -2267,7 +2254,7 @@ import java.lang.Exception; - return new RatNum(this, Native.mkReal(nCtx, num, den)); + return new RatNum(this, Native.mkReal(nCtx(), num, den)); } /** @@ -2279,7 +2266,7 @@ import java.lang.Exception; { - return new RatNum(this, Native.mkNumeral(nCtx, v, RealSort.NativeObject)); + return new RatNum(this, Native.mkNumeral(nCtx(), v, RealSort().NativeObject())); } /** @@ -2291,9 +2278,16 @@ import java.lang.Exception; { - return new RatNum(this, Native.mkInt(nCtx, v, RealSort.NativeObject)); + return new RatNum(this, Native.mkInt(nCtx(), v, RealSort().NativeObject())); } + /** + * Create a real numeral. + * value of the numeral. + * @return A Term with value and sort Real + **/ + /* Not translated because it would translate to a function with clashing types. */ + /** * Create a real numeral. * value of the numeral. @@ -2303,7 +2297,7 @@ import java.lang.Exception; { - return new RatNum(this, Native.mkUnsignedInt(nCtx, v, RealSort.NativeObject)); + return new RatNum(this, Native.mkInt64(nCtx(), v, RealSort().NativeObject())); } /** @@ -2311,24 +2305,7 @@ import java.lang.Exception; * value of the numeral. * @return A Term with value and sort Real **/ - public RatNum MkReal(long v) - { - - - return new RatNum(this, Native.mkInt64(nCtx, v, RealSort.NativeObject)); - } - - /** - * Create a real numeral. - * value of the numeral. - * @return A Term with value and sort Real - **/ - public RatNum MkReal(long v) - { - - - return new RatNum(this, Native.mkUnsignedInt64(nCtx, v, RealSort.NativeObject)); - } + /* Not translated because it would translate to a function with clashing types. */ /** * Create an integer numeral. @@ -2338,7 +2315,7 @@ import java.lang.Exception; { - return new IntNum(this, Native.mkNumeral(nCtx, v, IntSort.NativeObject)); + return new IntNum(this, Native.mkNumeral(nCtx(), v, IntSort().NativeObject())); } /** @@ -2350,9 +2327,16 @@ import java.lang.Exception; { - return new IntNum(this, Native.mkInt(nCtx, v, IntSort.NativeObject)); + return new IntNum(this, Native.mkInt(nCtx(), v, IntSort().NativeObject())); } + /** + * Create an integer numeral. + * value of the numeral. + * @return A Term with value and sort Integer + **/ + /* Not translated because it would translate to a function with clashing types. */ + /** * Create an integer numeral. * value of the numeral. @@ -2362,7 +2346,7 @@ import java.lang.Exception; { - return new IntNum(this, Native.mkUnsignedInt(nCtx, v, IntSort.NativeObject)); + return new IntNum(this, Native.mkInt64(nCtx(), v, IntSort().NativeObject())); } /** @@ -2370,31 +2354,14 @@ import java.lang.Exception; * value of the numeral. * @return A Term with value and sort Integer **/ - public IntNum MkInt(long v) - { - - - return new IntNum(this, Native.mkInt64(nCtx, v, IntSort.NativeObject)); - } - - /** - * Create an integer numeral. - * value of the numeral. - * @return A Term with value and sort Integer - **/ - public IntNum MkInt(long v) - { - - - return new IntNum(this, Native.mkUnsignedInt64(nCtx, v, IntSort.NativeObject)); - } + /* Not translated because it would translate to a function with clashing types. */ /** * Create a bit-vector numeral. * A string representing the value in decimal notation. * the size of the bit-vector **/ - public BitVecNum MkBV(String v, long size) + public BitVecNum MkBV(String v, int size) { @@ -2406,7 +2373,7 @@ import java.lang.Exception; * value of the numeral. * the size of the bit-vector **/ - public BitVecNum MkBV(int v, long size) + public BitVecNum MkBV(int v, int size) { @@ -2418,19 +2385,14 @@ import java.lang.Exception; * value of the numeral. * the size of the bit-vector **/ - public BitVecNum MkBV(long v, long size) - { - - - return (BitVecNum)MkNumeral(v, MkBitVecSort(size)); - } + /* Not translated because it would translate to a function with clashing types. */ /** * Create a bit-vector numeral. * value of the numeral. * * the size of the bit-vector **/ - public BitVecNum MkBV(long v, long size) + public BitVecNum MkBV(long v, int size) { @@ -2442,12 +2404,7 @@ import java.lang.Exception; * value of the numeral. * the size of the bit-vector **/ - public BitVecNum MkBV(long v, long size) - { - - - return (BitVecNum)MkNumeral(v, MkBitVecSort(size)); - } + /* Not translated because it would translate to a function with clashing types. */ /** @@ -2469,7 +2426,7 @@ import java.lang.Exception; * optional symbol to track quantifier. * optional symbol to track skolem constants. **/ - public Quantifier MkForall(Sort[] sorts, Symbol[] names, Expr body, long weight, Pattern[] patterns, Expr[] noPatterns, Symbol quantifierID, Symbol skolemID) + public Quantifier MkForall(Sort[] sorts, Symbol[] names, Expr body, int weight, Pattern[] patterns, Expr[] noPatterns, Symbol quantifierID, Symbol skolemID) { @@ -2489,7 +2446,7 @@ import java.lang.Exception; /** * Create a universal Quantifier. **/ - public Quantifier MkForall(Expr[] boundConstants, Expr body, long weight, Pattern[] patterns, Expr[] noPatterns, Symbol quantifierID, Symbol skolemID) + public Quantifier MkForall(Expr[] boundConstants, Expr body, int weight, Pattern[] patterns, Expr[] noPatterns, Symbol quantifierID, Symbol skolemID) { @@ -2505,7 +2462,7 @@ import java.lang.Exception; * Create an existential Quantifier. * **/ - public Quantifier MkExists(Sort[] sorts, Symbol[] names, Expr body, long weight, Pattern[] patterns, Expr[] noPatterns, Symbol quantifierID, Symbol skolemID) + public Quantifier MkExists(Sort[] sorts, Symbol[] names, Expr body, int weight, Pattern[] patterns, Expr[] noPatterns, Symbol quantifierID, Symbol skolemID) { @@ -2523,7 +2480,7 @@ import java.lang.Exception; /** * Create an existential Quantifier. **/ - public Quantifier MkExists(Expr[] boundConstants, Expr body, long weight, Pattern[] patterns, Expr[] noPatterns, Symbol quantifierID, Symbol skolemID) + public Quantifier MkExists(Expr[] boundConstants, Expr body, int weight, Pattern[] patterns, Expr[] noPatterns, Symbol quantifierID, Symbol skolemID) { @@ -2538,7 +2495,7 @@ import java.lang.Exception; /** * Create a Quantifier. **/ - public Quantifier MkQuantifier(boolean universal, Sort[] sorts, Symbol[] names, Expr body, long weight, Pattern[] patterns, Expr[] noPatterns, Symbol quantifierID, Symbol skolemID) + public Quantifier MkQuantifier(boolean universal, Sort[] sorts, Symbol[] names, Expr body, int weight, Pattern[] patterns, Expr[] noPatterns, Symbol quantifierID, Symbol skolemID) { @@ -2561,7 +2518,7 @@ import java.lang.Exception; /** * Create a Quantifier. **/ - public Quantifier MkQuantifier(boolean universal, Expr[] boundConstants, Expr body, long weight, Pattern[] patterns, Expr[] noPatterns, Symbol quantifierID, Symbol skolemID) + public Quantifier MkQuantifier(boolean universal, Expr[] boundConstants, Expr body, int weight, Pattern[] patterns, Expr[] noPatterns, Symbol quantifierID, Symbol skolemID) { @@ -2594,7 +2551,7 @@ import java.lang.Exception; * * **/ - public void setPrintMode(Z3_ast_print_mode value) { Native.setAstPrintMode(nCtx, (long)value); } + public void setPrintMode(Z3_ast_print_mode value) { Native.setAstPrintMode(nCtx(), (int)value); } /** * Convert a benchmark into an SMT-LIB formatted string. @@ -2613,9 +2570,9 @@ import java.lang.Exception; - return Native.benchmarkToSmtlibString(nCtx, name, logic, status, attributes, - (long)assumptions.Length, AST.ArrayToNative(assumptions), - formula.NativeObject); + return Native.benchmarkToSmtlibString(nCtx(), name, logic, status, attributes, + (int)assumptions.length, AST.ArrayToNative(assumptions), + formula.NativeObject()); } /** @@ -2630,13 +2587,13 @@ import java.lang.Exception; **/ public void ParseSMTLIBString(String str, Symbol[] sortNames, Sort[] sorts, Symbol[] declNames, FuncDecl[] decls) { - long csn = Symbol.ArrayLength(sortNames); - long cs = Sort.ArrayLength(sorts); - long cdn = Symbol.ArrayLength(declNames); - long cd = AST.ArrayLength(decls); + int csn = Symbol.ArrayLength(sortNames); + int cs = Sort.ArrayLength(sorts); + int cdn = Symbol.ArrayLength(declNames); + int cd = AST.ArrayLength(decls); if (csn != cs || cdn != cd) throw new Z3Exception("Argument size mismatch"); - Native.parseSmtlibString(nCtx, str, + Native.parseSmtlibString(nCtx(), str, AST.ArrayLength(sorts), Symbol.ArrayToNative(sortNames), AST.ArrayToNative(sorts), AST.ArrayLength(decls), Symbol.ArrayToNative(declNames), AST.ArrayToNative(decls)); } @@ -2647,13 +2604,13 @@ import java.lang.Exception; **/ public void ParseSMTLIBFile(String fileName, Symbol[] sortNames, Sort[] sorts, Symbol[] declNames, FuncDecl[] decls) { - long csn = Symbol.ArrayLength(sortNames); - long cs = Sort.ArrayLength(sorts); - long cdn = Symbol.ArrayLength(declNames); - long cd = AST.ArrayLength(decls); + int csn = Symbol.ArrayLength(sortNames); + int cs = Sort.ArrayLength(sorts); + int cdn = Symbol.ArrayLength(declNames); + int cd = AST.ArrayLength(decls); if (csn != cs || cdn != cd) throw new Z3Exception("Argument size mismatch"); - Native.parseSmtlibFile(nCtx, fileName, + Native.parseSmtlibFile(nCtx(), fileName, AST.ArrayLength(sorts), Symbol.ArrayToNative(sortNames), AST.ArrayToNative(sorts), AST.ArrayLength(decls), Symbol.ArrayToNative(declNames), AST.ArrayToNative(decls)); } @@ -2661,7 +2618,7 @@ import java.lang.Exception; /** * The number of SMTLIB formulas parsed by the last call to ParseSMTLIBString or ParseSMTLIBFile. **/ - public long NumSMTLIBFormulas () { return Native.getSmtlibNumFormulas(nCtx); } + public int NumSMTLIBFormulas () { return Native.getSmtlibNumFormulas(nCtx()); } /** * The formulas parsed by the last call to ParseSMTLIBString or ParseSMTLIBFile. @@ -2670,17 +2627,17 @@ import java.lang.Exception; { - long n = NumSMTLIBFormulas; + int n = NumSMTLIBFormulas(); BoolExpr[] res = new BoolExpr[n]; - for (long i; i < n; i++) - res[i] = (BoolExpr)Expr.Create(this, Native.getSmtlibFormula(nCtx, i)); + for (int i = 0; i < n; i++) + res[i] = (BoolExpr)Expr.Create(this, Native.getSmtlibFormula(nCtx(), i)); return res; } /** * The number of SMTLIB assumptions parsed by the last call to ParseSMTLIBString or ParseSMTLIBFile. **/ - public long NumSMTLIBAssumptions () { return Native.getSmtlibNumAssumptions(nCtx); } + public int NumSMTLIBAssumptions () { return Native.getSmtlibNumAssumptions(nCtx()); } /** * The assumptions parsed by the last call to ParseSMTLIBString or ParseSMTLIBFile. @@ -2689,17 +2646,17 @@ import java.lang.Exception; { - long n = NumSMTLIBAssumptions; + int n = NumSMTLIBAssumptions(); BoolExpr[] res = new BoolExpr[n]; - for (long i; i < n; i++) - res[i] = (BoolExpr)Expr.Create(this, Native.getSmtlibAssumption(nCtx, i)); + for (int i = 0; i < n; i++) + res[i] = (BoolExpr)Expr.Create(this, Native.getSmtlibAssumption(nCtx(), i)); return res; } /** * The number of SMTLIB declarations parsed by the last call to ParseSMTLIBString or ParseSMTLIBFile. **/ - public long NumSMTLIBDecls () { return Native.getSmtlibNumDecls(nCtx); } + public int NumSMTLIBDecls () { return Native.getSmtlibNumDecls(nCtx()); } /** * The declarations parsed by the last call to ParseSMTLIBString or ParseSMTLIBFile. @@ -2708,17 +2665,17 @@ import java.lang.Exception; { - long n = NumSMTLIBDecls; + int n = NumSMTLIBDecls(); FuncDecl[] res = new FuncDecl[n]; - for (long i; i < n; i++) - res[i] = new FuncDecl(this, Native.getSmtlibDecl(nCtx, i)); + for (int i = 0; i < n; i++) + res[i] = new FuncDecl(this, Native.getSmtlibDecl(nCtx(), i)); return res; } /** * The number of SMTLIB sorts parsed by the last call to ParseSMTLIBString or ParseSMTLIBFile. **/ - public long NumSMTLIBSorts () { return Native.getSmtlibNumSorts(nCtx); } + public int NumSMTLIBSorts () { return Native.getSmtlibNumSorts(nCtx()); } /** * The declarations parsed by the last call to ParseSMTLIBString or ParseSMTLIBFile. @@ -2727,10 +2684,10 @@ import java.lang.Exception; { - long n = NumSMTLIBSorts; + int n = NumSMTLIBSorts(); Sort[] res = new Sort[n]; - for (long i; i < n; i++) - res[i] = Sort.Create(this, Native.getSmtlibSort(nCtx, i)); + for (int i = 0; i < n; i++) + res[i] = Sort.Create(this, Native.getSmtlibSort(nCtx(), i)); return res; } @@ -2743,13 +2700,13 @@ import java.lang.Exception; { - long csn = Symbol.ArrayLength(sortNames); - long cs = Sort.ArrayLength(sorts); - long cdn = Symbol.ArrayLength(declNames); - long cd = AST.ArrayLength(decls); + int csn = Symbol.ArrayLength(sortNames); + int cs = Sort.ArrayLength(sorts); + int cdn = Symbol.ArrayLength(declNames); + int cd = AST.ArrayLength(decls); if (csn != cs || cdn != cd) throw new Z3Exception("Argument size mismatch"); - return (BoolExpr)Expr.Create(this, Native.parseSmtlib2String(nCtx, str, + return (BoolExpr)Expr.Create(this, Native.parseSmtlib2String(nCtx(), str, AST.ArrayLength(sorts), Symbol.ArrayToNative(sortNames), AST.ArrayToNative(sorts), AST.ArrayLength(decls), Symbol.ArrayToNative(declNames), AST.ArrayToNative(decls))); } @@ -2762,13 +2719,13 @@ import java.lang.Exception; { - long csn = Symbol.ArrayLength(sortNames); - long cs = Sort.ArrayLength(sorts); - long cdn = Symbol.ArrayLength(declNames); - long cd = AST.ArrayLength(decls); + int csn = Symbol.ArrayLength(sortNames); + int cs = Sort.ArrayLength(sorts); + int cdn = Symbol.ArrayLength(declNames); + int cd = AST.ArrayLength(decls); if (csn != cs || cdn != cd) throw new Z3Exception("Argument size mismatch"); - return (BoolExpr)Expr.Create(this, Native.parseSmtlib2File(nCtx, fileName, + return (BoolExpr)Expr.Create(this, Native.parseSmtlib2File(nCtx(), fileName, AST.ArrayLength(sorts), Symbol.ArrayToNative(sortNames), AST.ArrayToNative(sorts), AST.ArrayLength(decls), Symbol.ArrayToNative(declNames), AST.ArrayToNative(decls))); } @@ -2803,7 +2760,7 @@ import java.lang.Exception; /** * The number of supported tactics. **/ - public long NumTactics() { return Native.getNumTactics(nCtx); } + public int NumTactics() { return Native.getNumTactics(nCtx()); } /** * The names of all supported tactics. @@ -2812,10 +2769,10 @@ import java.lang.Exception; { - long n = NumTactics; + int n = NumTactics(); String[] res = new String[n]; - for (long i; i < n; i++) - res[i] = Native.getTacticName(nCtx, i); + for (int i = 0; i < n; i++) + res[i] = Native.getTacticName(nCtx(), i); return res; } @@ -2826,7 +2783,7 @@ import java.lang.Exception; { - return Native.tacticGetDescr(nCtx, name); + return Native.tacticGetDescr(nCtx(), name); } /** @@ -2856,19 +2813,19 @@ import java.lang.Exception; CheckContextMatch(ts); long last = 0; - if (ts != null && ts.Length > 0) + if (ts != null && ts.length > 0) { - last = ts[ts.Length - 1].NativeObject(); - for (int i = ts.Length - 2; i >= 0; i--) - last = Native.tacticAndThen(nCtx, ts[i].NativeObject, last); + last = ts[ts.length - 1].NativeObject(); + for (int i = ts.length - 2; i >= 0; i--) + last = Native.tacticAndThen(nCtx(), ts[i].NativeObject(), last); } if (last != 0) { - last = Native.tacticAndThen(nCtx, t2.NativeObject, last); - return new Tactic(this, Native.tacticAndThen(nCtx, t1.NativeObject, last)); + last = Native.tacticAndThen(nCtx(), t2.NativeObject(), last); + return new Tactic(this, Native.tacticAndThen(nCtx(), t1.NativeObject(), last)); } else - return new Tactic(this, Native.tacticAndThen(nCtx, t1.NativeObject, t2.NativeObject)); + return new Tactic(this, Native.tacticAndThen(nCtx(), t1.NativeObject(), t2.NativeObject())); } /** @@ -2900,7 +2857,7 @@ import java.lang.Exception; CheckContextMatch(t1); CheckContextMatch(t2); - return new Tactic(this, Native.tacticOrElse(nCtx, t1.NativeObject, t2.NativeObject)); + return new Tactic(this, Native.tacticOrElse(nCtx(), t1.NativeObject(), t2.NativeObject())); } /** @@ -2909,13 +2866,13 @@ import java.lang.Exception; * If does not terminate within milliseconds, then it fails. * **/ - public Tactic TryFor(Tactic t, long ms) + public Tactic TryFor(Tactic t, int ms) { CheckContextMatch(t); - return new Tactic(this, Native.tacticTryFor(nCtx, t.NativeObject, ms)); + return new Tactic(this, Native.tacticTryFor(nCtx(), t.NativeObject(), ms)); } /** @@ -2933,7 +2890,7 @@ import java.lang.Exception; CheckContextMatch(t); CheckContextMatch(p); - return new Tactic(this, Native.tacticWhen(nCtx, p.NativeObject, t.NativeObject)); + return new Tactic(this, Native.tacticWhen(nCtx(), p.NativeObject(), t.NativeObject())); } /** @@ -2950,20 +2907,20 @@ import java.lang.Exception; CheckContextMatch(p); CheckContextMatch(t1); CheckContextMatch(t2); - return new Tactic(this, Native.tacticCond(nCtx, p.NativeObject, t1.NativeObject, t2.NativeObject)); + return new Tactic(this, Native.tacticCond(nCtx(), p.NativeObject(), t1.NativeObject(), t2.NativeObject())); } /** * Create a tactic that keeps applying until the goal is not * modified anymore or the maximum number of iterations is reached. **/ - public Tactic Repeat(Tactic t, long max) + public Tactic Repeat(Tactic t, int max) { CheckContextMatch(t); - return new Tactic(this, Native.tacticRepeat(nCtx, t.NativeObject, max)); + return new Tactic(this, Native.tacticRepeat(nCtx(), t.NativeObject(), max)); } /** @@ -2973,7 +2930,7 @@ import java.lang.Exception; { - return new Tactic(this, Native.tacticSkip(nCtx)); + return new Tactic(this, Native.tacticSkip(nCtx())); } /** @@ -2983,7 +2940,7 @@ import java.lang.Exception; { - return new Tactic(this, Native.tacticFail(nCtx)); + return new Tactic(this, Native.tacticFail(nCtx())); } /** @@ -2995,7 +2952,7 @@ import java.lang.Exception; CheckContextMatch(p); - return new Tactic(this, Native.tacticFailIf(nCtx, p.NativeObject)); + return new Tactic(this, Native.tacticFailIf(nCtx(), p.NativeObject())); } /** @@ -3006,7 +2963,7 @@ import java.lang.Exception; { - return new Tactic(this, Native.tacticFailIfNotDecided(nCtx)); + return new Tactic(this, Native.tacticFailIfNotDecided(nCtx())); } /** @@ -3020,7 +2977,7 @@ import java.lang.Exception; CheckContextMatch(t); CheckContextMatch(p); - return new Tactic(this, Native.tacticUsingParams(nCtx, t.NativeObject, p.NativeObject)); + return new Tactic(this, Native.tacticUsingParams(nCtx(), t.NativeObject(), p.NativeObject())); } /** @@ -3045,7 +3002,7 @@ import java.lang.Exception; CheckContextMatch(t); - return new Tactic(this, Native.tacticParOr(nCtx, Tactic.ArrayLength(t), Tactic.ArrayToNative(t))); + return new Tactic(this, Native.tacticParOr(nCtx(), Tactic.ArrayLength(t), Tactic.ArrayToNative(t))); } /** @@ -3060,7 +3017,7 @@ import java.lang.Exception; CheckContextMatch(t1); CheckContextMatch(t2); - return new Tactic(this, Native.tacticParAndThen(nCtx, t1.NativeObject, t2.NativeObject)); + return new Tactic(this, Native.tacticParAndThen(nCtx(), t1.NativeObject(), t2.NativeObject())); } /** @@ -3069,13 +3026,13 @@ import java.lang.Exception; **/ public void Interrupt() { - Native.interrupt(nCtx); + Native.interrupt(nCtx()); } /** * The number of supported Probes. **/ - public long NumProbes() { return Native.getNumProbes(nCtx); } + public int NumProbes() { return Native.getNumProbes(nCtx()); } /** * The names of all supported Probes. @@ -3084,10 +3041,10 @@ import java.lang.Exception; { - long n = NumProbes; + int n = NumProbes(); String[] res = new String[n]; - for (long i; i < n; i++) - res[i] = Native.getProbeName(nCtx, i); + for (int i = 0; i < n; i++) + res[i] = Native.getProbeName(nCtx(), i); return res; } @@ -3098,7 +3055,7 @@ import java.lang.Exception; { - return Native.probeGetDescr(nCtx, name); + return Native.probeGetDescr(nCtx(), name); } /** @@ -3118,7 +3075,7 @@ import java.lang.Exception; { - return new Probe(this, Native.probeConst(nCtx, val)); + return new Probe(this, Native.probeConst(nCtx(), val)); } /** @@ -3133,7 +3090,7 @@ import java.lang.Exception; CheckContextMatch(p1); CheckContextMatch(p2); - return new Probe(this, Native.probeLt(nCtx, p1.NativeObject, p2.NativeObject)); + return new Probe(this, Native.probeLt(nCtx(), p1.NativeObject(), p2.NativeObject())); } /** @@ -3148,7 +3105,7 @@ import java.lang.Exception; CheckContextMatch(p1); CheckContextMatch(p2); - return new Probe(this, Native.probeGt(nCtx, p1.NativeObject, p2.NativeObject)); + return new Probe(this, Native.probeGt(nCtx(), p1.NativeObject(), p2.NativeObject())); } /** @@ -3163,7 +3120,7 @@ import java.lang.Exception; CheckContextMatch(p1); CheckContextMatch(p2); - return new Probe(this, Native.probeLe(nCtx, p1.NativeObject, p2.NativeObject)); + return new Probe(this, Native.probeLe(nCtx(), p1.NativeObject(), p2.NativeObject())); } /** @@ -3178,7 +3135,7 @@ import java.lang.Exception; CheckContextMatch(p1); CheckContextMatch(p2); - return new Probe(this, Native.probeGe(nCtx, p1.NativeObject, p2.NativeObject)); + return new Probe(this, Native.probeGe(nCtx(), p1.NativeObject(), p2.NativeObject())); } /** @@ -3193,7 +3150,7 @@ import java.lang.Exception; CheckContextMatch(p1); CheckContextMatch(p2); - return new Probe(this, Native.probeEq(nCtx, p1.NativeObject, p2.NativeObject)); + return new Probe(this, Native.probeEq(nCtx(), p1.NativeObject(), p2.NativeObject())); } /** @@ -3208,7 +3165,7 @@ import java.lang.Exception; CheckContextMatch(p1); CheckContextMatch(p2); - return new Probe(this, Native.probeAnd(nCtx, p1.NativeObject, p2.NativeObject)); + return new Probe(this, Native.probeAnd(nCtx(), p1.NativeObject(), p2.NativeObject())); } /** @@ -3223,7 +3180,7 @@ import java.lang.Exception; CheckContextMatch(p1); CheckContextMatch(p2); - return new Probe(this, Native.probeOr(nCtx, p1.NativeObject, p2.NativeObject)); + return new Probe(this, Native.probeOr(nCtx(), p1.NativeObject(), p2.NativeObject())); } /** @@ -3236,7 +3193,7 @@ import java.lang.Exception; CheckContextMatch(p); - return new Probe(this, Native.probeNot(nCtx, p.NativeObject)); + return new Probe(this, Native.probeNot(nCtx(), p.NativeObject())); } /** @@ -3252,9 +3209,9 @@ import java.lang.Exception; if (logic == null) - return new Solver(this, Native.mkSolver(nCtx)); + return new Solver(this, Native.mkSolver(nCtx())); else - return new Solver(this, Native.mkSolverForLogic(nCtx, logic.NativeObject)); + return new Solver(this, Native.mkSolverForLogic(nCtx(), logic.NativeObject())); } /** @@ -3275,7 +3232,7 @@ import java.lang.Exception; { - return new Solver(this, Native.mkSimpleSolver(nCtx)); + return new Solver(this, Native.mkSimpleSolver(nCtx())); } /** @@ -3290,7 +3247,7 @@ import java.lang.Exception; - return new Solver(this, Native.mkSolverFromTactic(nCtx, t.NativeObject)); + return new Solver(this, Native.mkSolverFromTactic(nCtx(), t.NativeObject())); } /** @@ -3343,13 +3300,13 @@ import java.lang.Exception; { - return Native.simplifyGetHelp(nCtx); + return Native.simplifyGetHelp(nCtx()); } /** * Retrieves parameter descriptions for simplifier. **/ - public ParamDescrs SimplifyParameterDescriptions() { return new ParamDescrs(this, Native.simplifyGetParamDescrs(nCtx)); } + public ParamDescrs SimplifyParameterDescriptions() { return new ParamDescrs(this, Native.simplifyGetParamDescrs(nCtx())); } /** * Enable/disable printing of warning messages to the console. @@ -3358,7 +3315,7 @@ import java.lang.Exception; **/ public static void ToggleWarningMessages(boolean enabled) { - Native.toggleWarningMessages((enabled) ? 1 : 0); + Native.toggleWarningMessages((enabled) ? true : false); } ///// @@ -3387,7 +3344,7 @@ import java.lang.Exception; **/ public void UpdateParamValue(String id, String value) { - Native.updateParamValue(nCtx, id, value); + Native.updateParamValue(nCtx(), id, value); } /** @@ -3400,8 +3357,8 @@ import java.lang.Exception; public String GetParamValue(String id) { long res = 0; - int r = Native.getParamValue(nCtx, id, res); - if (r == (int)Z3_lbool.Z3_L_FALSE) + int r = Native.getParamValue(nCtx(), id, res); + if (r == Z3_lbool.Z3_L_FALSE.toInt()) return null; else return Marshal.PtrToStringAnsi(res); @@ -3439,7 +3396,7 @@ import java.lang.Exception; if (arr != null) { - for (Iterator a = arr.iterator(); a.hasNext(); ) + for (Z3Object a: arr) { // It was an assume, now we added the precondition, and we made it into an assert CheckContextMatch(a); @@ -3499,7 +3456,7 @@ import java.lang.Exception; Fixedpoint.DecRefQueue Fixedpoint_DRQ () { return m_Fixedpoint_DRQ; } - long refCount = 0; + int refCount = 0; /** * Finalizer. diff --git a/src/api/java/com/Microsoft/Z3/DatatypeExpr.java b/src/api/java/com/Microsoft/Z3/DatatypeExpr.java index 4b18635cc..32835baf5 100644 --- a/src/api/java/com/Microsoft/Z3/DatatypeExpr.java +++ b/src/api/java/com/Microsoft/Z3/DatatypeExpr.java @@ -7,6 +7,7 @@ package com.Microsoft.Z3; import java.math.BigInteger; import java.util.*; import java.lang.Exception; +import com.Microsoft.Z3.Enumerations.*; /* using System; */ /* using System.Collections.Generic; */ /* using System.Linq; */ diff --git a/src/api/java/com/Microsoft/Z3/DatatypeSort.java b/src/api/java/com/Microsoft/Z3/DatatypeSort.java index c108c3de9..4d2dd8992 100644 --- a/src/api/java/com/Microsoft/Z3/DatatypeSort.java +++ b/src/api/java/com/Microsoft/Z3/DatatypeSort.java @@ -7,6 +7,7 @@ package com.Microsoft.Z3; import java.math.BigInteger; import java.util.*; import java.lang.Exception; +import com.Microsoft.Z3.Enumerations.*; /* using System; */ @@ -18,7 +19,7 @@ import java.lang.Exception; /** * The number of constructors of the datatype sort. **/ - public long NumConstructors() { return Native.getDatatypeSortNumConstructors(Context().nCtx(), NativeObject()); } + public int NumConstructors() { return Native.getDatatypeSortNumConstructors(Context().nCtx(), NativeObject()); } /** * The constructors. @@ -27,10 +28,10 @@ import java.lang.Exception; { - long n = NumConstructors; + int n = NumConstructors(); FuncDecl[] res = new FuncDecl[n]; - for (long i; i < n; i++) - res[i] = new FuncDecl(Context, Native.getDatatypeSortConstructor(Context().nCtx(), NativeObject(), i)); + for (int i = 0; i < n; i++) + res[i] = new FuncDecl(Context(), Native.getDatatypeSortConstructor(Context().nCtx(), NativeObject(), i)); return res; } @@ -41,10 +42,10 @@ import java.lang.Exception; { - long n = NumConstructors; + int n = NumConstructors(); FuncDecl[] res = new FuncDecl[n]; - for (long i; i < n; i++) - res[i] = new FuncDecl(Context, Native.getDatatypeSortRecognizer(Context().nCtx(), NativeObject(), i)); + for (int i = 0; i < n; i++) + res[i] = new FuncDecl(Context(), Native.getDatatypeSortRecognizer(Context().nCtx(), NativeObject(), i)); return res; } @@ -55,15 +56,15 @@ import java.lang.Exception; { - long n = NumConstructors; + int n = NumConstructors(); FuncDecl[][] res = new FuncDecl[n][]; - for (long i; i < n; i++) + for (int i = 0; i < n; i++) { - FuncDecl fd = new FuncDecl(Context, Native.getDatatypeSortConstructor(Context().nCtx(), NativeObject(), i)); - long ds = fd.DomainSize; + FuncDecl fd = new FuncDecl(Context(), Native.getDatatypeSortConstructor(Context().nCtx(), NativeObject(), i)); + int ds = fd.DomainSize; FuncDecl[] tmp = new FuncDecl[ds]; - for (long j; j < ds; j++) - tmp[j] = new FuncDecl(Context, Native.getDatatypeSortConstructorAccessor(Context().nCtx(), NativeObject(), i, j)); + for (int j = 0; j < ds; j++) + tmp[j] = new FuncDecl(Context(), Native.getDatatypeSortConstructorAccessor(Context().nCtx(), NativeObject(), i, j)); res[i] = tmp; } return res; @@ -72,7 +73,7 @@ import java.lang.Exception; DatatypeSort(Context ctx, long obj) { super(ctx, obj); { }} DatatypeSort(Context ctx, Symbol name, Constructor[] constructors) - { super(ctx, Native.mkDatatype(ctx.nCtx(), name.NativeObject, (long)constructors.Length, ArrayToNative(constructors))); + { super(ctx, Native.mkDatatype(ctx.nCtx(), name.NativeObject(), (int)constructors.length, ArrayToNative(constructors))); diff --git a/src/api/java/com/Microsoft/Z3/EnumSort.java b/src/api/java/com/Microsoft/Z3/EnumSort.java index 77e0ac057..cfb9d099a 100644 --- a/src/api/java/com/Microsoft/Z3/EnumSort.java +++ b/src/api/java/com/Microsoft/Z3/EnumSort.java @@ -7,6 +7,7 @@ package com.Microsoft.Z3; import java.math.BigInteger; import java.util.*; import java.lang.Exception; +import com.Microsoft.Z3.Enumerations.*; /* using System; */ @@ -64,19 +65,19 @@ import java.lang.Exception; - int n = enumNames.Length; + int n = enumNames.length; long[] n_constdecls = new long[n]; long[] n_testers = new long[n]; - NativeObject() = Native.mkEnumerationSort(ctx.nCtx(), name.NativeObject, (long)n, + NativeObject() = Native.mkEnumerationSort(ctx.nCtx(), name.NativeObject(), (int)n, Symbol.ArrayToNative(enumNames), n_constdecls, n_testers); _constdecls = new FuncDecl[n]; - for (long i; i < n; i++) + for (int i = 0; i < n; i++) _constdecls[i] = new FuncDecl(ctx, n_constdecls[i]); _testerdecls = new FuncDecl[n]; - for (long i; i < n; i++) + for (int i = 0; i < n; i++) _testerdecls[i] = new FuncDecl(ctx, n_testers[i]); _consts = new Expr[n]; - for (long i; i < n; i++) + for (int i = 0; i < n; i++) _consts[i] = ctx.MkApp(_constdecls[i]); } }; diff --git a/src/api/java/com/Microsoft/Z3/Enumerations/Z3_ast_kind.class b/src/api/java/com/Microsoft/Z3/Enumerations/Z3_ast_kind.class new file mode 100644 index 0000000000000000000000000000000000000000..b94349266d87b21f5cf6913260d2d8b2706e7ef0 GIT binary patch literal 1554 zcmah}U2_s=6n@e7Joti zMDIGi=}j*zw$*8;j@O;(?`VHQuWZkGp-QKYVVLveIqx~|dCoa6`R(P;&jGBV5`c%08lVhh^&Nr?X@}-fBW6IUt!d`CdU=g|7w@0T&+x2Qr zXV4N5MFD-KmMc{Yw!qToC&|+uab92GTrzcHu$u4QryA3xw%aNXjt^SBednM<9$ns2 zITTn;mL52doNUK&kFvJcYr97qsS`zPw%xY3C9v>@>|!xh6A0MtBiHc;J*uWArAt5T zb&rd#$J&c0)|j$Ar}=Q#`9eyj_aWf-x-wl!rf6!$X0tPvK@KW;d7_hoJ2>8admCG{ zY}4)zdd=2On}@<{{P!VT;-OeL&(Ctj!Yz~p;%|F77E;)?kU`nPIV@YafOnW)v=Bwi z!WlMkHVHP1Y?j!ZMNA;{dIzkWT5Wc^E@?WIOigrEIe5@&dZhd6JIZnaLQ*V|L`x*y5=pv5QZJDjpv)QW8VJXDX2dlF zcmxo5m)J5Pf6O7oPw>5f@|c)FlB_1rOo~q-J&r#QpY#T2p{Ad~{{rg&6MQ^g3giM8 zp->BemCnSULQ5xpg#P`j5+OPT=BU&>f>^+N#C*6!t!8m~T(U_XKlwAyV3ab?uPIxJ z_&11U607TKRQ&;Z>}zOI_3@XA`1bEVC`eglNj}-bj4U3*EKQB)a)DNTg-)sPO9XVR z3NiN=T_2(Udhd@5CJ1>d{xn_w9sMymjwKkliVw!2ze{DnSHD25&jb|zQl+03f z$)+R=`8CO=B@1g2J>JU?Q-9N;% zUDt+)*mZq~S-WlwF=yAq*w_wuDMho~5 KA5p9iAO8c?E;F(K literal 0 HcmV?d00001 diff --git a/src/api/java/com/Microsoft/Z3/Enumerations/Z3_ast_kind.java b/src/api/java/com/Microsoft/Z3/Enumerations/Z3_ast_kind.java index 2ba3f58ab..66841c073 100644 --- a/src/api/java/com/Microsoft/Z3/Enumerations/Z3_ast_kind.java +++ b/src/api/java/com/Microsoft/Z3/Enumerations/Z3_ast_kind.java @@ -8,12 +8,26 @@ package com.Microsoft.Z3; * Z3_ast_kind **/ public enum Z3_ast_kind { -Z3_VAR_AST (2), -Z3_SORT_AST (4), -Z3_QUANTIFIER_AST (3), -Z3_UNKNOWN_AST (1000), -Z3_FUNC_DECL_AST (5), -Z3_NUMERAL_AST (0), -Z3_APP_AST (1), + Z3_VAR_AST (2), + Z3_SORT_AST (4), + Z3_QUANTIFIER_AST (3), + Z3_UNKNOWN_AST (1000), + Z3_FUNC_DECL_AST (5), + Z3_NUMERAL_AST (0), + Z3_APP_AST (1); + + private final int intValue; + + Z3_ast_kind(int v) { + this.intValue = v; + } + + public static final Z3_ast_kind fromInt(int v) { + for (Z3_ast_kind k: values()) + if (k.intValue == v) return k; + return values()[0]; + } + + public final int toInt() { return this.intValue; } } diff --git a/src/api/java/com/Microsoft/Z3/Enumerations/Z3_ast_print_mode.class b/src/api/java/com/Microsoft/Z3/Enumerations/Z3_ast_print_mode.class new file mode 100644 index 0000000000000000000000000000000000000000..b146851186dd99083b4d89fb22e2806242d7b710 GIT binary patch literal 1450 zcma)5Sx*yD6#i~!I@4v?3beFrr?>unPGUY%!w-0$_+JR1PXB_ZyJL`at+c_2U41w+O)W+lZS|VkvCiM8ySSq%@ zx}nDx*Afhadb*g8u4dDvV!60$MYqT4O_^mYbx_I{tW>`EJTt@KztW?=MaR{>l}%k| z@LYuT^(QHPIk`+h2lY&vxk`qC#TnGWpi-yj{4$8eKYMeMmKzYn)+`2(ugXGyTM1XH&xHd9P5j({rr*P0Us*)M;98h8!GFCV><*xO$}C`lUQkZgj3M-2B-`!4c*qIHmVY4ACmDng8P{-pM8 z2qRJ($hG0B*u&KP9evcx(E|r@x?4+qDUbnAzd+vdI3?u-u4A}`r^$BVH3_fTE(xzi zc&&;oyf*bK6-rgOjV-x~CS%K9MT@beRMBP}gIy}+6_eZqoL|i*g4>KKxQON-%|;Lv Hr0@L(7U?iQ literal 0 HcmV?d00001 diff --git a/src/api/java/com/Microsoft/Z3/Enumerations/Z3_ast_print_mode.java b/src/api/java/com/Microsoft/Z3/Enumerations/Z3_ast_print_mode.java index 4aa4a2716..bfbbadd96 100644 --- a/src/api/java/com/Microsoft/Z3/Enumerations/Z3_ast_print_mode.java +++ b/src/api/java/com/Microsoft/Z3/Enumerations/Z3_ast_print_mode.java @@ -8,9 +8,23 @@ package com.Microsoft.Z3; * Z3_ast_print_mode **/ public enum Z3_ast_print_mode { -Z3_PRINT_SMTLIB2_COMPLIANT (3), -Z3_PRINT_SMTLIB_COMPLIANT (2), -Z3_PRINT_SMTLIB_FULL (0), -Z3_PRINT_LOW_LEVEL (1), + Z3_PRINT_SMTLIB2_COMPLIANT (3), + Z3_PRINT_SMTLIB_COMPLIANT (2), + Z3_PRINT_SMTLIB_FULL (0), + Z3_PRINT_LOW_LEVEL (1); + + private final int intValue; + + Z3_ast_print_mode(int v) { + this.intValue = v; + } + + public static final Z3_ast_print_mode fromInt(int v) { + for (Z3_ast_print_mode k: values()) + if (k.intValue == v) return k; + return values()[0]; + } + + public final int toInt() { return this.intValue; } } diff --git a/src/api/java/com/Microsoft/Z3/Enumerations/Z3_decl_kind.class b/src/api/java/com/Microsoft/Z3/Enumerations/Z3_decl_kind.class new file mode 100644 index 0000000000000000000000000000000000000000..6ba48582b09a7ce99f5d1804b4315c22fd15a14f GIT binary patch literal 11227 zcmai)2Y6i7vBzh2@7+C;W&0fWiW|ngV~o33(n?x;rImLj+j3jWa+8bXPBHEc<8IS? z@Ac3j^xj(t=?NhO(nAOV!b^BFbC0y*z4tx7kMIA}{oiv>otb+j^Xh*ddlCS~gihvx zhkwq;zu;e^_(2r^mX8zgGnT*eozL@0{-JOp^9y$VscVdPW*UWanC%qSFxxAf%j}?V z90tkqXaZj#79wbF{*9m}3;4%RF7-7Uo!m=P}PvxRp6h;Wp-(3b!-I zE8M}Hpl~O1qQYIwNeXu}Co9~;oT6|qbE?99%xMbuGh+(RXBH|vz${XD0kc@)L1tXx zA!dof!^~2JN0?;_k1`Vqk1?k!JkFe<@B}ldkYhYluJA%;g~E%NDTNm^D-~YCoT>0q zW?JE8%#6aznN(?N%tZ=sVb&_VmAP2qZOl4_w=8G^h9hyl|MM*YO6(g^8;H6{P>8V5of(ovaG|RTZ zkC}K?mS&own{HOrL3KrOyrlVQ9y(S*Gi!R9Ms{tfWA|{=R9Y^fusR(tAKARRRD32v z$L3jqVBBsG=jwq>|O#8A3ZZK&mQM70;#~g|3{N*?$n)2F&|-3s9VM0 zqw;FnOqY;Btd++qn`iDO>Q+blR#sD)sw#_T5|lUYDN4k2ydqYfTaaX|%m1nr-Q~#o z?qVua)IlzE=!x$hIOS6=yQ(QvY4)y1nne&;O}kqm<8^J$ZjKzP4b_==aduWL{hgUM zC9Zq6q&Ul)p9_?Dd1Z?zk`!^<8LOzy#iQ(6)25g5e!9|G$VW|c%`L5}EK4C@9?KoY z98McIWN{)>m8jrY$>lI-UP&yO$yK7lS)-*OyP&7Ko&8Rr(+KGp&&n-JGKOxu{Gi~cyv@)t6j3BM#}%hXQ+Hf{o4ZR;+9%?4 z5N^vd5~nU2OKF`=AuA{8(n4NnZkuA6tORGvpv%OQl4NdCGNGncO|!_z3A%xJrk$Fj zgd#c4Z%!)1vuFnHiCC!|b1vX3t21RyWwyCjiOyU=^MT15#?6*?%N@CE!)1XEfY7|7 zO|y3`D2Xc5sp+zyrp=IqcLz{io}hqkE*Y}9?iOX31V?VpO|>gS!!_-=1gTpT)u*@g53Vo zyP&+9UU=WF+wziY&ZQvlTf9JuX{+N@ZHjWaL2DmfNN+M1HIiJpTF~-MADmJ1?s7Ue zohVnBmhY7E6uk~o6^SBwr{q$TUmLMGiB#@Um#A)CEi%)+#ydCf5T|-NQAqFn;7#R% zC6g$v2)@K}!(?WpD1Z`kb8%V7ug>Pz44qQTSE;IR*f^_p^`@l=m_Uf0IxCi}=5*^l z?|VNYBb)ib4G4V)4*LGqUQy!`8l`QrzF}#_rZtO~uCJ~3YE?eKY zCeg5wXP@}~L0V@v*4C{muU#vXravhl_!}GL`S8F&v~y}w-D)=vGHA?EE!Glm*tBNS z_bg-zeU|5E8aJ)4TUt`j`@%WU{LMa`H>Lo8#DB~9pdfTKbPS>A|NE6+fIkl%FTh`h zP88q|@%;k)G5&-u@mB>n5hoSkWR@u`Q(305#8?Vhidc$S;w&XBr7UGE36|+BGgy)= znJj6R3`-SDHOnlP*(`HdYFOs7%ww6)vVdhFOO|C3OD)S{mO7RtEK6CI zu`Fj;ImB|9kFq?*@;J*6Se{^clI1Cur&*q1d6wllmgiYs zV0n?{C69lIljSXzw^`m{d6(rqoJ1c^x$43hNhw^ny0L*$t;4`U zEwVMWc;(W%jg*dKTNad})wLToOl;Atxj=olS9-2f%jaA(Dmv3f(ccFr(4QwSpVpOg z5P&$@af;(q$7zl+$3n*<$7090V~Jy_W0_;Zak}FS$E0JqV})bNvC?s-W7;v}NVzQY zr*sxlMhhvag_PGqN^K!!w{V^#<+xlga9rq^bzJ0F>$upl&T)z3QpaVE%Ng#8Y0(Q9k)4d zciiE)({Y#MZpS^2dmZ;V?sq)j@qpt6jt3nNIUaUA;&{~YnB#HB6OJbxsTRrnsT>KZ zA_=J|38^j#sWb_xItj0Eq#7mHS2^a-i@2_JW)8YtIKI6mq4 zl;hKm&p1Bo_?+YOjxRXA==hT3%Z{%&zUugzN5e_#PA5@h1g< z?#5pvbRB^_{=NXjpVC!dKvIBw3-}O(o`&$fbcOgc(umy4r}jU`U%2-DAS7<9_TUYE z1pKGL``-_Q_}c|SGQdy>gGZee3?9!L9gfx(eZk z&=r4!AGsmxXh@&@A&-Dc4ta8NcuLP6*F(1lwA-~1>FV9PCycjz`w2A) zkLD?bWDV_P@H?PA+zGwl4(Jbe;cw|K4g4R-i{i(K9lxUP4gL;4aRc_G74ok5gQ@d7 z>4%ovaW5$R6n`HyHDQ?251ak}nk z{NRzXVw|BnnMi@O7$?S=y0h_46=S>@6Lc37QDRIKW0LM_ykH9_i!nuaGu|L+F;$Fd zy1VfPixCr}Q1>u?7cq*&DAqlVH&l$c7$y1?6AmU;Dn^;^W&B{2gc#FxZ{r8YFhh)_ z?qmF5wdG<|=)NWttTrV^rS50^;9O>kk=CagzpD(J5u-}?H&GO$T8vrxG~;y>W40J` z^Z?@r5mY0_Ts_cWaB}m+n6C$!aIirO#8{{Y8?U$YkriW+9%B5~V$_PUSPwNAgl(M| zOY|_~4U`s3#aO0?8$W2VT#OZZgz%>^EPd8p?F*b;?QIDm6LKS0^7@PGOCLApPEHTd3N8Cw z*pDq@oTtYduaoq#Rg7(Vg7Jokv0aQEdZO|Bh_O?QU3!x7gSG4yV~?I}JR>dkim^{m zF)dUpr;uOjDunv(lO%&Q$H-m5nX7)K{y;0h;o!r>Y*uGKS)7Z}%xalK9&KUnPzV%(_9jTfBlO=8@vD~#V>rhbbUx9XIM1OaoK z7`N+66A3!KLySB1OcMz@y-SR{b=ri2aJWZ|dv(Tyg8jHp46Cb5C|LgeVmzR$jTa32 zpcoJ7S;h;N|F9U3=-I{(>e!=VJf`OukKS8U(jOP&2fD^!a12j~@uZ$>{2=F^660w- z&v+x{k!QqsR?j!yFfpDJ<9WTn_(6QUAjXS&q49!qc}a|yb=LSnIJ_dpt9p^~dPyIz ziSfFwHC{h4-VozWz1a92#CS`Lw{@LS!G63W#=Cln2?e9PC&mx;QsV_%_`VoF(#s46 z#s^~jST8qTJL&W%V*FIEFri@iKNI8Uy54v}QTl}#ztk%Y2DR{4V*FaKGU1@p55@S6 zUTq>lrTa*X-|96c9IWkL zOgI?jYcc+%&o+@@V&91IU-}&51sn8lG5({^HKCxue#=IC`Ztm-CL}3^7&sw)o(ajz z0K8-}^$m>Hta3Xq}@#K6l8aPUCHz5fl%nO`+13Qd2S{`c^SOo@lnuu&JwhpW| z26h>5l(cFaSlYmDqk>i@u-X~eV|usRvoXMFkKz|Miy#lU{! z1#|BjSltYqZ@gg1-2l6bQ7;l7h-z%_s8#rh%m_(nz>TBST@%u}w zet~tWfy2g=P{;m(b((=A#tR-C5Lg2Z95ue2CJqX$!3K^QU(y?g1lCXk#|_F6m#kk1lH*WE;7D+j^Nn9I>W%l#*@Isae;NF zflEw85(LK^xbz7MlCXtVnHtYR>r9Prp>3unV!>o;q88d`YLtbJnHo)2X99U$31oIB z%5DF~xBeb^ApU}p_076>}g9zHf5Q4EVjL^=)2ts=cqX-==j3IQi zFqY8C!Z<=_3*!l0EKDSHwJ@2`&B9bdcMCB>4+}+vo)+SSQ!JDcdRa&idRv%5=wqRr z(APqW(9gn5!l@QAg#H$)38z_@O&DOIhA_~=Ji;Ig3kZWPWC=qo)DnhTs3Q!su#_;| z!g9h03-yGN7FH2PSy)3DZK07c#=<(n=@vE+##-1!IK#qOgmD(mA)IMp3t_y4t%L~{ zwi6~=*h!dVVK-s2g}sC+7WNaSS~x(MX5kFbE&PhG z%EE_))fPS?tg-Mhp~1o@ghmU$C#<#bN5VP_e$-)O zcj$pbp(jp;Q?LShVHSGhTIhp2p)a0*es}|%iVr}4d;w0wAHe|nJ$fL11%pC)FgVl= zhJ=Q|(9k3p7Al9~p@lFa)CeO(J784kIE)TmPyYkx{cw8dc^DgdAI=E<4#tJPgfqhm z#)rGYgz#XP7@i1|!bzAMUI0_V4KOvl9j1kkK`eY76jGrq3O@(M;U7Xg{4tb-{|TjD z6w16Vknje!&$iEkA{byjY|1Q+|AHfp;AFwpy z!?H*xSRNSwDIH8e)0dg z8>1dz$#JECvH&gh4* zEBbfXt-`QJb%4F9KkQTEV82Sh`Dz{C_7Ou>DAFjt2$u k2Cm6(1J~yFf$Q>5hwJl8A)o%z@@tB-5dH!GDE!lZ1Dv6rng9R* literal 0 HcmV?d00001 diff --git a/src/api/java/com/Microsoft/Z3/Enumerations/Z3_decl_kind.java b/src/api/java/com/Microsoft/Z3/Enumerations/Z3_decl_kind.java index 3b0b01715..c9ae9aa35 100644 --- a/src/api/java/com/Microsoft/Z3/Enumerations/Z3_decl_kind.java +++ b/src/api/java/com/Microsoft/Z3/Enumerations/Z3_decl_kind.java @@ -8,157 +8,171 @@ package com.Microsoft.Z3; * Z3_decl_kind **/ public enum Z3_decl_kind { -Z3_OP_LABEL (1792), -Z3_OP_PR_REWRITE (1294), -Z3_OP_UNINTERPRETED (2051), -Z3_OP_SUB (519), -Z3_OP_ZERO_EXT (1058), -Z3_OP_ADD (518), -Z3_OP_IS_INT (528), -Z3_OP_BREDOR (1061), -Z3_OP_BNOT (1051), -Z3_OP_BNOR (1054), -Z3_OP_PR_CNF_STAR (1315), -Z3_OP_RA_JOIN (1539), -Z3_OP_LE (514), -Z3_OP_SET_UNION (773), -Z3_OP_PR_UNDEF (1280), -Z3_OP_BREDAND (1062), -Z3_OP_LT (516), -Z3_OP_RA_UNION (1540), -Z3_OP_BADD (1028), -Z3_OP_BUREM0 (1039), -Z3_OP_OEQ (267), -Z3_OP_PR_MODUS_PONENS (1284), -Z3_OP_RA_CLONE (1548), -Z3_OP_REPEAT (1060), -Z3_OP_RA_NEGATION_FILTER (1544), -Z3_OP_BSMOD0 (1040), -Z3_OP_BLSHR (1065), -Z3_OP_BASHR (1066), -Z3_OP_PR_UNIT_RESOLUTION (1304), -Z3_OP_ROTATE_RIGHT (1068), -Z3_OP_ARRAY_DEFAULT (772), -Z3_OP_PR_PULL_QUANT (1296), -Z3_OP_PR_APPLY_DEF (1310), -Z3_OP_PR_REWRITE_STAR (1295), -Z3_OP_IDIV (523), -Z3_OP_PR_GOAL (1283), -Z3_OP_PR_IFF_TRUE (1305), -Z3_OP_LABEL_LIT (1793), -Z3_OP_BOR (1050), -Z3_OP_PR_SYMMETRY (1286), -Z3_OP_TRUE (256), -Z3_OP_SET_COMPLEMENT (776), -Z3_OP_CONCAT (1056), -Z3_OP_PR_NOT_OR_ELIM (1293), -Z3_OP_IFF (263), -Z3_OP_BSHL (1064), -Z3_OP_PR_TRANSITIVITY (1287), -Z3_OP_SGT (1048), -Z3_OP_RA_WIDEN (1541), -Z3_OP_PR_DEF_INTRO (1309), -Z3_OP_NOT (265), -Z3_OP_PR_QUANT_INTRO (1290), -Z3_OP_UGT (1047), -Z3_OP_DT_RECOGNISER (2049), -Z3_OP_SET_INTERSECT (774), -Z3_OP_BSREM (1033), -Z3_OP_RA_STORE (1536), -Z3_OP_SLT (1046), -Z3_OP_ROTATE_LEFT (1067), -Z3_OP_PR_NNF_NEG (1313), -Z3_OP_PR_REFLEXIVITY (1285), -Z3_OP_ULEQ (1041), -Z3_OP_BIT1 (1025), -Z3_OP_BIT0 (1026), -Z3_OP_EQ (258), -Z3_OP_BMUL (1030), -Z3_OP_ARRAY_MAP (771), -Z3_OP_STORE (768), -Z3_OP_PR_HYPOTHESIS (1302), -Z3_OP_RA_RENAME (1545), -Z3_OP_AND (261), -Z3_OP_TO_REAL (526), -Z3_OP_PR_NNF_POS (1312), -Z3_OP_PR_AND_ELIM (1292), -Z3_OP_MOD (525), -Z3_OP_BUDIV0 (1037), -Z3_OP_PR_TRUE (1281), -Z3_OP_BNAND (1053), -Z3_OP_PR_ELIM_UNUSED_VARS (1299), -Z3_OP_RA_FILTER (1543), -Z3_OP_FD_LT (1549), -Z3_OP_RA_EMPTY (1537), -Z3_OP_DIV (522), -Z3_OP_ANUM (512), -Z3_OP_MUL (521), -Z3_OP_UGEQ (1043), -Z3_OP_BSREM0 (1038), -Z3_OP_PR_TH_LEMMA (1318), -Z3_OP_BXOR (1052), -Z3_OP_DISTINCT (259), -Z3_OP_PR_IFF_FALSE (1306), -Z3_OP_BV2INT (1072), -Z3_OP_EXT_ROTATE_LEFT (1069), -Z3_OP_PR_PULL_QUANT_STAR (1297), -Z3_OP_BSUB (1029), -Z3_OP_PR_ASSERTED (1282), -Z3_OP_BXNOR (1055), -Z3_OP_EXTRACT (1059), -Z3_OP_PR_DER (1300), -Z3_OP_DT_CONSTRUCTOR (2048), -Z3_OP_GT (517), -Z3_OP_BUREM (1034), -Z3_OP_IMPLIES (266), -Z3_OP_SLEQ (1042), -Z3_OP_GE (515), -Z3_OP_BAND (1049), -Z3_OP_ITE (260), -Z3_OP_AS_ARRAY (778), -Z3_OP_RA_SELECT (1547), -Z3_OP_CONST_ARRAY (770), -Z3_OP_BSDIV (1031), -Z3_OP_OR (262), -Z3_OP_PR_HYPER_RESOLVE (1319), -Z3_OP_AGNUM (513), -Z3_OP_PR_PUSH_QUANT (1298), -Z3_OP_BSMOD (1035), -Z3_OP_PR_IFF_OEQ (1311), -Z3_OP_PR_LEMMA (1303), -Z3_OP_SET_SUBSET (777), -Z3_OP_SELECT (769), -Z3_OP_RA_PROJECT (1542), -Z3_OP_BNEG (1027), -Z3_OP_UMINUS (520), -Z3_OP_REM (524), -Z3_OP_TO_INT (527), -Z3_OP_PR_QUANT_INST (1301), -Z3_OP_SGEQ (1044), -Z3_OP_POWER (529), -Z3_OP_XOR3 (1074), -Z3_OP_RA_IS_EMPTY (1538), -Z3_OP_CARRY (1073), -Z3_OP_DT_ACCESSOR (2050), -Z3_OP_PR_TRANSITIVITY_STAR (1288), -Z3_OP_PR_NNF_STAR (1314), -Z3_OP_PR_COMMUTATIVITY (1307), -Z3_OP_ULT (1045), -Z3_OP_BSDIV0 (1036), -Z3_OP_SET_DIFFERENCE (775), -Z3_OP_INT2BV (1071), -Z3_OP_XOR (264), -Z3_OP_PR_MODUS_PONENS_OEQ (1317), -Z3_OP_BNUM (1024), -Z3_OP_BUDIV (1032), -Z3_OP_PR_MONOTONICITY (1289), -Z3_OP_PR_DEF_AXIOM (1308), -Z3_OP_FALSE (257), -Z3_OP_EXT_ROTATE_RIGHT (1070), -Z3_OP_PR_DISTRIBUTIVITY (1291), -Z3_OP_SIGN_EXT (1057), -Z3_OP_PR_SKOLEMIZE (1316), -Z3_OP_BCOMP (1063), -Z3_OP_RA_COMPLEMENT (1546), + Z3_OP_LABEL (1792), + Z3_OP_PR_REWRITE (1294), + Z3_OP_UNINTERPRETED (2051), + Z3_OP_SUB (519), + Z3_OP_ZERO_EXT (1058), + Z3_OP_ADD (518), + Z3_OP_IS_INT (528), + Z3_OP_BREDOR (1061), + Z3_OP_BNOT (1051), + Z3_OP_BNOR (1054), + Z3_OP_PR_CNF_STAR (1315), + Z3_OP_RA_JOIN (1539), + Z3_OP_LE (514), + Z3_OP_SET_UNION (773), + Z3_OP_PR_UNDEF (1280), + Z3_OP_BREDAND (1062), + Z3_OP_LT (516), + Z3_OP_RA_UNION (1540), + Z3_OP_BADD (1028), + Z3_OP_BUREM0 (1039), + Z3_OP_OEQ (267), + Z3_OP_PR_MODUS_PONENS (1284), + Z3_OP_RA_CLONE (1548), + Z3_OP_REPEAT (1060), + Z3_OP_RA_NEGATION_FILTER (1544), + Z3_OP_BSMOD0 (1040), + Z3_OP_BLSHR (1065), + Z3_OP_BASHR (1066), + Z3_OP_PR_UNIT_RESOLUTION (1304), + Z3_OP_ROTATE_RIGHT (1068), + Z3_OP_ARRAY_DEFAULT (772), + Z3_OP_PR_PULL_QUANT (1296), + Z3_OP_PR_APPLY_DEF (1310), + Z3_OP_PR_REWRITE_STAR (1295), + Z3_OP_IDIV (523), + Z3_OP_PR_GOAL (1283), + Z3_OP_PR_IFF_TRUE (1305), + Z3_OP_LABEL_LIT (1793), + Z3_OP_BOR (1050), + Z3_OP_PR_SYMMETRY (1286), + Z3_OP_TRUE (256), + Z3_OP_SET_COMPLEMENT (776), + Z3_OP_CONCAT (1056), + Z3_OP_PR_NOT_OR_ELIM (1293), + Z3_OP_IFF (263), + Z3_OP_BSHL (1064), + Z3_OP_PR_TRANSITIVITY (1287), + Z3_OP_SGT (1048), + Z3_OP_RA_WIDEN (1541), + Z3_OP_PR_DEF_INTRO (1309), + Z3_OP_NOT (265), + Z3_OP_PR_QUANT_INTRO (1290), + Z3_OP_UGT (1047), + Z3_OP_DT_RECOGNISER (2049), + Z3_OP_SET_INTERSECT (774), + Z3_OP_BSREM (1033), + Z3_OP_RA_STORE (1536), + Z3_OP_SLT (1046), + Z3_OP_ROTATE_LEFT (1067), + Z3_OP_PR_NNF_NEG (1313), + Z3_OP_PR_REFLEXIVITY (1285), + Z3_OP_ULEQ (1041), + Z3_OP_BIT1 (1025), + Z3_OP_BIT0 (1026), + Z3_OP_EQ (258), + Z3_OP_BMUL (1030), + Z3_OP_ARRAY_MAP (771), + Z3_OP_STORE (768), + Z3_OP_PR_HYPOTHESIS (1302), + Z3_OP_RA_RENAME (1545), + Z3_OP_AND (261), + Z3_OP_TO_REAL (526), + Z3_OP_PR_NNF_POS (1312), + Z3_OP_PR_AND_ELIM (1292), + Z3_OP_MOD (525), + Z3_OP_BUDIV0 (1037), + Z3_OP_PR_TRUE (1281), + Z3_OP_BNAND (1053), + Z3_OP_PR_ELIM_UNUSED_VARS (1299), + Z3_OP_RA_FILTER (1543), + Z3_OP_FD_LT (1549), + Z3_OP_RA_EMPTY (1537), + Z3_OP_DIV (522), + Z3_OP_ANUM (512), + Z3_OP_MUL (521), + Z3_OP_UGEQ (1043), + Z3_OP_BSREM0 (1038), + Z3_OP_PR_TH_LEMMA (1318), + Z3_OP_BXOR (1052), + Z3_OP_DISTINCT (259), + Z3_OP_PR_IFF_FALSE (1306), + Z3_OP_BV2INT (1072), + Z3_OP_EXT_ROTATE_LEFT (1069), + Z3_OP_PR_PULL_QUANT_STAR (1297), + Z3_OP_BSUB (1029), + Z3_OP_PR_ASSERTED (1282), + Z3_OP_BXNOR (1055), + Z3_OP_EXTRACT (1059), + Z3_OP_PR_DER (1300), + Z3_OP_DT_CONSTRUCTOR (2048), + Z3_OP_GT (517), + Z3_OP_BUREM (1034), + Z3_OP_IMPLIES (266), + Z3_OP_SLEQ (1042), + Z3_OP_GE (515), + Z3_OP_BAND (1049), + Z3_OP_ITE (260), + Z3_OP_AS_ARRAY (778), + Z3_OP_RA_SELECT (1547), + Z3_OP_CONST_ARRAY (770), + Z3_OP_BSDIV (1031), + Z3_OP_OR (262), + Z3_OP_PR_HYPER_RESOLVE (1319), + Z3_OP_AGNUM (513), + Z3_OP_PR_PUSH_QUANT (1298), + Z3_OP_BSMOD (1035), + Z3_OP_PR_IFF_OEQ (1311), + Z3_OP_PR_LEMMA (1303), + Z3_OP_SET_SUBSET (777), + Z3_OP_SELECT (769), + Z3_OP_RA_PROJECT (1542), + Z3_OP_BNEG (1027), + Z3_OP_UMINUS (520), + Z3_OP_REM (524), + Z3_OP_TO_INT (527), + Z3_OP_PR_QUANT_INST (1301), + Z3_OP_SGEQ (1044), + Z3_OP_POWER (529), + Z3_OP_XOR3 (1074), + Z3_OP_RA_IS_EMPTY (1538), + Z3_OP_CARRY (1073), + Z3_OP_DT_ACCESSOR (2050), + Z3_OP_PR_TRANSITIVITY_STAR (1288), + Z3_OP_PR_NNF_STAR (1314), + Z3_OP_PR_COMMUTATIVITY (1307), + Z3_OP_ULT (1045), + Z3_OP_BSDIV0 (1036), + Z3_OP_SET_DIFFERENCE (775), + Z3_OP_INT2BV (1071), + Z3_OP_XOR (264), + Z3_OP_PR_MODUS_PONENS_OEQ (1317), + Z3_OP_BNUM (1024), + Z3_OP_BUDIV (1032), + Z3_OP_PR_MONOTONICITY (1289), + Z3_OP_PR_DEF_AXIOM (1308), + Z3_OP_FALSE (257), + Z3_OP_EXT_ROTATE_RIGHT (1070), + Z3_OP_PR_DISTRIBUTIVITY (1291), + Z3_OP_SIGN_EXT (1057), + Z3_OP_PR_SKOLEMIZE (1316), + Z3_OP_BCOMP (1063), + Z3_OP_RA_COMPLEMENT (1546); + + private final int intValue; + + Z3_decl_kind(int v) { + this.intValue = v; + } + + public static final Z3_decl_kind fromInt(int v) { + for (Z3_decl_kind k: values()) + if (k.intValue == v) return k; + return values()[0]; + } + + public final int toInt() { return this.intValue; } } diff --git a/src/api/java/com/Microsoft/Z3/Enumerations/Z3_error_code.class b/src/api/java/com/Microsoft/Z3/Enumerations/Z3_error_code.class new file mode 100644 index 0000000000000000000000000000000000000000..f9d486c4ee9c6aad166284c7a49b18c0422e5d60 GIT binary patch literal 1961 zcma)6T~k|S5Psg|BP*R|+3KU7h0gnv{<^}Ls z3uzU%RAjuE#x|P|`6TNlV{4dU%&})j!&Syz4PnN68X}DMHAETn8e)ul8fF7s zk%l?Ok2S;@KhbcVv7lj|@ly>8j71gu0zG?+1uMOqNLlNJ?L;nTX43-WsZ#wYzEvqT z>c{niW_)jv{tM+squwZ#>JQ7y0$t?TGPg22xxz-mN(t!XNM|TV);6;OE~1&c?YQ&& ziR@-O&b*&Aw{up8O1UY{%G?p?<_~GEpGZ;4T!L~M(${|6j-A*v1^URfVWrGMBAGO8 zyI^Ls87k)|x1Gu6&Ut`%`zhxh&b4kP3t4mH+@)1&&D~=4q%0sT0d<-x?U=T}#Dh0C zzbsN%Pq#nNY6 z#n0ulX@hCR&ALqB3`eMY+DfT<_7HMV(S;5*X6@u?7P+;``_f*F+$~tc2K&Nlu4IOXe9j2=~W^hHvRW@NZ5jIgaF*dVo zuCbY86K8Xs%{-e0T%pCjm=&v|c9g318ojzN9O+P=*?&|nHA&gc&gmqp#pC1UjGb2T*b4TfT&g(W4ZJcT;+HQYhv@fS|<-CuuDkaK~bO>#FHrJ59;e}c2JaL2B-Ir|mDDe3mrIi@AerHIO4cn|kJ`T2D_Ngr=<={%(gDNm zl5|kgw+z+rNFJ1Y$j}V0MvoQS(954nW5!{InrmG^zmg)WAI&!~w1BDGlsP^x-S?<68{iDF*QyyfoDI MhFJK3ayW4JZ;)?(^b literal 0 HcmV?d00001 diff --git a/src/api/java/com/Microsoft/Z3/Enumerations/Z3_error_code.java b/src/api/java/com/Microsoft/Z3/Enumerations/Z3_error_code.java index ef5fa6f2c..0c1c22870 100644 --- a/src/api/java/com/Microsoft/Z3/Enumerations/Z3_error_code.java +++ b/src/api/java/com/Microsoft/Z3/Enumerations/Z3_error_code.java @@ -8,18 +8,32 @@ package com.Microsoft.Z3; * Z3_error_code **/ public enum Z3_error_code { -Z3_INVALID_PATTERN (6), -Z3_MEMOUT_FAIL (7), -Z3_NO_PARSER (5), -Z3_OK (0), -Z3_INVALID_ARG (3), -Z3_EXCEPTION (12), -Z3_IOB (2), -Z3_INTERNAL_FATAL (9), -Z3_INVALID_USAGE (10), -Z3_FILE_ACCESS_ERROR (8), -Z3_SORT_ERROR (1), -Z3_PARSER_ERROR (4), -Z3_DEC_REF_ERROR (11), + Z3_INVALID_PATTERN (6), + Z3_MEMOUT_FAIL (7), + Z3_NO_PARSER (5), + Z3_OK (0), + Z3_INVALID_ARG (3), + Z3_EXCEPTION (12), + Z3_IOB (2), + Z3_INTERNAL_FATAL (9), + Z3_INVALID_USAGE (10), + Z3_FILE_ACCESS_ERROR (8), + Z3_SORT_ERROR (1), + Z3_PARSER_ERROR (4), + Z3_DEC_REF_ERROR (11); + + private final int intValue; + + Z3_error_code(int v) { + this.intValue = v; + } + + public static final Z3_error_code fromInt(int v) { + for (Z3_error_code k: values()) + if (k.intValue == v) return k; + return values()[0]; + } + + public final int toInt() { return this.intValue; } } diff --git a/src/api/java/com/Microsoft/Z3/Enumerations/Z3_goal_prec.class b/src/api/java/com/Microsoft/Z3/Enumerations/Z3_goal_prec.class new file mode 100644 index 0000000000000000000000000000000000000000..0d278b16fc54b0b86a831a3a98adc4888b830de8 GIT binary patch literal 1379 zcmah|OHUI~6#i~!I@8CLM|qT26#=ymr9wrKmmpTtq<~?hvAAf4v5;b!A!W+ig+Ii& zapMAu3eiYd`$zl>uF!KY1!^>QGP!5IbI;>D-@WtwdoiXnLB5jFBlSzbsxbDly^(Q>jz zsZwBIX$EyDJC|8W=?wkP8+KH7dEySkKqT5YTAsIGP?zRR(JCxfw$=*er^Z@|JgO+O zw9b%>WHyamBT+J}jfC!$i`K?uv@wmTqE&QAv(P`%)9GlI!K)WHEW@dkshu1VE_J24Vvrji}63`vPe7Rt33(|DL3~t93`BEfG%6X>DQjG^WsOL!CEGet9HPv8{89GCs zZdb}?;Zc$6(prDO!(12*J^X6*YPgSChVXx{gob|1X&Ar*4PEHg(1$RGgBseMeO+~z8_a=@q=&)ufGj)>=5o_$bToexNa248{B|IQ~@m(?>m4J3x9(8;k-o? z?Q)6=4dExcLxfzoN`$ZBdab2N9yj^phwx1#T}#K@9Cpn zjy`y3rkl0USArSv>?`D4&@0IY@a@AdkS0q41q5nxD*`nO)S|crYE{2cqEv-n&≧ q^qjkjW<94=(W>u*T`1KlI{Aq>znTG}+k|oWXv|a1hLI3M-}()apcK>q literal 0 HcmV?d00001 diff --git a/src/api/java/com/Microsoft/Z3/Enumerations/Z3_goal_prec.java b/src/api/java/com/Microsoft/Z3/Enumerations/Z3_goal_prec.java index 38e2fdf96..2d96c6e76 100644 --- a/src/api/java/com/Microsoft/Z3/Enumerations/Z3_goal_prec.java +++ b/src/api/java/com/Microsoft/Z3/Enumerations/Z3_goal_prec.java @@ -8,9 +8,23 @@ package com.Microsoft.Z3; * Z3_goal_prec **/ public enum Z3_goal_prec { -Z3_GOAL_UNDER (1), -Z3_GOAL_PRECISE (0), -Z3_GOAL_UNDER_OVER (3), -Z3_GOAL_OVER (2), + Z3_GOAL_UNDER (1), + Z3_GOAL_PRECISE (0), + Z3_GOAL_UNDER_OVER (3), + Z3_GOAL_OVER (2); + + private final int intValue; + + Z3_goal_prec(int v) { + this.intValue = v; + } + + public static final Z3_goal_prec fromInt(int v) { + for (Z3_goal_prec k: values()) + if (k.intValue == v) return k; + return values()[0]; + } + + public final int toInt() { return this.intValue; } } diff --git a/src/api/java/com/Microsoft/Z3/Enumerations/Z3_lbool.class b/src/api/java/com/Microsoft/Z3/Enumerations/Z3_lbool.class new file mode 100644 index 0000000000000000000000000000000000000000..eeee15f26a211be42e8ed85f4922618494ee8ea2 GIT binary patch literal 1270 zcmaJA?XGFJ`~rW7 z@x>P(u&5A?glGSVf59ho&QhR8ZPT3DnKLurH{Y4>XJ1YLr18WD5#usaxF=yi!i0=2 zO!6bmZ|=)zikvP%g8XuPUiZ`Vs7ceS(-1XROi)AdqXqoWd@dKkVZD<3+p+RVdz=gj-Gv9 zRAaani?`1d7p&*hy|bX3<&}D+Sgx*VMS~)e(_(dpAr&j^Y5Q8r(9GSGYFBl0Hxq9U zKckzvon`3%M`=DE-yn5Veb?0NdX=EWm=ltAs#Ya$+MIR1JwQOUwbILF?Uh58UWvhN zTTZPIi<45`nUc}uKmo!VYndTu)+;k@2FUU^QLTElR9@1#7J-Y$8s|bN=;v!Opdf=8 zhVXx%RzVcA3a%ropbsGhVMMrlLqRu!3VQg_iy%YCmB5@FO;a)~laPC3@fPB%#l3RL zCU#S;x-J-6t(Iv?yL_WRyHZ`KwXT^)+RshU)^^eIyXV538bFrVIhF|0O^{CjbVc~^ znnY0r6+fjI3{GMRID&U-$d^Sp2P^ZoB{04$&!f{L3a z7O|vbPRA`1XR*xYYd%>q$=o)OV860-3-PLlrC@@{DHXHd(ui9!JH4obP2MhGwed4y<#_nU!-(M84dihRebCoN? zJy_nlTevR}=^?wcbGvA-A2;8&OIs(ETlekK#xYzkZ?6^$0*2?ecieiXCLnA9eU4ge z7aW1}4?j&xd&-qZ0<-DNDbm%o=043CDtdmc)M@P1T3ha3og%vIQ$7&5mM%VWpStmTNwcFXe*7c-|IvgG+*ds$%oKk98evm+34yhGn@cUm-0P0Nse&}uepzs>yZQ%s3C zZMXV((|sao)9VljwwtnnlFpEN#!|K3Cqe-lIzO;Y!S6JdKDEj+UA5^nJFRN%j>po( zKY9q4SsV+q{4nP%+ygy@$^U;l7BbkhkVDDBdCXY2fX^6Sw2(m3!Z|h*Y*K6{*-WvS zMp7VpavRK_7OvKtKJhw}&J65U-g{K5wu$@oLH*b2?$OcWK-%$ze%zJn#s=&9X>>;` zSLp|HmVTF^l?2lT$P;7fiL~^@TY91{J+YUb7NE*FZwWZ5elsUSlQgfOK92D zuh4%!9ucKeV3bCUA&hZcA{4-7S~ZU={gG9Q1Sy_-1*4dIb4yuHP5gjlE;WBsO{l*> zPks+Ap+0}6h#x=vO-af;Qwqo(;&ONrBcvMZa)GY;DxK2c_Xz2j7h?1swI8PceAoH| zQ{-8dV3wNyM1Ks*F$DwH@kKxNFUbt}?hmMyct}xS!hC_SM3$;a6p<(zG$b05D5k}F zhr<%abwwVINOZ=~B^s4zET#n|9FOU*X^PTC*r}*pM4U>niy^0?busKz^e#r6iqXZW wQ;AV%+<5_UqVx>$25B4xzxD`SXcRXvgbl>7P3!N&B*}XEe~GUsH-H=e0K9lLV*mgE literal 0 HcmV?d00001 diff --git a/src/api/java/com/Microsoft/Z3/Enumerations/Z3_param_kind.java b/src/api/java/com/Microsoft/Z3/Enumerations/Z3_param_kind.java index e3d8c0e77..81b8ef7bd 100644 --- a/src/api/java/com/Microsoft/Z3/Enumerations/Z3_param_kind.java +++ b/src/api/java/com/Microsoft/Z3/Enumerations/Z3_param_kind.java @@ -8,12 +8,26 @@ package com.Microsoft.Z3; * Z3_param_kind **/ public enum Z3_param_kind { -Z3_PK_BOOL (1), -Z3_PK_SYMBOL (3), -Z3_PK_OTHER (5), -Z3_PK_INVALID (6), -Z3_PK_UINT (0), -Z3_PK_STRING (4), -Z3_PK_DOUBLE (2), + Z3_PK_BOOL (1), + Z3_PK_SYMBOL (3), + Z3_PK_OTHER (5), + Z3_PK_INVALID (6), + Z3_PK_UINT (0), + Z3_PK_STRING (4), + Z3_PK_DOUBLE (2); + + private final int intValue; + + Z3_param_kind(int v) { + this.intValue = v; + } + + public static final Z3_param_kind fromInt(int v) { + for (Z3_param_kind k: values()) + if (k.intValue == v) return k; + return values()[0]; + } + + public final int toInt() { return this.intValue; } } diff --git a/src/api/java/com/Microsoft/Z3/Enumerations/Z3_parameter_kind.class b/src/api/java/com/Microsoft/Z3/Enumerations/Z3_parameter_kind.class new file mode 100644 index 0000000000000000000000000000000000000000..2a137da1ee2cd5556ac5df173b322fa0eabe7c2c GIT binary patch literal 1639 zcma)6T~iZh6n@_9W_J@72*iMiL@Yv^4{It^tAdmef{o2bhXrP0FEUFA%xbc6!p2|F zAJNNBZ+g=U8{6vW$avlHfA|-AWqZzRMibi^lgXTi=e+0pobcD1XQu#GPzgZA%^+5> zrejgZtsu@~oyFJuvJoVaH4tUoWKGV%ImRsmbBuWdamH-}=NWGsm}mUPzy-#FjynP~ zcUNlPWp}cr{BC}yw!K%*)wc4vqQGLY-fm?|PQBAUX&-r+yDRjqJ+M1=tKl^|wfl~H zxGE4H^53fLZ5Hz%YOQK%vqB+5L$-zT?uV+ZMXISGE32|Yy2y}jC%apyl(Q7ka9nTS zZgv|2q9C9z?q`d8c}rmF`_anR9p1T5YI4Ma)*RRI)&*w&Cq|)=+!qK~&arEI-45kc6H=ug zb=s|h>v1225i^Zjo?X9RvLDFu>Ba>7URwrH5=ok-u~u*Piy;LizBbTR-tD&5MrmoC zjwEQcyPbMt+uCl8Go{ zCeE>#V-aU@p2a+i3y29!yx$P_Le1BkZI|jhlSmHqSvk1ZsC(4I)xmw_n)b=b>VVn1 zB@ag>znMY5z8URo;|l!*&(beFuo2~Q0Ya)+A{8x>>Xt~QOQh;0QUl~U&0Pbb7*CG4 zh5(NMbOgi}2>BE2LHr5dODKJr7vYoIu`txsQ}|y({jY6JM`F3(4y+29~AM+Kd;G1S>}>_vWIDzJcck$jpwpNtG+_7l=uw- zI+lfq{7vDf=zr;#{e*Eso{B$3!GEPc2FEcE16OgaZ~97B2K@LOYIQoGgtR9JKE{}& zrm9LdF4=_t?c1beAx)8QQ<6>VhGb#M&KSC65y@sknqSh{kp6Rkeq4tLpDz z(yD4bOj%XEhp<&OdWcxn5UFOZ#}Mx)y+Cz?W;_W#^l{qI1a1(!jS%*z{X+z4WN+vH L6|R%54>$e=sRB{1 literal 0 HcmV?d00001 diff --git a/src/api/java/com/Microsoft/Z3/Enumerations/Z3_parameter_kind.java b/src/api/java/com/Microsoft/Z3/Enumerations/Z3_parameter_kind.java index 0de56c3cd..c009104ba 100644 --- a/src/api/java/com/Microsoft/Z3/Enumerations/Z3_parameter_kind.java +++ b/src/api/java/com/Microsoft/Z3/Enumerations/Z3_parameter_kind.java @@ -8,12 +8,26 @@ package com.Microsoft.Z3; * Z3_parameter_kind **/ public enum Z3_parameter_kind { -Z3_PARAMETER_FUNC_DECL (6), -Z3_PARAMETER_DOUBLE (1), -Z3_PARAMETER_SYMBOL (3), -Z3_PARAMETER_INT (0), -Z3_PARAMETER_AST (5), -Z3_PARAMETER_SORT (4), -Z3_PARAMETER_RATIONAL (2), + Z3_PARAMETER_FUNC_DECL (6), + Z3_PARAMETER_DOUBLE (1), + Z3_PARAMETER_SYMBOL (3), + Z3_PARAMETER_INT (0), + Z3_PARAMETER_AST (5), + Z3_PARAMETER_SORT (4), + Z3_PARAMETER_RATIONAL (2); + + private final int intValue; + + Z3_parameter_kind(int v) { + this.intValue = v; + } + + public static final Z3_parameter_kind fromInt(int v) { + for (Z3_parameter_kind k: values()) + if (k.intValue == v) return k; + return values()[0]; + } + + public final int toInt() { return this.intValue; } } diff --git a/src/api/java/com/Microsoft/Z3/Enumerations/Z3_sort_kind.class b/src/api/java/com/Microsoft/Z3/Enumerations/Z3_sort_kind.class new file mode 100644 index 0000000000000000000000000000000000000000..3a4c6b2199ef6426ecf5341a27bb0198987188cf GIT binary patch literal 1770 zcmah}%W@i55Iw^T%rFcv=wTTwgp6dHhb>|$&cn!xkc5)45hx6jjl7@`Mk;JHq+rk& zB%hFdDw}MwaBvd4l8Vb~e}uQmCuHTM?`0&DN-C(NK01B7Z};iG@cQj9F9EFJp%)T1 zRcs+I^Ar?ZX1Jpu&akLpfniC(BEww;R~UY-;3~ti zf@=&-1qp@~1xbc`GWG?i2P?IW{hC=SR|Lcgjm}ACr`70odYvOXbFf0cwO*%d*PgVj zM_B>W#J7#2QOVb~N;^5D=w$lIpDUMhRfh+O?-lPAOZU$rbn=w*gRw1i0-E&leL(nw+xQXght7gKFL!(UQ0NC#z$GtkH{6%}&4DXl}RI zTtc+1^XIh02BYCRd-XRo+{Xg}(f@sb8kSMj@IDSSq>$FIgbbs%G{i8k;W9IEW)_%P zWabJpSDCrSOoEvt<^=@a?S*L}@r`!Jq9&&j$q}8U!^h2rO+s#su41!Y@Aa}HVdty; z=dF}?VKmPPqjjy{q|e|SeFbRiVb(oBNCG&L296|yBProXVmOi>jwFdAsp3e&08Fsq z0D6SYmbeFAHYo^rk64_L{ip*7Kg0D3;!|R@T(Ta1rc(SeeKif^7vSPv-z22e3%FlF z`gekhZGi$=f$I=S8VO6KXP?89iv9%ohw~BvIt4CLsW5zq-~(bVd`RpgeC(8LkjG8_ z^b073^vgTqT6FeXMAFga+frEi5pv`kc*4@tFGb`=aSBEW*;L#qy8L_kXLKBKC|JWM!%$(4cLu!q6;gG= zE6UHIK7)@lP0|%k{hS8eLl)#r_k_eh_-Tmq30WWJPI5Y>c=+KoXBTvjo6{LiFY2<$ zX_(W9u1K6-;&fK`>cixyuKq@Ci39k|sx*M#thxsXnpMvLA+stEFlknm0jABWPOcdO z@`VY=d5OR~K-7E&;oZKLXiK2K05lq=pB`2KSp;zxIv&svkLkIc(y+h66uyQ^OBil+ K9XZN#VdHOV8(^&f literal 0 HcmV?d00001 diff --git a/src/api/java/com/Microsoft/Z3/Enumerations/Z3_sort_kind.java b/src/api/java/com/Microsoft/Z3/Enumerations/Z3_sort_kind.java index 59a69b4c0..43f5b2f14 100644 --- a/src/api/java/com/Microsoft/Z3/Enumerations/Z3_sort_kind.java +++ b/src/api/java/com/Microsoft/Z3/Enumerations/Z3_sort_kind.java @@ -8,15 +8,29 @@ package com.Microsoft.Z3; * Z3_sort_kind **/ public enum Z3_sort_kind { -Z3_BV_SORT (4), -Z3_FINITE_DOMAIN_SORT (8), -Z3_ARRAY_SORT (5), -Z3_UNKNOWN_SORT (1000), -Z3_RELATION_SORT (7), -Z3_REAL_SORT (3), -Z3_INT_SORT (2), -Z3_UNINTERPRETED_SORT (0), -Z3_BOOL_SORT (1), -Z3_DATATYPE_SORT (6), + Z3_BV_SORT (4), + Z3_FINITE_DOMAIN_SORT (8), + Z3_ARRAY_SORT (5), + Z3_UNKNOWN_SORT (1000), + Z3_RELATION_SORT (7), + Z3_REAL_SORT (3), + Z3_INT_SORT (2), + Z3_UNINTERPRETED_SORT (0), + Z3_BOOL_SORT (1), + Z3_DATATYPE_SORT (6); + + private final int intValue; + + Z3_sort_kind(int v) { + this.intValue = v; + } + + public static final Z3_sort_kind fromInt(int v) { + for (Z3_sort_kind k: values()) + if (k.intValue == v) return k; + return values()[0]; + } + + public final int toInt() { return this.intValue; } } diff --git a/src/api/java/com/Microsoft/Z3/Enumerations/Z3_symbol_kind.class b/src/api/java/com/Microsoft/Z3/Enumerations/Z3_symbol_kind.class new file mode 100644 index 0000000000000000000000000000000000000000..6623e4b8d5e9a1c36ea65d2d8d1116342276eec9 GIT binary patch literal 1270 zcma)5+fEZv6kVq??X=TrX$u8gsmMj`1u0PRLXn^ZO_Kt~!6x8CGcAP-v@@oilKAe2 z7+-wx0YQamBs}{g{(?{FK0|{=NodoY-F-QGt-bc?kCU%Q05ZsWAR;AW6t^XWC5*}N zBh8O-o|%y8m~^9y+YFD~aU;m>l!UtszO_s-x3p4JR~H{I=NSg`WwVxE)XR0VVQyII zwG4fWjn}o3SuJks#(I_^KoNE2d2Z?H*)_LrSOu-xtT3<~gEUfjlz*|HG7P=!prLDr zUu`gq#1oy=i}U6>A$8?-qq5Yjl`8cWtyHCmWH(ygV3>;Mx3nECUDb@uv})CLV>6rR zgvyL==+-Pl-vteFxkQ1%qw1T6W;N>sD8}uOv{5%}Im6-;HmeSVW;Tp$HK{MCdN z+{1l_flIcpAc_YH`Z28_gl+}B=;LloK^FoFf(S79|0>U!(rD$XX%K;)c%p5J<}+}GyVAYhi&m5<%uUei_S2t3oQrT)09hhNkq{>h1fqOu@?G%o z3BYiLydkpuBkzHIf#Vp$E_nq^F|u40XOfzKpdamWMB&Cw+-j9RvzYIt satisfies select(store(a,i,v),j) = if i = j then v else select(a,j). * Array store takes at least 3 arguments. **/ - public boolean IsStore() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_STORE; } + public boolean IsStore() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_STORE; } /** * Indicates whether the term is an array select. **/ - public boolean IsSelect() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_SELECT; } + public boolean IsSelect() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_SELECT; } /** * Indicates whether the term is a constant array. * For example, select(const(v),i) = v holds for every v and i. The function is unary. **/ - public boolean IsConstantArray() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_CONST_ARRAY; } + public boolean IsConstantArray() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_CONST_ARRAY; } /** * Indicates whether the term is a default array. * For example default(const(v)) = v. The function is unary. **/ - public boolean IsDefaultArray() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_ARRAY_DEFAULT; } + public boolean IsDefaultArray() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_ARRAY_DEFAULT; } /** * Indicates whether the term is an array map. * It satisfies map[f](a1,..,a_n)[i] = f(a1[i],...,a_n[i]) for every i. **/ - public boolean IsArrayMap() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_ARRAY_MAP; } + public boolean IsArrayMap() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_ARRAY_MAP; } /** * Indicates whether the term is an as-array term. * An as-array term is n array value that behaves as the function graph of the * function passed as parameter. **/ - public boolean IsAsArray() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_AS_ARRAY; } + public boolean IsAsArray() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_AS_ARRAY; } /** * Indicates whether the term is set union **/ - public boolean IsSetUnion() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_SET_UNION; } + public boolean IsSetUnion() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_SET_UNION; } /** * Indicates whether the term is set intersection **/ - public boolean IsSetIntersect() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_SET_INTERSECT; } + public boolean IsSetIntersect() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_SET_INTERSECT; } /** * Indicates whether the term is set difference **/ - public boolean IsSetDifference() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_SET_DIFFERENCE; } + public boolean IsSetDifference() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_SET_DIFFERENCE; } /** * Indicates whether the term is set complement **/ - public boolean IsSetComplement() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_SET_COMPLEMENT; } + public boolean IsSetComplement() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_SET_COMPLEMENT; } /** * Indicates whether the term is set subset **/ - public boolean IsSetSubset() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_SET_SUBSET; } + public boolean IsSetSubset() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_SET_SUBSET; } /** * Indicates whether the terms is of bit-vector sort. **/ - public boolean IsBV() { return Native.getSortKind(Context().nCtx(), Native.getSort(Context().nCtx(), NativeObject())) == (long)Z3_sort_kind.Z3_BV_SORT; } + public boolean IsBV() { return Native.getSortKind(Context().nCtx(), Native.getSort(Context().nCtx(), NativeObject())) == Z3_sort_kind.Z3_BV_SORT.toInt(); } /** * Indicates whether the term is a bit-vector numeral **/ - public boolean IsBVNumeral() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_BNUM; } + public boolean IsBVNumeral() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_BNUM; } /** * Indicates whether the term is a one-bit bit-vector with value one **/ - public boolean IsBVBitOne() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_BIT1; } + public boolean IsBVBitOne() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_BIT1; } /** * Indicates whether the term is a one-bit bit-vector with value zero **/ - public boolean IsBVBitZero() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_BIT0; } + public boolean IsBVBitZero() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_BIT0; } /** * Indicates whether the term is a bit-vector unary minus **/ - public boolean IsBVUMinus() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_BNEG; } + public boolean IsBVUMinus() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_BNEG; } /** * Indicates whether the term is a bit-vector addition (binary) **/ - public boolean IsBVAdd() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_BADD; } + public boolean IsBVAdd() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_BADD; } /** * Indicates whether the term is a bit-vector subtraction (binary) **/ - public boolean IsBVSub() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_BSUB; } + public boolean IsBVSub() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_BSUB; } /** * Indicates whether the term is a bit-vector multiplication (binary) **/ - public boolean IsBVMul() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_BMUL; } + public boolean IsBVMul() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_BMUL; } /** * Indicates whether the term is a bit-vector signed division (binary) **/ - public boolean IsBVSDiv() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_BSDIV; } + public boolean IsBVSDiv() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_BSDIV; } /** * Indicates whether the term is a bit-vector unsigned division (binary) **/ - public boolean IsBVUDiv() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_BUDIV; } + public boolean IsBVUDiv() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_BUDIV; } /** * Indicates whether the term is a bit-vector signed remainder (binary) **/ - public boolean IsBVSRem() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_BSREM; } + public boolean IsBVSRem() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_BSREM; } /** * Indicates whether the term is a bit-vector unsigned remainder (binary) **/ - public boolean IsBVURem() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_BUREM; } + public boolean IsBVURem() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_BUREM; } /** * Indicates whether the term is a bit-vector signed modulus **/ - public boolean IsBVSMod() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_BSMOD; } + public boolean IsBVSMod() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_BSMOD; } /** * Indicates whether the term is a bit-vector signed division by zero **/ - boolean IsBVSDiv0 () { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_BSDIV0; } + boolean IsBVSDiv0 () { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_BSDIV0; } /** * Indicates whether the term is a bit-vector unsigned division by zero **/ - boolean IsBVUDiv0 () { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_BUDIV0; } + boolean IsBVUDiv0 () { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_BUDIV0; } /** * Indicates whether the term is a bit-vector signed remainder by zero **/ - boolean IsBVSRem0 () { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_BSREM0; } + boolean IsBVSRem0 () { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_BSREM0; } /** * Indicates whether the term is a bit-vector unsigned remainder by zero **/ - boolean IsBVURem0 () { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_BUREM0; } + boolean IsBVURem0 () { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_BUREM0; } /** * Indicates whether the term is a bit-vector signed modulus by zero **/ - boolean IsBVSMod0 () { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_BSMOD0; } + boolean IsBVSMod0 () { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_BSMOD0; } /** * Indicates whether the term is an unsigned bit-vector less-than-or-equal **/ - public boolean IsBVULE() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_ULEQ; } + public boolean IsBVULE() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_ULEQ; } /** * Indicates whether the term is a signed bit-vector less-than-or-equal **/ - public boolean IsBVSLE() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_SLEQ; } + public boolean IsBVSLE() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_SLEQ; } /** * Indicates whether the term is an unsigned bit-vector greater-than-or-equal **/ - public boolean IsBVUGE() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_UGEQ; } + public boolean IsBVUGE() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_UGEQ; } /** * Indicates whether the term is a signed bit-vector greater-than-or-equal **/ - public boolean IsBVSGE() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_SGEQ; } + public boolean IsBVSGE() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_SGEQ; } /** * Indicates whether the term is an unsigned bit-vector less-than **/ - public boolean IsBVULT() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_ULT; } + public boolean IsBVULT() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_ULT; } /** * Indicates whether the term is a signed bit-vector less-than **/ - public boolean IsBVSLT() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_SLT; } + public boolean IsBVSLT() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_SLT; } /** * Indicates whether the term is an unsigned bit-vector greater-than **/ - public boolean IsBVUGT() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_UGT; } + public boolean IsBVUGT() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_UGT; } /** * Indicates whether the term is a signed bit-vector greater-than **/ - public boolean IsBVSGT() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_SGT; } + public boolean IsBVSGT() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_SGT; } /** * Indicates whether the term is a bit-wise AND **/ - public boolean IsBVAND() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_BAND; } + public boolean IsBVAND() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_BAND; } /** * Indicates whether the term is a bit-wise OR **/ - public boolean IsBVOR() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_BOR; } + public boolean IsBVOR() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_BOR; } /** * Indicates whether the term is a bit-wise NOT **/ - public boolean IsBVNOT() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_BNOT; } + public boolean IsBVNOT() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_BNOT; } /** * Indicates whether the term is a bit-wise XOR **/ - public boolean IsBVXOR() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_BXOR; } + public boolean IsBVXOR() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_BXOR; } /** * Indicates whether the term is a bit-wise NAND **/ - public boolean IsBVNAND() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_BNAND; } + public boolean IsBVNAND() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_BNAND; } /** * Indicates whether the term is a bit-wise NOR **/ - public boolean IsBVNOR() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_BNOR; } + public boolean IsBVNOR() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_BNOR; } /** * Indicates whether the term is a bit-wise XNOR **/ - public boolean IsBVXNOR() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_BXNOR; } + public boolean IsBVXNOR() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_BXNOR; } /** * Indicates whether the term is a bit-vector concatenation (binary) **/ - public boolean IsBVConcat() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_CONCAT; } + public boolean IsBVConcat() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_CONCAT; } /** * Indicates whether the term is a bit-vector sign extension **/ - public boolean IsBVSignExtension() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_SIGN_EXT; } + public boolean IsBVSignExtension() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_SIGN_EXT; } /** * Indicates whether the term is a bit-vector zero extension **/ - public boolean IsBVZeroExtension() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_ZERO_EXT; } + public boolean IsBVZeroExtension() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_ZERO_EXT; } /** * Indicates whether the term is a bit-vector extraction **/ - public boolean IsBVExtract() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_EXTRACT; } + public boolean IsBVExtract() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_EXTRACT; } /** * Indicates whether the term is a bit-vector repetition **/ - public boolean IsBVRepeat() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_REPEAT; } + public boolean IsBVRepeat() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_REPEAT; } /** * Indicates whether the term is a bit-vector reduce OR **/ - public boolean IsBVReduceOR() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_BREDOR; } + public boolean IsBVReduceOR() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_BREDOR; } /** * Indicates whether the term is a bit-vector reduce AND **/ - public boolean IsBVReduceAND() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_BREDAND; } + public boolean IsBVReduceAND() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_BREDAND; } /** * Indicates whether the term is a bit-vector comparison **/ - public boolean IsBVComp() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_BCOMP; } + public boolean IsBVComp() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_BCOMP; } /** * Indicates whether the term is a bit-vector shift left **/ - public boolean IsBVShiftLeft() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_BSHL; } + public boolean IsBVShiftLeft() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_BSHL; } /** * Indicates whether the term is a bit-vector logical shift right **/ - public boolean IsBVShiftRightLogical() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_BLSHR; } + public boolean IsBVShiftRightLogical() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_BLSHR; } /** * Indicates whether the term is a bit-vector arithmetic shift left **/ - public boolean IsBVShiftRightArithmetic() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_BASHR; } + public boolean IsBVShiftRightArithmetic() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_BASHR; } /** * Indicates whether the term is a bit-vector rotate left **/ - public boolean IsBVRotateLeft() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_ROTATE_LEFT; } + public boolean IsBVRotateLeft() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_ROTATE_LEFT; } /** * Indicates whether the term is a bit-vector rotate right **/ - public boolean IsBVRotateRight() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_ROTATE_RIGHT; } + public boolean IsBVRotateRight() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_ROTATE_RIGHT; } /** * Indicates whether the term is a bit-vector rotate left (extended) * Similar to Z3_OP_ROTATE_LEFT, but it is a binary operator instead of a parametric one. **/ - public boolean IsBVRotateLeftExtended() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_EXT_ROTATE_LEFT; } + public boolean IsBVRotateLeftExtended() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_EXT_ROTATE_LEFT; } /** * Indicates whether the term is a bit-vector rotate right (extended) * Similar to Z3_OP_ROTATE_RIGHT, but it is a binary operator instead of a parametric one. **/ - public boolean IsBVRotateRightExtended() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_EXT_ROTATE_RIGHT; } + public boolean IsBVRotateRightExtended() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_EXT_ROTATE_RIGHT; } /** * Indicates whether the term is a coercion from integer to bit-vector * This function is not supported by the decision procedures. Only the most * rudimentary simplification rules are applied to this function. **/ - public boolean IsIntToBV() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_INT2BV; } + public boolean IsIntToBV() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_INT2BV; } /** * Indicates whether the term is a coercion from bit-vector to integer * This function is not supported by the decision procedures. Only the most * rudimentary simplification rules are applied to this function. **/ - public boolean IsBVToInt() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_BV2INT; } + public boolean IsBVToInt() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_BV2INT; } /** * Indicates whether the term is a bit-vector carry * Compute the carry bit in a full-adder. The meaning is given by the * equivalence (carry l1 l2 l3) <=> (or (and l1 l2) (and l1 l3) (and l2 l3))) **/ - public boolean IsBVCarry() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_CARRY; } + public boolean IsBVCarry() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_CARRY; } /** * Indicates whether the term is a bit-vector ternary XOR * The meaning is given by the equivalence (xor3 l1 l2 l3) <=> (xor (xor l1 l2) l3) **/ - public boolean IsBVXOR3() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_XOR3; } + public boolean IsBVXOR3() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_XOR3; } /** * Indicates whether the term is a label (used by the Boogie Verification condition generator). * The label has two parameters, a string and a Boolean polarity. It takes one argument, a formula. **/ - public boolean IsLabel() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_LABEL; } + public boolean IsLabel() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_LABEL; } /** * Indicates whether the term is a label literal (used by the Boogie Verification condition generator). * A label literal has a set of string parameters. It takes no arguments. **/ - public boolean IsLabelLit() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_LABEL_LIT; } + public boolean IsLabelLit() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_LABEL_LIT; } /** * Indicates whether the term is a binary equivalence modulo namings. * This binary predicate is used in proof terms. * It captures equisatisfiability and equivalence modulo renamings. **/ - public boolean IsOEQ() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_OEQ; } + public boolean IsOEQ() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_OEQ; } /** * Indicates whether the term is a Proof for the expression 'true'. **/ - public boolean IsProofTrue() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_PR_TRUE; } + public boolean IsProofTrue() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_PR_TRUE; } /** * Indicates whether the term is a proof for a fact asserted by the user. **/ - public boolean IsProofAsserted() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_PR_ASSERTED; } + public boolean IsProofAsserted() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_PR_ASSERTED; } /** * Indicates whether the term is a proof for a fact (tagged as goal) asserted by the user. **/ - public boolean IsProofGoal() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_PR_GOAL; } + public boolean IsProofGoal() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_PR_GOAL; } /** * Indicates whether the term is proof via modus ponens @@ -740,7 +742,7 @@ import java.lang.Exception; * [mp T1 T2]: q * The second antecedents may also be a proof for (iff p q). **/ - public boolean IsProofModusPonens() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_PR_MODUS_PONENS; } + public boolean IsProofModusPonens() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_PR_MODUS_PONENS; } /** * Indicates whether the term is a proof for (R t t), where R is a reflexive relation. @@ -749,7 +751,7 @@ import java.lang.Exception; * equivalence modulo namings, equality and equivalence. * That is, R is either '~', '=' or 'iff'. **/ - public boolean IsProofReflexivity() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_PR_REFLEXIVITY; } + public boolean IsProofReflexivity() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_PR_REFLEXIVITY; } /** * Indicates whether the term is proof by symmetricity of a relation @@ -760,7 +762,7 @@ import java.lang.Exception; * T1 is the antecedent of this proof object. * **/ - public boolean IsProofSymmetry() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_PR_SYMMETRY; } + public boolean IsProofSymmetry() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_PR_SYMMETRY; } /** * Indicates whether the term is a proof by transitivity of a relation @@ -772,7 +774,7 @@ import java.lang.Exception; * [trans T1 T2]: (R t u) * **/ - public boolean IsProofTransitivity() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_PR_TRANSITIVITY; } + public boolean IsProofTransitivity() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_PR_TRANSITIVITY; } /** * Indicates whether the term is a proof by condensed transitivity of a relation @@ -793,7 +795,7 @@ import java.lang.Exception; * antecedent (R a b) as an edge between a and b. * **/ - public boolean IsProofTransitivityStar() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_PR_TRANSITIVITY_STAR; } + public boolean IsProofTransitivityStar() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_PR_TRANSITIVITY_STAR; } /** @@ -807,7 +809,7 @@ import java.lang.Exception; * That is, reflexivity proofs are supressed to save space. * **/ - public boolean IsProofMonotonicity() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_PR_MONOTONICITY; } + public boolean IsProofMonotonicity() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_PR_MONOTONICITY; } /** * Indicates whether the term is a quant-intro proof @@ -817,7 +819,7 @@ import java.lang.Exception; * [quant-intro T1]: (~ (forall (x) p) (forall (x) q)) * **/ - public boolean IsProofQuantIntro() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_PR_QUANT_INTRO; } + public boolean IsProofQuantIntro() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_PR_QUANT_INTRO; } /** * Indicates whether the term is a distributivity proof object. @@ -835,7 +837,7 @@ import java.lang.Exception; * instantiated by f = or, and g = and. * **/ - public boolean IsProofDistributivity() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_PR_DISTRIBUTIVITY; } + public boolean IsProofDistributivity() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_PR_DISTRIBUTIVITY; } /** * Indicates whether the term is a proof by elimination of AND @@ -845,7 +847,7 @@ import java.lang.Exception; * [and-elim T1]: l_i * **/ - public boolean IsProofAndElimination() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_PR_AND_ELIM; } + public boolean IsProofAndElimination() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_PR_AND_ELIM; } /** * Indicates whether the term is a proof by eliminiation of not-or @@ -855,7 +857,7 @@ import java.lang.Exception; * [not-or-elim T1]: (not l_i) * **/ - public boolean IsProofOrElimination() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_PR_NOT_OR_ELIM; } + public boolean IsProofOrElimination() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_PR_NOT_OR_ELIM; } /** * Indicates whether the term is a proof by rewriting @@ -874,7 +876,7 @@ import java.lang.Exception; * (iff (or x false) x) * **/ - public boolean IsProofRewrite() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_PR_REWRITE; } + public boolean IsProofRewrite() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_PR_REWRITE; } /** * Indicates whether the term is a proof by rewriting @@ -890,7 +892,7 @@ import java.lang.Exception; * - When pulling ite expression up (PULL_CHEAP_ITE_TREES=true) * **/ - public boolean IsProofRewriteStar() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_PR_REWRITE_STAR; } + public boolean IsProofRewriteStar() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_PR_REWRITE_STAR; } /** * Indicates whether the term is a proof for pulling quantifiers out. @@ -898,7 +900,7 @@ import java.lang.Exception; * A proof for (iff (f (forall (x) q(x)) r) (forall (x) (f (q x) r))). This proof object has no antecedents. * **/ - public boolean IsProofPullQuant() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_PR_PULL_QUANT; } + public boolean IsProofPullQuant() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_PR_PULL_QUANT; } /** * Indicates whether the term is a proof for pulling quantifiers out. @@ -908,7 +910,7 @@ import java.lang.Exception; * This proof object has no antecedents * **/ - public boolean IsProofPullQuantStar() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_PR_PULL_QUANT_STAR; } + public boolean IsProofPullQuantStar() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_PR_PULL_QUANT_STAR; } /** * Indicates whether the term is a proof for pushing quantifiers in. @@ -921,7 +923,7 @@ import java.lang.Exception; * This proof object has no antecedents * **/ - public boolean IsProofPushQuant() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_PR_PUSH_QUANT; } + public boolean IsProofPushQuant() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_PR_PUSH_QUANT; } /** * Indicates whether the term is a proof for elimination of unused variables. @@ -933,7 +935,7 @@ import java.lang.Exception; * This proof object has no antecedents. * **/ - public boolean IsProofElimUnusedVars() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_PR_ELIM_UNUSED_VARS; } + public boolean IsProofElimUnusedVars() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_PR_ELIM_UNUSED_VARS; } /** * Indicates whether the term is a proof for destructive equality resolution @@ -947,7 +949,7 @@ import java.lang.Exception; * Several variables can be eliminated simultaneously. * **/ - public boolean IsProofDER() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_PR_DER; } + public boolean IsProofDER() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_PR_DER; } /** * Indicates whether the term is a proof for quantifier instantiation @@ -955,13 +957,13 @@ import java.lang.Exception; * A proof of (or (not (forall (x) (P x))) (P a)) * **/ - public boolean IsProofQuantInst() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_PR_QUANT_INST; } + public boolean IsProofQuantInst() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_PR_QUANT_INST; } /** * Indicates whether the term is a hypthesis marker. * Mark a hypothesis in a natural deduction style proof. **/ - public boolean IsProofHypothesis() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_PR_HYPOTHESIS; } + public boolean IsProofHypothesis() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_PR_HYPOTHESIS; } /** * Indicates whether the term is a proof by lemma @@ -974,7 +976,7 @@ import java.lang.Exception; * when T1 contains the hypotheses: l_1, ..., l_n. * **/ - public boolean IsProofLemma() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_PR_LEMMA; } + public boolean IsProofLemma() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_PR_LEMMA; } /** * Indicates whether the term is a proof by unit resolution @@ -986,7 +988,7 @@ import java.lang.Exception; * [unit-resolution T1 ... T(n+1)]: (or l_1' ... l_m') * **/ - public boolean IsProofUnitResolution() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_PR_UNIT_RESOLUTION; } + public boolean IsProofUnitResolution() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_PR_UNIT_RESOLUTION; } /** * Indicates whether the term is a proof by iff-true @@ -995,7 +997,7 @@ import java.lang.Exception; * [iff-true T1]: (iff p true) * **/ - public boolean IsProofIFFTrue() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_PR_IFF_TRUE; } + public boolean IsProofIFFTrue() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_PR_IFF_TRUE; } /** * Indicates whether the term is a proof by iff-false @@ -1004,7 +1006,7 @@ import java.lang.Exception; * [iff-false T1]: (iff p false) * **/ - public boolean IsProofIFFFalse() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_PR_IFF_FALSE; } + public boolean IsProofIFFFalse() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_PR_IFF_FALSE; } /** * Indicates whether the term is a proof by commutativity @@ -1017,7 +1019,7 @@ import java.lang.Exception; * Remark: if f is bool, then = is iff. * **/ - public boolean IsProofCommutativity() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_PR_COMMUTATIVITY; } + public boolean IsProofCommutativity() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_PR_COMMUTATIVITY; } /** * Indicates whether the term is a proof for Tseitin-like axioms @@ -1053,7 +1055,7 @@ import java.lang.Exception; * bounded number of steps (=3). * **/ - public boolean IsProofDefAxiom() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_PR_DEF_AXIOM; } + public boolean IsProofDefAxiom() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_PR_DEF_AXIOM; } /** * Indicates whether the term is a proof for introduction of a name @@ -1076,7 +1078,7 @@ import java.lang.Exception; * [def-intro]: (= n e) * **/ - public boolean IsProofDefIntro() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_PR_DEF_INTRO; } + public boolean IsProofDefIntro() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_PR_DEF_INTRO; } /** * Indicates whether the term is a proof for application of a definition @@ -1086,7 +1088,7 @@ import java.lang.Exception; * n is a name for F. * **/ - public boolean IsProofApplyDef() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_PR_APPLY_DEF; } + public boolean IsProofApplyDef() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_PR_APPLY_DEF; } /** * Indicates whether the term is a proof iff-oeq @@ -1095,7 +1097,7 @@ import java.lang.Exception; * [iff~ T1]: (~ p q) * **/ - public boolean IsProofIFFOEQ() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_PR_IFF_OEQ; } + public boolean IsProofIFFOEQ() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_PR_IFF_OEQ; } /** * Indicates whether the term is a proof for a positive NNF step @@ -1123,7 +1125,7 @@ import java.lang.Exception; * over Boolean connectives 'and' and 'or'. * **/ - public boolean IsProofNNFPos() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_PR_NNF_POS; } + public boolean IsProofNNFPos() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_PR_NNF_POS; } /** * Indicates whether the term is a proof for a negative NNF step @@ -1148,7 +1150,7 @@ import java.lang.Exception; * (and (or r_1 r_2) (or r_1' r_2'))) * **/ - public boolean IsProofNNFNeg() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_PR_NNF_NEG; } + public boolean IsProofNNFNeg() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_PR_NNF_NEG; } /** * Indicates whether the term is a proof for (~ P Q) here Q is in negation normal form. @@ -1160,7 +1162,7 @@ import java.lang.Exception; * This proof object may have n antecedents. Each antecedent is a PR_DEF_INTRO. * **/ - public boolean IsProofNNFStar() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_PR_NNF_STAR; } + public boolean IsProofNNFStar() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_PR_NNF_STAR; } /** * Indicates whether the term is a proof for (~ P Q) where Q is in conjunctive normal form. @@ -1170,7 +1172,7 @@ import java.lang.Exception; * This proof object may have n antecedents. Each antecedent is a PR_DEF_INTRO. * **/ - public boolean IsProofCNFStar() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_PR_CNF_STAR; } + public boolean IsProofCNFStar() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_PR_CNF_STAR; } /** * Indicates whether the term is a proof for a Skolemization step @@ -1183,7 +1185,7 @@ import java.lang.Exception; * This proof object has no antecedents. * **/ - public boolean IsProofSkolemize() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_PR_SKOLEMIZE; } + public boolean IsProofSkolemize() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_PR_SKOLEMIZE; } /** * Indicates whether the term is a proof by modus ponens for equi-satisfiability. @@ -1194,7 +1196,7 @@ import java.lang.Exception; * [mp~ T1 T2]: q * **/ - public boolean IsProofModusPonensOEQ() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_PR_MODUS_PONENS_OEQ; } + public boolean IsProofModusPonensOEQ() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_PR_MODUS_PONENS_OEQ; } /** * Indicates whether the term is a proof for theory lemma @@ -1213,15 +1215,16 @@ import java.lang.Exception; * - gcd-test - Indicates an integer linear arithmetic lemma that uses a gcd test. * **/ - public boolean IsProofTheoryLemma() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_PR_TH_LEMMA; } + public boolean IsProofTheoryLemma() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_PR_TH_LEMMA; } /** * Indicates whether the term is of an array sort. **/ public boolean IsRelation() { - return (Native.isApp(Context().nCtx(), NativeObject()) != 0 && - (Z3_sort_kind)Native.getSortKind(Context().nCtx(), Native.getSort(Context().nCtx(), NativeObject())) == Z3_sort_kind.Z3_RELATION_SORT); + return (Native.isApp(Context().nCtx(), NativeObject()) && + Native.getSortKind(Context().nCtx(), Native.getSort(Context().nCtx(), NativeObject())) + == Z3_sort_kind.Z3_RELATION_SORT.toInt()); } /** @@ -1232,40 +1235,40 @@ import java.lang.Exception; * correspond to the n columns of the relation. * **/ - public boolean IsRelationStore() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_RA_STORE; } + public boolean IsRelationStore() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_RA_STORE; } /** * Indicates whether the term is an empty relation **/ - public boolean IsEmptyRelation() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_RA_EMPTY; } + public boolean IsEmptyRelation() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_RA_EMPTY; } /** * Indicates whether the term is a test for the emptiness of a relation **/ - public boolean IsIsEmptyRelation() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_RA_IS_EMPTY; } + public boolean IsIsEmptyRelation() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_RA_IS_EMPTY; } /** * Indicates whether the term is a relational join **/ - public boolean IsRelationalJoin() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_RA_JOIN; } + public boolean IsRelationalJoin() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_RA_JOIN; } /** * Indicates whether the term is the union or convex hull of two relations. * The function takes two arguments. **/ - public boolean IsRelationUnion() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_RA_UNION; } + public boolean IsRelationUnion() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_RA_UNION; } /** * Indicates whether the term is the widening of two relations * The function takes two arguments. **/ - public boolean IsRelationWiden() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_RA_WIDEN; } + public boolean IsRelationWiden() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_RA_WIDEN; } /** * Indicates whether the term is a projection of columns (provided as numbers in the parameters). * The function takes one argument. **/ - public boolean IsRelationProject() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_RA_PROJECT; } + public boolean IsRelationProject() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_RA_PROJECT; } /** * Indicates whether the term is a relation filter @@ -1277,7 +1280,7 @@ import java.lang.Exception; * So the first column in the relation has index 0. * **/ - public boolean IsRelationFilter() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_RA_FILTER; } + public boolean IsRelationFilter() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_RA_FILTER; } /** * Indicates whether the term is an intersection of a relation with the negation of another. @@ -1293,7 +1296,7 @@ import java.lang.Exception; * x on the columns c1, d1, .., cN, dN. * **/ - public boolean IsRelationNegationFilter() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_RA_NEGATION_FILTER; } + public boolean IsRelationNegationFilter() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_RA_NEGATION_FILTER; } /** * Indicates whether the term is the renaming of a column in a relation @@ -1302,12 +1305,12 @@ import java.lang.Exception; * The parameters contain the renaming as a cycle. * **/ - public boolean IsRelationRename() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_RA_RENAME; } + public boolean IsRelationRename() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_RA_RENAME; } /** * Indicates whether the term is the complement of a relation **/ - public boolean IsRelationComplement() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_RA_COMPLEMENT; } + public boolean IsRelationComplement() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_RA_COMPLEMENT; } /** * Indicates whether the term is a relational select @@ -1317,7 +1320,7 @@ import java.lang.Exception; * and the remaining n arguments correspond to a record. * **/ - public boolean IsRelationSelect() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_RA_SELECT; } + public boolean IsRelationSelect() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_RA_SELECT; } /** * Indicates whether the term is a relational clone (copy) @@ -1329,21 +1332,21 @@ import java.lang.Exception; * to perform destructive updates to the first argument. * **/ - public boolean IsRelationClone() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_RA_CLONE; } + public boolean IsRelationClone() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_RA_CLONE; } /** * Indicates whether the term is of an array sort. **/ public boolean IsFiniteDomain() { - return (Native.isApp(Context().nCtx(), NativeObject()) != 0 && - (Z3_sort_kind)Native.getSortKind(Context().nCtx(), Native.getSort(Context().nCtx(), NativeObject())) == Z3_sort_kind.Z3_FINITE_DOMAIN_SORT); + return (Native.isApp(Context().nCtx(), NativeObject()) && + Native.getSortKind(Context().nCtx(), Native.getSort(Context().nCtx(), NativeObject())) == Z3_sort_kind.Z3_FINITE_DOMAIN_SORT.toInt()); } /** * Indicates whether the term is a less than predicate over a finite domain. **/ - public boolean IsFiniteDomainLT() { return FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_FD_LT; } + public boolean IsFiniteDomainLT() { return FuncDecl().DeclKind() == Z3_decl_kind.Z3_OP_FD_LT; } /** * The de-Burijn index of a bound variable. @@ -1364,9 +1367,9 @@ import java.lang.Exception; * index. * **/ - public long Index() + public int Index() { - if (!IsVar) + if (!IsVar()) throw new Z3Exception("Term is not a bound variable."); @@ -1385,9 +1388,9 @@ import java.lang.Exception; void CheckNativeObject(long obj) { - if (Native.isApp(Context().nCtx(), obj) == 0 && - (Z3_ast_kind)Native.getAstKind(Context().nCtx(), obj) != Z3_ast_kind.Z3_VAR_AST && - (Z3_ast_kind)Native.getAstKind(Context().nCtx(), obj) != Z3_ast_kind.Z3_QUANTIFIER_AST) + if (Native.isApp(Context().nCtx(), obj) ^ true && + Native.getAstKind(Context().nCtx(), obj) != Z3_ast_kind.Z3_VAR_AST.toInt() && + Native.getAstKind(Context().nCtx(), obj) != Z3_ast_kind.Z3_QUANTIFIER_AST.toInt()) throw new Z3Exception("Underlying object is not a term"); super.CheckNativeObject(obj); } @@ -1398,7 +1401,7 @@ import java.lang.Exception; - long obj = Native.mkApp(ctx.nCtx(), f.NativeObject, + long obj = Native.mkApp(ctx.nCtx(), f.NativeObject(), AST.ArrayLength(arguments), AST.ArrayToNative(arguments)); return Create(ctx, obj); @@ -1409,33 +1412,33 @@ import java.lang.Exception; - Z3_ast_kind k = (Z3_ast_kind)Native.getAstKind(ctx.nCtx(), obj); + Z3_ast_kind k = Z3_ast_kind.fromInt(Native.getAstKind(ctx.nCtx(), obj)); if (k == Z3_ast_kind.Z3_QUANTIFIER_AST) return new Quantifier(ctx, obj); long s = Native.getSort(ctx.nCtx(), obj); - Z3_sort_kind sk = (Z3_sort_kind)Native.getSortKind(ctx.nCtx(), s); + Z3_sort_kind sk = Z3_sort_kind.fromInt(Native.getSortKind(ctx.nCtx(), s)); - if (Native.isAlgebraicNumber(ctx.nCtx(), obj) != 0) // is this a numeral ast? + if (Native.isAlgebraicNumber(ctx.nCtx(), obj) ) // is this a numeral ast? return new AlgebraicNum(ctx, obj); - if (Native.isNumeralAst(ctx.nCtx(), obj) != 0) + if (Native.isNumeralAst(ctx.nCtx(), obj) ) { switch (sk) { - case Z3_sort_kind.Z3_INT_SORT: return new IntNum(ctx, obj); - case Z3_sort_kind.Z3_REAL_SORT: return new RatNum(ctx, obj); - case Z3_sort_kind.Z3_BV_SORT: return new BitVecNum(ctx, obj); + case Z3_INT_SORT: return new IntNum(ctx, obj); + case Z3_REAL_SORT: return new RatNum(ctx, obj); + case Z3_BV_SORT: return new BitVecNum(ctx, obj); } } switch (sk) { - case Z3_sort_kind.Z3_BOOL_SORT: return new BoolExpr(ctx, obj); - case Z3_sort_kind.Z3_INT_SORT: return new IntExpr(ctx, obj); - case Z3_sort_kind.Z3_REAL_SORT: return new RealExpr(ctx, obj); - case Z3_sort_kind.Z3_BV_SORT: return new BitVecExpr(ctx, obj); - case Z3_sort_kind.Z3_ARRAY_SORT: return new ArrayExpr(ctx, obj); - case Z3_sort_kind.Z3_DATATYPE_SORT: return new DatatypeExpr(ctx, obj); + case Z3_BOOL_SORT: return new BoolExpr(ctx, obj); + case Z3_INT_SORT: return new IntExpr(ctx, obj); + case Z3_REAL_SORT: return new RealExpr(ctx, obj); + case Z3_BV_SORT: return new BitVecExpr(ctx, obj); + case Z3_ARRAY_SORT: return new ArrayExpr(ctx, obj); + case Z3_DATATYPE_SORT: return new DatatypeExpr(ctx, obj); } return new Expr(ctx, obj); diff --git a/src/api/java/com/Microsoft/Z3/FiniteDomainSort.java b/src/api/java/com/Microsoft/Z3/FiniteDomainSort.java index 016d0fecc..49a2c40c5 100644 --- a/src/api/java/com/Microsoft/Z3/FiniteDomainSort.java +++ b/src/api/java/com/Microsoft/Z3/FiniteDomainSort.java @@ -7,6 +7,7 @@ package com.Microsoft.Z3; import java.math.BigInteger; import java.util.*; import java.lang.Exception; +import com.Microsoft.Z3.Enumerations.*; /* using System; */ @@ -30,7 +31,7 @@ import java.lang.Exception; } FiniteDomainSort(Context ctx, Symbol name, long size) - { super(ctx, Native.mkFiniteDomainSort(ctx.nCtx(), name.NativeObject, size)); + { super(ctx, Native.mkFiniteDomainSort(ctx.nCtx(), name.NativeObject(), size)); diff --git a/src/api/java/com/Microsoft/Z3/Fixedpoint.java b/src/api/java/com/Microsoft/Z3/Fixedpoint.java index 0c38f9679..104fd354c 100644 --- a/src/api/java/com/Microsoft/Z3/Fixedpoint.java +++ b/src/api/java/com/Microsoft/Z3/Fixedpoint.java @@ -7,6 +7,7 @@ package com.Microsoft.Z3; import java.math.BigInteger; import java.util.*; import java.lang.Exception; +import com.Microsoft.Z3.Enumerations.*; /* using System; */ @@ -31,14 +32,14 @@ import java.lang.Exception; public void setParameters(Params value) { - 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. **/ - public ParamDescrs ParameterDescriptions() { return new ParamDescrs(Context, Native.fixedpointGetParamDescrs(Context().nCtx(), NativeObject())); } + public ParamDescrs ParameterDescriptions() { return new ParamDescrs(Context(), Native.fixedpointGetParamDescrs(Context().nCtx(), NativeObject())); } /** @@ -49,10 +50,10 @@ import java.lang.Exception; - Context.CheckContextMatch(constraints); - for (Iterator a = constraints.iterator(); a.hasNext(); ) + Context().CheckContextMatch(constraints); + for (BoolExpr a: constraints) { - Native.fixedpointAssert(Context().nCtx(), NativeObject(), a.NativeObject); + Native.fixedpointAssert(Context().nCtx(), NativeObject(), a.NativeObject()); } } @@ -63,8 +64,8 @@ import java.lang.Exception; { - Context.CheckContextMatch(f); - Native.fixedpointRegisterRelation(Context().nCtx(), NativeObject(), f.NativeObject); + Context().CheckContextMatch(f); + Native.fixedpointRegisterRelation(Context().nCtx(), NativeObject(), f.NativeObject()); } /** @@ -74,20 +75,20 @@ import java.lang.Exception; { - Context.CheckContextMatch(rule); - Native.fixedpointAddRule(Context().nCtx(), NativeObject(), rule.NativeObject, AST.GetNativeObject(name)); + Context().CheckContextMatch(rule); + Native.fixedpointAddRule(Context().nCtx(), NativeObject(), rule.NativeObject(), AST.GetNativeObject(name)); } /** * Add table fact to the fixedpoint solver. **/ - public void AddFact(FuncDecl pred, long[] args) + public void AddFact(FuncDecl pred, int[] args) { - Context.CheckContextMatch(pred); - Native.fixedpointAddFact(Context().nCtx(), NativeObject(), pred.NativeObject, (long)args.Length, args); + Context().CheckContextMatch(pred); + Native.fixedpointAddFact(Context().nCtx(), NativeObject(), pred.NativeObject(), (int)args.length, args); } /** @@ -100,12 +101,12 @@ import java.lang.Exception; { - Context.CheckContextMatch(query); - Z3_lbool r = (Z3_lbool)Native.fixedpointQuery(Context().nCtx(), NativeObject(), query.NativeObject); + Context().CheckContextMatch(query); + Z3_lbool r = Z3_lbool.fromInt(Native.fixedpointQuery(Context().nCtx(), NativeObject(), query.NativeObject())); switch (r) { - case Z3_lbool.Z3_L_TRUE: return Status.SATISFIABLE; - case Z3_lbool.Z3_L_FALSE: return Status.UNSATISFIABLE; + case Z3_L_TRUE: return Status.SATISFIABLE; + case Z3_L_FALSE: return Status.UNSATISFIABLE; default: return Status.UNKNOWN; } } @@ -121,13 +122,13 @@ import java.lang.Exception; - Context.CheckContextMatch(relations); + Context().CheckContextMatch(relations); Z3_lbool r = (Z3_lbool)Native.fixedpointQueryRelations(Context().nCtx(), NativeObject(), AST.ArrayLength(relations), AST.ArrayToNative(relations)); switch (r) { - case Z3_lbool.Z3_L_TRUE: return Status.SATISFIABLE; - case Z3_lbool.Z3_L_FALSE: return Status.UNSATISFIABLE; + case Z3_L_TRUE: return Status.SATISFIABLE; + case Z3_L_FALSE: return Status.UNSATISFIABLE; default: return Status.UNKNOWN; } } @@ -159,8 +160,8 @@ import java.lang.Exception; { - Context.CheckContextMatch(rule); - Native.fixedpointUpdateRule(Context().nCtx(), NativeObject(), rule.NativeObject, AST.GetNativeObject(name)); + Context().CheckContextMatch(rule); + Native.fixedpointUpdateRule(Context().nCtx(), NativeObject(), rule.NativeObject(), AST.GetNativeObject(name)); } /** @@ -170,7 +171,7 @@ import java.lang.Exception; public Expr GetAnswer() { long ans = Native.fixedpointGetAnswer(Context().nCtx(), NativeObject()); - return (ans == 0) ? null : Expr.Create(Context, ans); + return (ans == 0) ? null : Expr.Create(Context(), ans); } /** @@ -186,9 +187,9 @@ import java.lang.Exception; /** * Retrieve the number of levels explored for a given predicate. **/ - public long GetNumLevels(FuncDecl predicate) + public int GetNumLevels(FuncDecl predicate) { - return Native.fixedpointGetNumLevels(Context().nCtx(), NativeObject(), predicate.NativeObject); + return Native.fixedpointGetNumLevels(Context().nCtx(), NativeObject(), predicate.NativeObject()); } /** @@ -196,8 +197,8 @@ import java.lang.Exception; **/ public Expr GetCoverDelta(int level, FuncDecl predicate) { - long res = Native.fixedpointGetCoverDelta(Context().nCtx(), NativeObject(), level, predicate.NativeObject); - return (res == 0) ? null : Expr.Create(Context, res); + long res = Native.fixedpointGetCoverDelta(Context().nCtx(), NativeObject(), level, predicate.NativeObject()); + return (res == 0) ? null : Expr.Create(Context(), res); } /** @@ -206,7 +207,7 @@ import java.lang.Exception; **/ public void AddCover(int level, FuncDecl predicate, Expr property) { - Native.fixedpointAddCover(Context().nCtx(), NativeObject(), level, predicate.NativeObject, property.NativeObject); + Native.fixedpointAddCover(Context().nCtx(), NativeObject(), level, predicate.NativeObject(), property.NativeObject()); } /** @@ -225,7 +226,7 @@ import java.lang.Exception; Native.fixedpointSetPredicateRepresentation(Context().nCtx(), NativeObject(), - f.NativeObject, AST.ArrayLength(kinds), Symbol.ArrayToNative(kinds)); + f.NativeObject(), AST.ArrayLength(kinds), Symbol.ArrayToNative(kinds)); } @@ -246,11 +247,11 @@ import java.lang.Exception; { - ASTVector v = new ASTVector(Context, Native.fixedpointGetRules(Context().nCtx(), NativeObject())); - long n = v.Size; + ASTVector v = new ASTVector(Context(), Native.fixedpointGetRules(Context().nCtx(), NativeObject())); + int n = v.Size; BoolExpr[] res = new BoolExpr[n]; - for (long i; i < n; i++) - res[i] = new BoolExpr(Context, v[i].NativeObject); + for (int i = 0; i < n; i++) + res[i] = new BoolExpr(Context(), v[i].NativeObject()); return res; } @@ -261,11 +262,11 @@ import java.lang.Exception; { - ASTVector v = new ASTVector(Context, Native.fixedpointGetAssertions(Context().nCtx(), NativeObject())); - long n = v.Size; + ASTVector v = new ASTVector(Context(), Native.fixedpointGetAssertions(Context().nCtx(), NativeObject())); + int n = v.Size; BoolExpr[] res = new BoolExpr[n]; - for (long i; i < n; i++) - res[i] = new BoolExpr(Context, v[i].NativeObject); + for (int i = 0; i < n; i++) + res[i] = new BoolExpr(Context(), v[i].NativeObject()); return res; } @@ -294,13 +295,13 @@ import java.lang.Exception; void IncRef(long o) { - Context.Fixedpoint_DRQ.IncAndClear(Context, o); + Context().Fixedpoint_DRQ().IncAndClear(Context(), o); super.IncRef(o); } void DecRef(long o) { - Context.Fixedpoint_DRQ.Add(o); + Context().Fixedpoint_DRQ().Add(o); super.DecRef(o); } } diff --git a/src/api/java/com/Microsoft/Z3/FuncDecl.java b/src/api/java/com/Microsoft/Z3/FuncDecl.java index 91579b085..aa716c028 100644 --- a/src/api/java/com/Microsoft/Z3/FuncDecl.java +++ b/src/api/java/com/Microsoft/Z3/FuncDecl.java @@ -7,6 +7,7 @@ package com.Microsoft.Z3; import java.math.BigInteger; import java.util.*; import java.lang.Exception; +import com.Microsoft.Z3.Enumerations.*; /* using System; */ @@ -56,18 +57,18 @@ import java.lang.Exception; /** * Returns a unique identifier for the function declaration. **/ - public long Id() { return Native.getFuncDeclId(Context().nCtx(), NativeObject()); } + public int Id() { return Native.getFuncDeclId(Context().nCtx(), NativeObject()); } /** * The arity of the function declaration **/ - public long Arity() { return Native.getArity(Context().nCtx(), NativeObject()); } + public int Arity() { return Native.getArity(Context().nCtx(), NativeObject()); } /** * The size of the domain of the function declaration * **/ - public long DomainSize() { return Native.getDomainSize(Context().nCtx(), NativeObject()); } + public int DomainSize() { return Native.getDomainSize(Context().nCtx(), NativeObject()); } /** * The domain of the function declaration @@ -79,8 +80,8 @@ import java.lang.Exception; var n = DomainSize; Sort[] res = new Sort[n]; - for (long i; i < n; i++) - res[i] = Sort.Create(Context, Native.getDomain(Context().nCtx(), NativeObject(), i)); + for (int i = 0; i < n; i++) + res[i] = Sort.Create(Context(), Native.getDomain(Context().nCtx(), NativeObject(), i)); return res; } @@ -90,13 +91,13 @@ import java.lang.Exception; public Sort Range() { - 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() { return (Z3_decl_kind)Native.getDeclKind(Context().nCtx(), NativeObject()); } + public Z3_decl_kind DeclKind() { return Z3_decl_kind.fromInt(Native.getDeclKind(Context().nCtx(), NativeObject())); } /** * The name of the function declaration @@ -104,13 +105,13 @@ import java.lang.Exception; public Symbol Name() { - 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 long NumParameters() { return Native.getDeclNumParameters(Context().nCtx(), NativeObject()); } + public int NumParameters() { return Native.getDeclNumParameters(Context().nCtx(), NativeObject()); } /** * The parameters of the function declaration @@ -119,32 +120,32 @@ import java.lang.Exception; { - long num = NumParameters; + int num = NumParameters(); Parameter[] res = new Parameter[num]; - for (long i; i < num; i++) + for (int i = 0; i < num; i++) { - Z3_parameter_kind k = (Z3_parameter_kind)Native.getDeclParameterKind(Context().nCtx(), NativeObject(), i); + Z3_parameter_kind k = Z3_parameter_kind.fromInt(Native.getDeclParameterKind(Context().nCtx(), NativeObject(), i)); switch (k) { - case Z3_parameter_kind.Z3_PARAMETER_INT: + case Z3_PARAMETER_INT: res[i] = new Parameter(k, Native.getDeclIntParameter(Context().nCtx(), NativeObject(), i)); break; - case Z3_parameter_kind.Z3_PARAMETER_DOUBLE: + case Z3_PARAMETER_DOUBLE: res[i] = new Parameter(k, Native.getDeclDoubleParameter(Context().nCtx(), NativeObject(), i)); break; - case Z3_parameter_kind.Z3_PARAMETER_SYMBOL: - res[i] = new Parameter(k, Symbol.Create(Context, Native.getDeclSymbolParameter(Context().nCtx(), NativeObject(), i))); + case Z3_PARAMETER_SYMBOL: + res[i] = new Parameter(k, Symbol.Create(Context(), Native.getDeclSymbolParameter(Context().nCtx(), NativeObject(), i))); break; - case Z3_parameter_kind.Z3_PARAMETER_SORT: - res[i] = new Parameter(k, Sort.Create(Context, Native.getDeclSortParameter(Context().nCtx(), NativeObject(), i))); + case Z3_PARAMETER_SORT: + res[i] = new Parameter(k, Sort.Create(Context(), Native.getDeclSortParameter(Context().nCtx(), NativeObject(), i))); break; - case Z3_parameter_kind.Z3_PARAMETER_AST: - res[i] = new Parameter(k, new AST(Context, Native.getDeclAstParameter(Context().nCtx(), NativeObject(), i))); + case Z3_PARAMETER_AST: + res[i] = new Parameter(k, new AST(Context(), Native.getDeclAstParameter(Context().nCtx(), NativeObject(), i))); break; - case Z3_parameter_kind.Z3_PARAMETER_FUNC_DECL: - res[i] = new Parameter(k, new FuncDecl(Context, Native.getDeclFuncDeclParameter(Context().nCtx(), NativeObject(), i))); + case Z3_PARAMETER_FUNC_DECL: + res[i] = new Parameter(k, new FuncDecl(Context(), Native.getDeclFuncDeclParameter(Context().nCtx(), NativeObject(), i))); break; - case Z3_parameter_kind.Z3_PARAMETER_RATIONAL: + case Z3_PARAMETER_RATIONAL: res[i] = new Parameter(k, Native.getDeclRationalParameter(Context().nCtx(), NativeObject(), i)); break; default: @@ -244,21 +245,21 @@ import java.lang.Exception; } FuncDecl(Context ctx, Symbol name, Sort[] domain, Sort range) - { super(ctx, Native.mkFuncDecl(ctx.nCtx(), name.NativeObject, AST.ArrayLength(domain), AST.ArrayToNative(domain), range.NativeObject)); + { 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) - { super(ctx, Native.mkFreshFuncDecl(ctx.nCtx(), prefix, AST.ArrayLength(domain), AST.ArrayToNative(domain), range.NativeObject)); + { super(ctx, Native.mkFreshFuncDecl(ctx.nCtx(), prefix, AST.ArrayLength(domain), AST.ArrayToNative(domain), range.NativeObject())); } void CheckNativeObject(long obj) { - if (Native.getAstKind(Context().nCtx(), obj) != (long)Z3_ast_kind.Z3_FUNC_DECL_AST) + 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); } @@ -279,8 +280,8 @@ import java.lang.Exception; { - Context.CheckContextMatch(args); - return Expr.Create(Context, this, args); + Context().CheckContextMatch(args); + return Expr.Create(Context(), this, args); } } diff --git a/src/api/java/com/Microsoft/Z3/FuncInterp.java b/src/api/java/com/Microsoft/Z3/FuncInterp.java index 7544aba11..341b82ec5 100644 --- a/src/api/java/com/Microsoft/Z3/FuncInterp.java +++ b/src/api/java/com/Microsoft/Z3/FuncInterp.java @@ -7,6 +7,7 @@ package com.Microsoft.Z3; import java.math.BigInteger; import java.util.*; import java.lang.Exception; +import com.Microsoft.Z3.Enumerations.*; /* using System; */ @@ -28,13 +29,13 @@ import java.lang.Exception; public Expr Value() { - return Expr.Create(Context, Native.funcEntryGetValue(Context().nCtx(), NativeObject())); + return Expr.Create(Context(), Native.funcEntryGetValue(Context().nCtx(), NativeObject())); } /** * The number of arguments of the entry. **/ - public long NumArgs() { return Native.funcEntryGetNumArgs(Context().nCtx(), NativeObject()); } + public int NumArgs() { return Native.funcEntryGetNumArgs(Context().nCtx(), NativeObject()); } /** * The arguments of the function entry. @@ -44,10 +45,10 @@ import java.lang.Exception; - long n = NumArgs; + int n = NumArgs(); Expr[] res = new Expr[n]; - for (long i; i < n; i++) - res[i] = Expr.Create(Context, Native.funcEntryGetArg(Context().nCtx(), NativeObject(), i)); + for (int i = 0; i < n; i++) + res[i] = Expr.Create(Context(), Native.funcEntryGetArg(Context().nCtx(), NativeObject(), i)); return res; } @@ -56,10 +57,10 @@ import java.lang.Exception; **/ public String toString() { - long n = NumArgs; + int n = NumArgs(); String res = "["; Expr[] args = Args; - for (long i; i < n; i++) + for (int i = 0; i < n; i++) res += args[i] + ", "; return res + Value + "]"; } @@ -81,13 +82,13 @@ import java.lang.Exception; void IncRef(long o) { - Context.FuncEntry_DRQ.IncAndClear(Context, o); + Context().FuncEntry_DRQ().IncAndClear(Context(), o); super.IncRef(o); } void DecRef(long o) { - Context.FuncEntry_DRQ.Add(o); + Context().FuncEntry_DRQ().Add(o); super.DecRef(o); } }; @@ -95,7 +96,7 @@ import java.lang.Exception; /** * The number of entries in the function interpretation. **/ - public long NumEntries() { return Native.funcInterpGetNumEntries(Context().nCtx(), NativeObject()); } + public int NumEntries() { return Native.funcInterpGetNumEntries(Context().nCtx(), NativeObject()); } /** * The entries in the function interpretation @@ -105,10 +106,10 @@ import java.lang.Exception; - long n = NumEntries; + int n = NumEntries(); Entry[] res = new Entry[n]; - for (long i; i < n; i++) - res[i] = new Entry(Context, Native.funcInterpGetEntry(Context().nCtx(), NativeObject(), i)); + for (int i = 0; i < n; i++) + res[i] = new Entry(Context(), Native.funcInterpGetEntry(Context().nCtx(), NativeObject(), i)); return res; } @@ -119,13 +120,13 @@ import java.lang.Exception; { - return Expr.Create(Context, Native.funcInterpGetElse(Context().nCtx(), NativeObject())); + return Expr.Create(Context(), Native.funcInterpGetElse(Context().nCtx(), NativeObject())); } /** * The arity of the function interpretation **/ - public long Arity() { return Native.funcInterpGetArity(Context().nCtx(), NativeObject()); } + public int Arity() { return Native.funcInterpGetArity(Context().nCtx(), NativeObject()); } /** * A string representation of the function interpretation. @@ -134,12 +135,12 @@ import java.lang.Exception; { String res = ""; res += "["; - for (Iterator e = Entries.iterator(); e.hasNext(); ) + for (Entry e: Entries) { - long n = e.NumArgs; + int n = e.NumArgs; if (n > 1) res += "["; Expr[] args = e.Args; - for (long i; i < n; i++) + for (int i = 0; i < n; i++) { if (i != 0) res += ", "; res += args[i]; @@ -172,13 +173,13 @@ import java.lang.Exception; void IncRef(long o) { - Context.FuncInterp_DRQ.IncAndClear(Context, o); + Context().FuncInterp_DRQ().IncAndClear(Context(), o); super.IncRef(o); } void DecRef(long o) { - Context.FuncInterp_DRQ.Add(o); + Context().FuncInterp_DRQ().Add(o); super.DecRef(o); } } diff --git a/src/api/java/com/Microsoft/Z3/Goal.java b/src/api/java/com/Microsoft/Z3/Goal.java index bfbefa203..9f522a768 100644 --- a/src/api/java/com/Microsoft/Z3/Goal.java +++ b/src/api/java/com/Microsoft/Z3/Goal.java @@ -7,6 +7,7 @@ package com.Microsoft.Z3; import java.math.BigInteger; import java.util.*; import java.lang.Exception; +import com.Microsoft.Z3.Enumerations.*; /* using System; */ @@ -25,7 +26,7 @@ import java.lang.Exception; * An over approximation is applied when the objective is to find a proof for a given goal. * **/ - public Z3_goal_prec Precision() { return (Z3_goal_prec)Native.goalPrecision(Context().nCtx(), NativeObject()); } + public Z3_goal_prec Precision() { return Z3_goal_prec.fromInt(Native.goalPrecision(Context().nCtx(), NativeObject())); } /** * Indicates whether the goal is precise. @@ -54,18 +55,18 @@ import java.lang.Exception; - Context.CheckContextMatch(constraints); - for (Iterator c = constraints.iterator(); c.hasNext(); ) + Context().CheckContextMatch(constraints); + for (BoolExpr c: constraints) { // It was an assume, now made an assert just to be sure we do not regress - Native.goalAssert(Context().nCtx(), NativeObject(), c.NativeObject); + Native.goalAssert(Context().nCtx(), NativeObject(), c.NativeObject()); } } /** * Indicates whether the goal contains `false'. **/ - public boolean Inconsistent() { return Native.goalInconsistent(Context().nCtx(), NativeObject()) != 0; } + public boolean Inconsistent() { return Native.goalInconsistent(Context().nCtx(), NativeObject()) ; } /** * The depth of the goal. @@ -73,7 +74,7 @@ import java.lang.Exception; * This tracks how many transformations were applied to it. * **/ - public long Depth() { return Native.goalDepth(Context().nCtx(), NativeObject()); } + public int Depth() { return Native.goalDepth(Context().nCtx(), NativeObject()); } /** * Erases all formulas from the given goal. @@ -86,7 +87,7 @@ import java.lang.Exception; /** * The number of formulas in the goal. **/ - public long Size() { return Native.goalSize(Context().nCtx(), NativeObject()); } + public int Size() { return Native.goalSize(Context().nCtx(), NativeObject()); } /** * The formulas in the goal. @@ -95,27 +96,27 @@ import java.lang.Exception; { - long n = Size; + int n = Size; BoolExpr[] res = new BoolExpr[n]; - for (long i; i < n; i++) - res[i] = new BoolExpr(Context, Native.goalFormula(Context().nCtx(), NativeObject(), i)); + 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 long NumExprs() { return Native.goalNumExprs(Context().nCtx(), NativeObject()); } + public int NumExprs() { 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()) != 0; } + public boolean IsDecidedSat() { 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()) != 0; } + public boolean IsDecidedUnsat() { return Native.goalIsDecidedUnsat(Context().nCtx(), NativeObject()) ; } /** * Translates (copies) the Goal to the target Context . @@ -133,11 +134,11 @@ import java.lang.Exception; **/ public Goal Simplify(Params p) { - Tactic t = Context.MkTactic("simplify"); + Tactic t = Context().MkTactic("simplify"); ApplyResult res = t.Apply(this, p); if (res.NumSubgoals == 0) - return Context.MkGoal(); + return Context().MkGoal(); else return res.Subgoals[0]; } @@ -154,7 +155,7 @@ import java.lang.Exception; Goal(Context ctx, long obj) { super(ctx, obj); { }} Goal(Context ctx, boolean models, boolean unsatCores, boolean proofs) - { super(ctx, Native.mkGoal(ctx.nCtx(), (models) ? 1 : 0, (unsatCores) ? 1 : 0, (proofs) ? 1 : 0)); + { super(ctx, Native.mkGoal(ctx.nCtx(), (models) ? true : false, (unsatCores) ? true : false, (proofs) ? true : false)); } @@ -173,13 +174,13 @@ import java.lang.Exception; void IncRef(long o) { - Context.Goal_DRQ.IncAndClear(Context, o); + Context().Goal_DRQ().IncAndClear(Context(), o); super.IncRef(o); } void DecRef(long o) { - Context.Goal_DRQ.Add(o); + Context().Goal_DRQ().Add(o); super.DecRef(o); } diff --git a/src/api/java/com/Microsoft/Z3/IDecRefQueue.java b/src/api/java/com/Microsoft/Z3/IDecRefQueue.java index 1b6291ce7..4d40bf66a 100644 --- a/src/api/java/com/Microsoft/Z3/IDecRefQueue.java +++ b/src/api/java/com/Microsoft/Z3/IDecRefQueue.java @@ -7,6 +7,7 @@ package com.Microsoft.Z3; import java.math.BigInteger; import java.util.*; import java.lang.Exception; +import com.Microsoft.Z3.Enumerations.*; /* using System; */ /* using System.Collections; */ @@ -23,8 +24,8 @@ import java.lang.Exception; protected Object m_lock = new Object(); - protected List m_queue = new List(); - final long m_move_limit = 1024; + protected LinkedList m_queue = new LinkedList(); + final int m_move_limit = 1024; public abstract void IncRef(Context ctx, long obj); public abstract void DecRef(Context ctx, long obj); @@ -34,7 +35,7 @@ import java.lang.Exception; IncRef(ctx, o); - if (m_queue.Count >= m_move_limit) Clear(ctx); + if (m_queue.size() >= m_move_limit) Clear(ctx); } public void Add(long o) @@ -43,7 +44,7 @@ import java.lang.Exception; synchronized (m_lock) { - m_queue.Add(o); + m_queue.add(o); } } @@ -53,9 +54,9 @@ import java.lang.Exception; synchronized (m_lock) { - for (Iterator o = m_queue.iterator(); o.hasNext(); ) + for (Long o: m_queue) DecRef(ctx, o); - m_queue.Clear(); + m_queue.clear(); } } } diff --git a/src/api/java/com/Microsoft/Z3/IntExpr.java b/src/api/java/com/Microsoft/Z3/IntExpr.java index 888e441b3..d493947d9 100644 --- a/src/api/java/com/Microsoft/Z3/IntExpr.java +++ b/src/api/java/com/Microsoft/Z3/IntExpr.java @@ -7,6 +7,7 @@ package com.Microsoft.Z3; import java.math.BigInteger; import java.util.*; import java.lang.Exception; +import com.Microsoft.Z3.Enumerations.*; /* using System; */ /* using System.Collections.Generic; */ /* using System.Linq; */ diff --git a/src/api/java/com/Microsoft/Z3/IntNum.java b/src/api/java/com/Microsoft/Z3/IntNum.java index e4d0e72e2..494ac316b 100644 --- a/src/api/java/com/Microsoft/Z3/IntNum.java +++ b/src/api/java/com/Microsoft/Z3/IntNum.java @@ -7,6 +7,7 @@ package com.Microsoft.Z3; import java.math.BigInteger; import java.util.*; import java.lang.Exception; +import com.Microsoft.Z3.Enumerations.*; /* using System; */ /* using System.Numerics; */ @@ -29,7 +30,7 @@ import java.lang.Exception; public long UInt64() { long res = 0; - if (Native.getNumeralLong64(Context().nCtx(), NativeObject(), res) == 0) + if (Native.getNumeralInt64(Context().nCtx(), NativeObject(), res) ^ true) throw new Z3Exception("Numeral is not a 64 bit unsigned"); return res; } @@ -40,7 +41,7 @@ import java.lang.Exception; public int Int() { int res = 0; - if (Native.getNumeralInt(Context().nCtx(), NativeObject(), res) == 0) + if (Native.getNumeralInt(Context().nCtx(), NativeObject(), res) ^ true) throw new Z3Exception("Numeral is not an int"); return res; } @@ -51,7 +52,7 @@ import java.lang.Exception; public long Int64() { long res = 0; - if (Native.getNumeralInt64(Context().nCtx(), NativeObject(), res) == 0) + if (Native.getNumeralInt64(Context().nCtx(), NativeObject(), res) ^ true) throw new Z3Exception("Numeral is not an int64"); return res; } @@ -59,11 +60,11 @@ import java.lang.Exception; /** * Retrieve the int value. **/ - public long UInt() + public int UInt() { - long res = 0; - if (Native.getNumeralLong(Context().nCtx(), NativeObject(), res) == 0) - throw new Z3Exception("Numeral is not a long"); + int res = 0; + if (Native.getNumeralInt(Context().nCtx(), NativeObject(), res) ^ true) + throw new Z3Exception("Numeral is not a int"); return res; } @@ -72,7 +73,7 @@ import java.lang.Exception; **/ public BigInteger BigInteger() { - return BigInteger.Parse(this.ToString()); + return new BigInteger(this.toString()); } /** diff --git a/src/api/java/com/Microsoft/Z3/IntSort.java b/src/api/java/com/Microsoft/Z3/IntSort.java index 29ff35136..b347cc149 100644 --- a/src/api/java/com/Microsoft/Z3/IntSort.java +++ b/src/api/java/com/Microsoft/Z3/IntSort.java @@ -7,6 +7,7 @@ package com.Microsoft.Z3; import java.math.BigInteger; import java.util.*; import java.lang.Exception; +import com.Microsoft.Z3.Enumerations.*; /* using System; */ diff --git a/src/api/java/com/Microsoft/Z3/IntSymbol.java b/src/api/java/com/Microsoft/Z3/IntSymbol.java index 0132def21..1750d87e6 100644 --- a/src/api/java/com/Microsoft/Z3/IntSymbol.java +++ b/src/api/java/com/Microsoft/Z3/IntSymbol.java @@ -7,6 +7,7 @@ package com.Microsoft.Z3; import java.math.BigInteger; import java.util.*; import java.lang.Exception; +import com.Microsoft.Z3.Enumerations.*; /* using System; */ /* using System.Runtime.InteropServices; */ diff --git a/src/api/java/com/Microsoft/Z3/ListSort.java b/src/api/java/com/Microsoft/Z3/ListSort.java index 96829c11e..4efee3783 100644 --- a/src/api/java/com/Microsoft/Z3/ListSort.java +++ b/src/api/java/com/Microsoft/Z3/ListSort.java @@ -7,6 +7,7 @@ package com.Microsoft.Z3; import java.math.BigInteger; import java.util.*; import java.lang.Exception; +import com.Microsoft.Z3.Enumerations.*; /* using System; */ @@ -109,7 +110,7 @@ import java.lang.Exception; ihead = 0, itail = 0; - NativeObject() = Native.mkListSort(ctx.nCtx(), name.NativeObject, elemSort.NativeObject, + NativeObject() = Native.mkListSort(ctx.nCtx(), name.NativeObject(), elemSort.NativeObject(), inil, iisnil, icons, iiscons, ihead, itail); nilDecl = new FuncDecl(ctx, inil); isNilDecl = new FuncDecl(ctx, iisnil); diff --git a/src/api/java/com/Microsoft/Z3/Log.java b/src/api/java/com/Microsoft/Z3/Log.java index bfcc2b1c5..2572f9880 100644 --- a/src/api/java/com/Microsoft/Z3/Log.java +++ b/src/api/java/com/Microsoft/Z3/Log.java @@ -7,6 +7,7 @@ package com.Microsoft.Z3; import java.math.BigInteger; import java.util.*; import java.lang.Exception; +import com.Microsoft.Z3.Enumerations.*; /* using System; */ diff --git a/src/api/java/com/Microsoft/Z3/Model.java b/src/api/java/com/Microsoft/Z3/Model.java index e20a9d575..c0c0e2852 100644 --- a/src/api/java/com/Microsoft/Z3/Model.java +++ b/src/api/java/com/Microsoft/Z3/Model.java @@ -7,6 +7,7 @@ package com.Microsoft.Z3; import java.math.BigInteger; import java.util.*; import java.lang.Exception; +import com.Microsoft.Z3.Enumerations.*; /* using System; */ @@ -24,7 +25,7 @@ import java.lang.Exception; { - Context.CheckContextMatch(a); + Context().CheckContextMatch(a); return ConstInterp(a.FuncDecl); } @@ -37,16 +38,16 @@ import java.lang.Exception; { - Context.CheckContextMatch(f); + Context().CheckContextMatch(f); if (f.Arity != 0 || - Native.getSortKind(Context().nCtx(), Native.getRange(Context().nCtx(), f.NativeObject)) == (long)Z3_sort_kind.Z3_ARRAY_SORT) + Native.getSortKind(Context().nCtx(), Native.getRange(Context().nCtx(), f.NativeObject())) == Z3_sort_kind.Z3_ARRAY_SORT.toInt()) throw new Z3Exception("Non-zero arity functions and arrays have FunctionInterpretations as a model. Use FuncInterp."); - long n = Native.modelGetConstInterp(Context().nCtx(), NativeObject(), f.NativeObject); + long n = Native.modelGetConstInterp(Context().nCtx(), NativeObject(), f.NativeObject()); if (n == 0) return null; else - return Expr.Create(Context, n); + return Expr.Create(Context(), n); } /** @@ -58,13 +59,13 @@ import java.lang.Exception; { - Context.CheckContextMatch(f); + Context().CheckContextMatch(f); - Z3_sort_kind sk = (Z3_sort_kind)Native.getSortKind(Context().nCtx(), Native.getRange(Context().nCtx(), f.NativeObject)); + Z3_sort_kind sk = Z3_sort_kind.fromInt(Native.getSortKind(Context().nCtx(), Native.getRange(Context().nCtx(), f.NativeObject()))); if (f.Arity == 0) { - long n = Native.modelGetConstInterp(Context().nCtx(), NativeObject(), f.NativeObject); + long n = Native.modelGetConstInterp(Context().nCtx(), NativeObject(), f.NativeObject()); if (sk == Z3_sort_kind.Z3_ARRAY_SORT) { @@ -72,10 +73,10 @@ import java.lang.Exception; return null; else { - if (Native.isAsArray(Context().nCtx(), n) == 0) + if (Native.isAsArray(Context().nCtx(), n) ^ true) throw new Z3Exception("Argument was not an array constant"); long fd = Native.getAsArrayFuncDecl(Context().nCtx(), n); - return FuncInterp(new FuncDecl(Context, fd)); + return FuncInterp(new FuncDecl(Context(), fd)); } } else @@ -85,18 +86,18 @@ import java.lang.Exception; } else { - long n = Native.modelGetFuncInterp(Context().nCtx(), NativeObject(), f.NativeObject); + long n = Native.modelGetFuncInterp(Context().nCtx(), NativeObject(), f.NativeObject()); if (n == 0) return null; else - return new FuncInterp(Context, n); + return new FuncInterp(Context(), n); } } /** * The number of constants that have an interpretation in the model. **/ - public long NumConsts() { return Native.modelGetNumConsts(Context().nCtx(), NativeObject()); } + public int NumConsts() { return Native.modelGetNumConsts(Context().nCtx(), NativeObject()); } /** * The function declarations of the constants in the model. @@ -105,17 +106,17 @@ import java.lang.Exception; { - long n = NumConsts; + int n = NumConsts(); FuncDecl[] res = new FuncDecl[n]; - for (long i; i < n; i++) - res[i] = new FuncDecl(Context, Native.modelGetConstDecl(Context().nCtx(), NativeObject(), i)); + for (int i = 0; i < n; i++) + res[i] = new FuncDecl(Context(), Native.modelGetConstDecl(Context().nCtx(), NativeObject(), i)); return res; } /** * The number of function interpretations in the model. **/ - public long NumFuncs() { return Native.modelGetNumFuncs(Context().nCtx(), NativeObject()); } + public int NumFuncs() { return Native.modelGetNumFuncs(Context().nCtx(), NativeObject()); } /** * The function declarations of the function interpretations in the model. @@ -124,10 +125,10 @@ import java.lang.Exception; { - long n = NumFuncs; + int n = NumFuncs(); FuncDecl[] res = new FuncDecl[n]; - for (long i; i < n; i++) - res[i] = new FuncDecl(Context, Native.modelGetFuncDecl(Context().nCtx(), NativeObject(), i)); + for (int i = 0; i < n; i++) + res[i] = new FuncDecl(Context(), Native.modelGetFuncDecl(Context().nCtx(), NativeObject(), i)); return res; } @@ -138,14 +139,14 @@ import java.lang.Exception; { - var nFuncs = NumFuncs; - var nConsts = NumConsts; - long n = nFuncs + nConsts; + var nFuncs = NumFuncs(); + var nConsts = NumConsts(); + int n = nFuncs + nConsts; FuncDecl[] res = new FuncDecl[n]; - for (long i; i < nConsts; i++) - res[i] = new FuncDecl(Context, Native.modelGetConstDecl(Context().nCtx(), NativeObject(), i)); - for (long i; i < nFuncs; i++) - res[nConsts + i] = new FuncDecl(Context, Native.modelGetFuncDecl(Context().nCtx(), NativeObject(), i)); + for (int i = 0; i < nConsts; i++) + res[i] = new FuncDecl(Context(), Native.modelGetConstDecl(Context().nCtx(), NativeObject(), i)); + for (int i = 0; i < nFuncs; i++) + res[nConsts + i] = new FuncDecl(Context(), Native.modelGetFuncDecl(Context().nCtx(), NativeObject(), i)); return res; } @@ -180,10 +181,10 @@ import java.lang.Exception; long v = 0; - if (Native.modelEval(Context().nCtx(), NativeObject(), t.NativeObject, (completion) ? 1 : 0, v) == 0) + if (Native.modelEval(Context().nCtx(), NativeObject(), t.NativeObject(), (completion) ? true : false, v) ^ true) throw new ModelEvaluationFailedException(); else - return Expr.Create(Context, v); + return Expr.Create(Context(), v); } /** @@ -200,7 +201,7 @@ import java.lang.Exception; /** * The number of uninterpreted sorts that the model has an interpretation for. **/ - public long NumSorts () { return Native.modelGetNumSorts(Context().nCtx(), NativeObject()); } + public int NumSorts () { return Native.modelGetNumSorts(Context().nCtx(), NativeObject()); } /** * The uninterpreted sorts that the model has an interpretation for. @@ -216,10 +217,10 @@ import java.lang.Exception; { - long n = NumSorts; + int n = NumSorts(); Sort[] res = new Sort[n]; - for (long i; i < n; i++) - res[i] = Sort.Create(Context, Native.modelGetSort(Context().nCtx(), NativeObject(), i)); + for (int i = 0; i < n; i++) + res[i] = Sort.Create(Context(), Native.modelGetSort(Context().nCtx(), NativeObject(), i)); return res; } @@ -234,11 +235,11 @@ import java.lang.Exception; - ASTVector nUniv = new ASTVector(Context, Native.modelGetSortUniverse(Context().nCtx(), NativeObject(), s.NativeObject)); - long n = nUniv.Size; + ASTVector nUniv = new ASTVector(Context(), Native.modelGetSortUniverse(Context().nCtx(), NativeObject(), s.NativeObject())); + int n = nUniv.Size; Expr[] res = new Expr[n]; - for (long i; i < n; i++) - res[i] = Expr.Create(Context, nUniv[i].NativeObject); + for (int i = 0; i < n; i++) + res[i] = Expr.Create(Context(), nUniv[i].NativeObject()); return res; } @@ -271,13 +272,13 @@ import java.lang.Exception; void IncRef(long o) { - Context.Model_DRQ.IncAndClear(Context, o); + Context().Model_DRQ().IncAndClear(Context(), o); super.IncRef(o); } void DecRef(long o) { - Context.Model_DRQ.Add(o); + Context().Model_DRQ().Add(o); super.DecRef(o); } } diff --git a/src/api/java/com/Microsoft/Z3/Native.java b/src/api/java/com/Microsoft/Z3/Native.java index 261e0663f..e42d8b7ba 100644 --- a/src/api/java/com/Microsoft/Z3/Native.java +++ b/src/api/java/com/Microsoft/Z3/Native.java @@ -4,8 +4,8 @@ public final class Native { public static class IntPtr { public int value; } public static class LongPtr { public long value; } public static class StringPtr { public String value; } - public static class errorHandler {}; - static { System.loadLibrary(""); } + public static class errorHandler { public long ptr; } + static { System.loadLibrary(""); } public static native long mkConfig(); public static native void delConfig(long a0); public static native void setParamValue(long a0, String a1, String a2); diff --git a/src/api/java/com/Microsoft/Z3/ParamDescrs.java b/src/api/java/com/Microsoft/Z3/ParamDescrs.java index 37ee77b7e..edba1ceab 100644 --- a/src/api/java/com/Microsoft/Z3/ParamDescrs.java +++ b/src/api/java/com/Microsoft/Z3/ParamDescrs.java @@ -7,6 +7,7 @@ package com.Microsoft.Z3; import java.math.BigInteger; import java.util.*; import java.lang.Exception; +import com.Microsoft.Z3.Enumerations.*; /* using System; */ @@ -21,7 +22,7 @@ import java.lang.Exception; public void Validate(Params p) { - Native.paramsValidate(Context().nCtx(), p.NativeObject, NativeObject()); + Native.paramsValidate(Context().nCtx(), p.NativeObject(), NativeObject()); } /** @@ -30,7 +31,7 @@ import java.lang.Exception; public Z3_param_kind GetKind(Symbol name) { - return (Z3_param_kind)Native.paramDescrsGetKind(Context().nCtx(), NativeObject(), name.NativeObject); + return Z3_param_kind.fromInt(Native.paramDescrsGetKind(Context().nCtx(), NativeObject(), name.NativeObject())); } /** @@ -38,10 +39,10 @@ import java.lang.Exception; **/ public Symbol[] Names() { - long sz = Native.paramDescrsSize(Context().nCtx(), NativeObject()); + int sz = Native.paramDescrsSize(Context().nCtx(), NativeObject()); Symbol[] names = new Symbol[sz]; - for (long i; i < sz; ++i) { - names[i] = Symbol.Create(Context, Native.paramDescrsGetName(Context().nCtx(), NativeObject(), i)); + for (int i = 0; i < sz; ++i) { + names[i] = Symbol.Create(Context(), Native.paramDescrsGetName(Context().nCtx(), NativeObject(), i)); } return names; } @@ -49,7 +50,7 @@ import java.lang.Exception; /** * The size of the ParamDescrs. **/ - public long Size() { return Native.paramDescrsSize(Context().nCtx(), NativeObject()); } + public int Size() { return Native.paramDescrsSize(Context().nCtx(), NativeObject()); } /** * Retrieves a string representation of the ParamDescrs. @@ -79,13 +80,13 @@ import java.lang.Exception; void IncRef(long o) { - Context.ParamDescrs_DRQ.IncAndClear(Context, o); + Context().ParamDescrs_DRQ().IncAndClear(Context(), o); super.IncRef(o); } void DecRef(long o) { - Context.ParamDescrs_DRQ.Add(o); + Context().ParamDescrs_DRQ().Add(o); super.DecRef(o); } } diff --git a/src/api/java/com/Microsoft/Z3/Params.java b/src/api/java/com/Microsoft/Z3/Params.java index d5c042d74..1107a80ee 100644 --- a/src/api/java/com/Microsoft/Z3/Params.java +++ b/src/api/java/com/Microsoft/Z3/Params.java @@ -7,6 +7,7 @@ package com.Microsoft.Z3; import java.math.BigInteger; import java.util.*; import java.lang.Exception; +import com.Microsoft.Z3.Enumerations.*; /* using System; */ @@ -22,17 +23,17 @@ import java.lang.Exception; { - Native.paramsSetBool(Context().nCtx(), NativeObject(), name.NativeObject, (value) ? 1 : 0); + Native.paramsSetBool(Context().nCtx(), NativeObject(), name.NativeObject(), (value) ? true : false); } /** * Adds a parameter setting. **/ - public void Add(Symbol name, long value) + public void Add(Symbol name, int value) { - Native.paramsSetLong(Context().nCtx(), NativeObject(), name.NativeObject, value); + Native.paramsSetInt(Context().nCtx(), NativeObject(), name.NativeObject(), value); } /** @@ -42,7 +43,7 @@ import java.lang.Exception; { - Native.paramsSetDouble(Context().nCtx(), NativeObject(), name.NativeObject, value); + Native.paramsSetDouble(Context().nCtx(), NativeObject(), name.NativeObject(), value); } /** @@ -53,7 +54,7 @@ import java.lang.Exception; - Native.paramsSetSymbol(Context().nCtx(), NativeObject(), name.NativeObject, value.NativeObject); + Native.paramsSetSymbol(Context().nCtx(), NativeObject(), name.NativeObject(), value.NativeObject()); } /** @@ -61,15 +62,15 @@ import java.lang.Exception; **/ public void Add(String name, boolean value) { - Native.paramsSetBool(Context().nCtx(), NativeObject(), Context.MkSymbol(name).NativeObject, (value) ? 1 : 0); + Native.paramsSetBool(Context().nCtx(), NativeObject(), Context().MkSymbol(name).NativeObject(), (value) ? true : false); } /** * Adds a parameter setting. **/ - public void Add(String name, long value) + public void Add(String name, int value) { - Native.paramsSetLong(Context().nCtx(), NativeObject(), Context.MkSymbol(name).NativeObject, value); + Native.paramsSetInt(Context().nCtx(), NativeObject(), Context().MkSymbol(name).NativeObject(), value); } /** @@ -77,7 +78,7 @@ import java.lang.Exception; **/ public void Add(String name, double value) { - Native.paramsSetDouble(Context().nCtx(), NativeObject(), Context.MkSymbol(name).NativeObject, value); + Native.paramsSetDouble(Context().nCtx(), NativeObject(), Context().MkSymbol(name).NativeObject(), value); } /** @@ -87,7 +88,7 @@ import java.lang.Exception; { - Native.paramsSetSymbol(Context().nCtx(), NativeObject(), Context.MkSymbol(name).NativeObject, value.NativeObject); + Native.paramsSetSymbol(Context().nCtx(), NativeObject(), Context().MkSymbol(name).NativeObject(), value.NativeObject()); } /** @@ -118,13 +119,13 @@ import java.lang.Exception; void IncRef(long o) { - Context.Params_DRQ.IncAndClear(Context, o); + Context().Params_DRQ().IncAndClear(Context(), o); super.IncRef(o); } void DecRef(long o) { - Context.Params_DRQ.Add(o); + Context().Params_DRQ().Add(o); super.DecRef(o); } } diff --git a/src/api/java/com/Microsoft/Z3/Pattern.java b/src/api/java/com/Microsoft/Z3/Pattern.java index 0e87dc254..99fb53b9c 100644 --- a/src/api/java/com/Microsoft/Z3/Pattern.java +++ b/src/api/java/com/Microsoft/Z3/Pattern.java @@ -7,6 +7,7 @@ package com.Microsoft.Z3; import java.math.BigInteger; import java.util.*; import java.lang.Exception; +import com.Microsoft.Z3.Enumerations.*; /* using System; */ /* using System.Runtime.InteropServices; */ @@ -21,7 +22,7 @@ import java.lang.Exception; /** * The number of terms in the pattern. **/ - public long NumTerms() { return Native.getPatternNumTerms(Context().nCtx(), NativeObject()); } + public int NumTerms() { return Native.getPatternNumTerms(Context().nCtx(), NativeObject()); } /** * The terms in the pattern. @@ -30,10 +31,10 @@ import java.lang.Exception; { - long n = NumTerms; + int n = NumTerms(); Expr[] res = new Expr[n]; - for (long i; i < n; i++) - res[i] = Expr.Create(Context, Native.getPattern(Context().nCtx(), NativeObject(), i)); + for (int i = 0; i < n; i++) + res[i] = Expr.Create(Context(), Native.getPattern(Context().nCtx(), NativeObject(), i)); return res; } diff --git a/src/api/java/com/Microsoft/Z3/Probe.java b/src/api/java/com/Microsoft/Z3/Probe.java index 537e9ef7f..8d1ba1a97 100644 --- a/src/api/java/com/Microsoft/Z3/Probe.java +++ b/src/api/java/com/Microsoft/Z3/Probe.java @@ -7,6 +7,7 @@ package com.Microsoft.Z3; import java.math.BigInteger; import java.util.*; import java.lang.Exception; +import com.Microsoft.Z3.Enumerations.*; /* using System; */ /* using System.Runtime.InteropServices; */ @@ -29,8 +30,8 @@ import java.lang.Exception; { - Context.CheckContextMatch(g); - return Native.probeApply(Context().nCtx(), NativeObject(), g.NativeObject); + Context().CheckContextMatch(g); + return Native.probeApply(Context().nCtx(), NativeObject(), g.NativeObject()); } /** @@ -67,13 +68,13 @@ import java.lang.Exception; void IncRef(long o) { - Context.Probe_DRQ.IncAndClear(Context, o); + Context().Probe_DRQ().IncAndClear(Context(), o); super.IncRef(o); } void DecRef(long o) { - Context.Probe_DRQ.Add(o); + Context().Probe_DRQ().Add(o); super.DecRef(o); } } diff --git a/src/api/java/com/Microsoft/Z3/Quantifier.java b/src/api/java/com/Microsoft/Z3/Quantifier.java index 8b4df947e..ad05c544b 100644 --- a/src/api/java/com/Microsoft/Z3/Quantifier.java +++ b/src/api/java/com/Microsoft/Z3/Quantifier.java @@ -7,6 +7,7 @@ package com.Microsoft.Z3; import java.math.BigInteger; import java.util.*; import java.lang.Exception; +import com.Microsoft.Z3.Enumerations.*; /* using System; */ @@ -18,7 +19,7 @@ import java.lang.Exception; /** * Indicates whether the quantifier is universal. **/ - public boolean IsUniversal() { return Native.isQuantifierForall(Context().nCtx(), NativeObject()) != 0; } + public boolean IsUniversal() { return Native.isQuantifierForall(Context().nCtx(), NativeObject()) ; } /** * Indicates whether the quantifier is existential. @@ -28,12 +29,12 @@ import java.lang.Exception; /** * The weight of the quantifier. **/ - public long Weight() { return Native.getQuantifierWeight(Context().nCtx(), NativeObject()); } + public int Weight() { return Native.getQuantifierWeight(Context().nCtx(), NativeObject()); } /** * The number of patterns. **/ - public long NumPatterns() { return Native.getQuantifierNumPatterns(Context().nCtx(), NativeObject()); } + public int NumPatterns() { return Native.getQuantifierNumPatterns(Context().nCtx(), NativeObject()); } /** * The patterns. @@ -42,17 +43,17 @@ import java.lang.Exception; { - long n = NumPatterns; + int n = NumPatterns(); Pattern[] res = new Pattern[n]; - for (long i; i < n; i++) - res[i] = new Pattern(Context, Native.getQuantifierPatternAst(Context().nCtx(), NativeObject(), i)); + for (int i = 0; i < n; i++) + res[i] = new Pattern(Context(), Native.getQuantifierPatternAst(Context().nCtx(), NativeObject(), i)); return res; } /** * The number of no-patterns. **/ - public long NumNoPatterns() { return Native.getQuantifierNumNoPatterns(Context().nCtx(), NativeObject()); } + public int NumNoPatterns() { return Native.getQuantifierNumNoPatterns(Context().nCtx(), NativeObject()); } /** * The no-patterns. @@ -61,17 +62,17 @@ import java.lang.Exception; { - long n = NumNoPatterns; + int n = NumNoPatterns(); Pattern[] res = new Pattern[n]; - for (long i; i < n; i++) - res[i] = new Pattern(Context, Native.getQuantifierNoPatternAst(Context().nCtx(), NativeObject(), i)); + for (int i = 0; i < n; i++) + res[i] = new Pattern(Context(), Native.getQuantifierNoPatternAst(Context().nCtx(), NativeObject(), i)); return res; } /** * The number of bound variables. **/ - public long NumBound() { return Native.getQuantifierNumBound(Context().nCtx(), NativeObject()); } + public int NumBound() { return Native.getQuantifierNumBound(Context().nCtx(), NativeObject()); } /** * The symbols for the bound variables. @@ -80,10 +81,10 @@ import java.lang.Exception; { - long n = NumBound; + int n = NumBound(); Symbol[] res = new Symbol[n]; - for (long i; i < n; i++) - res[i] = Symbol.Create(Context, Native.getQuantifierBoundName(Context().nCtx(), NativeObject(), i)); + for (int i = 0; i < n; i++) + res[i] = Symbol.Create(Context(), Native.getQuantifierBoundName(Context().nCtx(), NativeObject(), i)); return res; } @@ -94,10 +95,10 @@ import java.lang.Exception; { - long n = NumBound; + int n = NumBound(); Sort[] res = new Sort[n]; - for (long i; i < n; i++) - res[i] = Sort.Create(Context, Native.getQuantifierBoundSort(Context().nCtx(), NativeObject(), i)); + for (int i = 0; i < n; i++) + res[i] = Sort.Create(Context(), Native.getQuantifierBoundSort(Context().nCtx(), NativeObject(), i)); return res; } @@ -108,10 +109,10 @@ import java.lang.Exception; { - return new BoolExpr(Context, Native.getQuantifierBody(Context().nCtx(), NativeObject())); + return new BoolExpr(Context(), Native.getQuantifierBody(Context().nCtx(), NativeObject())); } - Quantifier(Context ctx, boolean isForall, Sort[] sorts, Symbol[] names, Expr body, long weight, Pattern[] patterns, Expr[] noPatterns, Symbol quantifierID, Symbol skolemID) + Quantifier(Context ctx, boolean isForall, Sort[] sorts, Symbol[] names, Expr body, int weight, Pattern[] patterns, Expr[] noPatterns, Symbol quantifierID, Symbol skolemID) { super(ctx); @@ -123,38 +124,38 @@ import java.lang.Exception; - Context.CheckContextMatch(patterns); - Context.CheckContextMatch(noPatterns); - Context.CheckContextMatch(sorts); - Context.CheckContextMatch(names); - Context.CheckContextMatch(body); + Context().CheckContextMatch(patterns); + Context().CheckContextMatch(noPatterns); + Context().CheckContextMatch(sorts); + Context().CheckContextMatch(names); + Context().CheckContextMatch(body); - if (sorts.Length != names.Length) + if (sorts.length != names.length) throw new Z3Exception("Number of sorts does not match number of names"); long[] _patterns = AST.ArrayToNative(patterns); if (noPatterns == null && quantifierID == null && skolemID == null) { - NativeObject() = Native.mkQuantifier(ctx.nCtx(), (isForall) ? 1 : 0, weight, + NativeObject() = Native.mkQuantifier(ctx.nCtx(), (isForall) ? true : false, weight, AST.ArrayLength(patterns), AST.ArrayToNative(patterns), AST.ArrayLength(sorts), AST.ArrayToNative(sorts), Symbol.ArrayToNative(names), - body.NativeObject); + body.NativeObject()); } else { - NativeObject() = Native.mkQuantifierEx(ctx.nCtx(), (isForall) ? 1 : 0, weight, + NativeObject() = Native.mkQuantifierEx(ctx.nCtx(), (isForall) ? true : false, weight, AST.GetNativeObject(quantifierID), AST.GetNativeObject(skolemID), AST.ArrayLength(patterns), AST.ArrayToNative(patterns), AST.ArrayLength(noPatterns), AST.ArrayToNative(noPatterns), AST.ArrayLength(sorts), AST.ArrayToNative(sorts), Symbol.ArrayToNative(names), - body.NativeObject); + body.NativeObject()); } } - Quantifier(Context ctx, boolean isForall, Expr[] bound, Expr body, long weight, Pattern[] patterns, Expr[] noPatterns, Symbol quantifierID, Symbol skolemID) + Quantifier(Context ctx, boolean isForall, Expr[] bound, Expr body, int weight, Pattern[] patterns, Expr[] noPatterns, Symbol quantifierID, Symbol skolemID) { super(ctx); @@ -163,26 +164,26 @@ import java.lang.Exception; - Context.CheckContextMatch(noPatterns); - Context.CheckContextMatch(patterns); - //Context.CheckContextMatch(bound); - Context.CheckContextMatch(body); + Context().CheckContextMatch(noPatterns); + Context().CheckContextMatch(patterns); + //Context().CheckContextMatch(bound); + Context().CheckContextMatch(body); if (noPatterns == null && quantifierID == null && skolemID == null) { - NativeObject() = Native.mkQuantifierConst(ctx.nCtx(), (isForall) ? 1 : 0, weight, + NativeObject() = Native.mkQuantifierConst(ctx.nCtx(), (isForall) ? true : false, weight, AST.ArrayLength(bound), AST.ArrayToNative(bound), AST.ArrayLength(patterns), AST.ArrayToNative(patterns), - body.NativeObject); + body.NativeObject()); } else { - NativeObject() = Native.mkQuantifierConstEx(ctx.nCtx(), (isForall) ? 1 : 0, weight, + NativeObject() = Native.mkQuantifierConstEx(ctx.nCtx(), (isForall) ? true : false, weight, AST.GetNativeObject(quantifierID), AST.GetNativeObject(skolemID), AST.ArrayLength(bound), AST.ArrayToNative(bound), AST.ArrayLength(patterns), AST.ArrayToNative(patterns), AST.ArrayLength(noPatterns), AST.ArrayToNative(noPatterns), - body.NativeObject); + body.NativeObject()); } } diff --git a/src/api/java/com/Microsoft/Z3/RatNum.java b/src/api/java/com/Microsoft/Z3/RatNum.java index 7921e70ef..ad0982a95 100644 --- a/src/api/java/com/Microsoft/Z3/RatNum.java +++ b/src/api/java/com/Microsoft/Z3/RatNum.java @@ -7,6 +7,7 @@ package com.Microsoft.Z3; import java.math.BigInteger; import java.util.*; import java.lang.Exception; +import com.Microsoft.Z3.Enumerations.*; /* using System; */ /* using System.Numerics; */ @@ -23,7 +24,7 @@ import java.lang.Exception; { - return new IntNum(Context, Native.getNumerator(Context().nCtx(), NativeObject())); + return new IntNum(Context(), Native.getNumerator(Context().nCtx(), NativeObject())); } /** @@ -33,7 +34,7 @@ import java.lang.Exception; { - return new IntNum(Context, Native.getDenominator(Context().nCtx(), NativeObject())); + return new IntNum(Context(), Native.getDenominator(Context().nCtx(), NativeObject())); } /** @@ -41,8 +42,8 @@ import java.lang.Exception; **/ public BigInteger BigIntNumerator() { - IntNum n = Numerator; - return BigInteger.Parse(n.ToString()); + IntNum n = Numerator(); + return new BigInteger(n.toString()); } /** @@ -50,15 +51,15 @@ import java.lang.Exception; **/ public BigInteger BigIntDenominator() { - IntNum n = Denominator; - return BigInteger.Parse(n.ToString()); + IntNum n = Denominator(); + return new BigInteger(n.toString()); } /** * Returns a string representation in decimal notation. * The result has at most decimal places. **/ - public String ToDecimalString(long precision) + public String ToDecimalString(int precision) { return Native.getNumeralDecimalString(Context().nCtx(), NativeObject(), precision); } diff --git a/src/api/java/com/Microsoft/Z3/RealExpr.java b/src/api/java/com/Microsoft/Z3/RealExpr.java index 8f2b139bd..2f06e4643 100644 --- a/src/api/java/com/Microsoft/Z3/RealExpr.java +++ b/src/api/java/com/Microsoft/Z3/RealExpr.java @@ -7,6 +7,7 @@ package com.Microsoft.Z3; import java.math.BigInteger; import java.util.*; import java.lang.Exception; +import com.Microsoft.Z3.Enumerations.*; /* using System; */ /* using System.Collections.Generic; */ /* using System.Linq; */ diff --git a/src/api/java/com/Microsoft/Z3/RealSort.java b/src/api/java/com/Microsoft/Z3/RealSort.java index 39aa849ab..d85aeccd1 100644 --- a/src/api/java/com/Microsoft/Z3/RealSort.java +++ b/src/api/java/com/Microsoft/Z3/RealSort.java @@ -7,6 +7,7 @@ package com.Microsoft.Z3; import java.math.BigInteger; import java.util.*; import java.lang.Exception; +import com.Microsoft.Z3.Enumerations.*; /* using System; */ diff --git a/src/api/java/com/Microsoft/Z3/RelationSort.java b/src/api/java/com/Microsoft/Z3/RelationSort.java index 3948e1651..85f083b57 100644 --- a/src/api/java/com/Microsoft/Z3/RelationSort.java +++ b/src/api/java/com/Microsoft/Z3/RelationSort.java @@ -7,6 +7,7 @@ package com.Microsoft.Z3; import java.math.BigInteger; import java.util.*; import java.lang.Exception; +import com.Microsoft.Z3.Enumerations.*; /* using System; */ @@ -18,7 +19,7 @@ import java.lang.Exception; /** * The arity of the relation sort. **/ - public long Arity() { return Native.getRelationArity(Context().nCtx(), NativeObject()); } + public int Arity() { return Native.getRelationArity(Context().nCtx(), NativeObject()); } /** * The sorts of the columns of the relation sort. @@ -30,10 +31,10 @@ import java.lang.Exception; if (m_columnSorts != null) return m_columnSorts; - long n = Arity; + int n = Arity; Sort[] res = new Sort[n]; - for (long i; i < n; i++) - res[i] = Sort.Create(Context, Native.getRelationColumn(Context().nCtx(), NativeObject(), i)); + for (int i = 0; i < n; i++) + res[i] = Sort.Create(Context(), Native.getRelationColumn(Context().nCtx(), NativeObject(), i)); return res; } diff --git a/src/api/java/com/Microsoft/Z3/SetSort.java b/src/api/java/com/Microsoft/Z3/SetSort.java index 2f008f4db..2ed16c09b 100644 --- a/src/api/java/com/Microsoft/Z3/SetSort.java +++ b/src/api/java/com/Microsoft/Z3/SetSort.java @@ -7,6 +7,7 @@ package com.Microsoft.Z3; import java.math.BigInteger; import java.util.*; import java.lang.Exception; +import com.Microsoft.Z3.Enumerations.*; /* using System; */ @@ -20,7 +21,7 @@ import java.lang.Exception; } SetSort(Context ctx, Sort ty) - { super(ctx, Native.mkSetSort(ctx.nCtx(), ty.NativeObject)); + { super(ctx, Native.mkSetSort(ctx.nCtx(), ty.NativeObject())); } diff --git a/src/api/java/com/Microsoft/Z3/Solver.java b/src/api/java/com/Microsoft/Z3/Solver.java index a206114f1..5fda96bb1 100644 --- a/src/api/java/com/Microsoft/Z3/Solver.java +++ b/src/api/java/com/Microsoft/Z3/Solver.java @@ -7,6 +7,7 @@ package com.Microsoft.Z3; import java.math.BigInteger; import java.util.*; import java.lang.Exception; +import com.Microsoft.Z3.Enumerations.*; /* using System; */ @@ -32,14 +33,14 @@ import java.lang.Exception; { - Context.CheckContextMatch(value); - Native.solverSetParams(Context().nCtx(), NativeObject(), value.NativeObject); + Context().CheckContextMatch(value); + Native.solverSetParams(Context().nCtx(), NativeObject(), value.NativeObject()); } /** * Retrieves parameter descriptions for solver. **/ - public ParamDescrs ParameterDescriptions() { return new ParamDescrs(Context, Native.solverGetParamDescrs(Context().nCtx(), NativeObject())); } + public ParamDescrs ParameterDescriptions() { return new ParamDescrs(Context(), Native.solverGetParamDescrs(Context().nCtx(), NativeObject())); } /** @@ -47,7 +48,7 @@ import java.lang.Exception; * * **/ - public long NumScopes() { return Native.solverGetNumScopes(Context().nCtx(), NativeObject()); } + public int NumScopes() { return Native.solverGetNumScopes(Context().nCtx(), NativeObject()); } /** * Creates a backtracking point. @@ -63,7 +64,7 @@ import java.lang.Exception; * Note that an exception is thrown if is not smaller than NumScopes * **/ - public void Pop(long n) + public void Pop(int n) { Native.solverPop(Context().nCtx(), NativeObject(), n); } @@ -85,19 +86,19 @@ import java.lang.Exception; - Context.CheckContextMatch(constraints); - for (Iterator a = constraints.iterator(); a.hasNext(); ) + Context().CheckContextMatch(constraints); + for (BoolExpr a: constraints) { - Native.solverAssert(Context().nCtx(), NativeObject(), a.NativeObject); + Native.solverAssert(Context().nCtx(), NativeObject(), a.NativeObject()); } } /** * The number of assertions in the solver. **/ - public long NumAssertions() + public int NumAssertions() { - ASTVector ass = new ASTVector(Context, Native.solverGetAssertions(Context().nCtx(), NativeObject())); + ASTVector ass = new ASTVector(Context(), Native.solverGetAssertions(Context().nCtx(), NativeObject())); return ass.Size; } @@ -108,11 +109,11 @@ import java.lang.Exception; { - ASTVector ass = new ASTVector(Context, Native.solverGetAssertions(Context().nCtx(), NativeObject())); - long n = ass.Size; + ASTVector ass = new ASTVector(Context(), Native.solverGetAssertions(Context().nCtx(), NativeObject())); + int n = ass.Size; BoolExpr[] res = new BoolExpr[n]; - for (long i; i < n; i++) - res[i] = new BoolExpr(Context, ass[i].NativeObject); + for (int i = 0; i < n; i++) + res[i] = new BoolExpr(Context(), ass[i].NativeObject()); return res; } @@ -128,13 +129,13 @@ import java.lang.Exception; { Z3_lbool r; if (assumptions == null) - r = (Z3_lbool)Native.solverCheck(Context().nCtx(), NativeObject()); + r = Z3_lbool.fromInt(Native.solverCheck(Context().nCtx(), NativeObject())); else - r = (Z3_lbool)Native.solverCheckAssumptions(Context().nCtx(), NativeObject(), (long)assumptions.Length, AST.ArrayToNative(assumptions)); + r = Z3_lbool.fromInt(Native.solverCheckAssumptions(Context().nCtx(), NativeObject(), (int)assumptions.length, AST.ArrayToNative(assumptions))); switch (r) { - case Z3_lbool.Z3_L_TRUE: return Status.SATISFIABLE; - case Z3_lbool.Z3_L_FALSE: return Status.UNSATISFIABLE; + case Z3_L_TRUE: return Status.SATISFIABLE; + case Z3_L_FALSE: return Status.UNSATISFIABLE; default: return Status.UNKNOWN; } } @@ -152,7 +153,7 @@ import java.lang.Exception; if (x == 0) return null; else - return new Model(Context, x); + return new Model(Context(), x); } /** @@ -168,7 +169,7 @@ import java.lang.Exception; if (x == 0) return null; else - return Expr.Create(Context, x); + return Expr.Create(Context(), x); } /** @@ -183,11 +184,11 @@ import java.lang.Exception; { - ASTVector core = new ASTVector(Context, Native.solverGetUnsatCore(Context().nCtx(), NativeObject())); - long n = core.Size; + ASTVector core = new ASTVector(Context(), Native.solverGetUnsatCore(Context().nCtx(), NativeObject())); + int n = core.Size; Expr[] res = new Expr[n]; - for (long i; i < n; i++) - res[i] = Expr.Create(Context, core[i].NativeObject); + for (int i = 0; i < n; i++) + res[i] = Expr.Create(Context(), core[i].NativeObject()); return res; } @@ -208,7 +209,7 @@ import java.lang.Exception; { - return new Statistics(Context, Native.solverGetStatistics(Context().nCtx(), NativeObject())); + return new Statistics(Context(), Native.solverGetStatistics(Context().nCtx(), NativeObject())); } /** @@ -239,13 +240,13 @@ import java.lang.Exception; void IncRef(long o) { - Context.Solver_DRQ.IncAndClear(Context, o); + Context().Solver_DRQ().IncAndClear(Context(), o); super.IncRef(o); } void DecRef(long o) { - Context.Solver_DRQ.Add(o); + Context().Solver_DRQ().Add(o); super.DecRef(o); } } diff --git a/src/api/java/com/Microsoft/Z3/Sort.java b/src/api/java/com/Microsoft/Z3/Sort.java index d328071dd..f1933fccd 100644 --- a/src/api/java/com/Microsoft/Z3/Sort.java +++ b/src/api/java/com/Microsoft/Z3/Sort.java @@ -7,6 +7,7 @@ package com.Microsoft.Z3; import java.math.BigInteger; import java.util.*; import java.lang.Exception; +import com.Microsoft.Z3.Enumerations.*; /* using System; */ @@ -57,12 +58,12 @@ import java.lang.Exception; /** * Returns a unique identifier for the sort. **/ - public long Id() { return Native.getSortId(Context().nCtx(), NativeObject()); } + public int Id() { return Native.getSortId(Context().nCtx(), NativeObject()); } /** * The kind of the sort. **/ - public Z3_sort_kind SortKind() { return (Z3_sort_kind)Native.getSortKind(Context().nCtx(), NativeObject()); } + public Z3_sort_kind SortKind() { return Z3_sort_kind.fromInt(Native.getSortKind(Context().nCtx(), NativeObject())); } /** * The name of the sort @@ -70,7 +71,7 @@ import java.lang.Exception; public Symbol Name() { - return Symbol.Create(Context, Native.getSortName(Context().nCtx(), NativeObject())); + return Symbol.Create(Context(), Native.getSortName(Context().nCtx(), NativeObject())); } /** @@ -89,7 +90,7 @@ import java.lang.Exception; void CheckNativeObject(long obj) { - if (Native.getAstKind(Context().nCtx(), obj) != (long)Z3_ast_kind.Z3_SORT_AST) + if (Native.getAstKind(Context().nCtx(), obj) != Z3_ast_kind.Z3_SORT_AST.toInt()) throw new Z3Exception("Underlying object is not a sort"); super.CheckNativeObject(obj); } @@ -99,17 +100,17 @@ import java.lang.Exception; - switch ((Z3_sort_kind)Native.getSortKind(ctx.nCtx(), obj)) + switch (Z3_sort_kind.fromInt(Native.getSortKind(ctx.nCtx(), obj))) { - case Z3_sort_kind.Z3_ARRAY_SORT: return new ArraySort(ctx, obj); - case Z3_sort_kind.Z3_BOOL_SORT: return new BoolSort(ctx, obj); - case Z3_sort_kind.Z3_BV_SORT: return new BitVecSort(ctx, obj); - case Z3_sort_kind.Z3_DATATYPE_SORT: return new DatatypeSort(ctx, obj); - case Z3_sort_kind.Z3_INT_SORT: return new IntSort(ctx, obj); - case Z3_sort_kind.Z3_REAL_SORT: return new RealSort(ctx, obj); - case Z3_sort_kind.Z3_UNINTERPRETED_SORT: return new UninterpretedSort(ctx, obj); - case Z3_sort_kind.Z3_FINITE_DOMAIN_SORT: return new FiniteDomainSort(ctx, obj); - case Z3_sort_kind.Z3_RELATION_SORT: return new RelationSort(ctx, obj); + case Z3_ARRAY_SORT: return new ArraySort(ctx, obj); + case Z3_BOOL_SORT: return new BoolSort(ctx, obj); + case Z3_BV_SORT: return new BitVecSort(ctx, obj); + case Z3_DATATYPE_SORT: return new DatatypeSort(ctx, obj); + case Z3_INT_SORT: return new IntSort(ctx, obj); + case Z3_REAL_SORT: return new RealSort(ctx, obj); + case Z3_UNINTERPRETED_SORT: return new UninterpretedSort(ctx, obj); + case Z3_FINITE_DOMAIN_SORT: return new FiniteDomainSort(ctx, obj); + case Z3_RELATION_SORT: return new RelationSort(ctx, obj); default: throw new Z3Exception("Unknown sort kind"); } diff --git a/src/api/java/com/Microsoft/Z3/Statistics.java b/src/api/java/com/Microsoft/Z3/Statistics.java index d0f4021ed..ec64ee0b3 100644 --- a/src/api/java/com/Microsoft/Z3/Statistics.java +++ b/src/api/java/com/Microsoft/Z3/Statistics.java @@ -7,6 +7,7 @@ package com.Microsoft.Z3; import java.math.BigInteger; import java.util.*; import java.lang.Exception; +import com.Microsoft.Z3.Enumerations.*; /* using System; */ @@ -27,7 +28,7 @@ import java.lang.Exception; /** * The uint-value of the entry. **/ - public long UIntValue() { return m_long; } + public int UIntValue() { return m_int; } /** * The double-value of the entry. **/ @@ -35,7 +36,7 @@ import java.lang.Exception; /** * True if the entry is uint-valued. **/ - public boolean IsUInt() { return m_is_long; } + public boolean IsUInt() { return m_is_int; } /** * True if the entry is double-valued. **/ @@ -49,9 +50,9 @@ import java.lang.Exception; if (IsUInt) - return m_long.ToString(); + return m_int.toString(); else if (IsDouble) - return m_double.ToString(); + return m_double.toString(); else throw new Z3Exception("Unknown statistical entry type"); } @@ -64,15 +65,15 @@ import java.lang.Exception; return Key + ": " + Value; } - private boolean m_is_long = false; + private boolean m_is_int = false; private boolean m_is_double = false; - private long m_long = 0; + private int m_int = 0; private double m_double = 0.0; - Entry(String k, long v) + Entry(String k, int v) { Key = k; - m_is_long = true; - m_long = v; + m_is_int = true; + m_int = v; } Entry(String k, double v) { @@ -93,7 +94,7 @@ import java.lang.Exception; /** * The number of statistical data. **/ - public long Size() { return Native.statsSize(Context().nCtx(), NativeObject()); } + public int Size() { return Native.statsSize(Context().nCtx(), NativeObject()); } /** * The data entries. @@ -104,15 +105,15 @@ import java.lang.Exception; - long n = Size; + int n = Size; Entry[] res = new Entry[n]; - for (long i; i < n; i++) + for (int i = 0; i < n; i++) { Entry e; String k = Native.statsGetKey(Context().nCtx(), NativeObject(), i); - if (Native.statsIsLong(Context().nCtx(), NativeObject(), i) != 0) - e = new Entry(k, Native.statsGetLongValue(Context().nCtx(), NativeObject(), i)); - else if (Native.statsIsDouble(Context().nCtx(), NativeObject(), i) != 0) + if (Native.statsIsInt(Context().nCtx(), NativeObject(), i) ) + e = new Entry(k, Native.statsGetIntValue(Context().nCtx(), NativeObject(), i)); + else if (Native.statsIsDouble(Context().nCtx(), NativeObject(), i) ) e = new Entry(k, Native.statsGetDoubleValue(Context().nCtx(), NativeObject(), i)); else throw new Z3Exception("Unknown data entry value"); @@ -128,9 +129,9 @@ import java.lang.Exception; { - long n = Size; + int n = Size; String[] res = new String[n]; - for (long i; i < n; i++) + for (int i = 0; i < n; i++) res[i] = Native.statsGetKey(Context().nCtx(), NativeObject(), i); return res; } @@ -141,9 +142,9 @@ import java.lang.Exception; **/ public Entry get(String key) { - long n = Size; + int n = Size; Entry[] es = Entries; - for (long i; i < n; i++) + for (int i = 0; i < n; i++) if (es[i].Key == key) return es[i]; return null; @@ -169,13 +170,13 @@ import java.lang.Exception; void IncRef(long o) { - Context.Statistics_DRQ.IncAndClear(Context, o); + Context().Statistics_DRQ().IncAndClear(Context(), o); super.IncRef(o); } void DecRef(long o) { - Context.Statistics_DRQ.Add(o); + Context().Statistics_DRQ().Add(o); super.DecRef(o); } } diff --git a/src/api/java/com/Microsoft/Z3/Status.java b/src/api/java/com/Microsoft/Z3/Status.java index 9eb75060c..64bd9f767 100644 --- a/src/api/java/com/Microsoft/Z3/Status.java +++ b/src/api/java/com/Microsoft/Z3/Status.java @@ -7,27 +7,28 @@ package com.Microsoft.Z3; import java.math.BigInteger; import java.util.*; import java.lang.Exception; +import com.Microsoft.Z3.Enumerations.*; /* using System; */ /** * Status values. **/ - public enum Status + public class Status { /// /// Used to signify an unsatisfiable status. /// - UNSATISFIABLE (1), +public static final int UNSATISFIABLE = 1; /// /// Used to signify an unknown status. /// - UNKNOWN (0), +public static final int UNKNOWN = 0; /// /// Used to signify a satisfiable status. /// - SATISFIABLE (1) +public static final int SATISFIABLE = 1; } diff --git a/src/api/java/com/Microsoft/Z3/StringSymbol.java b/src/api/java/com/Microsoft/Z3/StringSymbol.java index 27157599d..1ff869002 100644 --- a/src/api/java/com/Microsoft/Z3/StringSymbol.java +++ b/src/api/java/com/Microsoft/Z3/StringSymbol.java @@ -7,6 +7,7 @@ package com.Microsoft.Z3; import java.math.BigInteger; import java.util.*; import java.lang.Exception; +import com.Microsoft.Z3.Enumerations.*; /* using System; */ /* using System.Runtime.InteropServices; */ diff --git a/src/api/java/com/Microsoft/Z3/Symbol.java b/src/api/java/com/Microsoft/Z3/Symbol.java index 54caf9f1c..b7653414d 100644 --- a/src/api/java/com/Microsoft/Z3/Symbol.java +++ b/src/api/java/com/Microsoft/Z3/Symbol.java @@ -7,6 +7,7 @@ package com.Microsoft.Z3; import java.math.BigInteger; import java.util.*; import java.lang.Exception; +import com.Microsoft.Z3.Enumerations.*; /* using System; */ /* using System.Runtime.InteropServices; */ @@ -19,7 +20,7 @@ import java.lang.Exception; /** * The kind of the symbol (int or string) **/ - protected Z3_symbol_kind Kind() { return (Z3_symbol_kind)Native.getSymbolKind(Context().nCtx(), NativeObject()); } + protected Z3_symbol_kind Kind() { return Z3_symbol_kind.fromInt(Native.getSymbolKind(Context().nCtx(), NativeObject())); } /** * Indicates whether the symbol is of Int kind @@ -43,7 +44,7 @@ import java.lang.Exception; public String toString() { if (IsIntSymbol()) - return ((IntSymbol)this).Int.ToString(); + return ((IntSymbol)this).Int.toString(); else if (IsStringSymbol()) return ((StringSymbol)this).String; else @@ -62,10 +63,10 @@ import java.lang.Exception; - switch ((Z3_symbol_kind)Native.getSymbolKind(ctx.nCtx(), obj)) + switch (Z3_symbol_kind.fromInt(Native.getSymbolKind(ctx.nCtx(), obj))) { - case Z3_symbol_kind.Z3_INT_SYMBOL: return new IntSymbol(ctx, obj); - case Z3_symbol_kind.Z3_STRING_SYMBOL: return new StringSymbol(ctx, obj); + case Z3_INT_SYMBOL: return new IntSymbol(ctx, obj); + case Z3_STRING_SYMBOL: return new StringSymbol(ctx, obj); default: throw new Z3Exception("Unknown symbol kind encountered"); } diff --git a/src/api/java/com/Microsoft/Z3/Tactic.java b/src/api/java/com/Microsoft/Z3/Tactic.java index 275205be5..fd560847a 100644 --- a/src/api/java/com/Microsoft/Z3/Tactic.java +++ b/src/api/java/com/Microsoft/Z3/Tactic.java @@ -7,6 +7,7 @@ package com.Microsoft.Z3; import java.math.BigInteger; import java.util.*; import java.lang.Exception; +import com.Microsoft.Z3.Enumerations.*; /* using System; */ @@ -32,7 +33,7 @@ import java.lang.Exception; /** * Retrieves parameter descriptions for Tactics. **/ - public ParamDescrs ParameterDescriptions() { return new ParamDescrs(Context, Native.tacticGetParamDescrs(Context().nCtx(), NativeObject())); } + public ParamDescrs ParameterDescriptions() { return new ParamDescrs(Context(), Native.tacticGetParamDescrs(Context().nCtx(), NativeObject())); } /** @@ -43,13 +44,13 @@ import java.lang.Exception; - Context.CheckContextMatch(g); + Context().CheckContextMatch(g); if (p == null) - return new ApplyResult(Context, Native.tacticApply(Context().nCtx(), NativeObject(), g.NativeObject)); + return new ApplyResult(Context(), Native.tacticApply(Context().nCtx(), NativeObject(), g.NativeObject())); else { - Context.CheckContextMatch(p); - return new ApplyResult(Context, Native.tacticApplyEx(Context().nCtx(), NativeObject(), g.NativeObject, p.NativeObject)); + Context().CheckContextMatch(p); + return new ApplyResult(Context(), Native.tacticApplyEx(Context().nCtx(), NativeObject(), g.NativeObject(), p.NativeObject())); } } @@ -72,7 +73,7 @@ import java.lang.Exception; { - return Context.MkSolver(this); + return Context().MkSolver(this); } Tactic(Context ctx, long obj) @@ -99,13 +100,13 @@ import java.lang.Exception; void IncRef(long o) { - Context.Tactic_DRQ.IncAndClear(Context, o); + Context().Tactic_DRQ().IncAndClear(Context(), o); super.IncRef(o); } void DecRef(long o) { - Context.Tactic_DRQ.Add(o); + Context().Tactic_DRQ().Add(o); super.DecRef(o); } } diff --git a/src/api/java/com/Microsoft/Z3/TupleSort.java b/src/api/java/com/Microsoft/Z3/TupleSort.java index 2e682343a..0ac03bb88 100644 --- a/src/api/java/com/Microsoft/Z3/TupleSort.java +++ b/src/api/java/com/Microsoft/Z3/TupleSort.java @@ -7,6 +7,7 @@ package com.Microsoft.Z3; import java.math.BigInteger; import java.util.*; import java.lang.Exception; +import com.Microsoft.Z3.Enumerations.*; /* using System; */ @@ -22,13 +23,13 @@ import java.lang.Exception; { - return new FuncDecl(Context, Native.getTupleSortMkDecl(Context().nCtx(), NativeObject())); + return new FuncDecl(Context(), Native.getTupleSortMkDecl(Context().nCtx(), NativeObject())); } /** * The number of fields in the tuple. **/ - public long NumFields() { return Native.getTupleSortNumFields(Context().nCtx(), NativeObject()); } + public int NumFields() { return Native.getTupleSortNumFields(Context().nCtx(), NativeObject()); } /** * The field declarations. @@ -37,20 +38,20 @@ import java.lang.Exception; { - long n = NumFields; + int n = NumFields(); FuncDecl[] res = new FuncDecl[n]; - for (long i; i < n; i++) - res[i] = new FuncDecl(Context, Native.getTupleSortFieldDecl(Context().nCtx(), NativeObject(), i)); + for (int i = 0; i < n; i++) + res[i] = new FuncDecl(Context(), Native.getTupleSortFieldDecl(Context().nCtx(), NativeObject(), i)); return res; } - TupleSort(Context ctx, Symbol name, long numFields, Symbol[] fieldNames, Sort[] fieldSorts) + TupleSort(Context ctx, Symbol name, int numFields, Symbol[] fieldNames, Sort[] fieldSorts) { super(ctx); long t = 0; - NativeObject() = Native.mkTupleSort(ctx.nCtx(), name.NativeObject, numFields, + NativeObject() = Native.mkTupleSort(ctx.nCtx(), name.NativeObject(), numFields, Symbol.ArrayToNative(fieldNames), AST.ArrayToNative(fieldSorts), t, new long[numFields]); } diff --git a/src/api/java/com/Microsoft/Z3/UninterpretedSort.java b/src/api/java/com/Microsoft/Z3/UninterpretedSort.java index f8b91103c..3c732901d 100644 --- a/src/api/java/com/Microsoft/Z3/UninterpretedSort.java +++ b/src/api/java/com/Microsoft/Z3/UninterpretedSort.java @@ -7,6 +7,7 @@ package com.Microsoft.Z3; import java.math.BigInteger; import java.util.*; import java.lang.Exception; +import com.Microsoft.Z3.Enumerations.*; /* using System; */ @@ -20,7 +21,7 @@ import java.lang.Exception; } UninterpretedSort(Context ctx, Symbol s) - { super(ctx, Native.mkUninterpretedSort(ctx.nCtx(), s.NativeObject)); + { super(ctx, Native.mkUninterpretedSort(ctx.nCtx(), s.NativeObject())); } diff --git a/src/api/java/com/Microsoft/Z3/Version.java b/src/api/java/com/Microsoft/Z3/Version.java index ecf451e2f..c3fc4268d 100644 --- a/src/api/java/com/Microsoft/Z3/Version.java +++ b/src/api/java/com/Microsoft/Z3/Version.java @@ -7,6 +7,7 @@ package com.Microsoft.Z3; import java.math.BigInteger; import java.util.*; import java.lang.Exception; +import com.Microsoft.Z3.Enumerations.*; /* using System; */ @@ -21,9 +22,9 @@ import java.lang.Exception; /** * The major version **/ - public long Major() + public int Major() { - long major = 0, minor = 0, build = 0, revision = 0; + int major = 0, minor = 0, build = 0, revision = 0; Native.getVersion(major, minor, build, revision); return major; } @@ -31,9 +32,9 @@ import java.lang.Exception; /** * The minor version **/ - public long Minor() + public int Minor() { - long major = 0, minor = 0, build = 0, revision = 0; + int major = 0, minor = 0, build = 0, revision = 0; Native.getVersion(major, minor, build, revision); return minor; } @@ -41,9 +42,9 @@ import java.lang.Exception; /** * The build version **/ - public long Build() + public int Build() { - long major = 0, minor = 0, build = 0, revision = 0; + int major = 0, minor = 0, build = 0, revision = 0; Native.getVersion(major, minor, build, revision); return build; } @@ -51,9 +52,9 @@ import java.lang.Exception; /** * The revision **/ - public long Revision() + public int Revision() { - long major = 0, minor = 0, build = 0, revision = 0; + int major = 0, minor = 0, build = 0, revision = 0; Native.getVersion(major, minor, build, revision); return revision; } @@ -65,8 +66,8 @@ import java.lang.Exception; { - long major = 0, minor = 0, build = 0, revision = 0; + int major = 0, minor = 0, build = 0, revision = 0; Native.getVersion(major, minor, build, revision); - return major.ToString() + "." + minor.ToString() + "." + build.ToString() + "." + revision.ToString(); + return major.toString() + "." + minor.toString() + "." + build.toString() + "." + revision.toString(); } } diff --git a/src/api/java/com/Microsoft/Z3/Z3Exception.java b/src/api/java/com/Microsoft/Z3/Z3Exception.java index 0bca047ab..7036558c7 100644 --- a/src/api/java/com/Microsoft/Z3/Z3Exception.java +++ b/src/api/java/com/Microsoft/Z3/Z3Exception.java @@ -7,6 +7,7 @@ package com.Microsoft.Z3; import java.math.BigInteger; import java.util.*; import java.lang.Exception; +import com.Microsoft.Z3.Enumerations.*; /* using System; */ diff --git a/src/api/java/com/Microsoft/Z3/Z3Object.java b/src/api/java/com/Microsoft/Z3/Z3Object.java index 6a8392a86..d4bdf08f7 100644 --- a/src/api/java/com/Microsoft/Z3/Z3Object.java +++ b/src/api/java/com/Microsoft/Z3/Z3Object.java @@ -7,6 +7,7 @@ package com.Microsoft.Z3; import java.math.BigInteger; import java.util.*; import java.lang.Exception; +import com.Microsoft.Z3.Enumerations.*; /* using System; */ @@ -105,14 +106,14 @@ import java.lang.Exception; if (a == null) return null; - long[] an = new long[a.Length]; - for (long i; i < a.Length; i++) + long[] an = new long[a.length]; + for (int i = 0; i < a.length; i++) if (a[i] != null) an[i] = a[i].NativeObject(); return an; } - static long ArrayLength(Z3Object[] a) + static int ArrayLength(Z3Object[] a) { - return (a == null)?0:(long)a.Length; + return (a == null)?0:(int)a.length; } } diff --git a/src/api/java/mk_java.py b/src/api/java/mk_java.py index 81b4a08b6..fe7f50a25 100644 --- a/src/api/java/mk_java.py +++ b/src/api/java/mk_java.py @@ -11,14 +11,29 @@ CS="../dotnet/" EXT=".cs" EXCLUDE=["Enumerations.cs", "Native.cs", "AssemblyInfo.cs"] OUTDIR="com/Microsoft/Z3/" +ENUMS_FILE = "Enumerations.cs" import os import fileinput import string import re +EXCLUDE_METHODS = [ [ "Context.cs", "public Expr MkNumeral(ulong" ], + [ "Context.cs", "public Expr MkNumeral(uint" ], + [ "Context.cs", "public RatNum MkReal(ulong" ], + [ "Context.cs", "public RatNum MkReal(uint" ], + [ "Context.cs", "public IntNum MkInt(ulong" ], + [ "Context.cs", "public IntNum MkInt(uint" ], + [ "Context.cs", "public BitVecNum MkBV(ulong" ], + [ "Context.cs", "public BitVecNum MkBV(uint" ], + ] + +ENUMS = [] + def mk_java_bindings(): - print "Generating Java bindings (from C# bindings in " + CS + ")." + print "Generating Java bindings (from C# bindings in " + CS + ")..." + print "Finding enumerations in " + ENUMS_FILE + "..." + find_enums(ENUMS_FILE) for root, dirs, files in os.walk(CS): for fn in files: if not fn in EXCLUDE and fn.endswith(EXT): @@ -31,14 +46,14 @@ def subst_getters(s, getters): def type_replace(s): s = s.replace(" bool", " boolean") s = s.replace("(bool", "(boolean") - s = s.replace("uint", "long") + s = s.replace("uint", "int") s = s.replace("ulong", "long") s = s.replace("string", "String") s = s.replace("IntPtr", "long") s = s.replace("Dictionary<", "Map<") s = s.replace("UInt64", "long") s = s.replace("Int64", "long") - s = s.replace("List", "List") + s = s.replace("List", "LinkedList") s = s.replace("System.Exception", "Exception") return s @@ -55,12 +70,54 @@ def rename_native(s): s = c0 + c1 + c2 return s +def find_enums(fn): + for line in fileinput.input(os.path.join(CS, fn)): + s = string.rstrip(string.lstrip(line)) + if s.startswith("public enum"): + ENUMS.append(s.split(" ")[2]) + + +def enum_replace(line): + for e in ENUMS: + if line.find("case") != -1: + line = line.replace(e + ".", "") + elif line.find("== (int)") != -1 or line.find("!= (int)") != -1: + line = re.sub("\(int\)" + e + "\.(?P[A-Z0-9_]*)", e + ".\g.toInt()", line) + elif line.find("==") != -1 or line.find("!=") != -1: + line = re.sub(e + "\.(?P[A-Z0-9_]*)", e + ".\g", line) + else: + # line = re.sub("\(\(" + e + "\)(?P.*\(.*)\)", "(" + e + ".values()[\g])", line) + line = re.sub("\(" + e + "\)(?P.*\(.*\))", e + ".fromInt(\g)", line) + return line + def replace_generals(a): a = re.sub(" NativeObject", " NativeObject()", a) - a = re.sub(".NativeObject;", ".NativeObject();", a) - a = re.sub("Context.nCtx", "Context().nCtx()", a) - a = re.sub("ctx.nCtx", "ctx.nCtx()", a) + a = re.sub("\.NativeObject", ".NativeObject()", a) + a = re.sub("(?P[\.\(])Id", "\gId()", a) + a = a.replace("(Context ==", "(Context() ==") + a = a.replace("(Context,", "(Context(),") + a = a.replace("Context.", "Context().") + a = a.replace(".nCtx", ".nCtx()") + a = a.replace("(nCtx", "(nCtx()") + a = re.sub("Context\(\).(?P[^_]*)_DRQ", "Context().\g_DRQ()", a) a = re.sub("ASTKind", "ASTKind()", a) + a = re.sub("IsExpr(?P[ ;])", "IsExpr()\g", a) + a = re.sub("IsNumeral(?P[ ;])", "IsNumeral()\g", a) + a = re.sub("IsInt(?P[ ;])", "IsInt()\g", a) + a = re.sub("IsReal(?P[ ;])", "IsReal()\g", a) + a = re.sub("IsVar(?P[ ;\)])", "IsVar()\g", a) + a = re.sub("FuncDecl.DeclKind", "FuncDecl().DeclKind()", a) + a = re.sub("FuncDecl.DomainSize", "FuncDecl().DomainSize()", a) + a = re.sub("(?P[=&]) Num(?P[a-zA-Z]*)", "\g Num\g()", a) + a = re.sub("= Denominator", "= Denominator()", a) + a = re.sub(", BoolSort(?P[\)\.])", ", BoolSort()\g", a) + a = re.sub(", RealSort(?P[\)\.])", ", RealSort()\g", a) + a = re.sub(", IntSort(?P[\)\.])", ", IntSort()\g", a) + a = a.replace("? 1 : 0", "? true : false") + if a.find("Native.") != -1 and a.find("!= 0") != -1: + a = a.replace("!= 0", "") + if a.find("Native.") != -1 and a.find("== 0") != -1: + a = a.replace("== 0", "^ true") return a def translate(filename): @@ -82,6 +139,8 @@ def translate(filename): in_getter_set = 0 had_ulong_res = 0 in_enum = 0 + missing_foreach_brace = 0 + foreach_opened_brace = 0 for line in fileinput.input(os.path.join(CS, filename)): s = string.rstrip(string.lstrip(line)) if in_javadoc: @@ -104,6 +163,13 @@ def translate(filename): tgt.write(t + " **/\n") in_javadoc = 0 + for i in range(0, len(EXCLUDE_METHODS)): + if filename == EXCLUDE_METHODS[i][0] and s.startswith(EXCLUDE_METHODS[i][1]): + tgt.write(t + "/* Not translated because it would translate to a function with clashing types. */\n") + in_unsupported = 1 + break + + if in_unsupported: if s == "}": in_unsupported = 0 @@ -119,6 +185,7 @@ def translate(filename): tgt.write("import java.math.BigInteger;\n") tgt.write("import java.util.*;\n") tgt.write("import java.lang.Exception;\n") + tgt.write("import com.Microsoft.Z3.Enumerations.*;\n") elif in_header == 1: # tgt.write(" * " + line.replace(filename, tgtfn)) pass @@ -134,14 +201,15 @@ def translate(filename): tgt.write(t + "/* Overloaded operators are not translated. */\n") in_unsupported = 1 elif s.startswith("public enum"): - tgt.write(line) + tgt.write(line.replace("enum", "class")) in_enum = 1 elif in_enum == 1: if s == "}": tgt.write(line) in_enum = 0 else: - tgt.write(re.sub("(?P.*)\W*=\W*(?P[^\n,])", "\g (\g)", line)) + line = re.sub("(?P.*)\W*=\W*(?P[^\n,])", "public static final int \g = \g;", line) + tgt.write(line.replace(",","")) elif s.startswith("public class") or s.startswith("internal class") or s.startswith("internal abstract class"): a = line.replace(":", "extends").replace("internal ", "") a = a.replace(", IComparable", "") @@ -164,7 +232,7 @@ def translate(filename): s = s.replace("internal virtual", "") s = s.replace("internal", "") tokens = s.split(" ") - print "TOKENS: " + str(len(tokens)) + # print "TOKENS: " + str(len(tokens)) if len(tokens) == 3: in_getter = tokens[2] in_getter_type = type_replace((tokens[0] + " " + tokens[1])) @@ -204,6 +272,7 @@ def translate(filename): rest = type_replace(rest) rest = rename_native(rest) rest = replace_generals(rest) + rest = enum_replace(rest) t = "" for i in range(0, lastindent): t += " " @@ -225,6 +294,7 @@ def translate(filename): subst_getters(rest, getters) rest = rename_native(rest) rest = replace_generals(rest) + rest = enum_replace(rest) if in_bracket_op: tgt.write(d + rest) else: @@ -240,6 +310,7 @@ def translate(filename): rest = type_replace(rest) rest = rename_native(rest) rest = replace_generals(rest) + rest = enum_replace(rest) if in_bracket_op: tgt.write(t + in_getter_type + " " + in_getter + " " + rest + "\n") else: @@ -257,6 +328,7 @@ def translate(filename): rest = type_replace(rest) rest = rename_native(rest) rest = replace_generals(rest) + rest = enum_replace(rest) ac_acc = in_getter_type[:in_getter_type.find(' ')] ac_type = in_getter_type[in_getter_type.find(' ')+1:] if in_bracket_op: @@ -301,19 +373,43 @@ def translate(filename): else: for i in range(0, mbraces): line = line.replace("\n", "}\n") - if s.find("(") != -1: + if (s.find("public") != -1 or s.find("protected") != -1 or s.find("internal") != -1) and s.find("(") != -1: line = re.sub(" = [\w.]+(?P[,;\)])", "\g", line) a = type_replace(line) + a = enum_replace(a) a = re.sub("(?P[\(, ])params ", "\g", a) a = a.replace("base.", "super.") a = re.sub("Contract.\w+\([\s\S]*\);", "", a) a = rename_native(a) a = re.sub("~\w+\(\)", "protected void finalize()", a) + + if missing_foreach_brace == 1: + # a = a.replace("\n", " // checked " + str(foreach_opened_brace) + "\n") + if foreach_opened_brace == 0 and a.find("{") != -1: + foreach_opened_brace = 1 + elif foreach_opened_brace == 0 and a.find("}") == -1: + a = a.replace("\n", "}}\n") + foreach_opened_brace = 0 + missing_foreach_brace = 0 + elif foreach_opened_brace == 1 and a.find("}") != -1: + a = a.replace("\n", "}}\n") + foreach_opened_brace = 0 + missing_foreach_brace = 0 + +# if a.find("foreach") != -1: +# missing_foreach_brace = 1 +# a = re.sub("foreach\s*\((?P[\w <>,]+)\s+(?P\w+)\s+in\s+(?P\w+)\)", + # "{ Iterator fe_i = \g.iterator(); while (fe_i.hasNext()) { \g \g = (long)fe_i.next(); ", +# a) a = re.sub("foreach\s*\((?P[\w <>,]+)\s+(?P\w+)\s+in\s+(?P\w+)\)", - "for (Iterator \g = \g.iterator(); \g.hasNext(); )", a) + "for (\g \g: \g)", + a) + if a.find("long o: m_queue") != -1: + a = a.replace("long", "Long") a = a.replace("readonly ", "") a = a.replace("const ", "final ") a = a.replace("String ToString", "String toString") + a = a.replace(".ToString", ".toString") a = a.replace("internal ", "") a = a.replace("new static", "static") a = a.replace("new public", "public") @@ -333,6 +429,13 @@ def translate(filename): a = a.replace("out res", "res") a = a.replace("GC.ReRegisterForFinalize(m_ctx);", "") a = a.replace("GC.SuppressFinalize(this);", "") + a = a.replace(".Length", ".length") + a = a.replace("m_queue.Count", "m_queue.size()") + a = a.replace("m_queue.Add", "m_queue.add") + a = a.replace("m_queue.Clear", "m_queue.clear") + a = a.replace("for (long ", "for (int ") + a = a.replace("ReferenceEquals(Context, ctx)", "Context() == ctx") + a = a.replace("BigInteger.Parse", "new BigInteger") if had_ulong_res == 0 and a.find("ulong res = 0") != -1: a = a.replace("ulong res = 0;", "LongPtr res = new LongPtr();") elif had_ulong_res == 1: @@ -348,7 +451,6 @@ def translate(filename): a = re.sub("NativeObject = (?P.*);", "setNativeObject(\g);", a) a = replace_generals(a) tgt.write(a) - tgt.close() mk_java_bindings() From b456be1151e14d08501fb9b629f3d0382b6c9dbe Mon Sep 17 00:00:00 2001 From: Nikolaj Bjorner Date: Mon, 26 Nov 2012 14:00:20 -0800 Subject: [PATCH 5/6] fix documentation string in python API Signed-off-by: Nikolaj Bjorner --- src/api/python/z3.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/api/python/z3.py b/src/api/python/z3.py index a71db82c5..84724e51e 100644 --- a/src/api/python/z3.py +++ b/src/api/python/z3.py @@ -635,7 +635,7 @@ class FuncDeclRef(AstRef): args = _get_args(args) num = len(args) if __debug__: - _z3_assert(num == self.arity(), "Incorrect number of arguments") + _z3_assert(num == self.arity(), "Incorrect number of arguments to %s" % self) _args = (Ast * num)() saved = [] for i in range(num): @@ -1735,7 +1735,7 @@ class ArithSortRef(SortRef): """Real and Integer sorts.""" def is_real(self): - """Return `True` if `self` is the integer sort. + """Return `True` if `self` is of the sort Real. >>> x = Real('x') >>> x.is_real() @@ -1749,7 +1749,7 @@ class ArithSortRef(SortRef): return self.kind() == Z3_REAL_SORT def is_int(self): - """Return `True` if `self` is the real sort. + """Return `True` if `self` is of the sort Integer. >>> x = Int('x') >>> x.is_int() From 589665f00e20aedcad29065e2cc738167dd1fa3d Mon Sep 17 00:00:00 2001 From: Nikolaj Bjorner Date: Mon, 26 Nov 2012 14:01:06 -0800 Subject: [PATCH 6/6] set low-level pretty printer by default from fixedpoint context Signed-off-by: Nikolaj Bjorner --- src/ast/ast_smt_pp.cpp | 23 ++++++++++++++++++++++- src/ast/ast_smt_pp.h | 9 +++++---- src/muz_qe/dl_context.cpp | 23 +++++++++++------------ 3 files changed, 38 insertions(+), 17 deletions(-) diff --git a/src/ast/ast_smt_pp.cpp b/src/ast/ast_smt_pp.cpp index 713727f05..f18e6a78e 100644 --- a/src/ast/ast_smt_pp.cpp +++ b/src/ast/ast_smt_pp.cpp @@ -949,6 +949,10 @@ public: mark.mark(s, true); } + void operator()(sort* s) { + ast_mark mark; + pp_sort_decl(mark, s); + } void operator()(func_decl* d) { if (m_is_smt2) { @@ -962,7 +966,6 @@ public: m_out << ") "; visit_sort(d->get_range()); m_out << ")"; - newline(); } else { m_out << "("; @@ -1021,6 +1024,22 @@ void ast_smt_pp::display_expr_smt2(std::ostream& strm, expr* n, unsigned indent, p(n); } +void ast_smt_pp::display_ast_smt2(std::ostream& strm, ast* a, unsigned indent, unsigned num_var_names, char const* const* var_names) { + ptr_vector ql; + smt_renaming rn; + smt_printer p(strm, m_manager, ql, rn, m_logic, false, true, m_simplify_implies, indent, num_var_names, var_names); + if (is_expr(a)) { + p(to_expr(a)); + } + else if (is_func_decl(a)) { + p(to_func_decl(a)); + } + else { + SASSERT(is_sort(a)); + p(to_sort(a)); + } +} + void ast_smt_pp::display_smt2(std::ostream& strm, expr* n) { ptr_vector ql; @@ -1071,6 +1090,7 @@ void ast_smt_pp::display_smt2(std::ostream& strm, expr* n) { if (!(*m_is_declared)(d)) { smt_printer p(strm, m_manager, ql, rn, m_logic, true, true, m_simplify_implies, 0); p(d); + strm << "\n"; } } @@ -1079,6 +1099,7 @@ void ast_smt_pp::display_smt2(std::ostream& strm, expr* n) { if (!(*m_is_declared)(d)) { smt_printer p(strm, m_manager, ql, rn, m_logic, true, true, m_simplify_implies, 0); p(d); + strm << "\n"; } } diff --git a/src/ast/ast_smt_pp.h b/src/ast/ast_smt_pp.h index 36d4ced2e..97527759a 100644 --- a/src/ast/ast_smt_pp.h +++ b/src/ast/ast_smt_pp.h @@ -79,22 +79,23 @@ public: void display_smt2(std::ostream& strm, expr* n); void display_expr(std::ostream& strm, expr* n); void display_expr_smt2(std::ostream& strm, expr* n, unsigned indent = 0, unsigned num_var_names = 0, char const* const* var_names = 0); + void display_ast_smt2(std::ostream& strm, ast* n, unsigned indent = 0, unsigned num_var_names = 0, char const* const* var_names = 0); }; struct mk_smt_pp { - expr * m_expr; + ast* m_ast; ast_manager& m_manager; unsigned m_indent; unsigned m_num_var_names; char const* const* m_var_names; - mk_smt_pp(expr* e, ast_manager & m, unsigned indent = 0, unsigned num_var_names = 0, char const* const* var_names = 0) : - m_expr(e), m_manager(m), m_indent(indent), m_num_var_names(num_var_names), m_var_names(var_names) {} + mk_smt_pp(ast* e, ast_manager & m, unsigned indent = 0, unsigned num_var_names = 0, char const* const* var_names = 0) : + m_ast(e), m_manager(m), m_indent(indent), m_num_var_names(num_var_names), m_var_names(var_names) {} }; inline std::ostream& operator<<(std::ostream& out, const mk_smt_pp & p) { ast_smt_pp pp(p.m_manager); - pp.display_expr_smt2(out, p.m_expr, p.m_indent, p.m_num_var_names, p.m_var_names); + pp.display_ast_smt2(out, p.m_ast, p.m_indent, p.m_num_var_names, p.m_var_names); return out; } diff --git a/src/muz_qe/dl_context.cpp b/src/muz_qe/dl_context.cpp index 77b391ef7..f11c9852d 100644 --- a/src/muz_qe/dl_context.cpp +++ b/src/muz_qe/dl_context.cpp @@ -994,6 +994,7 @@ namespace datalog { p.insert(":profile-timeout-milliseconds", CPK_UINT, "instructions and rules that took less than the threshold will not be printed when printed the instruction/rule list"); p.insert(":print-with-fixedpoint-extensions", CPK_BOOL, "(default true) use SMT-LIB2 fixedpoint extensions, instead of pure SMT2, when printing rules"); + p.insert(":print-low-level-smt2", CPK_BOOL, "(default true) use (faster) low-level SMT2 printer (the printer is scalable but the result may not be as readable)"); PRIVATE_PARAMS( p.insert(":dbg-fpr-nonempty-relation-signature", CPK_BOOL, @@ -1650,6 +1651,9 @@ namespace datalog { expr_ref_vector rules(m); svector names; bool use_fixedpoint_extensions = m_params.get_bool(":print-with-fixedpoint-extensions", true); + bool print_low_level = m_params.get_bool(":print-low-level-smt2", true); + +#define PP(_e_) if (print_low_level) out << mk_smt_pp(_e_, m); else ast_smt2_pp(out, _e_, env, params); get_rules_as_formulas(rules, names); @@ -1684,18 +1688,18 @@ namespace datalog { obj_hashtable& sorts = visitor.sorts(); obj_hashtable::iterator sit = sorts.begin(), send = sorts.end(); for (; sit != send; ++sit) { - ast_smt2_pp(out, *sit, env, params); + PP(*sit); } for (; it != end; ++it) { func_decl* f = *it; - ast_smt2_pp(out, f, env, params); + PP(f); out << "\n"; } it = rels.begin(); end = rels.end(); for (; it != end; ++it) { func_decl* f = *it; out << "(declare-rel " << f->get_name() << " ("; - for (unsigned i = 0; i < f->get_arity(); ++i) { + for (unsigned i = 0; i < f->get_arity(); ++i) { ast_smt2_pp(out, f->get_domain(i), env, params); if (i + 1 < f->get_arity()) { out << " "; @@ -1714,7 +1718,7 @@ namespace datalog { for (unsigned i = 0; i < num_axioms; ++i) { out << "(assert "; - ast_smt2_pp(out, axioms[i], env, params); + PP(axioms[i]); out << ")\n"; } for (unsigned i = 0; i < rules.size(); ++i) { @@ -1724,12 +1728,7 @@ namespace datalog { if (symbol::null != nm) { out << "(! "; } - if (use_fixedpoint_extensions) { - ast_smt2_pp(out, r, env, params); - } - else { - out << mk_smt_pp(r, m); - } + PP(r); if (symbol::null != nm) { while (fresh_names.contains(nm)) { std::ostringstream s; @@ -1744,7 +1743,7 @@ namespace datalog { if (use_fixedpoint_extensions) { for (unsigned i = 0; i < num_queries; ++i) { out << "(query "; - ast_smt2_pp(out, queries[i], env, params); + PP(queries[i]); out << ")\n"; } } @@ -1754,7 +1753,7 @@ namespace datalog { out << "(assert "; expr_ref q(m); q = m.mk_not(queries[i]); - ast_smt2_pp(out, q, env, params); + PP(q); out << ")\n"; out << "(check-sat)\n"; if (num_queries > 1) out << "(pop)\n";