-
Notifications
You must be signed in to change notification settings - Fork 1
/
figure.html
310 lines (296 loc) · 12.6 KB
/
figure.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Winnow Figure</title>
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Source+Code+Pro:ital,wght@0,400;0,700;1,400;1,700&display=swap" rel="stylesheet">
<style>
* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; font-family: Georgia; }
body { padding: 0 1rem; }
h1, h2, h3 { margin-bottom: 1rem; width: 100%; }
hr { margin-bottom: 1rem; margin-top: 1rem; }
table { border-collapse:collapse; }
td:first-child { width: 340px; }
td:nth-child(2) { width: 860px; }
td:last-child { width: 300px; font-size: 20px; }
tr td {border-bottom: 1px solid #ccc; padding: 0.5rem 0; }
tr th {border-bottom: 1px solid #ccc; padding: 0.5rem 0; font-size: 20px; }
pre { /*background: #eee;*/ font-family: "Source Code Pro", monospace; padding: 0.5rem; }
code { font-family: "Source Code Pro", monospace; white-space: pre; }
.partialMatches { font-family: "Source Code Pro", monospace; }
.partialMatches { display: flex; flex-flow: row wrap; }
.partialMatch { margin-right: 10px; width: 200px; position: relative; }
.partialMatch .header { background: #555; color: white; font-weight: bold; }
.partialMatch.complete .header { background: darkgreen; }
.partialMatch.accept .header { background: darkblue; }
/*.partialMatch.fork .header { background: linear-gradient(to right, #555, darkblue); }
.partialMatch.forkComplete .header { background: linear-gradient(to right, #555, darkgreen); }*/
.partialMatch.die .header { background: darkred; text-decoration: line-through; }
.partialMatch .row { padding: 0.1rem; }
.partialMatch .row:not(.header):nth-child(odd) { background: #eee; }
.partialMatch .row:nth-child(even) { background: #ddd; }
.partialMatch .row.active { background: lemonchiffon !important; }
.partialMatch .arrow { position: absolute; left: 200px; top: 0; width: 0; height: 0; border-top: 11.5px solid transparent; border-bottom: 11.5px solid transparent; border-left: 11.5px solid #555; z-index: -1; }
/*.partialMatch.fork .arrow { border-left: 14px solid darkblue; }
.partialMatch.forkComplete .arrow { border-left: 14px solid darkgreen; }*/
span.accept { color: darkblue; font-weight: bold; }
span.complete { color: darkgreen; font-weight: bold; }
span.die { color: darkred; font-weight: bold; }
span.pass { color: #555; font-weight: bold; }
</style>
</head>
<body>
<main>
<table>
<tr><th>Event</th><th>Partial match pool</th><th>Explanation</th></tr>
<tr>
<td><pre style="">[initial state]</pre>
<!--<div style="position:relative;text-align:center;font-size: 20px">[initial state]</div>-->
</td>
<td>
<div class="partialMatches">
<div class="partialMatch">
<div class="row header">breakHospitality</div>
<div class="row">e1: ???, guest: ???</div>
<div class="row">e2: ???, host: ???</div>
<div class="row">e3: ???</div>
</div>
</div>
</td>
<td>We first create a single, empty partial match for every sifting pattern in the pattern library.</td>
</tr>
<tr>
<td><pre>{eventID: 1,
eventType: "enterTown",
actor: "Yann"}</pre></td>
<td>
<div class="partialMatches">
<div class="partialMatch fork">
<div class="row header">breakHospitality</div>
<div class="row">e1: ???, guest: ???</div>
<div class="row">e2: ???, host: ???</div>
<div class="row">e3: ???</div>
<div class="arrow"></div>
</div>
<div class="partialMatch accept">
<div class="row header">breakHospitality_1</div>
<div class="row active">e1: 1, guest: Yann</div>
<div class="row">e2: ???, host: ???</div>
<div class="row">e3: ???</div>
</div>
</div>
</td>
<td>Yann arrives in town. We fork the empty partial match and create a <span class="accept">new partial match</span> with the first set of variables bound.</td>
</tr>
<tr>
<td><pre>{eventID: 2,
eventType: "irrelevantEvent",
actor: "Mia"}</pre></td>
<td>
<div class="partialMatches">
<div class="partialMatch">
<div class="row header">breakHospitality</div>
<div class="row">e1: ???, guest: ???</div>
<div class="row">e2: ???, host: ???</div>
<div class="row">e3: ???</div>
</div>
<div class="partialMatch">
<div class="row header">breakHospitality_1</div>
<div class="row">e1: 1, guest: Yann</div>
<div class="row">e2: ???, host: ???</div>
<div class="row">e3: ???</div>
</div>
</div>
</td>
<td>An irrelevant event occurs. The pool of partial matches is <span class="pass">unchanged</span>.</td>
</tr>
<tr>
<td><pre>{eventID: 3,
eventType: "showHospitality",
actor: "Eve",
target: "Yann"}</pre></td>
<td>
<div class="partialMatches">
<div class="partialMatch">
<div class="row header">breakHospitality</div>
<div class="row">e1: ???, guest: ???</div>
<div class="row">e2: ???, host: ???</div>
<div class="row">e3: ???</div>
</div>
<div class="partialMatch fork">
<div class="row header">breakHospitality_1</div>
<div class="row">e1: 1, guest: Yann</div>
<div class="row">e2: ???, host: ???</div>
<div class="row">e3: ???</div>
<div class="arrow"></div>
</div>
<div class="partialMatch accept">
<div class="row header">breakHospitality_13</div>
<div class="row">e1: 1, guest: Yann</div>
<div class="row active">e2: 3, host: Eve</div>
<div class="row">e3: ???</div>
</div>
</div>
</td>
<td>Eve shows Yann hospitality. We again fork off a <span class="accept">new partial match</span> with the next set of variables bound.</td>
</tr>
<tr>
<td><pre>{eventID: 4,
eventType: "pickpocket",
tags: ["harm"],
actor: "Eve",
target: "Yann"}</pre></td>
<td>
<div class="partialMatches">
<div class="partialMatch">
<div class="row header">breakHospitality</div>
<div class="row">e1: ???, guest: ???</div>
<div class="row">e2: ???, host: ???</div>
<div class="row">e3: ???</div>
</div>
<div class="partialMatch">
<div class="row header">breakHospitality_1</div>
<div class="row">e1: 1, guest: Yann</div>
<div class="row">e2: ???, host: ???</div>
<div class="row">e3: ???</div>
</div>
<div class="partialMatch forkComplete">
<div class="row header">breakHospitality_13</div>
<div class="row">e1: 1, guest: Yann</div>
<div class="row">e2: 3, host: Eve</div>
<div class="row">e3: ???</div>
<div class="arrow"></div>
</div>
<div class="partialMatch complete">
<div class="row header">breakHospitality_134</div>
<div class="row">e1: 1, guest: Yann</div>
<div class="row">e2: 3, host: Eve</div>
<div class="row active">e3: 4<div>
</div>
</div>
</td>
<td>Eve pickpockets Yann, completing the pattern. We fork off a new match, mark it <span class="complete">complete</span>, and remove it from the pool.</td>
</tr>
<tr>
<td><pre>{eventID: 5,
eventType: "showHospitality",
actor: "Jake",
target: "Yann"}</pre></td>
<td>
<div class="partialMatches">
<div class="partialMatch">
<div class="row header">breakHospitality</div>
<div class="row">e1: ???, guest: ???</div>
<div class="row">e2: ???, host: ???</div>
<div class="row">e3: ???</div>
</div>
<div class="partialMatch fork">
<div class="row header">breakHospitality_1</div>
<div class="row">e1: 1, guest: Yann</div>
<div class="row">e2: ???, host: ???</div>
<div class="row">e3: ???</div>
<div class="arrow"></div>
</div>
<div class="partialMatch accept">
<div class="row header">breakHospitality_15</div>
<div class="row">e1: 1, guest: Yann</div>
<div class="row active">e2: 5, host: Jake</div>
<div class="row">e3: ???</div>
</div>
<div class="partialMatch">
<div class="row header">breakHospitality_13</div>
<div class="row">e1: 1, guest: Yann</div>
<div class="row">e2: 3, host: Eve</div>
<div class="row">e3: ???</div>
</div>
</div>
</td>
<td>Jake shows Yann hospitality. We fork off a <span class="accept">new partial match</span> from <code>breakHospitality_1</code>, with Jake as host instead of Eve.</td>
</tr>
<tr>
<td><pre>{eventID: 6,
eventType: "leaveTown",
actor: "Yann"}</pre></td>
<td>
<div class="partialMatches">
<div class="partialMatch">
<div class="row header">breakHospitality</div>
<div class="row">e1: ???, guest: ???</div>
<div class="row">e2: ???, host: ???</div>
<div class="row">e3: ???</div>
</div>
<div class="partialMatch die">
<div class="row header">breakHospitality_1</div>
<div class="row">e1: 1, guest: Yann</div>
<div class="row">e2: ???, host: ???</div>
<div class="row">e3: ???</div>
</div>
<div class="partialMatch die">
<div class="row header">breakHospitality_15</div>
<div class="row">e1: 1, guest: Yann</div>
<div class="row">e2: 5, host: Jake</div>
<div class="row">e3: ???</div>
</div>
<div class="partialMatch die">
<div class="row header">breakHospitality_13</div>
<div class="row">e1: 1, guest: Yann</div>
<div class="row">e2: 3, host: Eve</div>
<div class="row">e3: ???</div>
</div>
<!--
<div class="partialMatch complete">
<div class="row header">breakHospitality_134</div>
<div class="row">e1: 1, guest: Yann</div>
<div class="row">e2: 3, host: Eve</div>
<div class="row">e3: 4<div>
</div>
-->
</div>
</td>
<td>Yann leaves town. We mark all remaining partial matches involving Yann as <span class="die">dead</span> and remove them from the pool.</td>
</tr>
<tr>
<td><pre>{eventID: 7,
eventType: "chaseAndThreaten",
tags: ["harm"],
actor: "Jake",
target: "Yann"}</pre></td>
<td>
<div class="partialMatches">
<div class="partialMatch">
<div class="row header">breakHospitality</div>
<div class="row">e1: ???, guest: ???</div>
<div class="row">e2: ???, host: ???</div>
<div class="row">e3: ???</div>
</div>
<!--
<div class="partialMatch die">
<div class="row header">breakHospitality_1</div>
<div class="row">e1: 1, guest: Yann</div>
<div class="row">e2: ???, host: ???</div>
<div class="row">e3: ???</div>
</div>
<div class="partialMatch die">
<div class="row header">breakHospitality_13</div>
<div class="row">e1: 1, guest: Yann</div>
<div class="row">e2: 3, host: Eve</div>
<div class="row">e3: ???</div>
</div>
<div class="partialMatch complete">
<div class="row header">breakHospitality_134</div>
<div class="row">e1: 1, guest: Yann</div>
<div class="row">e2: 3, host: Eve</div>
<div class="row">e3: 4<div>
</div>
-->
</div>
</td>
<td>Jake harms Yann—but there's no valid partial matches left for this event to attach to, so <span class="pass">nothing happens</span>.</td>
</tr>
</table>
</main>
</body>
</html>