videos/02-algo1.srt
author Christian Urban <christian.urban@kcl.ac.uk>
Tue, 29 Sep 2020 12:52:07 +0100
changeset 766 e8402d8ec8e6
child 769 f9686b22db7e
permissions -rw-r--r--
updated
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
766
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
     1
1
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
     2
00:00:05,880 --> 00:00:09,700
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
     3
Welcome back.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
     4
Remember this slide.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
     5
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
     6
2
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
     7
00:00:09,700 --> 00:00:11,500
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
     8
This slide said, What is
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
     9
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    10
3
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    11
00:00:11,500 --> 00:00:14,500
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    12
all wreck expression Metro
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    13
actually supposed to do?
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    14
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    15
4
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    16
00:00:14,500 --> 00:00:16,570
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    17
It will take two arguments and
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    18
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    19
5
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    20
00:00:16,570 --> 00:00:18,670
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    21
reg expression R and a string
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    22
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    23
6
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    24
00:00:18,670 --> 00:00:21,580
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    25
S. And it's supposed to say yes,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    26
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    27
7
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    28
00:00:21,580 --> 00:00:23,440
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    29
the wreck expression matches
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    30
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    31
8
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    32
00:00:23,440 --> 00:00:26,920
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    33
the string if and only
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    34
if the string is in
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    35
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    36
9
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    37
00:00:26,920 --> 00:00:28,855
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    38
the language of R.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    39
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    40
10
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    41
00:00:28,855 --> 00:00:32,410
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    42
And if the string is not
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    43
in the language of our,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    44
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    45
11
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    46
00:00:32,410 --> 00:00:35,515
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    47
then our algorithm has to say no.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    48
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    49
12
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    50
00:00:35,515 --> 00:00:37,210
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    51
And we can't use
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    52
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    53
13
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    54
00:00:37,210 --> 00:00:39,565
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    55
this specification
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    56
directly because remember,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    57
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    58
14
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    59
00:00:39,565 --> 00:00:43,305
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    60
this l Sometimes
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    61
produces infinite sets.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    62
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    63
15
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    64
00:00:43,305 --> 00:00:47,585
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    65
And so we can test whether a
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    66
string is an infinite set,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    67
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    68
16
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    69
00:00:47,585 --> 00:00:50,090
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    70
at least not easily.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    71
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    72
17
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    73
00:00:50,090 --> 00:00:52,340
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    74
And so what we have to do
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    75
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    76
18
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    77
00:00:52,340 --> 00:00:54,260
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    78
instead is we have
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    79
to be a bit more
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    80
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    81
19
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    82
00:00:54,260 --> 00:00:57,050
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    83
clever and implement
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    84
some operations
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    85
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    86
20
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    87
00:00:57,050 --> 00:00:59,284
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    88
on Rekha expressions instead.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    89
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    90
21
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    91
00:00:59,284 --> 00:01:03,275
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    92
Because Weka expressions
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    93
are always finite trees.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    94
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    95
22
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    96
00:01:03,275 --> 00:01:05,870
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    97
I should say the
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    98
person who has been
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    99
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   100
23
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   101
00:01:05,870 --> 00:01:08,150
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   102
clever is called brush-off ski.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   103
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   104
24
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   105
00:01:08,150 --> 00:01:11,435
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   106
It's his, I've written,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   107
I'm introducing here.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   108
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   109
25
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   110
00:01:11,435 --> 00:01:15,515
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   111
And his algorithm consists
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   112
of two functions.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   113
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   114
26
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   115
00:01:15,515 --> 00:01:17,840
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   116
One is called
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   117
nullable and it takes
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   118
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   119
27
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   120
00:01:17,840 --> 00:01:20,104
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   121
a regular expression as argument.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   122
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   123
28
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   124
00:01:20,104 --> 00:01:24,155
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   125
And the idea is that
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   126
this function nullable.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   127
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   128
29
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   129
00:01:24,155 --> 00:01:26,450
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   130
Testing whether
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   131
the reg expression
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   132
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   133
30
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   134
00:01:26,450 --> 00:01:27,950
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   135
can match the empty string.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   136
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   137
31
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   138
00:01:27,950 --> 00:01:30,305
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   139
So 0 cannot match any string.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   140
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   141
32
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   142
00:01:30,305 --> 00:01:33,275
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   143
So it cannot match the
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   144
empty string either.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   145
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   146
33
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   147
00:01:33,275 --> 00:01:35,465
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   148
So that's defined as false.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   149
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   150
34
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   151
00:01:35,465 --> 00:01:37,775
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   152
This reg expression,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   153
the whole purpose
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   154
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   155
35
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   156
00:01:37,775 --> 00:01:39,680
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   157
is that it can match
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   158
the empty string.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   159
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   160
36
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   161
00:01:39,680 --> 00:01:41,645
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   162
So it's defined as true.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   163
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   164
37
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   165
00:01:41,645 --> 00:01:44,599
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   166
If a reg expression
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   167
can match a character,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   168
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   169
38
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   170
00:01:44,599 --> 00:01:47,045
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   171
then it cannot match
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   172
the empty string.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   173
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   174
39
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   175
00:01:47,045 --> 00:01:49,445
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   176
So that is defined as false.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   177
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   178
40
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   179
00:01:49,445 --> 00:01:53,180
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   180
If an alternative can
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   181
match the empty string,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   182
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   183
41
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   184
00:01:53,180 --> 00:01:56,960
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   185
then either or one can
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   186
match the empty string.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   187
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   188
42
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   189
00:01:56,960 --> 00:01:59,720
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   190
Or R2 can match the empty string.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   191
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   192
43
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   193
00:01:59,720 --> 00:02:03,110
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   194
So either nullable
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   195
of R1 has to hold,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   196
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   197
44
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   198
00:02:03,110 --> 00:02:06,945
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   199
or nullable of R2 has to hold.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   200
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   201
45
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   202
00:02:06,945 --> 00:02:09,925
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   203
In this sequence, it's
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   204
the other way around.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   205
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   206
46
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   207
00:02:09,925 --> 00:02:12,790
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   208
If this reg expression can
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   209
match the empty string,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   210
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   211
47
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   212
00:02:12,790 --> 00:02:16,615
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   213
then R1 has to be able to
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   214
match the empty string,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   215
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   216
48
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   217
00:02:16,615 --> 00:02:20,290
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   218
and R2 has to be able to
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   219
match the empty string.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   220
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   221
49
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   222
00:02:20,290 --> 00:02:22,555
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   223
So here it's just the opposite.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   224
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   225
50
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   226
00:02:22,555 --> 00:02:25,660
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   227
In one case it is o and
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   228
the other case it's end.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   229
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   230
51
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   231
00:02:25,660 --> 00:02:27,970
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   232
In the store record
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   233
expression can match
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   234
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   235
52
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   236
00:02:27,970 --> 00:02:30,445
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   237
always the empty string.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   238
So that is true.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   239
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   240
53
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   241
00:02:30,445 --> 00:02:33,340
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   242
So this is a simple
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   243
recursive function
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   244
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   245
54
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   246
00:02:33,340 --> 00:02:37,179
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   247
and should not be too
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   248
difficult to implement.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   249
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   250
55
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   251
00:02:37,179 --> 00:02:42,025
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   252
Okay, this nullable function
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   253
that is easy-peasy.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   254
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   255
56
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   256
00:02:42,025 --> 00:02:44,604
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   257
The second function, however,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   258
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   259
57
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   260
00:02:44,604 --> 00:02:49,155
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   261
is a bit more involved and
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   262
that's just to be expected.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   263
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   264
58
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   265
00:02:49,155 --> 00:02:53,075
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   266
Remember people working in
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   267
this area already for decades.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   268
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   269
59
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   270
00:02:53,075 --> 00:02:57,305
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   271
If they have some problems
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   272
with runtime, for example,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   273
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   274
60
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   275
00:02:57,305 --> 00:02:58,940
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   276
we can't expect that as
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   277
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   278
61
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   279
00:02:58,940 --> 00:03:03,260
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   280
simple fix will solve all
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   281
the problems in the world.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   282
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   283
62
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   284
00:03:03,260 --> 00:03:06,530
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   285
So I admit the second
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   286
function is a bit more
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   287
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   288
63
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   289
00:03:06,530 --> 00:03:10,085
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   290
complicated and make sure
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   291
that you understand it.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   292
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   293
64
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   294
00:03:10,085 --> 00:03:12,140
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   295
And it also just
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   296
chose this preserves
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   297
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   298
65
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   299
00:03:12,140 --> 00:03:14,345
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   300
the is a very clever guy.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   301
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   302
66
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   303
00:03:14,345 --> 00:03:15,800
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   304
Actually, I have to say he was
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   305
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   306
67
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   307
00:03:15,800 --> 00:03:17,720
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   308
a clever guy because
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   309
I think he either
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   310
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   311
68
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   312
00:03:17,720 --> 00:03:21,650
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   313
died last year or
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   314
the year before.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   315
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   316
69
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   317
00:03:21,650 --> 00:03:25,505
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   318
And he came up with this
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   319
algorithm already in 1964.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   320
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   321
70
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   322
00:03:25,505 --> 00:03:27,260
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   323
It somehow got lost,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   324
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   325
71
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   326
00:03:27,260 --> 00:03:30,305
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   327
but has been rediscovered
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   328
in the last ten years.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   329
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   330
72
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   331
00:03:30,305 --> 00:03:34,685
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   332
So the idea of the second
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   333
function is the following.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   334
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   335
73
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   336
00:03:34,685 --> 00:03:38,120
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   337
Imagine you have a
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   338
reexpression and it can
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   339
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   340
74
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   341
00:03:38,120 --> 00:03:41,930
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   342
match a string of the
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   343
form C followed by as.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   344
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   345
75
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   346
00:03:41,930 --> 00:03:44,810
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   347
So the C is the first
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   348
character of that string.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   349
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   350
76
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   351
00:03:44,810 --> 00:03:48,605
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   352
So I mentioned that can
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   353
match this kind of string.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   354
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   355
77
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   356
00:03:48,605 --> 00:03:50,330
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   357
The question is now,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   358
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   359
78
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   360
00:03:50,330 --> 00:03:52,400
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   361
what would a wrecker
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   362
expression look
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   363
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   364
79
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   365
00:03:52,400 --> 00:03:54,695
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   366
like that can match chest
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   367
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   368
80
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   369
00:03:54,695 --> 00:03:57,140
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   370
s. You probably remember
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   371
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   372
81
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   373
00:03:57,140 --> 00:03:59,300
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   374
that from the semantic
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   375
that every relative,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   376
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   377
82
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   378
00:03:59,300 --> 00:04:00,860
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   379
there was also
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   380
something of chopping
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   381
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   382
83
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   383
00:04:00,860 --> 00:04:02,210
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   384
off the first character.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   385
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   386
84
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   387
00:04:02,210 --> 00:04:04,940
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   388
Here it's the same.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   389
If a reg expression
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   390
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   391
85
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   392
00:04:04,940 --> 00:04:07,835
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   393
can match a string
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   394
starting with a C,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   395
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   396
86
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   397
00:04:07,835 --> 00:04:11,090
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   398
we're looking for a wreck
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   399
expression which can match
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   400
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   401
87
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   402
00:04:11,090 --> 00:04:15,215
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   403
the rest of the string where
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   404
the c has been chopped off.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   405
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   406
88
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   407
00:04:15,215 --> 00:04:17,690
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   408
And this operation will be called
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   409
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   410
89
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   411
00:04:17,690 --> 00:04:21,049
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   412
the derivative of a
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   413
wreck expression.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   414
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   415
90
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   416
00:04:21,049 --> 00:04:22,205
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   417
And it will also take
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   418
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   419
91
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   420
00:04:22,205 --> 00:04:25,460
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   421
a character as argument
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   422
and the rec expression.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   423
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   424
92
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   425
00:04:25,460 --> 00:04:28,730
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   426
And in contrast to
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   427
the semantic records,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   428
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   429
93
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   430
00:04:28,730 --> 00:04:31,310
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   431
semantic derivative, which works
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   432
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   433
94
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   434
00:04:31,310 --> 00:04:34,430
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   435
over languages or
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   436
sets of strings.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   437
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   438
95
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   439
00:04:34,430 --> 00:04:39,620
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   440
This derivative works
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   441
over regular expressions.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   442
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   443
96
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   444
00:04:39,620 --> 00:04:41,330
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   445
Okay, here's this function.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   446
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   447
97
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   448
00:04:41,330 --> 00:04:43,970
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   449
It's defined recursively over
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   450
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   451
98
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   452
00:04:43,970 --> 00:04:46,370
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   453
the structure of rec expressions.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   454
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   455
99
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   456
00:04:46,370 --> 00:04:48,814
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   457
The first argument
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   458
is the character,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   459
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   460
100
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   461
00:04:48,814 --> 00:04:52,700
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   462
and the second one is
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   463
a wreck expression.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   464
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   465
101
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   466
00:04:52,700 --> 00:04:56,510
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   467
And remember the idea
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   468
is we're looking for
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   469
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   470
102
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   471
00:04:56,510 --> 00:05:00,680
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   472
a wreck expression that
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   473
can match everything.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   474
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   475
103
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   476
00:05:00,680 --> 00:05:03,125
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   477
This reg expression
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   478
as argument can match
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   479
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   480
104
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   481
00:05:03,125 --> 00:05:07,040
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   482
except for the C. So now let's
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   483
look at this first case.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   484
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   485
105
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   486
00:05:07,040 --> 00:05:10,550
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   487
So this reg expression
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   488
cannot match any string.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   489
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   490
106
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   491
00:05:10,550 --> 00:05:14,270
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   492
So it certainly cannot
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   493
match any string starting
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   494
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   495
107
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   496
00:05:14,270 --> 00:05:16,910
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   497
a C. So we have to look
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   498
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   499
108
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   500
00:05:16,910 --> 00:05:20,090
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   501
for and reg expression which
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   502
can not much anything.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   503
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   504
109
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   505
00:05:20,090 --> 00:05:22,700
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   506
Well, that's the purpose
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   507
of this record expression,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   508
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   509
110
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   510
00:05:22,700 --> 00:05:24,815
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   511
so we define it as 0.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   512
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   513
111
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   514
00:05:24,815 --> 00:05:28,130
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   515
In the next case,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   516
this reg expression
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   517
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   518
112
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   519
00:05:28,130 --> 00:05:30,440
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   520
can match the empty string,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   521
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   522
113
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   523
00:05:30,440 --> 00:05:33,440
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   524
but it cannot match
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   525
any string that starts
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   526
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   527
114
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   528
00:05:33,440 --> 00:05:36,350
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   529
with C. So also in this case,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   530
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   531
115
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   532
00:05:36,350 --> 00:05:39,560
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   533
we just define it as
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   534
the bracket question,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   535
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   536
116
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   537
00:05:39,560 --> 00:05:41,615
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   538
which cannot match anything.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   539
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   540
117
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   541
00:05:41,615 --> 00:05:45,170
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   542
In the next case, this
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   543
C as the argument to
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   544
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   545
118
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   546
00:05:45,170 --> 00:05:48,335
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   547
the derivative and this d
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   548
is the Rekha expression.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   549
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   550
119
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   551
00:05:48,335 --> 00:05:50,225
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   552
So now there are two cases.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   553
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   554
120
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   555
00:05:50,225 --> 00:05:53,525
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   556
If this C and this D
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   557
is actually equal.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   558
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   559
121
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   560
00:05:53,525 --> 00:05:55,970
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   561
That means this record
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   562
expression can match
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   563
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   564
122
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   565
00:05:55,970 --> 00:05:59,240
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   566
a string which just contains C0.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   567
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   568
123
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   569
00:05:59,240 --> 00:06:01,505
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   570
So if we strip that off,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   571
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   572
124
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   573
00:06:01,505 --> 00:06:04,790
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   574
motor remains is
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   575
the empty string.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   576
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   577
125
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   578
00:06:04,790 --> 00:06:06,890
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   579
What is a regular expression
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   580
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   581
126
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   582
00:06:06,890 --> 00:06:09,170
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   583
look like that can
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   584
match the empty string.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   585
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   586
127
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   587
00:06:09,170 --> 00:06:11,915
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   588
Well, that's the
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   589
purpose of the warm.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   590
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   591
128
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   592
00:06:11,915 --> 00:06:15,440
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   593
And if c is not equal to d,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   594
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   595
129
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   596
00:06:15,440 --> 00:06:17,630
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   597
then this reg expression
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   598
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   599
130
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   600
00:06:17,630 --> 00:06:19,220
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   601
cannot match anything
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   602
which starts with
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   603
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   604
131
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   605
00:06:19,220 --> 00:06:23,780
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   606
a C. So again it will
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   607
be defined as just 0.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   608
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   609
132
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   610
00:06:23,780 --> 00:06:29,390
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   611
Okay? Now, the alternative case,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   612
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   613
133
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   614
00:06:29,390 --> 00:06:31,970
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   615
if this reg expression can
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   616
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   617
134
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   618
00:06:31,970 --> 00:06:36,050
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   619
match the strings
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   620
starting with C,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   621
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   622
135
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   623
00:06:36,050 --> 00:06:40,820
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   624
then it can either be
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   625
matched by the Ongwen.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   626
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   627
136
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   628
00:06:40,820 --> 00:06:44,495
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   629
Or it can be much by the R2.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   630
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   631
137
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   632
00:06:44,495 --> 00:06:50,090
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   633
If they are one can match C
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   634
and then following a string,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   635
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   636
138
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   637
00:06:50,090 --> 00:06:53,975
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   638
then we just have to recursively
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   639
call the derivative for
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   640
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   641
139
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   642
00:06:53,975 --> 00:06:56,570
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   643
R to get a reg expression
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   644
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   645
140
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   646
00:06:56,570 --> 00:06:59,135
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   647
that can match the
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   648
rest of the string.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   649
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   650
141
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   651
00:06:59,135 --> 00:07:02,690
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   652
And the same we can do with R2.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   653
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   654
142
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   655
00:07:02,690 --> 00:07:06,110
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   656
You can find a reg expression
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   657
which can match everything.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   658
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   659
143
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   660
00:07:06,110 --> 00:07:07,850
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   661
This R2 can match,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   662
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   663
144
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   664
00:07:07,850 --> 00:07:09,710
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   665
starting with C, bad,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   666
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   667
145
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   668
00:07:09,710 --> 00:07:12,590
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   669
which chopping off this C. Okay?
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   670
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   671
146
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   672
00:07:12,590 --> 00:07:16,370
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   673
So now if you have to find
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   674
the break expression,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   675
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   676
147
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   677
00:07:16,370 --> 00:07:20,030
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   678
which can match all the strings
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   679
where C is tripped off.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   680
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   681
148
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   682
00:07:20,030 --> 00:07:22,295
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   683
Then we just have to
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   684
take the alternatives
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   685
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   686
149
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   687
00:07:22,295 --> 00:07:24,965
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   688
of these two derivatives.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   689
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   690
150
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   691
00:07:24,965 --> 00:07:29,390
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   692
Okay? Now to sequence case,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   693
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   694
151
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   695
00:07:29,390 --> 00:07:33,005
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   696
this sequence case is the
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   697
most complicated one.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   698
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   699
152
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   700
00:07:33,005 --> 00:07:35,180
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   701
And let's look first at
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   702
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   703
153
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   704
00:07:35,180 --> 00:07:39,335
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   705
the second case where
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   706
the Earth's brush.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   707
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   708
154
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   709
00:07:39,335 --> 00:07:42,830
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   710
Okay? So if this
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   711
regular expression
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   712
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   713
155
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   714
00:07:42,830 --> 00:07:46,145
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   715
can match a string
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   716
starting with C,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   717
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   718
156
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   719
00:07:46,145 --> 00:07:48,155
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   720
then the following
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   721
must have happened.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   722
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   723
157
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   724
00:07:48,155 --> 00:07:51,905
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   725
First, the R1 must have matched
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   726
a string starting with C
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   727
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   728
158
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   729
00:07:51,905 --> 00:07:56,420
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   730
and then anything coming
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   731
afterwards with r2.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   732
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   733
159
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   734
00:07:56,420 --> 00:07:59,660
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   735
Okay? So in this case I only
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   736
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   737
160
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   738
00:07:59,660 --> 00:08:03,260
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   739
have to call this
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   740
derivative for this r one.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   741
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   742
161
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   743
00:08:03,260 --> 00:08:06,830
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   744
And find the reg expression
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   745
which can match everything
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   746
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   747
162
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   748
00:08:06,830 --> 00:08:11,555
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   749
this R one can match except
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   750
for this C chopped off.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   751
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   752
163
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   753
00:08:11,555 --> 00:08:15,830
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   754
And I have to build that
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   755
sequence derivative of that.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   756
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   757
164
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   758
00:08:15,830 --> 00:08:18,260
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   759
So that's what the As per se.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   760
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   761
165
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   762
00:08:18,260 --> 00:08:21,860
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   763
So I take the
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   764
derivative of R1 and I
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   765
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   766
166
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   767
00:08:21,860 --> 00:08:23,480
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   768
put the R2 on
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   769
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   770
167
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   771
00:08:23,480 --> 00:08:25,865
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   772
the back because that's
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   773
the rest of the string.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   774
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   775
168
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   776
00:08:25,865 --> 00:08:29,240
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   777
Ok? So that's the only
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   778
case we have to consider
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   779
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   780
169
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   781
00:08:29,240 --> 00:08:32,750
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   782
this sequence case
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   783
except if not the,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   784
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   785
170
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   786
00:08:32,750 --> 00:08:37,895
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   787
how one can match the
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   788
sea and something else.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   789
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   790
171
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   791
00:08:37,895 --> 00:08:42,965
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   792
But if on mismatching
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   793
actually the empty string,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   794
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   795
172
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   796
00:08:42,965 --> 00:08:48,890
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   797
this case actually the R two
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   798
is in charge of matching
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   799
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   800
173
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   801
00:08:48,890 --> 00:08:51,590
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   802
the string starting with C. So in
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   803
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   804
174
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   805
00:08:51,590 --> 00:08:55,490
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   806
this case we have to call
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   807
the derivative for R2.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   808
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   809
175
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   810
00:08:55,490 --> 00:08:57,875
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   811
So that's why we have
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   812
these two cases.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   813
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   814
176
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   815
00:08:57,875 --> 00:09:00,455
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   816
So if R1 is nullable,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   817
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   818
177
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   819
00:09:00,455 --> 00:09:03,245
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   820
then it can match
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   821
the empty string.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   822
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   823
178
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   824
00:09:03,245 --> 00:09:05,330
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   825
And we have to
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   826
consider the case that
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   827
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   828
179
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   829
00:09:05,330 --> 00:09:08,045
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   830
this R2 is matching a string
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   831
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   832
180
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   833
00:09:08,045 --> 00:09:10,700
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   834
starting with C. And so we have
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   835
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   836
181
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   837
00:09:10,700 --> 00:09:14,210
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   838
to call the derivative
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   839
for this R2 in this case.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   840
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   841
182
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   842
00:09:14,210 --> 00:09:18,680
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   843
Otherwise, the R1 will
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   844
be in charge of matching
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   845
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   846
183
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   847
00:09:18,680 --> 00:09:20,840
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   848
a part of that
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   849
string starting with
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   850
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   851
184
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   852
00:09:20,840 --> 00:09:24,695
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   853
C. And I have to call the
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   854
derivative on this R1.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   855
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   856
185
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   857
00:09:24,695 --> 00:09:30,670
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   858
Okay? I hope this makes sense.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   859
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   860
186
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   861
00:09:30,670 --> 00:09:34,150
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   862
Go over that and
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   863
also the handouts.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   864
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   865
187
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   866
00:09:34,150 --> 00:09:37,465
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   867
Again. With that, that's
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   868
it's really subtle.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   869
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   870
188
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   871
00:09:37,465 --> 00:09:40,945
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   872
And how do I remember this case?
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   873
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   874
189
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   875
00:09:40,945 --> 00:09:42,430
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   876
Well, I know it's
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   877
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   878
190
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   879
00:09:42,430 --> 00:09:45,310
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   880
an if condition and the
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   881
condition is nullable,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   882
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   883
191
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   884
00:09:45,310 --> 00:09:48,160
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   885
then I will always remember
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   886
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   887
192
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   888
00:09:48,160 --> 00:09:53,275
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   889
the else branch where pushes
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   890
NG derivative over the R1.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   891
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   892
193
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   893
00:09:53,275 --> 00:09:55,780
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   894
So are usually write
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   895
down the S punch
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   896
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   897
194
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   898
00:09:55,780 --> 00:09:59,650
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   899
first and then construct
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   900
the thin branch by saying,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   901
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   902
195
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   903
00:09:59,650 --> 00:10:01,525
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   904
well, I just repeat this.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   905
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   906
196
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   907
00:10:01,525 --> 00:10:03,760
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   908
And I have to remember
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   909
in that case I
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   910
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   911
197
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   912
00:10:03,760 --> 00:10:06,580
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   913
have to build also
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   914
derivative of R2.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   915
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   916
198
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   917
00:10:06,580 --> 00:10:12,695
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   918
Okay? Finally, the star case.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   919
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   920
199
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   921
00:10:12,695 --> 00:10:15,665
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   922
Ok. So here again
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   923
we're looking for
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   924
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   925
200
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   926
00:10:15,665 --> 00:10:17,300
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   927
a reg expression which
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   928
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   929
201
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   930
00:10:17,300 --> 00:10:19,745
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   931
can match the string
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   932
starting with C,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   933
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   934
202
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   935
00:10:19,745 --> 00:10:22,355
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   936
except that the c has
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   937
been chopped off.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   938
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   939
203
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   940
00:10:22,355 --> 00:10:28,640
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   941
So if r star has to match
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   942
a string starting with C,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   943
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   944
204
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   945
00:10:28,640 --> 00:10:32,735
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   946
then at least we need one
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   947
copy of this r. Okay?
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   948
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   949
205
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   950
00:10:32,735 --> 00:10:34,310
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   951
So at least one copy of
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   952
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   953
206
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   954
00:10:34,310 --> 00:10:37,010
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   955
this r has matched
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   956
something which starts with
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   957
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   958
207
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   959
00:10:37,010 --> 00:10:38,870
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   960
a C and then afterwards
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   961
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   962
208
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   963
00:10:38,870 --> 00:10:41,570
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   964
come 0 more copies
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   965
of this OnStar.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   966
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   967
209
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   968
00:10:41,570 --> 00:10:45,530
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   969
Okay? What we do there
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   970
is we trying to find
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   971
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   972
210
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   973
00:10:45,530 --> 00:10:47,960
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   974
the Rekha expression
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   975
which can match
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   976
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   977
211
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   978
00:10:47,960 --> 00:10:50,915
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   979
this first part of the string.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   980
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   981
212
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   982
00:10:50,915 --> 00:10:53,255
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   983
However, where the
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   984
sea is chopped off.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   985
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   986
213
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   987
00:10:53,255 --> 00:10:55,130
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   988
And then we just say, well,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   989
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   990
214
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   991
00:10:55,130 --> 00:10:57,050
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   992
the rest has to be
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   993
matched again with
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   994
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   995
215
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   996
00:10:57,050 --> 00:10:59,030
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   997
0 or more copies of
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   998
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
   999
