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

LtacProf should correctly handle multi-success tactics #12196

Closed
JasonGross opened this issue Apr 28, 2020 · 0 comments · Fixed by #12197
Closed

LtacProf should correctly handle multi-success tactics #12196

JasonGross opened this issue Apr 28, 2020 · 0 comments · Fixed by #12197
Assignees
Labels
part: ltac Issues and PRs related to the Ltac tactic language.
Milestone

Comments

@JasonGross
Copy link
Member

Description of the problem

LtacProf currently admits that it cannot handle multi-success tactics:

Fixpoint fact (n : nat) := match n with 0 => 1 | S n' => n * fact n' end.
Fixpoint walk (n : nat) := match n with 0 => tt | S n => walk n end.
Ltac slow := idtac + (do 2 (let x := eval lazy in (walk (fact 9)) in idtac)).
Ltac slow2 := idtac + (do 2 (let x := eval lazy in (walk (fact 9)) in idtac)).
Ltac multi := idtac + slow + slow2.
Set Ltac Profiling.
Goal True.
  Time try (multi; fail).
  (* Warning: Ltac Profiler cannot yet handle backtracking into multi-success
 tactics; profiling results may be wildly inaccurate.
 [profile-backtracking,ltac] *)
  Show Ltac Profile.
  (* total time:      0.000s

 tactic                                   local  total   calls       max
────────────────────────────────────────┴──────┴──────┴───────┴─────────┘
─multi ---------------------------------  47.1%  47.1%       1    0.000s
─slow ----------------------------------  35.3%  35.3%       1    0.000s
─slow2 ---------------------------------  17.6%  17.6%       1    0.000s

 tactic                                   local  total   calls       max
────────────────────────────────────────┴──────┴──────┴───────┴─────────┘
─multi ---------------------------------  47.1%  47.1%       1    0.000s
─slow ----------------------------------  35.3%  35.3%       1    0.000s
─slow2 ---------------------------------  17.6%  17.6%       1    0.000s

*)

It does something, but the results are quite strange.

Coq Version

8.11.1

@JasonGross JasonGross added the part: ltac Issues and PRs related to the Ltac tactic language. label Apr 28, 2020
@JasonGross JasonGross added this to the 8.12+beta1 milestone Apr 28, 2020
@JasonGross JasonGross self-assigned this Apr 28, 2020
JasonGross added a commit to JasonGross/coq that referenced this issue Apr 28, 2020
JasonGross added a commit to JasonGross/coq that referenced this issue Apr 28, 2020
JasonGross added a commit to JasonGross/coq that referenced this issue Apr 29, 2020
JasonGross added a commit to JasonGross/coq that referenced this issue Apr 29, 2020
@ppedrot ppedrot closed this as completed in 570dd44 May 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
part: ltac Issues and PRs related to the Ltac tactic language.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant