-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.pandoc
313 lines (263 loc) · 11.7 KB
/
index.pandoc
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
<!-- Copyright (C) 2015 Jake Ehrlich and Graham Leach-Krouse <[email protected]> -->
<!-- This file is part of Carnap -->
<!-- Carnap is free software: you can redistribute it and/or modify -->
<!-- it under the terms of the GNU General Public License as published by -->
<!-- the Free Software Foundation, either version 3 of the License, or -->
<!-- (at your option) any later version. -->
<!-- Carnap is distributed in the hope that it will be useful, but -->
<!-- WITHOUT ANY WARRANTY; without even the implied warranty of -->
<!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -->
<!-- General Public License for more details. -->
<!-- You should have received a copy of the GNU General Public License -->
<!-- along with Carnap. If not, see <http://www.gnu.org/licenses/>. -->
---
title: "Carnap"
bibliography: "/Applications/TeX/Bibliographies/Carnap.bib"
subtitle: "an interactive proofchecker that runs in the browser"
css: "./Frontend/Ghcjs/Implementations/Resources/MainPage.css"
links:
- <a target="_blank" href="https://github.com/gleachkr/Carnap">Github</a>
- <a target="_blank" href="https://github.com/gleachkr/Carnap/wiki/Installation-and-Usage">Installation</a>
- <a target="_blank" href="https://github.com/gleachkr/Carnap/wiki">Wiki</a>
header-includes:
- <link rel="stylesheet" href="Frontend/Ghcjs/Implementations/Resources/jquery-linedtextarea.css" type="text/css" media="screen" title="no title" charset="utf-8">
- <script language="javascript" src="Frontend/Ghcjs/Implementations/Resources/jquery.min.js"></script>
- <script language="javascript" src="Frontend/Ghcjs/Implementations/Resources/jquery-linedtextarea.js"></script>
- <script language="javascript" src="Frontend/Ghcjs/Implementations/Resources/textarea-plus.user.js"></script>
- <script language="javascript" src="Frontend/Ghcjs/Implementations/FOLBox/dist/build/FOLBox/FOLBox.jsexe/all.min.js"></script>
---
> “The acceptance or rejection of abstract linguistic forms, just as the
> acceptance or rejection of any other linguistic forms in any branch of
> science, will finally be decided by their efficiency as instruments, the ratio
> of the results achieved to the amount and complexity of the efforts required.
> To decree dogmatic prohibitions of certain linguistic forms instead of testing
> them by their success or failure in practical use, is worse than futile; it is
> positively harmful because it may obstruct scientific progress.
>
> Let us grant to those who work in any special field of investigation the
> freedom to use any form of expression which seems useful to them; the work
> in the field will sooner or later lead to the elimination of those forms
> which have no useful function. *Let us be cautious in making assertions
> and critical in examining them, but tolerant in permitting linguistic forms.*”
> [@Anonymous:RIba9Nf9, Empiricism, Semantics and Ontology]
#Introducing Carnap
Carnap is a free and open-source[^1] interactive proof-checker that runs in
any modern web-browser. It can continuously display a proof's development as
you type, verify the correctness and contents of partial proofs, and offer
simple explanations of errors.
Here are some interactive examples of what Carnap can do.
<div class="slider">
<div>
This is how you can prove Peirce's theorem:
```{#proof1 .slproof .strict}
Show: ((P=>Q)=>P)=>P
(P=>Q)=>P PR
Show: P
-P PR
-(P=>Q) MT 2,4
Show: P=>Q
P PR
Show: Q
:ID 7,4
:CD 8
:ID 5,6
:CD 3
```
To see some feedback on partial proofs and errors, change the proof above and
mouse over the proof analysis that appears to the right. To see a list of
available rules, press "?" while editing the proof. To see more examples of
what Carnap can do, press "next" below.
</div>
<div>
Carnap can handle proofs in first order logic. Here's a proof of Russell's theorem.
```{#proof2 .folproof}
Show: -ExAy(R(x,y)<=>-R(y,y))
ExAy(R(x,y)<=>-R(y,y)) PR
Show P/\-P
Ay(R(r,y)<=>-R(y,y)) PR
R(r,r)<=>-R(r,r) UI 4
Show: R(r,r)
-R(r,r) PR
-R(r,r)=>R(r,r) BC 5
R(r,r) MP 7,8
:ID 7,9
R(r,r)=>-R(r,r) BC 5
-R(r,r) MP 6,11
Show: (P/\-P)
:ID 6,12
:ED 2,13
P S 3
-P S 3
:ID 16,17
```
</div>
<div>
Carnap can handle function symbols and equational reasoning. Here's a proof
of the fact that the bisectors of the sides of a triangle always meet at
a point (from the assumption that a point is on the bisector of a segment if
and only if it's equidistant from the endpoints of that segment).
```{#proof3 .folproof}
AxAyAz(On(x,b(y,z))<> d(x,y) = d(x,z)) PR
Show AwAxAyAz(On(w,b(x,y))^On(w,b(x,z))=>On(w,b(y,z)))
Show AxAyAz(On(a,b(x,y))^On(a,b(x,z))=>On(a,b(y,z)))
Show AyAz(On(a,b(b,y))^On(a,b(b,z))=>On(a,b(y,z)))
Show Az(On(a,b(b,c))^On(a,b(b,z))=>On(a,b(c,z)))
Show On(a,b(b,c))^On(a,b(b,d))=>On(a,b(c,d))
On(a,b(b,c))^On(a,b(b,d)) PR
On(a,b(b,c)) S 7
On(a,b(b,d)) S 7
AyAz(On(a,b(y,z))<> d(a,y) = d(a,z)) UI 1
Az(On(a,b(b,z))<> d(a,b) = d(a,z)) UI 10
On(a,b(b,c))<> d(a,b) = d(a,c) UI 11
On(a,b(b,d))<> d(a,b) = d(a,d) UI 11
On(a,b(b,c)) > d(a,b) = d(a,c) BC 12
On(a,b(b,d)) > d(a,b) = d(a,d) BC 13
d(a,b) = d(a,c) MP 8 14
d(a,b) = d(a,d) MP 9 15
d(a,c) = d(a,d) LL 16 17
Az(On(a,b(c,z))<> d(a,c) = d(a,z)) UI 10
On(a,b(c,d))<> d(a,c) = d(a,d) UI 19
d(a,c) = d(a,d) > On(a,b(c,d)) BC 20
On(a,b(c,d)) MP 18 21
:CD 22
:UD 6
:UD 5
:UD 4
:UD 3
```
</div>
<div>
Goals can be attached to proof boxes, in order to embed exercises in
interactive class materials
```{#gproof .slproof .withGoal}
P/\Q;P\/Q
P/\Q PR
P S 1
P\/Q ADD
```
To complete the proof above, just enter the line number two after the rule
that lets us infer the contents of line three from the contents of line two.
To complete the proof below, enter the line number on which we've derived
Q and thereby finished the conditional derivation.
```{#gproof2 .slproof .withGoal}
-P\/Q;P->Q
-P\/Q PR
Show P->Q
P PR
--P DN 3
Q MTP 4 1
:CD
```
</div>
<div>
The way that Carnap parses its input is configurable. So, one can enter proofs
in either a Kalish-and-Montegue-like format:
```{#proof4 .slproof}
Show P=>(Q=>P)
P PR
Show Q=>P
Q PR
:CD 2
:CD 3
```
or a Fitch-like format:
```{#proof5 .slproof .fitch}
P AS
Q AS
P R 1
Q->P CD 2-3
P->(Q->P) CD 1-4
```
(depending on your preference, or the style of textbook you're working with).
</div>
<div>
You can also configure how formulas are parsed. So far, there's a lax mode,
which allows you to use any string you like as a proposition or relation symbol:
```{#proof6 .folproof}
Ax(Man(x)=>Mortal(x)) PR
Man(Socrates) PR
Man(Socrates) => Mortal(Socrates) UI 1
Mortal(Socrates) MP 2,3
```
And a strict mode, which permits a more compact "parentheses optional" syntax:
```{#proof7 .folproof .strict}
Ax(Px=>Qx) PR
Ps PR
Ps => Qs UI 1
Qs MP 2,3
```
more parsers (e.g. for controlled fragments of English and whitespace agnostic input formats) are underway.
</div>
</div>
Carnap's core algorithms are language agnostic and highly extensible, so this
is just the beginning.
[^1]: Carnap is released under the GNU General Public Licence, and is also
available without charge to anyone who would like to use it.
##What is it for?
Carnap is intended for use by teachers and students of logic. Carnap makes it
possible for students to get quick feedback on their work, and for educators
to rapidly prepare readings with embedded exercises, without the use of
proprietary software.
##Why "Carnap"?
Carnap is named after [Rudolf Carnap](https://en.wikipedia.org/wiki/Rudolf_Carnap), the philosopher quoted above.
Carnap (the philosopher) famously advocated a tolerant and experimental
approach to logic. Carnap (the program) is pluralistic by design. Inference
rules are specified declaratively,[^2] making it easy to add new logics to those
already provided for a given language. The algorithms for checking whether
inferences are correct are applicable to a wide variety of languages,
making it easy to introduce new languages.
Carnap (the philosopher) also had a lot to say about logical types, and how
ignoring them can leave you with beliefs that don't work very well.[^3]
Carnap (the program) is written in Haskell, a statically-typed functional
programming language that uses a theory of logical types to ensure code
correctness.
[^2]: What does this mean? Well, rather than writing code that explains *how* to
check whether an inference is an instance of a particular rule, you just say
what the rule *is*, by expressing it as a scheme. You can see some examples of
rule-declarations for propositional logic
[here](https://github.com/gleachkr/Carnap/blob/master/Calculi/ClassicalSententialLogic1.hs).
[^3]: See, for example [@Anonymous:yTMf3RXg].
#Usage
There are lots of ways to use Carnap, but right now, the options below are the
best developed. You can find downloads and detailed set-up instructions on our
[github page](https://github.com/gleachkr/Carnap).
##With Pandoc
Carnap can be used to insert interactive proofs into a document written in
Pandoc markdown and translated into html. That's how this page was
created.[^4]
[^4]: The markdown source code for this page is available [here](index.pandoc).
##Webapps
Carnap can be embedded into webapps. One simple example is the application
available
[here](./Frontend/Ghcjs/Implementations/AllTheTautologies/dist/build/AllTheTautologies/AllTheTautologies.jsexe/index.html),
which generates an infinite list of tautologies that can be used to practice
derivations in propositional logic. Another simple example, available
[here](./Frontend/Ghcjs/Implementations/ShowThis/dist/build/ShowThis/ShowThis.jsexe/index.html)
, allows you to create a sharable list of problems in first-order logic, by
entering premises and conclusions; Carnap will check to see if you can
correctly derive the premises from the conclusions.
##Slides
Carnap is compatible with several frameworks for HTML presentations. So, you
can embed interactive proofs into the slides that you use for lectures or
presentations. A simple example---also generated using Pandoc[^5]---can be found [here](./slides.html)
[^5]: The source code for the example slides is available [here](./slides.pandoc).
#Development
Carnap is currently at version 0.1.0, and is under active development.
##Languages and Logics
In the near future, we hope to extend Carnap to cover a wider range of
languages, logics, and types of proof system, including modal and temporal
logic, languages with definite descriptions, and higher-order languages.
##Interface
We'd like to broaden the range of available interfaces. New webapps and
a command-line interface for batch-processing of proofs are on the way.
If you'd like to support Carnap, please consider starring us on
[github](http://github.com/gleachkr/Carnap). If you have suggestions, feature
requests, or bug-reports, you can create an issue on github. For general
questions, just get in touch on [gitter](https://gitter.im/gleachkr/Carnap),
or over [email]([email protected]).
If you use Carnap and you'd like to share what you've done, please feel free
to add links to materials you've created or to other information, on the
[Carnap wiki](https://github.com/gleachkr/Carnap/wiki). If you'd like to
contribute some code to the project---anything from a new unification
algorithm to a css tweak or pandoc template---just put in a pull request!
#References