-
Notifications
You must be signed in to change notification settings - Fork 62
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
Request: term_eval
and term_eval_unint
#917
Comments
This sounds like a reasonable idea, and it shouldn't be too much work to add. |
I now have a draft PR (#927) that partially implements this feature. Here's an example of what it can do:
Currently it's restricted to evaluating terms with simple, non-function types. If you want to use it on a function, you'll have to generate some arguments with Anyway, if you check out the |
I am experimenting a bit, and it seems useful when it works. Sometimes I get the obscure message |
What is the type of the term you're trying to use it with? That's the error message I'd expect to see if you use |
I got the error with |
Indeed, that term has a function type. You'll need to do this instead:
|
This explains a lot --- I had not clearly understood your original explanation of the restriction. Thanks. |
@brianhuffman our use-case is to use
so |
@andreistefanescu I have realized that this use case is unlikely to work, at least in cases of the "undo the ripping apart" theorems we seem to need. e.g., above the |
@msaaltink I just realized it's already possible to "undo the ripping apart" for arrays, although I'm not sure why
|
This will make those rules considerably easier to write, avoiding This works for me even if I skip rewriting with |
While looking for a proof, it can be useful to experiment in the REPL. Here, the
unfold_term
andrewrite
functions reflect the actions ofunfolding
andsimplify
. For some things, though, like expanding maps, folds, or comprehensions, a proof needs to usegoal_eval
orgoal_eval_unint
. There's no analogue of these for terms, but they could be quite useful.The text was updated successfully, but these errors were encountered: