-
Notifications
You must be signed in to change notification settings - Fork 233
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 #3083 from mtzguido/3081
Fixing #3081
- Loading branch information
Showing
3 changed files
with
43 additions
and
2 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,36 @@ | ||
module Bug3081 | ||
|
||
// Fail if we warn about missing a variable in an SMTPat | ||
#set-options "--warn_error @271" | ||
|
||
assume val t: Type0 | ||
|
||
class toto = { | ||
f: t -> t -> t; | ||
g: t -> t -> t; | ||
f_lemma: x:t -> y:t -> squash (f x y == g y x); | ||
} | ||
|
||
// Lemma that can be proven using f_lemma twice | ||
val test_lemma: | ||
{|toto|} -> | ||
x:t -> y:t -> z:t -> | ||
Lemma | ||
(f x (f y z) == g (g z y) x) | ||
|
||
// It can't be proven automatically | ||
[@@expect_failure] | ||
let test_lemma #toto_instance x y z = () | ||
|
||
val f_lemma_smtpat: | ||
{|toto|} -> | ||
x:t -> y:t -> | ||
Lemma (f x y == g y x) | ||
[SMTPat (f x y)] | ||
// ^ This pattern mentions the dictionary after tc resolution | ||
// so we shouldn't warn. | ||
let f_lemma_smtpat #toto_instance x y = | ||
f_lemma x y | ||
|
||
// The SMT pattern works well | ||
let test_lemma #toto_instance x y z = () |