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

Meaning of eato 10? #156

Open
rhs0266 opened this issue Jun 15, 2015 · 3 comments
Open

Meaning of eato 10? #156

rhs0266 opened this issue Jun 15, 2015 · 3 comments

Comments

@rhs0266
Copy link

rhs0266 commented Jun 15, 2015

At 12_05 assignment, I believe my halve is well-defined.

I passed
Example halve_type: empty |- halve \in TArrow TNat TNat. Proof. unfold halve; eauto 10. Qed.

Example halve_10: tapp halve (tnat 10) ==>* tnat 5. Proof. unfold halve; normalize. Qed.

Example halve_11: tapp halve (tnat 11) ==>* tnat 5. Proof. unfold halve; normalize. Qed.
All of those examples.

  1. What is the meaning of eauto 10 at first example?
  2. Why can't I pass

Example halve_30: tapp halve (tnat 11) ==>* tnat 15. Proof. unfold halve; normalize. Qed.

with this error,

In nested Ltac calls to "normalize" and "apply multi_refl" (expanded to "apply multi_refl"), last call failed. ?

Is there limit of stack depth when using normalize?

@jaewooklee93
Copy link

eauto is basically searching for proof over tree. It has default search depth of 5. eauto 10 specifies the search depth to be 10 to get much extensive search (but slower at the same time). There are rare cases simple eauto fails but eauto 10 succeeds.

normalize is not an official tactic but author's custom tactic defined at the file Types.v

Tactic Notation "normalize" := 
   repeat (print_goal; eapply multi_step ; 
             [ (eauto 10; fail) | (instantiate; simpl)]);
   apply multi_refl.

Now you may see the reason. The definition of normalize already fixed its search depth to 10. Therefore, the following works.

Tactic Notation "deep_normalize" := 
   repeat (print_goal; eapply multi_step ; 
             [ (eauto 20; fail) | (instantiate; simpl)]);
   apply multi_refl.

Example halve_30: tapp halve (tnat 30) ==>* tnat 15.
Proof.
unfold halve; deep_normalize.
Qed.

@rhs0266
Copy link
Author

rhs0266 commented Jun 15, 2015

Wow...
I've never heard about existence of 'depth'...
Thank you very much

@woong8556
Copy link

For a simpler example, try the following:

Example eauto10_example : 3<11.
Proof.
try eauto.
eauto 10.
Qed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants