Skip to content

Commit

Permalink
Simplifications
Browse files Browse the repository at this point in the history
  • Loading branch information
Mathias Vorreiter Pedersen committed Mar 27, 2018
1 parent b19c5c9 commit 2b20ea0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ The grammar is given by `RegExp: Type -> Type`.
The semantics of regular expressions is specified by

```idris
RegExpSpec: (RegExp a) -> (xs: List a) -> Type
RegExpSpec: RegExp a -> List a -> Type
```

Finally the file contains a verified matching procedure for deciding regular language membership
Expand Down
4 changes: 2 additions & 2 deletions regex.idr
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ data RegExp: Type -> Type where
Empty: RegExp a
Nothing: RegExp a

data RegExpSpec: (RegExp a) -> (xs: List a) -> Type where
data RegExpSpec: RegExp a -> List a -> Type where
AtomSpec: (x : a) -> RegExpSpec (Atom x) [x]
DisjSpec1: (r1 : RegExp a) ->
(r2: RegExp a) -> (xs : List a) ->
Expand All @@ -39,7 +39,7 @@ data RegExpSpec: (RegExp a) -> (xs: List a) -> Type where
RegExpSpec (Star r) zs
EmptySpec: RegExpSpec Empty []

isEmpty : (r : RegExp a) -> RegExp a
isEmpty : RegExp a -> RegExp a
isEmpty (Atom x) = Nothing
isEmpty (Disj x y) = Disj (isEmpty x) (isEmpty y)
isEmpty (Seq x y) = Seq (isEmpty x) (isEmpty y)
Expand Down

0 comments on commit 2b20ea0

Please sign in to comment.