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

feat: allow slim_check to do work in MetaM #3838

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

semorrison
Copy link
Contributor

@semorrison semorrison commented May 7, 2023

This opens the possibility to e.g. run norm_num inside a Testable instance.

Ideally we would actually add a Testable instance that demonstrates this. :-)
Some hurdles:

  • norm_num can't decide all equalities in the reals. Does it just respond with success if it can't decide? We could add an extra case to TestResult called inconclusive, but I think the code paths would be the same as for success.
  • alternatively, we could have a new type class MetaDecidable, for propositions with decision procedures in MetaM. There would be a lot of new design there.
  • Until we merge [Merged by Bors] - feat: tactic frontend for slim_check #3114 it's annoying to work on slim_check.

Open in Gitpod

@semorrison semorrison added the merge-conflict The PR has a merge conflict with master, and needs manual merging. label Jun 12, 2023
@semorrison semorrison removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. label Jun 14, 2023
@semorrison semorrison added the t-meta Tactics, attributes or user commands label Jun 21, 2023
@semorrison semorrison added the merge-conflict The PR has a merge conflict with master, and needs manual merging. label Jul 11, 2023
@semorrison semorrison removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. label Jul 13, 2023
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added the merge-conflict The PR has a merge conflict with master, and needs manual merging. label Jul 19, 2023

/-- `Random α` gives us machinery to generate values of type `α` -/
class Random (α : Type u) where
random [RandomGen g] : RandG g α
random [RandomGen g] : RandG g Id α
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason these don't generalize across monads m?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because I couldn't get it to work.


namespace Rand
/-- Generate one more `Nat` -/
def next [RandomGen g] : RandG g Nat := do
def next [RandomGen g] : RandG g Id Nat := do
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def next [RandomGen g] : RandG g Id Nat := do
def next [RandomGen g] [Monad m] : RandG g m Nat := do

or is there a reason not to?

Comment on lines +151 to +152
instance : MonadLift (Rand m) m where
monadLift := runRand
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This strikes me as a bit risky; I'd rather not accidentally run a random monad with the default generator and get something less deterministic than expecfted.

@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. label Jul 19, 2023
@eric-wieser eric-wieser mentioned this pull request Jul 31, 2023
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added the merge-conflict The PR has a merge conflict with master, and needs manual merging. label Aug 14, 2023
@bors bors bot changed the base branch from master to ScottCarnahan/BinomialRing2 September 17, 2023 03:24
@semorrison semorrison changed the base branch from ScottCarnahan/BinomialRing2 to master September 17, 2023 12:17
@joneugster
Copy link
Collaborator

@semorrison what's the status of this PR? If you'd still like this to be reviewed, could you resolve the merge conflicts

@joneugster joneugster self-assigned this Jun 26, 2024
@joneugster joneugster added awaiting-author A reviewer has asked the author a question or requested changes and removed awaiting-review labels Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-author A reviewer has asked the author a question or requested changes merge-conflict The PR has a merge conflict with master, and needs manual merging. t-meta Tactics, attributes or user commands
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants