Commit 6fc18f2 1 parent e61d082 commit 6fc18f2 Copy full SHA for 6fc18f2
File tree 1 file changed +0
-31
lines changed
1 file changed +0
-31
lines changed Original file line number Diff line number Diff line change @@ -198,31 +198,6 @@ private partial def isNumeral (e : Expr) : Bool :=
198
198
else if fName == ``Nat.zero && e.getAppNumArgs == 0 then true
199
199
else false
200
200
201
- private partial def toNatLit? (e : Expr) : Option Literal :=
202
- if isNumeral e then
203
- if let some n := loop e then
204
- some (.natVal n)
205
- else
206
- none
207
- else
208
- none
209
- where
210
- loop (e : Expr) : OptionT Id Nat := do
211
- let f := e.getAppFn
212
- match f with
213
- | .lit (.natVal n) => return n
214
- | .const fName .. =>
215
- if fName == ``Nat.succ && e.getAppNumArgs == 1 then
216
- let r ← loop e.appArg!
217
- return r+1
218
- else if fName == ``OfNat.ofNat && e.getAppNumArgs == 3 then
219
- loop (e.getArg! 1 )
220
- else if fName == ``Nat.zero && e.getAppNumArgs == 0 then
221
- return 0
222
- else
223
- failure
224
- | _ => failure
225
-
226
201
private def isNatType (e : Expr) : MetaM Bool :=
227
202
return (← whnf e).isConstOf ``Nat
228
203
@@ -350,8 +325,6 @@ private def pushArgs (root : Bool) (todo : Array Expr) (e : Expr) (config : Whnf
350
325
return (.lit v, todo)
351
326
| .const c _ =>
352
327
unless root do
353
- if let some v := toNatLit? e then
354
- return (.lit v, todo)
355
328
if (← shouldAddAsStar c e) then
356
329
return (.star, todo)
357
330
let nargs := e.getAppNumArgs
@@ -468,10 +441,6 @@ def insertIfSpecific [BEq α] (d : DiscrTree α) (e : Expr) (v : α) (config : W
468
441
469
442
private def getKeyArgs (e : Expr) (isMatch root : Bool) (config : WhnfCoreConfig) : MetaM (Key × Array Expr) := do
470
443
let e ← reduceDT e root config
471
- unless root do
472
- -- See pushArgs
473
- if let some v := toNatLit? e then
474
- return (.lit v, #[])
475
444
match e.getAppFn with
476
445
| .lit v => return (.lit v, #[])
477
446
| .const c _ =>
You can’t perform that action at this time.
0 commit comments