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

Fixing inconsistencies in inspect_ln #2882

Merged
merged 21 commits into from
Apr 14, 2023
Merged
Show file tree
Hide file tree
Changes from 16 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
3 changes: 0 additions & 3 deletions examples/dsls/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,4 @@ extract_all: $(ALL_ML_FILES)
clean:
rm -rf .depend ._depend

%.fst-in %.fsti-in: $(CACHE_DIR)
@echo --include ../core --include $(CACHE_DIR)

.PHONY: verify_all extract_all
14 changes: 7 additions & 7 deletions examples/dsls/mini_steel/Pulse.Main.fst
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,8 @@ let translate_binder (g:R.env) (b:R.binder)
let b_ty' = readback_maybe_unknown_ty bv_view.bv_sort in
Inl ({binder_ty=b_ty';binder_ppname=bv_view.bv_ppname}, q)

let is_head_fv (t:R.term) (fv:list string) : option (list R.argv) =
let head, args = R.collect_app t in
let is_head_fv (t:R.term) (fv:list string) : T.Tac (option (list R.argv)) =
let head, args = T.collect_app t in
match R.inspect_ln head with
| R.Tv_FVar fv' ->
if inspect_fv fv' = fv
Expand Down Expand Up @@ -366,7 +366,7 @@ let rec map_err (f:'a -> T.Tac (err 'b)) (l:list 'a)
let translate_intro (g:RT.fstar_top_env) (t:R.term)
: T.Tac (err st_term)
= let open R in
let head, args = R.collect_app t in
let head, args = T.collect_app t in
match inspect_ln head with
| Tv_UInst fv _
| Tv_FVar fv ->
Expand All @@ -392,7 +392,7 @@ let translate_intro (g:RT.fstar_top_env) (t:R.term)
let translate_admit (g:RT.fstar_top_env) (t:R.term)
: T.Tac (err st_term)
= let open R in
let head, args = R.collect_app t in
let head, args = T.collect_app t in
match inspect_ln head, args with
| Tv_UInst v _, [(t, _)]
| Tv_FVar v, [(t, _)] ->
Expand Down Expand Up @@ -536,7 +536,7 @@ and translate_term (g:RT.fstar_top_env) (t:R.term)
and translate_while (g:RT.fstar_top_env) (t:R.term)
: T.Tac (err st_term)
= let open R in
let head, args = R.collect_app t in
let head, args = T.collect_app t in
match inspect_ln head with
| Tv_FVar v ->
if inspect_fv v = while_fv
Expand Down Expand Up @@ -571,7 +571,7 @@ and translate_rewrite (g:RT.fstar_top_env) (t:R.term)
: T.Tac (err st_term) =

let open R in
let head, args = R.collect_app t in
let head, args = T.collect_app t in
match inspect_ln head with
| Tv_FVar v ->
if inspect_fv v = rewrite_fv
Expand All @@ -588,7 +588,7 @@ and translate_par (g:RT.fstar_top_env) (t:R.term)
: T.Tac (err st_term) =

let open R in
let head, args = R.collect_app t in
let head, args = T.collect_app t in
match inspect_ln head with
| Tv_FVar v ->
if inspect_fv v = par_fv
Expand Down
4 changes: 2 additions & 2 deletions examples/dsls/mini_steel/Pulse.Readback.fst
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ let try_readback_st_comp
: T.Tac (option (c:comp{elab_comp c == t})) =

let open R in
let hd, args = collect_app t in
let hd, args = T.collect_app t in
match inspect_ln hd with
| Tv_UInst fv [u] ->
let fv_lid = inspect_fv fv in
Expand Down Expand Up @@ -187,7 +187,7 @@ let rec readback_ty (t:R.term)
let? arg' = readback_ty a in
Some (Tm_PureApp hd' (readback_qual q) arg' <: ty:term {elab_term ty == t})
in
let head, args = R.collect_app t in
let head, args = T.collect_app t in
begin
match inspect_ln head, args with
| Tv_FVar fv, [(a1,_); (a2,_)] ->
Expand Down
2 changes: 1 addition & 1 deletion examples/dsls/stlc/STLC.Infer.fst
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ let rec read_back (g:R.env) (t:R.term)

| R.Tv_App _ _ ->
begin
let head, args = R.collect_app t in
let head, args = T.collect_app t in
if not (is_fv head ["STLC"; "Core"; "TArrow"])
then T.fail "Got an application of type stlc_ty, but head is not a TArrow"
else match args with
Expand Down
4 changes: 4 additions & 0 deletions ocaml/fstar-lib/FStar_Unionfind.ml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ let puf_id' (h:'a puf) (x:'a p_uvar) : int =
let puf_id (h: 'a puf) (x: 'a p_uvar): Prims.int =
Z.of_int (puf_id' h x)

let puf_unique_id (x: 'a p_uvar): Prims.int =
match x with
| P a -> Z.of_int a

let puf_fromid (_:'a puf) (id : Prims.int) : 'a p_uvar =
P (Z.to_int id)

Expand Down

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

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

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

2 changes: 1 addition & 1 deletion ocaml/fstar-lib/generated/FStar_Reflection_Arith.ml

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

73 changes: 35 additions & 38 deletions ocaml/fstar-lib/generated/FStar_Reflection_Basic.ml

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

10 changes: 5 additions & 5 deletions ocaml/fstar-lib/generated/FStar_Reflection_Derived.ml

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

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

Loading