Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
C
cpdt
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
research
cpdt
Commits
e51986f6
Commit
e51986f6
authored
Oct 06, 2008
by
Adam Chlipala
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add 'Or' to regexp matcher
parent
b952f400
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletion
+10
-1
MoreDep.v
src/MoreDep.v
+10
-1
No files found.
src/MoreDep.v
View file @
e51986f6
...
...
@@ -353,7 +353,9 @@ Inductive regexp : (string -> Prop) -> Set :=
|
Char
:
forall
ch
:
ascii
,
regexp
(
fun
s
=>
s
=
String
ch
""
)
|
Concat
:
forall
P1
P2
(
r1
:
regexp
P1
)
(
r2
:
regexp
P2
)
,
regexp
(
fun
s
=>
exists
s1
,
exists
s2
,
s
=
s1
++
s2
/
\
P1
s1
/
\
P2
s2
)
.
regexp
(
fun
s
=>
exists
s1
,
exists
s2
,
s
=
s1
++
s2
/
\
P1
s1
/
\
P2
s2
)
|
Or
:
forall
P1
P2
(
r1
:
regexp
P1
)
(
r2
:
regexp
P2
)
,
regexp
(
fun
s
=>
P1
s
\
/
P2
s
)
.
Open
Scope
specif_scope
.
...
...
@@ -465,6 +467,7 @@ Definition matches P (r : regexp P) s : {P s} + { ~P s}.
match
r
with
|
Char
ch
=>
string_dec
s
(
String
ch
""
)
|
Concat
_
_
r1
r2
=>
Reduce
(
split
(
F
_
r1
)
(
F
_
r2
)
s
)
|
Or
_
_
r1
r2
=>
F
_
r1
s
||
F
_
r2
s
end
)
;
crush
;
match
goal
with
|
[
H
:
_
|-
_
]
=>
generalize
(
H
_
_
(
refl_equal
_
))
...
...
@@ -475,3 +478,9 @@ Defined.
Example
hi
:=
Concat
(
Char
"h"
%
char
)
(
Char
"i"
%
char
)
.
Eval
simpl
in
matches
hi
"hi"
.
Eval
simpl
in
matches
hi
"bye"
.
Example
a_b
:=
Or
(
Char
"a"
%
char
)
(
Char
"b"
%
char
)
.
Eval
simpl
in
matches
a_b
""
.
Eval
simpl
in
matches
a_b
"a"
.
Eval
simpl
in
matches
a_b
"aa"
.
Eval
simpl
in
matches
a_b
"b"
.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment