3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-08 18:31:49 +00:00

work around regression with use of mk_app_core, returning BR_FAILED if nothing is rewritten

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2018-07-02 11:10:37 -07:00
parent 648a531950
commit e13b61eae8
3 changed files with 8 additions and 8 deletions

View file

@ -2777,25 +2777,25 @@ namespace Microsoft.Z3
/// <summary>
/// Create an at-most-k constraint.
/// </summary>
public BoolExpr MkAtMost(BoolExpr[] args, uint k)
public BoolExpr MkAtMost(IEnumerable<BoolExpr> args, uint k)
{
Contract.Requires(args != null);
Contract.Requires(Contract.Result<BoolExpr[]>() != null);
CheckContextMatch<BoolExpr>(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));
}
/// <summary>
/// Create an at-least-k constraint.
/// </summary>
public BoolExpr MkAtLeast(BoolExpr[] args, uint k)
public BoolExpr MkAtLeast(IEnumerable<BoolExpr> args, uint k)
{
Contract.Requires(args != null);
Contract.Requires(Contract.Result<BoolExpr[]>() != null);
CheckContextMatch<BoolExpr>(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));
}
/// <summary>

View file

@ -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;

View file

@ -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) {