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

generalize derE to eqType, add mem_der language inclusion check #74

Merged
merged 1 commit into from
Jul 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion theories/regexp.v
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ Fixpoint der (char: eqType) x (e : regexp char) :=
else Conc (der x e1) e2
end.

Lemma derE (char : finType) (x : char) (e : regexp char) :
Lemma derE (char : eqType) (x : char) (e : regexp char) :
der x e =i residual x (mem e).
Proof.
elim: e => //= [y|e IHe|e1 IHe1 e2 IHe2|e1 IHe1 e2 IHe2] u.
Expand Down Expand Up @@ -546,3 +546,10 @@ Proof.
move/eqP => hx. move/eqP => hu. exists v.
by rewrite IHe1 in_residual hx; exists w.
Qed.

Fixpoint mem_der (char : eqType) (e : regexp char) w :=
if w is x :: v then mem_der (der x e) v else has_eps e.

Lemma mem_derE (char : eqType) w (e : regexp char) :
mem_der e w = (w \in e).
Proof. by elim: w e => [|x w IHu] e /=; rewrite ?has_epsE // IHu derE. Qed.
Loading