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

prove command returns Valid even when there are unsolved subgoals #316

Closed
brianhuffman opened this issue Oct 13, 2018 · 4 comments · Fixed by #1378
Closed

prove command returns Valid even when there are unsolved subgoals #316

brianhuffman opened this issue Oct 13, 2018 · 4 comments · Fixed by #1378
Assignees
Labels
type: bug Issues reporting bugs or unexpected/unwanted behavior
Milestone

Comments

@brianhuffman
Copy link
Contributor

Using the new goal_apply tactic, we can create proof states that contain multiple subgoals. A proof is supposed to be complete when all of its goals have been discharged; however, prove seems to succeed even if there are still more unproved goals. (It does print a little warning message though.)

sawscript> let andI = core_axiom "(a b : Bool) -> EqTrue a -> EqTrue b -> EqTrue (and a b)"
sawscript> r <- prove do { simplify (cryptol_ss()); goal_apply andI; abc; } {{ True && False }}
prove: 1 unsolved subgoal(s)
sawscript> print r
Valid

On the other hand, prove_print correctly checks for unsolved subgoals and fails if there are any left:

sawscript> result <- prove_print do { simplify (cryptol_ss()); goal_apply andI; abc; } {{ True && False }}

user error ("prove_print" (<stdin>:1:11-1:22):
prove: 1 unsolved subgoal(s)
Valid)
sawscript> print result

<stdin>:1:1-1:13: unbound variable: "result" (<stdin>:1:7-1:13)
@brianhuffman
Copy link
Contributor Author

I think that fixing this will require us to change the return type of prove. Currently we have

prove : ProofScript SatResult -> Term -> TopLevel ProofResult

where ProofResult has just two constructors: Valid, and InvalidMulti which contains a counterexample. Maybe we should add a third Unknown constructor to ProofResult, which could cover cases like "solver gave up" or "this goal is valid, but unsolved goals remain".

@atomb atomb added this to the 0.3 milestone Apr 1, 2019
@brianhuffman brianhuffman self-assigned this Apr 4, 2019
@atomb atomb added the type: bug Issues reporting bugs or unexpected/unwanted behavior label Apr 26, 2019
@atomb
Copy link
Contributor

atomb commented May 28, 2019

I'm going to mark the commands that work with multiple subgoals as experimental until we fix this.

@atomb atomb removed this from the 0.3 milestone May 28, 2019
atomb pushed a commit that referenced this issue May 28, 2019
atomb pushed a commit that referenced this issue May 28, 2019
atomb pushed a commit that referenced this issue May 28, 2019
@brianhuffman
Copy link
Contributor Author

@atomb: That seems reasonable. I don't think we want to change the type of a basic saw-script operator like prove at the last minute before a release. We can fix this properly before the next one.

@atomb atomb added this to the 1.0 milestone Jun 4, 2019
@atomb atomb modified the milestones: 1.0, 0.4 Oct 1, 2019
@atomb atomb modified the milestones: 0.4, 1.0 Oct 17, 2019
@atomb atomb modified the milestones: 0.5, 0.6 Apr 27, 2020
@atomb atomb modified the milestones: 0.6, 0.7 Aug 31, 2020
@atomb atomb modified the milestones: 0.7, 0.8 Dec 14, 2020
@robdockins robdockins added the maybe fixed Issues where there's reason to think they might be fixed but that still requires confirmation label Apr 14, 2021
@robdockins
Copy link
Contributor

I think this may be fixed now, following some reworking of the proof infrastructure. We should write a test case.

@robdockins robdockins self-assigned this Apr 14, 2021
@atomb atomb modified the milestones: 0.8, 0.9 Apr 19, 2021
robdockins added a commit that referenced this issue Jul 14, 2021
@sauclovian-g sauclovian-g removed the maybe fixed Issues where there's reason to think they might be fixed but that still requires confirmation label Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Issues reporting bugs or unexpected/unwanted behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants