Skip to content

Commit

Permalink
preserve behavior when looking only for free type vars
Browse files Browse the repository at this point in the history
  • Loading branch information
nikswamy committed Aug 15, 2023
1 parent a3158d4 commit 66e043e
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 10 deletions.
19 changes: 13 additions & 6 deletions ocaml/fstar-lib/generated/FStar_ToSyntax_ToSyntax.ml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 12 additions & 4 deletions src/tosyntax/FStar.ToSyntax.ToSyntax.fst
Original file line number Diff line number Diff line change
Expand Up @@ -289,14 +289,22 @@ let sort_ftv ftv =
let rec free_vars_b tvars_only env binder : (Env.env & list ident) =
match binder.b with
| Variable x ->
let env, _ = Env.push_bv env x in
env, []
if tvars_only
then env, [] //tvars can't clash with vars
else (
let env, _ = Env.push_bv env x in
env, []
)
| TVariable x ->
let env, _ = Env.push_bv env x in
env, [x]
| Annotated(x, term) ->
let env', _ = Env.push_bv env x in
env', free_vars tvars_only env term
if tvars_only //tvars can't clash with vars
then env, free_vars tvars_only env term
else (
let env', _ = Env.push_bv env x in
env', free_vars tvars_only env term
)
| TAnnotated(id, term) ->
let env', _ = Env.push_bv env id in
env', free_vars tvars_only env term
Expand Down

0 comments on commit 66e043e

Please sign in to comment.