Skip to content

Commit a362101

Browse files
committed
Update DFA and EpsilonNFA namespacing
1 parent 6b72aa5 commit a362101

1 file changed

Lines changed: 18 additions & 4 deletions

File tree

TraceTheory/TraceTheory/Computability.lean

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ open Classical Computability
55

66
variable {α : Type}
77

8+
namespace εNFA
9+
810
section concat
911

1012
variable {σ₁ σ₂ : Type*}
@@ -174,6 +176,16 @@ theorem accepts_concat (εM₁ : εNFA α σ₁) (εM₂ : εNFA α σ₂) :
174176

175177
end concat
176178

179+
section kstar
180+
181+
182+
183+
end kstar
184+
185+
end εNFA
186+
187+
namespace DFA
188+
177189
section singleton
178190

179191
def char (a : α) [DecidableEq α] : DFA α (Fin 3) where
@@ -226,6 +238,8 @@ theorem accepts_char (a : α) : (char a).accepts = { [a] } := by
226238

227239
end singleton
228240

241+
end DFA
242+
229243
namespace Language
230244

231245
theorem IsRegular.zero : IsRegular (0 : Language α) := by
@@ -268,22 +282,22 @@ theorem IsRegular.mul {L₁ L₂ : Language α} [DecidableEq α]
268282
have ⟨σ₂, _, M₂, hM₂⟩ := h₂
269283
let εM₁ := M₁.toNFA.toεNFA
270284
let εM₂ := M₂.toNFA.toεNFA
271-
let εM := concat εM₁ εM₂
285+
let εM := εNFA.concat εM₁ εM₂
272286
apply isRegular_iff.mpr
273287
use Set (σ₁ ⊕ σ₂), inferInstance, εM.toNFA.toDFA
274288
subst hM₁ hM₂
275289
rw [NFA.toDFA_correct, εNFA.toNFA_correct]
276290
rw [← DFA.toNFA_correct, ← NFA.toεNFA_correct]
277291
rw [← DFA.toNFA_correct, ← NFA.toεNFA_correct]
278-
exact accepts_concat εM₁ εM₂
292+
exact εNFA.accepts_concat εM₁ εM₂
279293

280294
theorem IsRegular.kstar {L : Language α} (h : IsRegular L) : IsRegular (L∗) := by
281295
sorry
282296

283297
theorem IsRegular.singleton {a : α} : IsRegular ({ [a] }) := by
284298
apply isRegular_iff.mpr
285-
let M := char a
299+
let M := DFA.char a
286300
use Fin 3, inferInstance, M
287-
exact accepts_char a
301+
exact DFA.accepts_char a
288302

289303
end Language

0 commit comments

Comments
 (0)