216
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1000
00:10:59,030 --> 00:11:02,600
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1001
this R. So that's why
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1002
it's defined like this.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1003
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1004
217
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1005
00:11:02,600 --> 00:11:09,050
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1006
Okay? S8. Please take care
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1007
with this definition.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1008
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1009
218
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1010
00:11:09,050 --> 00:11:11,435
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1011
That's not so simple.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1012
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1013
219
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1014
00:11:11,435 --> 00:11:13,250
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1015
Once you get a hang of it,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1016
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1017
220
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1018
00:11:13,250 --> 00:11:15,170
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1019
however, it makes perfect sense.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1020
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1021
221
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1022
00:11:15,170 --> 00:11:17,210
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1023
So let me explain it in
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1024
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1025
222
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1026
00:11:17,210 --> 00:11:20,825
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1027
different ways in
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1028
the next slides.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1029
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1030
223
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1031
00:11:20,825 --> 00:11:24,695
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1032
Okay, let's look
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1033
first some examples.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1034
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1035
224
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1036
00:11:24,695 --> 00:11:27,140
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1037
So here is a regular expression,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1038
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1039
225
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1040
00:11:27,140 --> 00:11:29,390
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1041
R. And let's have
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1042
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1043
226
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1044
00:11:29,390 --> 00:11:32,450
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1045
a look at these three
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1046
derivatives according to a,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1047
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1048
227
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1049
00:11:32,450 --> 00:11:38,405
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1050
B, and C. And Vishal do
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1051
with d1 for the a. Ok.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1052
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1053
228
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1054
00:11:38,405 --> 00:11:42,379
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1055
So here is our reg expression
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1056
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1057
229
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1058
00:11:42,379 --> 00:11:45,334
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1059
and was very generous
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1060
with dependent a thesis.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1061
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1062
230
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1063
00:11:45,334 --> 00:11:48,140
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1064
And the outermost is a star.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1065
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1066
231
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1067
00:11:48,140 --> 00:11:52,550
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1068
So if people now the
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1069
derivative according to a,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1070
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1071
232
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1072
00:11:52,550 --> 00:11:55,474
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1073
the character a of
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1074
that wreck expression.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1075
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1076
233
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1077
00:11:55,474 --> 00:11:57,380
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1078
Okay? So the first thing we
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1079
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1080
234
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1081
00:11:57,380 --> 00:11:59,555
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1082
have to analyze is the K star.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1083
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1084
235
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1085
00:11:59,555 --> 00:12:04,370
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1086
Ok? So here's direct expression,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1087
which we are looking at.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1088
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1089
236
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1090
00:12:04,370 --> 00:12:09,170
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1091
This are the outermost
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1092
constructor is this star.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1093
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1094
237
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1095
00:12:09,170 --> 00:12:11,510
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1096
If you go back to the definition,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1097
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1098
238
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1099
00:12:11,510 --> 00:12:13,625
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1100
I hope you have it next to you,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1101
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1102
239
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1103
00:12:13,625 --> 00:12:16,340
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1104
then this star case is defined
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1105
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1106
240
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1107
00:12:16,340 --> 00:12:20,000
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1108
as u taking just the
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1109
inside of the star
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1110
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1111
241
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1112
00:12:20,000 --> 00:12:23,030
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1113
and apply this derivative and
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1114
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1115
242
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1116
00:12:23,030 --> 00:12:26,765
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1117
leave the are on the
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1118
outside at the end.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1119
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1120
243
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1121
00:12:26,765 --> 00:12:29,990
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1122
Ok. So that's the first step.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1123
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1124
244
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1125
00:12:29,990 --> 00:12:32,030
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1126
Now we have to analyze
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1127
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1128
245
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1129
00:12:32,030 --> 00:12:36,035
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1130
the derivative according to
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1131
a of this record expression,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1132
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1133
246
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1134
00:12:36,035 --> 00:12:38,000
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1135
which is an alternative.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1136
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1137
247
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1138
00:12:38,000 --> 00:12:39,665
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1139
So the outermost is a plus.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1140
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1141
248
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1142
00:12:39,665 --> 00:12:41,375
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1143
Ok, that's very easy again,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1144
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1145
249
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1146
00:12:41,375 --> 00:12:45,185
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1147
we just have to push the
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1148
derivative into each component,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1149
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1150
250
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1151
00:12:45,185 --> 00:12:47,705
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1152
into the a, followed by b.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1153
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1154
251
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1155
00:12:47,705 --> 00:12:49,145
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1156
And in this segment,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1157
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1158
252
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1159
00:12:49,145 --> 00:12:51,185
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1160
alternative into b. Ok,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1161
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1162
253
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1163
00:12:51,185 --> 00:12:56,030
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1164
so we take the derivative
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1165
of each according to a way.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1166
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1167
254
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1168
00:12:56,030 --> 00:13:00,635
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1169
Now this one is a sequence
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1170
break expression.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1171
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1172
255
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1173
00:13:00,635 --> 00:13:02,210
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1174
This most complicated case.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1175
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1176
256
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1177
00:13:02,210 --> 00:13:04,160
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1178
So the first of all
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1179
you have to test is,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1180
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1181
257
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1182
00:13:04,160 --> 00:13:07,910
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1183
is the first component
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1184
nullable of this sequence?
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1185
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1186
258
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1187
00:13:07,910 --> 00:13:09,200
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1188
Well, that is a,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1189
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1190
259
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1191
00:13:09,200 --> 00:13:12,740
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1192
in this case, a on its
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1193
own is not nullable.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1194
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1195
260
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1196
00:13:12,740 --> 00:13:14,210
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1197
So vn, the easy case,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1198
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1199
261
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1200
00:13:14,210 --> 00:13:17,000
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1201
we only have a single derivative
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1202
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1203
262
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1204
00:13:17,000 --> 00:13:19,370
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1205
pushed in the first component.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1206
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1207
263
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1208
00:13:19,370 --> 00:13:25,160
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1209
So we have the derivative
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1210
of a with the character a.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1211
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1212
264
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1213
00:13:25,160 --> 00:13:27,920
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1214
Okay, that's now
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1215
the character case.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1216
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1217
265
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1218
00:13:27,920 --> 00:13:29,720
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1219
And in this case the character
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1220
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1221
266
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1222
00:13:29,720 --> 00:13:31,715
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1223
in the regular expression agree.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1224
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1225
267
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1226
00:13:31,715 --> 00:13:33,890
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1227
So it's defined as one.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1228
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1229
268
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1230
00:13:33,890 --> 00:13:37,550
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1231
Ok? In the other case,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1232
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1233
269
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1234
00:13:37,550 --> 00:13:39,710
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1235
the break expression is P,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1236
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1237
270
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1238
00:13:39,710 --> 00:13:41,675
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1239
But the characters a.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1240
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1241
271
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1242
00:13:41,675 --> 00:13:46,385
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1243
So in this case
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1244
it's defined as 0.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1245
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1246
272
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1247
00:13:46,385 --> 00:13:50,630
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1248
Okay? So that's what the
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1249
derivative would be.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1250
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1251
273
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1252
00:13:50,630 --> 00:13:52,160
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1253
This r is there
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1254
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1255
274
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1256
00:13:52,160 --> 00:13:55,280
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1257
because originally we
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1258
started with a star.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1259
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1260
275
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1261
00:13:55,280 --> 00:13:58,295
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1262
This expression is that
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1263
star at expression.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1264
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1265
276
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1266
00:13:58,295 --> 00:14:02,780
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1267
Ok? So the derivative
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1268
according to a
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1269
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1270
277
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1271
00:14:02,780 --> 00:14:07,610
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1272
up that reg expression
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1273
is this expression.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1274
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1275
278
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1276
00:14:07,610 --> 00:14:10,970
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1277
We just have to
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1278
substitute this back in.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1279
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1280
279
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1281
00:14:10,970 --> 00:14:13,745
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1282
Just coming back to this slide.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1283
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1284
280
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1285
00:14:13,745 --> 00:14:16,160
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1286
So far, they're only analyze
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1287
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1288
281
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1289
00:14:16,160 --> 00:14:19,505
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1290
the derivative according
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1291
to a single character.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1292
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1293
282
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1294
00:14:19,505 --> 00:14:23,960
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1295
But we can also very easily
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1296
extend that to whole strings.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1297
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1298
283
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1299
00:14:23,960 --> 00:14:26,360
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1300
So if you build the
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1301
derivative according
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1302
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1303
284
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1304
00:14:26,360 --> 00:14:27,905
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1305
to the empty string,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1306
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1307
285
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1308
00:14:27,905 --> 00:14:30,875
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1309
we just return the
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1310
Rekha expression.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1311
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1312
286
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1313
00:14:30,875 --> 00:14:35,585
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1314
If we have a string
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1315
starting with character c,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1316
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1317
287
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1318
00:14:35,585 --> 00:14:37,850
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1319
remember that can
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1320
be any character.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1321
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1322
288
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1323
00:14:37,850 --> 00:14:42,170
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1324
Then we build first the simple
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1325
derivative according to
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1326
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1327
289
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1328
00:14:42,170 --> 00:14:44,360
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1329
that first character and
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1330
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1331
290
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1332
00:14:44,360 --> 00:14:46,925
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1333
continue with the
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1334
rest of the string.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1335
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1336
291
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1337
00:14:46,925 --> 00:14:50,615
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1338
So here you see again,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1339
my personal convention.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1340
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1341
292
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1342
00:14:50,615 --> 00:14:54,365
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1343
Everything which works on
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1344
lists has this S at the end.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1345
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1346
293
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1347
00:14:54,365 --> 00:14:57,125
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1348
So this function is
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1349
for single characters.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1350
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1351
294
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1352
00:14:57,125 --> 00:14:59,179
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1353
This one is for strings,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1354
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1355
295
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1356
00:14:59,179 --> 00:15:02,450
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1357
but it uses the one
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1358
for the character.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1359
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1360
296
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1361
00:15:02,450 --> 00:15:04,025
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1362
Essentially what it does is
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1363
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1364
297
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1365
00:15:04,025 --> 00:15:06,185
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1366
it chops off the first character,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1367
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1368
298
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1369
00:15:06,185 --> 00:15:09,800
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1370
builds the derivative, then
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1371
chops off the next character,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1372
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1373
299
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1374
00:15:09,800 --> 00:15:13,760
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1375
builds the derivative of
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1376
the result, and so on.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1377
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1378
300
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1379
00:15:13,760 --> 00:15:17,000
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1380
Having this function,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1381
we can actually now
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1382
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1383
301
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1384
00:15:17,000 --> 00:15:20,600
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1385
state what the algorithm
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1386
is, the complete algorithm.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1387
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1388
302
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1389
00:15:20,600 --> 00:15:23,465
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1390
So the pro shops ki mantra
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1391
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1392
303
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1393
00:15:23,465 --> 00:15:24,860
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1394
takes a regular expression as
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1395
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1396
304
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1397
00:15:24,860 --> 00:15:26,915
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1398
argument and a
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1399
string as argument.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1400
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1401
305
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1402
00:15:26,915 --> 00:15:30,920
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1403
And is supposed to say yes if
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1404
the reg expression matches
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1405
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1406
306
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1407
00:15:30,920 --> 00:15:33,560
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1408
the string or No
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1409
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1410
307
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1411
00:15:33,560 --> 00:15:36,065
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1412
if the reg expression does
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1413
not match the string.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1414
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1415
308
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1416
00:15:36,065 --> 00:15:37,715
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1417
And how does it do that?
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1418
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1419
309
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1420
00:15:37,715 --> 00:15:42,560
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1421
Well, it takes this string
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1422
s And this reg expression,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1423
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1424
310
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1425
00:15:42,560 --> 00:15:43,925
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1426
and it first built
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1427
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1428
311
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1429
00:15:43,925 --> 00:15:48,845
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1430
successive derivatives until
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1431
that string is exhaust that.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1432
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1433
312
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1434
00:15:48,845 --> 00:15:52,115
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1435
Okay? Then you have
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1436
a final derivative,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1437
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1438
313
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1439
00:15:52,115 --> 00:15:53,839
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1440
a final reg expression.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1441
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1442
314
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1443
00:15:53,839 --> 00:15:55,370
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1444
And you test whether
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1445
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1446
315
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1447
00:15:55,370 --> 00:15:57,920
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1448
this reg expression can
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1449
match the empty string.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1450
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1451
316
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1452
00:15:57,920 --> 00:16:01,370
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1453
If yes, then the
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1454
original reg expression
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1455
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1456
317
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1457
00:16:01,370 --> 00:16:03,245
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1458
is r can match the string.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1459
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1460
318
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1461
00:16:03,245 --> 00:16:05,210
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1462
If no, if it cannot match
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1463
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1464
319
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1465
00:16:05,210 --> 00:16:08,030
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1466
the final derivative
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1467
with the empty string,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1468
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1469
320
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1470
00:16:08,030 --> 00:16:10,280
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1471
then know this
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1472
regular expression,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1473
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1474
321
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1475
00:16:10,280 --> 00:16:12,905
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1476
R cannot match that string.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1477
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1478
322
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1479
00:16:12,905 --> 00:16:16,010
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1480
I know it looks
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1481
very anticlimactic,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1482
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1483
323
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1484
00:16:16,010 --> 00:16:19,625
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1485
but that's actually the
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1486
beauty of this algorithm,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1487
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1488
324
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1489
00:16:19,625 --> 00:16:22,760
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1490
that it's not that complicated.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1491
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1492
325
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1493
00:16:22,760 --> 00:16:25,340
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1494
So how does the algorithm work?
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1495
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1496
326
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1497
00:16:25,340 --> 00:16:27,634
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1498
In a concrete example?
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1499
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1500
327
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1501
00:16:27,634 --> 00:16:31,580
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1502
Imagine you have a string, abc
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1503
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1504
328
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1505
00:16:31,580 --> 00:16:34,370
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1506
and you have a break
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1507
expression, say R1.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1508
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1509
329
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1510
00:16:34,370 --> 00:16:37,520
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1511
And you want to find out
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1512
whether this or one can match
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1513
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1514
330
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1515
00:16:37,520 --> 00:16:41,300
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1516
that string abc or not.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1517
How do you do that?
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1518
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1519
331
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1520
00:16:41,300 --> 00:16:45,140
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1521
Well, you would first
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1522
take this R1 and you
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1523
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1524
332
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1525
00:16:45,140 --> 00:16:47,150
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1526
build the derivative according
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1527
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1528
333
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1529
00:16:47,150 --> 00:16:49,880
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1530
to the first character, D-A.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1531
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1532
334
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1533
00:16:49,880 --> 00:16:53,015
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1534
Okay? You get the derivative,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1535
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1536
335
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1537
00:16:53,015 --> 00:16:55,294
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1538
which I call here R2.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1539
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1540
336
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1541
00:16:55,294 --> 00:16:58,640
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1542
Then you take the next
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1543
character, the B.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1544
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1545
337
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1546
00:16:58,640 --> 00:17:04,535
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1547
You now build the derivative
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1548
according to b of this R2.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1549
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1550
338
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1551
00:17:04,535 --> 00:17:07,460
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1552
Okay? So you take the
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1553
result of the first step,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1554
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1555
339
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1556
00:17:07,460 --> 00:17:09,530
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1557
you feed it into the second step,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1558
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1559
340
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1560
00:17:09,530 --> 00:17:11,810
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1561
and you take the
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1562
second character.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1563
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1564
341
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1565
00:17:11,810 --> 00:17:17,075
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1566
Then you do this also with c.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1567
So you get a derivative R3,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1568
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1569
342
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1570
00:17:17,075 --> 00:17:22,460
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1571
and you build the derivative
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1572
of R three according to c,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1573
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1574
343
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1575
00:17:22,460 --> 00:17:24,185
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1576
you get an R four.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1577
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1578
344
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1579
00:17:24,185 --> 00:17:26,300
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1580
Okay, so that's the
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1581
final derivative.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1582
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1583
345
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1584
00:17:26,300 --> 00:17:27,530
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1585
The string is exhausted.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1586
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1587
346
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1588
00:17:27,530 --> 00:17:29,570
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1589
We build derivatives
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1590
according to a, B,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1591
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1592
347
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1593
00:17:29,570 --> 00:17:34,610
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1594
and C. Now we just test whether
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1595
this r four is nullable.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1596
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1597
348
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1598
00:17:34,610 --> 00:17:37,175
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1599
If it says yes,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1600
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1601
349
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1602
00:17:37,175 --> 00:17:41,510
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1603
then df break expression metro
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1604
will just say true, yes,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1605
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1606
350
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1607
00:17:41,510 --> 00:17:43,340
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1608
this original reg expression,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1609
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1610
351
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1611
00:17:43,340 --> 00:17:47,270
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1612
the R1, will be able to
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1613
match that string abc.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1614
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1615
352
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1616
00:17:47,270 --> 00:17:50,585
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1617
And if this test returns false,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1618
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1619
353
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1620
00:17:50,585 --> 00:17:53,015
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1621
then the algorithm says false.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1622
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1623
354
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1624
00:17:53,015 --> 00:17:56,975
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1625
This reg expression will
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1626
not match the string.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1627
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1628
355
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1629
00:17:56,975 --> 00:18:00,260
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1630
Ok, you might ask
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1631
why on earth does
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1632
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1633
356
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1634
00:18:00,260 --> 00:18:02,960
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1635
that algorithm
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1636
actually work away?
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1637
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1638
357
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1639
00:18:02,960 --> 00:18:06,515
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1640
Here's an explanation
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1641
for why it works.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1642
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1643
358
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1644
00:18:06,515 --> 00:18:10,190
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1645
Imagine you have a wreck
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1646
expression R1, okay?
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1647
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1648
359
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1649
00:18:10,190 --> 00:18:13,220
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1650
And you have a string abc,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1651
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1652
360
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1653
00:18:13,220 --> 00:18:14,270
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1654
and you want to find out
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1655
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1656
361
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1657
00:18:14,270 --> 00:18:17,180
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1658
whether one can
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1659
match that string.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1660
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1661
362
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1662
00:18:17,180 --> 00:18:18,799
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1663
And for the moment,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1664
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1665
363
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1666
00:18:18,799 --> 00:18:22,610
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1667
let's assume that it
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1668
can match that string.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1669
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1670
364
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1671
00:18:22,610 --> 00:18:26,315
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1672
Ok? So the language L of
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1673
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1674
365
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1675
00:18:26,315 --> 00:18:30,185
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1676
R will actually
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1677
contain that string,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1678
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1679
366
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1680
00:18:30,185 --> 00:18:31,805
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1681
otherwise it wouldn't match that.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1682
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1683
367
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1684
00:18:31,805 --> 00:18:36,710
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1685
Okay? So ABC is in
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1686
this language, okay?
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1687
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1688
368
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1689
00:18:36,710 --> 00:18:39,785
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1690
If I now take the
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1691
semantic derivative,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1692
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1693
369
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1694
00:18:39,785 --> 00:18:43,145
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1695
that means I look at all
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1696
the strings in this f,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1697
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1698
370
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1699
00:18:43,145 --> 00:18:46,820
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1700
R1, and further out
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1701
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1702
371
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1703
00:18:46,820 --> 00:18:48,740
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1704
all the ones which
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1705
do not start with
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1706
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1707
372
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1708
00:18:48,740 --> 00:18:51,260
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1709
an a, I discharge them.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1710
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1711
373
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1712
00:18:51,260 --> 00:18:54,545
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1713
And I only look the one
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1714
which start with an a.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1715
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1716
374
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1717
00:18:54,545 --> 00:18:56,465
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1718
And of those strings,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1719
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1720
375
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1721
00:18:56,465 --> 00:18:58,475
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1722
I chop off this a.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1723
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1724
376
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1725
00:18:58,475 --> 00:19:01,025
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1726
So after this
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1727
romantic derivative,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1728
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1729
377
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1730
00:19:01,025 --> 00:19:05,735
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1731
this set of strings will
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1732
contain just B and C.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1733
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1734
378
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1735
00:19:05,735 --> 00:19:12,830
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1736
Ok. Now if I build the next
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1737
semantic derivative of that,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1738
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1739
379
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1740
00:19:12,830 --> 00:19:14,345
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1741
then I would look at
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1742
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1743
380
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1744
00:19:14,345 --> 00:19:16,850
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1745
all the strings which
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1746
start with a P,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1747
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1748
381
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1749
00:19:16,850 --> 00:19:21,350
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1750
and forget about everything
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1751
else of the ones.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1752
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1753
382
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1754
00:19:21,350 --> 00:19:27,905
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1755
I know they start with B.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1756
I just chop of the B. Ok.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1757
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1758
383
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1759
00:19:27,905 --> 00:19:31,655
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1760
So in this whole set here,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1761
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1762
384
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1763
00:19:31,655 --> 00:19:33,785
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1764
in this whole set here,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1765
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1766
385
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1767
00:19:33,785 --> 00:19:39,030
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1768
there will be now a string
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1769
which is just c. Okay?
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1770
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1771
386
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1772
00:19:39,190 --> 00:19:44,420
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1773
Then I built the third
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1774
semantic derivative
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1775
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1776
387
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1777
00:19:44,420 --> 00:19:47,300
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1778
because I want to find out
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1779
whether ABC is involved.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1780
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1781
388
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1782
00:19:47,300 --> 00:19:50,540
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1783
Okay? So now I look
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1784
at all the strings in
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1785
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1786
389
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1787
00:19:50,540 --> 00:19:52,820
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1788
here and look at
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1789
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1790
390
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1791
00:19:52,820 --> 00:19:55,340
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1792
them whether they start
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1793
with a C. If yes,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1794
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1795
391
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1796
00:19:55,340 --> 00:19:56,885
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1797
I chop off the sea.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1798
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1799
392
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1800
00:19:56,885 --> 00:19:59,120
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1801
And put in markets remaining.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1802
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1803
393
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1804
00:19:59,120 --> 00:20:00,425
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1805
So in this case,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1806
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1807
394
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1808
00:20:00,425 --> 00:20:02,510
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1809
if I have the string c
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1810
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1811
395
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1812
00:20:02,510 --> 00:20:04,550
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1813
in this language and
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1814
I chop off this,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1815
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1816
396
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1817
00:20:04,550 --> 00:20:07,700
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1818
see what is remaining
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1819
is the empty string.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1820
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1821
397
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1822
00:20:07,700 --> 00:20:09,695
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1823
So we have to check of
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1824
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1825
398
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1826
00:20:09,695 --> 00:20:14,510
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1827
that language whether it
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1828
contains the empty string.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1829
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1830
399
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1831
00:20:14,510 --> 00:20:18,800
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1832
If yes, then the
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1833
original R1 can match
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1834
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1835
400
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1836
00:20:18,800 --> 00:20:21,050
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1837
this ABC because this ABC
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1838
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1839
401
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1840
00:20:21,050 --> 00:20:24,119
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1841
must have been in this language.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1842
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1843
402
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1844
00:20:24,130 --> 00:20:28,565
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1845
And if in the end there wasn't
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1846
the empty string, then,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1847
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1848
403
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1849
00:20:28,565 --> 00:20:33,575
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1850
then this ABC Watson in
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1851
this language of one.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1852
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1853
404
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1854
00:20:33,575 --> 00:20:36,260
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1855
And so the electron must have,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1856
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1857
405
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1858
00:20:36,260 --> 00:20:38,880
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1859
or the metro must have failed.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1860
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1861
406
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1862
00:20:39,040 --> 00:20:42,530
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1863
The clever bit is that here
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1864
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1865
407
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1866
00:20:42,530 --> 00:20:45,530
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1867
the explanation is for languages.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1868
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1869
408
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1870
00:20:45,530 --> 00:20:49,835
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1871
Remember, this
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1872
semantic derivative
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1873
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1874
409
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1875
00:20:49,835 --> 00:20:53,450
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1876
works over languages and they
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1877
sometimes can be in finite.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1878
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1879
410
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1880
00:20:53,450 --> 00:20:55,730
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1881
So that's not really
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1882
an algorithm.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1883
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1884
411
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1885
00:20:55,730 --> 00:20:58,880
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1886
Yeah, that's just
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1887
explaining the idea with
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1888
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1889
412
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1890
00:20:58,880 --> 00:21:02,525
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1891
preserves key
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1892
achieved was that he
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1893
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1894
413
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1895
00:21:02,525 --> 00:21:06,440
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1896
now works with this derivative
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1897
America expressions and
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1898
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1899
414
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1900
00:21:06,440 --> 00:21:10,715
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1901
somehow imitates what
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1902
happens on these languages.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1903
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1904
415
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1905
00:21:10,715 --> 00:21:14,135
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1906
Because remember if you
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1907
have an wreck expression,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1908
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1909
416
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1910
00:21:14,135 --> 00:21:17,405
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1911
are you want to test
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1912
whether can match APC,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1913
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1914
417
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1915
00:21:17,405 --> 00:21:22,550
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1916
then you take first
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1917
derivative according to a.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1918
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1919
418
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1920
00:21:22,550 --> 00:21:25,760
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1921
So you will get a wreck
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1922
expression which can match b
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1923
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1924
419
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1925
00:21:25,760 --> 00:21:29,464
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1926
and c If R could match abc.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1927
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1928
420
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1929
00:21:29,464 --> 00:21:31,430
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1930
So after the first derivative,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1931
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1932
421
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1933
00:21:31,430 --> 00:21:33,620
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1934
you will get a wreck expression
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1935
which can match B and
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1936
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1937
422
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1938
00:21:33,620 --> 00:21:37,070
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1939
C. If you take the
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1940
second derivative,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1941
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1942
423
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1943
00:21:37,070 --> 00:21:41,225
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1944
you will get a reexpression
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1945
which can match c alone.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1946
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1947
424
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1948
00:21:41,225 --> 00:21:44,180
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1949
And if you take the
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1950
final derivative,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1951
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1952
425
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1953
00:21:44,180 --> 00:21:46,070
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1954
then you will get
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1955
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1956
426
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1957
00:21:46,070 --> 00:21:48,260
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1958
rec expression which hopefully
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1959
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1960
427
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1961
00:21:48,260 --> 00:21:49,715
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1962
can match the empty string.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1963
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1964
428
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1965
00:21:49,715 --> 00:21:53,780
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1966
If it does, then this
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1967
R can match the ABC.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1968
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1969
429
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1970
00:21:53,780 --> 00:21:55,655
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1971
And if it doesn't, then
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1972
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1973
430
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1974
00:21:55,655 --> 00:21:58,680
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1975
ABC couldn't be
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1976
matched by this on.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1977
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1978
431
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1979
00:21:58,900 --> 00:22:02,990
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1980
Okay, let's have a look
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1981
how this pans out in code.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1982
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1983
432
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1984
00:22:02,990 --> 00:22:06,050
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1985
Here's defile RE1.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1986
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1987
433
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1988
00:22:06,050 --> 00:22:07,940
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1989
It's also uploaded on Keith,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1990
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1991
434
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1992
00:22:07,940 --> 00:22:10,625
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1993
so you can see exactly
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1994
what I'm doing.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1995
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1996
435
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1997
00:22:10,625 --> 00:22:13,970
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1998
And actually I already saw
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  1999
that file because I showed you
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2000
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2001
436
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2002
00:22:13,970 --> 00:22:15,710
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2003
how my wreck expressions are
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2004
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2005
437
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2006
00:22:15,710 --> 00:22:17,960
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2007
defined with the
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2008
abstract classes here.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2009
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2010
438
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2011
00:22:17,960 --> 00:22:21,155
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2012
And here, the six cases
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2013
for 0-1 character,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2014
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2015
439
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2016
00:22:21,155 --> 00:22:23,540
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2017
I turn a TIF in
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2018
sequence and star.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2019
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2020
440
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2021
00:22:23,540 --> 00:22:26,705
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2022
Ok. So the first
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2023
function nullable,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2024
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2025
441
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2026
00:22:26,705 --> 00:22:28,760
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2027
the simple one, takes
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2028
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2029
442
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2030
00:22:28,760 --> 00:22:32,120
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2031
a regular expression as
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2032
argument and returns a boolean.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2033
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2034
443
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2035
00:22:32,120 --> 00:22:34,280
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2036
And then with this
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2037
pattern matching,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2038
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2039
444
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2040
00:22:34,280 --> 00:22:37,040
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2041
we just go through
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2042
all these six cases
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2043
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2044
445
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2045
00:22:37,040 --> 00:22:38,900
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2046
are serious defined as false.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2047
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2048
446
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2049
00:22:38,900 --> 00:22:43,234
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2050
One is defined as true
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2051
character for any character,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2052
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2053
447
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2054
00:22:43,234 --> 00:22:45,455
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2055
this null return false.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2056
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2057
448
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2058
00:22:45,455 --> 00:22:47,540
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2059
The alternative is to find here,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2060
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2061
449
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2062
00:22:47,540 --> 00:22:50,000
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2063
so that's the or in Scala.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2064
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2065
450
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2066
00:22:50,000 --> 00:22:52,700
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2067
And for the sequence,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2068
that's the end.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2069
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2070
451
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2071
00:22:52,700 --> 00:22:56,180
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2072
And this star, no matter
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2073
what the reg expression is,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2074
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2075
452
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2076
00:22:56,180 --> 00:22:59,540
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2077
it will always match the
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2078
empty string, so true.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2079
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2080
453
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2081
00:22:59,540 --> 00:23:02,225
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2082
So nanobots, very easy.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2083
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2084
454
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2085
00:23:02,225 --> 00:23:07,430
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2086
The derivative is also not
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2087
so much more complicated.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2088
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2089
455
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2090
00:23:07,430 --> 00:23:08,974
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2091
It takes two arguments,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2092
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2093
456
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2094
00:23:08,974 --> 00:23:11,810
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2095
a character and the
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2096
rec expression,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2097
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2098
457
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2099
00:23:11,810 --> 00:23:14,405
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2100
and returns a wreck expression.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2101
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2102
458
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2103
00:23:14,405 --> 00:23:16,340
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2104
So now we just have to analyze
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2105
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2106
459
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2107
00:23:16,340 --> 00:23:18,890
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2108
what's that reg
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2109
expression looks like.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2110
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2111
460
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2112
00:23:18,890 --> 00:23:23,870
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2113
If it's 0, we return
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2114
01, we return 0.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2115
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2116
461
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2117
00:23:23,870 --> 00:23:26,990
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2118
If the character is the
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2119
wreck expressions character
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2120
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2121
462
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2122
00:23:26,990 --> 00:23:30,260
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2123
d. We test whether it's
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2124
equal to this character.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2125
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2126
463
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2127
00:23:30,260 --> 00:23:32,225
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2128
We want to take the
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2129
derivative off.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2130
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2131
464
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2132
00:23:32,225 --> 00:23:36,185
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2133
If yes, return one, otherwise 0.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2134
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2135
465
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2136
00:23:36,185 --> 00:23:38,600
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2137
The alternative which has pushed
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2138
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2139
466
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2140
00:23:38,600 --> 00:23:39,860
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2141
the derivative under
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2142
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2143
467
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2144
00:23:39,860 --> 00:23:42,710
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2145
this alternative,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2146
that's the easy one.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2147
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2148
468
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2149
00:23:42,710 --> 00:23:44,690
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2150
Here's the sequence case where we
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2151
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2152
469
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2153
00:23:44,690 --> 00:23:47,015
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2154
first have to test
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2155
if it's nullable,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2156
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2157
470
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2158
00:23:47,015 --> 00:23:49,040
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2159
If it's not the have to push
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2160
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2161
471
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2162
00:23:49,040 --> 00:23:52,160
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2163
the derivative over
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2164
the first DR1.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2165
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2166
472
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2167
00:23:52,160 --> 00:23:56,135
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2168
And otherwise if it is null
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2169
above we have two cases.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2170
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2171
473
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2172
00:23:56,135 --> 00:24:00,605
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2173
Either you have to push
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2174
it over the R1 or R2.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2175
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2176
474
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2177
00:24:00,605 --> 00:24:03,860
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2178
And a star case, this one.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2179
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2180
475
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2181
00:24:03,860 --> 00:24:07,160
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2182
We just build the sequence
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2183
of the derivative of
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2184
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2185
476
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2186
00:24:07,160 --> 00:24:11,600
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2187
R1 and append the
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2188
or as a sequence,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2189
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2190
477
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2191
00:24:11,600 --> 00:24:14,195
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2192
put the star at the end.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2193
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2194
478
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2195
00:24:14,195 --> 00:24:19,430
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2196
Okay, so here's this
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2197
function for strings.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2198
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2199
479
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2200
00:24:19,430 --> 00:24:21,740
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2201
So a list of characters.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2202
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2203
480
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2204
00:24:21,740 --> 00:24:23,870
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2205
This function takes N,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2206
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2207
481
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2208
00:24:23,870 --> 00:24:26,480
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2209
S list of characters argument
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2210
and a reg expression
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2211
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2212
482
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2213
00:24:26,480 --> 00:24:29,360
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2214
as argument and returns
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2215
a wreck expression.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2216
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2217
483
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2218
00:24:29,360 --> 00:24:31,460
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2219
And we just have to
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2220
pattern match what
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2221
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2222
484
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2223
00:24:31,460 --> 00:24:34,055
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2224
that string looks like
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2225
or this list looks like.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2226
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2227
485
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2228
00:24:34,055 --> 00:24:35,360
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2229
If it's the empty list,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2230
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2231
486
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2232
00:24:35,360 --> 00:24:38,030
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2233
it just immediately
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2234
return the R. If
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2235
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2236
487
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2237
00:24:38,030 --> 00:24:42,020
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2238
it's something of the
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2239
form C followed by S,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2240
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2241
488
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2242
00:24:42,020 --> 00:24:45,050
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2243
then we build first the
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2244
derivative according
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2245
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2246
489
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2247
00:24:45,050 --> 00:24:48,345
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2248
to a C. And then
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2249
the result of that,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2250
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2251
490
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2252
00:24:48,345 --> 00:24:50,090
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2253
people recursively call
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2254
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2255
491
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2256
00:24:50,090 --> 00:24:53,675
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2257
the derivative
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2258
according to s. Okay?
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2259
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2260
492
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2261
00:24:53,675 --> 00:24:56,060
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2262
And now the main mantra,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2263
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2264
493
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2265
00:24:56,060 --> 00:24:59,360
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2266
it takes a reg
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2267
expression and takes
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2268
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2269
494
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2270
00:24:59,360 --> 00:25:02,870
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2271
a string and returns a
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2272
boolean, true or false.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2273
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2274
495
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2275
00:25:02,870 --> 00:25:05,705
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2276
And it first builds
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2277
the derivative.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2278
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2279
496
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2280
00:25:05,705 --> 00:25:07,430
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2281
The only thing I have to do here
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2282
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2283
497
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2284
00:25:07,430 --> 00:25:09,410
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2285
because I'm implementing
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2286
it and scholar,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2287
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2288
498
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2289
00:25:09,410 --> 00:25:15,064
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2290
I have to coerce between strings
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2291
and lists of characters.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2292
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2293
499
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2294
00:25:15,064 --> 00:25:16,580
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2295
So he, I take first
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2296
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2297
500
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2298
00:25:16,580 --> 00:25:20,810
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2299
the two list of the S that
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2300
gives me a list of characters.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2301
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2302
501
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2303
00:25:20,810 --> 00:25:23,135
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2304
Then I build this derivative
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2305
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2306
502
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2307
00:25:23,135 --> 00:25:26,045
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2308
is ds because I'm
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2309
looking at strings.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2310
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2311
503
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2312
00:25:26,045 --> 00:25:28,160
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2313
And then at the end,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2314
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2315
504
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2316
00:25:28,160 --> 00:25:33,050
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2317
built-in nullable of
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2318
the final derivative.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2319
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2320
505
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2321
00:25:33,050 --> 00:25:37,310
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2322
The beauty of all this
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2323
is that in Scala,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2324
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2325
506
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2326
00:25:37,310 --> 00:25:40,085
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2327
these definition which
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2328
I had on the slides
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2329
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2330
507
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2331
00:25:40,085 --> 00:25:43,835
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2332
go almost one-to-one into code.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2333
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2334
508
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2335
00:25:43,835 --> 00:25:45,605
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2336
And that's of course,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2337
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2338
509
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2339
00:25:45,605 --> 00:25:47,480
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2340
makes it very easy
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2341
to implement in
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2342
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2343
510
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2344
00:25:47,480 --> 00:25:49,730
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2345
a functional language like Scala.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2346
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2347
511
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2348
00:25:49,730 --> 00:25:52,865
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2349
We can also now try
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2350
out some examples.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2351
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2352
512
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2353
00:25:52,865 --> 00:25:56,960
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2354
This was the example
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2355
I had on the slide.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2356
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2357
513
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2358
00:25:56,960 --> 00:25:58,370
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2359
And we could now calculate
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2360
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2361
514
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2362
00:25:58,370 --> 00:26:00,305
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2363
what's the derivative
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2364
according to a,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2365
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2366
515
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2367
00:26:00,305 --> 00:26:02,720
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2368
B, and C of this
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2369
record expression.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2370
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2371
516
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2372
00:26:02,720 --> 00:26:07,040
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2373
And I hope you didn't
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2374
make any mistake.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2375
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2376
517
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2377
00:26:07,040 --> 00:26:09,260
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2378
Now of course we want
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2379
to see whether B
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2380
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2381
518
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2382
00:26:09,260 --> 00:26:11,390
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2383
do any better with
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2384
this algorithm.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2385
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2386
519
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2387
00:26:11,390 --> 00:26:13,715
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2388
Then Python and Ruby.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2389
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2390
520
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2391
00:26:13,715 --> 00:26:16,070
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2392
And let's first have a
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2393
look at this example.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2394
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2395
521
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2396
00:26:16,070 --> 00:26:18,079
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2397
So this reg expression.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2398
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2399
522
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2400
00:26:18,079 --> 00:26:19,880
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2401
The problem is that in
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2402
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2403
523
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2404
00:26:19,880 --> 00:26:22,070
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2405
our reg expression
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2406
metro so far we have
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2407
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2408
524
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2409
00:26:22,070 --> 00:26:24,530
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2410
the sequence right
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2411
expression where we
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2412
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2413
525
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2414
00:26:24,530 --> 00:26:27,200
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2415
don't have this optional
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2416
wreck expression.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2417
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2418
526
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2419
00:26:27,200 --> 00:26:30,800
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2420
And we don't have this n
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2421
times Rekha expression,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2422
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2423
527
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2424
00:26:30,800 --> 00:26:36,605
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2425
but we can quickly implement
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2426
that in our implementation.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2427
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2428
528
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2429
00:26:36,605 --> 00:26:40,549
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2430
So if you want to build the
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2431
optional reg expression,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2432
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2433
529
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2434
00:26:40,549 --> 00:26:41,870
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2435
which is defined here,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2436
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2437
530
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2438
00:26:41,870 --> 00:26:44,570
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2439
a little function which
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2440
takes a reg expression and
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2441
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2442
531
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2443
00:26:44,570 --> 00:26:47,360
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2444
returns the alternative of R one.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2445
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2446
532
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2447
00:26:47,360 --> 00:26:49,624
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2448
So it essentially
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2449
takes the definition
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2450
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2451
533
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2452
00:26:49,624 --> 00:26:53,240
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2453
of optional R and
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2454
replaces it by that.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2455
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2456
534
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2457
00:26:53,240 --> 00:26:56,150
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2458
The end times what we
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2459
essentially do it,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2460
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2461
535
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2462
00:26:56,150 --> 00:27:01,535
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2463
There's beaches built n
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2464
copies of this r. Ok?
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2465
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2466
536
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2467
00:27:01,535 --> 00:27:04,745
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2468
So if this n times was 0,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2469
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2470
537
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2471
00:27:04,745 --> 00:27:06,245
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2472
we just return one.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2473
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2474
538
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2475
00:27:06,245 --> 00:27:11,570
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2476
If it's one, then we return
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2477
just the reg expression.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2478
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2479
539
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2480
00:27:11,570 --> 00:27:15,575
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2481
And if it's a, something
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2482
bigger than one,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2483
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2484
540
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2485
00:27:15,575 --> 00:27:18,560
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2486
then we just built the
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2487
sequence of one of
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2488
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2489
541
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2490
00:27:18,560 --> 00:27:20,270
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2491
these copies and call
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2492
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2493
542
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2494
00:27:20,270 --> 00:27:22,925
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2495
this function again
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2496
with n minus one.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2497
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2498
543
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2499
00:27:22,925 --> 00:27:26,330
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2500
So we just now n copies of that.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2501
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2502
544
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2503
00:27:26,330 --> 00:27:30,710
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2504
Okay? Okay, so we can look
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2505
at our first example.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2506
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2507
545
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2508
00:27:30,710 --> 00:27:32,629
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2509
This is the work expression,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2510
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2511
546
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2512
00:27:32,629 --> 00:27:36,035
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2513
and I call that here
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2514
even rec expression1.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2515
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2516
547
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2517
00:27:36,035 --> 00:27:37,670
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2518
It doesn't look as beautiful
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2519
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2520
548
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2521
00:27:37,670 --> 00:27:39,140
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2522
as what we write down on paper.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2523
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2524
549
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2525
00:27:39,140 --> 00:27:41,240
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2526
We will actually look
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2527
at this later on
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2528
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2529
550
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2530
00:27:41,240 --> 00:27:43,640
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2531
if this can be improved.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2532
But here it is.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2533
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2534
551
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2535
00:27:43,640 --> 00:27:45,724
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2536
Here's the reg expression,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2537
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2538
552
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2539
00:27:45,724 --> 00:27:49,520
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2540
and here's a little function
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2541
which measures the time.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2542
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2543
553
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2544
00:27:49,520 --> 00:27:53,180
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2545
And we can now start testing
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2546
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2547
554
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2548
00:27:53,180 --> 00:27:57,845
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2549
this reg expression with
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2550
strings of just containing A's.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2551
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2552
555
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2553
00:27:57,845 --> 00:28:00,020
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2554
And we first a bit cautious,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2555
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2556
556
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2557
00:28:00,020 --> 00:28:04,985
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2558
be tested between 020
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2559
and be count by two.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2560
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2561
557
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2562
00:28:04,985 --> 00:28:08,330
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2563
And I actually will not
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2564
start that with Scala,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2565
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2566
558
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2567
00:28:08,330 --> 00:28:12,965
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2568
but actually the orbital online.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2569
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2570
559
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2571
00:28:12,965 --> 00:28:15,305
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2572
And that's out.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2573
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2574
560
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2575
00:28:15,305 --> 00:28:17,269
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2576
And that correlates.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2577
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2578
561
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2579
00:28:17,269 --> 00:28:20,675
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2580
So for 18 days it's pretty fast.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2581
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2582
562
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2583
00:28:20,675 --> 00:28:24,815
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2584
But for 20 it already
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2585
needs to seconds.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2586
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2587
563
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2588
00:28:24,815 --> 00:28:28,265
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2589
And you can see
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2590
actually this jump from
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2591
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2592
564
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2593
00:28:28,265 --> 00:28:32,825
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2594
18 to 20 in the runtime
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2595
is prepared to.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2596
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2597
565
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2598
00:28:32,825 --> 00:28:37,460
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2599
And if we actually measure
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2600
it more accurately,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2601
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2602
566
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2603
00:28:37,460 --> 00:28:39,770
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2604
then we get this picture.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2605
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2606
567
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2607
00:28:39,770 --> 00:28:41,255
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2608
And what turns out,
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2609
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2610
568
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2611
00:28:41,255 --> 00:28:45,830
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2612
we actually inverse as Python
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2613
and Ruby in this example.
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2614
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2615
569
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2616
00:28:45,830 --> 00:28:49,230
e8402d8ec8e6 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
  2617
So I guess that's a fail.