From e13b61eae8ed780a52358102d2aa8ff86d4832bc Mon Sep 17 00:00:00 2001 From: Nikolaj Bjorner Date: Mon, 2 Jul 2018 11:10:37 -0700 Subject: [PATCH] work around regression with use of mk_app_core, returning BR_FAILED if nothing is rewritten Signed-off-by: Nikolaj Bjorner --- src/api/dotnet/Context.cs | 12 ++++++------ src/smt/theory_seq.cpp | 2 +- src/solver/smt_logics.cpp | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/api/dotnet/Context.cs b/src/api/dotnet/Context.cs index 325758263..c8decb59b 100644 --- a/src/api/dotnet/Context.cs +++ b/src/api/dotnet/Context.cs @@ -2777,25 +2777,25 @@ namespace Microsoft.Z3 /// /// Create an at-most-k constraint. /// - public BoolExpr MkAtMost(BoolExpr[] args, uint k) + public BoolExpr MkAtMost(IEnumerable args, uint k) { Contract.Requires(args != null); Contract.Requires(Contract.Result() != null); CheckContextMatch(args); - return new BoolExpr(this, Native.Z3_mk_atmost(nCtx, (uint) args.Length, - AST.ArrayToNative(args), k)); + return new BoolExpr(this, Native.Z3_mk_atmost(nCtx, (uint) args.Count(), + AST.EnumToNative(args), k)); } /// /// Create an at-least-k constraint. /// - public BoolExpr MkAtLeast(BoolExpr[] args, uint k) + public BoolExpr MkAtLeast(IEnumerable args, uint k) { Contract.Requires(args != null); Contract.Requires(Contract.Result() != null); CheckContextMatch(args); - return new BoolExpr(this, Native.Z3_mk_atleast(nCtx, (uint) args.Length, - AST.ArrayToNative(args), k)); + return new BoolExpr(this, Native.Z3_mk_atleast(nCtx, (uint) args.Count(), + AST.EnumToNative(args), k)); } /// diff --git a/src/smt/theory_seq.cpp b/src/smt/theory_seq.cpp index ef50cf3b6..51d1d7119 100644 --- a/src/smt/theory_seq.cpp +++ b/src/smt/theory_seq.cpp @@ -5021,7 +5021,7 @@ expr* theory_seq::coalesce_chars(expr* const& e) { if (bvu.is_bv(s)) { expr_ref result(m); expr * args[1] = {s}; - if (m_seq_rewrite.mk_app_core(to_app(e)->get_decl(), 1, args, result)) { + if (BR_FAILED != m_seq_rewrite.mk_app_core(to_app(e)->get_decl(), 1, args, result)) { if (!ctx.e_internalized(result)) ctx.internalize(result, false); return result; diff --git a/src/solver/smt_logics.cpp b/src/solver/smt_logics.cpp index 7ed2b0445..5d845b78b 100644 --- a/src/solver/smt_logics.cpp +++ b/src/solver/smt_logics.cpp @@ -150,7 +150,7 @@ bool smt_logics::logic_has_horn(symbol const& s) { } bool smt_logics::logic_has_pb(symbol const& s) { - return s == "QF_FD" || s == "ALL"; + return s == "QF_FD" || s == "ALL" || s == "HORN"; } bool smt_logics::logic_has_datatype(symbol const& s) {