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

Meta_desugared Sequence lost during typechecking/normalization #2949

Closed
mtzguido opened this issue May 30, 2023 · 1 comment
Closed

Meta_desugared Sequence lost during typechecking/normalization #2949

mtzguido opened this issue May 30, 2023 · 1 comment
Assignees

Comments

@mtzguido
Copy link
Member

@msprotz reports that we are not getting sequences in resugared code, see e.g. this:

module Sequence

let f () = ()

let test () =
  f ();
  f ()
$ ./bin/fstar.exe --dump_module Sequence Sequence.fst 
Module after desugaring:
module Sequence
Declarations: [
let f _ = ()
let test _ =
  Sequence.f ();
  Sequence.f ()
]
Exports: [
let f _ = ()
let test _ =
  Sequence.f ();
  Sequence.f ()
]

Module before type checking:
module Sequence
Declarations: [
let f _ = ()
let test _ =
  Sequence.f ();
  Sequence.f ()
]
Exports: [
let f _ = ()
let test _ =
  Sequence.f ();
  Sequence.f ()
]

Module after type checking:
module Sequence
Declarations: [
let f _ = ()
let test _ =
  [@@ FStar.Pervasives.inline_let ]let _ = Sequence.f () in
  Sequence.f ()
]
Exports: [
let f _ = ()
let test _ =
  [@@ FStar.Pervasives.inline_let ]let _ = Sequence.f () in
  Sequence.f ()
]

(Warning 274) Implicitly opening fstar. namespace shadows (sequence -> Sequence.fst), rename Sequence.fst to avoid conflicts
Verified module: Sequence
All verification conditions discharged successfully

I tried fixing it here but it leads to weird regressions, so making a note.

@msprotz
Copy link
Collaborator

msprotz commented May 30, 2023

Thanks for trying Guido. The use-case is to debug terms produced by a tactic, and when it's not obvious why a term is well-typed, the only workflow I have is to print the term, copy/paste it into a buffer, and then try to run it in interactive mode. This resugaring issue is only one of many other issues that make processing printed terms difficult. Others include incorrectly-prefixed constructors, fully qualified references to the current module (which generate dependency loops in batch mode), and for a long while incorrect printing of machine integers, although maybe that is fixed now? Let me know if you want issues filed for the other problems. Thanks!

mtzguido added a commit that referenced this issue Nov 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants