-
Notifications
You must be signed in to change notification settings - Fork 259
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
base: master
Are you sure you want to change the base?
Conversation
|
||
/-- `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 α |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?
instance : MonadLift (Rand m) m where | ||
monadLift := runRand |
There was a problem hiding this comment.
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.
@semorrison what's the status of this PR? If you'd still like this to be reviewed, could you resolve the merge conflicts |
This opens the possibility to e.g. run
norm_num
inside aTestable
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 withsuccess
if it can't decide? We could add an extra case toTestResult
calledinconclusive
, but I think the code paths would be the same as forsuccess
.MetaDecidable
, for propositions with decision procedures inMetaM
. There would be a lot of new design there.slim_check
.