videos/02-cw1.srt
author Christian Urban <christian.urban@kcl.ac.uk>
Fri, 18 Oct 2024 05:45:14 +0100
changeset 969 0dfa2923a7c6
parent 774 42733adf2a48
permissions -rw-r--r--
updated
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
774
42733adf2a48 updated
update
parents:
diff changeset
     1
1
42733adf2a48 updated
update
parents:
diff changeset
     2
00:00:06,410 --> 00:00:09,390
42733adf2a48 updated
update
parents:
diff changeset
     3
The final video for this week.
42733adf2a48 updated
update
parents:
diff changeset
     4
42733adf2a48 updated
update
parents:
diff changeset
     5
2
42733adf2a48 updated
update
parents:
diff changeset
     6
00:00:09,390 --> 00:00:12,465
42733adf2a48 updated
update
parents:
diff changeset
     7
And let me say something
42733adf2a48 updated
update
parents:
diff changeset
     8
about the coursework.
42733adf2a48 updated
update
parents:
diff changeset
     9
42733adf2a48 updated
update
parents:
diff changeset
    10
3
42733adf2a48 updated
update
parents:
diff changeset
    11
00:00:12,465 --> 00:00:15,300
42733adf2a48 updated
update
parents:
diff changeset
    12
First. You can solve
42733adf2a48 updated
update
parents:
diff changeset
    13
42733adf2a48 updated
update
parents:
diff changeset
    14
4
42733adf2a48 updated
update
parents:
diff changeset
    15
00:00:15,300 --> 00:00:17,745
42733adf2a48 updated
update
parents:
diff changeset
    16
the coursework in any programming
42733adf2a48 updated
update
parents:
diff changeset
    17
language you're like,
42733adf2a48 updated
update
parents:
diff changeset
    18
42733adf2a48 updated
update
parents:
diff changeset
    19
5
42733adf2a48 updated
update
parents:
diff changeset
    20
00:00:17,745 --> 00:00:22,440
42733adf2a48 updated
update
parents:
diff changeset
    21
I already said that. You
42733adf2a48 updated
update
parents:
diff changeset
    22
have to submit a PDF file.
42733adf2a48 updated
update
parents:
diff changeset
    23
42733adf2a48 updated
update
parents:
diff changeset
    24
6
42733adf2a48 updated
update
parents:
diff changeset
    25
00:00:22,440 --> 00:00:23,850
42733adf2a48 updated
update
parents:
diff changeset
    26
There will be some questions,
42733adf2a48 updated
update
parents:
diff changeset
    27
42733adf2a48 updated
update
parents:
diff changeset
    28
7
42733adf2a48 updated
update
parents:
diff changeset
    29
00:00:23,850 --> 00:00:26,250
42733adf2a48 updated
update
parents:
diff changeset
    30
so you have to write down the
42733adf2a48 updated
update
parents:
diff changeset
    31
solution to this questions.
42733adf2a48 updated
update
parents:
diff changeset
    32
42733adf2a48 updated
update
parents:
diff changeset
    33
8
42733adf2a48 updated
update
parents:
diff changeset
    34
00:00:26,250 --> 00:00:30,315
42733adf2a48 updated
update
parents:
diff changeset
    35
Please use a PDF and you have
42733adf2a48 updated
update
parents:
diff changeset
    36
to submit your source code.
42733adf2a48 updated
update
parents:
diff changeset
    37
42733adf2a48 updated
update
parents:
diff changeset
    38
9
42733adf2a48 updated
update
parents:
diff changeset
    39
00:00:30,315 --> 00:00:35,580
42733adf2a48 updated
update
parents:
diff changeset
    40
And yes, if you do use a
42733adf2a48 updated
update
parents:
diff changeset
    41
language which isn't Scala,
42733adf2a48 updated
update
parents:
diff changeset
    42
42733adf2a48 updated
update
parents:
diff changeset
    43
10
42733adf2a48 updated
update
parents:
diff changeset
    44
00:00:35,580 --> 00:00:39,450
42733adf2a48 updated
update
parents:
diff changeset
    45
it might help to tell me
42733adf2a48 updated
update
parents:
diff changeset
    46
how I can run your code.
42733adf2a48 updated
update
parents:
diff changeset
    47
42733adf2a48 updated
update
parents:
diff changeset
    48
11
42733adf2a48 updated
update
parents:
diff changeset
    49
00:00:39,450 --> 00:00:42,550
42733adf2a48 updated
update
parents:
diff changeset
    50
If I can't run your code,
42733adf2a48 updated
update
parents:
diff changeset
    51
I will ask you anyway.
42733adf2a48 updated
update
parents:
diff changeset
    52
42733adf2a48 updated
update
parents:
diff changeset
    53
12
42733adf2a48 updated
update
parents:
diff changeset
    54
00:00:42,550 --> 00:00:50,044
42733adf2a48 updated
update
parents:
diff changeset
    55
Also, please submit both the
42733adf2a48 updated
update
parents:
diff changeset
    56
PDF and the code in a file,
42733adf2a48 updated
update
parents:
diff changeset
    57
42733adf2a48 updated
update
parents:
diff changeset
    58
13
42733adf2a48 updated
update
parents:
diff changeset
    59
00:00:50,044 --> 00:00:52,730
42733adf2a48 updated
update
parents:
diff changeset
    60
in a zip file, which generates
42733adf2a48 updated
update
parents:
diff changeset
    61
42733adf2a48 updated
update
parents:
diff changeset
    62
14
42733adf2a48 updated
update
parents:
diff changeset
    63
00:00:52,730 --> 00:00:55,835
42733adf2a48 updated
update
parents:
diff changeset
    64
a subdirectory with your
42733adf2a48 updated
update
parents:
diff changeset
    65
name and your family name.
42733adf2a48 updated
update
parents:
diff changeset
    66
42733adf2a48 updated
update
parents:
diff changeset
    67
15
42733adf2a48 updated
update
parents:
diff changeset
    68
00:00:55,835 --> 00:00:58,970
42733adf2a48 updated
update
parents:
diff changeset
    69
That we'll just save a
42733adf2a48 updated
update
parents:
diff changeset
    70
lot of time for me to try
42733adf2a48 updated
update
parents:
diff changeset
    71
42733adf2a48 updated
update
parents:
diff changeset
    72
16
42733adf2a48 updated
update
parents:
diff changeset
    73
00:00:58,970 --> 00:01:02,030
42733adf2a48 updated
update
parents:
diff changeset
    74
to figure out who
42733adf2a48 updated
update
parents:
diff changeset
    75
has submitted what.
42733adf2a48 updated
update
parents:
diff changeset
    76
42733adf2a48 updated
update
parents:
diff changeset
    77
17
42733adf2a48 updated
update
parents:
diff changeset
    78
00:01:02,030 --> 00:01:04,445
42733adf2a48 updated
update
parents:
diff changeset
    79
Please do that.
42733adf2a48 updated
update
parents:
diff changeset
    80
42733adf2a48 updated
update
parents:
diff changeset
    81
18
42733adf2a48 updated
update
parents:
diff changeset
    82
00:01:04,445 --> 00:01:07,789
42733adf2a48 updated
update
parents:
diff changeset
    83
So what is the task
42733adf2a48 updated
update
parents:
diff changeset
    84
into coursework?
42733adf2a48 updated
update
parents:
diff changeset
    85
42733adf2a48 updated
update
parents:
diff changeset
    86
19
42733adf2a48 updated
update
parents:
diff changeset
    87
00:01:07,789 --> 00:01:09,885
42733adf2a48 updated
update
parents:
diff changeset
    88
I essentially showed you how
42733adf2a48 updated
update
parents:
diff changeset
    89
42733adf2a48 updated
update
parents:
diff changeset
    90
20
42733adf2a48 updated
update
parents:
diff changeset
    91
00:01:09,885 --> 00:01:11,995
42733adf2a48 updated
update
parents:
diff changeset
    92
the Brzozowski matcher
42733adf2a48 updated
update
parents:
diff changeset
    93
42733adf2a48 updated
update
parents:
diff changeset
    94
21
42733adf2a48 updated
update
parents:
diff changeset
    95
00:01:11,995 --> 00:01:14,645
42733adf2a48 updated
update
parents:
diff changeset
    96
works for the basic
42733adf2a48 updated
update
parents:
diff changeset
    97
regular expressions.
42733adf2a48 updated
update
parents:
diff changeset
    98
42733adf2a48 updated
update
parents:
diff changeset
    99
22
42733adf2a48 updated
update
parents:
diff changeset
   100
00:01:14,645 --> 00:01:16,295
42733adf2a48 updated
update
parents:
diff changeset
   101
I also showed you actually how it
42733adf2a48 updated
update
parents:
diff changeset
   102
42733adf2a48 updated
update
parents:
diff changeset
   103
23
42733adf2a48 updated
update
parents:
diff changeset
   104
00:01:16,295 --> 00:01:18,110
42733adf2a48 updated
update
parents:
diff changeset
   105
works for the n-times.
42733adf2a48 updated
update
parents:
diff changeset
   106
42733adf2a48 updated
update
parents:
diff changeset
   107
24
42733adf2a48 updated
update
parents:
diff changeset
   108
00:01:18,110 --> 00:01:20,300
42733adf2a48 updated
update
parents:
diff changeset
   109
And the task in coursework
42733adf2a48 updated
update
parents:
diff changeset
   110
42733adf2a48 updated
update
parents:
diff changeset
   111
25
42733adf2a48 updated
update
parents:
diff changeset
   112
00:01:20,300 --> 00:01:22,970
42733adf2a48 updated
update
parents:
diff changeset
   113
is that you extend the
42733adf2a48 updated
update
parents:
diff changeset
   114
Brzozowski matcher to
42733adf2a48 updated
update
parents:
diff changeset
   115
42733adf2a48 updated
update
parents:
diff changeset
   116
26
42733adf2a48 updated
update
parents:
diff changeset
   117
00:01:22,970 --> 00:01:25,820
42733adf2a48 updated
update
parents:
diff changeset
   118
the other regular expressions
42733adf2a48 updated
update
parents:
diff changeset
   119
42733adf2a48 updated
update
parents:
diff changeset
   120
27
42733adf2a48 updated
update
parents:
diff changeset
   121
00:01:25,820 --> 00:01:27,800
42733adf2a48 updated
update
parents:
diff changeset
   122
from the extended
42733adf2a48 updated
update
parents:
diff changeset
   123
regular expressions.
42733adf2a48 updated
update
parents:
diff changeset
   124
42733adf2a48 updated
update
parents:
diff changeset
   125
28
42733adf2a48 updated
update
parents:
diff changeset
   126
00:01:27,800 --> 00:01:30,245
42733adf2a48 updated
update
parents:
diff changeset
   127
So you're supposed
42733adf2a48 updated
update
parents:
diff changeset
   128
to extended with
42733adf2a48 updated
update
parents:
diff changeset
   129
42733adf2a48 updated
update
parents:
diff changeset
   130
29
42733adf2a48 updated
update
parents:
diff changeset
   131
00:01:30,245 --> 00:01:34,490
42733adf2a48 updated
update
parents:
diff changeset
   132
r-plus, optional r, for n-times.
42733adf2a48 updated
update
parents:
diff changeset
   133
42733adf2a48 updated
update
parents:
diff changeset
   134
30
42733adf2a48 updated
update
parents:
diff changeset
   135
