From e4b9080165dce794561f26d4008fd9c9a0eb9bde Mon Sep 17 00:00:00 2001 From: Nikolaj Bjorner Date: Sat, 15 Apr 2017 15:04:13 +0800 Subject: [PATCH] include timeout/rlimit parameters in optmize Signed-off-by: Nikolaj Bjorner --- src/api/api_opt.cpp | 2 +- src/api/java/Context.java | 12 ++++++++++-- src/opt/opt_params.pyg | 2 ++ 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/api/api_opt.cpp b/src/api/api_opt.cpp index a2299aec3..0d1b4ef8d 100644 --- a/src/api/api_opt.cpp +++ b/src/api/api_opt.cpp @@ -128,7 +128,7 @@ extern "C" { lbool r = l_undef; cancel_eh eh(mk_c(c)->m().limit()); unsigned timeout = to_optimize_ptr(o)->get_params().get_uint("timeout", mk_c(c)->get_timeout()); - unsigned rlimit = mk_c(c)->get_rlimit(); + unsigned rlimit = to_optimize_ptr(o)->get_params().get_uint("rlimit", mk_c(c)->get_rlimit()); api::context::set_interruptable si(*(mk_c(c)), eh); { scoped_timer timer(timeout, &eh); diff --git a/src/api/java/Context.java b/src/api/java/Context.java index 549694de0..9fe4e0c38 100644 --- a/src/api/java/Context.java +++ b/src/api/java/Context.java @@ -2024,13 +2024,21 @@ public class Context implements AutoCloseable { } /** - * Take the bounded Kleene star of a regular expression. + * Take the lower and upper-bounded Kleene star of a regular expression. */ - public ReExpr mkLoop(ReExpr re, uint lo, uint hi = 0) + public ReExpr mkLoop(ReExpr re, uint lo, uint hi) { return (ReExpr) Expr.create(this, Native.mkReLoop(nCtx(), re.getNativeObject(), lo, hi)); } + /** + * Take the lower-bounded Kleene star of a regular expression. + */ + public ReExpr mkLoop(ReExpr re, uint lo) + { + return (ReExpr) Expr.create(this, Native.mkReLoop(nCtx(), re.getNativeObject(), lo, 0)); + } + /** * Take the Kleene plus of a regular expression. diff --git a/src/opt/opt_params.pyg b/src/opt/opt_params.pyg index a7c9e0011..51f58396c 100644 --- a/src/opt/opt_params.pyg +++ b/src/opt/opt_params.pyg @@ -5,6 +5,8 @@ def_module_params('opt', ('maxsat_engine', SYMBOL, 'maxres', "select engine for maxsat: 'core_maxsat', 'wmax', 'maxres', 'pd-maxres'"), ('priority', SYMBOL, 'lex', "select how to priortize objectives: 'lex' (lexicographic), 'pareto', or 'box'"), ('dump_benchmarks', BOOL, False, 'dump benchmarks for profiling'), + ('timeout', UINT, UINT_MAX, 'timeout (in milliseconds) (UINT_MAX and 0 mean no timeout)'), + ('rlimit', UINT, 0, 'resource limit (0 means no limit)'), ('print_model', BOOL, False, 'display model for satisfiable constraints'), ('enable_sls', BOOL, False, 'enable SLS tuning during weighted maxsast'), ('enable_sat', BOOL, True, 'enable the new SAT core for propositional constraints'),