-
Notifications
You must be signed in to change notification settings - Fork 236
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2850 from FStarLang/guido_2849
Normalizer fix for mutually recursive functions (#2849)
- Loading branch information
Showing
5 changed files
with
63 additions
and
9 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
module Bug2849a | ||
|
||
module T = FStar.Tactics | ||
|
||
let visit_terms (t: T.term): T.Tac unit = | ||
let rec tm (t: T.term): T.Tac unit = match T.inspect_unascribe t with | ||
| T.Tv_Match sc _ brs -> | ||
// do work then recurse... | ||
T.iter br brs; | ||
tm sc | ||
| _ -> () | ||
and br (b: T.branch): T.Tac unit = tm (snd b) | ||
in tm t | ||
|
||
let nothing (): unit = | ||
assert (true) by ( | ||
visit_terms (`true) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
module Bug2849b | ||
|
||
let pure () : int = | ||
let rec f () : int = 1 | ||
and g () = 2 | ||
and h () = 3 | ||
in f () | ||
|
||
let _ = assert_norm (pure () == 1) | ||
|
||
module T = FStar.Tactics | ||
|
||
let t1 () : T.Tac unit = | ||
let rec f (): T.Tac unit = T.fail "fail_f" | ||
and g () : T.Tac unit = () | ||
and h () : T.Tac unit = T.fail "fail_g" | ||
in g () | ||
|
||
let tac1 (): unit = assert (True) by (t1 ()) | ||
|
||
let t2 () : T.Tac unit = | ||
let rec f (): T.Tac unit = T.fail "fail_f" | ||
and g () : T.Tac unit = () | ||
and h () : T.Tac unit = T.fail "fail_g" | ||
in f () | ||
|
||
[@@expect_failure] | ||
let tac2 (): unit = assert (True) by (t2 ()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters