Skip to content

Fix -t so the time bound is applied to the stopwatch - #8

Open
alan23273850 wants to merge 1 commit into
NTU-ALComLab:mainfrom
alan23273850:fix-t-time-bound
Open

alan23273850 wants to merge 1 commit into
NTU-ALComLab:mainfrom
alan23273850:fix-t-time-bound

Conversation

@alan23273850

Copy link
Copy Markdown

Fixes #7

Summary

  • -t [s] wrote config_.time_bound_seconds but never updated stopwatch_, which is the object countSSAT() / countSAT() actually poll.
  • The stopwatch was only initialized in the Solver constructor (default 100000s) before argv was parsed, so -t had no effect.
  • Call setTimeBound() after parsing -t, skip the seconds token with ++i, and re-apply the config bound at the start of solve().

Test plan

  • ./SharpSSAT still prints -t [s] in the usage text
  • ./SharpSSAT -s -t 2 <small.sdimacs> prints TIMEOUT ! at ~2s if the instance does not finish earlier (optional; only if a long-enough instance is handy)
  • ./SharpSSAT -s -k -p -t 2147483647 <file.sdimacs> does not stop at 100000s solely because of the default bound

Made with Cursor

Parsing -t only updated config_.time_bound_seconds while countSSAT/countSAT
poll stopwatch_, which was initialized to the 100000s default before argv
was parsed. Call setTimeBound after -t, skip the seconds token, and re-apply
the config bound at the start of solve().

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

-t does not update the solver stopwatch (always times out at the default 100000s)

1 participant