00:01:34,490 --> 00:01:38,420
42733adf2a48 updated
update
parents:
diff changeset
   136
You've already seen that.
42733adf2a48 updated
update
parents:
diff changeset
   137
For 0 or more times,
42733adf2a48 updated
update
parents:
diff changeset
   138
42733adf2a48 updated
update
parents:
diff changeset
   139
31
42733adf2a48 updated
update
parents:
diff changeset
   140
00:01:38,420 --> 00:01:41,120
42733adf2a48 updated
update
parents:
diff changeset
   141
but not more than m
42733adf2a48 updated
update
parents:
diff changeset
   142
times regular expression.
42733adf2a48 updated
update
parents:
diff changeset
   143
42733adf2a48 updated
update
parents:
diff changeset
   144
32
42733adf2a48 updated
update
parents:
diff changeset
   145
00:01:41,120 --> 00:01:45,890
42733adf2a48 updated
update
parents:
diff changeset
   146
For at least n-times regular
42733adf2a48 updated
update
parents:
diff changeset
   147
expression and for between
42733adf2a48 updated
update
parents:
diff changeset
   148
42733adf2a48 updated
update
parents:
diff changeset
   149
33
42733adf2a48 updated
update
parents:
diff changeset
   150
00:01:45,890 --> 00:01:47,480
42733adf2a48 updated
update
parents:
diff changeset
   151
n times and m times
42733adf2a48 updated
update
parents:
diff changeset
   152
42733adf2a48 updated
update
parents:
diff changeset
   153
34
42733adf2a48 updated
update
parents:
diff changeset
   154
00:01:47,480 --> 00:01:50,810
42733adf2a48 updated
update
parents:
diff changeset
   155
regular expression and also this
42733adf2a48 updated
update
parents:
diff changeset
   156
NOT regular expression.
42733adf2a48 updated
update
parents:
diff changeset
   157
42733adf2a48 updated
update
parents:
diff changeset
   158
35
42733adf2a48 updated
update
parents:
diff changeset
   159
00:01:50,810 --> 00:01:52,790
42733adf2a48 updated
update
parents:
diff changeset
   160
So your task is to
42733adf2a48 updated
update
parents:
diff changeset
   161
42733adf2a48 updated
update
parents:
diff changeset
   162
36
42733adf2a48 updated
update
parents:
diff changeset
   163
00:01:52,790 --> 00:01:55,310
42733adf2a48 updated
update
parents:
diff changeset
   164
essentially find the definition
42733adf2a48 updated
update
parents:
diff changeset
   165
42733adf2a48 updated
update
parents:
diff changeset
   166
37
42733adf2a48 updated
update
parents:
diff changeset
   167
00:01:55,310 --> 00:01:57,155
42733adf2a48 updated
update
parents:
diff changeset
   168
for nullable in these cases.
42733adf2a48 updated
update
parents:
diff changeset
   169
42733adf2a48 updated
update
parents:
diff changeset
   170
38
42733adf2a48 updated
update
parents:
diff changeset
   171
00:01:57,155 --> 00:02:00,215
42733adf2a48 updated
update
parents:
diff changeset
   172
Find a definition for derivative,
42733adf2a48 updated
update
parents:
diff changeset
   173
42733adf2a48 updated
update
parents:
diff changeset
   174
39
42733adf2a48 updated
update
parents:
diff changeset
   175
00:02:00,215 --> 00:02:02,480
42733adf2a48 updated
update
parents:
diff changeset
   176
implement them,
42733adf2a48 updated
update
parents:
diff changeset
   177
write them down in
42733adf2a48 updated
update
parents:
diff changeset
   178
42733adf2a48 updated
update
parents:
diff changeset
   179
40
42733adf2a48 updated
update
parents:
diff changeset
   180
00:02:02,480 --> 00:02:06,065
42733adf2a48 updated
update
parents:
diff changeset
   181
a PDF and then do some
42733adf2a48 updated
update
parents:
diff changeset
   182
experiments with them.
42733adf2a48 updated
update
parents:
diff changeset
   183
42733adf2a48 updated
update
parents:
diff changeset
   184
41
42733adf2a48 updated
update
parents:
diff changeset
   185
00:02:06,065 --> 00:02:08,875
42733adf2a48 updated
update
parents:
diff changeset
   186
Well, how can you do that?
42733adf2a48 updated
update
parents:
diff changeset
   187
42733adf2a48 updated
update
parents:
diff changeset
   188
42
42733adf2a48 updated
update
parents:
diff changeset
   189
00:02:08,875 --> 00:02:10,370
42733adf2a48 updated
update
parents:
diff changeset
   190
Well I've given you
42733adf2a48 updated
update
parents:
diff changeset
   191
42733adf2a48 updated
update
parents:
diff changeset
   192
43
42733adf2a48 updated
update
parents:
diff changeset
   193
00:02:10,370 --> 00:02:13,565
42733adf2a48 updated
update
parents:
diff changeset
   194
the meaning of these additional
42733adf2a48 updated
update
parents:
diff changeset
   195
regular expressions.
42733adf2a48 updated
update
parents:
diff changeset
   196
42733adf2a48 updated
update
parents:
diff changeset
   197
44
42733adf2a48 updated
update
parents:
diff changeset
   198
00:02:13,565 --> 00:02:16,730
42733adf2a48 updated
update
parents:
diff changeset
   199
So here's, for example, the
42733adf2a48 updated
update
parents:
diff changeset
   200
meaning of this r-plus.
42733adf2a48 updated
update
parents:
diff changeset
   201
42733adf2a48 updated
update
parents:
diff changeset
   202
45
42733adf2a48 updated
update
parents:
diff changeset
   203
00:02:16,730 --> 00:02:18,290
42733adf2a48 updated
update
parents:
diff changeset
   204
So that would be, I have
42733adf2a48 updated
update
parents:
diff changeset
   205
42733adf2a48 updated
update
parents:
diff changeset
   206
46
42733adf2a48 updated
update
parents:
diff changeset
   207
00:02:18,290 --> 00:02:22,115
42733adf2a48 updated
update
parents:
diff changeset
   208
at least one copy up to infinity.
42733adf2a48 updated
update
parents:
diff changeset
   209
42733adf2a48 updated
update
parents:
diff changeset
   210
47
42733adf2a48 updated
update
parents:
diff changeset
   211
00:02:22,115 --> 00:02:25,070
42733adf2a48 updated
update
parents:
diff changeset
   212
And the optional-r would be it's
42733adf2a48 updated
update
parents:
diff changeset
   213
42733adf2a48 updated
update
parents:
diff changeset
   214
48
42733adf2a48 updated
update
parents:
diff changeset
   215
00:02:25,070 --> 00:02:28,370
42733adf2a48 updated
update
parents:
diff changeset
   216
the language of r plus
42733adf2a48 updated
update
parents:
diff changeset
   217
the empty string.
42733adf2a48 updated
update
parents:
diff changeset
   218
42733adf2a48 updated
update
parents:
diff changeset
   219
49
42733adf2a48 updated
update
parents:
diff changeset
   220
00:02:28,370 --> 00:02:30,440
42733adf2a48 updated
update
parents:
diff changeset
   221
If I have it exactly n times,
42733adf2a48 updated
update
parents:
diff changeset
   222
42733adf2a48 updated
update
parents:
diff changeset
   223
50
42733adf2a48 updated
update
parents:
diff changeset
   224
00:02:30,440 --> 00:02:31,985
42733adf2a48 updated
update
parents:
diff changeset
   225
then it would be
42733adf2a48 updated
update
parents:
diff changeset
   226
just the language
42733adf2a48 updated
update
parents:
diff changeset
   227
42733adf2a48 updated
update
parents:
diff changeset
   228
51
42733adf2a48 updated
update
parents:
diff changeset
   229
00:02:31,985 --> 00:02:34,010
42733adf2a48 updated
update
parents:
diff changeset
   230
of r exactly n-times.
42733adf2a48 updated
update
parents:
diff changeset
   231
42733adf2a48 updated
update
parents:
diff changeset
   232
52
42733adf2a48 updated
update
parents:
diff changeset
   233
00:02:34,010 --> 00:02:38,105
42733adf2a48 updated
update
parents:
diff changeset
   234
And here you have union
42733adf2a48 updated
update
parents:
diff changeset
   235
from 0 to m and so on.
42733adf2a48 updated
update
parents:
diff changeset
   236
42733adf2a48 updated
update
parents:
diff changeset
   237
53
42733adf2a48 updated
update
parents:
diff changeset
   238
00:02:38,105 --> 00:02:42,560
42733adf2a48 updated
update
parents:
diff changeset
   239
This might be a slightly
42733adf2a48 updated
update
parents:
diff changeset
   240
interesting regular expression.
42733adf2a48 updated
update
parents:
diff changeset
   241
42733adf2a48 updated
update
parents:
diff changeset
   242
54
42733adf2a48 updated
update
parents:
diff changeset
   243
00:02:42,560 --> 00:02:46,580
42733adf2a48 updated
update
parents:
diff changeset
   244
So that's supposed to be the
42733adf2a48 updated
update
parents:
diff changeset
   245
character set that is very
42733adf2a48 updated
update
parents:
diff changeset
   246
42733adf2a48 updated
update
parents:
diff changeset
   247
55
42733adf2a48 updated
update
parents:
diff changeset
   248
00:02:46,580 --> 00:02:48,410
42733adf2a48 updated
update
parents:
diff changeset
   249
similar to character ranges like
42733adf2a48 updated
update
parents:
diff changeset
   250
42733adf2a48 updated
update
parents:
diff changeset
   251
56
42733adf2a48 updated
update
parents:
diff changeset
   252
00:02:48,410 --> 00:02:51,005
42733adf2a48 updated
update
parents:
diff changeset
   253
in the existing regular
42733adf2a48 updated
update
parents:
diff changeset
   254
expression matchers.
42733adf2a48 updated
update
parents:
diff changeset
   255
42733adf2a48 updated
update
parents:
diff changeset
   256
57
42733adf2a48 updated
update
parents:
diff changeset
   257
00:02:51,005 --> 00:02:52,820
42733adf2a48 updated
update
parents:
diff changeset
   258
So this just says
42733adf2a48 updated
update
parents:
diff changeset
   259
42733adf2a48 updated
update
parents:
diff changeset
   260
58
42733adf2a48 updated
update
parents:
diff changeset
   261
00:02:52,820 --> 00:02:55,565
42733adf2a48 updated
update
parents:
diff changeset
   262
...this regular
42733adf2a48 updated
update
parents:
diff changeset
   263
expression can match
42733adf2a48 updated
update
parents:
diff changeset
   264
42733adf2a48 updated
update
parents:
diff changeset
   265
59
42733adf2a48 updated
update
parents:
diff changeset
   266
00:02:55,565 --> 00:03:00,860
42733adf2a48 updated
update
parents:
diff changeset
   267
either the character c1 or
42733adf2a48 updated
update
parents:
diff changeset
   268
the character c2 up to cn.
42733adf2a48 updated
update
parents:
diff changeset
   269
42733adf2a48 updated
update
parents:
diff changeset
   270
60
42733adf2a48 updated
update
parents:
diff changeset
   271
00:03:00,860 --> 00:03:03,620
42733adf2a48 updated
update
parents:
diff changeset
   272
Why do I include
42733adf2a48 updated
update
parents:
diff changeset
   273
that regular expression?
42733adf2a48 updated
update
parents:
diff changeset
   274
