summaryrefslogtreecommitdiff
path: root/backends/lean/Base
diff options
context:
space:
mode:
authorSon Ho2023-09-14 07:50:13 +0200
committerSon Ho2023-09-14 07:50:13 +0200
commitc9f4a412763ef46ed20c72a9d7fe2cca817d3817 (patch)
treebcb31143c09af558f117430078c84fe6d4e0bc4e /backends/lean/Base
parent0504acdaee98f28dfd08c5652b39c201c252d1be (diff)
Fix panic issues with the progress tactic
Diffstat (limited to '')
-rw-r--r--backends/lean/Base/Progress/Progress.lean8
1 files changed, 5 insertions, 3 deletions
diff --git a/backends/lean/Base/Progress/Progress.lean b/backends/lean/Base/Progress/Progress.lean
index 6a4729dc..afe3056e 100644
--- a/backends/lean/Base/Progress/Progress.lean
+++ b/backends/lean/Base/Progress/Progress.lean
@@ -314,12 +314,14 @@ def evalProgress (args : TSyntax `Progress.progressArgs) : TacticM Unit := do
else pure none
let ids :=
let args := asArgs.getArgs
- let args := (args.get! 2).getSepArgs
- args.map (λ s => if s.isIdent then some s.getId else none)
+ if args.size > 2 then
+ let args := (args.get! 2).getSepArgs
+ args.map (λ s => if s.isIdent then some s.getId else none)
+ else #[]
trace[Progress] "User-provided ids: {ids}"
let splitPost : Bool :=
let args := asArgs.getArgs
- (args.get! 3).getArgs.size > 0
+ args.size > 3 ∧ (args.get! 3).getArgs.size > 0
trace[Progress] "Split post: {splitPost}"
/- For scalarTac we have a fast track: if the goal is not a linear
arithmetic goal, we skip (note that otherwise, scalarTac would try