Open 857b opened 2 years ago
Hi Benjamin, I think your issue is another form of missed coercion as in #2471, which was fixed by @aseemr yesterday! I tried your example @857b with latest F* master, but the coercion is missed in that specific case. @aseemr do think it is easy to fix?
Btw, we can actually see F* is not inserting a binder_to_term
in lax
mode by printing the terms, i.e.:
module Main
open FStar.Tactics
assume val dummy_lemma: int -> unit
let test = (fun (x: binder) -> `(dummy_lemma (`#x))) <: _ -> Tac _
#push-options "--lax"
let test_lax = (fun (x: binder) -> `(dummy_lemma (`#x))) <: _ -> Tac _
#pop-options
let body_of_sigelt (n: string)
= match lookup_typ (top_env ()) (explode_qn n) with
| Some se -> ( match inspect_sigelt se with
| Sg_Let _ [lb] -> (inspect_lb lb).lb_def
| _ -> fail "body_of_sigelt: not Sg_Let" )
| _ -> fail ("body_of_sigelt: "^n^" not found")
let _ = run_tactic (fun () ->
let test = body_of_sigelt (`%test ) in
let test_lax = body_of_sigelt (`%test_lax) in
print (
"# test: \n" ^ term_to_string test ^
"\n# test_lax: \n" ^ term_to_string test_lax
)
)
prints:
# test:
(fun x ->
let _ = FStar.Tactics.Derived.binder_to_term x in
`Main.dummy_lemma _)
<:
_: FStar.Reflection.Types.binder -> FStar.Tactics.Effect.Tac FStar.Reflection.Types.term
# test_lax:
(fun _ -> `Main.dummy_lemma _)
<:
_: FStar.Reflection.Types.binder -> FStar.Tactics.Effect.Tac FStar.Reflection.Types.term
The following example verify without any issue when checked in normal mode:
However, if one checks the definition of
test_tac_0
in lax mode, it get stuck when called fromtest_0
:The problem seems to come from the direct use of a binder (
x
) in an anti-quotation operator`#
. There is no such issue withtest_tac_1
, which uses an explicit castbinder_to_term
.