42733adf2a48 updated
update
parents:
diff changeset
   275
61
42733adf2a48 updated
update
parents:
diff changeset
   276
00:03:03,620 --> 00:03:09,050
42733adf2a48 updated
update
parents:
diff changeset
   277
I could also just say
42733adf2a48 updated
update
parents:
diff changeset
   278
c1 plus c2 plus c3...
42733adf2a48 updated
update
parents:
diff changeset
   279
42733adf2a48 updated
update
parents:
diff changeset
   280
62
42733adf2a48 updated
update
parents:
diff changeset
   281
00:03:09,050 --> 00:03:12,889
42733adf2a48 updated
update
parents:
diff changeset
   282
a big alternative.
42733adf2a48 updated
update
parents:
diff changeset
   283
Well that's possible.
42733adf2a48 updated
update
parents:
diff changeset
   284
42733adf2a48 updated
update
parents:
diff changeset
   285
63
42733adf2a48 updated
update
parents:
diff changeset
   286
00:03:12,889 --> 00:03:16,595
42733adf2a48 updated
update
parents:
diff changeset
   287
But remember the Achilles'
42733adf2a48 updated
update
parents:
diff changeset
   288
heel of this algorithm is,
42733adf2a48 updated
update
parents:
diff changeset
   289
42733adf2a48 updated
update
parents:
diff changeset
   290
64
42733adf2a48 updated
update
parents:
diff changeset
   291
00:03:16,595 --> 00:03:18,425
42733adf2a48 updated
update
parents:
diff changeset
   292
if the regular expression is large,
42733adf2a48 updated
update
parents:
diff changeset
   293
42733adf2a48 updated
update
parents:
diff changeset
   294
65
42733adf2a48 updated
update
parents:
diff changeset
   295
00:03:18,425 --> 00:03:20,825
42733adf2a48 updated
update
parents:
diff changeset
   296
then the computation
42733adf2a48 updated
update
parents:
diff changeset
   297
take always a long time.
42733adf2a48 updated
update
parents:
diff changeset
   298
42733adf2a48 updated
update
parents:
diff changeset
   299
66
42733adf2a48 updated
update
parents:
diff changeset
   300
00:03:20,825 --> 00:03:23,840
42733adf2a48 updated
update
parents:
diff changeset
   301
So I'm trying to compress
42733adf2a48 updated
update
parents:
diff changeset
   302
that as much as I can.
42733adf2a48 updated
update
parents:
diff changeset
   303
42733adf2a48 updated
update
parents:
diff changeset
   304
67
42733adf2a48 updated
update
parents:
diff changeset
   305
00:03:23,840 --> 00:03:25,370
42733adf2a48 updated
update
parents:
diff changeset
   306
So instead of giving a big
42733adf2a48 updated
update
parents:
diff changeset
   307
42733adf2a48 updated
update
parents:
diff changeset
   308
68
42733adf2a48 updated
update
parents:
diff changeset
   309
00:03:25,370 --> 00:03:29,134
42733adf2a48 updated
update
parents:
diff changeset
   310
alternative, I am trying to
42733adf2a48 updated
update
parents:
diff changeset
   311
give one regular expression,
42733adf2a48 updated
update
parents:
diff changeset
   312
42733adf2a48 updated
update
parents:
diff changeset
   313
69
42733adf2a48 updated
update
parents:
diff changeset
   314
00:03:29,134 --> 00:03:31,340
42733adf2a48 updated
update
parents:
diff changeset
   315
which can not just match
42733adf2a48 updated
update
parents:
diff changeset
   316
a single character,
42733adf2a48 updated
update
parents:
diff changeset
   317
42733adf2a48 updated
update
parents:
diff changeset
   318
70
42733adf2a48 updated
update
parents:
diff changeset
   319
00:03:31,340 --> 00:03:34,230
42733adf2a48 updated
update
parents:
diff changeset
   320
but a set of characters.
42733adf2a48 updated
update
parents:
diff changeset
   321
42733adf2a48 updated
update
parents:
diff changeset
   322
71
42733adf2a48 updated
update
parents:
diff changeset
   323
00:03:34,630 --> 00:03:36,980
42733adf2a48 updated
update
parents:
diff changeset
   324
How can you be sure that
42733adf2a48 updated
update
parents:
diff changeset
   325
42733adf2a48 updated
update
parents:
diff changeset
   326
72
42733adf2a48 updated
update
parents:
diff changeset
   327
00:03:36,980 --> 00:03:39,215
42733adf2a48 updated
update
parents:
diff changeset
   328
definition you come
42733adf2a48 updated
update
parents:
diff changeset
   329
up with are correct?
42733adf2a48 updated
update
parents:
diff changeset
   330
42733adf2a48 updated
update
parents:
diff changeset
   331
73
42733adf2a48 updated
update
parents:
diff changeset
   332
00:03:39,215 --> 00:03:41,450
42733adf2a48 updated
update
parents:
diff changeset
   333
Well, I showed you which are
42733adf2a48 updated
update
parents:
diff changeset
   334
42733adf2a48 updated
update
parents:
diff changeset
   335
74
42733adf2a48 updated
update
parents:
diff changeset
   336
00:03:41,450 --> 00:03:45,170
42733adf2a48 updated
update
parents:
diff changeset
   337
the properties these two
42733adf2a48 updated
update
parents:
diff changeset
   338
functions need to satisfy.
42733adf2a48 updated
update
parents:
diff changeset
   339
42733adf2a48 updated
update
parents:
diff changeset
   340
75
42733adf2a48 updated
update
parents:
diff changeset
   341
00:03:45,170 --> 00:03:47,060
42733adf2a48 updated
update
parents:
diff changeset
   342
I've given you here what
42733adf2a48 updated
update
parents:
diff changeset
   343
42733adf2a48 updated
update
parents:
diff changeset
   344
76
42733adf2a48 updated
update
parents:
diff changeset
   345
00:03:47,060 --> 00:03:49,325
42733adf2a48 updated
update
parents:
diff changeset
   346
the meaning of these
42733adf2a48 updated
update
parents:
diff changeset
   347
expressions are.
42733adf2a48 updated
update
parents:
diff changeset
   348
42733adf2a48 updated
update
parents:
diff changeset
   349
77
42733adf2a48 updated
update
parents:
diff changeset
   350
00:03:49,325 --> 00:03:52,700
42733adf2a48 updated
update
parents:
diff changeset
   351
So you will always know what's
42733adf2a48 updated
update
parents:
diff changeset
   352
on the right-hand side.
42733adf2a48 updated
update
parents:
diff changeset
   353
42733adf2a48 updated
update
parents:
diff changeset
   354
78
42733adf2a48 updated
update
parents:
diff changeset
   355
00:03:52,700 --> 00:03:54,515
42733adf2a48 updated
update
parents:
diff changeset
   356
This is completely determined.
42733adf2a48 updated
update
parents:
diff changeset
   357
42733adf2a48 updated
update
parents:
diff changeset
   358
79
42733adf2a48 updated
update
parents:
diff changeset
   359
00:03:54,515 --> 00:03:56,720
42733adf2a48 updated
update
parents:
diff changeset
   360
You essentially
42733adf2a48 updated
update
parents:
diff changeset
   361
have to fill something
42733adf2a48 updated
update
parents:
diff changeset
   362
42733adf2a48 updated
update
parents:
diff changeset
   363
80
42733adf2a48 updated
update
parents:
diff changeset
   364
00:03:56,720 --> 00:03:58,910
42733adf2a48 updated
update
parents:
diff changeset
   365
equivalent on the left-hand side.
42733adf2a48 updated
update
parents:
diff changeset
   366
42733adf2a48 updated
update
parents:
diff changeset
   367
81
42733adf2a48 updated
update
parents:
diff changeset
   368
00:03:58,910 --> 00:04:02,105
42733adf2a48 updated
update
parents:
diff changeset
   369
That's the main task
42733adf2a48 updated
update
parents:
diff changeset
   370
of the coursework.
42733adf2a48 updated
update
parents:
diff changeset
   371
42733adf2a48 updated
update
parents:
diff changeset
   372
82
42733adf2a48 updated
update
parents:
diff changeset
   373
00:04:02,105 --> 00:04:08,090
42733adf2a48 updated
update
parents:
diff changeset
   374
And you can start from the
42733adf2a48 updated
update
parents:
diff changeset
   375
files I provided on KEATS.
42733adf2a48 updated
update
parents:
diff changeset
   376
42733adf2a48 updated
update
parents:
diff changeset
   377
83
42733adf2a48 updated
update
parents:
diff changeset
   378
00:04:08,090 --> 00:04:12,125
42733adf2a48 updated
update
parents:
diff changeset
   379
So you would just have to
42733adf2a48 updated
update
parents:
diff changeset
   380
add these additional cases.
42733adf2a48 updated
update
parents:
diff changeset
   381
42733adf2a48 updated
update
parents:
diff changeset
   382
84
42733adf2a48 updated
update
parents:
diff changeset
   383
00:04:12,125 --> 00:04:15,020
42733adf2a48 updated
update
parents:
diff changeset
   384
When you add these
42733adf2a48 updated
update
parents:
diff changeset
   385
additional cases
42733adf2a48 updated
update
parents:
diff changeset
   386
42733adf2a48 updated
update
parents:
diff changeset
   387
85
42733adf2a48 updated
update
parents:
diff changeset
   388
00:04:15,020 --> 00:04:17,330
42733adf2a48 updated
update
parents:
diff changeset
   389
and you're using the Scala language,
42733adf2a48 updated
update
parents:
diff changeset
   390
42733adf2a48 updated
update
parents:
diff changeset
   391
86
42733adf2a48 updated
update
parents:
diff changeset
   392
00:04:17,330 --> 00:04:18,980
42733adf2a48 updated
update
parents:
diff changeset
   393
you can do me a favour.
42733adf2a48 updated
update
parents:
diff changeset
   394
42733adf2a48 updated
update
parents:
diff changeset
   395
87
42733adf2a48 updated
update
parents:
diff changeset
   396
00:04:18,980 --> 00:04:22,550
42733adf2a48 updated
update
parents:
diff changeset
   397
You can call these
42733adf2a48 updated
update
parents:
diff changeset
   398
constructors for
42733adf2a48 updated
update
parents:
diff changeset
   399
42733adf2a48 updated
update
parents:
diff changeset
   400
88
42733adf2a48 updated
update
parents:
diff changeset
   401
00:04:22,550 --> 00:04:25,400
42733adf2a48 updated
update
parents:
diff changeset
   402
these different regular
42733adf2a48 updated
update
parents:
diff changeset
   403
expressions as RANGE,
42733adf2a48 updated
update
parents:
diff changeset
   404
42733adf2a48 updated
update
parents:
diff changeset
   405
89
42733adf2a48 updated
update
parents:
diff changeset
   406
00:04:25,400 --> 00:04:28,985
42733adf2a48 updated
update
parents:
diff changeset
   407
PLUS, OPTIONAL and NTIMES,
42733adf2a48 updated
update
parents:
diff changeset
   408
UPTO, FROM and BETWEEN.
42733adf2a48 updated
update
parents:
diff changeset
   409
42733adf2a48 updated
update
parents:
diff changeset
   410
90
42733adf2a48 updated
update
parents:
diff changeset
   411
00:04:28,985 --> 00:04:31,370
42733adf2a48 updated
update
parents:
diff changeset
   412
Remember I have this
42733adf2a48 updated
update
parents:
diff changeset
   413
