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

Tactics: make splice_t always run without admit/lax #3336

Merged
merged 5 commits into from
Jun 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions ocaml/fstar-lib/generated/FStar_Tactics_Hooks.ml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 11 additions & 2 deletions ocaml/fstar-lib/generated/FStar_TypeChecker_Tc.ml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/tactics/FStar.Tactics.Hooks.fst
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,7 @@ let splice
: list goal & dsl_tac_result_t =
run_tactic_on_ps tau.pos tau.pos false
FStar.Tactics.Typeclasses.solve
({env with gamma=[]}, val_t)
({env with lax=false; admit=false; gamma=[]}, val_t)
FStar.Tactics.Typeclasses.solve
tau
tactic_already_typed
Expand Down
3 changes: 3 additions & 0 deletions src/typechecker/FStar.TypeChecker.Tc.fst
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,9 @@ let tc_decl' env0 se: list sigelt & list sigelt & Env.env =

(* If we're --laxing, and this is not an `expect_lax_failure`, then just ignore the definition *)
| Sig_fail {fail_in_lax=false} when not (Env.should_verify env) || Options.admit_smt_queries () ->
if Debug.any () then
BU.print1 "Skipping %s since env.admit=true and this is not an expect_lax_failure\n"
(Print.sigelt_to_string_short se);
[], [], env

| Sig_fail {errs=expected_errors; fail_in_lax=lax; ses} ->
Expand Down
17 changes: 14 additions & 3 deletions tests/error-messages/OptionStack.fst
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,25 @@
*)
module OptionStack

assume val p : int -> prop

[@@expect_failure]
let t0 = assert (p 1)

[@@expect_failure]
let t1 = assert (p 2)

[@@expect_failure]
let _ = assert False
let t2 = assert False

#push-options "--admit_smt_queries true"

let _ = assert False
let t3 = assert False
let t4 = assert False
let t5 = assert False
let t6 = assert False

#pop-options

[@@expect_failure]
let _ = assert False
let t7 = assert False
24 changes: 20 additions & 4 deletions tests/error-messages/OptionStack.fst.expected
Original file line number Diff line number Diff line change
@@ -1,17 +1,33 @@
>> Got issues: [
* Error 19 at OptionStack.fst(19,8-19,14):
* Error 19 at OptionStack.fst(21,9-21,15):
- Assertion failed
- The SMT solver could not prove the query. Use --query_stats for more
details.
- See also OptionStack.fst(19,15-19,20)
- See also OptionStack.fst(21,16-21,21)

>>]
>> Got issues: [
* Error 19 at OptionStack.fst(28,8-28,14):
* Error 19 at OptionStack.fst(24,9-24,15):
- Assertion failed
- The SMT solver could not prove the query. Use --query_stats for more
details.
- See also OptionStack.fst(28,15-28,20)
- See also OptionStack.fst(24,16-24,21)

>>]
>> Got issues: [
* Error 19 at OptionStack.fst(27,9-27,15):
- Assertion failed
- The SMT solver could not prove the query. Use --query_stats for more
details.
- See also OptionStack.fst(27,16-27,21)

>>]
>> Got issues: [
* Error 19 at OptionStack.fst(39,9-39,15):
- Assertion failed
- The SMT solver could not prove the query. Use --query_stats for more
details.
- See also OptionStack.fst(39,16-39,21)

>>]
Verified module: OptionStack
Expand Down
16 changes: 16 additions & 0 deletions tests/tactics/Admit.fst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module Admit

open FStar.Tactics.V2

#push-options "--admit_smt_queries true"
let test () : squash False =
_ by (
()
)
#pop-options

[@@expect_failure [19]]
let test2 () : squash False =
_ by (
()
)
Loading