-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
220 lines (220 loc) · 15.1 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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta name="generator" content="pandoc" />
<title>Carnap</title>
<style type="text/css">code{white-space: pre;}</style>
<link rel="stylesheet" href="./Frontend/Ghcjs/Implementations/Resources/MainPage.css" type="text/css" />
<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>
</head>
<body>
<header>
<ul>
<li><a target="_blank" href="https://github.com/gleachkr/Carnap">Github</a></li>
<li><a target="_blank" href="https://github.com/gleachkr/Carnap/wiki/Installation-and-Usage">Installation</a></li>
<li><a target="_blank" href="https://github.com/gleachkr/Carnap/wiki">Wiki</a></li>
</ul>
<div id="header">
<h1 class="title">Carnap</h1>
<h1 class="subtitle">an interactive proofchecker that runs in the browser</h1>
</div>
</header>
<article>
<div id="TOC">
<ul>
<li><a href="#introducing-carnap">Introducing Carnap</a><ul>
<li><a href="#what-is-it-for">What is it for?</a></li>
<li><a href="#why-carnap">Why “Carnap”?</a></li>
</ul></li>
<li><a href="#usage">Usage</a><ul>
<li><a href="#with-pandoc">With Pandoc</a></li>
<li><a href="#webapps">Webapps</a></li>
<li><a href="#slides">Slides</a></li>
</ul></li>
<li><a href="#development">Development</a><ul>
<li><a href="#languages-and-logics">Languages and Logics</a></li>
<li><a href="#interface">Interface</a></li>
<li><a href="#contributing">Contributing</a></li>
</ul></li>
<li><a href="#references">References</a></li>
</ul>
</div>
<!-- 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/>. -->
<blockquote>
<p>“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.</p>
<p>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. <em>Let us be cautious in making assertions and critical in examining them, but tolerant in permitting linguistic forms.</em>” <span class="citation">(Carnap 1940, Empiricism, Semantics and Ontology)</span></p>
</blockquote>
<h1 id="introducing-carnap">Introducing Carnap</h1>
<p>Carnap is a free and open-source<a href="#fn1" class="footnoteRef" id="fnref1"><sup>1</sup></a> 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.</p>
<p>Here are some interactive examples of what Carnap can do.</p>
<div class="slider">
<div>
<p>This is how you can prove Peirce’s theorem:</p>
<div id="proof1"><textarea class="lined SLproofbox 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</textarea></div>
<p>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.</p>
</div>
<div>
<p>Carnap can handle proofs in first order logic. Here’s a proof of Russell’s theorem.</p>
<div id="proof2"><textarea class="lined FOLproofbox 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</textarea></div>
</div>
<div>
<p>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).</p>
<div id="proof3"><textarea class="lined FOLproofbox 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</textarea></div>
</div>
<div>
<p>Goals can be attached to proof boxes, in order to embed exercises in interactive class materials</p>
<div id="gproof"><textarea class="lined SLproofbox slproof withGoal">P/\Q;P\/Q
P/\Q PR
P S 1
P\/Q ADD</textarea></div>
<p>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.</p>
<div id="gproof2"><textarea class="lined SLproofbox slproof withGoal">-P\/Q;P->Q
-P\/Q PR
Show P->Q
P PR
--P DN 3
Q MTP 4 1
:CD </textarea></div>
</div>
<div>
<p>The way that Carnap parses its input is configurable. So, one can enter proofs in either a Kalish-and-Montegue-like format:</p>
<div id="proof4"><textarea class="lined SLproofbox slproof">Show P=>(Q=>P)
P PR
Show Q=>P
Q PR
:CD 2
:CD 3</textarea></div>
<p>or a Fitch-like format:</p>
<div id="proof5"><textarea class="lined SLproofbox slproof fitch"> P AS
Q AS
P R 1
Q->P CD 2-3
P->(Q->P) CD 1-4</textarea></div>
<p>(depending on your preference, or the style of textbook you’re working with).</p>
</div>
<div>
<p>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:</p>
<div id="proof6"><textarea class="lined FOLproofbox folproof">Ax(Man(x)=>Mortal(x)) PR
Man(Socrates) PR
Man(Socrates) => Mortal(Socrates) UI 1
Mortal(Socrates) MP 2,3</textarea></div>
<p>And a strict mode, which permits a more compact “parentheses optional” syntax:</p>
<div id="proof7"><textarea class="lined FOLproofbox folproof strict">Ax(Px=>Qx) PR
Ps PR
Ps => Qs UI 1
Qs MP 2,3</textarea></div>
<p>more parsers (e.g. for controlled fragments of English and whitespace agnostic input formats) are underway.</p>
</div>
</div>
<p>Carnap’s core algorithms are language agnostic and highly extensible, so this is just the beginning.</p>
<h2 id="what-is-it-for">What is it for?</h2>
<p>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.</p>
<h2 id="why-carnap">Why “Carnap”?</h2>
<p>Carnap is named after <a href="https://en.wikipedia.org/wiki/Rudolf_Carnap">Rudolf Carnap</a>, the philosopher quoted above.</p>
<p>Carnap (the philosopher) famously advocated a tolerant and experimental approach to logic. Carnap (the program) is pluralistic by design. Inference rules are specified declaratively,<a href="#fn2" class="footnoteRef" id="fnref2"><sup>2</sup></a> 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.</p>
<p>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.<a href="#fn3" class="footnoteRef" id="fnref3"><sup>3</sup></a> Carnap (the program) is written in Haskell, a statically-typed functional programming language that uses a theory of logical types to ensure code correctness.</p>
<h1 id="usage">Usage</h1>
<p>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 <a href="https://github.com/gleachkr/Carnap">github page</a>.</p>
<h2 id="with-pandoc">With Pandoc</h2>
<p>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.<a href="#fn4" class="footnoteRef" id="fnref4"><sup>4</sup></a></p>
<h2 id="webapps">Webapps</h2>
<p>Carnap can be embedded into webapps. One simple example is the application available <a href="./Frontend/Ghcjs/Implementations/AllTheTautologies/dist/build/AllTheTautologies/AllTheTautologies.jsexe/index.html">here</a>, which generates an infinite list of tautologies that can be used to practice derivations in propositional logic. Another simple example, available <a href="./Frontend/Ghcjs/Implementations/ShowThis/dist/build/ShowThis/ShowThis.jsexe/index.html">here</a> , 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.</p>
<h2 id="slides">Slides</h2>
<p>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<a href="#fn5" class="footnoteRef" id="fnref5"><sup>5</sup></a>—can be found <a href="./slides.html">here</a></p>
<h1 id="development">Development</h1>
<p>Carnap is currently at version 0.1.0, and is under active development.</p>
<h2 id="languages-and-logics">Languages and Logics</h2>
<p>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.</p>
<h2 id="interface">Interface</h2>
<p>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.</p>
<h2 id="contributing">Contributing</h2>
<p>If you’d like to support Carnap, please consider starring us on <a href="http://github.com/gleachkr/Carnap">github</a>. If you have suggestions, feature requests, or bug-reports, you can create an issue on github. For general questions, just get in touch on <a href="https://gitter.im/gleachkr/Carnap">gitter</a>, or over <a href="[email protected]">email</a>.</p>
<p>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 <a href="https://github.com/gleachkr/Carnap/wiki">Carnap wiki</a>. 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!</p>
<h1 id="references" class="references unnumbered">References</h1>
<p>Carnap, Rudolf. 1932. “The Elimination of Metaphysics Through Logical Analysis of Language.” In <em>Logical Positivism</em>, 60–81.</p>
<p>———. 1940. “<strong>Empiricism, Semantics, and Ontology</strong>.” <em>Revue Internationale de Philosophie</em> 4: 20–40.</p>
<div class="footnotes">
<hr />
<ol>
<li id="fn1"><p>Carnap is released under the GNU General Public Licence, and is also available without charge to anyone who would like to use it.<a href="#fnref1">↩</a></p></li>
<li id="fn2"><p>What does this mean? Well, rather than writing code that explains <em>how</em> to check whether an inference is an instance of a particular rule, you just say what the rule <em>is</em>, by expressing it as a scheme. You can see some examples of rule-declarations for propositional logic <a href="https://github.com/gleachkr/Carnap/blob/master/Calculi/ClassicalSententialLogic1.hs">here</a>.<a href="#fnref2">↩</a></p></li>
<li id="fn3"><p>See, for example <span class="citation">(Carnap 1932)</span>.<a href="#fnref3">↩</a></p></li>
<li id="fn4"><p>The markdown source code for this page is available <a href="index.pandoc">here</a>.<a href="#fnref4">↩</a></p></li>
<li id="fn5"><p>The source code for the example slides is available <a href="./slides.pandoc">here</a>.<a href="#fnref5">↩</a></p></li>
</ol>
</div>
<p> This project was made possible by the support of the <a href="https://www.lib.k-state.edu/open-textbook">Open Textbook Initiative</a> at Kansas State University</p>
</article>
</body>
</html>