convention to always
42733adf2a48 updated
update
parents:
diff changeset
   414
42733adf2a48 updated
update
parents:
diff changeset
   415
91
42733adf2a48 updated
update
parents:
diff changeset
   416
00:04:31,370 --> 00:04:34,025
42733adf2a48 updated
update
parents:
diff changeset
   417
use capital letters
42733adf2a48 updated
update
parents:
diff changeset
   418
for regular expressions.
42733adf2a48 updated
update
parents:
diff changeset
   419
42733adf2a48 updated
update
parents:
diff changeset
   420
92
42733adf2a48 updated
update
parents:
diff changeset
   421
00:04:34,025 --> 00:04:36,680
42733adf2a48 updated
update
parents:
diff changeset
   422
It would be nice if you could use
42733adf2a48 updated
update
parents:
diff changeset
   423
42733adf2a48 updated
update
parents:
diff changeset
   424
93
42733adf2a48 updated
update
parents:
diff changeset
   425
00:04:36,680 --> 00:04:39,260
42733adf2a48 updated
update
parents:
diff changeset
   426
these names because
42733adf2a48 updated
update
parents:
diff changeset
   427
then it will be
42733adf2a48 updated
update
parents:
diff changeset
   428
42733adf2a48 updated
update
parents:
diff changeset
   429
94
42733adf2a48 updated
update
parents:
diff changeset
   430
00:04:39,260 --> 00:04:42,335
42733adf2a48 updated
update
parents:
diff changeset
   431
very easy for me
42733adf2a48 updated
update
parents:
diff changeset
   432
to test your code.
42733adf2a48 updated
update
parents:
diff changeset
   433
42733adf2a48 updated
update
parents:
diff changeset
   434
95
42733adf2a48 updated
update
parents:
diff changeset
   435
00:04:42,335 --> 00:04:44,690
42733adf2a48 updated
update
parents:
diff changeset
   436
If you're using a different
42733adf2a48 updated
update
parents:
diff changeset
   437
programming language
42733adf2a48 updated
update
parents:
diff changeset
   438
42733adf2a48 updated
update
parents:
diff changeset
   439
96
42733adf2a48 updated
update
parents:
diff changeset
   440
00:04:44,690 --> 00:04:46,370
42733adf2a48 updated
update
parents:
diff changeset
   441
like let's say Rust,
42733adf2a48 updated
update
parents:
diff changeset
   442
42733adf2a48 updated
update
parents:
diff changeset
   443
97
42733adf2a48 updated
update
parents:
diff changeset
   444
00:04:46,370 --> 00:04:48,860
42733adf2a48 updated
update
parents:
diff changeset
   445
I expect some people will use that, where I
42733adf2a48 updated
update
parents:
diff changeset
   446
42733adf2a48 updated
update
parents:
diff changeset
   447
98
42733adf2a48 updated
update
parents:
diff changeset
   448
00:04:48,860 --> 00:04:51,380
42733adf2a48 updated
update
parents:
diff changeset
   449
have no idea what are the
42733adf2a48 updated
update
parents:
diff changeset
   450
conventions in your language,
42733adf2a48 updated
update
parents:
diff changeset
   451
42733adf2a48 updated
update
parents:
diff changeset
   452
99
42733adf2a48 updated
update
parents:
diff changeset
   453
00:04:51,380 --> 00:04:53,420
42733adf2a48 updated
update
parents:
diff changeset
   454
how you have to call
42733adf2a48 updated
update
parents:
diff changeset
   455
these constructors,
42733adf2a48 updated
update
parents:
diff changeset
   456
42733adf2a48 updated
update
parents:
diff changeset
   457
100
42733adf2a48 updated
update
parents:
diff changeset
   458
00:04:53,420 --> 00:04:56,420
42733adf2a48 updated
update
parents:
diff changeset
   459
we will see whatever you
42733adf2a48 updated
update
parents:
diff changeset
   460
submit. I'll have a look.
42733adf2a48 updated
update
parents:
diff changeset
   461
42733adf2a48 updated
update
parents:
diff changeset
   462
101
42733adf2a48 updated
update
parents:
diff changeset
   463
00:04:56,420 --> 00:04:59,360
42733adf2a48 updated
update
parents:
diff changeset
   464
There's one more
42733adf2a48 updated
update
parents:
diff changeset
   465
constraint I have to
42733adf2a48 updated
update
parents:
diff changeset
   466
42733adf2a48 updated
update
parents:
diff changeset
   467
102
42733adf2a48 updated
update
parents:
diff changeset
   468
00:04:59,360 --> 00:05:02,194
42733adf2a48 updated
update
parents:
diff changeset
   469
impose to make this
42733adf2a48 updated
update
parents:
diff changeset
   470
coursework interesting.
42733adf2a48 updated
update
parents:
diff changeset
   471
42733adf2a48 updated
update
parents:
diff changeset
   472
103
42733adf2a48 updated
update
parents:
diff changeset
   473
00:05:02,194 --> 00:05:04,730
42733adf2a48 updated
update
parents:
diff changeset
   474
I do not want you 
42733adf2a48 updated
update
parents:
diff changeset
   475
that you just take
42733adf2a48 updated
update
parents:
diff changeset
   476
42733adf2a48 updated
update
parents:
diff changeset
   477
104
42733adf2a48 updated
update
parents:
diff changeset
   478
00:05:04,730 --> 00:05:07,370
42733adf2a48 updated
update
parents:
diff changeset
   479
these extended regular
42733adf2a48 updated
update
parents:
diff changeset
   480
expressions and that you
42733adf2a48 updated
update
parents:
diff changeset
   481
42733adf2a48 updated
update
parents:
diff changeset
   482
105
42733adf2a48 updated
update
parents:
diff changeset
   483
00:05:07,370 --> 00:05:10,550
42733adf2a48 updated
update
parents:
diff changeset
   484
expand them using
42733adf2a48 updated
update
parents:
diff changeset
   485
their definition.
42733adf2a48 updated
update
parents:
diff changeset
   486
42733adf2a48 updated
update
parents:
diff changeset
   487
106
42733adf2a48 updated
update
parents:
diff changeset
   488
00:05:10,550 --> 00:05:12,320
42733adf2a48 updated
update
parents:
diff changeset
   489
Because that would make the regular
42733adf2a48 updated
update
parents:
diff changeset
   490
42733adf2a48 updated
update
parents:
diff changeset
   491
107
42733adf2a48 updated
update
parents:
diff changeset
   492
00:05:12,320 --> 00:05:13,955
42733adf2a48 updated
update
parents:
diff changeset
   493
expression matcher very slow.
42733adf2a48 updated
update
parents:
diff changeset
   494
42733adf2a48 updated
update
parents:
diff changeset
   495
108
42733adf2a48 updated
update
parents:
diff changeset
   496
00:05:13,955 --> 00:05:16,160
42733adf2a48 updated
update
parents:
diff changeset
   497
So for example, if
42733adf2a48 updated
update
parents:
diff changeset
   498
you want to define
42733adf2a48 updated
update
parents:
diff changeset
   499
42733adf2a48 updated
update
parents:
diff changeset
   500
109
42733adf2a48 updated
update
parents:
diff changeset
   501
00:05:16,160 --> 00:05:18,785
42733adf2a48 updated
update
parents:
diff changeset
   502
what's the derivative for r-plus,
42733adf2a48 updated
update
parents:
diff changeset
   503
42733adf2a48 updated
update
parents:
diff changeset
   504
110
42733adf2a48 updated
update
parents:
diff changeset
   505
00:05:18,785 --> 00:05:21,560
42733adf2a48 updated
update
parents:
diff changeset
   506
then what does not
42733adf2a48 updated
update
parents:
diff changeset
   507
count as a solution:
42733adf2a48 updated
update
parents:
diff changeset
   508
42733adf2a48 updated
update
parents:
diff changeset
   509
111
42733adf2a48 updated
update
parents:
diff changeset
   510
00:05:21,560 --> 00:05:24,770
42733adf2a48 updated
update
parents:
diff changeset
   511
if you just expand that
42733adf2a48 updated
update
parents:
diff changeset
   512
to the definition that r
42733adf2a48 updated
update
parents:
diff changeset
   513
42733adf2a48 updated
update
parents:
diff changeset
   514
112
42733adf2a48 updated
update
parents:
diff changeset
   515
00:05:24,770 --> 00:05:28,935
42733adf2a48 updated
update
parents:
diff changeset
   516
plus is equivalent to
42733adf2a48 updated
update
parents:
diff changeset
   517
r followed by r-star.
42733adf2a48 updated
update
parents:
diff changeset
   518
42733adf2a48 updated
update
parents:
diff changeset
   519
113
42733adf2a48 updated
update
parents:
diff changeset
   520
00:05:28,935 --> 00:05:32,845
42733adf2a48 updated
update
parents:
diff changeset
   521
So in code, what I
42733adf2a48 updated
update
parents:
diff changeset
   522
would like to not see,
42733adf2a48 updated
update
parents:
diff changeset
   523
42733adf2a48 updated
update
parents:
diff changeset
   524
114
42733adf2a48 updated
update
parents:
diff changeset
   525
00:05:32,845 --> 00:05:35,680
42733adf2a48 updated
update
parents:
diff changeset
   526
I would not give any
42733adf2a48 updated
update
parents:
diff changeset
   527
marks for that is,
42733adf2a48 updated
update
parents:
diff changeset
   528
42733adf2a48 updated
update
parents:
diff changeset
   529
115
42733adf2a48 updated
update
parents:
diff changeset
   530
00:05:35,680 --> 00:05:37,780
42733adf2a48 updated
update
parents:
diff changeset
   531
if you add the plus as follows,
42733adf2a48 updated
update
parents:
diff changeset
   532
42733adf2a48 updated
update
parents:
diff changeset
   533
116
42733adf2a48 updated
update
parents:
diff changeset
   534
00:05:37,780 --> 00:05:39,910
42733adf2a48 updated
update
parents:
diff changeset
   535
so that is still perfectly fine.
42733adf2a48 updated
update
parents:
diff changeset
   536
42733adf2a48 updated
update
parents:
diff changeset
   537
117
42733adf2a48 updated
update
parents:
diff changeset
   538
00:05:39,910 --> 00:05:42,160
42733adf2a48 updated
update
parents:
diff changeset
   539
There's nothing you
42733adf2a48 updated
update
parents:
diff changeset
   540
can do differently.
42733adf2a48 updated
update
parents:
diff changeset
   541
42733adf2a48 updated
update
parents:
diff changeset
   542
118
42733adf2a48 updated
update
parents:
diff changeset
   543
00:05:42,160 --> 00:05:44,065
42733adf2a48 updated
update
parents:
diff changeset
   544
That would be the constructor.
42733adf2a48 updated
update
parents:
diff changeset
   545
42733adf2a48 updated
update
parents:
diff changeset
   546
119
42733adf2a48 updated
update
parents:
diff changeset
   547
00:05:44,065 --> 00:05:46,480
42733adf2a48 updated
update
parents:
diff changeset
   548
But when you define nullable,
42733adf2a48 updated
update
parents:
diff changeset
   549
42733adf2a48 updated
update
parents:
diff changeset
   550
120
42733adf2a48 updated
update
parents:
diff changeset
   551
00:05:46,480 --> 00:05:49,180
42733adf2a48 updated
update
parents:
diff changeset
   552
I do not want to see
42733adf2a48 updated
update
parents:
diff changeset
   553
that you defined
42733adf2a48 updated
update
parents:
diff changeset
   554
42733adf2a48 updated
update
parents:
diff changeset
   555
121
42733adf2a48 updated
update
parents:
diff changeset
   556
00:05:49,180 --> 00:05:51,790
42733adf2a48 updated
update
parents:
diff changeset
   557
this plus r as nullable
42733adf2a48 updated
update
parents:
diff changeset
   558
42733adf2a48 updated
update
parents:
diff changeset
   559
122
42733adf2a48 updated
update
parents:
diff changeset
   560
00:05:51,790 --> 00:05:54,385
42733adf2a48 updated
update
parents:
diff changeset
   561
of the sequence of r and star-r,
42733adf2a48 updated
update
parents:
diff changeset
   562
42733adf2a48 updated
update
parents:
diff changeset
   563
123
42733adf2a48 updated
update
parents:
diff changeset
   564
00:05:54,385 --> 00:05:58,075
42733adf2a48 updated
update
parents:
diff changeset
   565
just unfolding
42733adf2a48 updated
update
parents:
diff changeset
   566
the definition.
42733adf2a48 updated
update
parents:
diff changeset
   567
42733adf2a48 updated
update
parents:
diff changeset
   568
124
42733adf2a48 updated
update
parents:
diff changeset
   569
00:05:58,075 --> 00:06:00,415
42733adf2a48 updated
update
parents:
diff changeset
   570
As you can see, when you come
42733adf2a48 updated
update
parents:
diff changeset
   571
42733adf2a48 updated
update
parents:
diff changeset
   572
125
42733adf2a48 updated
update
parents:
diff changeset
   573
00:06:00,415 --> 00:06:02,815
42733adf2a48 updated
update
parents:
diff changeset
   574
up with a much better
42733adf2a48 updated
update
parents:
diff changeset
   575
solution for that.
42733adf2a48 updated
update
parents:
diff changeset
   576
42733adf2a48 updated
update
parents:
diff changeset
   577
126
42733adf2a48 updated
update
parents:
diff changeset
   578
00:06:02,815 --> 00:06:05,110
42733adf2a48 updated
update
parents:
diff changeset
   579
This is a very inefficient way
42733adf2a48 updated
update
parents:
diff changeset
   580
42733adf2a48 updated
update
parents:
diff changeset
   581
127
42733adf2a48 updated
update
parents:
diff changeset
   582
00:06:05,110 --> 00:06:07,090
42733adf2a48 updated
update
parents:
diff changeset
   583
for how to calculate nullable.
42733adf2a48 updated
update
parents:
diff changeset
   584
42733adf2a48 updated
update
parents:
diff changeset
   585
128
42733adf2a48 updated
update
parents:
diff changeset
   586
00:06:07,090 --> 00:06:10,825
42733adf2a48 updated
update
parents:
diff changeset
   587
And so the same for derivative
42733adf2a48 updated
update
parents:
diff changeset
   588
would not be allowed.
42733adf2a48 updated
update
parents:
diff changeset
   589
42733adf2a48 updated
update
parents:
diff changeset
   590
129
42733adf2a48 updated
update
parents:
diff changeset
   591
00:06:10,825 --> 00:06:13,895
42733adf2a48 updated
update
parents:
diff changeset
   592
If you, I have the plus r here,
42733adf2a48 updated
update
parents:
diff changeset
   593
42733adf2a48 updated
update
parents:
diff changeset
   594
130
42733adf2a48 updated
update
parents:
diff changeset
   595
00:06:13,895 --> 00:06:16,685
42733adf2a48 updated
update
parents:
diff changeset
   596
you can't just unfold
42733adf2a48 updated
update
parents:
diff changeset
   597
the definition,
42733adf2a48 updated
update
parents:
diff changeset
   598
42733adf2a48 updated
update
parents:
diff changeset
   599
131
42733adf2a48 updated
update
parents:
diff changeset
   600
00:06:16,685 --> 00:06:19,790
42733adf2a48 updated
update
parents:
diff changeset
   601
with r-plus
42733adf2a48 updated
update
parents:
diff changeset
   602
being defined as r
42733adf2a48 updated
update
parents:
diff changeset
   603
42733adf2a48 updated
update
parents:
diff changeset
   604
132
42733adf2a48 updated
update
parents:
diff changeset
   605
00:06:19,790 --> 00:06:21,350
42733adf2a48 updated
update
parents:
diff changeset
   606
followed by r star and
42733adf2a48 updated
update
parents:
diff changeset
   607
42733adf2a48 updated
update
parents:
diff changeset
   608
133
42733adf2a48 updated
update
parents:
diff changeset
   609
00:06:21,350 --> 00:06:23,375
42733adf2a48 updated
update
parents:
diff changeset
   610
then just build the
42733adf2a48 updated
update
parents:
diff changeset
   611
derivative of that.
42733adf2a48 updated
update
parents:
diff changeset
   612
42733adf2a48 updated
update
parents:
diff changeset
   613
134
42733adf2a48 updated
update
parents:
diff changeset
   614
00:06:23,375 --> 00:06:25,280
42733adf2a48 updated
update
parents:
diff changeset
   615
You have to find something more
42733adf2a48 updated
update
parents:
diff changeset
   616
42733adf2a48 updated
update
parents:
diff changeset
   617
135
42733adf2a48 updated
update
parents:
diff changeset
   618
00:06:25,280 --> 00:06:28,730
42733adf2a48 updated
update
parents:
diff changeset
   619
primitive that involves
42733adf2a48 updated
update
parents:
diff changeset
   620
only the derivative of r,
42733adf2a48 updated
update
parents:
diff changeset
   621
42733adf2a48 updated
update
parents:
diff changeset
   622
136
42733adf2a48 updated
update
parents:
diff changeset
   623
00:06:28,730 --> 00:06:31,790
42733adf2a48 updated
update
parents:
diff changeset
   624
essentially, nothing
42733adf2a48 updated
update
parents:
diff changeset
   625
more involved. The same
42733adf2a48 updated
update
parents:
diff changeset
   626
42733adf2a48 updated
update
parents:
diff changeset
   627
137
42733adf2a48 updated
update
parents:
diff changeset
   628
00:06:31,790 --> 00:06:33,815
42733adf2a48 updated
update
parents:
diff changeset
   629
if you have n-times, for example,
42733adf2a48 updated
update
parents:
diff changeset
   630
42733adf2a48 updated
update
parents:
diff changeset
   631
138
42733adf2a48 updated
update
parents:
diff changeset
   632
00:06:33,815 --> 00:06:39,935
42733adf2a48 updated
update
parents:
diff changeset
   633
you can't just unfold this
42733adf2a48 updated
update
parents:
diff changeset
   634
n-times in this sequence
42733adf2a48 updated
update
parents:
diff changeset
   635
42733adf2a48 updated
update
parents:
diff changeset
   636
139
42733adf2a48 updated
update
parents:
diff changeset
   637
00:06:39,935 --> 00:06:43,310
42733adf2a48 updated
update
parents:
diff changeset
   638
of .... n-copies
42733adf2a48 updated
update
parents:
diff changeset
   639
42733adf2a48 updated
update
parents:
diff changeset
   640
140
42733adf2a48 updated
update
parents:
diff changeset
   641
00:06:43,310 --> 00:06:47,285
42733adf2a48 updated
update
parents:
diff changeset
   642
of this r. You have to get
42733adf2a48 updated
update
parents:
diff changeset
   643
something more primitive.
42733adf2a48 updated
update
parents:
diff changeset
   644
42733adf2a48 updated
update
parents:
diff changeset
   645
141
42733adf2a48 updated
update
parents:
diff changeset
   646
00:06:47,285 --> 00:06:49,760
42733adf2a48 updated
update
parents:
diff changeset
   647
Otherwise, as you've
42733adf2a48 updated
update
parents:
diff changeset
   648
seen earlier,
42733adf2a48 updated
update
parents:
diff changeset
   649
42733adf2a48 updated
update
parents:
diff changeset
   650
142
42733adf2a48 updated
update
parents:
diff changeset
   651
00:06:49,760 --> 00:06:53,135
42733adf2a48 updated
update
parents:
diff changeset
   652
your regular expression matcher
42733adf2a48 updated
update
parents:
diff changeset
   653
would be totally slow.
42733adf2a48 updated
update
parents:
diff changeset
   654
42733adf2a48 updated
update
parents:
diff changeset
   655
143
42733adf2a48 updated
update
parents:
diff changeset
   656
00:06:53,135 --> 00:06:55,475
42733adf2a48 updated
update
parents:
diff changeset
   657
When you submit your solution,
42733adf2a48 updated
update
parents:
diff changeset
   658
42733adf2a48 updated
update
parents:
diff changeset
   659
144
42733adf2a48 updated
update
parents:
diff changeset
   660
00:06:55,475 --> 00:06:58,445
42733adf2a48 updated
update
parents:
diff changeset
   661
please submit this
42733adf2a48 updated
update
parents:
diff changeset
   662
solution in the PDF.
42733adf2a48 updated
update
parents:
diff changeset
   663
42733adf2a48 updated
update
parents:
diff changeset
   664
145
42733adf2a48 updated
update
parents:
diff changeset
   665
00:06:58,445 --> 00:07:01,580
42733adf2a48 updated
update
parents:
diff changeset
   666
So give the cases of your definition
42733adf2a48 updated
update
parents:
diff changeset
   667
42733adf2a48 updated
update
parents:
diff changeset
   668
146
42733adf2a48 updated
update
parents:
diff changeset
   669
00:07:01,580 --> 00:07:06,004
42733adf2a48 updated
update
parents:
diff changeset
   670
in a form like that for
42733adf2a48 updated
update
parents:
diff changeset
   671
nullable and derivative.
42733adf2a48 updated
update
parents:
diff changeset
   672
42733adf2a48 updated
update
parents:
diff changeset
   673
147
42733adf2a48 updated
update
parents:
diff changeset
   674
00:07:06,004 --> 00:07:08,405
42733adf2a48 updated
update
parents:
diff changeset
   675
And also implement it in code.
42733adf2a48 updated
update
parents:
diff changeset
   676
42733adf2a48 updated
update
parents:
diff changeset
   677
148
42733adf2a48 updated
update
parents:
diff changeset
   678
00:07:08,405 --> 00:07:10,910
42733adf2a48 updated
update
parents:
diff changeset
   679
That is just helping me to
42733adf2a48 updated
update
parents:
diff changeset
   680
42733adf2a48 updated
update
parents:
diff changeset
   681
149
42733adf2a48 updated
update
parents:
diff changeset
   682
00:07:10,910 --> 00:07:13,400
42733adf2a48 updated
update
parents:
diff changeset
   683
find out whether you have
42733adf2a48 updated
update
parents:
diff changeset
   684
the correct solution or not.
42733adf2a48 updated
update
parents:
diff changeset
   685
42733adf2a48 updated
update
parents:
diff changeset
   686
150
42733adf2a48 updated
update
parents:
diff changeset
   687
00:07:13,400 --> 00:07:15,710
42733adf2a48 updated
update
parents:
diff changeset
   688
So you needed a kind of
42733adf2a48 updated
update
parents:
diff changeset
   689
mathematical notation of
42733adf2a48 updated
update
parents:
diff changeset
   690
42733adf2a48 updated
update
parents:
diff changeset
   691
