Skip to content

Commit 4c73ab8

Browse files
remove use of balistic tactic
1 parent 2f859cc commit 4c73ab8

File tree

1 file changed

+20
-7
lines changed

1 file changed

+20
-7
lines changed

Katydid/Regex/Calculus.lean

+20-7
Original file line numberDiff line numberDiff line change
@@ -153,17 +153,30 @@ def derive_concat {α: Type} {x: α} {P Q: Lang α} {xs: List α}:
153153
guard_hyp hp : P ps
154154
guard_hyp hq : Q qs
155155
guard_hyp hs : [x] ++ xs = ps ++ qs
156-
balistic
157-
· guard_hyp hp : P []
158-
guard_hyp hq : Q (x :: xs)
156+
match ps with
157+
| nil =>
158+
guard_hyp hp : P []
159+
guard_hyp hq : Q qs
159160
refine Or.inr ?r
160-
guard_target = P [] ∧ Q (x :: xs)
161+
guard_target = P [] ∧ Q ([x] ++ xs)
162+
rw [nil_append] at hs
163+
rw [hs]
161164
exact And.intro hp hq
162-
· guard_hyp hp : P (x :: e)
165+
| cons p ps =>
166+
guard_hyp hp : P (p :: ps)
163167
guard_hyp hq : Q qs
168+
guard_hyp hs : [x] ++ xs = p :: ps ++ qs
164169
refine Or.inl ?l
165-
guard_target = ∃ x_1, P (x :: x_1) ∧ ∃ x, Q x ∧ e ++ qs = x_1 ++ x
166-
exact Exists.intro e (And.intro hp (Exists.intro qs (And.intro hq rfl)))
170+
guard_target = ∃ x_1 y, P ([x] ++ x_1) ∧ Q y ∧ xs = x_1 ++ y
171+
simp only [cons_append, cons.injEq] at hs
172+
match hs with
173+
| And.intro hpx hs =>
174+
rw [hpx]
175+
rw [nil_append] at hs
176+
rw [hs]
177+
guard_hyp hs : xs = ps ++ qs
178+
guard_target = ∃ x y, P ([p] ++ x) ∧ Q y ∧ ps ++ qs = x ++ y
179+
exact Exists.intro ps (Exists.intro qs (And.intro hp (And.intro hq rfl)))
167180
case invFun =>
168181
simp only [Language.or, Language.concat, derive, derives, null, scalar]
169182
intro e

0 commit comments

Comments
 (0)