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

Tm_meta is dropped throughout extraction #725

Closed
msprotz opened this issue Oct 11, 2016 · 3 comments
Closed

Tm_meta is dropped throughout extraction #725

msprotz opened this issue Oct 11, 2016 · 3 comments

Comments

@msprotz
Copy link
Collaborator

msprotz commented Oct 11, 2016

At some point during @nikswamy 's work to normalize pure computations within effectful terms, the Tm_meta annotations were dropped. Specifically, those that indicate let-mutable constructs are no longer there at extraction time, meaning that let mutable is broken for the purposes of Low*.

@msprotz
Copy link
Collaborator Author

msprotz commented Oct 21, 2016

Here's a testcase:

diff --git a/src/extraction/term.fs b/src/extraction/term.fs
index 815f303..37e76c3 100644
--- a/src/extraction/term.fs
+++ b/src/extraction/term.fs
@@ -755,6 +755,7 @@ and term_as_mlexpr' (g:env) (top:term) : (mlexpr * e_tag * mlty) =
           ml_unit, E_PURE, ml_unit_ty

         | Tm_meta (t, Meta_desugared Mutable_alloc) ->
+            failwith "Found!";
             // the lack of as-patterns makes this a little bit heavy
             begin match term_as_mlexpr' g t with
             | { expr = MLE_Let ((NonRec, flags, bodies), continuation);
diff --git a/src/parser/tosyntax.fs b/src/parser/tosyntax.fs
index 45a1215..2a0cd9b 100644
--- a/src/parser/tosyntax.fs
+++ b/src/parser/tosyntax.fs
@@ -825,7 +825,7 @@ and desugar_term_maybe_top (top_level:bool) (env:env_t) (top:term) : S.term =
               mk <| Tm_let((false, [mk_lb (Inl x, x.sort, t1)]), Subst.close [S.mk_binder x] body)
           end in
         if is_mutable
-        then mk <| Tm_meta (tm, Meta_desugared Mutable_alloc)
+        then (Util.print_string "!!! GENERATED !!!\n"; mk <| Tm_meta (tm, Meta_desugared Mutable_alloc))
         else tm
       in

Apply the following diff (cd FStar && patch -p1 < path-to-this-diff). Then cd kremlin/test and make Mutable.exe KOPTS=-verbose.

This displays, among many other messages related to not extracting polymorphic functions:

⚡ Calling F*
✔ [F*,extract]
!!! GENERATED !!!

Meaning that the given Tm_meta node is generated, but then the failwith that's supposed to abort as soon as it's found on the other end is never triggered.

@mtzguido
Copy link
Member

Is this still relevant? let mutable itself is gone but don't know if any other Tm_meta annotations are still relevant to extraction

@aseemr
Copy link
Collaborator

aseemr commented Mar 17, 2022

Closing this issue since we don't have a concrete repro, we can file new issue(s) in case.

@aseemr aseemr closed this as completed Mar 17, 2022
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

5 participants