151
42733adf2a48 updated
update
parents:
diff changeset
   692
00:07:15,710 --> 00:07:18,695
42733adf2a48 updated
update
parents:
diff changeset
   693
your solution, and
42733adf2a48 updated
update
parents:
diff changeset
   694
an actual code.
42733adf2a48 updated
update
parents:
diff changeset
   695
42733adf2a48 updated
update
parents:
diff changeset
   696
152
42733adf2a48 updated
update
parents:
diff changeset
   697
00:07:18,695 --> 00:07:22,414
42733adf2a48 updated
update
parents:
diff changeset
   698
And then once you
42733adf2a48 updated
update
parents:
diff changeset
   699
have your definition,
42733adf2a48 updated
update
parents:
diff changeset
   700
42733adf2a48 updated
update
parents:
diff changeset
   701
153
42733adf2a48 updated
update
parents:
diff changeset
   702
00:07:22,414 --> 00:07:25,699
42733adf2a48 updated
update
parents:
diff changeset
   703
also make sure you try
42733adf2a48 updated
update
parents:
diff changeset
   704
it out on some examples.
42733adf2a48 updated
update
parents:
diff changeset
   705
42733adf2a48 updated
update
parents:
diff changeset
   706
154
42733adf2a48 updated
update
parents:
diff changeset
   707
00:07:25,699 --> 00:07:28,970
42733adf2a48 updated
update
parents:
diff changeset
   708
These will be the examples
42733adf2a48 updated
update
parents:
diff changeset
   709
I will definitely try out,
42733adf2a48 updated
update
parents:
diff changeset
   710
42733adf2a48 updated
update
parents:
diff changeset
   711
155
42733adf2a48 updated
update
parents:
diff changeset
   712
00:07:28,970 --> 00:07:30,560
42733adf2a48 updated
update
parents:
diff changeset
   713
but probably also more
42733adf2a48 updated
update
parents:
diff changeset
   714
42733adf2a48 updated
update
parents:
diff changeset
   715
156
42733adf2a48 updated
update
parents:
diff changeset
   716
00:07:30,560 --> 00:07:33,215
42733adf2a48 updated
update
parents:
diff changeset
   717
depending on what
42733adf2a48 updated
update
parents:
diff changeset
   718
definitions you give me.
42733adf2a48 updated
update
parents:
diff changeset
   719
42733adf2a48 updated
update
parents:
diff changeset
   720
157
42733adf2a48 updated
update
parents:
diff changeset
   721
00:07:33,215 --> 00:07:38,300
42733adf2a48 updated
update
parents:
diff changeset
   722
There's one more question I
42733adf2a48 updated
update
parents:
diff changeset
   723
ask you to do. You've seen
42733adf2a48 updated
update
parents:
diff changeset
   724
42733adf2a48 updated
update
parents:
diff changeset
   725
158
42733adf2a48 updated
update
parents:
diff changeset
   726
00:07:38,300 --> 00:07:40,130
42733adf2a48 updated
update
parents:
diff changeset
   727
there's some regular
42733adf2a48 updated
update
parents:
diff changeset
   728
expressions that
42733adf2a48 updated
update
parents:
diff changeset
   729
42733adf2a48 updated
update
parents:
diff changeset
   730
159
42733adf2a48 updated
update
parents:
diff changeset
   731
00:07:40,130 --> 00:07:42,215
42733adf2a48 updated
update
parents:
diff changeset
   732
are involved for characters,
42733adf2a48 updated
update
parents:
diff changeset
   733
42733adf2a48 updated
update
parents:
diff changeset
   734
160
42733adf2a48 updated
update
parents:
diff changeset
   735
00:07:42,215 --> 00:07:46,925
42733adf2a48 updated
update
parents:
diff changeset
   736
for character ranges or
42733adf2a48 updated
update
parents:
diff changeset
   737
character sets essentially.
42733adf2a48 updated
update
parents:
diff changeset
   738
42733adf2a48 updated
update
parents:
diff changeset
   739
161
42733adf2a48 updated
update
parents:
diff changeset
   740
00:07:46,925 --> 00:07:48,665
42733adf2a48 updated
update
parents:
diff changeset
   741
And sometimes I also want to have
42733adf2a48 updated
update
parents:
diff changeset
   742
42733adf2a48 updated
update
parents:
diff changeset
   743
162
42733adf2a48 updated
update
parents:
diff changeset
   744
00:07:48,665 --> 00:07:51,665
42733adf2a48 updated
update
parents:
diff changeset
   745
just a reg expression which
42733adf2a48 updated
update
parents:
diff changeset
   746
can match any character!!
42733adf2a48 updated
update
parents:
diff changeset
   747
42733adf2a48 updated
update
parents:
diff changeset
   748
163
42733adf2a48 updated
update
parents:
diff changeset
   749
00:07:51,665 --> 00:07:56,195
42733adf2a48 updated
update
parents:
diff changeset
   750
And I could have for all of
42733adf2a48 updated
update
parents:
diff changeset
   751
them separate definitions.
42733adf2a48 updated
update
parents:
diff changeset
   752
42733adf2a48 updated
update
parents:
diff changeset
   753
164
42733adf2a48 updated
update
parents:
diff changeset
   754
00:07:56,195 --> 00:07:57,710
42733adf2a48 updated
update
parents:
diff changeset
   755
And that would mean I also need
42733adf2a48 updated
update
parents:
diff changeset
   756
42733adf2a48 updated
update
parents:
diff changeset
   757
165
42733adf2a48 updated
update
parents:
diff changeset
   758
00:07:57,710 --> 00:07:59,645
42733adf2a48 updated
update
parents:
diff changeset
   759
separate definitions for nullable,
42733adf2a48 updated
update
parents:
diff changeset
   760
42733adf2a48 updated
update
parents:
diff changeset
   761
166
42733adf2a48 updated
update
parents:
diff changeset
   762
00:07:59,645 --> 00:08:02,405
42733adf2a48 updated
update
parents:
diff changeset
   763
separate definitions
42733adf2a48 updated
update
parents:
diff changeset
   764
for derivative.
42733adf2a48 updated
update
parents:
diff changeset
   765
42733adf2a48 updated
update
parents:
diff changeset
   766
167
42733adf2a48 updated
update
parents:
diff changeset
   767
00:08:02,405 --> 00:08:05,825
42733adf2a48 updated
update
parents:
diff changeset
   768
But actually they can be
42733adf2a48 updated
update
parents:
diff changeset
   769
generalized to just one constructor.
42733adf2a48 updated
update
parents:
diff changeset
   770
42733adf2a48 updated
update
parents:
diff changeset
   771
168
42733adf2a48 updated
update
parents:
diff changeset
   772
00:08:05,825 --> 00:08:08,210
42733adf2a48 updated
update
parents:
diff changeset
   773
And that is if we introduce
42733adf2a48 updated
update
parents:
diff changeset
   774
42733adf2a48 updated
update
parents:
diff changeset
   775
169
42733adf2a48 updated
update
parents:
diff changeset
   776
00:08:08,210 --> 00:08:11,630
42733adf2a48 updated
update
parents:
diff changeset
   777
a constructor for regular expressions,
42733adf2a48 updated
update
parents:
diff changeset
   778
42733adf2a48 updated
update
parents:
diff changeset
   779
170
42733adf2a48 updated
update
parents:
diff changeset
   780
00:08:11,630 --> 00:08:13,760
42733adf2a48 updated
update
parents:
diff changeset
   781
which not just takes
42733adf2a48 updated
update
parents:
diff changeset
   782
a single character
42733adf2a48 updated
update
parents:
diff changeset
   783
42733adf2a48 updated
update
parents:
diff changeset
   784
171
42733adf2a48 updated
update
parents:
diff changeset
   785
00:08:13,760 --> 00:08:15,469
42733adf2a48 updated
update
parents:
diff changeset
   786
or set of characters.
42733adf2a48 updated
update
parents:
diff changeset
   787
42733adf2a48 updated
update
parents:
diff changeset
   788
172
42733adf2a48 updated
update
parents:
diff changeset
   789
00:08:15,469 --> 00:08:18,245
42733adf2a48 updated
update
parents:
diff changeset
   790
But, which I call here CFUN.
42733adf2a48 updated
update
parents:
diff changeset
   791
42733adf2a48 updated
update
parents:
diff changeset
   792
173
42733adf2a48 updated
update
parents:
diff changeset
   793
00:08:18,245 --> 00:08:23,165
42733adf2a48 updated
update
parents:
diff changeset
   794
And it takes a function from
42733adf2a48 updated
update
parents:
diff changeset
   795
characters to booleans.
42733adf2a48 updated
update
parents:
diff changeset
   796
42733adf2a48 updated
update
parents:
diff changeset
   797
174
42733adf2a48 updated
update
parents:
diff changeset
   798
00:08:23,165 --> 00:08:24,470
42733adf2a48 updated
update
parents:
diff changeset
   799
So if I want to match
42733adf2a48 updated
update
parents:
diff changeset
   800
42733adf2a48 updated
update
parents:
diff changeset
   801
175
42733adf2a48 updated
update
parents:
diff changeset
   802
00:08:24,470 --> 00:08:26,900
42733adf2a48 updated
update
parents:
diff changeset
   803
just a single character
42733adf2a48 updated
update
parents:
diff changeset
   804
then this function f
42733adf2a48 updated
update
parents:
diff changeset
   805
42733adf2a48 updated
update
parents:
diff changeset
   806
176
42733adf2a48 updated
update
parents:
diff changeset
   807
00:08:26,900 --> 00:08:29,060
42733adf2a48 updated
update
parents:
diff changeset
   808
would only say true
42733adf2a48 updated
update
parents:
diff changeset
   809
42733adf2a48 updated
update
parents:
diff changeset
   810
177
42733adf2a48 updated
update
parents:
diff changeset
   811
00:08:29,060 --> 00:08:32,225
42733adf2a48 updated
update
parents:
diff changeset
   812
if it gets as argument
42733adf2a48 updated
update
parents:
diff changeset
   813
the single character.
42733adf2a48 updated
update
parents:
diff changeset
   814
42733adf2a48 updated
update
parents:
diff changeset
   815
178
42733adf2a48 updated
update
parents:
diff changeset
   816
00:08:32,225 --> 00:08:34,850
42733adf2a48 updated
update
parents:
diff changeset
   817
If I have a character set,
42733adf2a48 updated
update
parents:
diff changeset
   818
42733adf2a48 updated
update
parents:
diff changeset
   819
179
42733adf2a48 updated
update
parents:
diff changeset
   820
00:08:34,850 --> 00:08:36,515
42733adf2a48 updated
update
parents:
diff changeset
   821
then I would say, well,
42733adf2a48 updated
update
parents:
diff changeset
   822
42733adf2a48 updated
update
parents:
diff changeset
   823
180
42733adf2a48 updated
update
parents:
diff changeset
   824
00:08:36,515 --> 00:08:38,300
42733adf2a48 updated
update
parents:
diff changeset
   825
I need a function
42733adf2a48 updated
update
parents:
diff changeset
   826
which says true
42733adf2a48 updated
update
parents:
diff changeset
   827
42733adf2a48 updated
update
parents:
diff changeset
   828
181
42733adf2a48 updated
update
parents:
diff changeset
   829
00:08:38,300 --> 00:08:40,970
42733adf2a48 updated
update
parents:
diff changeset
   830
for all the characters
42733adf2a48 updated
update
parents:
diff changeset
   831
