-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Z3 randomly ignores timeout parameter #5702
Comments
@nunoplopes - stack trace suggests race condition around scoped-timer. It is waiting for a lock inside a tactic. |
- Disable CARGO_INCREMENTAL for faster builds - Change: `apt` to `apt-get` Removes: `WARNING: apt does not have a stable CLI interface. Use with caution in scripts.` - Change: `continue-on-error` to `if:${{ success() || failure() }}` Failing builds will now get a red check mark - Fix test_goal_apply_tactic to pass - Disable test_solver_unknown until Z3Prover/z3#5702 is fixed
- Disable CARGO_INCREMENTAL for faster builds - Change: `apt` to `apt-get` Removes: `WARNING: apt does not have a stable CLI interface. Use with caution in scripts.` - Change: `continue-on-error` to `if:${{ success() || failure() }}` Failing builds will now get a red check mark - Fix test_goal_apply_tactic to pass - Disable test_solver_unknown until Z3Prover/z3#5702 is fixed
This seems fixed now, thanks @zhouzhenghui; and @nunoplopes for merging the pull request. |
- Disable CARGO_INCREMENTAL for faster builds - Change: `apt` to `apt-get` Removes: `WARNING: apt does not have a stable CLI interface. Use with caution in scripts.` - Change: `continue-on-error` to `if:${{ success() || failure() }}` Failing builds will now get a red check mark - Fix test_goal_apply_tactic to pass - Disable test_solver_unknown until Z3Prover/z3#5702 is fixed
I encountered this issue again: Solver does not terminate despite a set timeout. I reduced it as much as I could: import z3
def make_formula(number: int, should_terminate: bool) -> z3.BoolRef:
formula = f"""
(assert (forall
((container String) (number String))
(=> (and
(str.contains start container)
(str.contains container number)
{'(= (str.++ number (str.++ " * " "<number>")) container)' if not should_terminate else ''})
(exists
((elem String))
(and
(str.contains number elem)
(<= (if (= (str.at elem 0) "-")
(* -1 (str.to.int (str.substr elem 1 (- (str.len elem) 1))))
(str.to.int elem))
{number}))))))"""
start = z3.String("start")
return z3.parse_smt2_string(formula, decls={"start": start})[0]
# Terminates
formula = z3.Not(z3.Implies(make_formula(-100, True), make_formula(-50, True)))
s = z3.Solver()
s.set("timeout", 100)
s.append(formula)
print(s.check())
# Diverges
formula = z3.Not(z3.Implies(make_formula(-100, False), make_formula(-50, False)))
s = z3.Solver()
s.set("timeout", 100)
s.append(formula)
print(s.check()) As you see, you can make the solver terminate / diverge by not adding / adding a specific premise to the formulas for which I check the implication. I would understand an "unknown" result, but nontermination despite the timeout is not the best possible outcome ;) I'm using Z3 4.8.14.0. |
Please file a new bug report. Your bug is unrelated with the timeout mechanism.
|
When the following code is run
(Derived from this test in the Rust package)
the program usually hangs despite the 1m timeout. Some runs will quickly return
0
The text was updated successfully, but these errors were encountered: