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

Tc: unconditionally restore options before encoding a module #3783

Merged
merged 1 commit into from
Feb 24, 2025
Merged
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
12 changes: 5 additions & 7 deletions src/fstar/FStarC.Universal.fst
Original file line number Diff line number Diff line change
Expand Up @@ -405,12 +405,10 @@ let tc_one_file
GenSym.reset_gensym();

(*
* AR: smt encode_modul functions are now here instead of in Tc.fs
* this is common smt postprocessing for fresh module and module read from cache
* AR: this is common smt postprocessing for fresh module and module read from cache
*)
let maybe_restore_opts () : unit =
if not (Options.interactive ()) then
Options.restore_cmd_line_options true |> ignore
let restore_opts () : unit =
Options.restore_cmd_line_options true |> ignore
in
let maybe_extract_mldefs tcmod env =
match Options.codegen() with
Expand Down Expand Up @@ -451,7 +449,7 @@ let tc_one_file
in
let modul, env = Tc.check_module tcenv fmod (is_some pre_fn) in
//AR: encode the module to to smt
maybe_restore_opts ();
restore_opts ();
let smt_decls =
if not (Options.lax())
then FStarC.SMTEncoding.Encode.encode_modul env modul
Expand Down Expand Up @@ -546,7 +544,7 @@ let tc_one_file
(FStarC.TypeChecker.Normalize.erase_universes tcenv)
in
let env = FStarC.TypeChecker.Tc.load_checked_module tcenv tcmod in
maybe_restore_opts ();
restore_opts ();
//AR: encode smt module and do post processing
if (not (Options.lax())) then begin
FStarC.SMTEncoding.Encode.encode_modul_from_cache env tcmod smt_decls
Expand Down
Loading