in this set.
42733adf2a48 updated
update
parents:
diff changeset
   832
42733adf2a48 updated
update
parents:
diff changeset
   833
182
42733adf2a48 updated
update
parents:
diff changeset
   834
00:08:40,970 --> 00:08:43,460
42733adf2a48 updated
update
parents:
diff changeset
   835
And otherwise it's false.
42733adf2a48 updated
update
parents:
diff changeset
   836
42733adf2a48 updated
update
parents:
diff changeset
   837
183
42733adf2a48 updated
update
parents:
diff changeset
   838
00:08:43,460 --> 00:08:46,205
42733adf2a48 updated
update
parents:
diff changeset
   839
And if I want to
42733adf2a48 updated
update
parents:
diff changeset
   840
match any character!!,
42733adf2a48 updated
update
parents:
diff changeset
   841
42733adf2a48 updated
update
parents:
diff changeset
   842
184
42733adf2a48 updated
update
parents:
diff changeset
   843
00:08:46,205 --> 00:08:48,500
42733adf2a48 updated
update
parents:
diff changeset
   844
then they should get a function
42733adf2a48 updated
update
parents:
diff changeset
   845
42733adf2a48 updated
update
parents:
diff changeset
   846
185
42733adf2a48 updated
update
parents:
diff changeset
   847
00:08:48,500 --> 00:08:53,450
42733adf2a48 updated
update
parents:
diff changeset
   848
which says true for
42733adf2a48 updated
update
parents:
diff changeset
   849
all characters.
42733adf2a48 updated
update
parents:
diff changeset
   850
42733adf2a48 updated
update
parents:
diff changeset
   851
186
42733adf2a48 updated
update
parents:
diff changeset
   852
00:08:53,450 --> 00:08:56,630
42733adf2a48 updated
update
parents:
diff changeset
   853
Okay? If I have
42733adf2a48 updated
update
parents:
diff changeset
   854
such a constructor
42733adf2a48 updated
update
parents:
diff changeset
   855
42733adf2a48 updated
update
parents:
diff changeset
   856
187
42733adf2a48 updated
update
parents:
diff changeset
   857
00:08:56,630 --> 00:09:00,140
42733adf2a48 updated
update
parents:
diff changeset
   858
that actually I can save
42733adf2a48 updated
update
parents:
diff changeset
   859
myself a bit of work.
42733adf2a48 updated
update
parents:
diff changeset
   860
42733adf2a48 updated
update
parents:
diff changeset
   861
188
42733adf2a48 updated
update
parents:
diff changeset
   862
00:09:00,140 --> 00:09:03,200
42733adf2a48 updated
update
parents:
diff changeset
   863
And I can just have one case
42733adf2a48 updated
update
parents:
diff changeset
   864
42733adf2a48 updated
update
parents:
diff changeset
   865
189
42733adf2a48 updated
update
parents:
diff changeset
   866
00:09:03,200 --> 00:09:06,920
42733adf2a48 updated
update
parents:
diff changeset
   867
for nullable and one
42733adf2a48 updated
update
parents:
diff changeset
   868
case for CFUNS.
42733adf2a48 updated
update
parents:
diff changeset
   869
42733adf2a48 updated
update
parents:
diff changeset
   870
190
42733adf2a48 updated
update
parents:
diff changeset
   871
00:09:06,920 --> 00:09:09,800
42733adf2a48 updated
update
parents:
diff changeset
   872
So that would then subsume
42733adf2a48 updated
update
parents:
diff changeset
   873
the character ranges and
42733adf2a48 updated
update
parents:
diff changeset
   874
42733adf2a48 updated
update
parents:
diff changeset
   875
191
42733adf2a48 updated
update
parents:
diff changeset
   876
00:09:09,800 --> 00:09:13,385
42733adf2a48 updated
update
parents:
diff changeset
   877
the character and also
42733adf2a48 updated
update
parents:
diff changeset
   878
this ALL regular expression.
42733adf2a48 updated
update
parents:
diff changeset
   879
42733adf2a48 updated
update
parents:
diff changeset
   880
192
42733adf2a48 updated
update
parents:
diff changeset
   881
00:09:13,385 --> 00:09:15,380
42733adf2a48 updated
update
parents:
diff changeset
   882
Ok, this was not explicitly
42733adf2a48 updated
update
parents:
diff changeset
   883
included at the beginning,
42733adf2a48 updated
update
parents:
diff changeset
   884
42733adf2a48 updated
update
parents:
diff changeset
   885
193
42733adf2a48 updated
update
parents:
diff changeset
   886
00:09:15,380 --> 00:09:17,510
42733adf2a48 updated
update
parents:
diff changeset
   887
but that's what I can now define.
42733adf2a48 updated
update
parents:
diff changeset
   888
42733adf2a48 updated
update
parents:
diff changeset
   889
194
42733adf2a48 updated
update
parents:
diff changeset
   890
00:09:17,510 --> 00:09:21,740
42733adf2a48 updated
update
parents:
diff changeset
   891
And then I can define
42733adf2a48 updated
update
parents:
diff changeset
   892
this for characters,
42733adf2a48 updated
update
parents:
diff changeset
   893
42733adf2a48 updated
update
parents:
diff changeset
   894
195
42733adf2a48 updated
update
parents:
diff changeset
   895
00:09:21,740 --> 00:09:23,885
42733adf2a48 updated
update
parents:
diff changeset
   896
just as special cases
42733adf2a48 updated
update
parents:
diff changeset
   897
for these functions.
42733adf2a48 updated
update
parents:
diff changeset
   898
42733adf2a48 updated
update
parents:
diff changeset
   899
196
42733adf2a48 updated
update
parents:
diff changeset
   900
00:09:23,885 --> 00:09:25,610
42733adf2a48 updated
update
parents:
diff changeset
   901
And I told you already
42733adf2a48 updated
update
parents:
diff changeset
   902
what this function
42733adf2a48 updated
update
parents:
diff changeset
   903
42733adf2a48 updated
update
parents:
diff changeset
   904
197
42733adf2a48 updated
update
parents:
diff changeset
   905
00:09:25,610 --> 00:09:28,025
42733adf2a48 updated
update
parents:
diff changeset
   906
should look like in
42733adf2a48 updated
update
parents:
diff changeset
   907
these three cases.
42733adf2a48 updated
update
parents:
diff changeset
   908
42733adf2a48 updated
update
parents:
diff changeset
   909
198
42733adf2a48 updated
update
parents:
diff changeset
   910
00:09:28,025 --> 00:09:30,350
42733adf2a48 updated
update
parents:
diff changeset
   911
So I let ...
42733adf2a48 updated
update
parents:
diff changeset
   912
42733adf2a48 updated
update
parents:
diff changeset
   913
199
42733adf2a48 updated
update
parents:
diff changeset
   914
00:09:30,350 --> 00:09:33,515
42733adf2a48 updated
update
parents:
diff changeset
   915
you decide how you're
42733adf2a48 updated
update
parents:
diff changeset
   916
going to implement that.
42733adf2a48 updated
update
parents:
diff changeset
   917
42733adf2a48 updated
update
parents:
diff changeset
   918
200
42733adf2a48 updated
update
parents:
diff changeset
   919
00:09:33,515 --> 00:09:35,450
42733adf2a48 updated
update
parents:
diff changeset
   920
If you first define
42733adf2a48 updated
update
parents:
diff changeset
   921
42733adf2a48 updated
update
parents:
diff changeset
   922
201
42733adf2a48 updated
update
parents:
diff changeset
   923
00:09:35,450 --> 00:09:38,495
42733adf2a48 updated
update
parents:
diff changeset
   924
your implementation is
42733adf2a48 updated
update
parents:
diff changeset
   925
all these explicit cases.
42733adf2a48 updated
update
parents:
diff changeset
   926
42733adf2a48 updated
update
parents:
diff changeset
   927
202
42733adf2a48 updated
update
parents:
diff changeset
   928
00:09:38,495 --> 00:09:41,900
42733adf2a48 updated
update
parents:
diff changeset
   929
Because in these cases it's
42733adf2a48 updated
update
parents:
diff changeset
   930
actually more intuitive,
42733adf2a48 updated
update
parents:
diff changeset
   931
42733adf2a48 updated
update
parents:
diff changeset
   932
203
42733adf2a48 updated
update
parents:
diff changeset
   933
00:09:41,900 --> 00:09:45,980
42733adf2a48 updated
update
parents:
diff changeset
   934
what nullable and
42733adf2a48 updated
update
parents:
diff changeset
   935
derivative should be.
42733adf2a48 updated
update
parents:
diff changeset
   936
42733adf2a48 updated
update
parents:
diff changeset
   937
204
42733adf2a48 updated
update
parents:
diff changeset
   938
00:09:45,980 --> 00:09:48,035
42733adf2a48 updated
update
parents:
diff changeset
   939
And then in a second step,
42733adf2a48 updated
update
parents:
diff changeset
   940
42733adf2a48 updated
update
parents:
diff changeset
   941
205
42733adf2a48 updated
update
parents:
diff changeset
   942
00:09:48,035 --> 00:09:51,140
42733adf2a48 updated
update
parents:
diff changeset
   943
you implement these
42733adf2a48 updated
update
parents:
diff changeset
   944
more general cases.
42733adf2a48 updated
update
parents:
diff changeset
   945
42733adf2a48 updated
update
parents:
diff changeset
   946
206
42733adf2a48 updated
update
parents:
diff changeset
   947
00:09:51,140 --> 00:09:53,360
42733adf2a48 updated
update
parents:
diff changeset
   948
And just keep the original ones
42733adf2a48 updated
update
parents:
diff changeset
   949
42733adf2a48 updated
update
parents:
diff changeset
   950
207
42733adf2a48 updated
update
parents:
diff changeset
   951
00:09:53,360 --> 00:09:54,500
42733adf2a48 updated
update
parents:
diff changeset
   952
in your implementation if you
42733adf2a48 updated
update
parents:
diff changeset
   953
42733adf2a48 updated
update
parents:
diff changeset
   954
208
42733adf2a48 updated
update
parents:
diff changeset
   955
00:09:54,500 --> 00:09:57,710
42733adf2a48 updated
update
parents:
diff changeset
   956
want, or if you feel
42733adf2a48 updated
update
parents:
diff changeset
   957
adventurous enough,
42733adf2a48 updated
update
parents:
diff changeset
   958
42733adf2a48 updated
update
parents:
diff changeset
   959
209
42733adf2a48 updated
update
parents:
diff changeset
   960
00:09:57,710 --> 00:09:59,225
42733adf2a48 updated
update
parents:
diff changeset
   961
and want to be lazy,
42733adf2a48 updated
update
parents:
diff changeset
   962
42733adf2a48 updated
update
parents:
diff changeset
   963
210
42733adf2a48 updated
update
parents:
diff changeset
   964
00:09:59,225 --> 00:10:01,115
42733adf2a48 updated
update
parents:
diff changeset
   965
that you just implement that.
42733adf2a48 updated
update
parents:
diff changeset
   966
42733adf2a48 updated
update
parents:
diff changeset
   967
211
42733adf2a48 updated
update
parents:
diff changeset
   968
00:10:01,115 --> 00:10:02,660
42733adf2a48 updated
update
parents:
diff changeset
   969
And then you have already done
42733adf2a48 updated
update
parents:
diff changeset
   970
42733adf2a48 updated
update
parents:
diff changeset
   971
212
42733adf2a48 updated
update
parents:
diff changeset
   972
00:10:02,660 --> 00:10:06,530
42733adf2a48 updated
update
parents:
diff changeset
   973
at least two constructors
42733adf2a48 updated
update
parents:
diff changeset
   974
by just implementing one.
42733adf2a48 updated
update
parents:
diff changeset
   975
42733adf2a48 updated
update
parents:
diff changeset
   976
213
42733adf2a48 updated
update
parents:
diff changeset
   977
00:10:06,530 --> 00:10:08,915
42733adf2a48 updated
update
parents:
diff changeset
   978
But as said that 
42733adf2a48 updated
update
parents:
diff changeset
   979
requires a bit skill
42733adf2a48 updated
update
parents:
diff changeset
   980
42733adf2a48 updated
update
parents:
diff changeset
   981
214
42733adf2a48 updated
update
parents:
diff changeset
   982
00:10:08,915 --> 00:10:11,450
42733adf2a48 updated
update
parents:
diff changeset
   983
of generalizing how
42733adf2a48 updated
update
parents:
diff changeset
   984
that should be.
42733adf2a48 updated
update
parents:
diff changeset
   985
42733adf2a48 updated
update
parents:
diff changeset
   986
215
42733adf2a48 updated
update
parents:
diff changeset
   987
00:10:11,450 --> 00:10:14,180
42733adf2a48 updated
update
parents:
diff changeset
   988
And the other questions
42733adf2a48 updated
update
parents:
diff changeset
   989
are just then
42733adf2a48 updated
update
parents:
diff changeset
   990
42733adf2a48 updated
update
parents:
diff changeset
   991
216
42733adf2a48 updated
update
parents:
diff changeset
   992
00:10:14,180 --> 00:10:16,745
42733adf2a48 updated
update
parents:
diff changeset
   993
trying out your
42733adf2a48 updated
update
parents:
diff changeset
   994
expression matcher on
42733adf2a48 updated
update
parents:
diff changeset
   995
42733adf2a48 updated
update
parents:
diff changeset
   996
217
42733adf2a48 updated
update
parents:
diff changeset
   997
00:10:16,745 --> 00:10:19,580
42733adf2a48 updated
update
parents:
diff changeset
   998
some examples, more
42733adf2a48 updated
update
parents:
diff changeset
   999
power examples,
42733adf2a48 updated
update
parents:
diff changeset
  1000
42733adf2a48 updated
update
parents:
diff changeset
  1001
218
42733adf2a48 updated
update
parents:
diff changeset
  1002
00:10:19,580 --> 00:10:22,400
42733adf2a48 updated
update
parents:
diff changeset
  1003
and they should be
42733adf2a48 updated
update
parents:
diff changeset
  1004
very easy to solve.
42733adf2a48 updated
update
parents:
diff changeset
  1005
42733adf2a48 updated
update
parents:
diff changeset
  1006
219
42733adf2a48 updated
update
parents:
diff changeset
  1007
00:10:22,400 --> 00:10:24,605
42733adf2a48 updated
update
parents:
diff changeset
  1008
So I hope it's not
42733adf2a48 updated
update
parents:
diff changeset
  1009
too much asked for
42733adf2a48 updated
update
parents:
diff changeset
  1010
42733adf2a48 updated
update
parents:
diff changeset
  1011
220
42733adf2a48 updated
update
parents:
diff changeset
  1012
00:10:24,605 --> 00:10:26,615
42733adf2a48 updated
update
parents:
diff changeset
  1013
and I hope you have fun.
42733adf2a48 updated
update
parents:
diff changeset
  1014
42733adf2a48 updated
update
parents:
diff changeset
  1015
221
42733adf2a48 updated
update
parents:
diff changeset
  1016
00:10:26,615 --> 00:10:29,675
42733adf2a48 updated
update
parents:
diff changeset
  1017
It is not too much ask
42733adf2a48 updated
update
parents:
diff changeset
  1018
because you can,
42733adf2a48 updated
update
parents:
diff changeset
  1019
42733adf2a48 updated
update
parents:
diff changeset
  1020
222
42733adf2a48 updated
update
parents:
diff changeset
  1021
00:10:29,675 --> 00:10:32,420
42733adf2a48 updated
update
parents:
diff changeset
  1022
I hope it's not too much
42733adf2a48 updated
update
parents:
diff changeset
  1023
because you can start from
42733adf2a48 updated
update
parents:
diff changeset
  1024
42733adf2a48 updated
update
parents:
diff changeset
  1025
223
42733adf2a48 updated
update
parents:
diff changeset
  1026
00:10:32,420 --> 00:10:35,615
42733adf2a48 updated
update
parents:
diff changeset
  1027
my definitions or
42733adf2a48 updated
update
parents:
diff changeset
  1028
my implementation.
42733adf2a48 updated
update
parents:
diff changeset
  1029
42733adf2a48 updated
update
parents:
diff changeset
  1030
224
42733adf2a48 updated
update
parents:
diff changeset
  1031
00:10:35,615 --> 00:10:39,425
42733adf2a48 updated
update
parents:
diff changeset
  1032
It's really essentially
42733adf2a48 updated
update
parents:
diff changeset
  1033
mostly is brain work,
42733adf2a48 updated
update
parents:
diff changeset
  1034
42733adf2a48 updated
update
parents:
diff changeset
  1035
225
42733adf2a48 updated
update
parents:
diff changeset
  1036
00:10:39,425 --> 00:10:42,170
42733adf2a48 updated
update
parents:
diff changeset
  1037
how these nullable and
42733adf2a48 updated
update
parents:
diff changeset
  1038
derivative should work.
42733adf2a48 updated
update
parents:
diff changeset
  1039
42733adf2a48 updated
update
parents:
diff changeset
  1040
226
42733adf2a48 updated
update
parents:
diff changeset
  1041
00:10:42,170 --> 00:10:44,510
42733adf2a48 updated
update
parents:
diff changeset
  1042
If you're in a
42733adf2a48 updated
update
parents:
diff changeset
  1043
language like Scala,
42733adf2a48 updated
update
parents:
diff changeset
  1044
42733adf2a48 updated
update
parents:
diff changeset
  1045
227
42733adf2a48 updated
update
parents:
diff changeset
  1046
00:10:44,510 --> 00:10:48,875
42733adf2a48 updated
update
parents:
diff changeset
  1047
the implementation should
42733adf2a48 updated
update
parents:
diff changeset
  1048
then be easy-peasy.
42733adf2a48 updated
update
parents:
diff changeset
  1049
42733adf2a48 updated
update
parents:
diff changeset
  1050
228
42733adf2a48 updated
update
parents:
diff changeset
  1051
00:10:48,875 --> 00:10:51,365
42733adf2a48 updated
update
parents:
diff changeset
  1052
If you are in a different language
42733adf2a48 updated
update
parents:
diff changeset
  1053
42733adf2a48 updated
update
parents:
diff changeset
  1054
229
42733adf2a48 updated
update
parents:
diff changeset
  1055
00:10:51,365 --> 00:10:52,610
42733adf2a48 updated
update
parents:
diff changeset
  1056
I assume you also
42733adf2a48 updated
update
parents:
diff changeset
  1057
42733adf2a48 updated
update
parents:
diff changeset
  1058
230
42733adf2a48 updated
update
parents:
diff changeset
  1059
00:10:52,610 --> 00:10:54,890
42733adf2a48 updated
update
parents:
diff changeset
  1060
dedicated to that
42733adf2a48 updated
update
parents:
diff changeset
  1061
language to start with,
42733adf2a48 updated
update
parents:
diff changeset
  1062
42733adf2a48 updated
update
parents:
diff changeset
  1063
231
42733adf2a48 updated
update
parents:
diff changeset
  1064
00:10:54,890 --> 00:10:58,475
42733adf2a48 updated
update
parents:
diff changeset
  1065
so it should be also very
42733adf2a48 updated
update
parents:
diff changeset
  1066
easy for you to translate
42733adf2a48 updated
update
parents:
diff changeset
  1067
42733adf2a48 updated
update
parents:
diff changeset
  1068
232
42733adf2a48 updated
update
parents:
diff changeset
  1069
00:10:58,475 --> 00:11:01,100
42733adf2a48 updated
update
parents:
diff changeset
  1070
my Scala code into whatever
42733adf2a48 updated
update
parents:
diff changeset
  1071
language you want to
42733adf2a48 updated
update
parents:
diff changeset
  1072
42733adf2a48 updated
update
parents:
diff changeset
  1073
233
42733adf2a48 updated
update
parents:
diff changeset
  1074
00:11:01,100 --> 00:11:04,280
42733adf2a48 updated
update
parents:
diff changeset
  1075
do, first and then
42733adf2a48 updated
update
parents:
diff changeset
  1076
start from there.
42733adf2a48 updated
update
parents:
diff changeset
  1077
42733adf2a48 updated
update
parents:
diff changeset
  1078
234
42733adf2a48 updated
update
parents:
diff changeset
  1079
00:11:04,280 --> 00:11:06,230
42733adf2a48 updated
update
parents:
diff changeset
  1080
If there are any questions,
42733adf2a48 updated
update
parents:
diff changeset
  1081
42733adf2a48 updated
update
parents:
diff changeset
  1082
235
42733adf2a48 updated
update
parents:
diff changeset
  1083
00:11:06,230 --> 00:11:08,360
42733adf2a48 updated
update
parents:
diff changeset
  1084
please ask me or the TAs.
42733adf2a48 updated
update
parents:
diff changeset
  1085
42733adf2a48 updated
update
parents:
diff changeset
  1086
236
42733adf2a48 updated
update
parents:
diff changeset
  1087
00:11:08,360 --> 00:11:10,040
42733adf2a48 updated
update
parents:
diff changeset
  1088
We are trying to be as helpful
42733adf2a48 updated
update
parents:
diff changeset
  1089
42733adf2a48 updated
update
parents:
diff changeset
  1090
237
42733adf2a48 updated
update
parents:
diff changeset
  1091
00:11:10,040 --> 00:11:12,900
42733adf2a48 updated
update
parents:
diff changeset
  1092
as possible with the coursework.
42733adf2a48 updated
update
parents:
diff changeset
  1093
42733adf2a48 updated
update
parents:
diff changeset
  1094
238
42733adf2a48 updated
update
parents:
diff changeset
  1095
00:11:13,240 --> 00:11:17,885
42733adf2a48 updated
update
parents:
diff changeset
  1096
Bear in mind, this is the
42733adf2a48 updated
update
parents:
diff changeset
  1097
first step in our compiler.
42733adf2a48 updated
update
parents:
diff changeset
  1098
42733adf2a48 updated
update
parents:
diff changeset
  1099
239
42733adf2a48 updated
update
parents:
diff changeset
  1100
00:11:17,885 --> 00:11:21,005
42733adf2a48 updated
update
parents:
diff changeset
  1101
The coursework 2 will then
42733adf2a48 updated
update
parents:
diff changeset
  1102
build on top of that.
42733adf2a48 updated
update
parents:
diff changeset
  1103
42733adf2a48 updated
update
parents:
diff changeset
  1104
240
42733adf2a48 updated
update
parents:
diff changeset
  1105
00:11:21,005 --> 00:11:25,770
42733adf2a48 updated
update
parents:
diff changeset
  1106
So it's better to get this
42733adf2a48 updated
update
parents:
diff changeset
  1107
correct first. Thanks.