RIS.alpha_regexp

Set Implicit Arguments.

Require Export tools algebra language regexp words positive_regexp.

Section s.
  Context {atom : Set}{๐€ : Atom atom}.
  Context {X : Set} {๐— : Alphabet ๐€ X}.

Nominal structure

  Global Instance actReg : Action ๐€ (@regexp letter) :=
    fix act p e {struct e} :=
      match e with
      | โŸชxโŸซ โ‡’ โŸชpโˆ™xโŸซ
      | e_un โ‡’ e_un
      | e_zero โ‡’ e_zero
      | e_add e f โ‡’ e_add (act p e) (act p f)
      | e_prod e f โ‡’ e_prod (act p e) (act p f)
      | e_star e โ‡’ e_star (act p e)
      end.

  Global Instance supReg : Support ๐€ (@regexp letter) :=
    fix sup e {struct e} :=
      match e with
      | โŸชxโŸซ โ‡’ โŒŠxโŒ‹
      | e_un โ‡’ []
      | e_zero โ‡’ []
      | e_add e f โ‡’ sup e ++ sup f
      | e_prod e f โ‡’ sup e ++ sup f
      | e_star e โ‡’ sup e
      end.

  Global Instance nominalReg : Nominal ๐€ (@regexp letter).

Facts about the support

Facts about the group action

Splitting the size by name

  Fixpoint sizeAt e (a : atom) :=
    match e with
    | e_un | e_zero | โŸชvar _โŸซ โ‡’ 0
    | โŸชopen bโŸซ | โŸชclose bโŸซ โ‡’ if a=?=b then 1 else 0
    | e_add e f | e_prod e f โ‡’ sizeAt e a + sizeAt f a
    | e_star e โ‡’ sizeAt e a
    end.

  Lemma sizeAt_fresh e a : a # e โ†’ sizeAt e a = 0.

  Lemma size_sizeAt e : sum (sizeAt e) {{โŒŠeโŒ‹}} โ‰ค sizeExpr e.


End s.