Integrate Comments to Equations Tutorial Basics#19
Conversation
|
@MevenBertrand can you elaborate on:
Also the behaviour of funelim should change soon, c.f. this comment #1 (comment) |
|
Refactored 1.2 to adapt to the comments |
|
|
@MevenBertrand Could you check section 1.2 and tell me if you are satisfied by the modifications ? |
MevenBertrand
left a comment
There was a problem hiding this comment.
Very nice addition of the examples for nested pattern-matching. Some more typo catches, but otherwise, lgtm :)
|
Merging now, thanks for the insight @MevenBertrand ! |
Integrate Comments to Equations Tutorial Basics
Also, at that point you pretend that this is about computation, but
autorewriteis propositional reasoning. That is, you would be able to add the newderived equation to the
nth_optionhintbase:And now the first
autorewritegoes through.I'm not sure it is something you want to flash here, or even later, but it might confuse learners that you talk about computation…
mapis filled, but not the other two? (It would make sense to me that you want to give at least one example, but force people to look for themselves in the other too, until we get a better set-up for exercises)Argumentsis probably not precise enough to be able to say what one would want to say ("simplify exactly when the list of arguments matches one of the patterns of the definition"), but your proposed version is very aggressive. Usually, forappI'd rather doArguments app !_ /.(which means "unfoldappwhen it is applied to at least one argument and that argument is a constructor). There's also thesimpl nomatchinvocation, which I've never used but seems relevant…Also, this is misleading: by using
cbn [f1 … fn]one can obtain a similar behaviour. So it's maybe best not to mention this point at all.induction l in n |- *(although I know in the end you want to say "functional induction is better" anyway).Maybe make it clear that this is not about Equations per se, but simply using the
general rewriting hint mechanism of Coq?
confluent and terminating?
after simplification we get a lot of uninteresting cases, that we would like to
deal with in an automatic but controlled way."
"a particular instance" is rather vague, do you mean it uses
try typeclasses eauto with …using a given set of hints? Then you should say so, mention what the databases are and what they do.(Good examples, especially
app_nth2, I would never have thought about doingfunelim (nth_option n l)despitenth_option n lappearing nowhere in my goal!)liainstead, which gets rid of these arithmetic goals without needing to find the right lemma.simp in Handsimp in *to also simplify in the hypotheses? This is useful in these exercises…halfexample above. Maybe it would be useful to have something like this to show the power offunelim?About rev_acc_elim.at this point so that we get to see what its type is?exact …->1: exact …(I'm picky about goal selectors :p) (and below)simp inwithout having introduced it before!