-
Notifications
You must be signed in to change notification settings - Fork 36
/
Copy pathindex.html
680 lines (574 loc) · 20.9 KB
/
index.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
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<title>The Incredible Proof Machine</title>
<link rel="stylesheet" data-css="true" type="text/css" href="./vendor/joint.min.css" />
<link rel="stylesheet" type="text/css" href="./webui/loader.css" />
<link rel="stylesheet" data-css="true" type="text/css" href="./webui/logic.css" />
<link rel="stylesheet" type="text/css" href="./fonts/lintsec_regular_macroman/stylesheet.css" />
<link rel="icon" href="incredible-favicon.png" type="image/png">
<style>
body {
font-family: sans-serif;
}
/* Because we try to animate something with a rotation, we need ot include that here */
@keyframes wiggle {
0% {
transform: skewX(9deg) rotate(180deg);
}
10% {
transform: skewX(-8deg) rotate(180deg);
}
20% {
transform: skewX(7deg) rotate(180deg);
}
30% {
transform: skewX(-6deg) rotate(180deg);
}
40% {
transform: skewX(5deg) rotate(180deg);
}
50% {
transform: skewX(-4deg) rotate(180deg);
}
60% {
transform: skewX(3deg) rotate(180deg);
}
70% {
transform: skewX(-2deg) rotate(180deg);
}
80% {
transform: skewX(1deg) rotate(180deg);
}
90% {
transform: skewX(0.001deg) rotate(180deg);
}
100% {
transform: skewX(9deg) rotate(180deg);
}
}
:hover>.e {
animation: wiggle;
animation-duration: 2s;
animation-direction: alternate;
animation-iteration-count: 30;
animation-fill-mode: both;
animation-timing-function: linear;
}
.e {
display: inline-block;
transform: skewX(0.001deg) rotate(180deg);
transform-origin: center 43%;
}
#loading {
position: absolute;
top: 0px;
left: 0px;
right: 0px;
bottom: 0px;
/* background: lightgray; */
/* ^ too much flickering if loading is quick */
}
#vertpane {
position: absolute;
top: 0px;
left: 0px;
right: 0px;
bottom: 0px;
padding: 0px;
margin: 0px;
overflow: none;
display: flex;
flex-direction: column;
}
#header {
height: 80px;
padding: 10px;
text-align: center;
border-bottom: 5px solid grey;
}
#task #assumptions,
#task #conclusions {
text-align: center;
}
#blockcount-div {
text-align: center;
}
#selection-region {
position: absolute;
border-style: solid;
border-color: #3399FF;
border-width: 1px;
background: #3399ff66;
display: none;
}
.close {
position: absolute;
top: 2px;
right: 2px;
}
button.iconic {
font-size: 120%;
color: white;
margin: 2px;
padding: 1px;
border: 0px;
border-radius: 5px;
background: lightgrey;
cursor: pointer;
}
button.iconic:hover {
opacity: 0.5;
}
.toolbar {
position: absolute;
top: 0px;
right: 0px;
padding: 1em;
display: flex;
justify-content: flex-end;
}
.toolbar button {
width: 40px;
flex-grow: 1;
flex-basis: 0;
}
.toolbar button#showhelp {
background: blue;
}
#inferredrule {
display: none;
}
#inferredrule button {
display: block;
margin-left: auto;
margin-right: auto;
width: 80px;
}
#taskwrap {
text-align: center;
}
.inferencerule {
width: 200px;
padding: 4px;
margin: 0 1em 1em 1em;
}
.inferencerule ul {
display: flex;
flex-wrap: wrap;
justify-content: space-around;
align-items: baseline;
padding: 0px;
margin: 0px;
}
.inferencerule li {
display: block;
padding: 0px;
margin: 1px 1ex 1px 1ex;
text-align: center;
}
#taskdialog .inferencerule.attempted {
background: wheat;
}
#taskdialog .inferencerule {
border: 1px solid lightgray;
border-radius: 0 5px 0 5px;
cursor: pointer;
}
#taskdialog .inferencerule.solved {
background: rgb(40, 220, 30);
}
#taskdialog .inferencerule:hover {
border: 1px solid black;
}
#complexitywrap .number {
display: inline-block;
text-align: right;
width: 10%;
}
#complexitywrap .bar {
display: inline-block;
background-color: purple;
vertical-align: middle;
height: 1em;
border-radius: .5em .5em .5em .5em;
width: 30%;
}
#complexitywrap #blockcount .bar {
background-color: purple;
width: 30%;
}
#complexitywrap #min-blockcount .bar {
background-color: blue;
width: 30%;
}
.blocklist {
display: flex;
flex-direction: column;
align-items: center;
}
.tasklist {
display: flex;
flex-wrap: wrap;
/* justify-content: space-between; */
/* ^ not a good idea, see http://stackoverflow.com/questions/1637797 */
align-items: center;
}
.customtaskentry {
width: 200px;
padding: 4px;
margin: 0 1em 1em 1em;
text-align: center;
}
.customtaskentry textarea {
width: 100%;
height: 80px;
display: inline-block;
font-family: sans-serif;
text-align: center;
}
.customtaskentry button {
width: 100%;
}
.tasklist .inferencerule {
position: relative;
}
.tasklist .inferencerule .task-tools {
position: absolute;
top: -20px;
right: 30px;
width: 0px;
height: 0px;
}
.tasklist .inferencerule:hover .tool-remove {
opacity: 1;
}
#horizpane {
flex-grow: 1;
flex-shrink: 1;
overflow-y: hidden;
display: flex;
flex-direction: row;
}
#leftpane {
width: 268px;
overflow: auto;
border-right: 2px solid grey;
padding: 15px;
resize: horizontal;
}
#mainpane {
overflow: hidden;
flex-grow: 1;
position: relative;
}
#paper {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
}
#dialog,
#help {
border: 2px solid grey;
border-radius: 5px;
background: white;
display: none;
position: absolute;
top: 120px;
left: 0px;
right: 0px;
margin-left: auto;
margin-right: auto;
width: 1000px;
bottom: 120px;
overflow: auto;
padding: 15px;
}
.symboltable {
margin-left: auto;
margin-right: auto;
border: 2px solid lightgray;
border-radius: 0 5px 0 5px;
}
.symboltable td {
padding-left: 10px;
padding-right: 10px;
text-align: center;
}
.symboltable th {
padding-left: 10px;
padding-right: 10px;
text-align: right;
font-weight: normal;
/* border-right: 2px solid lightgray; */
}
#taskdialog {
border-top: 5px solid grey;
position: absolute;
margin: 0px;
top: 100px;
left: 0px;
right: 0px;
bottom: 0px;
background: white;
overflow: auto;
padding: 15px;
}
#taskbottombar {
flex-grow: 0;
flex-shrink: 0;
text-align: center;
border-top: 5px solid grey;
height: 20px;
background: white;
padding: 5px;
}
#taskbottombar:hover {
background: lightgrey
}
.incrediblefont {
font-family: 'lintsecregular', Arial, sans-serif;
}
h1 {
font-family: 'lintsecregular', Arial, sans-serif;
}
h2,
h3 {
font-family: sans-serif
}
#errors {
white-space: pre-line;
}
</style>
</head>
<body>
<div id="vertpane">
<div id="header">
<h1>The Incredible Proof Machin<span class="e">e</span></h1>
<div class="toolbar">
<button class="iconic" id="showhelp" data-i18n="[title]Help">ℹ</button>
<button class="iconic" id="reset" data-i18n="[title]Forget all stored data">🔄</button>
</div>
</div>
<div id="horizpane">
<div id="leftpane">
<div id="task">
<h3 data-i18n>Current task:</h3>
<div id="taskwrap"></div>
<h3 data-i18n>Block count:</h3>
<div id="complexitywrap">
<div id="blockcount" data-i18n="[title]Your proof block count. Try to minimize it!">
<span class="number"></span>
<span class="bar"></span>
</div>
<div id="min-blockcount"
data-i18n="[title]The best known proof count. Did you beat it? Let us know!">
<span class="number"></span>
<span class="bar"></span>
</div>
</div>
</div>
<h3 data-i18n>Logic blocks:</h3>
<div class="blocklist" id="logic"></div>
<h3 data-i18n>Helper blocks:</h3>
<div class="blocklist" id="helpers"></div>
<div id="inferredrule">
<h3 data-i18n>New custom block:</h3>
<div class="blocklist" id="inferredrulewrapper">
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="30em" height="100px"></svg>
<button id="addcustomblock" data-i18n>Add</button>
</div>
</div>
<h3 data-i18n>Custom blocks:</h3>
<div class="blocklist" id="custom"></div>
<div id="errors"></div>
</div>
<div id="mainpane">
<div id="paper"></div>
<div id="selection-region"></div>
<div id="paper-toolbar" class="toolbar">
<button class="iconic" id="undo">↶</button>
<button class="iconic" id="redo">↷</button>
<button class="iconic" id="zoom-in">+</button>
<button class="iconic" id="zoom-out">−</button>
<button class="iconic" id="zoom-orig">1:1</button>
<button class="iconic" id="zoom-fit">Fit</button>
<button class="iconic" id="savesvg" data-i18n="[title]Save proof as SVG image.">⤓</button>
<button class="iconic" id="resettask" data-i18n="[title]Reset this task">🔄</button>
</div>
</div>
</div>
<div id="taskbottombar" data-i18n="switch"></div>
</div>
<div id="dialog">
<button class="iconic close" id="closedialog">×</button>
<span id="took"></span>
<br />
<textarea cols=100 rows=20 id="graph" readonly="readonly"></textarea>
<br />
<textarea cols=100 rows=20 id="proof" readonly="readonly"></textarea>
<br />
<textarea cols=100 rows=20 id="analysis" readonly="readonly"></textarea>
</div>
<div id="taskdialog">
<h2 data-i18n>What do you want to prove today?</h2>
<div id="sessiontasks"></div>
</div>
<div id="help">
<button class="iconic close" id="closehelp">×</button>
<h2>Welcome to <span class="incrediblefont">The Incredible Proof Machin<span class="e">e</span></span>!</h2>
<h3>What is this?</h3>
<p>
This is a tool to perform proofs in various logics (e.g. propositional, predicate logic) visually: You
simply add blocks that represent the various proofs steps, connect them properly, and if the conclusion
turns green, then you have created a complete proof!
Simply drag and drop to connect two dots; for some examples of completed proofs, see <a
href="https://www.joachim-breitner.de/publications/Incredible_ITP2016_preprint.pdf">this paper</a>.
</p>
<p>
For a quick introduction to the UI, check out the <a
href="https://www.youtube.com/watch?v=bExGUtVWzb4">introductory
video on the Tea Leaves Programming channel (13min)</a>!
</p>
<h3>Why is this?</h3>
<p>
<span class="incrediblefont">The Incredible Proof Machin<span class="e">e</span></span> was created to
convey the fun and joy of doing proofs, especially in a computer aided way, without first having to learn
the syntax of a “real” thereom prover like <a href="http://isabelle.in.tum.de/">Isabelle</a>.
</p>
<h3>Which keyboard shortcuts can I use?</h3>
<ul>
<li>CTRL+Z: Undo change</li>
<li>CTRL+Y: Redo change</li>
<li>CTRL+A: Select all blocks</li>
<li>BACKSPACE, DELETE: Delete selected blocks</li>
<li>SHIFT+MOUSE1: Add block or region to selection</li>
</ul>
<h3>Why is the conclusion not green?</h3>
<p>
Because your proof is not a proof (yet). This can have these reasons:
</p>
<ul>
<li>
Some of your blocks have an input (an assumption) that is not connected to
anything. These are red.
</li>
<li>
Some of your connections connect propositions that are obviously different (marked red and marked with
☠), or they are underspecified and it is not clear whether they might be different or not (marked red
and with ?). In the latter case, inserting an annotation block (✎P) can help.
</li>
<li>You have cycles in the proof. These are (you guessed it) marked red.</li>
<li>You have wired up local hypotheses wrongly. Local hypotheses are those outputs that come out on the left
of a dent in the block, and can only be used in the part of the proof that connects to the corresponding
input on the right of the dent. Do I need to mention that these are marked red?</li>
</ul>
<h3>How do I enter these funny characters?</h3>
<p>
There are only a few places where you actually have to enter formulas, mostly if you want to use the
✎P-block or define your own tasks. There, you can use the following abbreviations:
</p>
<table class="symboltable">
<tr>
<th>Instead of</th>
<td>∧</td>
<td>∨</td>
<td>→</td>
<td>↑</td>
<td>¬</td>
<td>∀</td>
<td>∃</td>
<!-- <td>λ</td> -->
<td>⊥</td>
</tr>
<tr>
<th>you can write</th>
<td>&</td>
<td>|</td>
<td>-></td>
<td>^</td>
<td>~</td>
<td>!</td>
<td>?</td>
<!-- <td>\</td> -->
<td>False</td>
</tr>
</table>
<h3>How do I create a custom task with multiple assumptions or conclusions?</h3>
<p>
Just put each assumption and conclusion on its own line, i.e. press enter after each of them.
</p>
<h3>How do I create custom blocks?</h3>
<p>
You can select blocks in a proof by clicking them while holding down Shift. Then, the option to create a
custom block wrapping the ones you've selected will appear.
</p>
<h3>Where did my proofs go?</h3>
<p>
Currently, your proofs will only be saved in your own browser. This means they will be lost when you delete
your local storage after you close this window/tab, or if this is a private browsing session or similar. We
have plans to save your progress on our server in a future version.
</p>
<h3>Who did this?</h3>
<p>
Mostly <a href="http://www.joachim-breitner.de/">Joachim Breitner</a>, with valuable help from <a
href="https://github.com/nomeata/incredible/graphs/contributors">some colleagues and friends</a>.
</p>
<h3>Where can I read more about this?</h3>
<p>
For more information about the Incredible Proof Machine, especially from an academic point of view, please
see the following publications:
</p>
<ul>
<li>Joachim Breitner: <a
href="https://www.joachim-breitner.de/publications/Incredible_ITP2016_preprint.pdf"><strong>Visual
theorem proving with the Incredible Proof Machine</strong></a>, accepted paper at <a
href="http://itp2016.inria.fr/">ITP 2016</a>, August 2016</li>
<li>Joachim Breitner: <a
href="https://www.joachim-breitner.de/publications/Incredible_LFMTP_2016-06-23.pdf"><strong>The
Incredible Proof Machine</strong></a>, Invited talk at <a
href="http://dlicata.web.wesleyan.edu/events/lfmtp2016/program.html">LFMTP 2016</a>, June 2016</li>
<li>Joachim Breitner, Denis Lohner: <a
href="http://isa-afp.org/entries/Incredible_Proof_Machine.shtml"><strong>The meta theory of the
Incredible Proof Machine</strong></a>, Isabelle formalisation in the Archive of Formal Proofs,
May 2016</li>
<li><a href="http://modellansatz.de/incredible-proof-machine"><strong>Incredible Proof Machine</strong></a>,
Interview of Joachim Breitner by Sebastian Ritterbusch, episode 78 of the science podcast
“Modellansatz”, German, 2016
</li>
</ul>
<h3>Can I help?</h3>
<p>
Most certainly! Everything is Free Software, so you can jump right in, <a
href="https://github.com/nomeata/incredible">fetch the code</a> and start contributing. The more people
contribute, the more incredible the <span class="incrediblefont">The Incredible Proof Machin<span
class="e">e</span></span> becomes.
</p>
</div>
<div id="loading">
<div class="signal"></div>
</div>
<script src="./vendor/jquery-3.6.4.min.js"></script>
<script type="text/javascript">$.holdReady(true);</script>
<script src="./vendor/i18next-1.10.1.min.js"></script>
<script src="./webui/i18n.js"></script>
<script src="./vendor/jquery-ui/jquery-ui.js"></script>
<script src="./vendor/lodash.min.js"></script>
<script src="./vendor/backbone-min.js"></script>
<script src="./vendor/joint.min.js"></script>
<script src="./vendor/FileSaver.min.js"></script>
<script src="./logic.js"></script>
<script src="./logics.js"></script>
<script src="./sessions.js"></script>
<script src="./webui/shapes.js"></script>
<script src="./webui/logic-interface.js"></script>
<script src="./webui/incredible-elements.js"></script>
<script src="./webui/task-management.js"></script>
<script src="./webui/graph-interaction.js"></script>
<script src="./webui/webui.js"></script>
</body>
</html>