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

Pretty-print ML extraction terms. #3468

Merged
merged 1 commit into from
Sep 12, 2024
Merged

Pretty-print ML extraction terms. #3468

merged 1 commit into from
Sep 12, 2024

Conversation

gebner
Copy link
Contributor

@gebner gebner commented Sep 12, 2024

I've been staring too much at ML extraction debugging output recently. This PR replaces the printf-based printer for ML terms with a pretty-printer using documents.

+++About to extract {FStar.List.Tot.Base.append}
Execution time of ---Extracted {FStar.List.Tot.Base.append}: 0.114 ms
Extraction result: [
MLM_Loc;
MLM_Let (Rec, [{
    mllb_name = append;
    mllb_tysc =
      Some
      (<MLTY_Fun> (<MLTY_Named> 'a Prims.list) ->
        (<MLTY_Fun> (<MLTY_Named> 'a Prims.list) -> (<MLTY_Named> 'a Prims.list)));
    mllb_add_unit = false;
    mllb_def =
      (MLE_Fun
        ([(x, (<MLTY_Named> 'a Prims.list)); (y, (<MLTY_Named> 'a Prims.list))],
        (MLE_Match
          ((MLE_Var x),
          [((MLP_CTor (Prims.Nil, [])), None, (MLE_Var y));
            ((MLP_CTor (Prims.Cons, [(MLP_Var a1); (MLP_Var tl1)])),
            None,
            (MLE_CTor
              (Prims.Cons,
              [(MLE_Var a1);
                (MLE_App
                  ((MLE_TApp ((MLE_Name (FStar.List.Tot.Base, append)), ['a])),
                  [(MLE_Var tl1); (MLE_Var y)]))])))]))))
    }])
]

@mtzguido
Copy link
Member

Nice!

@mtzguido mtzguido merged commit 2cda3b8 into master Sep 12, 2024
3 checks passed
@mtzguido mtzguido deleted the gebner_ml_doc branch September 12, 2024 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants