Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

proverTimeout is broken for What4-based solvers #1807

Open
RyanGlScott opened this issue Feb 18, 2025 · 0 comments · May be fixed by #1809
Open

proverTimeout is broken for What4-based solvers #1807

RyanGlScott opened this issue Feb 18, 2025 · 0 comments · May be fixed by #1809
Assignees
Labels
bug Something not working correctly prover Issues related to :sat and :prove

Comments

@RyanGlScott
Copy link
Contributor

Attempting to use a non-zero proverTimeout with any What4-based SMT solver will cause Cryptol to throw an exception. Example:

$ ~/Software/cryptol-3.2.0/bin/cryptol
┏━╸┏━┓╻ ╻┏━┓╺┳╸┏━┓╻  
┃  ┣┳┛┗┳┛┣━┛ ┃ ┃ ┃┃  
┗━╸╹┗╸ ╹ ╹   ╹ ┗━┛┗━╸
version 3.2.0 (1bcb75c)
https://cryptol.net  :? for help

Loading module Cryptol
Cryptol> :set prover=w4-z3
Cryptol> :set proverTimeout=5
Cryptol> :prove \(x : [8]) -> x == x

What4 exception:
Failed to get solver.cvc4.timeout: not found

I suspect that the culprit is the following code:

setTimeout :: W4.IsExprBuilder sym => Integer -> sym -> IO ()
setTimeout s sym =
do symCfg sym W4.z3Timeout (1000 * s)
symCfg sym W4.cvc4Timeout (1000 * s)
symCfg sym W4.cvc5Timeout (1000 * s)
symCfg sym W4.boolectorTimeout (1000 * s)
symCfg sym W4.yicesGoalTimeout s -- N.B. yices takes seconds
pure ()

As seen above, we don't want to unconditionally set the timeout configuration settings for all SMT solvers, as each solver has its own settings. Instead, I think we need to do something solver-specific here.

@RyanGlScott RyanGlScott added bug Something not working correctly prover Issues related to :sat and :prove labels Feb 18, 2025
@danmatichuk danmatichuk self-assigned this Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something not working correctly prover Issues related to :sat and :prove
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants